@techdocs/cli 1.3.2-next.2 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/cjs/{generate-103520bb.cjs.js → generate-2111f828.cjs.js} +11 -2
- package/dist/cjs/generate-2111f828.cjs.js.map +1 -0
- package/dist/cjs/{mkdocs-1501e940.cjs.js → mkdocs-452eb543.cjs.js} +13 -1
- package/dist/cjs/mkdocs-452eb543.cjs.js.map +1 -0
- package/dist/cjs/{serve-ca27a9de.cjs.js → serve-5138af76.cjs.js} +17 -5
- package/dist/cjs/serve-5138af76.cjs.js.map +1 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{5837.51740a39.chunk.js → 5837.239cccbd.chunk.js} +1 -1
- package/dist/embedded-app/static/{5837.51740a39.chunk.js.map → 5837.239cccbd.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{6051.e3b445b2.chunk.js → 6051.66d9ff08.chunk.js} +1 -1
- package/dist/embedded-app/static/{6051.e3b445b2.chunk.js.map → 6051.66d9ff08.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7560.ecd330c0.chunk.js → 7560.3487acce.chunk.js} +1 -1
- package/dist/embedded-app/static/{7560.ecd330c0.chunk.js.map → 7560.3487acce.chunk.js.map} +1 -1
- package/dist/embedded-app/static/7670.5e26cab8.chunk.js +3 -0
- package/dist/embedded-app/static/7670.5e26cab8.chunk.js.map +1 -0
- package/dist/embedded-app/static/{7750.0502b5b8.chunk.js → 7750.6d01f7cb.chunk.js} +1 -1
- package/dist/embedded-app/static/{7750.0502b5b8.chunk.js.map → 7750.6d01f7cb.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{8951.3e2e38b8.chunk.js → 8951.fbe78c62.chunk.js} +1 -1
- package/dist/embedded-app/static/{8951.3e2e38b8.chunk.js.map → 8951.fbe78c62.chunk.js.map} +1 -1
- package/dist/embedded-app/static/main.a942e8cf.js +503 -0
- package/dist/embedded-app/static/main.a942e8cf.js.map +1 -0
- package/dist/embedded-app/static/{runtime.abaaf437.js → runtime.a942e8cf.js} +2 -2
- package/dist/embedded-app/static/{runtime.abaaf437.js.map → runtime.a942e8cf.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.abaaf437.js → vendor.a942e8cf.js} +1 -1
- package/dist/embedded-app/static/{vendor.abaaf437.js.map → vendor.a942e8cf.js.map} +1 -1
- package/dist/index.cjs.js +16 -4
- package/dist/index.cjs.js.map +1 -1
- package/package.json +5 -5
- package/dist/cjs/generate-103520bb.cjs.js.map +0 -1
- package/dist/cjs/mkdocs-1501e940.cjs.js.map +0 -1
- package/dist/cjs/serve-ca27a9de.cjs.js.map +0 -1
- package/dist/embedded-app/static/7670.3857b377.chunk.js +0 -3
- package/dist/embedded-app/static/7670.3857b377.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.abaaf437.js +0 -503
- package/dist/embedded-app/static/main.abaaf437.js.map +0 -1
|
@@ -0,0 +1,503 @@
|
|
|
1
|
+
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{29644:function(At,Be,t){"use strict";t.d(Be,{n3:function(){return m},MS:function(){return S}});var h=t(25271),n=t(23054),W=t(96279),O=t.n(W);const m=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class S{async getEntityAncestors(P,oe){const{kind:_,namespace:te,name:B}=(0,h.of)(P.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(_)}/${encodeURIComponent(te)}/${encodeURIComponent(B)}/ancestry`,oe)}async getLocationById(P,oe){return await this.requestOptional("GET",`/locations/${encodeURIComponent(P)}`,oe)}async getEntities(P,oe){const{filter:_=[],fields:te=[],order:B,offset:I,limit:K,after:ce}=P!=null?P:{},se=[];for(const R of[_].flat()){const C=[];for(const[X,Se]of Object.entries(R))for(const Ge of[Se].flat())Ge===m?C.push(encodeURIComponent(X)):typeof Ge=="string"&&C.push(`${encodeURIComponent(X)}=${encodeURIComponent(Ge)}`);C.length&&se.push(`filter=${C.join(",")}`)}if(te.length&&se.push(`fields=${te.map(encodeURIComponent).join(",")}`),B)for(const R of[B].flat())R&&se.push(`order=${encodeURIComponent(R.order)}:${encodeURIComponent(R.field)}`);I!==void 0&&se.push(`offset=${I}`),K!==void 0&&se.push(`limit=${K}`),ce!==void 0&&se.push(`after=${encodeURIComponent(ce)}`);const $=se.length?`?${se.join("&")}`:"",T=await this.requestRequired("GET",`/entities${$}`,oe),z=(R,C)=>{var X,Se;if(((X=R.metadata)===null||X===void 0?void 0:X.name)===void 0||R.kind===void 0||((Se=C.metadata)===null||Se===void 0?void 0:Se.name)===void 0||C.kind===void 0)return 0;const Ge=(0,h.eE)(R),Ye=(0,h.eE)(C);return Ge<Ye?-1:Ge>Ye?1:0};return{items:T.sort(z)}}async getEntitiesByRefs(P,oe){var _;const te={entityRefs:P.entityRefs};!((_=P.fields)===null||_===void 0)&&_.length&&(te.fields=P.fields);const I=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,K=await this.fetchApi.fetch(I,{headers:{"Content-Type":"application/json",...(oe==null?void 0:oe.token)&&{Authorization:`Bearer ${oe==null?void 0:oe.token}`}},method:"POST",body:JSON.stringify(te)});if(!K.ok)throw await n.VL.fromResponse(K);const{items:ce}=await K.json();return{items:ce}}async getEntityByRef(P,oe){const{kind:_,namespace:te,name:B}=(0,h.of)(P);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(_)}/${encodeURIComponent(te)}/${encodeURIComponent(B)}`,oe)}async getEntityByName(P,oe){const{kind:_,namespace:te="default",name:B}=P;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(_)}/${encodeURIComponent(te)}/${encodeURIComponent(B)}`,oe)}async refreshEntity(P,oe){const _=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(oe==null?void 0:oe.token)&&{Authorization:`Bearer ${oe==null?void 0:oe.token}`}},method:"POST",body:JSON.stringify({entityRef:P})});if(_.status!==200)throw new Error(await _.text())}async getEntityFacets(P,oe){const{filter:_=[],facets:te}=P,B=[];for(const K of[_].flat()){const ce=[];for(const[se,$]of Object.entries(K))for(const T of[$].flat())T===m?ce.push(encodeURIComponent(se)):typeof T=="string"&&ce.push(`${encodeURIComponent(se)}=${encodeURIComponent(T)}`);ce.length&&B.push(`filter=${ce.join(",")}`)}for(const K of te)B.push(`facet=${encodeURIComponent(K)}`);const I=B.length?`?${B.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${I}`,oe)}async addLocation(P,oe){const{type:_="url",target:te,dryRun:B}=P,I=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${B?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(oe==null?void 0:oe.token)&&{Authorization:`Bearer ${oe==null?void 0:oe.token}`}},method:"POST",body:JSON.stringify({type:_,target:te})});if(I.status!==201)throw new Error(await I.text());const{location:K,entities:ce,exists:se}=await I.json();if(!K)throw new Error(`Location wasn't added: ${te}`);return{location:K,entities:ce,exists:se}}async getLocationByRef(P,oe){return(await this.requestRequired("GET","/locations",oe)).map(te=>te.data).find(te=>P===(0,h.NZ)(te))}async removeLocationById(P,oe){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(P)}`,oe)}async removeEntityByUid(P,oe){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(P)}`,oe)}async validateEntity(P,oe,_){const te=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(_==null?void 0:_.token)&&{Authorization:`Bearer ${_==null?void 0:_.token}`}},method:"POST",body:JSON.stringify({entity:P,location:oe})});if(te.ok)return{valid:!0};if(te.status!==400)throw await n.VL.fromResponse(te);const{errors:B=[]}=await te.json();return{valid:!1,errors:B}}async requestIgnored(P,oe,_){const te=`${await this.discoveryApi.getBaseUrl("catalog")}${oe}`,B=_!=null&&_.token?{Authorization:`Bearer ${_.token}`}:{},I=await this.fetchApi.fetch(te,{method:P,headers:B});if(!I.ok)throw await n.VL.fromResponse(I)}async requestRequired(P,oe,_){const te=`${await this.discoveryApi.getBaseUrl("catalog")}${oe}`,B=_!=null&&_.token?{Authorization:`Bearer ${_.token}`}:{},I=await this.fetchApi.fetch(te,{method:P,headers:B});if(!I.ok)throw await n.VL.fromResponse(I);return await I.json()}async requestOptional(P,oe,_){const te=`${await this.discoveryApi.getBaseUrl("catalog")}${oe}`,B=_!=null&&_.token?{Authorization:`Bearer ${_.token}`}:{},I=await this.fetchApi.fetch(te,{method:P,headers:B});if(!I.ok){if(I.status===404)return;throw await n.VL.fromResponse(I)}return await I.json()}constructor(P){this.discoveryApi=P.discoveryApi,this.fetchApi=P.fetchApi||{fetch:O()}}}},25271:function(At,Be,t){"use strict";t.d(Be,{Tf:function(){return W},P1:function(){return An},q1:function(){return ge},M6:function(){return re},l2:function(){return n},zG:function(){return h},w$:function(){return Sn},nP:function(){return Fn},aS:function(){return Mn},S4:function(){return Gt},cz:function(){return Un},iB:function(){return $e},CV:function(){return pt},of:function(){return ht},Ou:function(){return Ze},eE:function(){return gt},NZ:function(){return _e}});const h="default",n="backstage.io/view-url",W="backstage.io/edit-url",O="kubernetes.io/api-server",m="kubernetes.io/api-server-certificate-authority",S="kubernetes.io/auth-provider";var l=t(76635),P=t.n(l);class oe{async enforce(F){return F.metadata.namespace?F:lodash.merge({metadata:{namespace:this.namespace}},F)}constructor(F=DEFAULT_NAMESPACE){this.namespace=F}}class _{static isValidPrefixAndOrSuffix(F,he,Re,et){if(typeof F!="string")return!1;const Ue=F.split(he);return Ue.length===1?et(Ue[0]):Ue.length===2?Re(Ue[0])&&et(Ue[1]):!1}static isJsonSafe(F){try{return P().isEqual(F,JSON.parse(JSON.stringify(F)))}catch{return!1}}static isValidDnsSubdomain(F){return typeof F=="string"&&F.length>=1&&F.length<=253&&F.split(".").every(_.isValidDnsLabel)}static isValidDnsLabel(F){return typeof F=="string"&&F.length>=1&&F.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(F)}static isValidTag(F){return typeof F=="string"&&F.length>=1&&F.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(F)}static isValidUrl(F){if(typeof F!="string")return!1;try{return new URL(F),!0}catch{return!1}}static isValidString(F){var he;return typeof F=="string"&&((he=F==null?void 0:F.trim())===null||he===void 0?void 0:he.length)>=1}static isNonEmptyString(F){var he;return typeof F=="string"&&((he=F==null?void 0:F.trim())===null||he===void 0?void 0:he.length)>=1}}var te=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}}}}}'),B=t(27991),I=t.n(B),K=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"}}}`),ce=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityMeta","description":"Metadata fields common to all versions/kinds of entity.","examples":[{"uid":"e01199ab-08cc-44c2-8e19-5c29ded82521","etag":"lsndfkjsndfkjnsdfkjnsd==","name":"my-component-yay","namespace":"the-namespace","labels":{"backstage.io/custom":"ValueStuff"},"annotations":{"example.com/bindings":"are-secret"},"tags":["java","data"]}],"type":"object","required":["name"],"additionalProperties":true,"properties":{"uid":{"type":"string","description":"A globally unique ID for the entity. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, but the server is free to reject requests that do so in such a way that it breaks semantics.","examples":["e01199ab-08cc-44c2-8e19-5c29ded82521"],"minLength":1},"etag":{"type":"string","description":"An opaque string that changes for each update operation to any part of the entity, including metadata. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, and the server will then reject the operation if it does not match the current stored value.","examples":["lsndfkjsndfkjnsdfkjnsd=="],"minLength":1},"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1},"title":{"type":"string","description":"A display name of the entity, to be presented in user interfaces instead of the name property, when available.","examples":["React SSR Template"],"minLength":1},"description":{"type":"string","description":"A short (typically relatively few words, on one line) description of the entity."},"labels":{"type":"object","description":"Key/value pairs of identifying information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"annotations":{"type":"object","description":"Key/value pairs of non-identifying auxiliary information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"tags":{"type":"array","description":"A list of single-valued strings, to for example classify catalog entities in various ways.","items":{"type":"string","minLength":1}},"links":{"type":"array","description":"A list of external hyperlinks related to the entity. Links can provide additional contextual information that may be located outside of Backstage itself. For example, an admin dashboard or external CMS page.","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://admin.example-org.com"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["Admin Dashboard"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"type":{"type":"string","description":"An optional value to categorize links into specific groups.","examples":["runbook","documentation","logs","dashboard"],"minLength":1}}}}}}'),se=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"common","type":"object","description":"Common definitions to import from other schemas","definitions":{"reference":{"$id":"#reference","type":"object","description":"A reference by name to another entity.","required":["kind","namespace","name"],"additionalProperties":false,"properties":{"kind":{"type":"string","description":"The kind field of the entity.","minLength":1},"namespace":{"type":"string","description":"The metadata.namespace field of the entity.","minLength":1},"name":{"type":"string","description":"The metadata.name field of the entity.","minLength":1}}},"relation":{"$id":"#relation","type":"object","description":"A directed relation from one entity to another.","required":["type","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 $=new Map,T=[te,K,ce,se];function z(ue){if(!(ue!=null&&ue.length))throw new TypeError("Unknown error");const F=ue[0];throw new TypeError(`${F.instancePath||"<root>"} ${F.message}${F.params?` - ${Object.entries(F.params).map(([he,Re])=>`${he}: ${Re}`).join(", ")}`:""}`)}function R(ue,F={}){var he;const Re=(he=F==null?void 0:F.disableCache)!==null&&he!==void 0?he:!1,et=Re?"":JSON.stringify(ue);if(!Re){const Jt=$.get(et);if(Jt)return Jt}const Ue=C(ue),Et=new(I())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});Ue.length&&Et.addSchema(Ue,void 0,void 0,!0);const Vt=Et.compile(ue);return Re||$.set(et,Vt),Vt}function C(ue){if(typeof ue!="object")return[];const F=new Set;ue.$id&&F.add(ue.$id);const he=new Array,Re=[ue];for(;Re.length;){const et=Re.pop();for(const Ue of X(et))if(!F.has(Ue)){F.add(Ue);const Et=T.find(Vt=>Vt.$id===Ue);Et&&(he.push(Et),Re.push(Et))}}return he}function*X(ue){const F=[ue];for(;F.length;){const he=F.pop();if(typeof he=="object"&&he)for(const[Re,et]of Object.entries(he))Re==="$ref"&&typeof et=="string"?yield et.split("#")[0]:F.push(et)}}function Se(ue){const F=compileAjvSchema(ue||entityEnvelopeSchema);return he=>{if(F(he)===!0)return he;throw throwAjvError(F.errors)}}function Ge(ue){const F=R(ue);return he=>{var Re;if(F(he)===!0)return he;const Ue=(Re=F.errors)===null||Re===void 0?void 0:Re.filter(Et=>["/kind","/apiVersion"].includes(Et.instancePath));if((Ue==null?void 0:Ue.length)&&Ue.every(Et=>Et.keyword==="enum"))return!1;throw z(F.errors)}}function Ye(ue){const F=compileAjvSchema(ue||entitySchema);return he=>{if(F(he)===!0)return he;throw throwAjvError(F.errors)}}class dt{static isValidApiVersion(F){return _.isValidPrefixAndOrSuffix(F,"/",_.isValidDnsSubdomain,he=>he.length>=1&&he.length<=63&&/^[a-z0-9A-Z]+$/.test(he))}static isValidKind(F){return typeof F=="string"&&F.length>=1&&F.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(F)}static isValidObjectName(F){return typeof F=="string"&&F.length>=1&&F.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(F)}static isValidNamespace(F){return _.isValidDnsLabel(F)}static isValidLabelKey(F){return _.isValidPrefixAndOrSuffix(F,"/",_.isValidDnsSubdomain,dt.isValidObjectName)}static isValidLabelValue(F){return F===""||dt.isValidObjectName(F)}static isValidAnnotationKey(F){return _.isValidPrefixAndOrSuffix(F,"/",_.isValidDnsSubdomain,dt.isValidObjectName)}static isValidAnnotationValue(F){return typeof F=="string"}}const ze={isValidApiVersion:dt.isValidApiVersion,isValidKind:dt.isValidKind,isValidEntityName:dt.isValidObjectName,isValidNamespace:dt.isValidNamespace,isValidLabelKey:dt.isValidLabelKey,isValidLabelValue:dt.isValidLabelValue,isValidAnnotationKey:dt.isValidAnnotationKey,isValidAnnotationValue:dt.isValidAnnotationValue,isValidTag:ue=>typeof ue=="string"&&ue.length>=1&&ue.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(ue)};function at(ue={}){return{...ze,...ue}}class ot{async enforce(F){function he(w,D,G){if(D==null)throw new Error(`${w} must have a value`);let de;try{de=G(D)}catch(pe){throw new Error(`${w} could not be validated, ${pe}`)}if(!de){let pe;switch(G.name){case"isValidLabelValue":case"isValidObjectName":pe="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":pe="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":pe="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":pe="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":pe="a string";break;case"isValidKind":pe="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":pe="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":pe="a non empty string";break;default:pe=void 0;break}const Ee=pe?` expected ${pe} but found "${D}".`:"";throw new Error(`"${w}" is not valid;${Ee} 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 Re(w,D,G){return D===void 0||he(w,D,G)}he("apiVersion",F.apiVersion,this.validators.isValidApiVersion),he("kind",F.kind,this.validators.isValidKind),he("metadata.name",F.metadata.name,this.validators.isValidEntityName),Re("metadata.namespace",F.metadata.namespace,this.validators.isValidNamespace);var et;for(const[w,D]of Object.entries((et=F.metadata.labels)!==null&&et!==void 0?et:[]))he(`labels.${w}`,w,this.validators.isValidLabelKey),he(`labels.${w}`,D,this.validators.isValidLabelValue);var Ue;for(const[w,D]of Object.entries((Ue=F.metadata.annotations)!==null&&Ue!==void 0?Ue:[]))he(`annotations.${w}`,w,this.validators.isValidAnnotationKey),he(`annotations.${w}`,D,this.validators.isValidAnnotationValue);var Et;const Vt=(Et=F.metadata.tags)!==null&&Et!==void 0?Et:[];for(let w=0;w<Vt.length;++w)he(`tags.${w}`,Vt[w],this.validators.isValidTag);var Jt;const Xt=(Jt=F.metadata.links)!==null&&Jt!==void 0?Jt:[];for(let w=0;w<Xt.length;++w){var q,H,g;he(`links.${w}.url`,(q=Xt[w])===null||q===void 0?void 0:q.url,CommonValidatorFunctions.isValidUrl),Re(`links.${w}.title`,(H=Xt[w])===null||H===void 0?void 0:H.title,CommonValidatorFunctions.isNonEmptyString),Re(`links.${w}.icon`,(g=Xt[w])===null||g===void 0?void 0:g.icon,KubernetesValidatorFunctions.isValidObjectName)}return F}constructor(F=makeValidator()){this.validators=F}}class Ke{async enforce(F){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(F)===!0)return F;const[Re]=this.validate.errors||[];throw Re?new Error(`Malformed envelope, ${Re.instancePath||"<root>"} ${Re.message}`):new Error("Malformed envelope, Unknown error")}}function Qe(ue){let F=ue.indexOf(":");const he=ue.indexOf("/");he!==-1&&he<F&&(F=-1);const Re=F===-1?void 0:ue.slice(0,F),et=he===-1?void 0:ue.slice(F+1,he),Ue=ue.slice(Math.max(F+1,he+1));if(Re===""||et===""||Ue==="")throw new TypeError(`Entity reference "${ue}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Re,namespace:et,name:Ue}}function $e(ue){return{kind:ue.kind,namespace:ue.metadata.namespace||h,name:ue.metadata.name}}function ht(ue,F){if(!ue)throw new Error("Entity reference must not be empty");const he=F==null?void 0:F.defaultKind,Re=(F==null?void 0:F.defaultNamespace)||h;let et,Ue,Et;if(typeof ue=="string"){const H=Qe(ue);var Vt;et=(Vt=H.kind)!==null&&Vt!==void 0?Vt:he;var Jt;Ue=(Jt=H.namespace)!==null&&Jt!==void 0?Jt:Re,Et=H.name}else{var Xt;et=(Xt=ue.kind)!==null&&Xt!==void 0?Xt:he;var q;Ue=(q=ue.namespace)!==null&&q!==void 0?q:Re,Et=ue.name}if(et)if(Ue){if(!Et){const H=JSON.stringify(ue);throw new Error(`Entity reference ${H} had missing or empty name`)}}else{const H=JSON.stringify(ue);throw new Error(`Entity reference ${H} had missing or empty namespace`)}else{const H=JSON.stringify(ue);throw new Error(`Entity reference ${H} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:et,namespace:Ue,name:Et}}function gt(ue){let F,he,Re;if("metadata"in ue){F=ue.kind;var et;he=(et=ue.metadata.namespace)!==null&&et!==void 0?et:h,Re=ue.metadata.name}else{F=ue.kind;var Ue;he=(Ue=ue.namespace)!==null&&Ue!==void 0?Ue:h,Re=ue.name}return`${F.toLocaleLowerCase("en-US")}:${he.toLocaleLowerCase("en-US")}/${Re.toLocaleLowerCase("en-US")}`}class Ct{async enforce(F){let he=F;for(const Re of this.policies){const et=await Re.enforce(he);if(!et)throw new Error(`Policy ${Re.constructor.name} did not return a result`);he=et}return he}constructor(F){this.policies=F}}class $t{async enforce(F){for(const he of this.policies){const Re=await he.enforce(F);if(Re)return Re}throw new Error("The entity did not match any known policy")}constructor(F){this.policies=F}}const Lt={allOf(ue){return new Ct(ue)},oneOf(ue){return new $t(ue)}};var We=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 me(ue){let F;return{async check(he){return F||(F=Ge(ue)),F(he)===he}}}const Le=me(We);var Pe=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ComponentV1alpha1","description":"A Component describes a software component. It is typically intimately linked to the source code that constitutes the component, and should be what a developer may regard a \\"unit of software\\", usually with a distinct deployable or linkable artifact.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Component"]},"spec":{"type":"object","required":["type","lifecycle","owner"],"properties":{"type":{"type":"string","description":"The type of component.","examples":["service","website","library"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the component.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the component belongs to.","minLength":1},"subcomponentOf":{"type":"string","description":"An entity reference to another component of which the component is a part.","minLength":1},"providesApis":{"type":"array","description":"An array of entity references to the APIs that are provided by the component.","items":{"type":"string","minLength":1}},"consumesApis":{"type":"array","description":"An array of entity references to the APIs that are consumed by the component.","items":{"type":"string","minLength":1}},"dependsOn":{"type":"array","description":"An array of references to other entities that the component depends on to function.","items":{"type":"string","minLength":1}}}}}}]}');const Fe=me(Pe);var tt=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 Zt=me(tt);var xt=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 wt=me(xt);var bt=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 Pt=me(bt),Gt="ownedBy",Yt="ownerOf",an="consumesApi",Mt="apiConsumedBy",hn="providesApi",bn="apiProvidedBy",Fn="dependsOn",Sn="dependencyOf",kn="parentOf",En="childOf",ln="memberOf",tn="hasMember",Un="partOf",Mn="hasPart";var On=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 Bn=me(On);var pn=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 mn=me(pn);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 Cn=me(Hn),An="backstage.io/managed-by-location",ge="backstage.io/managed-by-origin-location",re="backstage.io/source-location",je=/^[\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 Ze(ue){if(typeof ue!="string")throw new TypeError(`Unable to parse location ref '${ue}', unexpected argument ${typeof ue}`);const F=ue.indexOf(":");if(F<0)throw new TypeError(`Unable to parse location ref '${ue}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const he=ue.substring(0,F).trim(),Re=ue.substring(F+1).trim();if(!he||!Re)throw new TypeError(`Unable to parse location ref '${ue}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(he==="http"||he==="https")throw new TypeError(`Invalid location ref '${ue}', please prefix it with 'url:', e.g. 'url:${ue}'`);if(je.test(Re))throw new TypeError(`Invalid location ref '${ue}', target is a javascript: URL`);return{type:he,target:Re}}function _e(ue){const{type:F,target:he}=ue;if(F){if(!he)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");if(je.test(he))throw new TypeError(`Invalid location ref '${F}:${he}', target is a javascript: URL`);return`${F}:${he}`}function pt(ue){var F,he,Re,et,Ue;const Et=(Ue=(F=ue.metadata)===null||F===void 0||(he=F.annotations)===null||he===void 0?void 0:he[re])!==null&&Ue!==void 0?Ue:(Re=ue.metadata)===null||Re===void 0||(et=Re.annotations)===null||et===void 0?void 0:et[An];if(!Et)throw new Error(`Entity '${gt(ue)}' is missing location`);return Ze(Et)}},23196:function(At,Be,t){"use strict";t.d(Be,{zx:function(){return Qe},Oi:function(){return Fe},VY:function(){return Ui},yW:function(){return tl},XF:function(){return xt},mn:function(){return F},NX:function(){return h},ub:function(){return w},mf:function(){return il},yu:function(){return j},h4:function(){return Qi},M6:function(){return Yr},i9:function(){return vl},aR:function(){return Mi},rJ:function(){return Rr},Oh:function(){return wl},hu:function(){return bl},rU:function(){return at},nU:function(){return qn},SA:function(){return go},sk:function(){return Tt},Or:function(){return So},T3:function(){return qi},g9:function(){return Al},Ex:function(){return mr},Gk:function(){return A},tn:function(){return zi},Ph:function(){return or},YE:function(){return ri},v7:function(){return fa},R6:function(){return Cs},tR:function(){return ti},uw:function(){return Ta},qt:function(){return Ri},iA:function(){return Xi},GB:function(){return vn},po:function(){return hr},mZ:function(){return zo},Pf:function(){return Wr}});var h={};t.r(h),t.d(h,{Nm:function(){return wt},ht:function(){return Gt},LJ:function(){return Pt}});var n=t(52322),W=t(25248),O=t(19928),m=t(2784);function S(e){const[o,a]=useState([]),d=useApi(alertApiRef),{anchorOrigin:p={vertical:"top",horizontal:"center"},transientTimeoutMs:y}=e,E=y!=null?y:5e3;useEffect(()=>{const M=d.alert$().subscribe(fe=>a(ae=>ae.concat(fe)));return()=>{M.unsubscribe()}},[d]);const[U]=o;if(useEffect(()=>{if(U&&U.display==="transient"){const M=setTimeout(()=>{a(fe=>{const ae=fe.filter(ye=>ye!==U);return ae.length===fe.length?fe:ae})},E);return()=>clearTimeout(M)}},[U,E]),o.length===0)return null;const Y=()=>{a(M=>M.filter(fe=>fe!==U))};return _jsx(Snackbar,{open:!0,anchorOrigin:p,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:Y,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:U.severity,children:_jsxs(Typography,{component:"span",children:[String(U.message),o.length>1&&_jsx("em",{children:` (${o.length-1} older ${pluralize("message",o.length-1)})`})]})})})}var l=t(79692),P=t(12420);const oe=(0,l.Z)(e=>(0,P.Z)({avatar:{width:"4rem",height:"4rem",color:"#fff"},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function _(e){const{displayName:o,picture:a,customStyles:d}=e,p=oe();let y={...d};const E={fontFamily:y.fontFamily,fontSize:y.fontSize,fontWeight:y.fontWeight};return a||(y={backgroundColor:stringToColor(o||""),...d}),_jsx(MaterialAvatar,{alt:o,src:a,className:p.avatar,style:y,children:o&&_jsx(Typography,{variant:"h6",component:"span",className:p.avatarText,style:E,children:extractInitials(o)})})}var te=t(77277),B=t(86689),I=t(90436),K=t(72779),ce=t.n(K),se=t(76635),$=t(79635),T=t(39857);function z(){const[e]=(0,$.is)((0,n.jsx)($.AW,{index:!0,element:(0,n.jsx)("div",{})}));return!e.index}const R=(0,l.Z)({visuallyHidden:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",height:1,width:1},externalLink:{position:"relative"}},{name:"Link"}),C=e=>/^([a-z+.-]+):/.test(e),X=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i,Se=window.open;if(Se&&!Se.__backstage){const e=function(...a){const d=String(a[0]);if(X.test(d))throw new Error("Rejected window.open() with a javascript: URL as a security precaution");return Se.apply(this,a)};e.__backstage=!0,window.open=e}const Ge=()=>{try{return(0,W.h_)(W.Ds).getOptionalString("app.baseUrl")}catch{return}},Ye=()=>{const e="http://sample.dev";var o;const a=(o=Ge())!==null&&o!==void 0?o:"/",{pathname:d}=new URL(a,e);return(0,se.trimEnd)(d,"/")},dt=e=>{let o=String(e);const a=Ye(),d=C(o),p=o.startsWith(a);return!d&&!p&&(o=a.concat(o)),o},ze=e=>{if(e instanceof Array)return e.map(ze).join(" ").trim();if(typeof e=="object"&&e){var o;return ze(e==null||(o=e.props)===null||o===void 0?void 0:o.children)}return["string","number"].includes(typeof e)?String(e):""},at=m.forwardRef(({onClick:e,noTrack:o,...a},d)=>{const p=R(),y=(0,W.z$)(),E=z()?dt(a.to):a.to,U=ze(a.children)||E,Y=C(E),M=Y&&!!/^https?:/.exec(E);if(X.test(E))throw new Error("Link component rejected javascript: URL as a security precaution");const fe=ae=>{e==null||e(ae),o||y.captureEvent("click",U,{attributes:{to:E}})};return Y?(0,n.jsxs)(B.Z,{...M?{target:"_blank",rel:"noopener"}:{},...a,ref:d,href:E,onClick:fe,className:ce()(p.externalLink,a.className),children:[a.children,(0,n.jsx)(I.Z,{component:"span",className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,n.jsx)(B.Z,{...a,ref:d,component:T.rU,to:E,onClick:fe})}),ot=m.forwardRef((e,o)=>(0,n.jsx)(at,{ref:o,...e,color:"initial"})),Qe=m.forwardRef((e,o)=>(0,n.jsx)(te.Z,{ref:o,component:ot,...e}));var $e=t(95544),ht=t(60364),gt=t(83229),Ct=t(26639),$t=t(39595),Lt=t(61837),We=t(80030),me=t(19353),Le=t(95074);function Pe(e){const{text:o,tooltipDelay:a=1e3,tooltipText:d="Text copied to clipboard","aria-label":p="Copy text"}=e,y=(0,W.h_)(W.VE),[E,U]=(0,m.useState)(!1),[{error:Y},M]=(0,Le.Z)();(0,m.useEffect)(()=>{Y&&y.post(Y)},[Y,y]);const fe=ae=>{ae.stopPropagation(),U(!0),M(o)};return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(We.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:a,onClose:()=>U(!1),open:E,children:(0,n.jsx)(Lt.Z,{onClick:fe,"aria-label":p,children:(0,n.jsx)(me.Z,{})})})})}function Fe(e){const{text:o,language:a,showLineNumbers:d=!1,highlightedNumbers:p,customStyle:y,showCopyCodeButton:E=!1}=e,U=(0,ht.Z)(),Y=U.palette.type==="dark"?Ct.Z:$t.Z,M=U.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,n.jsxs)($e.Z,{position:"relative",children:[(0,n.jsx)(gt.Z,{customStyle:y,language:a,style:Y,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:U.palette.textVerySubtle},lineProps:fe=>p!=null&&p.includes(fe)?{style:{backgroundColor:M}}:{},children:o}),E&&(0,n.jsx)($e.Z,{position:"absolute",top:0,right:0,children:(0,n.jsx)(Pe,{text:o})})]})}var tt=t(41156),Zt=t(88188);function xt(e){const{title:o,to:a}=e,d=(0,tt.Z)(p=>p.breakpoints.down("xs"));return a?d?(0,n.jsx)(Lt.Z,{component:T.rU,color:"primary",title:o,size:"small",to:a,children:(0,n.jsx)(Zt.Z,{})}):(0,n.jsx)(te.Z,{component:T.rU,variant:"contained",color:"primary",to:a,children:o}):null}var wt;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(wt||(wt={}));var bt;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(bt||(bt={}));var Pt;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(Pt||(Pt={}));var Gt;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(Gt||(Gt={}));var Yt=t(27397),an=t(11105),Mt=t(97963),hn=t(46506),bn=t.n(hn),Fn=t(54073),Sn=t.n(Fn),kn=t(10368);const En=(0,l.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function ln({node:{id:e}}){const o=En(),[a,d]=m.useState(0),[p,y]=m.useState(0),E=m.useRef(null);m.useLayoutEffect(()=>{if(E.current){let{height:fe,width:ae}=E.current.getBBox();fe=Math.round(fe),ae=Math.round(ae),(fe!==p||ae!==a)&&(d(ae),y(fe))}},[a,p]);const U=10,Y=a+U*2,M=p+U*2;return(0,n.jsxs)("g",{children:[(0,n.jsx)("rect",{className:o.node,width:Y,height:M,rx:10}),(0,n.jsx)("text",{ref:E,className:o.text,y:M/2,x:Y/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const tn="arrow-marker",Un="node",Mn="edge",On="label",Bn=(0,kn.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),pn=e=>(0,n.jsx)(ln,{...e});function mn({render:e=pn,setNode:o,node:a}){const{width:d,height:p,x:y=0,y:E=0}=a,U=a,Y=Bn(),M=m.useRef(null);return m.useLayoutEffect(()=>{if(M.current){let{height:fe,width:ae}=M.current.getBBox();fe=Math.round(fe),ae=Math.round(ae),(fe!==p||ae!==d)&&o(a.id,{...a,height:fe,width:ae})}},[a,d,p,o]),(0,n.jsx)("g",{ref:M,"data-testid":Un,className:Y.node,transform:`translate(${y-d/2},${E-p/2})`,children:e({node:U})})}var Hn=t(76985),Cn=t(39829),An=t(19574),ge=t.n(An);const re=(0,kn.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function je({edge:{label:e}}){const o=re();return(0,n.jsx)("text",{className:o.text,textAnchor:"middle",children:e})}const Ze=(0,kn.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"}),_e=e=>(0,n.jsx)(je,{...e});function pt({render:e=_e,setEdge:o,id:a,edge:d,curve:p}){const{x:y=0,y:E=0,width:U,height:Y,points:M}=d,fe=d,ae=Ze(),ye=m.useRef(null);m.useLayoutEffect(()=>{if(ye.current){let{height:Je,width:kt}=ye.current.getBBox();Je=Math.round(Je),kt=Math.round(kt),(Je!==Y||kt!==U)&&o(a,{...d,height:Je,width:kt})}},[d,Y,U,o,a]);let we="";const Me=m.useMemo(()=>Hn.Z().x(Je=>Je.x).y(Je=>Je.y).curve(Cn[p]),[p]);if(M){const Je=M.filter(kt=>ge()(kt.x)&&ge()(kt.y));we=Me(Je)||""}return(0,n.jsxs)(n.Fragment,{children:[we&&(0,n.jsx)("path",{"data-testid":Mn,className:ae.path,d:we}),fe.label?(0,n.jsx)("g",{ref:ye,"data-testid":On,className:ae.label,transform:`translate(${y},${E})`,children:e({edge:fe})}):null]})}const ue="workspace";function F(e){var o,a;const{edges:d,nodes:p,renderNode:y,direction:E=wt.TOP_BOTTOM,align:U,nodeMargin:Y=50,edgeMargin:M=10,rankMargin:fe=50,paddingX:ae=0,paddingY:ye=0,acyclicer:we,ranker:Me=Pt.NETWORK_SIMPLEX,labelPosition:Je=Gt.RIGHT,labelOffset:kt=10,edgeRanks:Qt=1,edgeWeight:nn=1,renderLabel:rn,defs:Ot,zoom:en="enabled",curve:qt="curveMonotoneX",fit:xr="grow",...br}=e,Sr=(0,Mt.Z)(),[Cr,hi]=m.useState(100),[Or,pi]=m.useState(100),_t=m.useRef(new(bn()).graphlib.Graph),[io,Es]=m.useState(((o=_t.current.graph())===null||o===void 0?void 0:o.width)||0),[Br,fi]=m.useState(((a=_t.current.graph())===null||a===void 0?void 0:a.height)||0),[Dn,pr]=m.useState([]),[Hr,Gr]=m.useState([]),dn=Math.max(io,Cr),xn=Math.max(Br,Or),ao=Math.min(Br,Or),Kr=xr==="grow"?xn:ao,Ho=m.useMemo(()=>Sn()(gn=>{if(!gn)return;const Nn=an.Z(gn),un=an.Z(gn.getElementById(ue));function ir(){Nn.call(Yt.sP().scaleExtent([1,10]).on("zoom",wr=>{wr.transform.x=Math.min(0,Math.max(wr.transform.x,dn-dn*wr.transform.k)),wr.transform.y=Math.min(0,Math.max(wr.transform.y,xn-xn*wr.transform.k)),un.attr("transform",wr.transform)}))}en==="enabled"?ir():en==="enable-on-click"&&Nn.on("click",()=>ir());const{width:ar,height:As}=gn.getBoundingClientRect();Cr!==ar&&hi(ar),Or!==As&&pi(As)},100),[Or,Cr,dn,xn,en]),sa=m.useCallback(()=>{const gn=_t.current.nodes(),Nn=_t.current.edges();gn.forEach(un=>{p.some(ar=>ar.id===un)||_t.current.removeNode(un)}),Nn.forEach(un=>{d.some(ar=>ar.from===un.v&&ar.to===un.w)||_t.current.removeEdge(un.v,un.w)}),p.forEach(un=>{const ir=_t.current.nodes().find(ar=>un.id===ar);if(ir&&_t.current.node(ir)){const{width:ar,height:As,x:wr,y:Hl}=_t.current.node(ir);_t.current.setNode(ir,{...un,width:ar,height:As,x:wr,y:Hl})}else _t.current.setNode(un.id,{...un,width:0,height:0})}),d.forEach(un=>{_t.current.setEdge(un.from,un.to,{...un,label:un.label,width:0,height:0,labelpos:Je,labeloffset:kt,weight:nn,minlen:Qt})})},[d,p,Je,kt,nn,Qt]),Go=m.useMemo(()=>Sn()(()=>{bn().layout(_t.current);const{height:gn,width:Nn}=_t.current.graph(),un=Math.max(0,gn||0),ir=Math.max(0,Nn||0);Es(ir),fi(un),pr(_t.current.nodes()),Gr(_t.current.edges())},250,{leading:!0}),[]);m.useEffect(()=>(_t.current.setGraph({rankdir:E,align:U,nodesep:Y,edgesep:M,ranksep:fe,marginx:ae,marginy:ye,acyclicer:we,ranker:Me}),sa(),Go(),Go.cancel),[we,U,E,M,ae,ye,Y,fe,Me,sa,Go]);function Wl(gn,Nn){return _t.current.setNode(gn,Nn),Go(),_t.current}function Vl(gn,Nn){return _t.current.setEdge(gn,Nn),Go(),_t.current}return(0,n.jsxs)("svg",{ref:Ho,...br,width:"100%",height:Kr,viewBox:`0 0 ${dn} ${xn}`,children:[(0,n.jsxs)("defs",{children:[(0,n.jsx)("marker",{id:tn,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,n.jsx)("path",{fill:Sr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),Ot]}),(0,n.jsx)("g",{id:ue,children:(0,n.jsxs)("svg",{width:io,height:Br,y:xn/2-Br/2,x:dn/2-io/2,viewBox:`0 0 ${io} ${Br}`,children:[Hr.map(gn=>{const Nn=_t.current.edge(gn);return Nn?(0,n.jsx)(pt,{id:gn,setEdge:Vl,render:rn,edge:Nn,curve:qt},`${gn.v}-${gn.w}`):null}),Dn.map(gn=>{const Nn=_t.current.node(gn);return Nn?(0,n.jsx)(mn,{setNode:Wl,render:y,node:Nn},gn):null})]})})]})}var he;const Re=(0,l.Z)(e=>({root:{padding:e.spacing(0),marginBottom:e.spacing(0),marginTop:e.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:e.spacing(6),marginTop:-e.spacing(3),zIndex:"unset"},icon:{fontSize:e.typography.h6.fontSize},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap"},message:{display:"flex",alignItems:"center",color:e.palette.banner.text,"& a":{color:e.palette.banner.link}},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(he=e.palette.banner.warning)!==null&&he!==void 0?he:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),et=e=>{const{variant:o,message:a,id:d,fixed:p=!1}=e,y=Re(),U=useApi(storageApiRef).forBucket("notifications");var Y;const M=(Y=U.snapshot("dismissedBanners").value)!==null&&Y!==void 0?Y:[],[fe,ae]=useState(new Set(M)),ye=useObservable(U.observe$("dismissedBanners"));useEffect(()=>{if(ye!=null&&ye.value){var Me;const Je=(Me=ye==null?void 0:ye.value)!==null&&Me!==void 0?Me:[];ae(new Set(Je))}},[ye==null?void 0:ye.value]);const we=()=>{U.set("dismissedBanners",[...fe,d])};return _jsx(Snackbar,{anchorOrigin:p?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!fe.has(d),classes:{root:classNames(y.root,!p&&y.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(y.content,y[o]),message:y.message},message:a,action:[_jsx(IconButton,{title:"Permanently dismiss this message",color:"inherit",onClick:we,children:_jsx(Close,{className:y.icon})},"dismiss")]})})};var Ue=t(60905),Et=t.p+"static/missingAnnotation.67f79e98..svg",Vt=t.p+"static/noInformation.4b426325..svg",Jt=t.p+"static/createComponent.975d1e1e..svg",Xt=t.p+"static/noBuild.1715fa71..svg";const q=(0,l.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),H=({missing:e})=>{const o=q();switch(e){case"field":return(0,n.jsx)("img",{src:Et,className:o.generalImg,alt:"annotation is missing"});case"info":return(0,n.jsx)("img",{src:Vt,alt:"no Information",className:o.generalImg});case"content":return(0,n.jsx)("img",{src:Jt,alt:"create Component",className:o.generalImg});case"data":return(0,n.jsx)("img",{src:Xt,alt:"no Build",className:o.generalImg});default:return null}},g=(0,l.Z)(e=>({root:{backgroundColor:e.palette.background.default,padding:e.spacing(2,0,0,0)},action:{marginTop:e.spacing(2)},imageContainer:{position:"relative"}}),{name:"BackstageEmptyState"});function w(e){const{title:o,description:a,missing:d,action:p}=e,y=g();return(0,n.jsxs)(Ue.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:y.root,spacing:2,children:[(0,n.jsx)(Ue.Z,{item:!0,xs:12,md:6,children:(0,n.jsxs)(Ue.Z,{container:!0,direction:"column",children:[(0,n.jsx)(Ue.Z,{item:!0,xs:!0,children:(0,n.jsx)(I.Z,{variant:"h5",children:o})}),(0,n.jsx)(Ue.Z,{item:!0,xs:!0,children:(0,n.jsx)(I.Z,{variant:"body1",children:a})}),(0,n.jsx)(Ue.Z,{item:!0,xs:!0,className:y.action,children:p})]})}),(0,n.jsx)(Ue.Z,{item:!0,xs:12,md:6,className:y.imageContainer,children:typeof d=="string"?(0,n.jsx)(H,{missing:d}):d.customImage})]})}const D=`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`,G=/^.*ANNOTATION.*$/m,de=D.match(G)[0],pe=D.split(`
|
|
12
|
+
`).findIndex(e=>G.test(e)),Ee=(0,l.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":"#fff"}}),{name:"BackstageMissingAnnotationEmptyState"});function lt(e){return Array.from(Array(e+1).keys(),o=>o+pe)}function ct(e){const o=e.map(a=>de.replace("ANNOTATION",a)).join(`
|
|
13
|
+
`);return D.replace(de,o)}function St(e){const o=e.length<=1;return(0,n.jsxs)(n.Fragment,{children:["The ",o?"annotation":"annotations"," ",e.map(a=>(0,n.jsx)("code",{children:a})).reduce((a,d)=>(0,n.jsxs)(n.Fragment,{children:[a,", ",d]}))," ",o?"is":"are"," missing. You need to add the"," ",o?"annotation":"annotations"," to your component if you want to enable this tool."]})}function Tt(e){const{annotation:o,readMoreUrl:a}=e,d=Array.isArray(o)?o:[o],p=a||"https://backstage.io/docs/features/software-catalog/well-known-annotations",y=Ee();return(0,n.jsx)(w,{missing:"field",title:"Missing Annotation",description:St(d),action:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(I.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,n.jsx)($e.Z,{className:y.code,children:(0,n.jsx)(Fe,{text:ct(d),language:"yaml",showLineNumbers:!0,highlightedNumbers:lt(d.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(te.Z,{color:"primary",component:at,to:p,children:"Read more"})]})})}var st=t(11776),De=t(38402),ft=t(49378),It=t(41128),zt=t(27616),mt=t(8284),Dt=t(70660),Ht=t(91750),Rt=t(38016);const nt=(e,o)=>(o.palette.type==="light"?It._j:It.$n)(o.palette[e].light,.6),rt=(e,o)=>(o.palette.type==="light"?It.$n:It._j)(o.palette[e].light,.9),Wt=(0,l.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:o})=>nt(o,e)}})),fn=({severity:e})=>{const o=Wt({severity:e});return(0,n.jsx)(Ht.Z,{classes:o})},sn=({severity:e})=>{const o=Wt({severity:e});return(0,n.jsx)(Rt.Z,{classes:o})},zn=(0,l.Z)(e=>({panel:{backgroundColor:({severity:o})=>rt(o,e),color:({severity:o})=>nt(o,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:o})=>nt(o,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:o})=>nt(o,e),backgroundColor:({severity:o})=>rt(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"}),Jn=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function vn(e){const{severity:o="warning",title:a,message:d,children:p,defaultExpanded:y}=e,E=zn({severity:o}),U=Jn(o)+(a?`: ${a}`:"");return(0,n.jsxs)(zt.Z,{defaultExpanded:y!=null?y:!1,className:E.panel,role:"alert",children:[(0,n.jsxs)(mt.Z,{expandIcon:(0,n.jsx)(sn,{severity:o}),className:E.summary,children:[(0,n.jsx)(fn,{severity:o}),(0,n.jsx)(I.Z,{className:E.summaryText,variant:"subtitle1",children:U})]}),(d||p)&&(0,n.jsx)(Dt.Z,{children:(0,n.jsxs)(Ue.Z,{container:!0,children:[d&&(0,n.jsx)(Ue.Z,{item:!0,xs:12,children:(0,n.jsx)(I.Z,{className:E.message,variant:"body1",children:d})}),p&&(0,n.jsx)(Ue.Z,{item:!0,xs:12,className:E.details,children:p})]})})]})}const Wn=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),lr=({error:e,message:o,stack:a,children:d})=>{const p=Wn();return(0,n.jsxs)(st.Z,{dense:!0,children:[(0,n.jsxs)(De.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ft.Z,{classes:{secondary:p.text},primary:"Error",secondary:e}),(0,n.jsx)(Pe,{text:e})]}),(0,n.jsxs)(De.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ft.Z,{classes:{secondary:p.text},primary:"Message",secondary:o}),(0,n.jsx)(Pe,{text:o})]}),a&&(0,n.jsxs)(De.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ft.Z,{classes:{secondary:p.text},primary:"Stack Trace",secondary:a}),(0,n.jsx)(Pe,{text:a})]}),d]})};function j(e){const{title:o,error:a,defaultExpanded:d,children:p}=e;return(0,n.jsx)(vn,{severity:"error",title:o!=null?o:a.message,defaultExpanded:d,children:(0,n.jsx)(lr,{error:a.name,message:a.message,stack:a.stack,children:p})})}var u=t(85256);const b=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function A(e){var o;const{title:a,error:d,defaultExpanded:p}=e,y=b();if(d.name!=="ResponseError")return(0,n.jsx)(j,{title:a!=null?a:d.message,defaultExpanded:p,error:d});const{body:E,cause:U}=d,{request:Y,response:M}=E,fe=`${M.statusCode}: ${U.name}`,ae=Y&&`${Y.method} ${Y.url}`,ye=U.message.replace(/\\n/g,`
|
|
14
|
+
`),we=(o=U.stack)===null||o===void 0?void 0:o.replace(/\\n/g,`
|
|
15
|
+
`),Me=JSON.stringify(E,void 0,2);return(0,n.jsxs)(j,{title:a!=null?a:d.message,defaultExpanded:p,error:{name:fe,message:ye,stack:we},children:[ae&&(0,n.jsxs)(De.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ft.Z,{classes:{secondary:y.text},primary:"Request",secondary:Y?`${ae}`:void 0}),(0,n.jsx)(Pe,{text:ae})]}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.Z,{component:"li",className:y.divider}),(0,n.jsx)(De.Z,{alignItems:"flex-start",children:(0,n.jsx)(ft.Z,{classes:{secondary:y.text},primary:"Full Error as JSON"})}),(0,n.jsx)(Fe,{language:"json",text:Me,showCopyCodeButton:!0})]})]})}var Q=t(28316);function ve(e){const o=document.createElement("div");return o.setAttribute("id",e),o}function xe(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function Oe(e){const o=useRef(null);useEffect(function(){const p=document.querySelector(`#${e}`),y=p||ve(e);return p||xe(y),y.appendChild(o.current),function(){o.current.remove(),y.childNodes.length===-1&&y.remove()}},[e]);function a(){return o.current||(o.current=document.createElement("div")),o.current}return a()}var Ve=null;const Nt="core.calloutSeen";function on(){const[e,o]=useState(()=>{const d=localStorage.getItem(Nt);return d?JSON.parse(d):{}}),a=useCallback((d,p)=>{const y=localStorage.getItem(Nt),U={...y?JSON.parse(y):{},[d]:p};o(U),localStorage.setItem(Nt,JSON.stringify(U))},[]);return{states:e,setState:a}}function Vn(e){const{states:o,setState:a}=on(),d=useCallback(()=>{a(e,!0)},[a,e]);return{seen:o[e]===!0,markSeen:d}}function cr(e){const{seen:o,markSeen:a}=Vn(e);return{show:o===!1,hide:a}}const jr=(0,l.Z)({"@keyframes pulsateSlightly":{"0%":{transform:"scale(1.0)"},"100%":{transform:"scale(1.1)"}},"@keyframes pulsateAndFade":{"0%":{transform:"scale(1.0)",opacity:.9},"100%":{transform:"scale(1.5)",opacity:0}},featureWrapper:{position:"relative"},backdrop:{zIndex:2e3,position:"fixed",overflow:"hidden",left:0,right:0,top:0,bottom:0},dot:{position:"absolute",backgroundColor:"transparent",borderRadius:"100%",border:"1px solid rgba(103, 146, 180, 0.98)",boxShadow:"0px 0px 0px 20000px rgba(0, 0, 0, 0.5)",zIndex:2001,transformOrigin:"center center",animation:"$pulsateSlightly 1744ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) alternate infinite"},pulseCircle:{width:"100%",height:"100%",backgroundColor:"transparent",borderRadius:"100%",border:"2px solid white",zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:"white",zIndex:2003}},{name:"BackstageFeatureCalloutCircular"});function lo(e){const{featureId:o,title:a,description:d,children:p}=e,{show:y,hide:E}=useShowCallout(o),U=usePortal("core.callout"),Y=useRef(null),[M,fe]=useState(),ae=jr(),ye=useCallback(()=>{if(Y.current){const we=Y.current.getBoundingClientRect(),Me=Math.max(we.width,we.height),Je=800,kt=we.x-(Me-we.width)/2-Je,Qt=we.y-(Me-we.height)/2-Je,nn=Me+2*Je,rn=450,Ot=we.x+we.width/2-rn,en=we.y-(Me-we.height)/2+Me+20;fe({dotLeft:kt,dotTop:Qt,dotSize:nn,borderWidth:Je,textTop:en,textLeft:Ot,textWidth:rn})}},[]);return useEffect(()=>(window.addEventListener("resize",ye),window.addEventListener("scroll",ye),()=>{window.removeEventListener("resize",ye),window.removeEventListener("scroll",ye)}),[ye]),useLayoutEffect(ye,[Y.current,ye]),y?_jsxs(_Fragment,{children:[_jsx(Box,{className:ae.featureWrapper,ref:Y,children:p}),createPortal(_jsx(Box,{className:ae.backdrop,children:_jsx(ClickAwayListener,{onClickAway:E,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:ae.dot,"data-testid":"dot",style:{left:M==null?void 0:M.dotLeft,top:M==null?void 0:M.dotTop,width:M==null?void 0:M.dotSize,height:M==null?void 0:M.dotSize,borderWidth:M==null?void 0:M.borderWidth},onClick:E,onKeyDown:E,role:"button",tabIndex:0,children:_jsx(Box,{className:ae.pulseCircle})}),_jsxs(Box,{className:ae.text,"data-testid":"text",style:{left:M==null?void 0:M.textLeft,top:M==null?void 0:M.textTop,width:M==null?void 0:M.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:a}),_jsx(Typography,{children:d})]})]})})}),U)]}):_jsx(_Fragment,{children:p})}var $r=t(35292);const co=(0,l.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function uo({color:e="primary",disabled:o=!1,href:a="#",icon:d=(0,n.jsx)($r.Z,{}),label:p,onClick:y,title:E}){const U=co();return o?(0,n.jsxs)($e.Z,{title:E,className:ce()(U.link,U.disabled),children:[d,(0,n.jsx)(I.Z,{variant:"caption",component:"span",className:U.label,children:p})]}):(0,n.jsxs)(at,{title:E,className:ce()(U.link,U[e]),to:a,onClick:y,children:[d,(0,n.jsx)(I.Z,{variant:"caption",component:"span",className:U.label,children:p})]})}const fr=(0,l.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function Yr(e){const{links:o}=e,a=fr();return(0,n.jsx)("nav",{className:a.links,children:o.map((d,p)=>(0,n.jsx)(uo,{...d},p+1))})}const Xn=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
|
+
`},Qn=100,Gn=10,Er=(0,l.Z)(e=>({root:{position:"relative",display:"flex",flexFlow:"row nowrap",alignItems:"center"},container:{overflow:"auto",scrollbarWidth:0,"&::-webkit-scrollbar":{display:"none"}},fade:{position:"absolute",width:Qn,height:`calc(100% + ${Gn}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-Gn,background:`linear-gradient(90deg, ${Xn(e.palette.type)})`},fadeRight:{right:-Gn,background:`linear-gradient(270deg, ${Xn(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function Jr(e){const[[o,a],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const p=e.current;if(!p){d([0,0]);return}const y=()=>{const E=p.scrollLeft,U=p.scrollWidth-p.offsetWidth-p.scrollLeft;d([E,U])};return y(),p.addEventListener("scroll",y),window.addEventListener("resize",y),()=>{p.removeEventListener("scroll",y),window.removeEventListener("resize",y)}},[e]),[o,a]}function ho(e,o,a){const[d,p]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const y=window.performance.now(),E=requestAnimationFrame(U=>{if(!e.current)return;const Y=U-y,M=Math.abs(d)*Y/o,ae=Math.max(a,M)*Math.sign(d);e.current.scrollBy({left:ae});const ye=d-ae;Math.sign(d)!==Math.sign(ye)?p(0):p(ye)});return()=>cancelAnimationFrame(E)},[e,d,o,a]),p}function Xr(e){const{scrollStep:o=100,scrollSpeed:a=50,minScrollDistance:d=5,children:p,...y}=e,E=Er(e),U=React.useRef(),[Y,M]=Jr(U),fe=ho(U,a,d),ae=ye=>{!U.current||fe(ye?o:-o)};return _jsxs(Box,{...y,className:E.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:E.container,ref:U,children:p}),_jsx(Box,{className:classNames(E.fade,E.fadeLeft,{[E.fadeHidden]:Y===0})}),_jsx(Box,{className:classNames(E.fade,E.fadeRight,{[E.fadeHidden]:M===0})}),Y>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>ae(!1),className:classNames(E.button,E.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),M>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>ae(!0),className:classNames(E.button,E.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const po=(0,l.Z)({alpha:{color:"#ffffff",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}},{name:"BackstageLifecycle"});function Ko(e){const o=po(e),{shorthand:a,alpha:d}=e;return a?_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],style:{fontSize:"120%"},children:d?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],children:d?"Alpha":"Beta"})}const Zr=(0,m.lazy)(()=>Promise.all([t.e(5869),t.e(6051)]).then(t.bind(t,76051)).then(e=>({default:e.RealLogViewer})));function qn(e){const{Progress:o}=(0,W.qD)().getComponents();return(0,n.jsx)(m.Suspense,{fallback:(0,n.jsx)(o,{}),children:(0,n.jsx)(Zr,{...e})})}var Ar=t(28865),gr=t(60251);const Dr=(0,l.Z)(e=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${e.palette.border}`},"& th, & td":{border:`1px solid ${e.palette.border}`,padding:e.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:e.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:e.palette.background.paper},"& tr":{backgroundColor:e.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:e.palette.background.default},"& a":{color:e.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),Tr=(e,o)=>o?typeof o=="string"?e+o:m.Children.toArray(o.props.children).reduce(Tr,e):e,rr=({level:e,children:o})=>{const p=m.Children.toArray(o).reduce(Tr,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return m.createElement(`h${e}`,{id:p},o)},fo={code:({inline:e,className:o,children:a,...d})=>{const p=String(a).replace(/\n+$/,""),y=/language-(\w+)/.exec(o||"");return!e&&y?(0,n.jsx)(Fe,{language:y[1],text:p}):(0,n.jsx)("code",{className:o,...d,children:a})},h1:rr,h2:rr,h3:rr,h4:rr,h5:rr,h6:rr};function go(e){const{content:o,dialect:a="gfm",linkTarget:d,transformLinkUri:p,transformImageUri:y,className:E}=e,U=Dr();return(0,n.jsx)(Ar.D,{remarkPlugins:a==="gfm"?[gr.Z]:[],className:`${U.markdown} ${E}`,children:o,components:fo,linkTarget:d,transformLinkUri:p,transformImageUri:y})}var Ir=t(23054);const Qr=(0,l.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),Yo=({request:e,busy:o,setBusy:a})=>{const d=Qr(),[p,y]=useState(),E=async()=>{a(!0);try{await e.trigger()}catch(Y){y(isError(Y)?Y.message:"An unspecified error occurred")}finally{a(!1)}},U=e.provider.icon;return _jsxs(ListItem,{disabled:o,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx(U,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:p&&_jsx(Typography,{color:"error",children:p})}),_jsx(Button,{color:"primary",variant:"contained",onClick:E,children:"Log in"})]})};var dr=null;const mo=(0,l.Z)(e=>({dialog:{paddingTop:e.spacing(1)},title:{minWidth:0},titleHeading:{fontSize:e.typography.h6.fontSize},contentList:{padding:0},actionButtons:{padding:e.spacing(2,0)}}),{name:"OAuthRequestDialog"});function vo(e){const o=mo(),[a,d]=useState(!1),p=useApi(oauthRequestApiRef),y=useObservable(useMemo(()=>p.authRequest$(),[p]),[]),E=()=>{y.forEach(U=>U.reject())};return _jsxs(Dialog,{open:Boolean(y.length),fullWidth:!0,maxWidth:"xs",classes:{paper:o.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsx(DialogTitle,{classes:{root:o.title},id:"oauth-req-dialog-title",children:_jsx(Typography,{className:o.titleHeading,variant:"h1",children:"Login Required"})}),_jsx(DialogContent,{dividers:!0,classes:{root:o.contentList},children:_jsx(List,{children:y.map(U=>_jsx(LoginRequestListItem,{request:U,busy:a,setBusy:d},U.provider.title))})})]}),_jsx(DialogActions,{classes:{root:o.actionButtons},children:_jsx(Button,{onClick:E,children:"Reject All"})})]})}var yo=t(15277),xo=t.n(yo),Nr=t(29862);const bo=(0,l.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function So(e){const[o,a]=(0,m.useState)(!1),d=(0,Nr.t)(),p=bo(),y=U=>{d()&&a(U)};var E;return(0,n.jsx)(We.ZP,{title:(E=e.title)!==null&&E!==void 0?E:e.text||"",placement:e.placement,disableHoverListener:!o,children:(0,n.jsx)(xo(),{text:e.text,line:e.line,onToggled:y,containerClassName:p.container})})}var Fr=t(67358);function mr(e){const o=(0,ht.Z)(),[a,d]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{const p=setTimeout(()=>d(!0),o.transitions.duration.short);return()=>clearTimeout(p)},[o.transitions.duration.short]),a?(0,n.jsx)(Fr.Z,{...e,"data-testid":"progress"}):(0,n.jsx)($e.Z,{display:"none"})}var ur=t(94339),qr=t(14503),Co=t(24579),Kt=t(32552),wn=t(15459),wo=t(27597);const jo=(0,l.Z)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function Eo(e){const{link:o,title:a,onClick:d}=e,p=jo();return(0,n.jsxs)($e.Z,{children:[(0,n.jsx)(u.Z,{}),(0,n.jsx)(at,{to:o,onClick:d,underline:"none",children:(0,n.jsxs)($e.Z,{display:"flex",alignItems:"center",className:p.root,children:[(0,n.jsx)($e.Z,{className:p.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,n.jsx)(I.Z,{children:(0,n.jsx)("strong",{children:a})})}),(0,n.jsx)(wo.Z,{className:p.arrow})]})})]})}const Ao=e=>{const{slackChannel:o}=e;if(o){if(typeof o=="string")return(0,n.jsxs)(I.Z,{children:["Please contact ",o," for help."]});if(!o.href)return(0,n.jsxs)(I.Z,{children:["Please contact ",o.name," for help."]})}else return null;return(0,n.jsx)(Qe,{to:o.href,variant:"contained",children:o.name})},To=class extends m.Component{componentDidCatch(o,a){console.error(`ErrorBoundary, error: ${o}, info: ${a}`),this.setState({error:o,errorInfo:a})}render(){const{slackChannel:o,children:a}=this.props,{error:d}=this.state;return d?(0,n.jsx)(j,{title:"Something Went Wrong",error:d,children:(0,n.jsx)(Ao,{slackChannel:o})}):a}constructor(o){super(o),this.state={error:void 0,errorInfo:void 0}}},Io=(0,l.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,wn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(qr.Z),_r={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 Rr(e){const{title:o,subheader:a,divider:d=!0,deepLink:p,slackChannel:y,errorBoundaryProps:E,variant:U,children:Y,headerStyle:M,headerProps:fe,icon:ae,action:ye,actionsClassName:we,actions:Me,cardClassName:Je,actionsTopRight:kt,className:Qt,noPadding:nn,titleTypographyProps:rn}=e,Ot=Io();let en={},qt={};U&&U.split(/[\s]+/g).forEach(Cr=>{en={...en,..._r.card[Cr]},qt={...qt,..._r.cardContent[Cr]}});const xr=()=>!a&&!ae?null:(0,n.jsxs)("div",{className:Ot.headerSubheader,"data-testid":"info-card-subheader",children:[a&&(0,n.jsx)("div",{className:Ot.subheader,children:a}),ae]}),br=E||(y?{slackChannel:y}:{});return(0,n.jsx)(ur.Z,{style:en,className:Qt,children:(0,n.jsxs)(To,{...br,children:[o&&(0,n.jsx)(Kt.Z,{classes:{root:Ot.header,title:Ot.headerTitle,subheader:Ot.headerSubheader,avatar:Ot.headerAvatar,action:Ot.headerAction,content:Ot.headerContent},title:o,subheader:xr(),action:ye,style:{...M},titleTypographyProps:rn,...fe}),kt&&(0,n.jsx)(Ro,{children:kt}),d&&(0,n.jsx)(u.Z,{}),(0,n.jsx)(Co.Z,{className:ce()(Je,{[Ot.noPadding]:nn}),style:qt,children:Y}),Me&&(0,n.jsx)(qr.Z,{className:we,children:Me}),p&&(0,n.jsx)(Eo,{...p})]})})}var Jo=t(39307);const Lo=(0,l.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"}),eo={fractional:!0,inverse:!1,unit:"%",max:100},Po=({palette:e,value:o,inverse:a,max:d})=>{if(isNaN(o))return"#ddd";const p=d||eo.max,y=a?p-o:o;return y<p/3?e.status.error:y<p*(2/3)?e.status.warning:e.status.ok};function Ts(e){const[o,a]=useState(null),{getColor:d=Po}=e,p=Lo(e),{palette:y}=useTheme(),{value:E,fractional:U,inverse:Y,unit:M,max:fe,description:ae}={...eo,...e},ye=U?Math.round(E*fe):E,we=fe!==100?Math.round(E):ye,[Me,Je]=useState(!1);return useEffect(()=>{const kt=o,Qt=()=>Je(!0),nn=()=>Je(!1);return kt&&ae?(kt.addEventListener("mouseenter",Qt),kt.addEventListener("mouseleave",nn),()=>{kt.removeEventListener("mouseenter",Qt),kt.removeEventListener("mouseleave",nn)}):()=>{Je(!1)}},[ae,o]),_jsxs(Box,{ref:a,className:p.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:ye,strokeWidth:12,trailWidth:12,strokeColor:d({palette:y,value:we,inverse:Y,max:fe}),className:p.circle}),ae&&Me?_jsx(Box,{className:p.description,children:ae}):_jsx(Box,{className:p.overlay,children:isNaN(E)?"N/A":`${we}${M}`})]})}const v=(0,l.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function x(e){const o=v(e),{title:a,subheader:d,progress:p,inverse:y,deepLink:E,description:U,icon:Y,variant:M,getColor:fe}=e,ae={inverse:y,description:U,getColor:fe,value:p};return _jsx(Box,{className:o.root,children:_jsx(InfoCard,{title:a,subheader:d,deepLink:E,variant:M,icon:Y,children:_jsx(Gauge,{...ae})})})}function L(e){const{value:o,getColor:a=getProgressColor}=e,{palette:d}=useTheme();if(isNaN(o))return null;let p=Math.round(o*100*100)/100;p>100&&(p=100);const y=a({palette:d,value:p,inverse:!1,max:100});return _jsx(Tooltip,{title:`${p}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:p,strokeWidth:4,trailWidth:4,strokeColor:y})})})}var Z=t(21324),J=t(7089),ee=t(1292),ne=t(42494),le=t(74603),be=t(56939),Ce=t(12231),Ie=t(73698),Ae=t(72379);const He=(0,l.Z)(e=>(0,P.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var qe=()=>{const e=He();return(0,n.jsx)(Ae.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const Te=(0,l.Z)(e=>(0,P.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Ut=()=>{const e=Te();return(0,n.jsx)(Ae.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const Tn=(0,wn.Z)(e=>(0,P.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"})(le.Z),In=(0,l.Z)(e=>(0,P.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 or(e){const{multiple:o,items:a,label:d,placeholder:p,selected:y,onChange:E,triggerReset:U,native:Y=!1,disabled:M=!1,margin:fe}=e,ae=In(),[ye,we]=(0,m.useState)(y||(o?[]:"")),[Me,Je]=(0,m.useState)(!1);(0,m.useEffect)(()=>{we(o?[]:"")},[U,o]),(0,m.useEffect)(()=>{y!==void 0&&we(y)},[y]);const kt=Ot=>{we(Ot.target.value),E(Ot.target.value)},Qt=Ot=>{if(M){Ot.preventDefault();return}Je(en=>o&&!(Ot.target instanceof HTMLElement)?!0:!en)},nn=()=>{Je(!1)},rn=Ot=>()=>{const en=ye.filter(qt=>qt!==Ot);we(en),E(en)};return(0,n.jsx)($e.Z,{className:ae.root,children:(0,n.jsx)(ee.Z,{onClickAway:nn,children:(0,n.jsxs)(ne.Z,{className:ae.formControl,children:[(0,n.jsx)(be.Z,{className:ae.formLabel,children:d}),(0,n.jsxs)(Ie.Z,{"aria-label":d,value:ye,native:Y,disabled:M,"data-testid":"select",displayEmpty:!0,multiple:o,margin:fe,onChange:kt,onClick:Qt,open:Me,input:(0,n.jsx)(Tn,{}),label:d,tabIndex:0,renderValue:Ot=>{var en;return o&&ye.length!==0?(0,n.jsx)($e.Z,{className:ae.chips,children:Ot.map(qt=>{var xr,br;return(0,n.jsx)(J.Z,{label:(xr=a.find(Sr=>Sr.value===qt))===null||xr===void 0?void 0:xr.label,clickable:!0,onDelete:rn(qt),className:ae.chip},(br=a.find(Sr=>Sr.value===qt))===null||br===void 0?void 0:br.value)})}):(0,n.jsx)(I.Z,{children:ye.length===0?p||"":(en=a.find(qt=>qt.value===Ot))===null||en===void 0?void 0:en.label})},IconComponent:()=>Me?(0,n.jsx)(Ut,{}):(0,n.jsx)(qe,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[p&&!o&&(0,n.jsx)(Ce.Z,{value:[],children:p}),Y?a&&a.map(Ot=>(0,n.jsx)("option",{value:Ot.value,children:Ot.label},Ot.value)):a&&a.map(Ot=>(0,n.jsxs)(Ce.Z,{value:Ot.value,children:[o&&(0,n.jsx)(Z.Z,{color:"primary",checked:ye.includes(Ot.value)||!1,className:ae.checkbox}),Ot.label]},Ot.value))]})]})})})}const cn=()=>{},Rn=m.createContext({stepperLength:0,stepIndex:0,setStepIndex:cn,stepHistory:[],setStepHistory:cn,onStepChange:cn});function Kn(e){const{children:o,elevated:a,onStepChange:d,activeStep:p=0}=e,[y,E]=useState(p),[U,Y]=useState([0]);useEffect(()=>{E(p)},[p]);const M=[];let fe;return Children.forEach(o,ae=>{isValidElement(ae)&&(ae.props.end?fe=ae:M.push(ae))}),_jsxs(_Fragment,{children:[_jsx(Rn.Provider,{value:{stepIndex:y,setStepIndex:E,stepHistory:U,setStepHistory:Y,onStepChange:d,stepperLength:Children.count(o)},children:_jsx(MuiStepper,{activeStep:y,orientation:"vertical",elevation:a?2:0,children:M})}),y>=Children.count(o)-1&&fe]})}const Lr=(0,l.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),Pr=({text:e,handleClick:o})=>_jsx(Button,{onClick:o,children:e||"Reset"}),Ur=({text:e,handleClick:o,disabled:a,last:d,stepIndex:p})=>_jsx(Button,{variant:"contained",color:"primary",disabled:a,"data-testid":`nextButton-${p}`,onClick:o,children:e||(d?"Finish":"Next")}),jn=({text:e,handleClick:o,disabled:a,stepIndex:d})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:a,"data-testid":`skipButton-${d}`,onClick:o,children:e||"Skip"}),Ln=({text:e,handleClick:o,disabled:a,stepIndex:d})=>_jsx(Button,{onClick:o,"data-testid":`backButton-${d}`,disabled:a,children:e||"Back"}),kr=({actions:e={},children:o})=>{const a=Lr(),{stepperLength:d,stepIndex:p,setStepIndex:y,stepHistory:E,setStepHistory:U,onStepChange:Y}=useContext(VerticalStepperContext),M=(we,Me)=>{Me&&Me(),Y&&Y(p,we),y(we)},fe=()=>{const we=e.nextStep?e.nextStep(p,d-1):p+1;M(we,e.onNext),U([...E,we])},ae=()=>{E.pop(),M(E[E.length-1],e.onBack),U([...E])},ye=()=>{M(0,e.onRestart),U([0])};return _jsxs(Box,{className:a.root,children:[[void 0,!0].includes(e.showBack)&&p!==0&&_jsx(Ln,{text:e.backText,handleClick:ae,disabled:p===0,stepIndex:p}),e.showSkip&&_jsx(jn,{text:e.skipText,handleClick:fe,disabled:!!d&&p>=d||!!e.canSkip&&!e.canSkip(),stepIndex:p}),[void 0,!0].includes(e.showNext)&&_jsx(Ur,{text:e.nextText,handleClick:fe,disabled:!!d&&p>=d||!!e.canNext&&!e.canNext(),stepIndex:p}),e.showRestart&&p!==0&&_jsx(Pr,{text:e.restartText,handleClick:ye,stepIndex:p}),o]})},Is=(0,l.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function Xo(e){const{title:o,children:a,end:d,actions:p,...y}=e,E=Is();return d?_jsxs(Box,{className:E.end,children:[_jsx(Typography,{variant:"h6",children:o}),a,_jsx(SimpleStepperFooter,{actions:{...p||{},showNext:!1}})]}):_jsxs(MuiStep,{...y,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:o})}),_jsxs(StepContent,{children:[a,_jsx(SimpleStepperFooter,{actions:p})]})]})}const vr=(0,l.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 gi(e){const o=vr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function mi(e){const o=vr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function ia(e){const o=vr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.error),"aria-label":"Status error","aria-hidden":"true",...e})}function Mr(e){const o=vr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function vi(e){const o=vr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.running),"aria-label":"Status running","aria-hidden":"true",...e})}function $n(e){const o=vr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var aa=t(74600),Rs=t(15584);const yi=e=>(0,P.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),Ls={root:{border:"0",verticalAlign:"top"}},xi=e=>(0,P.Z)({root:{margin:e.spacing(0,0,-1,0)}}),bi=e=>(0,P.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),ko=(0,wn.Z)(yi,{name:"BackstageMetadataTableTitleCell"})(Rs.Z),Ps=(0,wn.Z)(Ls,{name:"BackstageMetadataTableCell"})(Rs.Z),Oo=({dense:e,children:o})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:o})}),Bo=({title:e,children:o,...a})=>_jsxs(TableRow,{children:[e&&_jsx(ko,{children:e}),_jsx(Ps,{colSpan:e?1:2,...a,children:o})]}),zr=(0,wn.Z)(xi,{name:"BackstageMetadataTableList"})(({classes:e,children:o})=>(0,n.jsx)(st.Z,{disablePadding:!0,className:e.root,children:o})),Si=(0,wn.Z)(bi,{name:"BackstageMetadataTableListItem"})(({classes:e,children:o})=>(0,n.jsx)(De.Z,{className:e.root,children:o})),$o=(0,P.Z)({root:{margin:"0 0",listStyleType:"none"}}),Qo=e=>(0,P.Z)({root:{...$o.root,paddingLeft:e.spacing(1)}}),qo=(0,wn.Z)($o,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:o})=>(0,n.jsx)(zr,{classes:e,children:o})),_o=(0,wn.Z)(Qo,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:o})=>(0,n.jsx)(zr,{classes:e,children:o}));function ks(e,o){const a=e.map((d,p)=>_jsx(MetadataListItem,{children:Zo(d)},p));return o?_jsx(_o,{children:a}):_jsx(qo,{children:a})}function Os(e,o,a){const d=Object.keys(e).map(p=>{const y=Zo(e[p],!0),E=a&&a.titleFormat?a.titleFormat(p):startCase(p);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${E}: `}),y]},p)});return o?_jsx(_o,{children:d}):_jsx(qo,{children:d})}function Zo(e,o,a){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?Os(e,o,a):Array.isArray(e)?ks(e,a):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const yr=({value:e,options:o})=>_jsx(Fragment,{children:Zo(e,o)}),Do=({title:e,value:o,options:a})=>_jsx(MetadataTableItem,{title:a&&a.titleFormat?a.titleFormat(e):startCase(e),children:_jsx(yr,{value:o,options:a})});function Bs(e,o){return Object.keys(e).map(a=>_jsx(Do,{title:a,value:e[a],options:o},a))}function Ci(e){const{metadata:o,dense:a=!0,options:d}=e,p=Bs(o,d||{});return _jsx(MetadataTable,{dense:a,children:p})}var es=t(49429),$s=t(86136),ts=t(79784),Zs=t(19126),ns=t.n(Zs);function wi(e){return qs.stringify(e,{strictNullHandling:!0})}function rs(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function os(e,o){return rs(e)[o]}function Ds(e,o,a){const d={...rs(e),[o]:a};return wi(d)}function ji(e,o=250){const[a,d]=useSearchParams(),p=a.toString(),[y,E]=useState(os(p,e));return useEffect(()=>{const U=os(p,e);E(Y=>isEqual(U,Y)?Y:U)},[p,E,e]),useDebouncedEffect(()=>{const U=Ds(p,e,y);p!==U&&d(U,{replace:!0})},[d,y,p,e],o),[y,E]}const ss={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 to(){const o=(0,W.I_)().get(W.Ds),a=o==null?void 0:o.getOptionalConfig("app.support");if(!a)return ss;var d;return{url:a.getString("url"),items:a.getConfigArray("items").flatMap(p=>({title:p.getString("title"),icon:p.getOptionalString("icon"),links:((d=p.getOptionalConfigArray("links"))!==null&&d!==void 0?d:[]).flatMap(y=>({url:y.getString("url"),title:y.getString("title")}))}))}}var Ns=t(80079);function _n(e,o){const d=(0,W.qD)().getSystemIcon(e);return d?(0,n.jsx)(d,{...o}):(0,n.jsx)(Ns.Z,{...o})}function Ei(e){return _n("brokenImage",e)}function Ai(e){return _n("catalog",e)}function la(e){return _n("chat",e)}function ca(e){return _n("dashboard",e)}function No(e){return _n("docs",e)}function da(e){return _n("email",e)}function ua(e){return _n("github",e)}function Ti(e){return _n("group",e)}function no(e){return _n("help",e)}function Fs(e){return _n("user",e)}function ha(e){return _n("warning",e)}const Ii=(0,l.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),is=({icon:e})=>{const o=(0,W.qD)();var a;const d=e&&(a=o.getSystemIcon(e))!==null&&a!==void 0?a:no;return(0,n.jsx)(d,{})};var ro;const Us=({link:e})=>(0,n.jsx)(at,{to:e.url,children:(ro=e.title)!==null&&ro!==void 0?ro:e.url}),Ms=({item:e})=>{var o;return(0,n.jsxs)(De.Z,{children:[(0,n.jsx)($s.Z,{children:(0,n.jsx)(is,{icon:e.icon})}),(0,n.jsx)(ft.Z,{primary:e.title,secondary:(o=e.links)===null||o===void 0?void 0:o.reduce((a,d,p)=>[...a,p>0&&(0,n.jsx)("br",{},p),(0,n.jsx)(Us,{link:d},d.url)],[])})]})};function Ri(e){const{title:o,items:a,children:d}=e,{items:p}=to(),[y,E]=(0,m.useState)(!1),[U,Y]=(0,m.useState)(null),M=Ii(),fe=(0,tt.Z)(we=>we.breakpoints.down("sm")),ae=we=>{Y(we.currentTarget),E(!0)},ye=()=>{E(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)($e.Z,{display:"flex",ml:1,children:fe?(0,n.jsx)(Lt.Z,{color:"primary",size:"small",onClick:ae,"data-testid":"support-button","aria-label":"Support",children:(0,n.jsx)(no,{})}):(0,n.jsx)(te.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:ae,startIcon:(0,n.jsx)(no,{}),children:"Support"})}),(0,n.jsxs)(ts.ZP,{"data-testid":"support-button-popover",open:y,anchorEl:U,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:ye,children:[(0,n.jsxs)(st.Z,{className:M.popoverList,children:[o&&(0,n.jsx)(De.Z,{alignItems:"flex-start",children:(0,n.jsx)(I.Z,{variant:"subtitle1",children:o})}),m.Children.map(d,(we,Me)=>(0,n.jsx)(De.Z,{alignItems:"flex-start",children:we},`child-${Me}`)),(a!=null?a:p).map((we,Me)=>(0,n.jsx)(Ms,{item:we},`item-${Me}`))]}),(0,n.jsx)(es.Z,{children:(0,n.jsx)(te.Z,{color:"primary",onClick:ye,"aria-label":"Close",children:"Close"})})]})]})}var as=t(18671),ls=t(16060);const Fo=72,cs=24,Pn=18,hr={drawerWidthClosed:Fo,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:Fo,iconSize:Fo-cs*2,iconPadding:cs,selectedIndicatorWidth:3,userBadgePadding:Pn,userBadgeDiameter:Fo-Pn*2,mobileSidebarHeight:56},zs=e=>({...hr,...e,iconContainerWidth:hr.drawerWidthClosed,iconSize:hr.drawerWidthClosed-hr.iconPadding*2,userBadgeDiameter:hr.drawerWidthClosed-hr.userBadgePadding*2}),Ws={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:hr.defaultOpenDelayMs+200},Li=e=>({...Ws,...e}),pa="@backstage/core/sidebar-intro-dismissed",sr=(0,m.createContext)({sidebarConfig:hr,submenuConfig:Ws}),Vs=(0,m.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var Pi=t(50023),ki=t(4190),Oi=t(87685),Bi=t(44882),Uo=t(51837);const Hs={isOpen:!1,setOpen:()=>{}},Gs=(0,m.createContext)(Hs),Mo=(0,Uo.CT)("sidebar-open-state-context");function ds(e){const{children:o,value:a}=e;return(0,n.jsx)(Gs.Provider,{value:a,children:(0,n.jsx)(Mo.Provider,{value:(0,Uo.EI)({1:a}),children:o})})}const zo=()=>{const e=(0,m.useContext)(Mo),o=(0,m.useContext)(Gs);if(e===void 0)return o||Hs;const a=e.atVersion(1);if(a===void 0)throw new Error("No context found for version 1.");return a};var Ks=t(57998);const us={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},hs=(0,m.createContext)(us),ps=(0,Uo.CT)("sidebar-pin-state-context");function Ys(e){const{children:o,value:a}=e;return(0,n.jsx)(hs.Provider,{value:a,children:(0,n.jsx)(ps.Provider,{value:(0,Uo.EI)({1:a}),children:o})})}const Wr=()=>{const e=(0,m.useContext)(ps),o=(0,m.useContext)(hs);if(e===void 0)return o||us;const a=e.atVersion(1);if(a===void 0)throw new Error("No context found for version 1.");return a},Js=(0,l.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"}})),$i=e=>{const{to:o,label:a,icon:d,value:p}=e,{sidebarConfig:y}=(0,m.useContext)(sr),E=Js({sidebarConfig:y}),U=(0,$.TH)(),{selectedMenuItemIndex:Y,setSelectedMenuItemIndex:M}=(0,m.useContext)(ms),fe=(ye,we)=>{M(we===Y?-1:we)},ae=p===Y&&Y>=0||p!==Y&&!(Y>=0)&&o===U.pathname;return(0,n.jsx)(Ks.Z,{"aria-label":a,label:a,icon:d,component:at,to:o||U.pathname,onChange:fe,value:p,selected:ae,classes:E})},fs=e=>{const{children:o,to:a,label:d,icon:p,value:y}=e,{isMobile:E}=Wr();return E?(0,n.jsx)($i,{to:a,label:d,icon:p,value:y}):(0,n.jsx)(n.Fragment,{children:o})},gs=(0,l.Z)(e=>({root:{position:"fixed",backgroundColor:e.palette.navigation.background,color:e.palette.navigation.color,bottom:0,left:0,right:0,zIndex:e.zIndex.snackbar,borderTop:"1px solid #383838"},overlay: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`})})),Zi=e=>(0,se.orderBy)(e,({props:{priority:o}})=>Number.isInteger(o)?o:-1,"desc"),Xs=m.createElement(fs).type,Qs=({children:e,label:o="Menu",open:a,onClose:d})=>{const{sidebarConfig:p}=(0,m.useContext)(sr),y=gs({sidebarConfig:p});return(0,n.jsxs)(ki.ZP,{anchor:"bottom",open:a,onClose:d,ModalProps:{BackdropProps:{classes:{root:y.marginMobileSidebar}}},classes:{root:y.marginMobileSidebar,paperAnchorBottom:y.overlay},children:[(0,n.jsxs)($e.Z,{className:y.overlayHeader,children:[(0,n.jsx)(I.Z,{variant:"h3",children:o}),(0,n.jsx)(Lt.Z,{onClick:d,classes:{root:y.overlayHeaderClose},children:(0,n.jsx)(Oi.Z,{})})]}),(0,n.jsx)($e.Z,{component:"nav",children:e})]})},ms=(0,m.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),_s=e=>{const{sidebarConfig:o}=(0,m.useContext)(sr),{children:a}=e,d=gs({sidebarConfig:o}),p=(0,$.TH)(),[y,E]=(0,m.useState)(-1);(0,m.useEffect)(()=>{E(-1)},[p.pathname]);let U=(0,W.vJ)(a,M=>M.getElements().filter(fe=>fe.type===Xs));if(a)U.length?U=Zi(U):U.push((0,n.jsx)(fs,{icon:(0,n.jsx)(Bi.Z,{}),children:a},"default_menu"));else return null;const Y=y>=0&&!U[y].props.to;return(0,n.jsx)(ds,{value:{isOpen:!0,setOpen:()=>{}},children:(0,n.jsxs)(ms.Provider,{value:{selectedMenuItemIndex:y,setSelectedMenuItemIndex:E},children:[(0,n.jsx)(Qs,{label:U[y]&&U[y].props.label,open:Y,onClose:()=>E(-1),children:U[y]&&U[y].props.children}),(0,n.jsx)(Pi.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:U})]})})};var oo;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(oo||(oo={}));const vs={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(oo.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(oo.SIDEBAR_PIN_STATE,JSON.stringify(e))}},ei=(0,l.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"}),er=(0,m.createContext)({content:{contentRef:void 0}});function ti(e){const[o,a]=(0,m.useState)(()=>vs.getSidebarPinState()),{sidebarConfig:d}=(0,m.useContext)(sr),p=(0,m.useRef)(null),y=(0,m.useMemo)(()=>({content:{contentRef:p}}),[p]);(0,m.useEffect)(()=>{vs.setSidebarPinState(o)},[o]);const E=(0,tt.Z)(M=>M.breakpoints.down("xs"),{noSsr:!0}),U=()=>a(!o),Y=ei({isPinned:o,sidebarConfig:d});return(0,n.jsx)(Ys,{value:{isPinned:o,toggleSidebarPinState:U,isMobile:E},children:(0,n.jsx)(er.Provider,{value:y,children:(0,n.jsx)($e.Z,{className:Y.root,children:e.children})})})}function ys(){const{content:e}=(0,m.useContext)(er);return{focusContent:(0,m.useCallback)(()=>{var a,d;e==null||(a=e.contentRef)===null||a===void 0||(d=a.current)===null||d===void 0||d.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const xs=(0,l.Z)(e=>({drawer:o=>({display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:e.zIndex.appBar,background:e.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",width:o.sidebarConfig.drawerWidthClosed,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"},"& .MuiButtonBase-root":{textTransform:"none"}}),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 Zn;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Zn||(Zn={}));const ni=e=>{const{sidebarConfig:o}=(0,m.useContext)(sr),{openDelayMs:a=o.defaultOpenDelayMs,closeDelayMs:d=o.defaultCloseDelayMs,disableExpandOnHover:p,children:y}=e,E=xs({sidebarConfig:o}),U=(0,tt.Z)(Qt=>Qt.breakpoints.down("md"),{noSsr:!0}),[Y,M]=(0,m.useState)(Zn.Closed),fe=(0,m.useRef)(),{isPinned:ae,toggleSidebarPinState:ye}=Wr(),we=()=>{ae||p||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),Y!==Zn.Open&&!U&&(fe.current=window.setTimeout(()=>{fe.current=void 0,M(Zn.Open)},a),M(Zn.Idle)))},Me=()=>{ae||p||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),Y===Zn.Idle?M(Zn.Closed):Y===Zn.Open&&(fe.current=window.setTimeout(()=>{fe.current=void 0,M(Zn.Closed)},d)))},Je=Y===Zn.Open&&!U||ae,kt=Qt=>{Qt?(M(Zn.Open),ye()):(M(Zn.Closed),ye())};return(0,n.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,n.jsx)(oi,{}),(0,n.jsx)(ds,{value:{isOpen:Je,setOpen:kt},children:(0,n.jsx)($e.Z,{className:E.root,"data-testid":"sidebar-root",onMouseEnter:p?()=>{}:we,onFocus:p?()=>{}:we,onMouseLeave:p?()=>{}:Me,onBlur:p?()=>{}:Me,children:(0,n.jsx)($e.Z,{className:ce()(E.drawer,{[E.drawerOpen]:Je}),children:y})})})]})},ri=e=>{var o;const a=zs((o=e.sidebarOptions)!==null&&o!==void 0?o:{});var d;const p=Li((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:y,disableExpandOnHover:E,openDelayMs:U,closeDelayMs:Y}=e,{isMobile:M}=Wr();return M?(0,n.jsx)(_s,{children:y}):(0,n.jsx)(sr.Provider,{value:{sidebarConfig:a,submenuConfig:p},children:(0,n.jsx)(ni,{openDelayMs:U,closeDelayMs:Y,disableExpandOnHover:E,children:y})})};function oi(){const{sidebarConfig:e}=(0,m.useContext)(sr),{focusContent:o,contentRef:a}=ys(),d=xs({sidebarConfig:e});return a!=null&&a.current?(0,n.jsx)(te.Z,{onClick:o,variant:"contained",className:ce()(d.visuallyHidden),children:"Skip to content"}):null}function bs(e,o){const a=new URLSearchParams(o.search).toString(),d=ns().parse(a),p=new URLSearchParams(e.search).toString(),y=ns().parse(p);return(0,se.isEqual)(o.pathname,e.pathname)&&(0,se.isMatch)(y,d)}const Di=(0,l.Z)(e=>({item:{height:48,width:"100%","&:hover":{background:"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:e.spacing(2.5),cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:"#FFF"},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:"#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"}),Ni=e=>{const{title:o,subtitle:a,to:d,icon:p,dropdownItems:y}=e,E=Di(),{setIsHoveredOn:U}=useContext(SidebarItemWithSubmenuContext),Y=()=>{U(!1)},M=useResolvedPath(d!=null?d:""),fe=useLocation();let ae=isLocationMatch(fe,M);const[ye,we]=useState(!1),Me=()=>{we(!ye)};return y!==void 0?(y.some(Je=>{const kt=resolvePath(Je.to);return ae=isLocationMatch(fe,kt),ae}),_jsxs(Box,{className:E.itemContainer,children:[_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:Me,onTouchStart:Je=>Je.stopPropagation(),className:classnames(E.item,ae?E.selected:void 0),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:E.label,children:[o,_jsx("br",{}),a&&_jsx(Typography,{variant:"caption",className:E.subtitle,children:a})]}),ye?_jsx(ArrowDropUpIcon,{className:E.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:E.dropdownArrow})]})}),y&&ye&&_jsx(Box,{className:E.dropdown,children:y.map((Je,kt)=>_jsx(Tooltip,{title:Je.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:Je.to,underline:"none",className:E.dropdownItem,onClick:Y,onTouchStart:Qt=>Qt.stopPropagation(),children:_jsx(Typography,{className:E.textContent,children:Je.title})})},kt))})]})):_jsx(Box,{className:E.itemContainer,children:_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames(E.item,ae?E.selected:void 0),onClick:Y,onTouchStart:Je=>Je.stopPropagation(),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:E.label,children:[o,_jsx("br",{}),a&&_jsx(Typography,{variant:"caption",className:E.subtitle,children:a})]})]})})})};var i;const r=(0,l.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:o=>{var a;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:(i=(a=e.palette.navigation.submenu)===null||a===void 0?void 0:a.background)!==null&&i!==void 0?i:"#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:"#FFF",padding:e.spacing(2.5),[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),s=e=>{const{isOpen:o}=zo(),{sidebarConfig:a,submenuConfig:d}=(0,m.useContext)(sr),p=o?a.drawerWidthOpen:a.drawerWidthClosed,y=r({left:p,submenuConfig:d}),{isHoveredOn:E}=(0,m.useContext)(Vs),[U,Y]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{Y(E)},[E]),(0,n.jsxs)($e.Z,{className:ce()(y.drawer,{[y.drawerOpen]:U}),children:[(0,n.jsx)(I.Z,{variant:"h5",className:y.title,children:e.title}),e.children]})};var c=t(26739),f=t(76600),k=t(83543),N=t(59797),V=t(98989);const ie=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Ne=()=>{const e=ie();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 ke=null;const it=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),ut=()=>{const e=it();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 jt=null,yt,Bt;const Ft=e=>(0,l.Z)(o=>{var a,d;return{root:{color:o.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[o.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(yt=(a=o.palette.navigation.navItem)===null||a===void 0?void 0:a.hoverBackground)!==null&&yt!==void 0?yt:"#404040"}},highlighted:{background:(Bt=(d=o.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&Bt!==void 0?Bt:"#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 yn(e){return(0,m.useMemo)(()=>Ft(e),[e])()}const tr=(e,o)=>(0,W.vJ)(e.props.children,a=>{let d=!1;return a.getElements().forEach(({props:{to:p,dropdownItems:y}})=>{if(!d){if(y!=null&&y.length){y.forEach(({to:E})=>d=d||bs(o,(0,ls.i3)(E)));return}p&&(d=bs(o,(0,ls.i3)(p)))}}),d},[o.pathname]);function nr(e){return e.to===void 0}const so=m.createElement(s).type,si=m.forwardRef(function({to:o,end:a,style:d,className:p,activeStyle:y,caseSensitive:E,activeClassName:U="active","aria-current":Y="page",...M},fe){let{pathname:ae}=(0,$.TH)(),{pathname:ye}=(0,$.WU)(o);E||(ae=ae.toLocaleLowerCase("en-US"),ye=ye.toLocaleLowerCase("en-US"));let we=ae===ye;!we&&!a&&(we=ae.startsWith(`${ye}/`));const Me=we?Y:void 0;return(0,n.jsx)(T.rU,{...M,to:o,ref:fe,"aria-current":Me,style:{...d,...we?y:void 0},className:ce()([p,we?U:void 0])})}),Ss=(0,m.forwardRef)((e,o)=>{const{icon:a,text:d,hasNotifications:p=!1,hasSubmenu:y=!1,disableHighlight:E=!1,onClick:U,children:Y,className:M,...fe}=e,{sidebarConfig:ae}=(0,m.useContext)(sr),ye=yn(ae),{isOpen:we}=zo(),Me=!we&&y?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},Je=(0,n.jsxs)($e.Z,{style:Me,children:[(0,n.jsx)(a,{fontSize:"small"}),!we&&y?(0,n.jsx)(V.Z,{fontSize:"small"}):(0,n.jsx)(n.Fragment,{})]}),kt=(0,n.jsx)(c.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!p,className:ce()({[ye.closedItemIcon]:!we}),children:Je}),Qt=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)($e.Z,{"data-testid":"login-button",className:ye.iconContainer,children:kt}),d&&(0,n.jsx)(I.Z,{variant:"subtitle2",className:ye.label,children:d}),(0,n.jsx)("div",{className:ye.secondaryAction,children:Y})]}),nn=we?Qt:kt,rn={onClick:U,className:ce()(M,ye.root,we?ye.open:ye.closed,nr(e)&&ye.buttonItem,{[ye.highlightable]:!E})};return nr(e)?(0,n.jsx)(te.Z,{role:"button","aria-label":d,...rn,ref:o,children:nn}):(0,n.jsx)(si,{...rn,activeClassName:ye.selected,to:e.to?e.to:"",ref:o,"aria-label":d||e.to,...fe,children:nn})}),Wo=({children:e,...o})=>{const{sidebarConfig:a}=(0,m.useContext)(sr),d=yn(a),[p,y]=(0,m.useState)(!1),E=(0,$.TH)(),U=tr(e,E),Y=(0,tt.Z)(ye=>ye.breakpoints.down("sm")),M=()=>{y(!0)},fe=()=>{y(!1)},ae=()=>Y?p?(0,n.jsx)(N.Z,{fontSize:"small",className:d.submenuArrow}):(0,n.jsx)(k.Z,{fontSize:"small",className:d.submenuArrow}):!p&&(0,n.jsx)(V.Z,{fontSize:"small",className:d.submenuArrow});return(0,n.jsx)(Vs.Provider,{value:{isHoveredOn:p,setIsHoveredOn:y},children:(0,n.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:fe,onTouchStart:p?fe:M,onMouseEnter:M,className:ce()(p&&d.highlighted),children:[(0,n.jsx)(Ss,{hasSubmenu:!0,className:U?d.selected:"",...o,children:ae()}),p&&e]})})},Cs=(0,m.forwardRef)((e,o)=>{const[a]=(0,W.vJ)(e.children,d=>d.getElements().filter(p=>p.type===so));return a?(0,n.jsx)(Wo,{...e,children:a}):(0,n.jsx)(Ss,{...e,ref:o})});function Vr(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),[a,d]=useState(""),p=yn(o),y=e.icon?e.icon:SearchIcon,E=()=>{e.onSearch(a),d("")},U=ae=>{ae.key==="Enter"&&(ae.preventDefault(),E())},Y=ae=>{d(ae.target.value)},M=ae=>{ae.preventDefault(),ae.stopPropagation()},fe=ae=>{E(),ae.preventDefault()};return _jsx(Box,{className:p.searchRoot,children:_jsx(Cs,{icon:y,to:e.to,onClick:fe,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:a,onClick:M,onChange:Y,onKeyDown:U,className:p.searchContainer,InputProps:{disableUnderline:!0,className:p.searchField},inputProps:{className:p.searchFieldHTMLInput}})})})}const Gl=(0,f.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),Kl=(0,f.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),fa=(0,f.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),ga=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),Yl=(0,f.Z)("div")(({theme:e})=>{const o=ga(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":o,"&:hover":o}}),Jl=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),o=yn(e),{isOpen:a,setOpen:d}=useSidebarOpenState();if(useMediaQuery(E=>E.breakpoints.down("md"),{noSsr:!0}))return null;const y=()=>{d(!a)};return _jsx(Button,{role:"button",onClick:y,className:o.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:o.arrows,children:a?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},ma=(0,l.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 va(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),a=ma({sidebarConfig:o}),{text:d,onClose:p}=e,y=()=>p();return _jsxs(Box,{className:a.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:d}),_jsx(Box,{className:a.introDismiss,children:_jsxs(IconButton,{onClick:y,className:a.introDismissLink,children:[_jsx(CloseIcon,{className:a.introDismissIcon}),_jsx(Typography,{component:"span",className:a.introDismissText,children:"Dismiss"})]})})]})}const Fi=e=>{const{text:o,onDismiss:a}=e,[d,p]=useState(!1),y=()=>{p(!0)};return _jsx(Collapse,{in:!d,onExited:a,children:_jsx(va,{text:o,onClose:y})})},ya=null,xa="And your recently viewed plugins will pop up here!";function Xl(e){const{isOpen:o}=useSidebarOpenState(),a={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:d,set:p}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:y,recentlyViewedItemsDismissed:E}=d!=null?d:{},U=()=>{p(M=>({...a,...M,starredItemsDismissed:!0}))},Y=()=>{p(M=>({...a,...M,recentlyViewedItemsDismissed:!0}))};return o?_jsxs(_Fragment,{children:[!y&&_jsxs(_Fragment,{children:[_jsx(Fi,{text:ya,onDismiss:U}),_jsx(SidebarDivider,{})]}),!E&&_jsx(Fi,{text:xa,onDismiss:Y})]}):null}const ba=(0,l.Z)(e=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:e.spacing(3),paddingBottom:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function Ui(e){const{className:o,stretch:a,noPadding:d,children:p,...y}=e,{contentRef:E}=ys(),U=ba();return(0,n.jsx)("article",{ref:E,tabIndex:-1,...y,className:ce()(U.root,o,{[U.stretch]:a,[U.noPadding]:d}),children:p})}var Sa=t(6487),Ca=t(99152);const wa=(0,l.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 Mi(e){const{tabs:o,onChange:a,selectedIndex:d}=e,[p,y]=(0,m.useState)(d!=null?d:0),E=wa(),U=(0,m.useCallback)((Y,M)=>{d===void 0&&y(M),a&&d!==M&&a(M)},[d,a]);return(0,m.useEffect)(()=>{d!==void 0&&y(d)},[d]),(0,n.jsx)($e.Z,{className:E.tabsWrapper,children:(0,n.jsx)(Ca.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"scrollable auto tabs example",onChange:U,value:p,children:o.map((Y,M)=>(0,m.createElement)(Sa.Z,{...Y.tabProps,"data-testid":`header-tab-${M}`,label:Y.label,key:Y.id,value:M,className:E.defaultTab,classes:{selected:E.selected,root:E.tabRoot}}))})})}function ja(e){const o=(0,$.UO)(),d=e.map(({path:ye,children:we})=>({caseSensitive:!1,path:`${ye}/*`,element:we})).sort((ye,we)=>we.path.replace(/\/\*$/,"").localeCompare(ye.path.replace(/\/\*$/,"")));var p;const y=(p=(0,$.V$)(d))!==null&&p!==void 0?p:e[0].children;var E;let U=(E=o["*"])!==null&&E!==void 0?E:"";U.startsWith("/")||(U=`/${U}`);var Y;const[M]=(Y=(0,ls.fp)(d,U))!==null&&Y!==void 0?Y:[],fe=M?e.findIndex(ye=>`${ye.path}/*`===M.route.path):0;var ae;return{index:fe===-1?0:fe,element:y,route:(ae=e[fe])!==null&&ae!==void 0?ae:e[0]}}function zi(e){const{routes:o}=e,a=(0,$.s0)(),{index:d,route:p,element:y}=ja(o),E=(0,m.useMemo)(()=>o.map(Y=>({id:Y.path,label:Y.title,tabProps:Y.tabProps})),[o]),U=Y=>{let{path:M}=o[Y];M=M.replace(/\/\*$/,""),M=M.replace(/^\//,""),a(M)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Mi,{tabs:E,selectedIndex:d,onChange:U}),(0,n.jsxs)(Ui,{children:[(0,n.jsx)(as.q,{title:p.title}),y]})]})}const ii=()=>null;(0,W.R5)(ii,"core.gatherMountPoints",!0);function Wi(e){const o=(0,n.jsx)(ii,{path:"",title:"",children:(0,n.jsx)("div",{})}).type;return m.Children.toArray(e).flatMap(a=>{if(!(0,m.isValidElement)(a))return[];if(a.type===m.Fragment)return Wi(a.props.children);if(a.type!==o)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:p,children:y,tabProps:E}=a.props;return[{path:d,title:p,children:y,tabProps:E}]})}function Ea(e){const o=Wi(e.children);return(0,n.jsx)(zi,{routes:o})}Ea.Route=ii;const Aa=(0,l.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function Ta(e){const{value:o,subvalue:a}=e,d=Aa();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)($e.Z,{className:d.value,children:o}),(0,n.jsx)($e.Z,{className:d.subvalue,children:a})]})}var ws=t(67222),Ia=t(21070),Ra=t(90324),La=t(98281),Pa=t(48049),Vi=t(51209),Hi=t(33375),ka=t(44233),Oa=t(27604),ai=t(36444),Ba=t(37971),$a=t(59709),Za=t(17373),Da=t(3702),Na=t(93111);const Fa=(0,l.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height: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"}),Ua=e=>{var o;const a=Fa(),{onChangeFilters:d}=e,[p,y]=(0,m.useState)({...e.selectedFilters}),[E,U]=(0,m.useState)(!1),Y=()=>{y({}),U(M=>!M)};return(0,m.useEffect)(()=>{d(p)},[p,d]),(0,n.jsxs)($e.Z,{className:a.root,children:[(0,n.jsxs)($e.Z,{className:a.header,children:[(0,n.jsx)($e.Z,{className:a.value,children:"Filters"}),(0,n.jsx)(te.Z,{color:"primary",onClick:Y,children:"Clear all"})]}),(0,n.jsx)($e.Z,{className:a.filters,children:((o=e.filters)===null||o===void 0?void 0:o.length)&&e.filters.map(M=>(0,n.jsx)(or,{triggerReset:E,...M.element,selected:p[M.element.label],onChange:fe=>y({...p,[M.element.label]:fe})},M.element.label))})]})},Gi={Add:(0,m.forwardRef)((e,o)=>(0,n.jsx)(Ia.Z,{...e,ref:o})),Check:(0,m.forwardRef)((e,o)=>(0,n.jsx)(La.Z,{...e,ref:o})),Clear:(0,m.forwardRef)((e,o)=>(0,n.jsx)(Hi.Z,{...e,ref:o})),Delete:(0,m.forwardRef)((e,o)=>(0,n.jsx)(ka.Z,{...e,ref:o})),DetailPanel:(0,m.forwardRef)((e,o)=>(0,n.jsx)(Vi.Z,{...e,ref:o})),Edit:(0,m.forwardRef)((e,o)=>(0,n.jsx)(Oa.Z,{...e,ref:o})),Export:(0,m.forwardRef)((e,o)=>(0,n.jsx)(Da.Z,{...e,ref:o})),Filter:(0,m.forwardRef)((e,o)=>(0,n.jsx)(ai.Z,{...e,ref:o})),FirstPage:(0,m.forwardRef)((e,o)=>(0,n.jsx)(Ba.Z,{...e,ref:o})),LastPage:(0,m.forwardRef)((e,o)=>(0,n.jsx)($a.Z,{...e,ref:o})),NextPage:(0,m.forwardRef)((e,o)=>(0,n.jsx)(Vi.Z,{...e,ref:o})),PreviousPage:(0,m.forwardRef)((e,o)=>(0,n.jsx)(Pa.Z,{...e,ref:o})),ResetSearch:(0,m.forwardRef)((e,o)=>(0,n.jsx)(Hi.Z,{...e,ref:o})),Search:(0,m.forwardRef)((e,o)=>(0,n.jsx)(ai.Z,{...e,ref:o})),SortArrow:(0,m.forwardRef)((e,o)=>(0,n.jsx)(Ra.Z,{...e,ref:o})),ThirdStateCheck:(0,m.forwardRef)((e,o)=>(0,n.jsx)(Za.Z,{...e,ref:o})),ViewColumn:(0,m.forwardRef)((e,o)=>(0,n.jsx)(Na.Z,{...e,ref:o}))};function Ki(e,o){const a=o.split(".");let d=e[a[0]];for(let p=1;p<a.length;++p){if(d===void 0)return d;const y=a[p];d=d[y]}return d}const Ma=(0,wn.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"})(ws.W$),Yi=(0,wn.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"})(ws.UW),za=(0,l.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Wa=(0,l.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Va(e,o){return e.map(a=>{const d={};let p=a.cellStyle||{};if(a.highlight)if(d.color=o.palette.textContrast,typeof p=="object")p.fontWeight=o.typography.fontWeightBold;else{const y=p;p=(E,U,Y)=>({...y(E,U,Y),fontWeight:o.typography.fontWeightBold})}return{...a,headerStyle:d,cellStyle:p}})}function Ha(e,o){return(0,se.transform)(e,(a,d,p)=>{(0,se.isEqual)(d,o[p])||(a[p]=d)})}const Ji={search:"",filtersOpen:!1,filters:{}};function Ga(e){const{toolbarRef:o,setSearch:a,hasFilters:d,selectedFiltersLength:p,toggleFilters:y}=e,E=za(),U=(0,m.useCallback)(Y=>{e.onSearchChanged(Y),a(Y)},[e,a]);return d?(0,n.jsxs)($e.Z,{className:E.root,children:[(0,n.jsxs)($e.Z,{className:E.root,children:[(0,n.jsx)(Lt.Z,{onClick:y,"aria-label":"filter list",children:(0,n.jsx)(ai.Z,{})}),(0,n.jsxs)(I.Z,{className:E.title,children:["Filters (",p,")"]})]}),(0,n.jsx)(Yi,{...e,ref:o,onSearchChanged:U})]}):(0,n.jsx)(Yi,{...e,ref:o,onSearchChanged:U})}function Xi(e){const{data:o,columns:a,options:d,title:p,subtitle:y,filters:E,initialState:U,emptyContent:Y,onStateChange:M,components:fe,...ae}=e,ye=Wa(),we=(0,ht.Z)(),Me={...Ji,...U},[Je,kt]=(0,m.useState)(Me.filtersOpen),Qt=(0,m.useCallback)(()=>kt(Dn=>!Dn),[kt]),[nn,rn]=(0,m.useState)(0),[Ot,en]=(0,m.useState)(o),[qt,xr]=(0,m.useState)(Me.filters),br=Va(a,we),[Sr,Cr]=(0,m.useState)(Me.search);(0,m.useEffect)(()=>{if(M){const Dn=Ha({search:Sr,filtersOpen:Je,filters:qt},Ji);M(Dn)}},[Sr,Je,qt,M]);const hi={headerStyle:{textTransform:"uppercase"}},Or=(0,m.useCallback)(Dn=>{var pr;return(pr=a.find(Hr=>Hr.title===Dn))===null||pr===void 0?void 0:pr.field},[a]);(0,m.useEffect)(()=>{if(typeof o=="function")return;if(!qt){en(o);return}const Dn=Object.values(qt);if(o&&Dn.flat().length){const pr=o.filter(Hr=>!!Object.entries(qt).filter(([,Gr])=>!!Gr.length).every(([Gr,dn])=>{const xn=Ki(Hr,Or(Gr));return Array.isArray(xn)&&Array.isArray(dn)?xn.some(ao=>dn.includes(ao)):Array.isArray(xn)?xn.includes(dn):Array.isArray(dn)?dn.includes(xn):xn===dn}));en(pr)}else en(o);rn(Dn.flat().length)},[o,qt,Or]);const pi=(Dn,pr)=>{const Hr=dn=>{const xn=new Set,ao=Kr=>{Kr!=null&&xn.add(Kr)};return pr&&pr.forEach(Kr=>{const Ho=Ki(Kr,Or(dn));Array.isArray(Ho)?Ho.forEach(ao):ao(Ho)}),xn},Gr=dn=>({placeholder:"All results",label:dn.column,multiple:dn.type==="multiple-select",items:[...Hr(dn.column)].sort().map(xn=>({label:xn,value:xn}))});return Dn.map(dn=>({type:dn.type,element:Gr(dn)}))},_t=!!(E!=null&&E.length),io=(0,m.useCallback)(Dn=>(0,n.jsx)(Ga,{setSearch:Cr,hasFilters:_t,selectedFiltersLength:nn,toggleFilters:Qt,...Dn}),[Qt,_t,nn,Cr]),Es=typeof o!="function"&&o.length===0,Br=a.length,fi=(0,m.useCallback)(Dn=>Y&&Es?(0,n.jsx)("tbody",{children:(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:Br,children:Y})})}):(0,n.jsx)(ws.os,{...Dn}),[Es,Y,Br]);return(0,n.jsxs)($e.Z,{className:ye.root,children:[Je&&o&&typeof o!="function"&&(E==null?void 0:E.length)&&(0,n.jsx)(Ua,{filters:pi(E,o),selectedFilters:qt,onChangeFilters:xr}),(0,n.jsx)(ws.ZP,{components:{Header:Ma,Toolbar:io,Body:fi,...fe},options:{...hi,...d},columns:br,icons:Gi,title:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(I.Z,{variant:"h5",component:"h2",children:p}),y&&(0,n.jsx)(I.Z,{color:"textSecondary",variant:"body1",children:y})]}),data:typeof o=="function"?o:Ot,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...ae})]})}Xi.icons=Object.freeze(Gi);const Ql=e=>{const{children:o,value:a,index:d,...p}=e;return _jsx(Box,{role:"tabpanel",hidden:a!==d,"aria-labelledby":`scrollable-auto-tab-${d}`,...p,children:a===d&&_jsx(Box,{p:3,children:o})})},Ka=(0,l.Z)(e=>({root:{color:"#6E6E6E",overflow:"visible",fontSize:e.typography.h5.fontSize,textAlign:"center",borderRadius:"50%",backgroundColor:"#E6E6E6",marginLeft:o=>o.isNext?"auto":"0",marginRight:o=>o.isNext?"0":e.spacing(1.25),"&:hover":{backgroundColor:"#E6E6E6",opacity:"1"}}}),{name:"BackstageTabIcon"}),ql=e=>{const o=Ka(e),{ariaLabel:a,onClick:d}=e;return _jsx(IconButton,{onClick:d,className:o.root,size:"small",disableRipple:!0,disableFocusRipple:!0,"aria-label":a,children:e.children})},Ya=(e,o)=>o?e?"20px":"0":"40px",Ja=(0,l.Z)(e=>({root:{textTransform:"none",height:"64px",fontWeight:e.typography.fontWeightBold,fontSize:e.typography.pxToRem(13),color:e.palette.textSubtle,marginLeft:o=>Ya(o.isFirstNav,o.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:e.palette.textSubtle}}}),{name:"BackstageTab"}),_l=e=>{const o=Ja(e),{isFirstNav:a,isFirstIndex:d,...p}=e;return _jsx(Tab,{classes:o,disableRipple:!0,...p})},Xa=(0,l.Z)(e=>({indicator:{display:"flex",justifyContent:"center",backgroundColor:e.palette.tabbar.indicator,height:e.spacing(.5)},flexContainer:{alignItems:"center"},root:{"&:last-child":{marginLeft:"auto"}}}),{name:"BackstageTabBar"}),ec=e=>{const o=Xa(e);return _jsx(Tabs,{classes:o,...e,TabIndicatorProps:{children:_jsx(Typography,{component:"span"})}})},Qa=(0,l.Z)(e=>({root:{flexGrow:1,width:"100%"},styledTabs:{backgroundColor:e.palette.background.paper},appbar:{boxShadow:"none",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(1.25),paddingRight:e.spacing(1.25)}}),{name:"BackstageTabs"});function tc(e){const{tabs:o}=e,a=Qa(),[d,p]=useState([0,0]),[y,E]=useState(0),[U,Y]=useState(0),[M,fe]=useState([[]]),ae=useRef(),{width:ye}=useWindowSize(),we=(nn,rn)=>{p([y,rn])},Me=()=>{E(y-1)},Je=()=>{E(y+1)},kt=()=>y+1<M.length;useEffect(()=>{const rn=y===0?1:2,Ot=ae.current.offsetWidth-20-rn*30,en=d[0]*U+d[1],qt=Math.floor(Ot/170);Y(qt),fe(chunkArray(o,qt)),p([Math.floor(en/qt),en%qt])},[ye,o]);const Qt=y===d[0]?d[1]:!1;return _jsxs(Box,{className:a.root,children:[_jsx(AppBar,{ref:ae,className:a.appbar,position:"static",children:_jsx(Box,{children:_jsxs(StyledTabs,{value:Qt,onChange:we,selectionFollowsFocus:!0,children:[y!==0&&_jsx(StyledIcon,{onClick:Me,ariaLabel:"navigate-before",children:_jsx(NavigateBeforeIcon,{})}),M[y].map((nn,rn)=>_jsx(StyledTab,{value:rn,isFirstIndex:rn===0,isFirstNav:y===0,icon:nn.icon||void 0,label:nn.label||void 0},rn)),kt()&&_jsx(StyledIcon,{isNext:!0,onClick:Je,ariaLabel:"navigate-next",children:_jsx(NavigateNextIcon,{})})]})})}),Qt!==!1?M[y].map((nn,rn)=>_jsx(TabPanel,{value:rn,index:Qt,children:nn.content},rn)):_jsx(TabPanel,{value:d[1],index:d[1],children:M[d[0]][d[1]].content},"panel_outside_chunked_array")]})}var nc=t(44311);function qa(e,o){const a=e[e.length-1];if(!!a)return a>=.9?o.palette.status.ok:a>=.5?o.palette.status.warning:o.palette.status.error}function rc(e){const o=useTheme();if(!e.data)return null;var a;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(a=e.color)!==null&&a!==void 0?a:qa(e.data,o)})]})}const _a=e=>(0,l.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"}),el=({title:e="Unknown page",className:o})=>(0,n.jsx)(I.Z,{variant:"h4",component:"h2",className:o,"data-testid":"header-title",children:e});function tl(e){const{description:o,title:a,titleComponent:d=void 0,children:p,textAlign:y="left"}=e,E=_a({textAlign:y})(),U=d||(0,n.jsx)(el,{title:a,className:E.title});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(as.q,{title:a}),(0,n.jsxs)($e.Z,{className:E.container,children:[(0,n.jsxs)($e.Z,{className:E.leftItemsBox,children:[U,o&&(0,n.jsx)(I.Z,{className:E.description,variant:"body2",children:o})]}),(0,n.jsx)($e.Z,{className:E.rightItemsBox,children:p})]})]})}var nl=t.p+"static/mic-drop.fe3ef4d0..svg";const rl=(0,l.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),ol=()=>{const e=rl();return(0,n.jsx)("img",{src:nl,className:e.micDrop,alt:"Girl dropping mic from her hands"})},sl=(0,l.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:e.typography.h3.fontSize}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function il(e){const{status:o,statusMessage:a,additionalInfo:d,supportUrl:p}=e,y=sl(),E=(0,$.s0)(),U=to();return(0,n.jsxs)(Ue.Z,{container:!0,spacing:0,className:y.container,children:[(0,n.jsxs)(Ue.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,n.jsxs)(I.Z,{"data-testid":"error",variant:"body1",className:y.subtitle,children:["ERROR ",o,": ",a]}),(0,n.jsx)(I.Z,{variant:"body1",className:y.subtitle,children:d}),(0,n.jsx)(I.Z,{variant:"h2",className:y.title,children:"Looks like someone dropped the mic!"}),(0,n.jsxs)(I.Z,{variant:"h6",children:[(0,n.jsx)(at,{to:"#","data-testid":"go-back-link",onClick:()=>E(-1),children:"Go back"}),"... or please"," ",(0,n.jsx)(at,{to:p||U.url,children:"contact support"})," if you think this is a bug."]})]}),(0,n.jsx)(ol,{})]})}var al=t(16173);const ll=(0,wn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(I.Z),li=(0,wn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})($e.Z);function cl(e){const{children:o,...a}=e,[d,p]=m.useState(null),y=m.Children.toArray(o),[E,U,...Y]=y,M=Y.length?Y.pop():y[y.length-1],fe=y.length>3,ae=Me=>{p(Me.currentTarget)},ye=()=>{p(null)},we=Boolean(d);return(0,n.jsxs)(m.Fragment,{children:[(0,n.jsxs)(al.Z,{"aria-label":"breadcrumb",...a,children:[y.length>1&&(0,n.jsx)(li,{clone:!0,children:E}),y.length>2&&(0,n.jsx)(li,{clone:!0,children:U}),fe&&(0,n.jsx)(ll,{onClick:ae,children:"..."}),(0,n.jsx)($e.Z,{style:{fontStyle:"italic"},children:M})]}),(0,n.jsx)(ts.ZP,{open:we,anchorEl:d,onClose:ye,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,n.jsx)(st.Z,{children:Y.map((Me,Je)=>(0,n.jsx)(De.Z,{button:!0,children:(0,n.jsx)(li,{clone:!0,children:Me})},Je))})})]})}const dl=(0,l.Z)(e=>({header:{gridArea:"pageHeader",padding:e.spacing(3),width:"100%",boxShadow:e.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:e.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[e.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto",alignItems:"center"},title:{color:e.page.fontColor,wordBreak:"break-word",fontSize:e.typography.h3.fontSize,marginBottom:0},subtitle:{color:e.page.fontColor,opacity:.8,display:"inline-block",marginTop:e.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:e.spacing(1),color:e.page.fontColor},breadcrumb:{color:e.page.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-e.spacing(.3),marginBottom:e.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-e.spacing(.3),marginBottom:e.spacing(.3)}}),{name:"BackstageHeader"}),ul=({type:e,typeLink:o,classes:a,pageTitle:d})=>e?o?(0,n.jsxs)(cl,{className:a.breadcrumb,children:[(0,n.jsx)(at,{to:o,children:e}),(0,n.jsx)(I.Z,{children:d})]}):(0,n.jsx)(I.Z,{className:a.type,children:e}):null,hl=({pageTitle:e,classes:o,tooltip:a})=>{const d=(0,n.jsx)(I.Z,{className:o.title,variant:"h1",children:e});return a?(0,n.jsx)(We.ZP,{title:a,placement:"top-start",children:d}):d},pl=({classes:e,subtitle:o})=>o?typeof o!="string"?(0,n.jsx)(n.Fragment,{children:o}):(0,n.jsx)(I.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:o}):null;function Qi(e){const{children:o,pageTitleOverride:a,style:d,subtitle:p,title:y,tooltip:E,type:U,typeLink:Y}=e,M=dl(),ae=(0,W.h_)(W.Ds).getOptionalString("app.title")||"Backstage",ye=a||y,we=y||a,Me=`${ye} | %s | ${ae}`,Je=`${ye} | ${ae}`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(as.q,{titleTemplate:Me,defaultTitle:Je}),(0,n.jsxs)("header",{style:d,className:M.header,children:[(0,n.jsxs)($e.Z,{className:M.leftItemsBox,children:[(0,n.jsx)(ul,{classes:M,type:U,typeLink:Y,pageTitle:we}),(0,n.jsx)(hl,{classes:M,pageTitle:we,tooltip:E}),(0,n.jsx)(pl,{classes:M,subtitle:p})]}),(0,n.jsx)(Ue.Z,{container:!0,className:M.rightItemsBox,spacing:4,children:o})]})]})}const fl=({label:e,secondaryLabel:o,icon:a,disabled:d=!1,onClick:p})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:d,button:!0,onClick:y=>{p&&p(y)},children:[a&&_jsx(ListItemIcon,{children:a}),_jsx(ListItemText,{primary:e,secondary:o})]})});function oc(e){const{actionItems:o}=e,[a,d]=React.useState(!1),p=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>d(!0),"data-testid":"header-action-menu",ref:p,style:{color:"white",height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:a,anchorEl:p.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>d(!1),children:_jsx(List,{children:o.map((y,E)=>_jsx(fl,{...y},`header-action-menu-${E}`))})})]})}const gl=(0,l.Z)(e=>({root:{textAlign:"left"},label:{color:e.palette.common.white,fontWeight:e.typography.fontWeightBold,letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:"rgba(255, 255, 255, 0.8)",fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),ml=({value:e,className:o})=>(0,n.jsx)(I.Z,{className:o,children:e});function vl(e){const{label:o,value:a,url:d}=e,p=gl(),y=(0,n.jsx)(ml,{className:p.value,value:a||"<Unknown>"});return(0,n.jsx)(Ue.Z,{item:!0,children:(0,n.jsxs)(I.Z,{component:"span",className:p.root,children:[(0,n.jsx)(I.Z,{className:p.label,children:o}),d?(0,n.jsx)(at,{to:d,children:y}):y]})})}const yl=e=>(0,P.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),xl=(0,l.Z)(yl,{name:"BackstageItemCardHeader"});function bl(e){const{title:o,subtitle:a,children:d}=e,p=xl(e);return(0,n.jsxs)($e.Z,{className:p.root,children:[a&&(0,n.jsx)(I.Z,{variant:"subtitle2",component:"h3",children:a}),o&&(0,n.jsx)(I.Z,{variant:"h6",component:"h4",children:o}),d]})}function sc(e){const{description:o,tags:a,title:d,type:p,subtitle:y,label:E,onClick:U,href:Y}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:d,subtitle:y||p})}),_jsxs(CardContent,{children:[a!=null&&a.length?_jsx(Box,{children:a.map((M,fe)=>_jsx(Chip,{size:"small",label:M},fe))}):null,o]}),_jsxs(CardActions,{children:[!Y&&_jsx(Button,{to:"#",onClick:U,color:"primary",children:E}),Y&&_jsx(Button,{to:Y,color:"primary",children:E})]})]})}const Sl=e=>(0,P.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),Cl=(0,l.Z)(Sl,{name:"BackstageItemCardGrid"});function wl(e){const{children:o,...a}=e,d=Cl(a);return(0,n.jsx)($e.Z,{className:d.root,...a,children:o})}var jl=t(41547);const El=(0,l.Z)(()=>({root:({isMobile:e})=>({display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",height:e?"100%":"100vh",overflowY:"auto"})}),{name:"BackstagePage"});function qi(e){const{themeId:o,children:a}=e,{isMobile:d}=Wr(),p=El({isMobile:d});return(0,n.jsx)(jl.Z,{theme:y=>({...y,page:y.getPageTheme({themeId:o})}),children:(0,n.jsx)("main",{className:p.root,children:a})})}function Al(e){const{themeId:o,children:a,...d}=e;return(0,n.jsxs)(qi,{themeId:o,children:[(0,n.jsx)(Qi,{...d}),a]})}var Yn=t(30195);const ic=Yn.z.object({providerInfo:Yn.z.object({}).catchall(Yn.z.unknown()).optional(),profile:Yn.z.object({email:Yn.z.string().optional(),displayName:Yn.z.string().optional(),picture:Yn.z.string().optional()}),backstageIdentity:Yn.z.object({token:Yn.z.string(),identity:Yn.z.object({type:Yn.z.literal("user"),userEntityRef:Yn.z.string(),ownershipEntityRefs:Yn.z.array(Yn.z.string())})})}),_i={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function Tl(e){const o=new Date(Date.now()+_i.defaultTokenExpiryMillis);if(!e)return o;const[a,d,p]=e.split("."),y=JSON.parse(window.atob(d));return typeof y.exp!="number"?o:new Date(y.exp*1e3-_i.tokenExpiryMarginMillis)}class ac{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:o}=this.getSessionSync(),a=o.identity.userEntityRef,d=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(a);if(!d)throw new TypeError(`Invalid user entity reference "${a}"`);return d[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const o=this.state.type==="active"?this.state.session:void 0,a=this.fetchSession().then(d=>(this.state={type:"active",session:d,expiresAt:Tl(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:a,previous:o},a}async fetchSession(){const o=await this.options.discoveryApi.getBaseUrl("auth"),a=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,d=new Headers(a);d.set("X-Requested-With","XMLHttpRequest");const p=await fetch(`${o}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:d,credentials:"include"});if(!p.ok)throw await ResponseError.fromResponse(p);return proxiedSessionSchema.parse(await p.json())}constructor(o){this.options=o,this.abortController=new AbortController,this.state={type:"empty"}}}const lc=e=>{const o=useApi(discoveryApiRef),[{status:a,error:d},{execute:p}]=useAsync(async()=>{const y=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:o,headers:e.headers});await y.start(),e.onSignInSuccess(y)});return useMountEffect(p),a==="loading"?_jsx(Progress,{}):d?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},Il=(0,l.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),ci=({children:e})=>{const o=Il();return(0,n.jsx)(Ue.Z,{component:"li",item:!0,classes:o,children:e})};class di{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 Rl(e){const[o,a,d]=e.split(".");return JSON.parse(window.atob(a))}class ui{getUserId(){return this.result.userId}static fromResult(o){return new ui(o)}async getIdToken(){var o,a;return(a=(o=this.result).getIdToken)===null||a===void 0?void 0:a.call(o)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const o=await this.getIdToken();if(!o){const p=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:p,ownershipEntityRefs:[p]}}const{sub:a,ent:d}=Rl(o);return{type:"user",userEntityRef:a,ownershipEntityRefs:d!=null?d:[]}}async getCredentials(){var o,a;return{token:await((a=(o=this.result).getIdToken)===null||a===void 0?void 0:a.call(o))}}async signOut(){var o,a;return(a=(o=this.result).signOut)===null||a===void 0?void 0:a.call(o)}constructor(o){this.result=o}}class Vo{static createGuest(){return new di}static fromLegacy(o){return ui.fromResult(o)}static create(o){return new Vo(o.identity,o.authApi,o.profile)}getUserId(){const o=this.identity.userEntityRef,a=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(o);if(!a)throw new TypeError(`Invalid user entity reference "${o}"`);return a[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,a,d){this.identity=o,this.authApi=a,this.profile=d}}const Ll={Component:({config:e,onSignInSuccess:o})=>{const{apiRef:a,title:d,message:p}=e,y=(0,W.h_)(a),E=(0,W.h_)(W.VE),U=async()=>{try{const Y=await y.getBackstageIdentity({instantPopup:!0});if(!Y)throw new Error(`The ${d} provider is not configured to support sign-in`);const M=await y.getProfile();o(Vo.create({identity:Y.identity,profile:M,authApi:y}))}catch(Y){E.post(new Ir.SP("Login failed",Y))}};return(0,n.jsx)(ci,{children:(0,n.jsx)(Rr,{variant:"fullHeight",title:d,actions:(0,n.jsx)(te.Z,{color:"primary",variant:"outlined",onClick:U,children:"Sign In"}),children:(0,n.jsx)(I.Z,{variant:"body1",children:p})})})},loader:async(e,o)=>{const a=e.get(o),d=await a.getBackstageIdentity({optional:!0});if(!d)return;const p=await a.getProfile();return Vo.create({identity:d.identity,profile:p,authApi:a})}},Pl={Component:({onSignInSuccess:e})=>(0,n.jsx)(ci,{children:(0,n.jsx)(Rr,{title:"Guest",variant:"fullHeight",actions:(0,n.jsx)(te.Z,{color:"primary",variant:"outlined",onClick:()=>e(new di),children:"Enter"}),children:(0,n.jsxs)(I.Z,{variant:"body1",children:["Enter as a Guest User.",(0,n.jsx)("br",{}),"You will not have a verified identity,",(0,n.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new di};var kl=t(63955),ea=t(86619),ta=t(74828),Ol=t(45455),Bl=t.n(Ol);const $l=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Zl=(0,l.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),na=e=>{const{ref:o,...a}=e;return{inputRef:o,...a}},Dl={Component:({onSignInSuccess:e})=>{const o=Zl(),{register:a,handleSubmit:d,formState:p}=(0,kl.cI)({mode:"onChange"}),{errors:y}=p,E=({userId:U,idToken:Y})=>{e(Vo.fromLegacy({userId:U,getIdToken:Y!==void 0?async()=>Y:void 0,profile:{email:`${U}@example.com`}}))};return(0,n.jsx)(ci,{children:(0,n.jsxs)(Rr,{title:"Custom User",variant:"fullHeight",children:[(0,n.jsxs)(I.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,n.jsx)("br",{}),"This selection will not be stored."]}),(0,n.jsxs)("form",{className:o.form,onSubmit:d(E),children:[(0,n.jsxs)(ne.Z,{children:[(0,n.jsx)(ea.Z,{...na(a("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(y.userId)}),y.userId&&(0,n.jsx)(ta.Z,{error:!0,children:y.userId.message})]}),(0,n.jsxs)(ne.Z,{children:[(0,n.jsx)(ea.Z,{...na(a("idToken",{required:!1,validate:U=>!U||$l.test(U)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(y.idToken)}),y.idToken&&(0,n.jsx)(ta.Z,{error:!0,children:y.idToken.message})]}),(0,n.jsx)(te.Z,{type:"submit",color:"primary",variant:"outlined",className:o.button,disabled:!(p!=null&&p.isDirty)||!Bl()(y),children:"Continue"})]})]})})},loader:async()=>{}},js="@backstage/core:SignInPage:provider",ra={guest:Pl,custom:Dl,common:Ll};function oa(e,o){if(e in o)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function gc(e){return e.reduce((a,d)=>{if(typeof d=="string")return oa(d,a),a[d]={components:ra[d],id:d},a;const{id:p}=d;return oa(p,a),a[p]={components:ra.common,id:p,config:d},a},{})}const mc=(e,o)=>{const a=useApi(errorApiRef),d=useApiHolder(),[p,y]=useState(!0),E=useCallback(Y=>{o(IdentityApiSignOutProxy.from({identityApi:Y,signOut:async()=>{var M;localStorage.removeItem(js),await((M=Y.signOut)===null||M===void 0?void 0:M.call(Y))}}))},[o]);useLayoutEffect(()=>{var Y;if(!p)return;const M=localStorage.getItem(js);if(M===null){y(!1);return}const fe=e[M];if(!fe){y(!1);return}let ae=!1;return fe.components.loader(d,(Y=fe.config)===null||Y===void 0?void 0:Y.apiRef).then(ye=>{ae||(ye?E(ye):y(!1))}).catch(ye=>{ae||(localStorage.removeItem(js),a.post(ye),y(!1))}),()=>{ae=!0}},[p,a,o,d,e,E]);const U=useMemo(()=>Object.keys(e).map(Y=>{const M=e[Y],{Component:fe}=M.components,ae=ye=>{localStorage.setItem(js,M.id),E(ye)};return _jsx(fe,{config:M.config,onSignInSuccess:ae},M.id)}),[e,E]);return[p,U]},Nl=({onSignInSuccess:e,providers:o=[],title:a,align:d="left"})=>{const p=useApi(configApiRef),y=useStyles(),E=getSignInProviders(o),[U,Y]=useSignInProviders(E,e);return U?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:p.getString("app.title")}),_jsxs(Content,{children:[a&&_jsx(ContentHeader,{title:a,textAlign:d}),_jsx(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:y,children:Y})]})]})},Fl=({provider:e,auto:o,onSignInSuccess:a})=>{const d=useStyles(),p=useApi(e.apiRef),y=useApi(configApiRef),[E,U]=useState(),[Y,M]=useState(!1),fe=async({checkExisting:ae,showPopup:ye})=>{try{let we;if(ae&&(we=await p.getBackstageIdentity({optional:!0})),!we&&(ye||o)&&(M(!0),we=await p.getBackstageIdentity({instantPopup:!0}),!we))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!we){M(!0);return}const Me=await p.getProfile();a(UserIdentity.create({identity:we.identity,authApi:p,profile:Me}))}catch(we){U(we),M(!0)}};return useMountEffect(()=>fe({checkExisting:!0})),Y?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:y.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:d,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{fe({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),E&&E.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:E.message})]})})})})]}):_jsx(Progress,{})};function vc(e){return"provider"in e?_jsx(Fl,{...e}):_jsx(Nl,{...e})}const Ul=(0,l.Z)(e=>({root:{padding:e.spacing(0,2,0,2.5),minHeight:e.spacing(3)},indicator:{backgroundColor:e.palette.info.main,height:e.spacing(.3)}}),{name:"BackstageTabbedCard"}),Ml=(0,wn.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(Kt.Z);function yc(e){const{slackChannel:o,errorBoundaryProps:a,children:d,title:p,deepLink:y,value:E,onChange:U}=e,Y=Ul(),[M,fe]=useState(0),ae=U||((Me,Je)=>fe(Je));let ye;E?React.Children.map(d,Me=>{if(React.isValidElement(Me)&&(Me==null?void 0:Me.props.value)===E){var Je;ye=Me==null||(Je=Me.props)===null||Je===void 0?void 0:Je.children}}):React.Children.map(d,(Me,Je)=>{React.isValidElement(Me)&&Je===M&&(ye=Me==null?void 0:Me.props.children)});const we=a||(o?{slackChannel:o}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...we,children:[p&&_jsx(Ml,{title:p}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:Y,value:E||M,onChange:ae,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:ye}),y&&_jsx(BottomLink,{...y})]})})}const zl=(0,l.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:e.typography.fontWeightBold}}),{name:"BackstageCardTab"});function xc(e){const{children:o,...a}=e,d=zl();return _jsx(Tab,{disableRipple:!0,classes:d,...a})}},25248:function(At,Be,t){"use strict";t.d(Be,{fC:function(){return S},CL:function(){return Ke},sM:function(){return K},$v:function(){return Ge},v_:function(){return Ye},hg:function(){return dt},uB:function(){return Se},R5:function(){return xt},bq:function(){return C},Km:function(){return X},Ds:function(){return ze},ni:function(){return I},T0:function(){return B},CO:function(){return On},x8:function(){return kn},rx:function(){return An},YO:function(){return Bn},P4:function(){return Mn},NT:function(){return Yt},NW:function(){return at},VE:function(){return ot},W0:function(){return Qe},gP:function(){return $e},IY:function(){return wt},F4:function(){return se},ux:function(){return T},Kp:function(){return ce},$4:function(){return ht},p_:function(){return z},ZM:function(){return gt},D:function(){return $},gW:function(){return R},E6:function(){return Ct},z$:function(){return We},h_:function(){return oe},I_:function(){return P},qD:function(){return Fe},vJ:function(){return Hn},yx:function(){return Pe},tg:function(){return ln},Oi:function(){return tn}});var h=t(52322),n=t(51837),W=t(2784);const O=(0,n.CT)("analytics-context"),m=()=>{const ge=(0,W.useContext)(O);if(ge===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const re=ge.atVersion(1);if(re===void 0)throw new Error("No context found for version 1.");return re},S=ge=>{const{attributes:re,children:je}=ge,_e={...m(),...re},pt=(0,n.EI)({1:_e});return(0,h.jsx)(O.Provider,{value:pt,children:je})};function l(ge,re){const je=Ze=>_jsx(S,{attributes:re,children:_jsx(ge,{...Ze})});return je.displayName=`WithAnalyticsContext(${ge.displayName||ge.name||"Component"})`,je}function P(){const ge=(0,n.Vt)("api-context");if(!ge)throw new Error("API context is not available");const re=ge.atVersion(1);if(!re)throw new Error("ApiContext v1 not available");return re}function oe(ge){const je=P().get(ge);if(!je)throw new Error(`No implementation available for ${ge}`);return je}function _(ge){return function(je){const Ze=pt=>{const ue=P(),F={};for(const he in ge)if(ge.hasOwnProperty(he)){const Re=ge[he],et=ue.get(Re);if(!et)throw new Error(`No implementation available for ${Re}`);F[he]=et}return _jsx(je,{...pt,...F})},_e=je.displayName||je.name||"Component";return Ze.displayName=`withApis(${_e})`,Ze}}class te{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(re){if(this.config=re,!re.id.split(".").flatMap(Ze=>Ze.split("-")).every(Ze=>Ze.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${re.id}'`)}}function B(ge){return new te(ge)}function I(ge,re){return"id"in ge?{api:ge,deps:{},factory:()=>re}:ge}var K;(function(ge){ge.SignedIn="SignedIn",ge.SignedOut="SignedOut"})(K||(K={}));const ce=B({id:"core.auth.google"}),se=B({id:"core.auth.github"}),$=B({id:"core.auth.okta"}),T=B({id:"core.auth.gitlab"}),z=B({id:"core.auth.microsoft"}),R=B({id:"core.auth.onelogin"}),C=B({id:"core.auth.bitbucket"}),X=B({id:"core.auth.bitbucket-server"}),Se=B({id:"core.auth.atlassian"}),Ge=B({id:"core.alert"}),Ye=B({id:"core.analytics"}),dt=B({id:"core.apptheme"}),ze=B({id:"core.config"}),at=B({id:"core.discovery"}),ot=B({id:"core.error"});var Ke;(function(ge){ge[ge.None=0]="None",ge[ge.Active=1]="Active"})(Ke||(Ke={}));const Qe=B({id:"core.featureflags"}),$e=B({id:"core.fetch"}),ht=B({id:"core.identity"}),gt=B({id:"core.oauthrequest"}),Ct=B({id:"core.storage"});class $t{setContext(re){this.context=re}captureEvent(re,je,{value:Ze,attributes:_e}={}){try{this.analyticsApi.captureEvent({action:re,subject:je,value:Ze,attributes:_e,context:this.context})}catch(pt){console.warn("Error during analytics event capture. %o",pt)}}constructor(re,je={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=re,this.context=je}}function Lt(){try{return oe(Ye)}catch{return{captureEvent:()=>{}}}}function We(){const ge=(0,W.useRef)(null),re=m(),je=Lt();function Ze(){return ge.current===null&&(ge.current=new $t(je)),ge.current}const _e=Ze();return _e.setContext(re),_e}const me="plugin-context",Le=ge=>{const{children:re,plugin:je}=ge,{Provider:Ze}=(0,n.CT)(me);return(0,h.jsx)(Ze,{value:(0,n.EI)({1:{plugin:je}}),children:re})};function Pe(){const ge=(0,n.Vt)(me);if(!ge)throw new Error("Plugin Options context is not available");const re=ge.atVersion(1);if(!re)throw new Error("Plugin Options v1 is not available");return re.plugin.getPluginOptions()}const Fe=()=>{const ge=(0,n.Vt)("app-context");if(!ge)throw new Error("App context is not available");const re=ge.atVersion(1);if(!re)throw new Error("AppContext v1 not available");return re},tt=(0,n.uW)("component-data-store",()=>new WeakMap),Zt="__backstage_data";function xt(ge,re,je){const Ze=ge;var _e;let pt=(_e=Ze[Zt])!==null&&_e!==void 0?_e:tt.get(ge);if(pt||(pt={map:new Map},Object.defineProperty(Ze,Zt,{enumerable:!1,configurable:!0,writable:!1,value:pt}),tt.set(ge,pt)),pt.map.has(re)){const ue=ge.displayName||ge.name;throw new Error(`Attempted to attach duplicate data "${re}" to component "${ue}"`)}pt.map.set(re,je)}function wt(ge,re){if(!ge)return;const je=ge.type;if(!je)return;var Ze;const _e=(Ze=je[Zt])!==null&&Ze!==void 0?Ze:tt.get(je);if(!!_e)return _e.map.get(re)}const bt=(0,n.uW)("route-ref-type",()=>Symbol("route-ref-type"));let Pt=bt;class Gt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(re,je){this.id=re,this.params=je,this[Pt]="absolute"}}function Yt(ge){var re;return new Gt(ge.id,(re=ge.params)!==null&&re!==void 0?re:[])}const an=/^\w+$/;let Mt=null;class hn{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(re,je,Ze,_e){this.id=re,this.path=je,this.parent=Ze,this.params=_e,this[Mt]="sub"}}function bn(ge){const{id:re,path:je,parent:Ze}=ge,_e=je.split("/").filter(F=>F.startsWith(":")).map(F=>F.substring(1)),pt=[...Ze.params,..._e];if(Ze.params.some(F=>_e.includes(F)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!je.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${je}'`);if(je.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${je}'`);for(const F of _e)if(!an.test(F))throw new Error(`SubRouteRef path has invalid param, got '${F}'`);return new hn(re,je,Ze,pt)}let Fn=bt;class Sn{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(re,je,Ze){this.id=re,this.params=je,this.optional=Ze,this[Fn]="external"}}function kn(ge){var re;return new Sn(ge.id,(re=ge.params)!==null&&re!==void 0?re:[],Boolean(ge.optional))}var En=t(79635);function ln(ge){const{pathname:re}=(0,En.TH)(),je=(0,n.Vt)("routing-context");if(!je)throw new Error("Routing context is not available");const Ze=je.atVersion(1),_e=(0,W.useMemo)(()=>Ze&&Ze.resolve(ge,{pathname:re}),[Ze,ge,re]);if(!je)throw new Error("useRouteRef used outside of routing context");if(!Ze)throw new Error("RoutingContext v1 not available");const pt="optional"in ge&&ge.optional;if(!_e&&!pt)throw new Error(`No path for ${ge}`);return _e}function tn(ge){return(0,En.UO)()}class Un extends W.Component{static getDerivedStateFromError(re){return{error:re}}render(){const{error:re}=this.state,{app:je,plugin:Ze}=this.props,{ErrorBoundaryFallback:_e}=je.getComponents();return re?(0,h.jsx)(_e,{error:re,resetError:this.handleErrorReset,plugin:Ze}):this.props.children}constructor(...re){super(...re),this.state={error:void 0},this.handleErrorReset=()=>{this.setState({error:void 0})}}}function Mn(ge){const{component:re,mountPoint:je,name:Ze}=ge;return Bn({component:{lazy:()=>re().then(_e=>{const pt=F=>{try{ln(je)}catch(he){if(typeof he=="object"&&he!==null){const{message:Re}=he;if(typeof Re=="string"&&Re.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${je} 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 he}return(0,h.jsx)(_e,{...F})},ue=Ze||_e.displayName||_e.name||"LazyComponent";return pt.displayName=`RoutableExtension(${ue})`,pt},_e=>ue=>{const F=Fe(),{BootErrorPage:he}=F.getComponents();return(0,h.jsx)(he,{step:"load-chunk",error:_e})})},data:{"core.mountPoint":je},name:Ze})}function On(ge){const{component:re,name:je}=ge;return Bn({component:re,name:je})}function Bn(ge){const{data:re={},name:je}=ge;je||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Ze;if("lazy"in ge.component){const pt=ge.component.lazy;Ze=(0,W.lazy)(()=>pt().then(ue=>({default:ue})))}else Ze=ge.component.sync;const _e=je||Ze.displayName||Ze.name||"Component";return{expose(pt){const ue=F=>{const he=Fe(),{Progress:Re}=he.getComponents(),et=re==null?void 0:re["core.mountPoint"];return(0,h.jsx)(W.Suspense,{fallback:(0,h.jsx)(Re,{}),children:(0,h.jsx)(Un,{app:he,plugin:pt,children:(0,h.jsx)(S,{attributes:{pluginId:pt.getId(),...je&&{extension:je},...et&&{routeRef:et.id}},children:(0,h.jsx)(Le,{plugin:pt,children:(0,h.jsx)(Ze,{...F})})})})})};xt(ue,"core.plugin",pt);for(const[F,he]of Object.entries(re))xt(ue,F,he);return ue.displayName=`Extension(${_e})`,ue}}}function pn(ge,re,je,Ze){return W.Children.toArray(ge).flatMap(_e=>{if(!(0,W.isValidElement)(_e))return[];if(_e.type===W.Fragment)return pn(_e.props.children,re,je,Ze);if(wt(_e,"core.featureFlagged")){const pt=_e.props;return("with"in pt?re.isActive(pt.with):!re.isActive(pt.without))?pn(_e.props.children,re,je,Ze):[]}if(je===void 0||je(_e))return[_e];if(Ze)throw new Error(Ze);return pn(_e.props.children,re,je,Ze)})}class mn{selectByComponentData(re){const je=pn(this.node,this.featureFlagsApi,Ze=>wt(Ze,re.key)!==void 0,re.withStrictError);return new mn(je,this.featureFlagsApi)}findComponentData(re){return pn(this.node,this.featureFlagsApi,Ze=>wt(Ze,re.key)!==void 0).map(Ze=>wt(Ze,re.key)).filter(Ze=>Ze!==void 0)}getElements(){return pn(this.node,this.featureFlagsApi)}constructor(re,je){this.node=re,this.featureFlagsApi=je}}function Hn(ge,re,je=[]){const Ze=oe(Qe),_e=new mn(ge,Ze);return(0,W.useMemo)(()=>re(_e),[ge,...je])}class Cn{getId(){return this.config.id}getApis(){var re;return(re=this.config.apis)!==null&&re!==void 0?re:[]}getFeatureFlags(){var re,je;return(je=(re=this.config.featureFlags)===null||re===void 0?void 0:re.slice())!==null&&je!==void 0?je:[]}get routes(){var re;return(re=this.config.routes)!==null&&re!==void 0?re:{}}get externalRoutes(){var re;return(re=this.config.externalRoutes)!==null&&re!==void 0?re:{}}provide(re){return re.expose(this)}__experimentalReconfigure(re){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(re))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var re;return(re=this.options)!==null&&re!==void 0?re:{}}toString(){return`plugin{${this.config.id}}`}constructor(re){this.config=re,this.options=void 0}}function An(ge){return new Cn(ge)}},23054:function(At,Be,t){"use strict";t.d(Be,{SP:function(){return K},dR:function(){return te},VL:function(){return se},BD:function(){return n}});function h($){if(typeof $!="object"||$===null||Array.isArray($))return!1;const T=$;return!(typeof T.name!="string"||T.name===""||typeof T.message!="string")}function n($){if(typeof $!="object"||$===null||Array.isArray($))throw new Error(`Encountered invalid error, not an object, got '${$}'`);const T=$;if(typeof T.name!="string"||T.name==="")throw new Error(`Encountered error object without a name, got '${$}'`);if(typeof T.message!="string")throw new Error(`Encountered error object without a message, got '${$}'`)}var W=t(24852);function O($,T){const R={name:"Unknown",message:"<no reason given>",...serializeErrorInternal($)};return T!=null&&T.includeStack||delete R.stack,R}function m($){const T=(0,W.deserializeError)($);return $.stack||(T.stack=void 0),T}function S($){if(h($)){const T=String($);return T!=="[object Object]"?T:`${$.name}: ${$.message}`}return`unknown error '${$}'`}class l extends Error{constructor(T,z){var R;let C=T;if(z!==void 0){const X=S(z);C?C+=`; caused by ${X}`:C=`caused by ${X}`}super(C),(R=Error.captureStackTrace)===null||R===void 0||R.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=h(z)?z:void 0}}class P extends null{}class oe extends null{}class _ extends null{}class te extends l{}class B extends null{}class I extends null{}class K extends l{constructor(T,z){super(T,z),this.name=h(z)?z.name:"Error"}}async function ce($){try{const z=await $.text();if(z){var T;if(!((T=$.headers.get("content-type"))===null||T===void 0)&&T.startsWith("application/json"))try{const R=JSON.parse(z);if(R.error&&R.response)return R}catch{}return{error:{name:"Error",message:`Request failed with status ${$.status} ${$.statusText}, ${z}`},response:{statusCode:$.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${$.status} ${$.statusText}`},response:{statusCode:$.status}}}class se extends Error{static async fromResponse(T){const z=await ce(T),R=z.response.statusCode||T.status,C=z.error.name||T.statusText,X=`Request failed with ${R} ${C}`,Se=m(z.error);return new se({message:X,response:T,data:z,cause:Se})}constructor(T){super(T.message),this.name="ResponseError",this.response=T.response,this.body=T.data,this.cause=T.cause}}},32838:function(At,Be,t){"use strict";t.d(Be,{nW:function(){return se},ae:function(){return te},q3:function(){return B}});var h=t(25248);const n=(0,h.T0)({id:"core.scmauth"});var W=new WeakMap;class O{async getCredentials(T){const z=new URL(T.url),R=_class_private_field_get(this,W).find(C=>C.isUrlSupported(z));if(!R)throw new Error(`No auth provider available for '${T.url}', see https://backstage.io/link?scm-auth`);return R.getCredentials(T)}constructor(T){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_set(this,W,T)}}var m=new WeakMap,S=new WeakMap,l=new WeakMap,P=new WeakMap;class oe{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:T,gitlab:z,azure:R,bitbucket:C})=>oe.merge(oe.forGithub(T),oe.forGitlab(z),oe.forAzure(R),oe.forBitbucket(C))})}static forAuthApi(T,z){return new oe("generic",T,z.host,z.scopeMapping)}static forGithub(T,z){var R;const C=(R=z==null?void 0:z.host)!==null&&R!==void 0?R:"github.com";return new oe("github",T,C,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(T,z){var R;const C=(R=z==null?void 0:z.host)!==null&&R!==void 0?R:"gitlab.com";return new oe("gitlab",T,C,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(T,z){var R;const C=(R=z==null?void 0:z.host)!==null&&R!==void 0?R:"dev.azure.com";return new oe("azure",T,C,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(T,z){var R;const C=(R=z==null?void 0:z.host)!==null&&R!==void 0?R:"bitbucket.org";return new oe("bitbucket",T,C,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...T){return new O(T)}isUrlSupported(T){return T.host===_class_private_field_get(this,S)}getAdditionalScopesForProvider(T){var z;if(!(T!=null&&T.customScopes)||_class_private_field_get(this,P)==="generic")return[];var R;return(R=(z=T.customScopes)===null||z===void 0?void 0:z[_class_private_field_get(this,P)])!==null&&R!==void 0?R:[]}async getCredentials(T){const{url:z,additionalScope:R,...C}=T,X=_class_private_field_get(this,l).default.slice();R!=null&&R.repoWrite&&X.push(..._class_private_field_get(this,l).repoWrite);const Se=this.getAdditionalScopesForProvider(R);Se.length&&X.push(...Se);const Ge=[...new Set(X)],Ye=await _class_private_field_get(this,m).getAccessToken(Ge,C);return{token:Ye,headers:{Authorization:`Bearer ${Ye}`}}}constructor(T,z,R,C){_class_private_field_init(this,m,{writable:!0,value:void 0}),_class_private_field_init(this,S,{writable:!0,value:void 0}),_class_private_field_init(this,l,{writable:!0,value:void 0}),_class_private_field_init(this,P,{writable:!0,value:void 0}),_class_private_field_set(this,m,z),_class_private_field_set(this,S,R),_class_private_field_set(this,l,C),_class_private_field_set(this,P,T)}}var _=t(79158);class te{static fromConfig(T){return _.Lx.fromConfig(T)}}const B=(0,h.T0)({id:"integration.scmintegrations"});var I=t(52322),K=t(73250),ce=t(2784);const se=$=>{const{type:T}=$,z=(0,h.qD)(),R=K.Z;var C;const X=T&&(C=z.getSystemIcon(T))!==null&&C!==void 0?C:R;return(0,I.jsx)(X,{})}},79158:function(At,Be,t){"use strict";t.d(Be,{Lx:function(){return lr},BT:function(){return De}});var h=t(82717),n=t.n(h),W=t(76635);function O(j){const u=new URL("http://example.com");return u.host=j,u.host===j}function m(j){try{return new URL(j),!0}catch{return!1}}function S(j,u){return{list(){return j},byUrl(b){try{const A=typeof b=="string"?new URL(b):b;return j.find(Q=>u(Q)===A.host)}catch{return}},byHost(b){return j.find(A=>u(A)===b)}}}function l(j){const{url:u,base:b,lineNumber:A}=j;try{return new URL(u),u}catch{}let Q;if(u.startsWith("/")){const{filepath:ve}=n()(b);Q=new URL(b);const xe=(0,W.trimEnd)(Q.pathname.substring(0,Q.pathname.length-ve.length),"/");Q.pathname=`${xe}${u}`}else Q=new URL(u,b);return Q.search=new URL(b).search,A&&(Q.hash=`L${A}`),Q.toString()}const P="amazonaws.com";function oe(j){const u=j.getOptionalString("endpoint");var b;const A=(b=j.getOptionalBoolean("s3ForcePathStyle"))!==null&&b!==void 0?b:!1;let Q,ve;if(u){try{const on=new URL(u);Q=on.host,ve=on.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${u}' is not a valid URL`)}if(ve!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${u}'`)}else Q=P;const xe=j.getOptionalString("accessKeyId"),Oe=j.getOptionalString("secretAccessKey"),Ve=j.getOptionalString("roleArn"),Nt=j.getOptionalString("externalId");return{host:Q,endpoint:u,s3ForcePathStyle:A,accessKeyId:xe,secretAccessKey:Oe,roleArn:Ve,externalId:Nt}}function _(j){const u=j.map(oe);return u.some(b=>b.host===P)||u.push({host:P}),u}class te{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return l(u)}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}te.factory=({config:j})=>{var u;const b=_((u=j.getOptionalConfigArray("integrations.awsS3"))!==null&&u!==void 0?u:[]);return S(b.map(A=>new te(A)),A=>A.config.host)};var B=t(90383),I=t(22504),K=t(69866);const ce="GB";var se=new WeakMap,$=new WeakMap,T=new WeakMap,z=new WeakMap,R=new WeakMap,C=new WeakMap,X=new WeakMap;class Se{static fromRepoUrl(u){const b=new URL(u);let A,Q,ve;const xe=b.pathname.split("/").map(Vn=>decodeURIComponent(Vn));if(xe[2]==="_git"?(A=xe[1],Q=ve=xe[3]):xe[3]==="_git"?(A=xe[1],Q=xe[2],ve=xe[4]):xe[4]==="_git"&&(A=`${xe[1]}/${xe[2]}`,Q=xe[3],ve=xe[5]),!A||!Q||!ve)throw new Error("Azure URL must point to a git repository");var Oe;const Ve=(Oe=b.searchParams.get("path"))!==null&&Oe!==void 0?Oe:void 0;let Nt;const on=b.searchParams.get("version");if(on){if(on.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Nt=on.slice(2)}return new Se(b.origin,A,Q,ve,Ve,Nt)}toRepoUrl(){let u;return(0,B.Z)(this,T)===(0,B.Z)(this,z)?u=(0,B.Z)(this,X).call(this,(0,B.Z)(this,$),"_git",(0,B.Z)(this,z)):u=(0,B.Z)(this,X).call(this,(0,B.Z)(this,$),(0,B.Z)(this,T),"_git",(0,B.Z)(this,z)),(0,B.Z)(this,R)&&u.searchParams.set("path",(0,B.Z)(this,R)),(0,B.Z)(this,C)&&u.searchParams.set("version",ce+(0,B.Z)(this,C)),u.toString()}toFileUrl(){if(!(0,B.Z)(this,R))throw new Error("Azure URL must point to a specific path to be able to download a file");const u=(0,B.Z)(this,X).call(this,(0,B.Z)(this,$),(0,B.Z)(this,T),"_apis","git","repositories",(0,B.Z)(this,z),"items");return u.searchParams.set("api-version","6.0"),u.searchParams.set("path",(0,B.Z)(this,R)),(0,B.Z)(this,C)&&u.searchParams.set("version",(0,B.Z)(this,C)),u.toString()}toArchiveUrl(){const u=(0,B.Z)(this,X).call(this,(0,B.Z)(this,$),(0,B.Z)(this,T),"_apis","git","repositories",(0,B.Z)(this,z),"items");return u.searchParams.set("recursionLevel","full"),u.searchParams.set("download","true"),u.searchParams.set("api-version","6.0"),(0,B.Z)(this,R)&&u.searchParams.set("scopePath",(0,B.Z)(this,R)),(0,B.Z)(this,C)&&u.searchParams.set("version",(0,B.Z)(this,C)),u.toString()}toCommitsUrl(){const u=(0,B.Z)(this,X).call(this,(0,B.Z)(this,$),(0,B.Z)(this,T),"_apis","git","repositories",(0,B.Z)(this,z),"commits");return u.searchParams.set("api-version","6.0"),(0,B.Z)(this,C)&&u.searchParams.set("searchCriteria.itemVersion.version",(0,B.Z)(this,C)),u.toString()}getOwner(){return(0,B.Z)(this,$)}getProject(){return(0,B.Z)(this,T)}getRepo(){return(0,B.Z)(this,z)}getPath(){return(0,B.Z)(this,R)}getRef(){return(0,B.Z)(this,C)}constructor(u,b,A,Q,ve,xe){(0,I.Z)(this,se,{writable:!0,value:void 0}),(0,I.Z)(this,$,{writable:!0,value:void 0}),(0,I.Z)(this,T,{writable:!0,value:void 0}),(0,I.Z)(this,z,{writable:!0,value:void 0}),(0,I.Z)(this,R,{writable:!0,value:void 0}),(0,I.Z)(this,C,{writable:!0,value:void 0}),(0,I.Z)(this,X,{writable:!0,value:(...Oe)=>{const Ve=new URL((0,B.Z)(this,se));return Ve.pathname=Oe.map(Nt=>encodeURIComponent(Nt)).join("/"),Ve}}),(0,K.Z)(this,se,u),(0,K.Z)(this,$,b),(0,K.Z)(this,T,A),(0,K.Z)(this,z,Q),(0,K.Z)(this,R,ve),(0,K.Z)(this,C,xe)}}const Ge="dev.azure.com";function Ye(j){var u;const b=(u=j.getOptionalString("host"))!==null&&u!==void 0?u:Ge,A=j.getOptionalString("token");if(!O(b))throw new Error(`Invalid Azure integration config, '${b}' is not a valid host`);return{host:b,token:A}}function dt(j){const u=j.map(Ye);return u.some(b=>b.host===Ge)||u.push({host:Ge}),u}class ze{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:b,base:A}=u;if(m(b))return b;try{const ve=Se.fromRepoUrl(A),xe=new URL(A);var Q;const Oe=new URL(`https://a.com${(Q=ve.getPath())!==null&&Q!==void 0?Q:""}`),Ve=new URL(b,Oe).pathname;return xe.searchParams.set("path",Ve),u.lineNumber&&(xe.searchParams.set("line",String(u.lineNumber)),xe.searchParams.set("lineEnd",String(u.lineNumber+1)),xe.searchParams.set("lineStartColumn","1"),xe.searchParams.set("lineEndColumn","1")),xe.toString()}catch{return new URL(b,A).toString()}}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}ze.factory=({config:j})=>{var u;const b=dt((u=j.getOptionalConfigArray("integrations.azure"))!==null&&u!==void 0?u:[]);return S(b.map(A=>new ze(A)),A=>A.config.host)};var at=t(48834).lW;function ot(j){return AzureUrl.fromRepoUrl(j).toFileUrl()}function Ke(j){return AzureUrl.fromRepoUrl(j).toArchiveUrl()}function Qe(j){return AzureUrl.fromRepoUrl(j).toCommitsUrl()}function $e(j,u){const b=u?{...u}:{};if(j.token){const A=at.from(`:${j.token}`,"utf8");b.Authorization=`Basic ${A.toString("base64")}`}return{headers:b}}const ht="bitbucket.org",gt="https://api.bitbucket.org/2.0";function Ct(j){var u;const b=(u=j.getOptionalString("host"))!==null&&u!==void 0?u:ht;let A=j.getOptionalString("apiBaseUrl");const Q=j.getOptionalString("token"),ve=j.getOptionalString("username"),xe=j.getOptionalString("appPassword");if(!O(b))throw new Error(`Invalid Bitbucket integration config, '${b}' is not a valid host`);return A?A=(0,W.trimEnd)(A,"/"):b===ht?A=gt:A=`https://${b}/rest/api/1.0`,{host:b,apiBaseUrl:A,token:Q,username:ve,appPassword:xe}}function $t(j){const u=j.map(Ct);return u.some(b=>b.host===ht)||u.push({host:ht,apiBaseUrl:gt}),u}class Lt{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const b=l(u);if(!u.lineNumber)return b;const A=new URL(b);return this.integrationConfig.host==="bitbucket.org"?A.hash=`lines-${u.lineNumber}`:A.hash=`${u.lineNumber}`,A.toString()}resolveEditUrl(u){const b=n()(u),A=new URL(u);return A.searchParams.set("mode","edit"),A.searchParams.set("spa","0"),A.searchParams.set("at",b.ref),A.toString()}constructor(u){this.integrationConfig=u}}Lt.factory=({config:j})=>{var u,b,A;const Q=$t((A=j.getOptionalConfigArray("integrations.bitbucket"))!==null&&A!==void 0?A:[...(u=j.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[],...(b=j.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&b!==void 0?b:[]]);return S(Q.map(ve=>new Lt(ve)),ve=>ve.config.host)};var We=t(96279),me=t(48834).lW;async function Le(j,u){const{name:b,owner:A,resource:Q}=parseGitUrl(j),ve=Q==="bitbucket.org";let xe=ve?`${u.apiBaseUrl}/repositories/${A}/${b}`:`${u.apiBaseUrl}/projects/${A}/repos/${b}/default-branch`,Oe=await fetch(xe,tt(u));if(Oe.status===404&&!ve&&(xe=`${u.apiBaseUrl}/projects/${A}/repos/${b}/branches/default`,Oe=await fetch(xe,tt(u))),!Oe.ok){const Nt=`Failed to retrieve default branch from ${xe}, ${Oe.status} ${Oe.statusText}`;throw new Error(Nt)}let Ve;if(ve)Ve=(await Oe.json()).mainbranch.name;else{const{displayId:Nt}=await Oe.json();Ve=Nt}if(!Ve)throw new Error(`Failed to read default branch from ${xe}. Response ${Oe.status} ${Oe.json()}`);return Ve}async function Pe(j,u){const{name:b,owner:A,ref:Q,protocol:ve,resource:xe,filepath:Oe}=parseGitUrl(j),Ve=xe==="bitbucket.org";let Nt=Q;Nt||(Nt=await Le(j,u));const on=Oe?`&path=${encodeURIComponent(decodeURIComponent(Oe))}`:"";return Ve?`${ve}://${xe}/${A}/${b}/get/${Nt}.tar.gz`:`${u.apiBaseUrl}/projects/${A}/repos/${b}/archive?format=tgz&at=${Nt}&prefix=${A}-${b}${on}`}function Fe(j,u){try{const{owner:b,name:A,ref:Q,filepathtype:ve,filepath:xe}=parseGitUrl(j);if(!b||!A||ve!=="browse"&&ve!=="raw"&&ve!=="src")throw new Error("Invalid Bitbucket URL or file path");const Oe=xe.replace(/^\//,"");if(u.host==="bitbucket.org"){if(!Q)throw new Error("Invalid Bitbucket URL or file path");return`${u.apiBaseUrl}/repositories/${b}/${A}/src/${Q}/${Oe}`}return`${u.apiBaseUrl}/projects/${b}/repos/${A}/raw/${Oe}?at=${Q}`}catch(b){throw new Error(`Incorrect URL: ${j}, ${b}`)}}function tt(j){const u={};if(j.token)u.Authorization=`Bearer ${j.token}`;else if(j.username&&j.appPassword){const b=me.from(`${j.username}:${j.appPassword}`,"utf8");u.Authorization=`Basic ${b.toString("base64")}`}return{headers:u}}const Zt="bitbucket.org",xt="https://api.bitbucket.org/2.0";function wt(j){const u=Zt,b=xt,A=j.getString("username"),Q=j.getString("appPassword");return{host:u,apiBaseUrl:b,username:A,appPassword:Q}}function bt(j){const u=j.map(wt);return u.length===0&&u.push({host:Zt,apiBaseUrl:xt}),u}class Pt{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const b=l(u);if(u.lineNumber){const A=new URL(b);return A.hash=`lines-${u.lineNumber}`,A.toString()}return b}resolveEditUrl(u){const b=n()(u),A=new URL(u);return A.searchParams.set("mode","edit"),A.searchParams.set("at",b.ref),A.toString()}constructor(u){this.integrationConfig=u}}Pt.factory=({config:j})=>{var u;const b=bt((u=j.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[]);return S(b.map(A=>new Pt(A)),A=>A.config.host)};var Gt=t(48834).lW;async function Yt(j,u){const{name:b,owner:A}=parseGitUrl(j),Q=`${u.apiBaseUrl}/repositories/${A}/${b}`,ve=await fetch(Q,hn(u));if(!ve.ok){const Ve=`Failed to retrieve default branch from ${Q}, ${ve.status} ${ve.statusText}`;throw new Error(Ve)}const Oe=(await ve.json()).mainbranch.name;if(!Oe)throw new Error(`Failed to read default branch from ${Q}. Response ${ve.status} ${ve.json()}`);return Oe}async function an(j,u){const{name:b,owner:A,ref:Q,protocol:ve,resource:xe}=parseGitUrl(j);let Oe=Q;return Oe||(Oe=await Yt(j,u)),`${ve}://${xe}/${A}/${b}/get/${Oe}.tar.gz`}function Mt(j,u){try{const{owner:b,name:A,ref:Q,filepathtype:ve,filepath:xe}=parseGitUrl(j);if(!b||!A||ve!=="src"&&ve!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Oe=xe.replace(/^\//,"");if(!Q)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${u.apiBaseUrl}/repositories/${b}/${A}/src/${Q}/${Oe}`}catch(b){throw new Error(`Incorrect URL: ${j}, ${b}`)}}function hn(j){const u={};if(j.username&&j.appPassword){const b=Gt.from(`${j.username}:${j.appPassword}`,"utf8");u.Authorization=`Basic ${b.toString("base64")}`}return{headers:u}}function bn(j){const u=j.getString("host");let b=j.getOptionalString("apiBaseUrl");const A=j.getOptionalString("token"),Q=j.getOptionalString("username"),ve=j.getOptionalString("password");if(!O(u))throw new Error(`Invalid Bitbucket Server integration config, '${u}' is not a valid host`);return b?b=(0,W.trimEnd)(b,"/"):b=`https://${u}/rest/api/1.0`,{host:u,apiBaseUrl:b,token:A,username:Q,password:ve}}function Fn(j){return j.map(bn)}class Sn{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const b=l(u);if(u.lineNumber){const A=new URL(b);return A.hash=u.lineNumber.toString(),A.toString()}return b}resolveEditUrl(u){return u.includes("?")?u.substring(0,u.indexOf("?")):u}constructor(u){this.integrationConfig=u}}Sn.factory=({config:j})=>{var u;const b=Fn((u=j.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&u!==void 0?u:[]);return S(b.map(A=>new Sn(A)),A=>A.config.host)};var kn=t(48834).lW;async function En(j,u){const{name:b,owner:A}=parseGitUrl(j);let Q=`${u.apiBaseUrl}/projects/${A}/repos/${b}/default-branch`,ve=await fetch(Q,Un(u));if(ve.status===404&&(Q=`${u.apiBaseUrl}/projects/${A}/repos/${b}/branches/default`,ve=await fetch(Q,Un(u))),!ve.ok){const Ve=`Failed to retrieve default branch from ${Q}, ${ve.status} ${ve.statusText}`;throw new Error(Ve)}const{displayId:xe}=await ve.json(),Oe=xe;if(!Oe)throw new Error(`Failed to read default branch from ${Q}. Response ${ve.status} ${ve.json()}`);return Oe}async function ln(j,u){const{name:b,owner:A,ref:Q,filepath:ve}=parseGitUrl(j);let xe=Q;xe||(xe=await En(j,u));const Oe=ve?`&path=${encodeURIComponent(decodeURIComponent(ve))}`:"";return`${u.apiBaseUrl}/projects/${A}/repos/${b}/archive?format=tgz&at=${xe}&prefix=${A}-${b}${Oe}`}function tn(j,u){try{const{owner:b,name:A,ref:Q,filepathtype:ve,filepath:xe}=parseGitUrl(j);if(!b||!A||ve!=="browse"&&ve!=="raw"&&ve!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Oe=xe.replace(/^\//,"");return`${u.apiBaseUrl}/projects/${b}/repos/${A}/raw/${Oe}?at=${Q}`}catch(b){throw new Error(`Incorrect URL: ${j}, ${b}`)}}function Un(j){const u={};if(j.token)u.Authorization=`Bearer ${j.token}`;else if(j.username&&j.password){const b=kn.from(`${j.username}:${j.password}`,"utf8");u.Authorization=`Basic ${b.toString("base64")}`}return{headers:u}}function Mn(j){const u=j.getString("host");let b=j.getOptionalString("baseUrl"),A=j.getOptionalString("cloneUrl"),Q=j.getOptionalString("gitilesBaseUrl");const ve=j.getOptionalString("username"),xe=j.getOptionalString("password");if(O(u)){if(b&&!m(b))throw new Error(`Invalid Gerrit integration config, '${b}' is not a valid baseUrl`);if(A&&!m(A))throw new Error(`Invalid Gerrit integration config, '${A}' is not a valid cloneUrl`);if(Q&&!m(Q))throw new Error(`Invalid Gerrit integration config, '${Q}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${u}' is not a valid host`);return b?b=(0,W.trimEnd)(b,"/"):b=`https://${u}`,Q?Q=(0,W.trimEnd)(Q,"/"):Q=`https://${u}`,A?A=(0,W.trimEnd)(A,"/"):A=b,{host:u,baseUrl:b,cloneUrl:A,gitilesBaseUrl:Q,username:ve,password:xe}}function On(j){return j.map(Mn)}var Bn=t(48834).lW;const pn=")]}'";function mn(j,u){const A=u.replace(j.gitilesBaseUrl,"").split("/").filter(Nt=>!!Nt),Q=A.indexOf("+");if(Q<=0)throw new Error(`Unable to parse project from url: ${u}`);const ve=(0,W.trimStart)(A.slice(0,Q).join("/"),"/"),xe=A.indexOf("heads");if(xe<=0)throw new Error(`Unable to parse branch from url: ${u}`);const Oe=A[xe+1],Ve=A.slice(xe+2).join("/");return{branch:Oe,filePath:Ve===""?"/":Ve,project:ve}}function Hn(j,u,b,A){return`${j.gitilesBaseUrl}/${u}/+/refs/heads/${b}/${(0,W.trimStart)(A,"/")}`}function Cn(j){return j.password?"/a/":"/"}function An(j,u){const{branch:b,project:A}=mn(j,u);return`${j.baseUrl}${Cn(j)}projects/${encodeURIComponent(A)}/branches/${b}`}function ge(j,u){const{project:b}=mn(j,u);return`${j.cloneUrl}${Cn(j)}${b}`}function re(j,u){const{branch:b,filePath:A,project:Q}=mn(j,u);return`${j.baseUrl}${Cn(j)}projects/${encodeURIComponent(Q)}/branches/${b}/files/${encodeURIComponent(A)}/content`}function je(j){return`${j.baseUrl}${Cn(j)}projects/`}function Ze(j){const u={};if(!j.password)return u;const b=Bn.from(`${j.username}:${j.password}`,"utf8");return u.Authorization=`Basic ${b.toString("base64")}`,{headers:u}}async function _e(j){const u=await j.text();if(u.startsWith(pn))try{return JSON.parse(u.slice(pn.length))}catch(b){throw new Error(`Invalid response from Gerrit: ${u.slice(0,10)} - ${b}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${u.slice(0,10)}`)}class pt{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:b,base:A,lineNumber:Q}=u;let ve;if(b.startsWith("/")){const{branch:xe,project:Oe}=mn(this.config,A);return Hn(this.config,Oe,xe,b)}return b?ve=new URL(b,A):ve=new URL(A),Q&&(ve.hash=Q.toString()),ve.toString()}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}pt.factory=({config:j})=>{var u;const b=On((u=j.getOptionalConfigArray("integrations.gerrit"))!==null&&u!==void 0?u:[]);return S(b.map(A=>new pt(A)),A=>A.config.host)};function ue(j){const u=j.getString("host");let b=j.getOptionalString("baseUrl");const A=j.getOptionalString("username"),Q=j.getOptionalString("password");if(!O(u))throw new Error(`Invalid Gitea integration config, '${u}' is not a valid host`);return b?b=(0,W.trimEnd)(b,"/"):b=`https://${u}`,{host:u,baseUrl:b,username:A,password:Q}}var F=t(48834).lW;function he(j,u){try{var b;const A=(b=j.baseUrl)!==null&&b!==void 0?b:`https://${j.host}`,[Q,ve,xe,Oe,Ve,Nt,...on]=u.replace(A,"").split("/"),Vn=on.join("/").replace(/^\//,"");return`${A}/${ve}/${xe}/_edit/${Nt}/${Vn}`}catch(A){throw new Error(`Incorrect URL: ${u}, ${A}`)}}function Re(j,u){try{var b;const A=(b=j.baseUrl)!==null&&b!==void 0?b:`https://${j.host}`,[Q,ve,xe,Oe,Ve,Nt,...on]=u.replace(A,"").split("/"),Vn=on.join("/").replace(/^\//,"");return`${A}/api/v1/repos/${ve}/${xe}/contents/${Vn}?ref=${Nt}`}catch(A){throw new Error(`Incorrect URL: ${u}, ${A}`)}}function et(j){const u={},{username:b,password:A}=j;return A?(b?u.Authorization=`basic ${F.from(`${b}:${A}`).toString("base64")}`:u.Authorization=`token ${A}`,{headers:u}):u}class Ue{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(u){return l(u)}resolveEditUrl(u){return he(this.config,u)}constructor(u){this.config=u}}Ue.factory=({config:j})=>{var u;const A=((u=j.getOptionalConfigArray("integrations.gitea"))!==null&&u!==void 0?u:[]).map(Q=>ue(Q));return S(A.map(Q=>new Ue(Q)),Q=>Q.config.host)};const Et="github.com",Vt="https://api.github.com",Jt="https://raw.githubusercontent.com";function Xt(j){var u,b;const A=(b=j.getOptionalString("host"))!==null&&b!==void 0?b:Et;let Q=j.getOptionalString("apiBaseUrl"),ve=j.getOptionalString("rawBaseUrl");const xe=j.getOptionalString("token"),Oe=(u=j.getOptionalConfigArray("apps"))===null||u===void 0?void 0:u.map(Ve=>({appId:Ve.getNumber("appId"),clientId:Ve.getString("clientId"),clientSecret:Ve.getString("clientSecret"),webhookSecret:Ve.getString("webhookSecret"),privateKey:Ve.getString("privateKey"),allowedInstallationOwners:Ve.getOptionalStringArray("allowedInstallationOwners")}));if(!O(A))throw new Error(`Invalid GitHub integration config, '${A}' is not a valid host`);return Q?Q=(0,W.trimEnd)(Q,"/"):A===Et&&(Q=Vt),ve?ve=(0,W.trimEnd)(ve,"/"):A===Et&&(ve=Jt),{host:A,apiBaseUrl:Q,rawBaseUrl:ve,token:xe,apps:Oe}}function q(j){const u=j.map(Xt);return u.some(b=>b.host===Et)||u.push({host:Et,apiBaseUrl:Vt,rawBaseUrl:Jt}),u}function H(j,u,b){try{const{owner:A,name:Q,ref:ve,filepathtype:xe,filepath:Oe}=parseGitUrl(j);if(!A||!Q||!ve||xe!=="blob"&&xe!=="raw"&&xe!=="tree")throw new Error("Invalid GitHub URL or file path");const Ve=Oe.replace(/^\//,"");return w(u,b)==="api"?`${u.apiBaseUrl}/repos/${A}/${Q}/contents/${Ve}?ref=${ve}`:`${u.rawBaseUrl}/${A}/${Q}/${ve}/${Ve}`}catch(A){throw new Error(`Incorrect URL: ${j}, ${A}`)}}function g(j,u){const b={};return w(j,u)==="api"&&(b.Accept="application/vnd.github.v3.raw"),u.token&&(b.Authorization=`token ${u.token}`),{headers:b}}function w(j,u){return j.apiBaseUrl&&(u.token||!j.rawBaseUrl)?"api":"raw"}var D=t(42822),G=t(89393),de=t(26228);class pe{async getOrCreateToken(u,b,A){let Q=this.tokenCache.get(u);if((!Q||this.isExpired(Q.expiresAt))&&(Q=await A(),Q.expiresAt=Q.expiresAt.minus({minutes:10}),this.tokenCache.set(u,Q)),!this.appliesToRepo(Q,b))throw new Error(`The Backstage GitHub application used in the ${u} organization does not have access to a repository with the name ${b}`);return{accessToken:Q.token}}appliesToRepo(u,b){return b===void 0?!0:u.repositories!==void 0?u.repositories.includes(b):!0}constructor(){this.tokenCache=new Map,this.isExpired=u=>de.ou.local()>u}}const Ee={Accept:"application/vnd.github.machine-man-preview+json"};class lt{async getInstallationCredentials(u,b){if(this.allowedInstallationOwners){var A;if(!(!((A=this.allowedInstallationOwners)===null||A===void 0)&&A.includes(u)))return{accessToken:void 0}}return this.cache.getOrCreateToken(u,b,async()=>{const{installationId:Q,suspended:ve}=await this.getInstallationData(u);if(ve)throw new Error(`The GitHub application for ${u} is suspended`);const xe=await this.appClient.apps.createInstallationAccessToken({installation_id:Q,headers:Ee});let Oe;if(xe.data.repository_selection==="selected"){const Nt=new G.v({baseUrl:this.baseUrl,auth:xe.data.token}),on=await Nt.paginate(Nt.apps.listReposAccessibleToInstallation);var Ve;Oe=((Ve=on.repositories)!==null&&Ve!==void 0?Ve:on).map(cr=>cr.name)}return{token:xe.data.token,expiresAt:de.ou.fromISO(xe.data.expires_at),repositories:Oe}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(u){const A=(await this.getInstallations()).find(ve=>{var xe,Oe;return((xe=ve.account)===null||xe===void 0||(Oe=xe.login)===null||Oe===void 0?void 0:Oe.toLocaleLowerCase("en-US"))===u.toLocaleLowerCase("en-US")});if(A)return{installationId:A.id,suspended:Boolean(A.suspended_by)};const Q=new Error(`No app installation found for ${u} in ${this.baseAuthConfig.appId}`);throw Q.name="NotFoundError",Q}constructor(u,b){this.cache=new pe,this.allowedInstallationOwners=u.allowedInstallationOwners,this.baseUrl=b,this.baseAuthConfig={appId:u.appId,privateKey:u.privateKey.replace(/\\n/gm,`
|
|
33
|
+
`)},this.appClient=new G.v({baseUrl:b,headers:Ee,authStrategy:D.i,auth:this.baseAuthConfig})}}class ct{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(b=>b.getInstallations()))).flat():[]}async getAppToken(u,b){if(this.apps.length===0)return;const A=await Promise.all(this.apps.map(Oe=>Oe.getInstallationCredentials(u,b).then(Ve=>({credentials:Ve,error:void 0}),Ve=>({credentials:void 0,error:Ve})))),Q=A.find(Oe=>Oe.credentials);if(Q)return Q.credentials.accessToken;const xe=A.map(Oe=>Oe.error).find(Oe=>Oe.name!=="NotFoundError");if(xe)throw xe}constructor(u){var b,A;this.apps=(A=(b=u.apps)===null||b===void 0?void 0:b.map(Q=>new lt(Q,u.apiBaseUrl)))!==null&&A!==void 0?A:[]}}class St{async getCredentials(u){const b=n()(u.url),A=b.owner||b.name,Q=b.owner?b.name:void 0;let ve="app",xe=await this.githubAppCredentialsMux.getAppToken(A,Q);return xe||(ve="token",xe=this.token),{headers:xe?{Authorization:`Bearer ${xe}`}:void 0,token:xe,type:ve}}constructor(u,b){this.githubAppCredentialsMux=u,this.token=b}}St.create=j=>new St(new ct(j),j.token);class Tt{static fromIntegrations(u){const b=new Map;return u.github.list().forEach(A=>{const Q=SingleInstanceGithubCredentialsProvider.create(A.config);b.set(A.config.host,Q)}),new Tt(b)}async getCredentials(u){const b=new URL(u.url),A=this.providers.get(b.host);if(!A)throw new Error(`There is no GitHub integration that matches ${u.url}. Please add a configuration for an integration.`);return A.getCredentials(u)}constructor(u){this.providers=u}}class st{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return De(l(u),"tree")}resolveEditUrl(u){return De(u,"edit")}constructor(u){this.integrationConfig=u}}st.factory=({config:j})=>{var u;const b=q((u=j.getOptionalConfigArray("integrations.github"))!==null&&u!==void 0?u:[]);return S(b.map(A=>new st(A)),A=>A.config.host)};function De(j,u){return j.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(b,A,Q,ve)=>`//${A}/${Q}/${ve}/${u}/`)}const ft=null;class It extends st{get config(){return super.config}constructor(u){super(u)}}It.factory=st.factory;const zt=null,mt=null,Dt=null,Ht="gitlab.com",Rt="https://gitlab.com/api/v4";function nt(j){const u=j.getString("host");let b=j.getOptionalString("apiBaseUrl");const A=j.getOptionalString("token");let Q=j.getOptionalString("baseUrl");if(b?b=(0,W.trimEnd)(b,"/"):u===Ht&&(b=Rt),Q?Q=(0,W.trimEnd)(Q,"/"):Q=`https://${u}`,O(u)){if(!b||!m(b))throw new Error(`Invalid GitLab integration config, '${b}' is not a valid apiBaseUrl`);if(!m(Q))throw new Error(`Invalid GitLab integration config, '${Q}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${u}' is not a valid host`);return{host:u,token:A,apiBaseUrl:b,baseUrl:Q}}function rt(j){const u=j.map(nt);return u.some(b=>b.host===Ht)||u.push({host:Ht,apiBaseUrl:Rt,baseUrl:`https://${Ht}`}),u}function Wt(j){let u="";return j.host!==Ht&&(u=new URL(j.baseUrl).pathname),trimEnd(u,"/")}async function fn(j,u){const b=await Jn(j,u);return zn(j,b,u).toString()}function sn(j){const{token:u=""}=j;return{headers:{"PRIVATE-TOKEN":u}}}function zn(j,u,b){try{const A=new URL(j),Q=A.pathname.split("/blob/").slice(1).join("/blob/"),[ve,...xe]=Q.split("/"),Oe=getGitLabIntegrationRelativePath(b);return A.pathname=[...Oe?[Oe]:[],"api/v4/projects",u,"repository/files",encodeURIComponent(decodeURIComponent(xe.join("/"))),"raw"].join("/"),A.search=`?ref=${ve}`,A}catch(A){throw new Error(`Incorrect url: ${j}, ${A}`)}}async function Jn(j,u){const b=new URL(j);if(!b.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let A=b.pathname.split("/-/blob/")[0].split("/blob/")[0];const Q=getGitLabIntegrationRelativePath(u);Q&&(A=A.replace(Q,""));const ve=new URL(`${b.origin}${Q}/api/v4/projects/${encodeURIComponent(A.replace(/^\//,""))}`),xe=await fetch(ve.toString(),sn(u)),Oe=await xe.json();if(!xe.ok)throw new Error(`GitLab Error '${Oe.error}', ${Oe.error_description}`);return Number(Oe.id)}catch(A){throw new Error(`Could not get GitLab project ID for: ${j}, ${A}`)}}class vn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return l(u)}resolveEditUrl(u){return Wn(u,"edit")}constructor(u){this.integrationConfig=u}}vn.factory=({config:j})=>{var u;const b=rt((u=j.getOptionalConfigArray("integrations.gitlab"))!==null&&u!==void 0?u:[]);return S(b.map(A=>new vn(A)),A=>A.config.host)};function Wn(j,u){return j.replace(/\/\-\/(blob|tree|edit)\//,`/-/${u}/`)}class lr{static fromConfig(u){return new lr({awsS3:te.factory({config:u}),azure:ze.factory({config:u}),bitbucket:Lt.factory({config:u}),bitbucketCloud:Pt.factory({config:u}),bitbucketServer:Sn.factory({config:u}),gerrit:pt.factory({config:u}),github:st.factory({config:u}),gitlab:vn.factory({config:u}),gitea:Ue.factory({config:u})})}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(u=>u.list())}byUrl(u){let b=Object.values(this.byType).map(A=>A.byUrl(u)).filter(Boolean);if(b.length>1){const A=b.filter(Q=>!(Q instanceof Lt));A.length!==0&&(b=A)}return b[0]}byHost(u){return Object.values(this.byType).map(b=>b.byHost(u)).find(Boolean)}resolveUrl(u){const b=this.byUrl(u.base);return b?b.resolveUrl(u):l(u)}resolveEditUrl(u){const b=this.byUrl(u);return b?b.resolveEditUrl(u):u}constructor(u){this.byType=u}}},26309:function(At,Be,t){"use strict";var h={};t.r(h),t.d(h,{TechDocsPlugin:function(){return C.s4}});var n=t(52322),W=t(2784),O=t(28316),m=t(79635),S=t(25248);const l=(0,S.T0)({id:"plugin.techdocs.storageservice"}),P=(0,S.T0)({id:"plugin.techdocs.service"});var oe=t(92077),_=t(95481),te=t(7476),B=t(93225),I=t(67896),K=t(65124),ce=t(22478),se=t(85478),$=t(68435),T=t(3482),z=t(42081),R=t(48431),C=t(89258),X=t(52943),Se=t(61886),Ge=t(13980),Ye=t.n(Ge);class dt{get(r){for(const s of this.holders){const c=s.get(r);if(c)return c}}constructor(...r){this.holders=r}}var ze=t(51837);const at=(0,ze.CT)("api-context"),ot=i=>{var r;const{apis:s,children:c}=i,f=(r=(0,W.useContext)(at))===null||r===void 0?void 0:r.atVersion(1),k=f?new dt(s,f):s;return(0,n.jsx)(at.Provider,{value:(0,ze.EI)({1:k}),children:c})};ot.propTypes={apis:Ye().shape({get:Ye().func.isRequired}).isRequired,children:Ye().node};class Ke{static validateFactories(r,s){for(const c of s){const f=[c],k=new Set;for(;f.length;){const N=f.shift(),V=r.get(N);if(!!V)for(const ie of Object.values(V.deps)){if(ie.id===c.id)throw new Error(`Circular dependency of api factory for ${c}`);k.has(ie)||(k.add(ie),f.push(ie))}}}}get(r){return this.load(r)}load(r,s=[]){const c=this.apis.get(r.id);if(c)return c;const f=this.factories.get(r);if(!f)return;if(s.includes(f.api))throw new Error(`Circular dependency of api factory for ${f.api}`);const k=this.loadDeps(r,f.deps,[...s,f.api]),N=f.factory(k);return this.apis.set(r.id,N),N}loadDeps(r,s,c){const f={};for(const k in s)if(s.hasOwnProperty(k)){const N=s[k],V=this.load(N,c);if(!V)throw new Error(`No API factory available for dependency ${N} of dependent ${r}`);f[k]=V}return f}constructor(r){this.factories=r,this.apis=new Map}}var Qe;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(Qe||(Qe={}));class $e{register(r,s){const c=Qe[r],f=this.factories.get(s.api.id);return f&&f.priority>=c?!1:(this.factories.set(s.api.id,{priority:c,factory:s}),!0)}get(r){const s=this.factories.get(r.id);if(!!s)return s.factory}getAllApis(){const r=new Set;for(const{factory:s}of this.factories.values())r.add(s.api);return r}constructor(){this.factories=new Map}}function ht(i){return new Promise((r,s)=>{const c=i.width||500,f=i.height||700,k=window.screen.width/2-c/2,N=window.screen.height/2-f/2,V=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${c},height=${f},top=${N},left=${k}`);let ie="";if(!V||typeof V.closed=="undefined"||V.closed){const ut=new Error("Failed to open auth popup.");ut.name="PopupRejectedError",s(ut);return}const Ne=ut=>{if(ut.source!==V||ut.origin!==i.origin)return;const{data:jt}=ut;if(jt.type==="config_info"){ie=jt.targetOrigin;return}if(jt.type!=="authorization_response")return;const yt=jt;if("error"in yt){const Bt=new Error(yt.error.message);Bt.name=yt.error.name,s(Bt)}else r(yt.response);it()},ke=setInterval(()=>{if(V.closed){const ut=`Login failed, ${ie&&ie!==window.location.origin?`Incorrect app origin, expected ${ie}`:"popup was closed"}`,jt=new Error(ut);jt.name="PopupClosedError",s(jt),it()}},100);function it(){window.removeEventListener("message",Ne),clearInterval(ke)}window.addEventListener("message",Ne)})}function gt(i){return[...i].join(" ")}class Ct{async createSession(r){return r.instantPopup?this.showPopup(r.scopes):this.authRequester(r.scopes)}async refreshSession(){const r=await fetch(await this.buildUrl("/refresh",{optional:!0}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(c=>{throw new Error(`Auth refresh request failed, ${c}`)});if(!r.ok){const c=new Error(`Auth refresh request failed, ${r.statusText}`);throw c.status=r.status,c}const s=await r.json();if(s.error){const c=new Error(s.error.message);throw s.error.name&&(c.name=s.error.name),c}return await this.sessionTransform(s)}async removeSession(){const r=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(!r.ok){const s=new Error(`Logout request failed, ${r.statusText}`);throw s.status=r.status,s}}async showPopup(r){const s=this.joinScopesFunc(r),c=await this.buildUrl("/start",{scope:s,origin:window.location.origin}),f=await ht({url:c,name:`${this.provider.title} Login`,origin:new URL(c).origin,width:450,height:730});return await this.sessionTransform(f)}async buildUrl(r,s){const c=await this.discoveryApi.getBaseUrl("auth"),f=this.buildQueryString({...s,env:this.environment});return`${c}/${this.provider.id}${r}${f}`}buildQueryString(r){if(!r)return"";const s=Object.entries(r).map(([c,f])=>{if(typeof f=="string")return`${encodeURIComponent(c)}=${encodeURIComponent(f)}`;if(f)return encodeURIComponent(c)}).filter(Boolean).join("&");return s?`?${s}`:""}constructor(r){const{discoveryApi:s,environment:c,provider:f,joinScopes:k=gt,oauthRequestApi:N,sessionTransform:V=ie=>ie}=r;this.authRequester=N.createAuthRequester({provider:f,onAuthRequest:ie=>this.showPopup(ie)}),this.discoveryApi=s,this.environment=c,this.provider=f,this.joinScopesFunc=k,this.sessionTransform=V}}function $t(i,r){for(const s of r)if(!i.has(s))return!1;return!0}class Lt{sessionExistsAndHasScope(r,s){if(!r)return!1;if(!s||this.options.sessionScopes===void 0)return!0;const c=this.options.sessionScopes(r);return $t(c,s)}getExtendedScope(r,s){const c=new Set(this.options.defaultScopes);if(r&&this.options.sessionScopes!==void 0){const f=this.options.sessionScopes(r);for(const k of f)c.add(k)}if(s)for(const f of s)c.add(f);return c}constructor(r){this.options=r}}var We=t(82394),me=t.n(We);let Le=Symbol.observable;class Pe{[Le](){return this}get closed(){return this.isClosed}next(r){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(s=>s.next(r))}error(r){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=r,this.subscribers.forEach(s=>s.error(r))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(r=>r.complete())}subscribe(r,s,c){const f=typeof r=="function"?{next:r,error:s,complete:c}:r;return this.observable.subscribe(f)}constructor(){this.isClosed=!1,this.observable=new(me())(r=>this.isClosed?(this.terminatingError?r.error(this.terminatingError):r.complete(),()=>{}):(this.subscribers.add(r),()=>{this.subscribers.delete(r)})),this.subscribers=new Set}}let Fe=Symbol.observable;class tt{[Fe](){return this}get closed(){return this.isClosed}next(r){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=r,this.subscribers.forEach(s=>s.next(r))}error(r){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=r,this.subscribers.forEach(s=>s.error(r))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(r=>r.complete())}subscribe(r,s,c){const f=typeof r=="function"?{next:r,error:s,complete:c}:r;return this.observable.subscribe(f)}constructor(r){this.subscribers=new Set,this.isClosed=!1,this.currentValue=r,this.terminatingError=void 0,this.observable=new(me())(s=>this.isClosed?(this.terminatingError?s.error(this.terminatingError):s.complete(),()=>{}):(s.next(this.currentValue),this.subscribers.add(s),()=>{this.subscribers.delete(s)}))}}class Zt{setIsSignedIn(r){this.signedIn!==r&&(this.signedIn=r,this.subject.next(this.signedIn?S.sM.SignedIn:S.sM.SignedOut))}sessionState$(){return this.subject}constructor(){this.subject=new tt(S.sM.SignedOut),this.signedIn=!1}}class xt{async getSession(r){if(this.helper.sessionExistsAndHasScope(this.currentSession,r.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const c=await this.collapsedSessionRefresh(),f=this.sessionScopesFunc(this.currentSession),k=this.sessionScopesFunc(c);return $t(k,f)&&(this.currentSession=c),c}catch(c){if(r.optional)return;throw c}}if(!this.currentSession&&!r.instantPopup)try{const s=await this.collapsedSessionRefresh();return this.currentSession=s,this.getSession(r)}catch{}if(!r.optional)return this.currentSession=await this.connector.createSession({...r,scopes:this.helper.getExtendedScope(this.currentSession,r.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession();try{const r=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),r}finally{delete this.refreshPromise}}constructor(r){this.stateTracker=new Zt;const{connector:s,defaultScopes:c=new Set,sessionScopes:f,sessionShouldRefresh:k}=r;this.connector=s,this.sessionScopesFunc=f,this.sessionShouldRefreshFunc=k,this.helper=new Lt({sessionScopes:f,defaultScopes:c})}}class wt{setSession(r){this.currentSession=r,this.stateTracker.setIsSignedIn(Boolean(r))}async getSession(r){if(this.helper.sessionExistsAndHasScope(this.currentSession,r.scopes))return this.currentSession;if(!r.optional)return this.currentSession=await this.connector.createSession({...r,scopes:this.helper.getExtendedScope(this.currentSession,r.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(r){this.stateTracker=new SessionStateTracker;const{connector:s,defaultScopes:c=new Set,sessionScopes:f}=r;this.connector=s,this.helper=new SessionScopeHelper({sessionScopes:f,defaultScopes:c})}}const bt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class Pt{static create(r){const{discoveryApi:s,environment:c="development",provider:f=bt,oauthRequestApi:k,defaultScopes:N=[],scopeTransform:V=ke=>ke}=r,ie=new Ct({discoveryApi:s,environment:c,provider:f,oauthRequestApi:k,sessionTransform(ke){return{...ke,providerInfo:{idToken:ke.providerInfo.idToken,accessToken:ke.providerInfo.accessToken,scopes:Pt.normalizeScopes(V,ke.providerInfo.scope),expiresAt:new Date(Date.now()+ke.providerInfo.expiresInSeconds*1e3)}}}}),Ne=new xt({connector:ie,defaultScopes:new Set(N),sessionScopes:ke=>ke.providerInfo.scopes,sessionShouldRefresh:ke=>(ke.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new Pt({sessionManager:Ne,scopeTransform:V})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(r,s){const c=Pt.normalizeScopes(this.scopeTransform,r),f=await this.sessionManager.getSession({...s,scopes:c});var k;return(k=f==null?void 0:f.providerInfo.accessToken)!==null&&k!==void 0?k:""}async getIdToken(r={}){const s=await this.sessionManager.getSession(r);var c;return(c=s==null?void 0:s.providerInfo.idToken)!==null&&c!==void 0?c:""}async getBackstageIdentity(r={}){const s=await this.sessionManager.getSession(r);return s==null?void 0:s.backstageIdentity}async getProfile(r={}){const s=await this.sessionManager.getSession(r);return s==null?void 0:s.profile}static normalizeScopes(r,s){if(!s)return new Set;const c=Array.isArray(s)?s:s.split(/[\s|,]/).filter(Boolean);return new Set(r(c))}constructor(r){this.sessionManager=r.sessionManager,this.scopeTransform=r.scopeTransform}}const Gt={id:"github",title:"GitHub",icon:()=>null};class Yt{static create(r){const{discoveryApi:s,environment:c="development",provider:f=Gt,oauthRequestApi:k,defaultScopes:N=["read:user"]}=r;return Pt.create({discoveryApi:s,oauthRequestApi:k,provider:f,environment:c,defaultScopes:N})}}const an={id:"gitlab",title:"GitLab",icon:()=>null};class Mt{static create(r){const{discoveryApi:s,environment:c="development",provider:f=an,oauthRequestApi:k,defaultScopes:N=["read_user"]}=r;return Pt.create({discoveryApi:s,oauthRequestApi:k,provider:f,environment:c,defaultScopes:N})}}const hn={id:"google",title:"Google",icon:()=>null},bn="https://www.googleapis.com/auth/";class Fn{static create(r){const{discoveryApi:s,oauthRequestApi:c,environment:f="development",provider:k=hn,defaultScopes:N=["openid",`${bn}userinfo.email`,`${bn}userinfo.profile`]}=r;return Pt.create({discoveryApi:s,oauthRequestApi:c,provider:k,environment:f,defaultScopes:N,scopeTransform(V){return V.map(ie=>ie==="openid"?ie:ie==="profile"||ie==="email"?`${bn}userinfo.${ie}`:ie.startsWith(bn)?ie:`${bn}${ie}`)}})}}const Sn={id:"okta",title:"Okta",icon:()=>null},kn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),En="okta.";class ln{static create(r){const{discoveryApi:s,environment:c="development",provider:f=Sn,oauthRequestApi:k,defaultScopes:N=["openid","email","profile","offline_access"]}=r;return Pt.create({discoveryApi:s,oauthRequestApi:k,provider:f,environment:c,defaultScopes:N,scopeTransform(V){return V.map(ie=>kn.has(ie)||ie.startsWith(En)?ie:`${En}${ie}`)}})}}var tn=t(30195);const Un=tn.z.object({profile:tn.z.object({email:tn.z.string().optional(),displayName:tn.z.string().optional(),picture:tn.z.string().optional()}),backstageIdentity:tn.z.object({token:tn.z.string(),identity:tn.z.object({type:tn.z.literal("user"),userEntityRef:tn.z.string(),ownershipEntityRefs:tn.z.array(tn.z.string())})})}),Mn={id:"saml",title:"SAML",icon:()=>null};class On{static create(r){const{discoveryApi:s,environment:c="development",provider:f=Mn}=r,k=new DirectAuthConnector({discoveryApi:s,environment:c,provider:f}),N=new StaticAuthSessionManager({connector:k}),V=new AuthSessionStore({manager:N,storageKey:`${f.id}Session`,schema:samlSessionSchema});return new On(V)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(r={}){const s=await this.sessionManager.getSession(r);return s==null?void 0:s.backstageIdentity}async getProfile(r={}){const s=await this.sessionManager.getSession(r);return s==null?void 0:s.profile}constructor(r){this.sessionManager=r}}const Bn={id:"microsoft",title:"Microsoft",icon:()=>null};class pn{static create(r){const{environment:s="development",provider:c=Bn,oauthRequestApi:f,discoveryApi:k,defaultScopes:N=["openid","offline_access","profile","email","User.Read"]}=r;return Pt.create({discoveryApi:k,oauthRequestApi:f,provider:c,environment:s,defaultScopes:N})}}const mn={id:"onelogin",title:"onelogin",icon:()=>null},Hn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),Cn="onelogin.";class An{static create(r){const{discoveryApi:s,environment:c="development",provider:f=mn,oauthRequestApi:k}=r;return Pt.create({discoveryApi:s,oauthRequestApi:k,provider:f,environment:c,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(N){return N.map(V=>Hn.has(V)||V.startsWith(Cn)?V:`${Cn}${V}`)}})}}const ge={id:"bitbucket",title:"Bitbucket",icon:()=>null};class re{static create(r){const{discoveryApi:s,environment:c="development",provider:f=ge,oauthRequestApi:k,defaultScopes:N=["team"]}=r;return Pt.create({discoveryApi:s,oauthRequestApi:k,provider:f,environment:c,defaultScopes:N})}}const je={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class Ze{static create(r){const{discoveryApi:s,environment:c="development",provider:f=je,oauthRequestApi:k,defaultScopes:N=["PROJECT_ADMIN"]}=r;return Pt.create({discoveryApi:s,oauthRequestApi:k,provider:f,environment:c,defaultScopes:N})}}const _e={id:"atlassian",title:"Atlassian",icon:()=>null};class pt{static create(r){const{discoveryApi:s,environment:c="development",provider:f=_e,oauthRequestApi:k}=r;return Pt.create({discoveryApi:s,oauthRequestApi:k,provider:f,environment:c})}}class ue{post(r){this.subject.next(r)}alert$(){return this.subject}constructor(){this.subject=new Pe}}class F{captureEvent(r){}}const he="theme";class Re{static createWithStorage(r){const s=new Re(r);if(!window.localStorage)return s;var c;const f=(c=window.localStorage.getItem(he))!==null&&c!==void 0?c:void 0;return s.setActiveThemeId(f),s.activeThemeId$().subscribe(k=>{k?window.localStorage.setItem(he,k):window.localStorage.removeItem(he)}),window.addEventListener("storage",k=>{if(k.key===he){var N;const V=(N=localStorage.getItem(he))!==null&&N!==void 0?N:void 0;s.setActiveThemeId(V)}}),s}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(r){this.activeThemeId=r,this.subject.next(r)}constructor(r){this.themes=r,this.subject=new tt(void 0)}}var et=t(9850),Ue=t.n(et),Et=t(12782),Vt=t.n(Et);const Jt=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function Xt(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function q(i){if(i===null)return"null";if(Array.isArray(i))return"array";const r=typeof i;return r==="number"&&isNaN(i)?"nan":r==="string"&&i===""?"empty-string":r}const H={type(i,r,s,c){return`Invalid type in config for key '${i}' in '${r}', got ${s}, wanted ${c}`},missing(i){return`Missing required config value at '${i}'`},convert(i,r,s){return`Unable to convert config value for key '${i}' in '${r}' to a ${s}`}};class g{static fromConfigs(r){return r.length===0?new g(void 0):r.reduce((s,{data:c,context:f,filteredKeys:k,deprecatedKeys:N})=>{const V=new g(c,f,s);if(V.filteredKeys=k,N)for(const{key:ie,description:Ne}of N)console.warn(`The configuration key '${ie}' of ${f} is deprecated and may be removed soon. ${Ne||""}`);return V},void 0)}has(r){var s;if(this.readValue(r)!==void 0)return!0;var f;return(f=(s=this.fallback)===null||s===void 0?void 0:s.has(r))!==null&&f!==void 0?f:!1}keys(){var r;const s=this.data?Object.keys(this.data):[];var c;const f=(c=(r=this.fallback)===null||r===void 0?void 0:r.keys())!==null&&c!==void 0?c:[];return[...new Set([...s,...f])]}get(r){const s=this.getOptional(r);if(s===void 0)throw new Error(H.missing(this.fullKey(r!=null?r:"")));return s}getOptional(r){var s;const c=Ue()(this.readValue(r)),f=(s=this.fallback)===null||s===void 0?void 0:s.getOptional(r);if(c===void 0){if(!1)var k;return f}else if(f===void 0)return c;return Vt()({},{value:f},{value:c},(N,V)=>!Xt(V)||!Xt(N)?V:void 0).value}getConfig(r){const s=this.getOptionalConfig(r);if(s===void 0)throw new Error(H.missing(this.fullKey(r)));return s}getOptionalConfig(r){var s;const c=this.readValue(r),f=(s=this.fallback)===null||s===void 0?void 0:s.getOptionalConfig(r);if(Xt(c))return this.copy(c,r,f);if(c!==void 0)throw new TypeError(H.type(this.fullKey(r),this.context,q(c),"object"));return f}getConfigArray(r){const s=this.getOptionalConfigArray(r);if(s===void 0)throw new Error(H.missing(this.fullKey(r)));return s}getOptionalConfigArray(r){const s=this.readConfigValue(r,f=>{if(!Array.isArray(f))return{expected:"object-array"};for(const[k,N]of f.entries())if(!Xt(N))return{expected:"object-array",value:N,key:`${r}[${k}]`};return!0});if(!s){if(!1)var c;return}return s.map((f,k)=>this.copy(f,`${r}[${k}]`))}getNumber(r){const s=this.getOptionalNumber(r);if(s===void 0)throw new Error(H.missing(this.fullKey(r)));return s}getOptionalNumber(r){const s=this.readConfigValue(r,f=>typeof f=="number"||typeof f=="string"||{expected:"number"});if(typeof s=="number"||s===void 0)return s;const c=Number(s);if(!Number.isFinite(c))throw new Error(H.convert(this.fullKey(r),this.context,"number"));return c}getBoolean(r){const s=this.getOptionalBoolean(r);if(s===void 0)throw new Error(H.missing(this.fullKey(r)));return s}getOptionalBoolean(r){const s=this.readConfigValue(r,f=>typeof f=="boolean"||typeof f=="number"||typeof f=="string"||{expected:"boolean"});if(typeof s=="boolean"||s===void 0)return s;const c=String(s).trim();if(/^(?:y|yes|true|1|on)$/i.test(c))return!0;if(/^(?:n|no|false|0|off)$/i.test(c))return!1;throw new Error(H.convert(this.fullKey(r),this.context,"boolean"))}getString(r){const s=this.getOptionalString(r);if(s===void 0)throw new Error(H.missing(this.fullKey(r)));return s}getOptionalString(r){return this.readConfigValue(r,s=>typeof s=="string"&&s!==""||{expected:"string"})}getStringArray(r){const s=this.getOptionalStringArray(r);if(s===void 0)throw new Error(H.missing(this.fullKey(r)));return s}getOptionalStringArray(r){return this.readConfigValue(r,s=>{if(!Array.isArray(s))return{expected:"string-array"};for(const[c,f]of s.entries())if(typeof f!="string"||f==="")return{expected:"string-array",value:f,key:`${r}[${c}]`};return!0})}fullKey(r){return`${this.prefix}${this.prefix?".":""}${r}`}copy(r,s,c){const f=new g(r,this.context,c,this.fullKey(s));return f.filteredKeys=this.filteredKeys,f}readConfigValue(r,s){const c=this.readValue(r);if(c===void 0){var f;if(!1)var k;return(f=this.fallback)===null||f===void 0?void 0:f.readConfigValue(r,s)}const N=s(c);if(N!==!0){const{key:V=r,value:ie=c,expected:Ne}=N;throw new TypeError(H.type(this.fullKey(V),this.context,q(ie),Ne))}return c}readValue(r){const s=r?r.split("."):[];for(const f of s)if(!Jt.test(f))throw new TypeError(`Invalid config key '${r}'`);if(this.data===void 0)return;let c=this.data;for(const[f,k]of s.entries())if(Xt(c))c=c[k];else if(c!==void 0){const N=this.fullKey(s.slice(0,f).join("."));throw new TypeError(H.type(N,this.context,q(c),"object"))}return c}constructor(r,s="mock-config",c,f=""){this.data=r,this.context=s,this.fallback=c,this.prefix=f,this.notifiedFilteredKeys=new Set}}const w="Invalid discovery URL pattern,";class D{static compile(r){const s=r.split(/\{\{\s*pluginId\s*\}\}/),c=s.join("pluginId");let f;try{f=new URL(c)}catch{throw new Error(`${w} URL '${c}' is invalid`)}if(f.hash)throw new Error(`${w} URL must not have a hash`);if(f.search)throw new Error(`${w} URL must not have a query`);if(c.endsWith("/"))throw new Error(`${w} URL must not end with a slash`);return new D(s)}async getBaseUrl(r){return this.parts.join(r)}constructor(r){this.parts=r}}class G{post(r,s){return s!=null&&s.hidden||this.alertApi.post({message:r.message,severity:"error"}),this.errorApi.post(r,s)}error$(){return this.errorApi.error$()}constructor(r,s){this.alertApi=r,this.errorApi=s}}class de{post(r,s){this.subject.next({error:r,context:s})}error$(){return this.subject}constructor(){this.subject=new Pe}}class pe{static forward(r,s){window.addEventListener("unhandledrejection",c=>{r.post(c.reason,s)})}}function Ee(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 lt{registerFlag(r){Ee(r.name),this.registeredFeatureFlags.push(r)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(r){return this.flags||(this.flags=this.load()),this.flags.get(r)===S.CL.Active}save(r){this.flags||(this.flags=this.load()),r.merge||this.flags.clear();for(const[c,f]of Object.entries(r.states))this.flags.set(c,f);const s=Array.from(this.flags.entries()).filter(([,c])=>c===S.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(s)))}load(){try{const r=window.localStorage.getItem("featureFlags");if(!r)return new Map;const s=JSON.parse(r);if(typeof s!="object"||s===null||Array.isArray(s))return new Map;const c=Object.entries(s).filter(([f,k])=>(Ee(f),k===S.CL.Active));return new Map(c)}catch{return new Map}}constructor(){this.registeredFeatureFlags=[]}}function ct(i){let r=i.baseImplementation||t.g.fetch;var s;const c=[(s=i.middleware)!==null&&s!==void 0?s:[]].flat().reverse();for(const f of c)r=f.apply(r);return{fetch:r}}class St{static create(r){var s,c;const f=Tt(r),k=((s=r.header)===null||s===void 0?void 0:s.name)||"authorization",N=((c=r.header)===null||c===void 0?void 0:c.value)||(V=>`Bearer ${V}`);return new St(r.identityApi,f,k,N)}apply(r){return async(s,c)=>{const f=new Request(s,c),{token:k}=await this.identityApi.getCredentials();return f.headers.get(this.headerName)||typeof k!="string"||!k||!this.allowUrl(f.url)?r(s,c):(f.headers.set(this.headerName,this.headerValue(k)),r(f))}}constructor(r,s,c,f){this.identityApi=r,this.allowUrl=s,this.headerName=c,this.headerValue=f}}function Tt(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?st(i.urlPrefixAllowlist):i.config?st([i.config.getString("backend.baseUrl")]):()=>!1}function st(i){const r=i.map(s=>s.replace(/\/$/,""));return s=>r.some(c=>s===c||s.startsWith(`${c}/`))}function De(i,r){return!r||r==="/"?i:`${i.replace(/\/$/,"")}/${r.replace(/^\//,"")}`}class ft{apply(r){return async(s,c)=>{const f=new Request(s,c),k="plugin://";if(!f.url.startsWith(k))return r(s,c);const{hostname:N,pathname:V,search:ie,hash:Ne,username:ke,password:it}=new URL(`http://${f.url.substring(k.length)}`);let ut=await this.discoveryApi.getBaseUrl(N);if(ke||it){const yt=new URL(ut),Bt=`${ke}${it?`:${it}`:""}@`;ut=`${yt.protocol}//${Bt}${yt.host}${yt.pathname}`}const jt=`${De(ut,V)}${ie}${Ne}`;return r(jt,typeof s=="string"||It(s)?c:s)}}constructor(r){this.discoveryApi=r}}function It(i){return typeof i=="object"&&(i==null?void 0:i.constructor)===URL}class zt{static resolvePluginProtocol(r){return new ft(r.discoveryApi)}static injectIdentityAuth(r){return St.create(r)}constructor(){}}function mt(i,r){for(const s of r)if(!i.has(s))return!1;return!0}function Dt(i,...r){const s=new Set(i);for(const c of r)for(const f of c)s.add(f);return s}class Ht{request(r){return new Promise((s,c)=>{this.requests.push({scopes:r,resolve:s,reject:c}),this.subject.next(this.getCurrentPending())})}resolve(r,s){this.requests=this.requests.filter(c=>mt(r,c.scopes)?(c.resolve(s),!1):!0),this.subject.next(this.getCurrentPending())}reject(r){this.requests.forEach(s=>s.reject(r)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const r=this.requests.length===0?void 0:this.requests.slice(1).reduce((s,c)=>Dt(s,c.scopes),this.requests[0].scopes);return{scopes:r,resolve:s=>{r&&this.resolve(r,s)},reject:s=>{r&&this.reject(s)}}}constructor(){this.requests=[],this.subject=new tt(this.getCurrentPending())}}class Rt{createAuthRequester(r){const s=new Ht,c=this.handlerCount;return this.handlerCount++,s.pending().subscribe({next:f=>{const k=this.currentRequests.slice(),N=this.makeAuthRequest(f,r);N?k[c]=N:delete k[c],this.currentRequests=k,this.subject.next(k.filter(Boolean))}}),f=>s.request(f)}makeAuthRequest(r,s){const{scopes:c}=r;if(!!c)return{provider:s.provider,trigger:async()=>{const f=await s.onAuthRequest(c);r.resolve(f)},reject:()=>{const f=new Error("Login failed, rejected by user");f.name="RejectedError",r.reject(f)}}}authRequest$(){return this.subject}constructor(){this.subject=new tt([]),this.currentRequests=[],this.handlerCount=0}}const nt=new Map;class rt{static create(r){var s;return new rt((s=r.namespace)!==null&&s!==void 0?s:"",r.errorApi)}static addStorageEventListener(){window.addEventListener("storage",r=>{for(const[c,f]of nt.entries()){var s;!((s=r.key)===null||s===void 0)&&s.startsWith(c)&&f.handleStorageChange(r.key)}})}get(r){return this.snapshot(r).value}snapshot(r){let s,c="absent";try{const f=localStorage.getItem(this.getKeyName(r));f&&(s=JSON.parse(f,(k,N)=>(typeof N=="object"&&N!==null&&Object.freeze(N),N)),c="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${r}`))}return{key:r,value:s,presence:c}}forBucket(r){const s=`${this.namespace}/${r}`;return nt.has(s)||nt.set(s,new rt(s,this.errorApi)),nt.get(s)}async set(r,s){localStorage.setItem(this.getKeyName(r),JSON.stringify(s)),this.notifyChanges(r)}async remove(r){localStorage.removeItem(this.getKeyName(r)),this.notifyChanges(r)}observe$(r){return rt.hasSubscribed||(rt.addStorageEventListener(),rt.hasSubscribed=!0),this.observable.filter(({key:s})=>s===r)}handleStorageChange(r){if(!(r!=null&&r.startsWith(this.namespace)))return;const s=r==null?void 0:r.slice(`${this.namespace}/`.length);s.includes("/")||this.notifyChanges(decodeURIComponent(s))}getKeyName(r){return`${this.namespace}/${encodeURIComponent(r)}`}notifyChanges(r){const s=this.snapshot(r);for(const c of this.subscribers)c.next(s)}constructor(r,s){this.namespace=r,this.errorApi=s,this.subscribers=new Set,this.observable=new(me())(c=>(this.subscribers.add(c),()=>{this.subscribers.delete(c)}))}}rt.hasSubscribed=!1;const Wt=(0,W.createContext)(void 0);function fn(){const[i]=(0,m.is)((0,n.jsx)(m.AW,{index:!0,element:(0,n.jsx)("div",{})}));return!i.index}var sn=t(16060);const zn=(i,r)=>{try{var s,c;const f=(0,sn.fp)(r,{pathname:i}),k=(s=f==null?void 0:f.filter(V=>{var ie;return((ie=V==null?void 0:V.route.routeRefs)===null||ie===void 0?void 0:ie.size)>0}).pop())===null||s===void 0?void 0:s.route;if(!k)return{};let N;return k.routeRefs.size===1&&(N=k.routeRefs.values().next().value),{extension:"App",pluginId:((c=k.plugin)===null||c===void 0?void 0:c.getId())||"root",...N?{routeRef:N.id}:{}}}catch{return{}}},Jn=({pathname:i,search:r,hash:s})=>{const c=(0,S.z$)();return(0,W.useEffect)(()=>{c.captureEvent("navigate",`${i}${r}${s}`)},[c,i,r,s]),null},vn=({routeObjects:i})=>{const{pathname:r,search:s,hash:c}=(0,m.TH)();return(0,n.jsx)(S.fC,{attributes:zn(r,i),children:(0,n.jsx)(Jn,{pathname:r,search:s,hash:c})})};function Wn(i){return fn()?lr(i):""}function lr(i){var r;let{pathname:s}=new URL((r=i.getOptionalString("app.baseUrl"))!==null&&r!==void 0?r:"/","http://sample.dev");return s=s.replace(/\/*$/,""),s}function j({component:i,appIdentityProxy:r,children:s}){const[c,f]=(0,W.useState)(),k=(0,S.h_)(S.Ds),N=Wn(k);return c?(r.setTarget(c,{signOutTargetUrl:N||"/"}),(0,n.jsx)(n.Fragment,{children:s})):(0,n.jsx)(i,{onSignInSuccess:f})}function u(i){const{Router:r,SignInPage:s}=(0,S.qD)().getComponents(),c=(0,S.h_)(S.Ds),f=lr(c),k=`${f}/*`,N=(0,W.useContext)(Wt);if(!N)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:V,appIdentityProxy:ie}=N;return s?fn()?(0,n.jsxs)(r,{children:[(0,n.jsx)(vn,{routeObjects:V}),(0,n.jsx)(j,{component:s,appIdentityProxy:ie,children:(0,n.jsx)(m.Z5,{children:(0,n.jsx)(m.AW,{path:k,element:(0,n.jsx)(n.Fragment,{children:i.children})})})})]}):(0,n.jsxs)(r,{basename:f,children:[(0,n.jsx)(vn,{routeObjects:V}),(0,n.jsx)(j,{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:f||"/"}),fn()?(0,n.jsxs)(r,{children:[(0,n.jsx)(vn,{routeObjects:V}),(0,n.jsx)(m.Z5,{children:(0,n.jsx)(m.AW,{path:k,element:(0,n.jsx)(n.Fragment,{children:i.children})})})]}):(0,n.jsxs)(r,{basename:f,children:[(0,n.jsx)(vn,{routeObjects:V}),i.children]}))}var b=t(90383),A=t(22504),Q=t(69866),ve=t(64279);function xe(i){const r={};for(const c in i.collectors)i.collectors.hasOwnProperty(c)&&(r[c]=i.collectors[c]());const s=[{node:W.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;s.length!==0;){const{node:c,parent:f,contexts:k}=s.shift();W.Children.forEach(c,N=>{if(!(0,W.isValidElement)(N))return;const V={};for(const ie in r)if(r.hasOwnProperty(ie)){const Ne=r[ie];V[ie]=Ne.visit(Ne.accumulator,N,f,k[ie])}for(const ie of i.discoverers){const Ne=ie(N);Ne&&s.push({node:Ne,parent:N,contexts:V})}})}return Object.fromEntries(Object.entries(r).map(([c,f])=>[c,f.accumulator]))}function Oe(i,r){return()=>({accumulator:i(),visit:r})}function Ve(i){var r;return(r=i.props)===null||r===void 0?void 0:r.children}function Nt(i){var r,s;if(((r=i.props)===null||r===void 0?void 0:r.path)&&((s=i.props)===null||s===void 0?void 0:s.element)){var c;return(c=i.props)===null||c===void 0?void 0:c.element}}const on=Oe(()=>new Set,(i,r)=>{const s=(0,S.IY)(r,"core.plugin");s&&i.add(s)}),Vn=i=>{const{children:r}=i,s=(0,S.h_)(S.W0),c="with"in i?s.isActive(i.with):!s.isActive(i.without);return(0,n.jsx)(n.Fragment,{children:c?r:null})};(0,S.R5)(Vn,"core.featureFlagged",!0);const cr={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function jr(i){const r=i;if(r!=null&&r.type){var s,c;return(c=(s=r.type.displayName)!==null&&s!==void 0?s:r.type.name)!==null&&c!==void 0?c:String(r.type)}return String(r)}function lo(i,r=new Array){return W.Children.forEach(i,s=>{if(!(0,W.isValidElement)(s))return;const c=(0,S.IY)(s,"core.mountPoint");if(c){const f=(0,S.IY)(s,"core.plugin");r.push({routeRef:c,plugin:f})}lo(s.props.children,r)}),r}const $r=Oe(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,r,s,c)=>{var f,k;if(c!=null&&c.isElementAncestor)return c;if((s==null?void 0:s.props.element)===r)return{...c,isElementAncestor:!0};const N=(f=r.props)===null||f===void 0?void 0:f.path,V=(0,S.IY)(r,"core.mountPoint");if(V&&N)throw new Error(`Path property may not be set directly on a routable extension "${jr(r)}"`);var ie;const Ne=(ie=c==null||(k=c.obj)===null||k===void 0?void 0:k.children)!==null&&ie!==void 0?ie:i.objects;if(N!==void 0){if(typeof N!="string")throw new Error(`Element path must be a string at "${jr(r)}"`);const jt=N.startsWith("/")?N.slice(1):N,yt=r.props.element;if((0,S.IY)(r,"core.gatherMountPoints")){var ke;if(yt)throw new Error(`Mount point gatherers may not have an element prop "${jr(r)}"`);const Bt={path:jt,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((ke=r.props)===null||ke===void 0?void 0:ke.caseSensitive),children:[cr],plugin:void 0};return Ne.push(Bt),{obj:Bt,gatherPath:jt,routeRef:c==null?void 0:c.routeRef,gatherRouteRef:c==null?void 0:c.routeRef}}if(yt){var it;const[Bt,...Ft]=lo(yt);if(Ft.length>0)throw new Error(`Route element with path "${N}" may not contain multiple routable extensions`);if(!Bt)return c;const{routeRef:yn,plugin:tr}=Bt,nr={path:jt,element:"mounted",routeRefs:new Set([yn]),caseSensitive:Boolean((it=r.props)===null||it===void 0?void 0:it.caseSensitive),children:[cr],plugin:tr};return Ne.push(nr),i.paths.set(yn,jt),i.parents.set(yn,c==null?void 0:c.routeRef),{obj:nr,routeRef:yn!=null?yn:c==null?void 0:c.routeRef,gatherPath:jt,gatherRouteRef:c==null?void 0:c.gatherRouteRef}}}if(V){var ut;if((c==null?void 0:c.gatherPath)===void 0)throw new Error(`Routable extension "${jr(r)}" with mount point "${V}" must be assigned a path`);return c==null||(ut=c.obj)===null||ut===void 0||ut.routeRefs.add(V),i.paths.set(V,c.gatherPath),i.parents.set(V,c==null?void 0:c.gatherRouteRef),{...c,routeRef:V}}return c}),co=Oe(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,r,s,c)=>{var f,k,N;if((s==null?void 0:s.props.element)===r)return c;let V=c==null?void 0:c.obj,ie=c==null?void 0:c.routeRef,Ne=c==null?void 0:c.sticky;const ke=(f=r.props)===null||f===void 0?void 0:f.path;var it;const ut=(it=V==null?void 0:V.children)!==null&&it!==void 0?it:i.objects,jt=Boolean((k=r.props)===null||k===void 0?void 0:k.caseSensitive);let yt=c==null?void 0:c.path;if((0,S.IY)(r,"core.gatherMountPoints")){if(!ke)throw new Error("Mount point gatherer must have a path");yt=ke}const Bt=(N=r.props)===null||N===void 0?void 0:N.element;let Ft=(0,S.IY)(r,"core.mountPoint");if(!Ft&&(0,W.isValidElement)(Bt)&&(Ft=(0,S.IY)(Bt,"core.mountPoint")),Ft){let nr=ke;if(yt&&(nr?yt=void 0:nr=yt),!nr)throw new Error("Mounted routable extension must have a path");i.paths.set(Ft,nr),ie&&Ne?(i.parents.set(Ft,ie),ke&&(ie=Ft,Ne=!1)):(i.parents.set(Ft,ie),ie=Ft),ke?(V={caseSensitive:jt,path:ke,element:"mounted",routeRefs:new Set([Ft]),children:[cr],plugin:(0,S.IY)(r.props.element,"core.plugin")},ut.push(V)):V==null||V.routeRefs.add(Ft)}if((0,S.IY)(r,"core.gatherMountPoints")&&(Ne=!0),(0,S.IY)(r,"core.gatherMountPoints")){if(!ke)throw new Error("Mount point gatherer must have a path");if(!Ft){var tr;V={caseSensitive:jt,path:ke,element:"gathered",routeRefs:new Set,children:[cr],plugin:c==null||(tr=c.obj)===null||tr===void 0?void 0:tr.plugin},ut.push(V)}}return{obj:V,path:yt,routeRef:ie,sticky:Ne}}),uo=Oe(()=>new Set,(i,r)=>{if(r.type===Vn){const s=r.props;i.add("with"in s?s.with:s.without)}}),fr=(0,ze.uW)("route-ref-type",()=>Symbol("route-ref-type"));function Yr(i){return i[fr]==="absolute"}function Xn(i){return i[fr]==="sub"}function Qn(i){return i[fr]==="external"}function Gn(...i){const r=i.join("/").replace(/\/\/+/g,"/");return r!=="/"&&r.endsWith("/")?r.slice(0,-1):r}function Er(i,r,s){let c,f="";if(Yr(i))c=i;else if(Xn(i))c=i.parent,f=i.path;else if(Qn(i)){const V=s.get(i);if(!V)return[void 0,""];if(Yr(V))c=V;else if(Xn(V))c=V.parent,f=V.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${V}`)}else throw i[fr]?new Error(`Unknown or invalid route ref type, ${i[fr]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!c)return[void 0,""];const k=r.get(c);if(k===void 0)return[void 0,""];const N=Gn(k,f);return[c,N]}function Jr(i,r,s,c,f){var k;const N=(k=(0,sn.fp)(f,r))!==null&&k!==void 0?k:[],V=Array();let ie=-1;for(let it=i;it&&(ie=N.findIndex(ut=>ut.route.routeRefs.has(it)),ie===-1);it=c.get(it))V.unshift(it);V.length===0&&(ie-=1);const Ne=ie===-1?"":N[ie].pathname,ke=V.slice(0,-1).map(it=>{const ut=s.get(it);if(ut===void 0)throw new Error(`No path for ${it}`);if(ut.includes(":"))throw new Error(`Cannot route to ${i} with parent ${it} as it has parameters`);return ut});return`${Gn(Ne,...ke)}/`}class ho{resolve(r,s){const[c,f]=Er(r,this.routePaths,this.routeBindings);if(!c)return;let k;typeof s=="string"?k=this.trimPath(s):s.pathname?k={...s,pathname:this.trimPath(s.pathname)}:k=s;const N=this.appBasePath+Jr(c,k,this.routePaths,this.routeParents,this.routeObjects);return(...[ie])=>Gn(N,(0,sn.Gn)(f,ie))}trimPath(r){return r&&(r.startsWith(this.appBasePath)?r.slice(this.appBasePath.length):r)}constructor(r,s,c,f,k){this.routePaths=r,this.routeParents=s,this.routeObjects=c,this.routeBindings=f,this.appBasePath=k}}const Xr=(0,ze.CT)("routing-context"),po=({routePaths:i,routeParents:r,routeObjects:s,routeBindings:c,basePath:f="",children:k})=>{const N=new ho(i,r,s,c,f),V=(0,ze.EI)({1:N});return(0,n.jsx)(Xr.Provider,{value:V,children:k})};function Ko(i,r){const s=new Set(r.values());s.delete(void 0);for(const c of r.keys()){if(s.has(c))continue;let f=c,k="";for(;f;){const V=i.get(f);if(V===void 0)throw new Error(`No path for ${f}`);k=Gn(V,k),f=r.get(f)}const N=k.match(/:(\w+)/g);if(N){for(let V=0;V<N.length;V++)for(let ie=V+1;ie<N.length;ie++)if(N[ie]===N[V])throw new Error(`Parameter ${N[ie]} is duplicated in path ${k}`)}}}function Zr(i,r){for(const s of r)if(!!s.externalRoutes){for(const[c,f]of Object.entries(s.externalRoutes))if(!f.optional&&!i.has(f))throw new Error(`External route '${c}' of the '${s.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const qn=(0,ze.CT)("app-context"),Ar=({appContext:i,children:r})=>{const s=(0,ze.EI)({1:i});return(0,n.jsx)(qn.Provider,{value:s,children:r})};function gr(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function Dr(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class Tr{setTarget(r,s){this.target=r,this.signOutTargetUrl=s.signOutTargetUrl,this.resolveTarget(r)}getUserId(){if(!this.target)throw gr("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Dr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw gr("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Dr("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(r=>r.getProfileInfo())}async getBackstageIdentity(){const r=await this.waitForTarget.then(s=>s.getBackstageIdentity());return r.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${r.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),r}async getCredentials(){return this.waitForTarget.then(r=>r.getCredentials())}async getIdToken(){return this.waitForTarget.then(r=>{if(!r.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return Dr("getIdToken"),r.getIdToken()})}async signOut(){await this.waitForTarget.then(r=>r.signOut()),window.location.href=this.signOutTargetUrl}constructor(){this.resolveTarget=()=>{},this.signOutTargetUrl="/",this.waitForTarget=new Promise(r=>{this.resolveTarget=r})}}var rr=t(72164);function fo(i,r,s){if(i!==void 0){const f=s.find(k=>k.id===i);if(f)return f}if(r){const f=s.find(k=>k.variant==="dark");if(f)return f}const c=s.find(f=>f.variant==="light");return c||s[0]}const go=()=>{const i=(0,W.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[r,s]=(0,W.useState)(i.matches);return(0,W.useEffect)(()=>{const c=f=>{s(f.matches)};return i.addListener(c),()=>{i.removeListener(c)}},[i]),r};function Ir({children:i}){const r=(0,S.h_)(S.hg),s=(0,rr.Z)(r.activeThemeId$(),r.getActiveThemeId()),c=Boolean(window.matchMedia)?go():!1,f=fo(s,c,r.getInstalledThemes());if(!f)throw new Error("App has no themes");return(0,n.jsx)(f.Provider,{children:i})}const Qr=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const r=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!r)throw new Error("No static configuration provided");if(!Array.isArray(r))throw new Error("Static configuration has invalid format");const s=r.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const f=JSON.parse(i);Array.isArray(f)?s.push(...f):s.push({data:f,context:"env"})}catch(f){throw new Error(`Failed to load runtime configuration, ${f}`)}const c=window.__APP_CONFIG__;return c&&s.push({context:"window",data:c}),s};class Yo{add(r,s){return this.apis.push([r.id,s]),s}build(){return new dr(new Map(this.apis))}constructor(){this.apis=[]}}class dr{static builder(){return new Yo}static from(r){return new dr(new Map(r.map(([s,c])=>[s.id,c])))}static with(r,s){return new dr(new Map([[r.id,s]]))}with(r,s){return new dr(new Map([...this.apis,[r.id,s]]))}get(r){return this.apis.get(r.id)}constructor(r){this.apis=r}}function mo(i){const r=new Map;return i&&i({bind:(c,f)=>{for(const[k,N]of Object.entries(f)){const V=c[k];if(!V)throw new Error(`Key ${k} is not an existing external route`);if(!N&&!V.optional)throw new Error(`External route ${k} is required but was undefined`);N&&r.set(V,N)}}}),r}function vo(i){const r=new URL(i);return r.protocol=document.location.protocol,r.hostname=document.location.hostname,r.port=document.location.port,r.toString().replace(/\/$/,"")}function yo(i,r,s){var c;const f=Boolean(i),k=(0,ve.default)(i||(()=>Promise.resolve([])));let N;if(f&&k.loading){const{Progress:Ne}=r;N=(0,n.jsx)(Ne,{})}else if(k.error){const{BootErrorPage:Ne}=r;N=(0,n.jsx)(Ne,{step:"load-config",error:k.error})}const{ThemeProvider:V=Ir}=r;if(N)return{node:(0,n.jsx)(ot,{apis:dr.with(S.hg,s),children:(0,n.jsx)(V,{children:N})})};let ie;if(!((c=k.value)===null||c===void 0)&&c.length){const Ne=g.fromConfigs(k.value),ke=Ne.getOptionalString("app.baseUrl"),it=Ne.getOptionalString("backend.baseUrl");let ut=k.value;const jt={data:{},context:"relative-resolver"};if(ke&&it){const yt=new URL(ke).origin,Bt=new URL(it).origin;if(yt===Bt){const Ft=vo(it);it!==Ft&&(jt.data.backend={baseUrl:Ft})}}if(ke){const yt=vo(ke);ke!==yt&&(jt.data.app={baseUrl:yt})}Object.keys(jt.data).length&&(ut=ut.concat([jt])),ie=g.fromConfigs(ut)}else ie=g.fromConfigs([]);return{api:ie}}class xo{getPlugins(){return this.app.getPlugins()}getSystemIcon(r){return this.app.getSystemIcon(r)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(r){this.app=r}}var Nr=new WeakMap;class bo{getPlugins(){return Array.from(this.plugins)}getSystemIcon(r){return this.icons[r]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(r){const s=this.getProvider();return()=>(0,n.jsx)(s,{children:r})}getProvider(){if((0,b.Z)(this,Nr))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,Q.Z)(this,Nr,!0);const r=new xo(this);let s=!1;return({children:f})=>{const k=(0,W.useRef)(!0),N=(0,W.useMemo)(()=>Re.createWithStorage(this.themes),[]),{routing:V,featureFlags:ie,routeBindings:Ne}=(0,W.useMemo)(()=>{const jt=xe({root:f,discoverers:[Ve,Nt],collectors:{routing:fn()?co:$r,collectedPlugins:on,featureFlags:uo}});return jt.collectedPlugins.forEach(yt=>this.plugins.add(yt)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...jt,routeBindings:mo(this.bindRoutes)}},[f]);s||(s=!0,Ko(V.paths,V.parents),Zr(Ne,this.plugins));const ke=yo(this.configLoader,this.components,N),it="api"in ke;if(it){const{api:jt}=ke;this.configApi=jt}if("node"in ke)return ke.node;if(it&&k.current){k.current=!1;const jt=this.getApiHolder().get(S.W0);if(jt){for(const Ft of this.featureFlags)jt.registerFlag({...Ft,pluginId:""});for(const Ft of this.plugins.values())if("getFeatureFlags"in Ft)for(const yn of Ft.getFeatureFlags())jt.registerFlag({name:yn.name,pluginId:Ft.getId()});else for(const yn of Ft.output())yn.type==="feature-flag"&&jt.registerFlag({name:yn.name,pluginId:Ft.getId()});const yt=jt.getRegisteredFlags(),Bt=new Set(yt.map(Ft=>Ft.name));for(const Ft of ie)Bt.has(Ft)||jt.registerFlag({name:Ft,pluginId:""})}}const{ThemeProvider:ut=Ir}=this.components;return(0,n.jsx)(ot,{apis:this.getApiHolder(),children:(0,n.jsx)(Ar,{appContext:r,children:(0,n.jsx)(ut,{children:(0,n.jsx)(po,{routePaths:V.paths,routeParents:V.parents,routeObjects:V.objects,routeBindings:Ne,basePath:Wn(ke.api),children:(0,n.jsx)(Wt.Provider,{value:{routeObjects:V.objects,appIdentityProxy:this.appIdentityProxy},children:f})})})})})}}getRouter(){return u}getApiHolder(){if(this.apiHolder){for(const r of this.plugins)for(const s of r.getApis())this.apiFactoryRegistry.get(s.api)||this.apiFactoryRegistry.register("default",s);return Ke.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:S.hg,deps:{},factory:()=>Re.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:S.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:S.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:S.W0,deps:{},factory:()=>new lt});for(const r of this.defaultApis)this.apiFactoryRegistry.register("default",r);for(const r of this.plugins)for(const s of r.getApis())if(!this.apiFactoryRegistry.register("default",s))throw new Error(`Plugin ${r.getId()} tried to register duplicate or forbidden API factory for ${s.api}`);for(const r of this.apis)if(!this.apiFactoryRegistry.register("app",r))throw new Error(`Duplicate or forbidden API factory for ${r.api} in app`);return Ke.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Ke(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(r){const s=new Set;for(const c of r){const f=c.getId();if(s.has(f))throw new Error(`Duplicate plugin found '${f}'`);s.add(f)}}constructor(r){this.appIdentityProxy=new Tr,(0,A.Z)(this,Nr,{writable:!0,value:!1});var s;this.apis=(s=r.apis)!==null&&s!==void 0?s:[],this.icons=r.icons;var c;this.plugins=new Set((c=r.plugins)!==null&&c!==void 0?c:[]);var f;this.featureFlags=(f=r.featureFlags)!==null&&f!==void 0?f:[],this.components=r.components,this.themes=r.themes;var k;this.configLoader=(k=r.configLoader)!==null&&k!==void 0?k:Qr;var N;this.defaultApis=(N=r.defaultApis)!==null&&N!==void 0?N:[],this.bindRoutes=r.bindRoutes,this.apiFactoryRegistry=new $e}}function So(i){return new bo(i)}let Fr=!1;const mr=i=>{const r=(0,S.qD)(),{NotFoundErrorPage:s}=r.getComponents(),c=(0,W.useMemo)(()=>fn(),[]),k=[...(0,S.vJ)(i.children,N=>N.getElements().flatMap(V=>{let ie=V.props.path;if(ie==="")return[];var Ne;ie=(Ne=ie==null?void 0:ie.replace(/\/\*$/,""))!==null&&Ne!==void 0?Ne:"/";let ke=c?V:V.props.element;return!c&&!ke&&(ke=V,Fr||(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] />} />."),Fr=!0)),[{path:ie,element:ke,children:V.props.children?[{path:ie==="/"?"/":"*",element:V.props.children}]:void 0}]}).sort((V,ie)=>ie.path.localeCompare(V.path)).map(V=>({...V,path:V.path==="/"?"/":`${V.path}/*`}))),{path:"*",element:(0,n.jsx)(s,{})}];return(0,m.V$)(k)};var ur=t(25488);const qr=[(0,S.ni)({api:S.NW,deps:{configApi:S.Ds},factory:({configApi:i})=>D.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,S.ni)({api:S.$v,deps:{},factory:()=>new ue}),(0,S.ni)({api:S.v_,deps:{},factory:()=>new F}),(0,S.ni)({api:S.VE,deps:{alertApi:S.$v},factory:({alertApi:i})=>{const r=new G(i,new de);return pe.forward(r,{hidden:!1}),r}}),(0,S.ni)({api:S.E6,deps:{errorApi:S.VE},factory:({errorApi:i})=>rt.create({errorApi:i})}),(0,S.ni)({api:S.gP,deps:{configApi:S.Ds,identityApi:S.$4,discoveryApi:S.NW},factory:({configApi:i,identityApi:r,discoveryApi:s})=>ct({middleware:[zt.resolvePluginProtocol({discoveryApi:s}),zt.injectIdentityAuth({identityApi:r,config:i})]})}),(0,S.ni)({api:S.ZM,deps:{},factory:()=>new Rt}),(0,S.ni)({api:S.Kp,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:i,oauthRequestApi:r,configApi:s})=>Fn.create({discoveryApi:i,oauthRequestApi:r,environment:s.getOptionalString("auth.environment")})}),(0,S.ni)({api:S.p_,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:i,oauthRequestApi:r,configApi:s})=>pn.create({discoveryApi:i,oauthRequestApi:r,environment:s.getOptionalString("auth.environment")})}),(0,S.ni)({api:S.F4,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:i,oauthRequestApi:r,configApi:s})=>Yt.create({discoveryApi:i,oauthRequestApi:r,defaultScopes:["read:user"],environment:s.getOptionalString("auth.environment")})}),(0,S.ni)({api:S.D,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:i,oauthRequestApi:r,configApi:s})=>ln.create({discoveryApi:i,oauthRequestApi:r,environment:s.getOptionalString("auth.environment")})}),(0,S.ni)({api:S.ux,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:i,oauthRequestApi:r,configApi:s})=>Mt.create({discoveryApi:i,oauthRequestApi:r,environment:s.getOptionalString("auth.environment")})}),(0,S.ni)({api:S.gW,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:i,oauthRequestApi:r,configApi:s})=>An.create({discoveryApi:i,oauthRequestApi:r,environment:s.getOptionalString("auth.environment")})}),(0,S.ni)({api:S.bq,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:i,oauthRequestApi:r,configApi:s})=>re.create({discoveryApi:i,oauthRequestApi:r,defaultScopes:["team"],environment:s.getOptionalString("auth.environment")})}),(0,S.ni)({api:S.Km,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM},factory:({discoveryApi:i,oauthRequestApi:r})=>Ze.create({discoveryApi:i,oauthRequestApi:r,defaultScopes:["REPO_READ"]})}),(0,S.ni)({api:S.uB,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:i,oauthRequestApi:r,configApi:s})=>pt.create({discoveryApi:i,oauthRequestApi:r,environment:s.getOptionalString("auth.environment")})}),(0,S.ni)({api:ur.RV,deps:{discovery:S.NW,identity:S.$4,config:S.Ds},factory:({config:i,discovery:r,identity:s})=>ur.iM.create({config:i,discovery:r,identity:s})})];var Co=t(77277),Kt=t(23196),wn=t(39857);function wo({children:i}){return(0,m.GV)()?(0,n.jsx)(n.Fragment,{children:i}):(0,n.jsx)(m.VA,{children:i})}const jo=()=>(0,n.jsx)(Kt.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),Eo=({step:i,error:r})=>{let s="";return i==="load-config"?s=`The configuration failed to load, someone should have a look at this error: ${r.message}`:i==="load-chunk"&&(s=`Lazy loaded chunk failed to load, try to reload the page: ${r.message}`),(0,n.jsx)(wo,{children:(0,n.jsx)(Kt.mf,{status:"501",statusMessage:s})})},Ao=({error:i,resetError:r,plugin:s})=>(0,n.jsx)(Kt.yu,{title:`Error in ${s==null?void 0:s.getId()}`,defaultExpanded:!0,error:i,children:(0,n.jsx)(Co.Z,{variant:"outlined",onClick:r,children:"Retry"})}),To={Progress:Kt.Ex,Router:wn.VK,NotFoundErrorPage:jo,BootErrorPage:Eo,ErrorBoundaryFallback:Ao};var Io=t(43642),Ro=t(80079),_r=t(90941),Rr=t(32915),Jo=t(40562),Lo=t(21853),eo=t(60744),Po=t(66569),Ts=t(30254),v=t(13384),x=t(15933),L=t(58838),Z=t(86737),J=t(4989),ee=t(44407),ne=t(18628),le=t(84219),be=t(98685),Ce=t(39781);const Ie={brokenImage:Ro.Z,catalog:ne.Z,scaffolder:Rr.Z,techdocs:Jo.Z,search:Lo.Z,chat:eo.Z,dashboard:Po.Z,docs:Ts.Z,email:v.Z,github:L.Z,group:le.Z,help:Z.Z,"kind:api":x.Z,"kind:component":ee.Z,"kind:domain":Io.Z,"kind:group":le.Z,"kind:location":J.Z,"kind:system":_r.Z,"kind:user":be.Z,user:be.Z,warning:Ce.Z};var Ae=t(73689),He=t(48032);const Xe={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")`},qe={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 Te(i){const{colors:r,shape:s,options:c}=i,k=`linear-gradient(90deg, ${(r.length===1?[r[0],r[0]]:r).join(", ")})`,N=`${s}, ${k}`;var V;const ie=(V=c==null?void 0:c.fontColor)!==null&&V!==void 0?V:"#FFFFFF";return{colors:r,shape:s,backgroundImage:N,fontColor:ie}}const vt={home:Te({colors:qe.teal,shape:Xe.wave}),documentation:Te({colors:qe.pinkSea,shape:Xe.wave2}),tool:Te({colors:qe.purpleSky,shape:Xe.round}),service:Te({colors:qe.marineBlue,shape:Xe.wave}),website:Te({colors:qe.veryBlue,shape:Xe.wave}),library:Te({colors:qe.rubyRed,shape:Xe.wave}),other:Te({colors:qe.darkGrey,shape:Xe.wave}),app:Te({colors:qe.toastyOrange,shape:Xe.wave}),apis:Te({colors:qe.teal,shape:Xe.wave2}),card:Te({colors:qe.greens,shape:Xe.wave})},Ut=16,Tn='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function In(i){const{palette:r,htmlFontSize:s=Ut,fontFamily:c=Tn,defaultPageTheme:f,pageTheme:k=vt}=i;if(!k[f])throw new Error(`${f} is not defined in pageTheme.`);var N;return{palette:r,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:s,fontFamily:c,h6:{fontWeight:700,fontSize:20,marginBottom:2},h5:{fontWeight:700,fontSize:24,marginBottom:4},h4:{fontWeight:700,fontSize:28,marginBottom:6},h3:{fontSize:32,fontWeight:700,marginBottom:6},h2:{fontSize:40,fontWeight:700,marginBottom:8},h1:{fontSize:54,fontWeight:700,marginBottom:10}},page:k[f],getPageTheme:({themeId:V})=>(N=k[V])!==null&&N!==void 0?N:k[f]}}function or(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,He.darken)(i.palette.link,.3),background:(0,He.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 cn(i){const r=In(i),s=(0,Ae.Z)(r),c=or(s);return{...s,overrides:c}}var Rn=t(34505);const Kn=cn({palette:{type:"light",background:{default:"#F8F8F8"},status:{ok:"#1DB954",warning:"#FF9800",error:"#E22134",running:"#2E77D0",pending:"#FFED51",aborted:"#757575"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#2E77D0"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#000000",textVerySubtle:"#DDD",textSubtle:"#6E6E6E",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#2196F3",link:"#0A6EBE",gold:Rn.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:vt}),Lr=cn({palette:{type:"dark",background:{default:"#333333"},status:{ok:"#71CF88",warning:"#FFB84D",error:"#F84C55",running:"#3488E3",pending:"#FEF071",aborted:"#9E9E9E"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#9CC9FF",dark:"#82BAFD"},secondary:{main:"#FF88B2"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#FFFFFF",textVerySubtle:"#727272",textSubtle:"#CCCCCC",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#82BAFD",link:"#9CC9FF",gold:Rn.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:vt});var Pr=t(98192),Ur=t(15222),jn=t(41547),Ln=t(87561);const kr=[{id:"light",title:"Light Theme",variant:"light",icon:(0,n.jsx)(Ur.Z,{}),Provider:({children:i})=>(0,n.jsx)(jn.Z,{theme:Kn,children:(0,n.jsx)(Ln.ZP,{children:i})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,n.jsx)(Pr.Z,{}),Provider:({children:i})=>(0,n.jsx)(jn.Z,{theme:Lr,children:(0,n.jsx)(Ln.ZP,{children:i})})}];function Is(i){var r,s,c,f;return So({...i,apis:(r=i==null?void 0:i.apis)!==null&&r!==void 0?r:[],bindRoutes:i==null?void 0:i.bindRoutes,components:{...To,...i==null?void 0:i.components},configLoader:i==null?void 0:i.configLoader,defaultApis:qr,icons:{...Ie,...i==null?void 0:i.icons},plugins:(s=i==null?void 0:i.plugins)!==null&&s!==void 0?s:[],featureFlags:(c=i==null?void 0:i.featureFlags)!==null&&c!==void 0?c:[],themes:(f=i==null?void 0:i.themes)!==null&&f!==void 0?f:kr})}var Xo=t(25271),vr=t(76635);async function gi({storageApi:i}){const r=i.forBucket("settings"),s=i.forBucket("starredEntities"),c=r.snapshot("starredEntities").value;if(!(0,vr.isArray)(c))return;var f;const k=new Set((f=s.snapshot("entityRefs").value)!==null&&f!==void 0?f:[]);c.filter(vr.isString).map(N=>N.split(":")).filter(N=>N.length===4&&N[0]==="entity").map(([N,V,ie,Ne])=>(0,Xo.eE)({kind:V,namespace:ie,name:Ne})).forEach(N=>k.add(N)),await s.set("entityRefs",Array.from(k)),await r.remove("starredEntities")}class mi{async toggleStarred(r){this.starredEntities.has(r)?this.starredEntities.delete(r):this.starredEntities.add(r),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const r of this.subscribers)r.next(new Set(this.starredEntities))}constructor(r){this.subscribers=new Set,this.observable=new(me())(c=>(c.next(new Set(this.starredEntities)),this.subscribers.add(c),()=>{this.subscribers.delete(c)})),gi(r).then(),this.settingsStore=r.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:c=>{var f;this.starredEntities=new Set((f=c.value)!==null&&f!==void 0?f:[]),this.notifyChanges()}})}}var ia=t(33414),Mr=t(79692),vi=t(12420),$n=t(56941),aa=t(19928);function Rs(){const i=useApi(catalogApiRef),{error:r,loading:s,value:c}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(k=>{var N;return((N=k.facets.kind)===null||N===void 0?void 0:N.map(V=>V.value).sort())||[]}),[i]);return{loading:s,error:r,allKinds:c!=null?c:[]}}function yi(i,r,s){let c=i;return r&&(c=c.filter(k=>r.some(N=>N.toLocaleLowerCase("en-US")===k.toLocaleLowerCase("en-US")))),s&&!i.some(k=>k.toLocaleLowerCase("en-US")===s.toLocaleLowerCase("en-US"))&&(c=c.concat([s])),c.sort().reduce((k,N)=>(k[N.toLocaleLowerCase("en-US")]=N,k),{})}const Ls=(0,Mr.Z)(i=>(0,vi.Z)({root:{...i.typography.h4}}));function xi(i){var r;const{initialFilter:s="component",allowedKinds:c}=i,f=Ls(),{allKinds:k}=useAllKinds(),{filters:N,updateFilters:V,queryParameters:{kind:ie}}=useEntityList(),Ne=useMemo(()=>[ie].flat()[0],[ie]);var ke;const[it,ut]=useState((ke=Ne!=null?Ne:(r=N.kind)===null||r===void 0?void 0:r.value)!==null&&ke!==void 0?ke:s);useEffect(()=>{Ne&&ut(Ne)},[Ne]),useEffect(()=>{var yt;if(!((yt=N.kind)===null||yt===void 0)&&yt.value){var Bt;ut((Bt=N.kind)===null||Bt===void 0?void 0:Bt.value)}},[N.kind]),useEffect(()=>{V({kind:it?new EntityKindFilter(it):void 0})},[it,V]);const jt=filterKinds(k,c,it);return _jsx(Select,{input:_jsx(InputBase,{}),value:it.toLocaleLowerCase("en-US"),onChange:yt=>ut(yt.target.value),classes:f,children:Object.keys(jt).map(yt=>_jsx(MenuItem,{value:yt,children:`${pluralize(jt[yt])}`},yt))})}var bi=t(86359),ko=t(95544),Ps=t(99688),Oo=t(12231),Bo=t(86136),zr=t(49378),Si=t(85256),$o=t(80030),Qo=t(61837),qo=t(79784),_o=t(50758),ks=t(31654),Os=t(43054),Zo=t(65759),yr=t(51666);const Do="catalog-entity",Bs=(0,yr.J$)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:Do}),Ci=(0,yr.J$)({name:"catalog.entity.create",attributes:{action:"create"}}),es=(0,yr.J$)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:Do}),$s=(0,yr.J$)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:Do}),ts=(0,yr.J$)({name:"catalog.location.read",attributes:{action:"read"}}),Zs=(0,yr.J$)({name:"catalog.location.create",attributes:{action:"create"}}),ns=(0,yr.J$)({name:"catalog.location.delete",attributes:{action:"delete"}}),wi=[Bs,Ci,es,$s,ts,Zs,ns];var rs=t(49166);function os(i){const{unregisterEntityOptions:r,isUnregisterAllowed:s,onUnregisterEntity:c,onClose:f}=i,k=typeof(r==null?void 0:r.disableUnregister)=="boolean";var N;const V=(N=!s||(k?!!(r!=null&&r.disableUnregister):(r==null?void 0:r.disableUnregister)==="disable"))!==null&&N!==void 0?N:!1;let ie=(0,n.jsx)(n.Fragment,{});return(r==null?void 0:r.disableUnregister)!=="hidden"&&(ie=(0,n.jsxs)(Oo.Z,{onClick:()=>{f(),c()},disabled:V,children:[(0,n.jsx)(Bo.Z,{children:(0,n.jsx)(rs.Z,{fontSize:"small"})}),(0,n.jsx)(zr.Z,{primary:"Unregister entity"})]})),(0,n.jsx)(n.Fragment,{children:ie})}const Ds=(0,Mr.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function ji(i){const{UNSTABLE_extraContextMenuItems:r,UNSTABLE_contextMenuOptions:s,onUnregisterEntity:c,onInspectEntity:f}=i,[k,N]=(0,W.useState)(),V=Ds(),Ne=(0,$n.N$)(es).allowed,ke=Bt=>{N(Bt.currentTarget)},it=()=>{N(void 0)},ut=(0,S.h_)(S.$v),jt=(0,W.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>ut.post({message:"Copied!",severity:"info"}))},[ut]),yt=r&&[...r.map(Bt=>(0,n.jsxs)(Oo.Z,{onClick:()=>{it(),Bt.onClick()},children:[(0,n.jsx)(Bo.Z,{children:(0,n.jsx)(Bt.Icon,{fontSize:"small"})}),(0,n.jsx)(zr.Z,{primary:Bt.title})]},Bt.title)),(0,n.jsx)(Si.Z,{},"the divider is here!")];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)($o.ZP,{title:"More",arrow:!0,children:(0,n.jsx)(Qo.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!k,role:"button",onClick:ke,"data-testid":"menu-button",className:V.button,id:"long-menu",children:(0,n.jsx)(Os.Z,{})})}),(0,n.jsx)(qo.ZP,{open:Boolean(k),onClose:it,anchorEl:k,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,n.jsxs)(_o.Z,{children:[yt,(0,n.jsx)(os,{unregisterEntityOptions:s,isUnregisterAllowed:Ne,onUnregisterEntity:c,onClose:it}),(0,n.jsxs)(Oo.Z,{onClick:()=>{it(),f()},children:[(0,n.jsx)(Bo.Z,{children:(0,n.jsx)(ks.Z,{fontSize:"small"})}),(0,n.jsx)(zr.Z,{primary:"Inspect entity"})]}),(0,n.jsxs)(Oo.Z,{onClick:()=>{it(),jt()},children:[(0,n.jsx)(Bo.Z,{children:(0,n.jsx)(Zo.Z,{fontSize:"small"})}),(0,n.jsx)(zr.Z,{primary:"Copy entity URL"})]})]})})]})}const ss="plugin.catalog.entityLayoutRoute",to=()=>null;(0,S.R5)(to,ss,!0),(0,S.R5)(to,"core.gatherMountPoints",!0);function Ns(i){const{entity:r,title:s}=i;return(0,n.jsxs)(ko.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,n.jsx)(ko.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:s}),r&&(0,n.jsx)($n.LH,{entity:r})]})}function _n(i,r,s,c){var f;const k=(f=i!=null?i:c==null?void 0:c.kind)!==null&&f!==void 0?f:"";var N;const V=(N=r!=null?r:c==null?void 0:c.metadata.namespace)!==null&&N!==void 0?N:"";var ie,Ne,ke;return{headerTitle:`${(ke=(Ne=(ie=c==null?void 0:c.metadata.title)!==null&&ie!==void 0?ie:s)!==null&&Ne!==void 0?Ne:c==null?void 0:c.metadata.name)!==null&&ke!==void 0?ke:""}${V&&V!==Xo.zG?` in ${V}`:""}`,headerType:(()=>{let ut=k.toLocaleLowerCase("en-US");return c&&c.spec&&"type"in c.spec&&(ut+=" \u2014 ",ut+=c.spec.type.toLocaleLowerCase("en-US")),ut})()}}function Ei(i){var r;const{entity:s}=i,c=(0,$n.hF)(s,Xo.S4);return(0,n.jsxs)(n.Fragment,{children:[c.length>0&&(0,n.jsx)(Kt.i9,{label:"Owner",value:(0,n.jsx)($n.rI,{entityRefs:c,defaultKind:"Group",color:"inherit"})}),((r=s.spec)===null||r===void 0?void 0:r.lifecycle)&&(0,n.jsx)(Kt.i9,{label:"Lifecycle",value:s.spec.lifecycle})]})}const Ai=i=>{var r,s;const{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,children:k,NotFoundComponent:N}=i,{kind:V,namespace:ie,name:Ne}=(0,S.Oi)($n.wi),{entity:ke,loading:it,error:ut}=(0,$n.ce)(),jt=(0,m.TH)(),yt=(0,S.vJ)(k,Cs=>Cs.selectByComponentData({key:ss,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Vr})=>{if(ke){if(Vr.if&&!Vr.if(ke))return[]}else return[];return[{path:Vr.path,title:Vr.title,children:Vr.children,tabProps:Vr.tabProps}]}),[ke]),{headerTitle:Bt,headerType:Ft}=_n(V,ie,Ne,ke),[yn,tr]=(0,W.useState)(!1),[nr,so]=(0,W.useState)(!1),si=(0,m.s0)(),Ss=async()=>{tr(!1),so(!1),si("/")};(0,W.useEffect)(()=>{tr(!1),so(!1)},[jt.pathname]);var Wo;return(0,n.jsxs)(Kt.T3,{themeId:(Wo=ke==null||(r=ke.spec)===null||r===void 0||(s=r.type)===null||s===void 0?void 0:s.toString())!==null&&Wo!==void 0?Wo:"home",children:[(0,n.jsx)(Kt.h4,{title:(0,n.jsx)(Ns,{title:Bt,entity:ke}),pageTitleOverride:Bt,type:Ft,children:ke&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ei,{entity:ke}),(0,n.jsx)(ji,{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,onUnregisterEntity:()=>tr(!0),onInspectEntity:()=>so(!0)})]})}),it&&(0,n.jsx)(Kt.Ex,{}),ke&&(0,n.jsx)(Kt.tn,{routes:yt}),ut&&(0,n.jsx)(Kt.VY,{children:(0,n.jsx)(Ps.Z,{severity:"error",children:ut.toString()})}),!it&&!ut&&!ke&&(0,n.jsx)(Kt.VY,{children:N||(0,n.jsxs)(Kt.GB,{title:"Entity not found",children:["There is no ",V," with the requested"," ",(0,n.jsx)(Kt.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,n.jsx)($n.pp,{open:yn,entity:ke,onConfirm:Ss,onClose:()=>tr(!1)}),(0,n.jsx)($n.U_,{open:nr,entity:ke,onClose:()=>so(!1)})]})};Ai.Route=to;var la=t(23054);function ca(i){const{open:r,onClose:s,onConfirm:c,entity:f}=i,[k,N]=useState(!1),V=useApi(catalogApiRef),ie=useApi(alertApiRef),Ne=async()=>{N(!0);try{const ke=f.metadata.uid;await V.removeEntityByUid(ke),c()}catch(ke){assertError(ke),ie.post({message:ke.message})}finally{N(!1)}};return _jsxs(Dialog,{open:r,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:k,onClick:Ne,children:"Delete"}),_jsx(Button,{onClick:s,color:"primary",children:"Cancel"})]})]})}var No=t(19625);function da(i){var r,s;return(i==null||(r=i.metadata)===null||r===void 0||(s=r.annotations)===null||s===void 0?void 0:s["backstage.io/orphan"])==="true"}function ua(){const i=useNavigate(),r=useRouteRef(rootRouteRef),[s,c]=useState(!1),{entity:f}=useEntity(),k=async()=>{c(!1),i(r())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>c(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:s,entity:f,onConfirm:k,onClose:()=>c(!1)})]})}var Ti=t(29644);const no=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function Fs(i,r){return{items:(await r.getEntityAncestors({entityRef:i})).items.map(f=>{var k,N;return{errors:((N=(k=f.entity.status)===null||k===void 0?void 0:k.items)!==null&&N!==void 0?N:[]).filter(no).map(Ne=>Ne.error).filter(Ne=>Boolean(Ne)),entity:f.entity}}).filter(f=>f.errors.length>0)}}async function ha(i,r){const s=r.apis.get(catalogApiRef);if(!s)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Fs(stringifyEntityRef(i),s)).items.length>0}function Ii(){const{entity:i}=useEntity(),r=stringifyEntityRef(i),s=useApi(catalogApiRef),{loading:c,error:f,value:k}=useAsync(async()=>Fs(r,s),[r,s]);return f?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:f})}):c||!k?null:_jsx(_Fragment,{children:k.items.map((N,V)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(N.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:N.entity})]}),N.errors.map((ie,Ne)=>_jsx(ResponseErrorPanel,{error:ie},Ne))]},V))})}const is="core.backstage.entitySwitch",ro=i=>null;(0,S.R5)(ro,is,!0);const Us=i=>{var r;const{entity:s,loading:c}=(0,$n.ce)(),f=(0,S.I_)(),k=(0,S.vJ)(i.children,ie=>ie.selectByComponentData({key:is,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(Ne=>{if(c)return[];const{if:ke,children:it}=Ne.props;if(!s)return[{if:ke===void 0,children:it}];var ut;return[{if:(ut=ke==null?void 0:ke(s,{apis:f}))!==null&&ut!==void 0?ut:!0,children:it}]}),[f,s,c]);if(k.some(ie=>typeof ie.if=="object"&&"then"in ie.if))return(0,n.jsx)(Ms,{results:k});var V;return(V=(r=k.find(ie=>ie.if))===null||r===void 0?void 0:r.children)!==null&&V!==void 0?V:null};function Ms({results:i}){const{loading:r,value:s}=(0,ve.default)(async()=>{const c=i.map(async({if:k,children:N})=>{try{if(await k)return N}catch{}return null});var f;return(f=(await Promise.all(c)).find(Boolean))!==null&&f!==void 0?f:null},[i]);return r||!s?null:s}Us.Case=ro;const Ri=null,as=$n._i.Filters,ls=$n._i.Content;var Fo=t(85877),cs=t(15096);const Pn=(0,S.rx)({id:"catalog",apis:[(0,S.ni)({api:$n.Ah,deps:{discoveryApi:S.NW,fetchApi:S.gP},factory:({discoveryApi:i,fetchApi:r})=>new Ti.MS({discoveryApi:i,fetchApi:r})}),(0,S.ni)({api:$n.p3,deps:{storageApi:S.E6},factory:({storageApi:i})=>new mi({storageApi:i})})],routes:{catalogIndex:No._Z,catalogEntity:$n.wi},externalRoutes:{createComponent:No.yw,viewTechDoc:No.jU},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),hr=Pn.provide((0,S.P4)({name:"CatalogIndexPage",component:()=>t.e(5837).then(t.bind(t,95837)).then(i=>i.CatalogPage),mountPoint:No._Z})),zs=Pn.provide((0,S.P4)({name:"CatalogEntityPage",component:()=>t.e(8951).then(t.bind(t,78951)).then(i=>i.CatalogEntityPage),mountPoint:$n.wi})),Ws=Pn.provide((0,S.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,33414)).then(i=>i.AboutCard)}})),Li=Pn.provide((0,S.CO)({name:"EntityLinksCard",component:{lazy:()=>t.e(7750).then(t.bind(t,17750)).then(i=>i.EntityLinksCard)}})),pa=Pn.provide((0,S.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,85877)).then(i=>i.EntityLabelsCard)}})),sr=Pn.provide((0,S.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>t.e(5458).then(t.bind(t,5458)).then(i=>i.HasSystemsCard)}})),Vs=Pn.provide((0,S.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>t.e(1105).then(t.bind(t,1105)).then(i=>i.HasComponentsCard)}})),Pi=Pn.provide((0,S.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>t.e(2440).then(t.bind(t,82440)).then(i=>i.HasSubcomponentsCard)}})),ki=Pn.provide((0,S.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>t.e(9770).then(t.bind(t,79770)).then(i=>i.HasResourcesCard)}})),Oi=Pn.provide((0,S.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>t.e(9545).then(t.bind(t,19545)).then(i=>i.DependsOnComponentsCard)}})),Bi=Pn.provide((0,S.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>t.e(184).then(t.bind(t,40184)).then(i=>i.DependencyOfComponentsCard)}})),Uo=Pn.provide((0,S.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>t.e(1032).then(t.bind(t,81032)).then(i=>i.DependsOnResourcesCard)}})),Hs=Pn.provide((0,S.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>t.e(732).then(t.bind(t,732)).then(i=>i.RelatedEntitiesCard)}})),Gs=Pn.provide((0,cs.E5)({name:"CatalogSearchResultListItem",component:()=>t.e(7670).then(t.bind(t,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var Mo=t(32838);class ds{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(r,s){const f=`${await this.getApiOrigin()}/${s}`,k=await fetch(`${f.endsWith("/")?f:`${f}/`}index.html`);if(k.status===404)throw new Error("Page not found");return k.text()}async syncEntityDocs(r){return"cached"}async getBaseUrl(r,s,c){const f=await this.getApiOrigin();return new URL(r,`${f}/${c}`).toString()}constructor({configApi:r,discoveryApi:s,identityApi:c}){this.configApi=r,this.discoveryApi=s,this.identityApi=c}}class zo{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(r){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(r){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:r,discoveryApi:s,identityApi:c}){this.configApi=r,this.discoveryApi=s,this.identityApi=c}}const Ks=[(0,S.ni)({api:Se.Dl,deps:{configApi:S.Ds,discoveryApi:S.NW,identityApi:S.$4},factory:({configApi:i,discoveryApi:r,identityApi:s})=>new ds({configApi:i,discoveryApi:r,identityApi:s})}),(0,S.ni)({api:Se.gT,deps:{configApi:S.Ds,discoveryApi:S.NW,identityApi:S.$4},factory:({configApi:i,discoveryApi:r,identityApi:s})=>new zo({configApi:i,discoveryApi:r,identityApi:s})}),(0,S.ni)({api:Mo.q3,deps:{configApi:S.Ds},factory:({configApi:i})=>Mo.ae.fromConfig(i)})],us={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},hs={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function ps(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function Ys(){const i=await Qr(),r=await ps();return[...i,{context:"detected",data:r?us:hs}]}var Wr=t(58845);const Js=(0,Mr.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var fs=()=>{const i=Js();return(0,n.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,n.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 gs=(0,Mr.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Xs=()=>{const i=gs();return(0,n.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,n.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 Qs=(0,Mr.Z)({root:{width:Kt.po.drawerWidthClosed,height:3*Kt.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:Kt.po.drawerWidthClosed,marginLeft:24}}),ms=()=>{const i=Qs(),{isOpen:r}=(0,Kt.mZ)();return(0,n.jsx)("div",{className:i.root,children:(0,n.jsx)(Kt.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:r?(0,n.jsx)(fs,{}):(0,n.jsx)(Xs,{})})})},_s=({children:i})=>(0,n.jsxs)(Kt.tR,{children:[(0,n.jsxs)(Kt.YE,{children:[(0,n.jsx)(ms,{}),(0,n.jsx)(Kt.v7,{}),(0,n.jsx)(Kt.R6,{icon:Wr.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var oo=t(32388),vs=t(4142);const ei=(0,Mr.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 er;(function(i){i.LIGHT="light",i.DARK="dark"})(er||(er={}));const ti=()=>{const i=(0,S.h_)(S.hg),r=ei(),[s,c]=(0,W.useState)(i.getActiveThemeId()===er.DARK?er.DARK:er.LIGHT),f={[er.LIGHT]:{icon:vs.Z,title:"Dark theme"},[er.DARK]:{icon:oo.Z,title:"Light theme"}},{title:k,icon:N}=f[s],V=()=>{c(ie=>{const Ne=ie===er.LIGHT?er.DARK:er.LIGHT;return i.setActiveThemeId(Ne),Ne})};return(0,n.jsx)(ko.Z,{display:"flex",alignItems:"center",mr:2,children:(0,n.jsx)($o.ZP,{title:k,arrow:!0,children:(0,n.jsx)(Qo.Z,{size:"small",onClick:V,children:(0,n.jsx)(N,{className:r.headerIcon})})})})},ys=()=>(0,n.jsxs)(C.I6,{children:[(0,n.jsx)(B.S,{}),(0,n.jsx)(I.F,{withSearch:!1})]}),xs=(0,n.jsx)(ys,{}),Zn=Is({apis:Ks,configLoader:Ys,plugins:Object.values(h)}),ni=Zn.getProvider(),ri=Zn.getRouter(),oi=C.s4.provide((0,Se.KY)({name:"ThemeToggleAddon",component:ti,location:Se.oZ.Header})),bs=(0,n.jsxs)(mr,{children:[(0,n.jsx)(m.Fg,{to:"/docs/default/component/local/"},"/"),(0,n.jsx)(m.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,n.jsx)(zs,{})}),(0,n.jsx)(m.AW,{path:"/docs",element:(0,n.jsx)(C.Jl,{}),children:(0,n.jsx)(T.u,{})}),(0,n.jsxs)(m.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,n.jsx)(C.I6,{}),children:[xs,(0,n.jsx)(Se.DR,{children:(0,n.jsx)(oi,{})})]})]});var Ni=()=>(0,n.jsx)(ni,{children:(0,n.jsx)(ri,{children:(0,n.jsx)(_s,{children:bs})})});O.render((0,n.jsx)(Ni,{}),document.getElementById("root"))},51837:function(At,Be,t){"use strict";t.d(Be,{CT:function(){return S},EI:function(){return oe},uW:function(){return O},Vt:function(){return l}});function h(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const n=h(),W=_=>`__@backstage/${_}__`;function O(_,te){const B=W(_);let I=n[B];return I||(I=te(),n[B]=I,I)}var m=t(2784);function S(_){return O(_,()=>(0,m.createContext)(void 0))}function l(_){return(0,m.useContext)(S(_))}function P(_){return{set(te){globalThis[`__@backstage/${_}__`]=createContext(createVersionedValueMap(te))},reset(){delete globalThis[`__@backstage/${_}__`]}}}function oe(_){Object.freeze(_);const te={atVersion(B){return _[B]}};return Object.defineProperty(te,"$map",{configurable:!0,enumerable:!0,get(){return _}}),te}},56941:function(At,Be,t){"use strict";t.d(Be,{h$:function(){return wt},n3:function(){return h.n3},_i:function(){return z},tW:function(){return he},df:function(){return D},UO:function(){return En},dq:function(){return Ee},nl:function(){return Po},dx:function(){return ze},rI:function(){return Ke},u3:function(){return nt},xE:function(){return sn},sL:function(){return zn},LH:function(){return u},U_:function(){return qr},pp:function(){return Eo},EW:function(){return Rr},Ah:function(){return W},wi:function(){return Se},hF:function(){return ht},CV:function(){return gt},$3:function(){return Ye},p3:function(){return O},ce:function(){return Gt},X2:function(){return Pt},wp:function(){return ln},ZW:function(){return je},N$:function(){return _e},eK:function(){return mn},CR:function(){return An}});var h=t(29644),n=t(25248);const W=(0,n.T0)({id:"plugin.catalog.service"}),O=(0,n.T0)({id:"catalog-react.starred-entities"});var m=t(82394);class S{async toggleStarred(x){this.starredEntities.delete(x)||this.starredEntities.add(x);for(const L of this.subscribers)L.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){this.starredEntities=new Set,this.subscribers=new Set,this.observable=new ObservableImpl(x=>(x.next(new Set(this.starredEntities)),this.subscribers.add(x),()=>{this.subscribers.delete(x)}))}}var l=t(52322),P=t(2784),oe=t(41156),_=t(60364),te=t(77277),B=t(4190),I=t(95544),K=t(90436),ce=t(60905),se=t(36444);const $=v=>{const x=(0,oe.Z)(ee=>ee.breakpoints.down("md")),L=(0,_.Z)(),[Z,J]=(0,P.useState)(!1);return x?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(te.Z,{style:{marginTop:L.spacing(1),marginLeft:L.spacing(1)},onClick:()=>J(!0),startIcon:(0,l.jsx)(se.Z,{}),children:"Filters"}),(0,l.jsx)(B.ZP,{open:Z,onClose:()=>J(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,l.jsxs)(I.Z,{m:2,children:[(0,l.jsx)(K.Z,{variant:"h6",component:"h2",style:{marginBottom:L.spacing(1)},children:"Filters"}),v.children]})})]}):(0,l.jsx)(ce.Z,{item:!0,lg:2,children:v.children})},T=v=>(0,l.jsx)(ce.Z,{item:!0,xs:12,lg:10,children:v.children}),z=v=>(0,l.jsx)(ce.Z,{container:!0,style:{position:"relative"},children:v.children});z.Filters=$,z.Content=T;var R=t(23196),C=t(25271),X=t(51837);const Se=(0,X.uW)("catalog:entity-route-ref",()=>(0,n.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function Ge(v){var x,L;return{kind:v.kind.toLocaleLowerCase("en-US"),namespace:(L=(x=v.metadata.namespace)===null||x===void 0?void 0:x.toLocaleLowerCase("en-US"))!==null&&L!==void 0?L:DEFAULT_NAMESPACE,name:v.metadata.name}}function Ye(v,x){const L=x==null?void 0:x.defaultKind;let Z,J,ee;return"metadata"in v?(Z=v.kind,J=v.metadata.namespace,ee=v.metadata.name):(Z=v.kind,J=v.namespace,ee=v.name),(J===void 0||J==="")&&(J=C.zG),(x==null?void 0:x.defaultNamespace)!==void 0?(x==null?void 0:x.defaultNamespace)===J&&(J=void 0):J===C.zG&&(J=void 0),Z=Z.toLocaleLowerCase("en-US"),Z=L&&L.toLocaleLowerCase("en-US")===Z?void 0:Z,`${Z?`${Z}:`:""}${J?`${J}/`:""}${ee}`}var dt=t(80030);const ze=(0,P.forwardRef)((v,x)=>{const{entityRef:L,defaultKind:Z,title:J,children:ee,...ne}=v,le=(0,n.tg)(Se);let be,Ce,Ie;if(typeof L=="string"){const Te=(0,C.of)(L);be=Te.kind,Ce=Te.namespace,Ie=Te.name}else"metadata"in L?(be=L.kind,Ce=L.metadata.namespace,Ie=L.metadata.name):(be=L.kind,Ce=L.namespace,Ie=L.name);be=be.toLocaleLowerCase("en-US");var Ae;Ce=(Ae=Ce==null?void 0:Ce.toLocaleLowerCase("en-US"))!==null&&Ae!==void 0?Ae:C.zG;const He={kind:be,namespace:Ce,name:Ie},Xe=Ye({kind:be,namespace:Ce,name:Ie},{defaultKind:Z}),qe=(0,l.jsxs)(R.rU,{...ne,ref:x,to:le(He),children:[ee,!ee&&(J!=null?J:Xe)]});return J?(0,l.jsx)(dt.ZP,{title:Xe,children:qe}):qe});var at=t(64279);function ot(v){const{entityRefs:x,defaultKind:L,getTitle:Z,...J}=v,ee=(0,n.h_)(W),{value:ne=new Array,loading:le,error:be}=(0,at.default)(async()=>{const Ce=x.reduce((Ae,He)=>"metadata"in He?Ae:[...Ae,(0,C.of)(He)],new Array),Ie=x.filter(Ae=>"metadata"in Ae);return Ce.length>0?[...(await ee.getEntities({filter:Ce.map(Ae=>({kind:Ae.kind,"metadata.namespace":Ae.namespace,"metadata.name":Ae.name}))})).items,...Ie]:Ie},[x]);return le?(0,l.jsx)(R.Ex,{}):be?(0,l.jsx)(R.yu,{error:be}):(0,l.jsx)(l.Fragment,{children:ne.map((Ce,Ie)=>(0,l.jsxs)(P.Fragment,{children:[Ie>0&&", ",(0,l.jsx)(ze,{...J,defaultKind:L,entityRef:Ce,title:Z(Ce)})]},Ie))})}function Ke(v){const{entityRefs:x,defaultKind:L,fetchEntities:Z,getTitle:J,...ee}=v;return Z?(0,l.jsx)(ot,{...ee,defaultKind:L,entityRefs:x,getTitle:J}):(0,l.jsx)(l.Fragment,{children:x.map((ne,le)=>(0,l.jsxs)(P.Fragment,{children:[le>0&&", ",(0,l.jsx)(ze,{...ee,defaultKind:L,entityRef:ne,title:J?J(ne):void 0})]},le))})}function Qe(v){return v.reduce((x,L)=>({...x,...L.getCatalogFilters?L.getCatalogFilters():{}}),{})}function $e(v){return x=>v.every(L=>!L.filterEntity||L.filterEntity(x))}function ht(v,x,L){var Z;let J=(v==null||(Z=v.relations)===null||Z===void 0?void 0:Z.filter(ee=>ee.type===x).map(ee=>(0,C.of)(ee.targetRef)))||[];return L!=null&&L.kind&&(J=J.filter(ee=>ee.kind.toLocaleLowerCase("en-US")===L.kind.toLocaleLowerCase("en-US"))),J}function gt(v,x){var L;const Z=(L=v.metadata.annotations)===null||L===void 0?void 0:L[C.M6];if(!!Z)try{const J=(0,C.Ou)(Z),ee=x.byUrl(J.target);return{locationTargetUrl:J.target,integrationType:ee==null?void 0:ee.type}}catch{return}}function Ct(v,x){const L=new Set([...getEntityRelations(v,RELATION_MEMBER_OF,{kind:"group"}),...v?[getCompoundEntityRef(v)]:[]].map(stringifyEntityRef)),Z=getEntityRelations(x,RELATION_OWNED_BY).map(stringifyEntityRef);for(const J of Z)if(L.has(J))return!0;return!1}class $t{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(x){this.value=x}}class Lt{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(x){this.value=x}}class We{filterEntity(x){var L;return this.values.every(Z=>((L=x.metadata.tags)!==null&&L!==void 0?L:[]).includes(Z))}toQueryValue(){return this.values}constructor(x){this.values=x}}class me{filterEntity(x){const L=this.toUpperArray(this.value.split(/\s/)),Z=this.toUpperArray([x.metadata.tags]),J=this.toUpperArray([x.metadata.name,x.metadata.title]);for(const ee of L)if(Z.every(ne=>ne!==ee)&&J.every(ne=>!ne.includes(ee)))return!1;return!0}toUpperArray(x){return x.flat().filter(L=>Boolean(L)).map(L=>L.toLocaleUpperCase("en-US"))}constructor(x){this.value=x}}class Le{filterEntity(x){return this.values.some(L=>ht(x,C.S4).some(Z=>Ye(Z,{defaultKind:"group"})===L))}toQueryValue(){return this.values}constructor(x){this.values=x}}class Pe{filterEntity(x){return this.values.some(L=>{var Z;return((Z=x.spec)===null||Z===void 0?void 0:Z.lifecycle)===L})}toQueryValue(){return this.values}constructor(x){this.values=x}}class Fe{filterEntity(x){switch(this.value){case"owned":return this.isOwnedEntity(x);case"starred":return this.isStarredEntity(x);default:return!0}}toQueryValue(){return this.value}constructor(x,L,Z){this.value=x,this.isOwnedEntity=L,this.isStarredEntity=Z}}class tt{filterEntity(x){var L;const Z=(L=x.metadata.annotations)===null||L===void 0?void 0:L["backstage.io/orphan"];return Z!==void 0&&this.value.toString()===Z}constructor(x){this.value=x}}class Zt{filterEntity(x){var L,Z;const J=(x==null||(L=x.status)===null||L===void 0||(Z=L.items)===null||Z===void 0?void 0:Z.length)>0;return J!==void 0&&this.value===J}constructor(x){this.value=x}}const xt=(0,X.CT)("entity-context"),wt=({children:v,entity:x,loading:L,error:Z,refresh:J})=>{const ee={entity:x,loading:L,error:Z,refresh:J};return(0,l.jsx)(xt.Provider,{value:(0,X.EI)({1:ee}),children:(0,l.jsx)(n.fC,{attributes:{...x?{entityRef:(0,C.eE)(x)}:void 0},children:v})})},bt=v=>_jsx(wt,{entity:v.entity,loading:!Boolean(v.entity),error:void 0,refresh:void 0,children:v.children});function Pt(){const v=(0,X.Vt)("entity-context");if(!v)throw new Error("Entity context is not available");const x=v.atVersion(1);if(!x)throw new Error("EntityContext v1 not available");if(!x.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:x.entity}}function Gt(){const v=(0,X.Vt)("entity-context");if(!v)throw new Error("Entity context is not available");const x=v.atVersion(1);if(!x)throw new Error("EntityContext v1 not available");const{entity:L,loading:Z,error:J,refresh:ee}=x;return{entity:L,loading:Z,error:J,refresh:ee}}var Yt=t(76635),an=t(19126),Mt=t.n(an),hn=t(79635),bn=t(69294),Fn=t(48760),Sn=t(90736);const kn=(0,P.createContext)(void 0),En=({children:v})=>{const x=(0,Sn.default)(),L=(0,n.h_)(W),[Z,J]=(0,P.useState)({}),ee=(0,hn.TH)();var ne;const le=(0,P.useMemo)(()=>(ne=Mt().parse(ee.search,{ignoreQueryPrefix:!0}).filters)!==null&&ne!==void 0?ne:{},[ee]),[be,Ce]=(0,P.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:Ie,error:Ae},He]=(0,bn.default)(async()=>{const Te=(0,Yt.compact)(Object.values(Z)),vt=$e(Te),Ut=Qe(Te),Tn=Qe((0,Yt.compact)(Object.values(be.appliedFilters))),In=Object.keys(Z).reduce((cn,Rn)=>{const Kn=Z[Rn];return Kn!=null&&Kn.toQueryValue&&(cn[Rn]=Kn.toQueryValue()),cn},{});if((0,Yt.isEqual)(Tn,Ut))Ce({appliedFilters:Z,backendEntities:be.backendEntities,entities:be.backendEntities.filter(vt)});else{const cn=await L.getEntities({filter:Ut});Ce({appliedFilters:Z,backendEntities:cn.items,entities:cn.items.filter(vt)})}if(x()){var or;const cn=Mt().parse(ee.search,{ignoreQueryPrefix:!0}),Rn=Mt().stringify({...cn,filters:In},{addQueryPrefix:!0,arrayFormat:"repeat"}),Kn=`${window.location.pathname}${Rn}`;(or=window.history)===null||or===void 0||or.replaceState(null,document.title,Kn)}},[L,le,Z,be],{loading:!0});(0,Fn.Z)(He,10,[Z]);const Xe=(0,P.useCallback)(Te=>{J(vt=>{const Ut=typeof Te=="function"?Te(vt):Te;return{...vt,...Ut}})},[]),qe=(0,P.useMemo)(()=>({filters:be.appliedFilters,entities:be.entities,backendEntities:be.backendEntities,updateFilters:Xe,queryParameters:le,loading:Ie,error:Ae}),[be,Xe,le,Ie,Ae]);return(0,l.jsx)(kn.Provider,{value:qe,children:v})};function ln(){const v=(0,P.useContext)(kn);if(!v)throw new Error("useEntityList must be used within EntityListProvider");return v}var tn=t(18149),Un=t.n(tn),Mn=t(829),On=t.n(Mn);function Bn(){const v=(0,n.h_)(W),{filters:{kind:x,type:L},queryParameters:{type:Z},updateFilters:J}=ln(),ee=(0,P.useMemo)(()=>[Z].flat().filter(Boolean),[Z]);var ne;const[le,be]=(0,P.useState)(ee.length?ee:(ne=L==null?void 0:L.getTypes())!==null&&ne!==void 0?ne:[]);(0,P.useEffect)(()=>{ee.length&&be(ee)},[ee]);const[Ce,Ie]=(0,P.useState)([]),Ae=(0,P.useMemo)(()=>x==null?void 0:x.value,[x]),{error:He,loading:Xe,value:qe}=(0,at.default)(async()=>Ae?await v.getEntityFacets({filter:{kind:Ae},facets:["spec.type"]}).then(Ut=>Ut.facets["spec.type"]||[]):[],[Ae,v]),Te=(0,P.useRef)(qe);return(0,P.useEffect)(()=>{const vt=Te.current;if(Te.current=qe,Xe||!Ae||vt===qe||!qe)return;const Ut=[...new Set(On()(qe,In=>-In.count).map(In=>In.value.toLocaleLowerCase("en-US")))];Ie(Ut);const Tn=le.filter(In=>Ut.includes(In));Un()(le,Tn)||be(Tn)},[Xe,Ae,le,be,qe]),(0,P.useEffect)(()=>{J({type:le.length?new Lt(le):void 0})},[le,J]),{loading:Xe,error:He,availableTypes:Ce,selectedTypes:le,setSelectedTypes:be}}const pn=20;function mn(v,x){var L,Z;const J=x==null||(L=x.type)===null||L===void 0?void 0:L.toLocaleLowerCase("en-US"),ee=x==null||(Z=x.kind)===null||Z===void 0?void 0:Z.toLocaleLowerCase("en-US"),ne=(0,n.h_)(W),{loading:le,value:be,error:Ce}=(0,at.default)(async()=>{var Ie;const Ae=(Ie=v.relations)===null||Ie===void 0?void 0:Ie.map(Te=>({type:Te.type,target:(0,C.of)(Te.targetRef)})).filter(Te=>(!J||Te.type.toLocaleLowerCase("en-US")===J)&&(!ee||Te.target.kind===ee));if(!Ae)return[];const He=Object.values((0,Yt.groupBy)(Ae,({target:Te})=>`${Te.kind}:${Te.namespace}`.toLocaleLowerCase("en-US"))),Xe=[];for(const Te of He)Xe.push({kind:Te[0].target.kind,namespace:Te[0].target.namespace,nameBatches:(0,Yt.chunk)(Te.map(vt=>vt.target.name),pn)});return(await Promise.all(Xe.flatMap(Te=>Te.nameBatches.map(vt=>ne.getEntities({filter:{kind:Te.kind,"metadata.namespace":Te.namespace,"metadata.name":vt}}))))).flatMap(Te=>Te.items)},[v,J,ee]);return{entities:be,loading:le,error:Ce}}var Hn=t(72164);function Cn(v){return typeof v=="string"?v:(0,C.eE)(v)}function An(){const v=(0,n.h_)(O),x=(0,Hn.Z)(v.starredEntitie$(),new Set),L=(0,P.useCallback)(J=>x.has(Cn(J)),[x]),Z=(0,P.useCallback)(J=>v.toggleStarred(Cn(J)).then(),[v]);return{starredEntities:x,toggleStarredEntity:Z,isStarredEntity:L}}function ge(v){return typeof v=="string"?v:(0,C.eE)(v)}function re(v){const x=(0,n.h_)(O),[L,Z]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{const ee=x.starredEntitie$().subscribe({next(ne){Z(ne.has(ge(v)))}});return()=>{ee.unsubscribe()}},[v,x]),{toggleStarredEntity:(0,P.useCallback)(()=>x.toggleStarred(ge(v)).then(),[v,x]),isStarredEntity:L}}function je(){const v=(0,n.h_)(n.$4),{loading:x,value:L}=(0,at.default)(async()=>{const{ownershipEntityRefs:J}=await v.getBackstageIdentity();return J},[]),Z=(0,P.useMemo)(()=>{const J=new Set(L!=null?L:[]);return ee=>{const ne=ht(ee,C.S4).map(C.eE);for(const le of ne)if(J.has(le))return!0;return!1}},[L]);return(0,P.useMemo)(()=>({loading:x,isOwnedEntity:Z}),[x,Z])}var Ze=t(25488);function _e(v){const{entity:x,loading:L,error:Z}=Gt(),{allowed:J,loading:ee,error:ne}=(0,Ze.gI)({permission:v,resourceRef:x?(0,C.eE)(x):void 0});return L||ee?{loading:!0,allowed:!1}:Z?{loading:!1,allowed:!1,error:Z}:{loading:!1,allowed:J,error:ne}}function pt(){const v=(0,n.h_)(W),{error:x,loading:L,value:Z}=(0,at.default)(async()=>await v.getEntityFacets({facets:["kind"]}).then(ee=>{var ne;return((ne=ee.facets.kind)===null||ne===void 0?void 0:ne.map(le=>le.value).sort())||[]}),[v]);return{loading:L,error:x,allKinds:Z!=null?Z:[]}}function ue(v,x,L){let Z=v;return x&&(Z=Z.filter(ee=>x.some(ne=>ne.toLocaleLowerCase("en-US")===ee.toLocaleLowerCase("en-US")))),L&&!v.some(ee=>ee.toLocaleLowerCase("en-US")===L.toLocaleLowerCase("en-US"))&&(Z=Z.concat([L])),Z.sort().reduce((ee,ne)=>(ee[ne.toLocaleLowerCase("en-US")]=ne,ee),{})}function F(v){var x;const{filters:L,queryParameters:{kind:Z},updateFilters:J}=ln(),ee=(0,P.useMemo)(()=>[Z].flat()[0],[Z]);var ne;const[le,be]=(0,P.useState)((ne=ee!=null?ee:(x=L.kind)===null||x===void 0?void 0:x.value)!==null&&ne!==void 0?ne:v.initialFilter);(0,P.useEffect)(()=>{ee&&be(ee)},[ee]),(0,P.useEffect)(()=>{var He;if(!((He=L.kind)===null||He===void 0)&&He.value){var Xe;be((Xe=L.kind)===null||Xe===void 0?void 0:Xe.value)}},[L.kind]),(0,P.useEffect)(()=>{J({kind:le?new $t(le):void 0})},[le,J]);const{allKinds:Ce,loading:Ie,error:Ae}=pt();return{loading:Ie,error:Ae,allKinds:Ce!=null?Ce:[],selectedKind:le,setSelectedKind:be}}const he=v=>{const{allowedKinds:x,hidden:L,initialFilter:Z="component"}=v,J=(0,n.h_)(n.$v),{error:ee,allKinds:ne,selectedKind:le,setSelectedKind:be}=F({initialFilter:Z});if((0,P.useEffect)(()=>{ee&&J.post({message:"Failed to load entity kinds",severity:"error"})},[ee,J]),ee)return null;const Ce=ue(ne,x,le),Ie=Object.keys(Ce).map(Ae=>({value:Ae,label:Ce[Ae]}));return L?null:(0,l.jsx)(I.Z,{pb:1,pt:1,children:(0,l.jsx)(R.Ph,{label:"Kind",items:Ie,selected:le.toLocaleLowerCase("en-US"),onChange:Ae=>be(String(Ae))})})};var Re=t(79692),et=t(5806),Ue=t(21324),Et=t(86619),Vt=t(19996),Jt=t(25505),Xt=t(38016),q=t(88013);const H=(0,Re.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),g=(0,l.jsx)(Jt.Z,{fontSize:"small"}),w=(0,l.jsx)(Vt.Z,{fontSize:"small"}),D=v=>{var x;const{initialFilter:L=[]}=v,Z=H(),{updateFilters:J,backendEntities:ee,filters:ne,queryParameters:{lifecycles:le}}=ln(),be=(0,P.useMemo)(()=>[le].flat().filter(Boolean),[le]);var Ce;const[Ie,Ae]=(0,P.useState)(be.length?be:(Ce=(x=ne.lifecycles)===null||x===void 0?void 0:x.values)!==null&&Ce!==void 0?Ce:L);(0,P.useEffect)(()=>{be.length&&Ae(be)},[be]);const He=(0,P.useMemo)(()=>[...new Set(ee.map(Xe=>{var qe;return(qe=Xe.spec)===null||qe===void 0?void 0:qe.lifecycle}).filter(Boolean))].sort(),[ee]);return(0,P.useEffect)(()=>{J({lifecycles:Ie.length&&He.length?new Pe(Ie):void 0})},[Ie,J,He]),He.length?(0,l.jsx)(I.Z,{pb:1,pt:1,children:(0,l.jsxs)(K.Z,{variant:"button",component:"label",children:["Lifecycle",(0,l.jsx)(q.ZP,{multiple:!0,options:He,value:Ie,onChange:(Xe,qe)=>Ae(qe),renderOption:(Xe,{selected:qe})=>(0,l.jsx)(et.Z,{control:(0,l.jsx)(Ue.Z,{icon:g,checkedIcon:w,checked:qe}),label:Xe}),size:"small",popupIcon:(0,l.jsx)(Xt.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:Xe=>(0,l.jsx)(Et.Z,{...Xe,className:Z.input,variant:"outlined"})})]})}):null},G=(0,Re.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),de=(0,l.jsx)(Jt.Z,{fontSize:"small"}),pe=(0,l.jsx)(Vt.Z,{fontSize:"small"}),Ee=()=>{var v;const x=G(),{updateFilters:L,backendEntities:Z,filters:J,queryParameters:{owners:ee}}=ln(),ne=(0,P.useMemo)(()=>[ee].flat().filter(Boolean),[ee]);var le;const[be,Ce]=(0,P.useState)(ne.length?ne:(le=(v=J.owners)===null||v===void 0?void 0:v.values)!==null&&le!==void 0?le:[]);(0,P.useEffect)(()=>{ne.length&&Ce(ne)},[ne]);const Ie=(0,P.useMemo)(()=>[...new Set(Z.flatMap(Ae=>ht(Ae,C.S4).map(He=>Ye(He,{defaultKind:"group"}))).filter(Boolean))].sort(),[Z]);return(0,P.useEffect)(()=>{L({owners:be.length&&Ie.length?new Le(be):void 0})},[be,L,Ie]),Ie.length?(0,l.jsx)(I.Z,{pb:1,pt:1,children:(0,l.jsxs)(K.Z,{variant:"button",component:"label",children:["Owner",(0,l.jsx)(q.ZP,{multiple:!0,options:Ie,value:be,onChange:(Ae,He)=>Ce(He),renderOption:(Ae,{selected:He})=>(0,l.jsx)(et.Z,{control:(0,l.jsx)(Ue.Z,{icon:de,checkedIcon:pe,checked:He}),label:Ae}),size:"small",popupIcon:(0,l.jsx)(Xt.Z,{"data-testid":"owner-picker-expand"}),renderInput:Ae=>(0,l.jsx)(Et.Z,{...Ae,className:x.input,variant:"outlined"})})]})}):null},lt=v=>{const x=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:x(getCompoundEntityRef(v.entity)),children:_jsx(InfoIcon,{})})},ct=v=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${v.email}`,to:`mailto:${v.email}`,children:_jsx(EmailIcon,{})}),St=v=>{var x;const L=(x=v.entity.spec.profile)===null||x===void 0?void 0:x.email;return L?_jsx(EmailCardAction,{email:L}):null},Tt=v=>{var x;const L=(x=v.entity.spec.profile)===null||x===void 0?void 0:x.email;return L?_jsx(EmailCardAction,{email:L}):null},st=(0,Re.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),De=4,ft=v=>{var x,L,Z;const{entityRef:J,children:ee,delayTime:ne=500}=v,le=st(),be=useApiHolder(),Ce=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[Ie,Ae]=useState(!1),He=useMemo(()=>debounce(()=>Ae(!0),ne),[ne]),[{loading:Xe,error:qe,value:Te},vt]=useAsyncFn(async()=>{const Tn=be.get(catalogApiRef);if(Tn){const In=await Tn.getEntityByRef(J);if(!In)throw new Error(`${J} not found`);return In}},[be,J]),Ut=()=>{Ae(!1),He.cancel()};return useEffect(()=>{Ce.isOpen&&!Te&&!qe&&!Xe&&vt()},[Ce.isOpen,vt,Te,qe,Xe]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:He,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Ce),children:ee})}),Ie&&_jsx(HoverPopover,{PaperProps:{className:le.popoverPaper},...bindPopover(Ce),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:Ut,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[qe&&_jsx(ResponseErrorPanel,{error:qe}),Xe&&_jsx(Progress,{}),Te&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:Te.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:Te.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:Te.kind}),Te.metadata.description&&_jsx(Typography,{className:le.descriptionTypography,paragraph:!0,children:Te.metadata.description}),_jsx(Typography,{children:(x=Te.spec)===null||x===void 0?void 0:x.type}),_jsxs(Box,{marginTop:"0.5em",children:[(Te.metadata.tags||[]).slice(0,De).map(Tn=>_jsx(Chip,{size:"small",label:Tn},Tn)),((L=Te.metadata.tags)===null||L===void 0?void 0:L.length)&&((Z=Te.metadata.tags)===null||Z===void 0?void 0:Z.length)>De&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!qe&&Te&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity(Te)&&_jsx(UserCardActions,{entity:Te}),isGroupEntity(Te)&&_jsx(GroupCardActions,{entity:Te}),_jsx(EntityCardActions,{entity:Te})]})})]})})]})},It=(0,Re.Z)(v=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),zt=()=>{var v;const x=It(),{filters:L,updateFilters:Z}=useEntityList();var J;const[ee,ne]=useState((J=(v=L.text)===null||v===void 0?void 0:v.value)!==null&&J!==void 0?J:"");return useDebounce(()=>{Z({text:ee.length?new EntityTextFilter(ee):void 0})},250,[ee,Z]),_jsx(Toolbar,{className:x.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:x.input,placeholder:"Search",autoComplete:"off",onChange:le=>ne(le.target.value),value:ee,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>ne(""),edge:"end",disabled:ee.length===0,children:_jsx(Clear,{})})})})})})},mt=Object.freeze({createEntityRefColumn(v){const{defaultKind:x}=v;function L(Z){var J;return((J=Z.metadata)===null||J===void 0?void 0:J.title)||Ye(Z,{defaultKind:x})}return{title:"Name",highlight:!0,customFilterAndSearch(Z,J){return L(J).includes(Z)},customSort(Z,J){return L(Z).localeCompare(L(J))},render:Z=>{var J;return(0,l.jsx)(ze,{entityRef:Z,defaultKind:x,title:(J=Z.metadata)===null||J===void 0?void 0:J.title})}}},createEntityRelationColumn(v){const{title:x,relation:L,defaultKind:Z,filter:J}=v;function ee(le){return ht(le,L,J)}function ne(le){return ee(le).map(be=>Ye(be,{defaultKind:Z})).join(", ")}return{title:x,customFilterAndSearch(le,be){return ne(be).includes(le)},customSort(le,be){return ne(le).localeCompare(ne(be))},render:le=>(0,l.jsx)(Ke,{entityRefs:ee(le),defaultKind:Z})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:C.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:C.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:C.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:v=>(0,l.jsx)(R.Or,{text:v.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),Dt=[mt.createEntityRefColumn({defaultKind:"system"}),mt.createDomainColumn(),mt.createOwnerColumn(),mt.createMetadataDescriptionColumn()],Ht=[mt.createEntityRefColumn({defaultKind:"component"}),mt.createSystemColumn(),mt.createOwnerColumn(),mt.createSpecTypeColumn(),mt.createSpecLifecycleColumn(),mt.createMetadataDescriptionColumn()],Rt=(0,Re.Z)(v=>({empty:{padding:v.spacing(2),display:"flex",justifyContent:"center"}})),nt=v=>{const{entities:x,title:L,emptyContent:Z,variant:J="gridItem",columns:ee}=v,ne=Rt(),le={minWidth:"0",width:"100%"};return J==="gridItem"&&(le.height="calc(100% - 10px)"),(0,l.jsx)(R.iA,{columns:ee,title:L,style:le,emptyContent:Z&&(0,l.jsx)("div",{className:ne.empty,children:Z}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:x})};nt.columns=mt,nt.systemEntityColumns=Dt,nt.componentEntityColumns=Ht;const rt=(0,Re.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),Wt=(0,l.jsx)(Jt.Z,{fontSize:"small"}),fn=(0,l.jsx)(Vt.Z,{fontSize:"small"}),sn=v=>{var x;const L=rt(),{updateFilters:Z,filters:J,queryParameters:{tags:ee}}=ln(),ne=(0,n.h_)(W),{value:le}=(0,at.default)(async()=>{var He;const Xe="metadata.tags",{facets:qe}=await ne.getEntityFacets({facets:[Xe],filter:(He=J.kind)===null||He===void 0?void 0:He.getCatalogFilters()});return Object.fromEntries(qe[Xe].map(({value:Te,count:vt})=>[Te,vt]))},[J.kind]),be=(0,P.useMemo)(()=>[ee].flat().filter(Boolean),[ee]);var Ce;const[Ie,Ae]=(0,P.useState)(be.length?be:(Ce=(x=J.tags)===null||x===void 0?void 0:x.values)!==null&&Ce!==void 0?Ce:[]);return(0,P.useEffect)(()=>{be.length&&Ae(be)},[be]),(0,P.useEffect)(()=>{const He=Object.keys(le!=null?le:{});Z({tags:Ie.length&&He.length?new We(Ie):void 0})},[Ie,Z,le]),Object.keys(le!=null?le:{}).length?(0,l.jsx)(I.Z,{pb:1,pt:1,children:(0,l.jsxs)(K.Z,{variant:"button",component:"label",children:["Tags",(0,l.jsx)(q.ZP,{multiple:!0,options:Object.keys(le!=null?le:{}),value:Ie,onChange:(He,Xe)=>Ae(Xe),renderOption:(He,{selected:Xe})=>(0,l.jsx)(et.Z,{control:(0,l.jsx)(Ue.Z,{icon:Wt,checkedIcon:fn,checked:Xe}),label:v.showCounts?`${He} (${le==null?void 0:le[He]})`:He}),size:"small",popupIcon:(0,l.jsx)(Xt.Z,{"data-testid":"tag-picker-expand"}),renderInput:He=>(0,l.jsx)(Et.Z,{...He,className:L.input,variant:"outlined"})})]})}):null},zn=v=>{const{hidden:x,initialFilter:L}=v,Z=(0,n.h_)(n.$v),{error:J,availableTypes:ee,selectedTypes:ne,setSelectedTypes:le}=Bn();if((0,P.useEffect)(()=>{J&&Z.post({message:"Failed to load entity types",severity:"error"}),L&&le([L])},[J,Z,L,le]),ee.length===0||J)return null;const be=[{value:"all",label:"all"},...ee.map(Ie=>({value:Ie,label:Ie}))];var Ce;return x?null:(0,l.jsx)(I.Z,{pb:1,pt:1,children:(0,l.jsx)(R.Ph,{label:"Type",items:be,selected:(Ce=be.length>1?ne[0]:void 0)!==null&&Ce!==void 0?Ce:"all",onChange:Ie=>le(Ie==="all"?[]:[String(Ie)])})})};var Jn=t(15459),vn=t(61837),Wn=t(11640),lr=t(28347);const j=(0,Jn.Z)({root:{color:"#f3ba37"}})(Wn.Z),u=v=>{const{toggleStarredEntity:x,isStarredEntity:L}=re(v.entity);return(0,l.jsx)(vn.Z,{"aria-label":"favorite",color:"inherit",...v,onClick:()=>x(),children:(0,l.jsx)(dt.ZP,{title:L?"Remove from favorites":"Add to favorites",children:L?(0,l.jsx)(j,{}):(0,l.jsx)(lr.Z,{})})})};var b=t(8629),A=t(79249),Q=t(38724),ve=t(99152),xe=t(6487),Oe=t(49429),Ve=t(55999),Nt=t(72779),on=t.n(Nt),Vn=t(39412);const cr=Vn.Z;function jr(v,x){if(v)return v.toLocaleLowerCase("en-US");if(x)try{return(0,C.of)(x).kind.toLocaleLowerCase("en-US")}catch{return}}function lo(v,x){const L=(0,n.qD)(),Z=jr(v,x);return Z&&L.getSystemIcon(`kind:${Z}`)||cr}function $r(v){const{kind:x,entityRef:L,...Z}=v,J=lo(x,L);return(0,l.jsx)(J,{...Z})}const co=(0,Re.Z)(v=>({node:{fill:v.palette.grey[300],stroke:v.palette.grey[300],"&.primary":{fill:v.palette.primary.light,stroke:v.palette.primary.light},"&.secondary":{fill:v.palette.secondary.light,stroke:v.palette.secondary.light}},text:{fill:v.palette.getContrastText(v.palette.grey[300]),"&.primary":{fill:v.palette.primary.contrastText},"&.secondary":{fill:v.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function uo(v){const x=(0,n.h_)(W),L=(0,C.eE)(v),{loading:Z,error:J,value:ee}=(0,at.default)(async()=>{const ne=await x.getEntityAncestors({entityRef:L}),le=new Array,be=new Array;for(const Ce of ne.items){const Ie=(0,C.eE)(Ce.entity),Ae=Ie===ne.rootEntityRef;le.push({id:Ie,root:Ae,...Ce.entity});for(const He of Ce.parentEntityRefs)be.push({from:Ie,to:He})}return{nodes:le,edges:be}},[L]);return{loading:Z,error:J,nodes:(ee==null?void 0:ee.nodes)||[],edges:(ee==null?void 0:ee.edges)||[]}}function fr({node:v}){const x=co(),L=(0,hn.s0)(),Z=(0,n.tg)(Se),[J,ee]=(0,P.useState)(0),[ne,le]=(0,P.useState)(0),be=(0,P.useRef)(null);(0,P.useLayoutEffect)(()=>{if(be.current){let{height:vt,width:Ut}=be.current.getBBox();vt=Math.round(vt),Ut=Math.round(Ut),(vt!==ne||Ut!==J)&&(ee(Ut),le(vt))}},[J,ne]);const Ce=10,Ie=ne,Ae=Ie+Ce,He=Ae+J+Ce*2,Xe=ne+Ce*2,qe=v.metadata.title||(v.kind&&v.metadata.name&&v.metadata.namespace?Ye({kind:v.kind,name:v.metadata.name,namespace:v.metadata.namespace||""}):v.id),Te=()=>{L(Z({kind:v.kind,namespace:v.metadata.namespace||C.zG,name:v.metadata.name}))};return(0,l.jsxs)("g",{onClick:Te,className:x.clickable,children:[(0,l.jsx)("rect",{className:on()(x.node,v.root?"secondary":"primary"),width:He,height:Xe,rx:10}),(0,l.jsx)($r,{kind:v.kind,y:Ce,x:Ce,width:Ie,height:Ie,className:on()(x.text,v.root?"secondary":"primary")}),(0,l.jsx)("text",{ref:be,className:on()(x.text,v.root?"secondary":"primary"),y:Xe/2,x:Ae+(J+Ce*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:qe})]})}function Yr(v){const{loading:x,error:L,nodes:Z,edges:J}=uo(v.entity);return x?(0,l.jsx)(R.Ex,{}):L?(0,l.jsx)(R.Gk,{error:L}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Ve.Z,{variant:"h2",children:"Ancestry"}),(0,l.jsxs)(Ve.Z,{gutterBottom:!0,children:["This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where"," ",(0,l.jsx)(R.rU,{to:"https://backstage.io/docs/features/software-catalog/life-of-an-entity",children:"processors emitted"})," ","child entities that ultimately led to the current one existing. Note that this is a completely different mechanism from relations."]}),(0,l.jsx)(I.Z,{mt:4,children:(0,l.jsx)(R.mn,{nodes:Z,edges:J,renderNode:fr,direction:R.NX.Nm.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var Xn=t(11776),Qn=t(38402),Gn=t(86136),Er=t(99688),Jr=t(49378),ho=t(54506),Xr=t(94339),po=t(24579),Ko=t(27685);const Zr=(0,Re.Z)(v=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:v.spacing(2)},helpIcon:{marginLeft:v.spacing(1),color:v.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function qn(v){const x=Zr();return(0,l.jsx)(Jr.Z,{...v,primaryTypographyProps:{className:x.monospace},secondaryTypographyProps:{className:x.monospace}})}function Ar(v){const x=Zr();return(0,l.jsx)(ho.Z,{className:x.monospace,children:v.children})}function gr(v){return(0,l.jsx)(I.Z,{mt:2,children:(0,l.jsx)(Xr.Z,{variant:"outlined",children:(0,l.jsxs)(po.Z,{children:[(0,l.jsxs)(K.Z,{variant:"h6",gutterBottom:!0,children:[v.title,v.helpLink&&(0,l.jsx)(rr,{to:v.helpLink})]}),v.children]})})})}function Dr(v){if(v.match(/^url:https?:\/\//))return v.slice(4);if(v.match(/^https?:\/\//))return v}function Tr(v){const[x,L]=v.entry,Z=Dr(L);return(0,l.jsxs)(Qn.Z,{children:[v.indent&&(0,l.jsx)(Gn.Z,{}),(0,l.jsx)(qn,{primary:x,secondary:Z?(0,l.jsx)(R.rU,{to:Z,children:L}):L})]})}function rr(v){const x=Zr();return(0,l.jsx)(R.rU,{to:v.to,className:x.helpIcon,children:(0,l.jsx)(Ko.Z,{fontSize:"inherit"})})}const fo=(0,Re.Z)({root:{display:"flex",flexDirection:"column"}});function go(v){var x,L;const Z=(0,n.h_)(W),J=(0,C.eE)(v),ee=(x=v.metadata.annotations)===null||x===void 0?void 0:x[C.P1],ne=(L=v.metadata.annotations)===null||L===void 0?void 0:L[C.q1],{loading:le,error:be,value:Ce}=(0,at.default)(async()=>!ee&&!ne?[]:(await Z.getEntities({filter:[...ee?[{[`metadata.annotations.${C.P1}`]:ee}]:[],...ne?[{[`metadata.annotations.${C.q1}`]:ne}]:[]]})).items,[ee,ne]);return{loading:le,error:be,location:ee,originLocation:ne,colocatedEntities:Ce==null?void 0:Ce.filter(Ie=>(0,C.eE)(Ie)!==J)}}function Ir(v){return(0,l.jsxs)(Xn.Z,{dense:!0,children:[v.header&&(0,l.jsx)(Tr,{entry:v.header},"header"),v.entities.map(x=>(0,l.jsxs)(Qn.Z,{children:[(0,l.jsx)(Gn.Z,{children:(0,l.jsx)($r,{kind:x.kind})}),(0,l.jsx)(qn,{primary:(0,l.jsx)(ze,{entityRef:x})})]},(0,C.eE)(x)))]})}function Qr(v){const{entity:x}=v,{loading:L,error:Z,location:J,originLocation:ee,colocatedEntities:ne}=go(x);if(L)return(0,l.jsx)(R.Ex,{});if(Z)return(0,l.jsx)(R.Gk,{error:Z});if(!J&&!ee)return(0,l.jsx)(Er.Z,{severity:"warning",children:"Entity had no location information."});if(!(ne!=null&&ne.length))return(0,l.jsx)(Er.Z,{severity:"info",children:"There were no other entities on this location."});if(J===ee)return(0,l.jsx)(Ir,{entities:ne});const le=ne.filter(Ce=>{var Ie;return((Ie=Ce.metadata.annotations)===null||Ie===void 0?void 0:Ie[C.P1])===J}),be=ne.filter(Ce=>{var Ie;return((Ie=Ce.metadata.annotations)===null||Ie===void 0?void 0:Ie[C.q1])===ee});return(0,l.jsxs)(l.Fragment,{children:[le.length>0&&(0,l.jsx)(Ir,{entities:le,header:["At the same location",J]}),be.length>0&&(0,l.jsx)(Ir,{entities:be,header:["At the same origin",ee]})]})}function Yo(v){const x=fo();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Ve.Z,{variant:"h2",children:"Colocated"}),(0,l.jsx)(Ve.Z,{children:"These are the entities that are colocated with this entity - as in, they originated from the same data source (e.g. came from the same YAML file), or from the same origin (e.g. the originally registered URL)."}),(0,l.jsx)("div",{className:x.root,children:(0,l.jsx)(Qr,{entity:v.entity})})]})}function dr(v){return Object.fromEntries([...Object.entries(v)].sort((x,L)=>x[0]<L[0]?-1:1))}function mo(v){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Ve.Z,{variant:"h2",children:"Entity as JSON"}),(0,l.jsx)(Ve.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,l.jsx)(Ve.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)(R.Oi,{text:JSON.stringify(dr(v.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var vo=t(3440),yo=t.n(vo);const xo=(0,Re.Z)({root:{display:"flex",flexDirection:"column"}});function Nr(v){var x,L;const Z=xo(),{apiVersion:J,kind:ee,metadata:ne,spec:le,relations:be=[],status:Ce={}}=v.entity,Ie=yo()(On()(be,Ae=>Ae.targetRef),"type");return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Ve.Z,{variant:"h2",children:"Overview"}),(0,l.jsxs)("div",{className:Z.root,children:[(0,l.jsx)(gr,{title:"Identity",children:(0,l.jsxs)(Xn.Z,{dense:!0,children:[(0,l.jsx)(Qn.Z,{children:(0,l.jsx)(qn,{primary:"apiVersion",secondary:J})}),(0,l.jsx)(Qn.Z,{children:(0,l.jsx)(qn,{primary:"kind",secondary:ee})}),(le==null?void 0:le.type)&&(0,l.jsx)(Qn.Z,{children:(0,l.jsx)(qn,{primary:"spec.type",secondary:le.type})}),ne.uid&&(0,l.jsx)(Qn.Z,{children:(0,l.jsx)(qn,{primary:"uid",secondary:ne.uid})}),ne.etag&&(0,l.jsx)(Qn.Z,{children:(0,l.jsx)(qn,{primary:"etag",secondary:ne.etag})})]})}),(0,l.jsxs)(gr,{title:"Metadata",children:[!!Object.keys(ne.annotations||{}).length&&(0,l.jsx)(Xn.Z,{dense:!0,subheader:(0,l.jsxs)(Ar,{children:["Annotations",(0,l.jsx)(rr,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(ne.annotations).map(Ae=>(0,l.jsx)(Tr,{indent:!0,entry:Ae},Ae[0]))}),!!Object.keys(ne.labels||{}).length&&(0,l.jsx)(Xn.Z,{dense:!0,subheader:(0,l.jsx)(Ar,{children:"Labels"}),children:Object.entries(ne.labels).map(Ae=>(0,l.jsx)(Tr,{indent:!0,entry:Ae},Ae[0]))}),!!(!((x=ne.tags)===null||x===void 0)&&x.length)&&(0,l.jsx)(Xn.Z,{dense:!0,subheader:(0,l.jsx)(Ar,{children:"Tags"}),children:ne.tags.map((Ae,He)=>(0,l.jsxs)(Qn.Z,{children:[(0,l.jsx)(Gn.Z,{}),(0,l.jsx)(qn,{primary:Ae})]},`${Ae}-${He}`))})]}),!!be.length&&(0,l.jsx)(gr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Ie).map(([Ae,He],Xe)=>(0,l.jsx)("div",{children:(0,l.jsx)(Xn.Z,{dense:!0,subheader:(0,l.jsx)(Ar,{children:Ae}),children:He.map(qe=>(0,l.jsxs)(Qn.Z,{children:[(0,l.jsx)(Gn.Z,{children:(0,l.jsx)($r,{entityRef:qe.targetRef})}),(0,l.jsx)(qn,{primary:(0,l.jsx)(ze,{entityRef:qe.targetRef})})]},qe.targetRef))})},Xe))}),!!(!((L=Ce.items)===null||L===void 0)&&L.length)&&(0,l.jsx)(gr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Ce.items.map((Ae,He)=>(0,l.jsxs)("div",{children:[(0,l.jsxs)(K.Z,{children:[Ae.level,": ",Ae.type]}),(0,l.jsx)(I.Z,{ml:2,children:Ae.message})]},He))})]})]})}var bo=t(72847);function So(v){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Ve.Z,{variant:"h2",children:"Entity as YAML"}),(0,l.jsx)(Ve.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,l.jsx)(Ve.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)(R.Oi,{text:bo.ZP.stringify(dr(v.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const Fr=(0,Re.Z)(v=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:v.palette.background.paper},tabs:{borderRight:`1px solid ${v.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function mr(v){const{children:x,value:L,index:Z,...J}=v,ee=Fr();return(0,l.jsx)("div",{role:"tabpanel",hidden:L!==Z,id:`vertical-tabpanel-${Z}`,"aria-labelledby":`vertical-tab-${Z}`,className:ee.tabContents,...J,children:L===Z&&(0,l.jsx)(I.Z,{pl:3,pr:3,children:x})})}function ur(v){return{id:`vertical-tab-${v}`,"aria-controls":`vertical-tabpanel-${v}`}}function qr(v){const x=Fr(),[L,Z]=P.useState(0);return(0,P.useEffect)(()=>{Z(0)},[v.open]),v.entity?(0,l.jsxs)(b.Z,{fullWidth:!0,maxWidth:"xl",open:v.open,onClose:v.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:x.fullHeightDialog},children:[(0,l.jsx)(A.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,l.jsx)(Q.Z,{dividers:!0,children:(0,l.jsxs)("div",{className:x.root,children:[(0,l.jsxs)(ve.Z,{orientation:"vertical",variant:"scrollable",value:L,onChange:(J,ee)=>Z(ee),"aria-label":"Inspector options",className:x.tabs,children:[(0,l.jsx)(xe.Z,{label:"Overview",...ur(0)}),(0,l.jsx)(xe.Z,{label:"Ancestry",...ur(1)}),(0,l.jsx)(xe.Z,{label:"Colocated",...ur(2)}),(0,l.jsx)(xe.Z,{label:"Raw JSON",...ur(3)}),(0,l.jsx)(xe.Z,{label:"Raw YAML",...ur(4)})]}),(0,l.jsx)(mr,{value:L,index:0,children:(0,l.jsx)(Nr,{entity:v.entity})}),(0,l.jsx)(mr,{value:L,index:1,children:(0,l.jsx)(Yr,{entity:v.entity})}),(0,l.jsx)(mr,{value:L,index:2,children:(0,l.jsx)(Yo,{entity:v.entity})}),(0,l.jsx)(mr,{value:L,index:3,children:(0,l.jsx)(mo,{entity:v.entity})}),(0,l.jsx)(mr,{value:L,index:4,children:(0,l.jsx)(So,{entity:v.entity})})]})}),(0,l.jsx)(Oe.Z,{children:(0,l.jsx)(te.Z,{onClick:v.onClose,color:"primary",children:"Close"})})]}):null}var Co=t(85256);function Kt(v){var x;const L=(0,n.h_)(W),Z=(x=v.metadata.annotations)===null||x===void 0?void 0:x[C.q1],J=v.metadata.uid,ee=Z==="bootstrap:bootstrap",ne=(0,at.default)(async()=>{const qe=L.getLocationByRef(Z);let Te;if(!Z)Te=Promise.resolve([]);else{const vt=`metadata.annotations.${C.q1}`;Te=L.getEntities({filter:{[vt]:Z},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Ut=>Ut.items)}return Promise.all([qe,Te]).then(([vt,Ut])=>({location:vt,colocatedEntities:Ut}))},[L,v]),le=(0,P.useCallback)(async function(){const{location:Te}=ne.value;await L.removeLocationById(Te.id)},[L,ne]),be=(0,P.useCallback)(async function(){await L.removeEntityByUid(J)},[L,J]);if(ee)return{type:"bootstrap",location:Z,deleteEntity:be};const{loading:Ce,error:Ie,value:Ae}=ne;if(Ce)return{type:"loading"};if(Ie)return{type:"error",error:Ie};const{location:He,colocatedEntities:Xe}=Ae;return He?{type:"unregister",location:Z,colocatedEntities:Xe.map(C.iB),unregisterLocation:le,deleteEntity:be}:{type:"only-delete",deleteEntity:be}}var wn=t(23054);const wo=(0,Re.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),jo=({entity:v,onConfirm:x,onClose:L})=>{const Z=(0,n.h_)(n.$v),J=(0,n.h_)(n.Ds),ee=wo(),ne=Kt(v),[le,be]=(0,P.useState)(!1),[Ce,Ie]=(0,P.useState)(!1);var Ae;const He=(Ae=J.getOptionalString("app.title"))!==null&&Ae!==void 0?Ae:"Backstage",Xe=(0,P.useCallback)(async function(){if("unregisterLocation"in ne){Ie(!0);try{await ne.unregisterLocation(),x()}catch(Ut){(0,wn.BD)(Ut),Z.post({message:Ut.message})}finally{Ie(!1)}}},[Z,x,ne]),qe=(0,P.useCallback)(async function(){if("deleteEntity"in ne){Ie(!0);try{await ne.deleteEntity(),x()}catch(Ut){(0,wn.BD)(Ut),Z.post({message:Ut.message})}finally{Ie(!1)}}},[Z,x,ne]),Te=()=>(0,l.jsx)(Oe.Z,{className:ee.dialogActions,children:(0,l.jsx)(te.Z,{onClick:L,color:"primary",children:"Cancel"})});return ne.type==="loading"?(0,l.jsx)(R.Ex,{}):ne.type==="error"?(0,l.jsx)(R.Gk,{error:ne.error}):ne.type==="bootstrap"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(Er.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',ne.location,'"). If you believe this is in error, please contact the ',He," ","integrator."]}),(0,l.jsxs)(I.Z,{marginTop:2,children:[!le&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(te.Z,{variant:"text",size:"small",color:"primary",className:ee.advancedButton,onClick:()=>be(!0),children:"Advanced Options"}),(0,l.jsx)(Te,{})]}),le&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Ve.Z,{children:"You have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,l.jsx)(te.Z,{variant:"contained",color:"secondary",disabled:Ce,onClick:qe,children:"Delete Entity"}),(0,l.jsx)(Te,{})]})]})]}):ne.type==="only-delete"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Ve.Z,{children:"This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog."}),(0,l.jsx)(te.Z,{variant:"contained",color:"secondary",disabled:Ce,onClick:qe,children:"Delete Entity"}),(0,l.jsx)(Te,{})]}):ne.type==="unregister"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Ve.Z,{children:"This action will unregister the following entities:"}),(0,l.jsx)(Ve.Z,{component:"ul",children:ne.colocatedEntities.map(vt=>(0,l.jsx)("li",{children:(0,l.jsx)(ze,{entityRef:vt})},`${vt.kind}:${vt.namespace}/${vt.name}`))}),(0,l.jsx)(Ve.Z,{children:"Located at the following location:"}),(0,l.jsx)(Ve.Z,{component:"ul",children:(0,l.jsx)("li",{children:ne.location})}),(0,l.jsxs)(Ve.Z,{children:["To undo, just re-register the entity in ",He,"."]}),(0,l.jsxs)(I.Z,{marginTop:2,children:[(0,l.jsx)(te.Z,{variant:"contained",color:"secondary",disabled:Ce,onClick:Xe,children:"Unregister Location"}),!le&&(0,l.jsx)(I.Z,{component:"span",marginLeft:2,children:(0,l.jsx)(te.Z,{variant:"text",size:"small",color:"primary",className:ee.advancedButton,onClick:()=>be(!0),children:"Advanced Options"})})]}),le&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(I.Z,{paddingTop:4,paddingBottom:4,children:(0,l.jsx)(Co.Z,{})}),(0,l.jsx)(Ve.Z,{children:"You also have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,l.jsx)(te.Z,{variant:"contained",color:"secondary",disabled:Ce,onClick:qe,children:"Delete Entity"})]})]}):(0,l.jsx)(Er.Z,{severity:"error",children:"Internal error: Unknown state"})},Eo=v=>{const{open:x,onConfirm:L,onClose:Z,entity:J}=v;return(0,l.jsxs)(b.Z,{open:x,onClose:Z,children:[(0,l.jsx)(A.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,l.jsx)(Q.Z,{children:(0,l.jsx)(jo,{entity:J,onConfirm:L,onClose:Z})})]})};var Ao=t(12231),To=t(9520),Io=t(47603);const Ro=(0,Re.Z)(v=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:v.spacing(1,0,1,0)},title:{margin:v.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:v.palette.text.primary},menuItem:{minHeight:v.spacing(6)},groupWrapper:{margin:v.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function _r(v){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:Io.Z},{id:"starred",label:"Starred",icon:Wn.Z}]},{name:v!=null?v:"Company",items:[{id:"all",label:"All"}]}]}const Rr=v=>{const{initialFilter:x,availableFilters:L}=v,Z=Ro(),J=(0,n.h_)(n.Ds);var ee;const ne=(ee=J.getOptionalString("organization.name"))!==null&&ee!==void 0?ee:"Company",{filters:le,updateFilters:be,backendEntities:Ce,queryParameters:{kind:Ie,user:Ae},loading:He}=ln(),Xe=["starred","all"],qe=_r(ne).map(jn=>({...jn,items:jn.items.filter(({id:Ln})=>["group","user"].some(kr=>kr===Ie)?Xe.includes(Ln):!L||L.includes(Ln))})).filter(({items:jn})=>!!jn.length),{isStarredEntity:Te}=An(),{isOwnedEntity:vt,loading:Ut}=je(),Tn=He||Ut,In=(0,P.useMemo)(()=>new Fe("owned",vt,Te),[vt,Te]),or=(0,P.useMemo)(()=>new Fe("starred",vt,Te),[vt,Te]),cn=(0,P.useMemo)(()=>[Ae].flat()[0],[Ae]),[Rn,Kn]=(0,P.useState)(cn!=null?cn:x),Lr=(0,P.useMemo)(()=>Ce.filter($e((0,Yt.compact)(Object.values({...le,user:void 0})))),[le,Ce]),Pr=(0,P.useMemo)(()=>({all:Lr.length,starred:Lr.filter(jn=>or.filterEntity(jn)).length,owned:Lr.filter(jn=>In.filterEntity(jn)).length}),[Lr,or,In]);(0,P.useEffect)(()=>{cn&&Kn(cn)},[cn]),(0,P.useEffect)(()=>{!Tn&&!!Rn&&Rn!=="all"&&Pr[Rn]===0&&Kn("all")},[Tn,Pr,Rn,Kn]),(0,P.useEffect)(()=>{be({user:Rn?new Fe(Rn,vt,Te):void 0})},[Rn,vt,Te,be]);var Ur;return(0,l.jsx)(Xr.Z,{className:Z.root,children:qe.map(jn=>(0,l.jsxs)(P.Fragment,{children:[(0,l.jsx)(K.Z,{variant:"subtitle2",component:"span",className:Z.title,children:jn.name}),(0,l.jsx)(Xr.Z,{className:Z.groupWrapper,children:(0,l.jsx)(Xn.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":jn.name,children:jn.items.map(Ln=>{var kr;return(0,l.jsxs)(Ao.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>Kn(Ln.id),selected:Ln.id===((kr=le.user)===null||kr===void 0?void 0:kr.value),className:Z.menuItem,disabled:Pr[Ln.id]===0,"data-testid":`user-picker-${Ln.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Ln.icon&&(0,l.jsx)(Gn.Z,{className:Z.listIcon,children:(0,l.jsx)(Ln.icon,{fontSize:"small"})}),(0,l.jsx)(Jr.Z,{children:(0,l.jsxs)(K.Z,{variant:"body1",children:[Ln.label," "]})}),(0,l.jsx)(To.Z,{children:(Ur=Pr[Ln.id])!==null&&Ur!==void 0?Ur:"-"})]},Ln.id)})})})]},jn.name))})},Jo=(0,Re.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Lo=(0,l.jsx)(Jt.Z,{fontSize:"small"}),eo=(0,l.jsx)(Vt.Z,{fontSize:"small"}),Po=()=>{const v=Jo(),{updateFilters:x}=ln(),[L,Z]=(0,P.useState)([]);function J(le){x({orphan:le?new tt(le):void 0})}function ee(le){x({error:le?new Zt(le):void 0})}const ne=["Is Orphan","Has Error"];return(0,l.jsx)(I.Z,{pb:1,pt:1,children:(0,l.jsxs)(K.Z,{variant:"button",component:"label",children:["Processing Status",(0,l.jsx)(q.ZP,{multiple:!0,options:ne,value:L,onChange:(le,be)=>{Z(be),J(be.includes("Is Orphan")),ee(be.includes("Has Error"))},renderOption:(le,{selected:be})=>(0,l.jsx)(et.Z,{control:(0,l.jsx)(Ue.Z,{icon:Lo,checkedIcon:eo,checked:be}),label:le}),size:"small",popupIcon:(0,l.jsx)(Xt.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:le=>(0,l.jsx)(Et.Z,{...le,className:v.input,variant:"outlined"})})]})})},Ts=({children:v,value:x})=>{var L;const[Z,J]=useState((L=x==null?void 0:x.filters)!==null&&L!==void 0?L:{}),ee=useCallback(Xe=>{J(qe=>{const Te=typeof Xe=="function"?Xe(qe):Xe;return{...qe,...Te}})},[]),ne=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var le,be,Ce,Ie,Ae;const He=useMemo(()=>({entities:(le=x==null?void 0:x.entities)!==null&&le!==void 0?le:ne.entities,backendEntities:(be=x==null?void 0:x.backendEntities)!==null&&be!==void 0?be:ne.backendEntities,updateFilters:(Ce=x==null?void 0:x.updateFilters)!==null&&Ce!==void 0?Ce:ee,filters:Z,loading:(Ie=x==null?void 0:x.loading)!==null&&Ie!==void 0?Ie:!1,queryParameters:(Ae=x==null?void 0:x.queryParameters)!==null&&Ae!==void 0?Ae:ne.queryParameters,error:x==null?void 0:x.error}),[x,ne,Z,ee]);return _jsx(EntityListContext.Provider,{value:He,children:v})}},33414:function(At,Be,t){"use strict";t.r(Be),t.d(Be,{AboutCard:function(){return at},AboutContent:function(){return dt},AboutField:function(){return X}});var h=t(52322),n=t(25271),W=t(23196),O=t(25248),m=t(32838),S=t(56941),l=t(79692),P=t(94339),oe=t(32552),_=t(61837),te=t(85256),B=t(24579),I=t(52866),K=t(30254),ce=t(27604),se=t(2784),$=t(19625),T=t(60905),z=t(7089),R=t(90436);const C=(0,l.Z)(ot=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:ot.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function X(ot){const{label:Ke,value:Qe,gridSizes:$e,children:ht}=ot,gt=C(),Ct=(0,O.vJ)(ht,Lt=>Lt.getElements()),$t=Ct.length>0?Ct:(0,h.jsx)(R.Z,{variant:"body2",className:gt.value,children:Qe||"unknown"});return(0,h.jsxs)(T.Z,{item:!0,...$e,children:[(0,h.jsx)(R.Z,{variant:"h2",className:gt.label,children:Ke}),$t]})}var Se=t(24851);const Ge=(0,l.Z)({description:{wordBreak:"break-word"}});function Ye(ot,Ke,Qe){if(Ke==="url"||ot.includes("://"))return ot;const $e=Qe.type==="file"?`file://${Qe.target}`:Qe.target;return Ke==="file"||Qe.type==="file"?new URL(ot,$e).href:$e}function dt(ot){var Ke,Qe,$e,ht,gt,Ct,$t,Lt;const{entity:We}=ot,me=Ge(),Le=We.kind.toLocaleLowerCase("en-US")==="system",Pe=We.kind.toLocaleLowerCase("en-US")==="resource",Fe=We.kind.toLocaleLowerCase("en-US")==="component",tt=We.kind.toLocaleLowerCase("en-US")==="api",Zt=We.kind.toLocaleLowerCase("en-US")==="template",xt=We.kind.toLocaleLowerCase("en-US")==="location",wt=We.kind.toLocaleLowerCase("en-US")==="group",bt=(0,S.hF)(We,n.cz,{kind:"system"}),Pt=(0,S.hF)(We,n.cz,{kind:"component"}),Gt=(0,S.hF)(We,n.cz,{kind:"domain"}),Yt=(0,S.hF)(We,n.S4);let an;try{an=(0,n.CV)(We)}catch{an=void 0}return(0,h.jsxs)(T.Z,{container:!0,children:[(0,h.jsx)(X,{label:"Description",gridSizes:{xs:12},children:(0,h.jsx)(W.SA,{className:me.description,content:(We==null||(Ke=We.metadata)===null||Ke===void 0?void 0:Ke.description)||"No description"})}),(0,h.jsx)(X,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:Yt.length>0&&(0,h.jsx)(S.rI,{entityRefs:Yt,defaultKind:"group"})}),(Le||Gt.length>0)&&(0,h.jsx)(X,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:Gt.length>0&&(0,h.jsx)(S.rI,{entityRefs:Gt,defaultKind:"domain"})}),(tt||Fe||Pe||bt.length>0)&&(0,h.jsx)(X,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:bt.length>0&&(0,h.jsx)(S.rI,{entityRefs:bt,defaultKind:"system"})}),Fe&&Pt.length>0&&(0,h.jsx)(X,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,h.jsx)(S.rI,{entityRefs:Pt,defaultKind:"component"})}),(tt||Fe||Pe||Zt||wt||xt||typeof(We==null||(Qe=We.spec)===null||Qe===void 0?void 0:Qe.type)=="string")&&(0,h.jsx)(X,{label:"Type",value:We==null||($e=We.spec)===null||$e===void 0?void 0:$e.type,gridSizes:{xs:12,sm:6,lg:4}}),(tt||Fe||typeof(We==null||(ht=We.spec)===null||ht===void 0?void 0:ht.lifecycle)=="string")&&(0,h.jsx)(X,{label:"Lifecycle",value:We==null||(gt=We.spec)===null||gt===void 0?void 0:gt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,h.jsx)(X,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((We==null||(Ct=We.metadata)===null||Ct===void 0?void 0:Ct.tags)||[]).map(Mt=>(0,h.jsx)(z.Z,{size:"small",label:Mt},Mt))}),xt&&((We==null||($t=We.spec)===null||$t===void 0?void 0:$t.targets)||(We==null||(Lt=We.spec)===null||Lt===void 0?void 0:Lt.target))&&(0,h.jsx)(X,{label:"Targets",gridSizes:{xs:12},children:(0,h.jsx)(Se.s,{cols:1,items:(We.spec.targets||[We.spec.target]).map(Mt=>Mt).map(Mt=>{var hn;return{text:Mt,href:Ye(Mt,(We==null||(hn=We.spec)===null||hn===void 0?void 0:hn.type)||"unknown",an)}})})})]})}const ze=(0,l.Z)({gridItemCard:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"},fullHeightCard:{display:"flex",flexDirection:"column",height:"100%"},gridItemCardContent:{flex:1},fullHeightCardContent:{flex:1}});function at(ot){var Ke,Qe,$e;const{variant:ht}=ot,gt=ze(),{entity:Ct}=(0,S.X2)(),$t=(0,O.h_)(m.q3),Lt=(0,O.h_)(S.Ah),We=(0,O.h_)(O.$v),me=(0,O.h_)(O.VE),Le=(0,O.tg)($.jU),Pe=(0,S.CV)(Ct,$t),Fe=(Ke=Ct.metadata.annotations)===null||Ke===void 0?void 0:Ke[n.Tf],tt={label:"View Source",disabled:!Pe,icon:(0,h.jsx)(m.nW,{type:Pe==null?void 0:Pe.integrationType}),href:Pe==null?void 0:Pe.locationTargetUrl},Zt={label:"View TechDocs",disabled:!(!((Qe=Ct.metadata.annotations)===null||Qe===void 0)&&Qe["backstage.io/techdocs-ref"])||!Le,icon:(0,h.jsx)(K.Z,{}),href:Le&&Le({namespace:Ct.metadata.namespace||n.zG,kind:Ct.kind,name:Ct.metadata.name})};let xt="";ht==="gridItem"?xt=gt.gridItemCard:ht==="fullHeight"&&(xt=gt.fullHeightCard);let wt="";ht==="gridItem"?wt=gt.gridItemCardContent:ht==="fullHeight"&&(wt=gt.fullHeightCardContent);const bt=($e=Ct.metadata.annotations)===null||$e===void 0?void 0:$e[n.P1],Pt=(bt==null?void 0:bt.startsWith("url:"))||(bt==null?void 0:bt.startsWith("file:")),Gt=(0,se.useCallback)(async()=>{try{await Lt.refreshEntity((0,n.eE)(Ct)),We.post({message:"Refresh scheduled",severity:"info"})}catch(Yt){me.post(Yt)}},[Lt,We,me,Ct]);return(0,h.jsxs)(P.Z,{className:xt,children:[(0,h.jsx)(oe.Z,{title:"About",action:(0,h.jsxs)(h.Fragment,{children:[Pt&&(0,h.jsx)(_.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:Gt,children:(0,h.jsx)(I.Z,{})}),(0,h.jsx)(_.Z,{component:W.rU,"aria-label":"Edit",disabled:!Fe,title:"Edit Metadata",to:Fe!=null?Fe:"#",children:(0,h.jsx)(ce.Z,{})})]}),subheader:(0,h.jsx)(W.M6,{links:[tt,Zt]})}),(0,h.jsx)(te.Z,{}),(0,h.jsx)(B.Z,{className:wt,children:(0,h.jsx)(dt,{entity:Ct})})]})}},86359:function(At,Be,t){"use strict";t.d(Be,{E:function(){return $}});var h=t(52322),n=t(25271),W=t(23196),O=t(56941),m=t(90436),S=t(15459),l=t(27604),P=t(2997),oe=t(11640),_=t(28347),te=t(76635),B=t(2784),I=t(7089);const K=Object.freeze({createNameColumn(T){function z(R){var C;return((C=R.metadata)===null||C===void 0?void 0:C.title)||(0,O.$3)(R,{defaultKind:T==null?void 0:T.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:R},{entity:C}){return z(R).localeCompare(z(C))},render:({entity:R})=>{var C;return(0,h.jsx)(O.dx,{entityRef:R,defaultKind:(T==null?void 0:T.defaultKind)||"Component",title:(C=R.metadata)===null||C===void 0?void 0:C.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:T})=>(0,h.jsx)(O.rI,{entityRefs:T.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:T})=>(0,h.jsx)(O.rI,{entityRefs:T.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:T})=>{var z,R;return(0,h.jsx)(h.Fragment,{children:((T==null||(z=T.spec)===null||z===void 0?void 0:z.targets)||(T==null||(R=T.spec)===null||R===void 0?void 0:R.target))&&(0,h.jsx)(W.Or,{text:(T.spec.targets||[T.spec.target]).join(", "),placement:"bottom-start"})})}}},createSpecTypeColumn(){return{title:"Type",field:"entity.spec.type",hidden:!0,width:"auto"}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"entity.spec.lifecycle"}},createMetadataDescriptionColumn(){return{title:"Description",field:"entity.metadata.description",render:({entity:T})=>(0,h.jsx)(W.Or,{text:T.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:T})=>(0,h.jsx)(h.Fragment,{children:T.metadata.tags&&T.metadata.tags.map(z=>(0,h.jsx)(I.Z,{label:z,size:"small",variant:"outlined",style:{marginBottom:"0px"}},z))}),width:"auto"}},createTitleColumn(T){return{title:"Title",field:"entity.metadata.title",hidden:T==null?void 0:T.hidden,searchable:!0}},createLabelColumn(T,z){return{title:(z==null?void 0:z.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:R})=>{var C;const X=(C=R.metadata)===null||C===void 0?void 0:C.labels,Se=X&&X[T]||(z==null?void 0:z.defaultValue);return(0,h.jsx)(h.Fragment,{children:Se&&(0,h.jsx)(I.Z,{label:Se,size:"small",variant:"outlined"},Se)})},width:"auto"}}}),ce=(0,S.Z)({root:{color:"#f3ba37"}})(oe.Z),se=(T,z)=>{const R=C=>C.metadata.title||(0,O.$3)(C,{defaultKind:"Component"});return R(T).localeCompare(R(z))},$=T=>{var z,R;const{columns:C,actions:X,tableOptions:Se,subtitle:Ge,emptyContent:Ye}=T,{isStarredEntity:dt,toggleStarredEntity:ze}=(0,O.CR)(),{loading:at,error:ot,entities:Ke,filters:Qe}=(0,O.wp)(),$e=(0,B.useMemo)(()=>{var Le;return[K.createTitleColumn({hidden:!0}),K.createNameColumn({defaultKind:(Le=Qe.kind)===null||Le===void 0?void 0:Le.value}),...Pe(),K.createMetadataDescriptionColumn(),K.createTagsColumn()];function Pe(){var Fe;switch((Fe=Qe.kind)===null||Fe===void 0?void 0:Fe.value){case"user":return[];case"domain":case"system":return[K.createOwnerColumn()];case"group":case"template":return[K.createSpecTypeColumn()];case"location":return[K.createSpecTypeColumn(),K.createSpecTargetsColumn()];default:return[K.createSystemColumn(),K.createOwnerColumn(),K.createSpecTypeColumn(),K.createSpecLifecycleColumn()]}}},[(z=Qe.kind)===null||z===void 0?void 0:z.value]),ht=Qe.type===void 0;var gt;const Ct=(0,te.capitalize)((gt=(R=Qe.user)===null||R===void 0?void 0:R.value)!==null&>!==void 0?gt:"all");if(ot)return(0,h.jsx)("div",{children:(0,h.jsx)(W.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,h.jsx)(W.Oi,{language:"text",text:ot.toString()})})});const $t=[({entity:Le})=>{var Pe;const Fe=(Pe=Le.metadata.annotations)===null||Pe===void 0?void 0:Pe[n.l2],tt="View";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(m.Z,{variant:"srOnly",children:tt}),(0,h.jsx)(P.Z,{fontSize:"small"})]}),tooltip:tt,disabled:!Fe,onClick:()=>{!Fe||window.open(Fe,"_blank")}}},({entity:Le})=>{var Pe;const Fe=(Pe=Le.metadata.annotations)===null||Pe===void 0?void 0:Pe[n.Tf],tt="Edit";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(m.Z,{variant:"srOnly",children:tt}),(0,h.jsx)(l.Z,{fontSize:"small"})]}),tooltip:tt,disabled:!Fe,onClick:()=>{!Fe||window.open(Fe,"_blank")}}},({entity:Le})=>{const Pe=dt(Le),Fe=Pe?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(m.Z,{variant:"srOnly",children:Fe}),Pe?(0,h.jsx)(ce,{}):(0,h.jsx)(_.Z,{})]}),tooltip:Fe,onClick:()=>ze(Le)}}],Lt=Ke.sort(se).map(Le=>{const Pe=(0,O.hF)(Le,n.cz,{kind:"system"}),Fe=(0,O.hF)(Le,n.S4);return{entity:Le,resolved:{name:(0,O.$3)(Le,{defaultKind:"Component"}),ownedByRelationsTitle:Fe.map(tt=>(0,O.$3)(tt,{defaultKind:"group"})).join(", "),ownedByRelations:Fe,partOfSystemRelationTitle:Pe.map(tt=>(0,O.$3)(tt,{defaultKind:"system"})).join(", "),partOfSystemRelations:Pe}}}),We=(C||$e).find(Le=>Le.title==="Type");We&&(We.hidden=!ht);const me=Lt.length>20;return(0,h.jsx)(W.iA,{isLoading:at,columns:C||$e,options:{paging:me,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!at,padding:"dense",pageSizeOptions:[20,50,100],...Se},title:`${Ct} (${Ke.length})`,data:Lt,actions:X||$t,subtitle:Ge,emptyContent:Ye})};$.columns=K},85877:function(At,Be,t){"use strict";t.r(Be),t.d(Be,{EntityLabelsCard:function(){return B},hasLabels:function(){return I}});var h=t(52322),n=t(56941),W=t(2784),O=t(23196),m=t(79692),S=t(90436),l=t(77277);const P=`metadata:
|
|
34
|
+
name: example
|
|
35
|
+
labels:
|
|
36
|
+
javaVersion: 1.2.3`,oe=(0,m.Z)(K=>({code:{borderRadius:6,margin:`${K.spacing(2)}px 0px`,background:K.palette.type==="dark"?"#444":"#fff"}}),{name:"PluginCatalogEntityLabelsEmptyState"});function _(){const K=oe();return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(S.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,h.jsx)("div",{className:K.code,children:(0,h.jsx)(O.Oi,{text:P,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,h.jsx)(l.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:"Read more"})]})}const te=(0,m.Z)(K=>({key:{fontWeight:"bold"}})),B=K=>{var ce;const{variant:se,title:$}=K,{entity:T}=(0,n.X2)(),z=te(),R=[{render:X=>(0,h.jsx)(S.Z,{className:z.key,variant:"body2",children:X.key})},{field:"value"}],C=T==null||(ce=T.metadata)===null||ce===void 0?void 0:ce.labels;return(0,h.jsx)(O.rJ,{title:$||"Labels",variant:se,children:!C||Object.keys(C).length===0?(0,h.jsx)(_,{}):(0,h.jsx)(O.iA,{columns:R,data:Object.keys(C).map(X=>({key:X,value:C[X]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(C).length>5}})})};function I(K){var ce,se;return!(K==null||(ce=K.metadata)===null||ce===void 0)&&ce.labels?Object.keys(K==null||(se=K.metadata)===null||se===void 0?void 0:se.labels).some(Boolean):!1}},24851:function(At,Be,t){"use strict";t.d(Be,{s:function(){return ce}});var h=t(52322),n=t(90348),W=t(11861),O=t(2784),m=t(79692),S=t(95544),l=t(90436),P=t(52160),oe=t(23196);const _=(0,m.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function te(se){const{href:$,text:T,Icon:z}=se,R=_();return(0,h.jsxs)(S.Z,{display:"flex",children:[(0,h.jsx)(S.Z,{mr:1,className:R.svgIcon,children:(0,h.jsx)(l.Z,{component:"div",children:z?(0,h.jsx)(z,{}):(0,h.jsx)(P.Z,{})})}),(0,h.jsx)(S.Z,{flexGrow:"1",children:(0,h.jsx)(oe.rU,{to:$,target:"_blank",rel:"noopener",children:T||$})})]})}var B=t(41156);const I={xs:1,sm:1,md:1,lg:2,xl:3};function K(se){const $=[(0,B.Z)(C=>C.breakpoints.up("xl"))?"xl":null,(0,B.Z)(C=>C.breakpoints.up("lg"))?"lg":null,(0,B.Z)(C=>C.breakpoints.up("md"))?"md":null,(0,B.Z)(C=>C.breakpoints.up("sm"))?"sm":null,(0,B.Z)(C=>C.breakpoints.up("xs"))?"xs":null];let T=1;if(typeof se=="number")T=se;else{var z;const C=(z=$.find(X=>X!==null))!==null&&z!==void 0?z:"xs";var R;T=(R=se==null?void 0:se[C])!==null&&R!==void 0?R:I[C]}return T}function ce(se){const{items:$,cols:T=void 0}=se,z=K(T);return(0,h.jsx)(n.Z,{rowHeight:"auto",cols:z,children:$.map(({text:R,href:C,Icon:X},Se)=>(0,h.jsx)(W.Z,{children:(0,h.jsx)(te,{href:C,text:R!=null?R:C,Icon:X})},Se))})}},19625:function(At,Be,t){"use strict";t.d(Be,{_Z:function(){return O},jU:function(){return W},yw:function(){return n}});var h=t(25248);const n=(0,h.x8)({id:"create-component",optional:!0}),W=(0,h.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),O=(0,h.NT)({id:"catalog"})},51666:function(At,Be,t){"use strict";t.d(Be,{rG:function(){return h},Y2:function(){return z},J$:function(){return oe},g2:function(){return W}});var h;(function(R){R.DENY="DENY",R.ALLOW="ALLOW",R.CONDITIONAL="CONDITIONAL"})(h||(h={}));function n(R,C){return R.name===C.name}function W(R,C){return"resourceType"in R?!C||R.resourceType===C:!1}function O(R){return R.attributes.action==="create"}function m(R){return R.attributes.action==="read"}function S(R){return R.attributes.action==="update"}function l(R){return R.attributes.action==="delete"}function P(R){return{authorize:async(C,X)=>await R.authorize(C,X),authorizeConditional(C,X){const Se=C;return R.authorize(Se,X)}}}function oe({name:R,attributes:C,resourceType:X}){return X?{type:"resource",name:R,attributes:C,resourceType:X}:{type:"basic",name:R,attributes:C}}var _=t(23054),te=t(96279),B=t.n(te),I=t(9571),K=t(30195);const ce=K.z.lazy(()=>K.z.object({rule:K.z.string(),resourceType:K.z.string(),params:K.z.record(K.z.any()).optional()}).or(K.z.object({anyOf:K.z.array(ce).nonempty()})).or(K.z.object({allOf:K.z.array(ce).nonempty()})).or(K.z.object({not:ce}))),se=K.z.object({result:K.z.literal(h.ALLOW).or(K.z.literal(h.DENY))}),$=K.z.union([K.z.object({result:K.z.literal(h.ALLOW).or(K.z.literal(h.DENY))}),K.z.object({result:K.z.literal(h.CONDITIONAL),pluginId:K.z.string(),resourceType:K.z.string(),conditions:ce})]),T=(R,C)=>K.z.object({items:K.z.array(K.z.intersection(K.z.object({id:K.z.string()}),R)).refine(X=>X.length===C.size&&X.every(({id:Se})=>C.has(Se)),{message:"Items in response do not match request"})});class z{async authorize(C,X){return this.makeRequest(C,se,X)}async authorizeConditional(C,X){return this.makeRequest(C,$,X)}async makeRequest(C,X,Se){if(!this.enabled)return C.map(Ke=>({result:h.ALLOW}));const Ge={items:C.map(Ke=>({id:I.Z(),...Ke}))},Ye=await this.discovery.getBaseUrl("permission"),dt=await B()(`${Ye}/authorize`,{method:"POST",body:JSON.stringify(Ge),headers:{...this.getAuthorizationHeader(Se==null?void 0:Se.token),"content-type":"application/json"}});if(!dt.ok)throw await _.VL.fromResponse(dt);const ze=await dt.json(),ot=T(X,new Set(Ge.items.map(({id:Ke})=>Ke))).parse(ze).items.reduce((Ke,Qe)=>(Ke[Qe.id]=Qe,Ke),{});return Ge.items.map(Ke=>ot[Ke.id])}getAuthorizationHeader(C){return C?{Authorization:`Bearer ${C}`}:{}}constructor(C){this.discovery=C.discovery;var X;this.enabled=(X=C.config.getOptionalBoolean("permission.enabled"))!==null&&X!==void 0?X:!1}}},25488:function(At,Be,t){"use strict";t.d(Be,{iM:function(){return S},RV:function(){return O},gI:function(){return P}});var h=t(52322),n=t(2784),W=t(25248);const O=(0,W.T0)({id:"plugin.permission.api"});var m=t(51666);class S{static create(B){const{config:I,discovery:K,identity:ce}=B,se=new m.Y2({discovery:K,config:I});return new S(se,ce)}async authorize(B){return(await this.permissionClient.authorize([B],await this.identityApi.getCredentials()))[0]}constructor(B,I){this.permissionClient=B,this.identityApi=I}}var l=t(69984);function P(te){const B=(0,W.h_)(O),{data:I,error:K}=(0,l.ZP)(te,async ce=>{if((0,m.g2)(ce.permission)&&!ce.resourceRef)return m.rG.DENY;const{result:se}=await B.authorize(ce);return se});return K?{error:K,loading:!1,allowed:!1}:I===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:I===m.rG.ALLOW}}const oe=te=>{const{permission:B,resourceRef:I,errorComponent:K,...ce}=te,se=usePermission(isResourcePermission(B)?{permission:B,resourceRef:I}:{permission:B}),$=useApp(),{NotFoundErrorPage:T}=$.getComponents();let z=K===void 0?_jsx(T,{}):K;return se.loading?z=null:se.allowed&&(z=te.element),_jsx(Route,{...ce,element:z})};function _(te){const{permission:B,resourceRef:I}=te,K=usePermission(isResourcePermission(B)?{permission:B,resourceRef:I}:{permission:B}),ce=useApp();if(K.loading)return null;if(K.allowed)return _jsx(_Fragment,{children:te.children});if(te.errorPage)return _jsx(_Fragment,{children:te.errorPage});const{NotFoundErrorPage:se}=ce.getComponents();return _jsx(se,{})}},15096:function(At,Be,t){"use strict";t.d(Be,{FA:function(){return oe},qO:function(){return gt},Nd:function(){return dt},E5:function(){return Vt},Rx:function(){return C}});var h=t(25248);const n=(0,h.T0)({id:"plugin.search.queryservice"});class W{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(H){this.mockedResults=H}}var O=t(52322),m=t(2784),S=t(38402),l=t(79692);const P=(0,l.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),oe=({text:q,preTag:H,postTag:g})=>{const w=P(),D=(0,m.useMemo)(()=>q.split(new RegExp(`(${H}.+?${g})`)),[g,H,q]);return(0,O.jsx)(O.Fragment,{children:D.map((G,de)=>G.includes(H)?(0,O.jsx)("mark",{className:w.highlight,children:G.replace(new RegExp(`${H}|${g}`,"g"),"")},de):G)})};var _=t(48760),te=t(50581),B=t(61837),I=t(74603),K=t(21853),ce=t(33375),se=t(76635),$=t(64279),T=t(1849),z=t(51837);const R=(0,z.CT)("search-context"),C=()=>{const q=(0,m.useContext)(R);if(!q)throw new Error("useSearch must be used within a SearchContextProvider");const H=q.atVersion(1);if(!H)throw new Error("No SearchContext v1 found");return H},X=()=>(0,m.useContext)(R)!==void 0,Se={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},Ge=(q=Se)=>{var H,g,w,D;const G=(0,h.h_)(n),[de,pe]=(0,m.useState)(q.term),[Ee,lt]=(0,m.useState)(q.types),[ct,St]=(0,m.useState)(q.filters),[Tt,st]=(0,m.useState)(q.pageLimit),[De,ft]=(0,m.useState)(q.pageCursor),It=(0,T.Z)(de),zt=(0,T.Z)(ct),mt=(0,$.default)(()=>G.query({term:de,types:Ee,filters:ct,pageLimit:Tt,pageCursor:De}),[de,Ee,ct,Tt,De]),Dt=!mt.loading&&!mt.error&&((H=mt.value)===null||H===void 0?void 0:H.nextPageCursor),Ht=!mt.loading&&!mt.error&&((g=mt.value)===null||g===void 0?void 0:g.previousPageCursor),Rt=(0,m.useCallback)(()=>{var Wt;ft((Wt=mt.value)===null||Wt===void 0?void 0:Wt.nextPageCursor)},[(w=mt.value)===null||w===void 0?void 0:w.nextPageCursor]),nt=(0,m.useCallback)(()=>{var Wt;ft((Wt=mt.value)===null||Wt===void 0?void 0:Wt.previousPageCursor)},[(D=mt.value)===null||D===void 0?void 0:D.previousPageCursor]);return(0,m.useEffect)(()=>{It!==void 0&&de!==It&&ft(void 0)},[de,It,ft]),(0,m.useEffect)(()=>{zt!==void 0&&!(0,se.isEqual)(ct,zt)&&ft(void 0)},[ct,zt,ft]),{result:mt,term:de,setTerm:pe,types:Ee,setTypes:lt,filters:ct,setFilters:St,pageLimit:Tt,setPageLimit:st,pageCursor:De,setPageCursor:ft,fetchNextPage:Dt?Rt:void 0,fetchPreviousPage:Ht?nt:void 0}},Ye=q=>{const{initialState:H,children:g}=q,w=Ge(H);return(0,O.jsx)(h.fC,{attributes:{searchTypes:w.types.sort().join(",")},children:(0,O.jsx)(R.Provider,{value:(0,z.EI)({1:w}),children:g})})},dt=q=>{const{initialState:H,inheritParentContextIfAvailable:g,children:w}=q;return X()&&g?(0,O.jsx)(O.Fragment,{children:w}):(0,O.jsx)(Ye,{initialState:H,children:w})},ze=({children:q})=>{var H;const g=ct=>(0,T.Z)(ct)!==ct,w=(0,h.z$)(),{term:D,result:G}=C();var de;const pe=(de=(H=G.value)===null||H===void 0?void 0:H.numberOfResults)!==null&&de!==void 0?de:void 0,lt=g(G.loading)&&!G.loading;return(0,m.useEffect)(()=>{D&<&&w.captureEvent("search",D,{value:pe})},[w,D,pe,lt]),(0,O.jsx)(O.Fragment,{children:q})};function at(q){return(0,m.forwardRef)((H,g)=>(0,O.jsx)(dt,{inheritParentContextIfAvailable:!0,children:(0,O.jsx)(q,{...H,ref:g})}))}const ot=at((0,m.forwardRef)((q,H)=>{const{onChange:g,onKeyDown:w=()=>{},onClear:D=()=>{},onSubmit:G=()=>{},debounceTime:de=200,clearButton:pe=!0,fullWidth:Ee=!0,value:lt,placeholder:ct,inputProps:St={},endAdornment:Tt,...st}=q,De=(0,h.h_)(h.Ds),[ft,It]=(0,m.useState)("");(0,m.useEffect)(()=>{It(rt=>rt!==lt?String(lt):rt)},[lt]),(0,_.Z)(()=>g(ft),de,[ft]);const zt=(0,m.useCallback)(rt=>{It(rt.target.value)},[It]),mt=(0,m.useCallback)(rt=>{w&&w(rt),G&&rt.key==="Enter"&&G()},[w,G]),Dt=(0,m.useCallback)(()=>{g(""),D&&D()},[g,D]),Ht=ct!=null?ct:`Search in ${De.getOptionalString("app.title")||"Backstage"}`,Rt=(0,O.jsx)(te.Z,{position:"start",children:(0,O.jsx)(B.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,O.jsx)(K.Z,{})})}),nt=(0,O.jsx)(te.Z,{position:"end",children:(0,O.jsx)(B.Z,{"aria-label":"Clear",size:"small",onClick:Dt,children:(0,O.jsx)(ce.Z,{})})});return(0,O.jsx)(ze,{children:(0,O.jsx)(I.Z,{"data-testid":"search-bar-next",ref:H,value:ft,placeholder:Ht,startAdornment:Rt,endAdornment:pe?nt:Tt,inputProps:{"aria-label":"Search",...St},fullWidth:Ee,onChange:zt,onKeyDown:mt,...st})})})),Ke=at((0,m.forwardRef)((q,H)=>{const{value:g="",onChange:w,...D}=q,{term:G,setTerm:de}=C();(0,m.useEffect)(()=>{g&&de(String(g))},[g,de]);const pe=(0,m.useCallback)(Ee=>{w?w(Ee):de(Ee)},[w,de]);return(0,O.jsx)(h.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,O.jsx)(ot,{...D,ref:H,value:G,onChange:pe})})}));var Qe=t(4614),$e=t(88013);const gt=(q=>H=>(0,O.jsx)(dt,{inheritParentContextIfAvailable:!0,children:(0,O.jsx)(q,{...H})}))(function(H){const{loading:g,value:w,onChange:D=()=>{},options:G=[],getOptionLabel:de=Dt=>String(Dt),inputPlaceholder:pe,inputDebounceTime:Ee,freeSolo:lt=!0,fullWidth:ct=!0,clearOnBlur:St=!1,"data-testid":Tt="search-autocomplete",...st}=H,{setTerm:De}=C(),ft=(0,m.useCallback)(Dt=>Dt?typeof Dt=="string"?Dt:de(Dt):"",[de]),It=(0,m.useMemo)(()=>ft(w),[w,ft]),zt=(0,m.useCallback)((Dt,Ht,Rt,nt)=>{De(ft(Ht)),D(Dt,Ht,Rt,nt)},[ft,De,D]),mt=(0,m.useCallback)(({InputProps:{ref:Dt,endAdornment:Ht},InputLabelProps:Rt,...nt})=>(0,O.jsx)(Ke,{...nt,ref:Dt,clearButton:!1,value:It,placeholder:pe,debounceTime:Ee,endAdornment:g?(0,O.jsx)(Qe.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):Ht}),[g,It,pe,Ee]);return(0,O.jsx)($e.ZP,{...st,"data-testid":Tt,value:w,onChange:zt,options:G,getOptionLabel:de,renderInput:mt,freeSolo:lt,fullWidth:ct,clearOnBlur:St})}),Ct=({icon:q,primaryText:H,primaryTextTypographyProps:g,secondaryText:w,secondaryTextTypographyProps:D,disableTextTypography:G})=>_jsxs(_Fragment,{children:[q?_jsx(ListItemIcon,{children:q}):null,_jsx(ListItemText,{primary:H,primaryTypographyProps:g,secondary:w,secondaryTypographyProps:D,disableTypography:G})]});var $t=t(42494),Lt=t(84899),We=t(5806),me=t(21324),Le=t(56939),Pe=t(73698),Fe=t(12231),tt=t(86619),Zt=t(7089),xt=t(69294);const wt=(q,H,g=[],w=250)=>{const D=(0,m.useRef)({}),G=q||(()=>Promise.resolve([])),[de,pe]=(0,xt.default)(G,[H],{loading:!0});if((0,_.Z)(()=>{D.current[H]===void 0&&(D.current[H]=pe(H).then(lt=>(D.current[H]=lt,lt)))},w,[pe,H]),g.length)return{loading:!1,value:g};const Ee=D.current[H];return Array.isArray(Ee)?{loading:!1,value:Ee}:de},bt=(q,H)=>{const{setFilters:g}=C();(0,m.useEffect)(()=>{H&&[H].flat().length>0&&g(w=>({...w,[q]:H}))},[])},Pt=q=>{const{className:H,defaultValue:g,name:w,values:D,valuesDebounceMs:G,label:de,filterSelectedOptions:pe,limitTags:Ee,multiple:lt}=q,[ct,St]=(0,m.useState)("");bt(w,g);const Tt=typeof D=="function"?D:void 0,st=typeof D=="function"?void 0:D,{value:De,loading:ft}=wt(Tt,ct,st,G),{filters:It,setFilters:zt}=C(),mt=It[w]||(lt?[]:null),Dt=(nt,rt)=>{zt(Wt=>{const{[w]:fn,...sn}=Wt;return rt?{...sn,[w]:rt}:{...sn}})},Ht=nt=>(0,O.jsx)(tt.Z,{...nt,name:"search",variant:"outlined",label:de,fullWidth:!0}),Rt=(nt,rt)=>nt.map((Wt,fn)=>(0,O.jsx)(Zt.Z,{label:Wt,color:"primary",...rt({index:fn})}));return(0,O.jsx)($e.ZP,{filterSelectedOptions:pe,limitTags:Ee,multiple:lt,className:H,id:`${lt?"multi-":""}select-filter-${w}--select`,options:De||[],loading:ft,value:mt,onChange:Dt,onInputChange:(nt,rt)=>St(rt),renderInput:Ht,renderTags:Rt})},Gt=(0,l.Z)({label:{textTransform:"capitalize"}}),Yt=q=>{const{className:H,defaultValue:g,label:w,name:D,values:G=[],valuesDebounceMs:de}=q,pe=Gt(),{filters:Ee,setFilters:lt}=C();bt(D,g);const ct=typeof G=="function"?G:void 0,St=typeof G=="function"?void 0:G,{value:Tt=[],loading:st}=wt(ct,"",St,de),De=It=>{const{target:{value:zt,checked:mt}}=It;lt(Dt=>{const{[D]:Ht,...Rt}=Dt,nt=(Ht||[]).filter(Wt=>Wt!==zt),rt=mt?[...nt,zt]:nt;return rt.length?{...Rt,[D]:rt}:Rt})};var ft;return(0,O.jsxs)($t.Z,{className:H,disabled:st,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[w?(0,O.jsx)(Lt.Z,{className:pe.label,children:w}):null,Tt.map(It=>(0,O.jsx)(We.Z,{control:(0,O.jsx)(me.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":It},value:It,name:It,onChange:De,checked:((ft=Ee[D])!==null&&ft!==void 0?ft:[]).includes(It)}),label:It},It))]})},an=q=>{const{className:H,defaultValue:g,label:w,name:D,values:G,valuesDebounceMs:de}=q,pe=Gt();bt(D,g);const Ee=typeof G=="function"?G:void 0,lt=typeof G=="function"?void 0:G,{value:ct=[],loading:St}=wt(Ee,"",lt,de),{filters:Tt,setFilters:st}=C(),De=ft=>{const{target:{value:It}}=ft;st(zt=>{const{[D]:mt,...Dt}=zt;return It?{...Dt,[D]:It}:Dt})};return(0,O.jsxs)($t.Z,{disabled:St,className:H,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[w?(0,O.jsx)(Le.Z,{className:pe.label,margin:"dense",children:w}):null,(0,O.jsxs)(Pe.Z,{variant:"outlined",value:Tt[D]||"",onChange:De,children:[(0,O.jsx)(Fe.Z,{value:"",children:(0,O.jsx)("em",{children:"All"})}),ct.map(ft=>(0,O.jsx)(Fe.Z,{value:ft,children:ft},ft))]})]})},Mt=({component:q,...H})=>(0,O.jsx)(q,{...H});Mt.Checkbox=q=>(0,O.jsx)(Mt,{...q,component:Yt}),Mt.Select=q=>(0,O.jsx)(Mt,{...q,component:an}),Mt.Autocomplete=q=>(0,O.jsx)(Mt,{...q,component:Pt});var hn=t(48834).lW;const bn=q=>hn.from(q.toString(),"utf-8").toString("base64"),Fn=q=>q?Number(hn.from(q,"base64").toString("utf-8")):0,Sn=q=>{const{total:H=-1,cursor:g,onCursorChange:w,limit:D=25,limitLabel:G="Results per page:",limitText:de=({from:st,to:De})=>H>0?`of ${H}`:`${st}-${De}`,limitOptions:pe,onLimitChange:Ee,...lt}=q,ct=useMemo(()=>Fn(g),[g]),St=useCallback((st,De)=>{w==null||w(bn(De))},[w]),Tt=useCallback(st=>{const De=st.target.value;Ee==null||Ee(parseInt(De,10))},[Ee]);return _jsx(TablePagination,{...lt,component:"div",count:H,page:ct,onPageChange:St,rowsPerPage:D,labelRowsPerPage:G,labelDisplayedRows:de,rowsPerPageOptions:pe,onRowsPerPageChange:Tt})},kn=q=>{const{pageLimit:H,setPageLimit:g,pageCursor:w,setPageCursor:D}=useSearch();return _jsx(Sn,{...q,limit:H,onLimitChange:g,cursor:w,onCursorChange:D})};var En=t(23196);const ln=q=>{const{children:H}=q,g=useSearch(),{result:w,...D}=g;return H(w,D)},tn=q=>{const{query:H,children:g}=q,w=useApi(searchApiRef),D=useAsync(()=>{const{term:G="",types:de=[],filters:pe={},...Ee}=H;return w.query({...Ee,term:G,types:de,filters:pe})},[H]);return g(D,H)},Un=q=>{const{query:H,children:g}=q;return H?_jsx(tn,{query:H,children:g}):_jsx(ln,{children:g})},Mn=q=>{const{query:H,children:g,noResultsComponent:w=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...D}=q;return _jsx(Un,{query:H,children:({loading:G,error:de,value:pe})=>G?_jsx(Progress,{}):de?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:de}):pe!=null&&pe.results.length?isFunction(g)?g(pe):_jsx(SearchResultListItemExtensions,{...D,results:pe.results,children:g}):w})},On=q=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(Mn,{...q})}),Bn=({result:q,highlight:H,icon:g,secondaryAction:w,lineClamp:D=5})=>q?_jsxs(_Fragment,{children:[g&&_jsx(ListItemIcon,{children:g}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:q.location,children:H!=null&&H.fields.title?_jsx(HighlightedSearchResultText,{text:(H==null?void 0:H.fields.title)||"",preTag:(H==null?void 0:H.preTag)||"",postTag:(H==null?void 0:H.postTag)||""}):q.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:D,overflow:"hidden"},children:H!=null&&H.fields.text?_jsx(HighlightedSearchResultText,{text:H.fields.text,preTag:H.preTag,postTag:H.postTag}):q.text})}),w&&_jsx(Box,{alignItems:"flex-end",children:w})]}):null,pn=q=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(Bn,{...q})}),mn=q=>{const{error:H,loading:g,resultItems:w,renderResultItem:D=Ee=>_jsx(DefaultResultListItem,{result:Ee.document},Ee.document.location),disableRenderingWithNoResults:G,noResultsComponent:de=G?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...pe}=q;return g?_jsx(Progress,{}):H?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:H}):w!=null&&w.length?_jsx(List,{...pe,children:w.map(D)}):_jsx(_Fragment,{children:de})},Hn=q=>{const{query:H,renderResultItem:g,children:w,...D}=q,G=useSearchResultListItemExtensions(w);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:H,children:({loading:de,error:pe,value:Ee})=>_jsx(mn,{...D,error:pe,loading:de,resultItems:Ee==null?void 0:Ee.results,renderResultItem:g!=null?g:G})})})};var Cn=t(19126);const An=(0,l.Z)(q=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:q.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:q.palette.text.secondary,margin:q.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:q.palette.text.secondary,margin:q.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:q.spacing(.5)}})),ge=q=>{const H=An(),{label:g,children:w,...D}=q;return _jsx(Chip,{...D,className:H.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[g,": ",w]})})},re=()=>null,je=(0,l.Z)(q=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:q.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:q.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),Ze=q=>{const H=je(),{label:g,value:w="None",onChange:D,onDelete:G}=q,de=useCallback(pe=>{D(pe.target.value)},[D]);return _jsx(ge,{label:g,onDelete:G,children:_jsx(Typography,{role:"textbox",component:"span",className:H.root,onChange:de,contentEditable:!0,suppressContentEditableWarning:!0,children:w})})},_e=(0,l.Z)(q=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:q.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),pt=q=>{const H=_e(),{label:g,value:w="none",onChange:D,onDelete:G,children:de}=q,pe=useCallback(Ee=>{D(Ee.target.value)},[D]);return _jsx(ge,{label:g,onDelete:G,children:_jsxs(Select,{className:H.root,value:w,onChange:pe,input:_jsx(InputBase,{}),IconComponent:re,children:[_jsx(MenuItem,{value:"none",children:"None"}),de]})})};function ue(q){const H=An(),[g,w]=useState(null),{error:D,loading:G,icon:de,title:pe,titleProps:Ee={},link:lt=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:H.listSubheaderLinkIcon})]}),linkProps:ct={},filterOptions:St,renderFilterOption:Tt=rt=>_jsx(MenuItem,{value:String(rt),children:rt},String(rt)),filterFields:st,renderFilterField:De,resultItems:ft,renderResultItem:It=rt=>_jsx(DefaultResultListItem,{result:rt.document},rt.document.location),disableRenderingWithNoResults:zt,noResultsComponent:mt=zt?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Dt}=q,Ht=useCallback(rt=>{w(rt.currentTarget)},[]),Rt=useCallback(()=>{w(null)},[]);if(G)return _jsx(Progress,{});if(D)return _jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:D});if(!(ft!=null&&ft.length))return _jsx(_Fragment,{children:mt});var nt;return _jsxs(List,{...Dt,children:[_jsxs(ListSubheader,{className:H.listSubheader,children:[de,_jsx(Typography,{className:H.listSubheaderName,component:"strong",...Ee,children:pe}),St?_jsx(Chip,{className:H.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:Ht}):null,St?_jsx(Menu,{id:"filters-menu",anchorEl:g,open:Boolean(g),onClose:Rt,onClick:Rt,keepMounted:!0,children:St.map(Tt)}):null,st==null?void 0:st.map(rt=>(nt=De==null?void 0:De(rt))!==null&&nt!==void 0?nt:null),_jsx(Link,{className:H.listSubheaderLink,to:"/search",...ct,children:lt})]}),ft.map(It)]})}function F(q){const{query:H,children:g,renderResultItem:w,linkProps:D={},...G}=q,de=useSearchResultListItemExtensions(g);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:H,children:({loading:pe,error:Ee,value:lt},{term:ct,types:St,pageCursor:Tt,filters:st={}})=>{const De=`/search?${qs.stringify({term:ct,types:St,filters:st,pageCursor:Tt,query:ct},{arrayFormat:"brackets"})}`;return _jsx(ue,{...G,error:Ee,loading:pe,linkProps:{to:De,...D},filterFields:Object.keys(st),resultItems:lt==null?void 0:lt.results,renderResultItem:w!=null?w:de})}})})}const he=(0,l.Z)(q=>({root:{display:"flex",justifyContent:"space-between",gap:q.spacing(2),margin:q.spacing(2,0)}})),Re=()=>{const{fetchNextPage:q,fetchPreviousPage:H}=useSearch(),g=he();return!q&&!H?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:g.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!H,onClick:H,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!q,onClick:q,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},et="search.results.list.items.extensions.v1",Ue=(q,H)=>{for(const g of q){if(!isValidElement(g))continue;const w=getComponentData(g,et);if(!!(w!=null&&w(H)))return cloneElement(g,{rank:H.rank,highlight:H.highlight,result:H.document,...g.props})}return null},Et=q=>{const{rank:H,result:g,noTrack:w,children:D,alignItems:G="flex-start",...de}=q,pe=(0,h.z$)(),Ee=(0,m.useCallback)(()=>{w||!g||pe.captureEvent("discover",g.title,{attributes:{to:g.location},value:H})},[H,g,w,pe]);return(0,O.jsx)(S.Z,{divider:!0,alignItems:G,onClickCapture:Ee,...de,children:D})},Vt=q=>{const{name:H,component:g,predicate:w=()=>!0}=q;return(0,h.YO)({name:H,component:{lazy:()=>g().then(D=>G=>(0,O.jsx)(Et,{rank:G.rank,result:G.result,noTrack:G.noTrack,children:(0,m.createElement)(D,G)}))},data:{[et]:w}})},Jt=q=>{const H=useElementFilter(q,g=>g.selectByComponentData({key:et}).getElements(),[q]);return useCallback((g,w)=>{const D=Ue(H,g);return _jsx(Fragment,{children:D!=null?D:_jsx(Et,{rank:g.rank,result:g.document,children:_jsx(DefaultResultListItem,{rank:g.rank,highlight:g.highlight,result:g.document})})},w)},[H])},Xt=q=>{const{results:H,children:g,...w}=q,D=Jt(g);return _jsx(List,{...w,children:H.map(D)})}},61886:function(At,Be,t){"use strict";t.d(Be,{Ox:function(){return Ke},jM:function(){return m},Zz:function(){return S},oZ:function(){return Ye},DR:function(){return l},ZS:function(){return Se},VA:function(){return ht},KY:function(){return oe},gT:function(){return K},Dl:function(){return ce},ux:function(){return $e},$L:function(){return I},x1:function(){return Ge}});var h=t(52322),n=t(2784),W=t(79635),O=t(25248);const m="techdocs.addons.addon.v1",S="techdocs.addons.wrapper.v1",l=()=>null;(0,O.R5)(l,S,!0);const P=me=>`${m}.${me.toLocaleLowerCase("en-US")}`;function oe(me){const{name:Le,component:Pe}=me;return(0,O.YO)({name:Le,component:{sync:Fe=>(0,h.jsx)(Pe,{...Fe})},data:{[m]:me,[P(Le)]:!0}})}const _=(me,Le)=>me.selectByComponentData({key:Le}).getElements()[0],te=me=>me.selectByComponentData({key:S}).selectByComponentData({key:m}),B=me=>me.selectByComponentData({key:S}).findComponentData({key:m}),I=()=>{const me=(0,W.pC)(),Le=(0,O.vJ)(me,te),Pe=(0,O.vJ)(me,B),Fe=(0,n.useCallback)(xt=>{if(!Le||!xt)return null;const wt=P(xt.name);var bt;return(bt=_(Le,wt))!==null&&bt!==void 0?bt:null},[Le]),tt=(0,n.useCallback)(xt=>{const wt=Pe.find(bt=>bt.name===xt);return wt?Fe(wt):null},[Pe,Fe]),Zt=(0,n.useCallback)(xt=>{const wt=Pe.filter(bt=>bt.location===xt);return wt.length?wt.map(Fe):null},[Pe,Fe]);return{renderComponentByName:tt,renderComponentsByLocation:Zt}},K=(0,O.T0)({id:"plugin.techdocs.service"}),ce=(0,O.T0)({id:"plugin.techdocs.storageservice"});var se=t(64279),$=t(25271),T=t(51837);function z(me,Le){return Le.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(me.kind=me.kind.toLocaleLowerCase(),me.name=me.name.toLocaleLowerCase(),me.namespace=me.namespace.toLocaleLowerCase()),me}const R=(me,Le)=>(0,$.eE)(me)===(0,$.eE)(Le),C={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},X=(0,T.CT)("techdocs-reader-page-context"),Se=(0,n.memo)(({entityRef:me,children:Le})=>{const Pe=(0,O.h_)(K),Fe=(0,O.h_)(O.Ds),tt=(0,se.default)(async()=>Pe.getTechDocsMetadata(me),[me]),Zt=(0,se.default)(async()=>Pe.getEntityMetadata(me),[me]),[xt,wt]=(0,n.useState)(C.title),[bt,Pt]=(0,n.useState)(C.subtitle),[Gt,Yt]=(0,n.useState)(C.shadowRoot),an={metadata:tt,entityRef:z(me,Fe),entityMetadata:Zt,shadowRoot:Gt,setShadowRoot:Yt,title:xt,setTitle:wt,subtitle:bt,setSubtitle:Pt},Mt=(0,T.EI)({1:an});return(0,h.jsx)(O.fC,{attributes:{entityRef:(0,$.eE)(me)},children:(0,h.jsx)(X.Provider,{value:Mt,children:Le instanceof Function?Le(an):Le})})},(me,Le)=>R(me.entityRef,Le.entityRef)),Ge=()=>{const me=(0,n.useContext)(X);if(me===void 0)return C;const Le=me.atVersion(1);if(Le===void 0)throw new Error("No context found for version 1.");return Le},Ye=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var dt=t(70882),ze=t(50236),at=t(19219),ot=t(23196);const Ke="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",Qe=me=>{(0,n.useEffect)(()=>{if(!me)return()=>{};const Le=me.querySelectorAll('head > link[rel="stylesheet"]');var Pe;let Fe=(Pe=Le==null?void 0:Le.length)!==null&&Pe!==void 0?Pe:0;const tt=new CustomEvent(Ke);if(!Fe)return me.dispatchEvent(tt),()=>{};const Zt=()=>{--Fe===0&&me.dispatchEvent(tt)};return Le==null||Le.forEach(xt=>{xt.addEventListener("load",Zt)}),()=>{Le==null||Le.forEach(xt=>{xt.removeEventListener("load",Zt)})}},[me])},$e=me=>{const[Le,Pe]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(!me)return()=>{};Pe(!0);const Fe=me.style;Fe.setProperty("opacity","0");const tt=()=>{Pe(!1),Fe.setProperty("opacity","1")};return me.addEventListener(Ke,tt),()=>{me.removeEventListener(Ke,tt)}},[me]),Le},ht=({element:me,onAppend:Le,children:Pe})=>{const[Fe,tt]=(0,n.useState)((0,dt.Ue)({...(0,ze.Z)(),insertionPoint:void 0}));Qe(me);const Zt=$e(me),xt=(0,n.useCallback)(wt=>{if(!me||!wt)return;tt((0,dt.Ue)({...(0,ze.Z)(),insertionPoint:me.querySelector("head")||void 0}));let bt=wt.shadowRoot;bt||(bt=wt.attachShadow({mode:"open"})),bt.replaceChildren(me),typeof Le=="function"&&Le(bt)},[me,Le]);return(0,h.jsxs)(h.Fragment,{children:[Zt&&(0,h.jsx)(ot.Ex,{}),(0,h.jsxs)(at.ZP,{jss:Fe,sheetsManager:new Map,children:[(0,h.jsx)("div",{ref:xt,"data-testid":"techdocs-native-shadowroot"}),Pe]})]})};var gt=t(54073);const Ct=()=>{const{shadowRoot:me}=useTechDocsReaderPage();return me},$t=me=>{const Le=Ct();return Le?me.map(Pe=>Le==null?void 0:Le.querySelectorAll(Pe)).filter(Pe=>Pe.length).map(Pe=>Array.from(Pe)).flat():[]},Lt=me=>me.toString()&&me.rangeCount&&me.getRangeAt(0).getBoundingClientRect().top,We=(me=0)=>{const Le=Ct(),[Pe,Fe]=useState(null),tt=useMemo(()=>debounce(()=>{const Zt=Le,xt=Zt.getSelection?Zt.getSelection():document.getSelection();xt&&Lt(xt)?Fe(xt):Fe(null)},me),[Le,Fe,me]);return useEffect(()=>(window.document.addEventListener("selectionchange",tt),()=>window.document.removeEventListener("selectionchange",tt)),[tt]),Pe}},52943:function(At,Be,t){"use strict";t.r(Be),t.d(Be,{EmbeddedDocsRouter:function(){return se},Router:function(){return ce},isTechDocsAvailable:function(){return K}});var h=t(52322),n=t(2784),W=t(79635),O=t(56941),m=t(23196),S=t(25271),l=t(89258),P=t(65124),oe=t(67896);const _=({entity:$})=>{const T=(0,S.iB)($);return(0,h.jsxs)(l.I6,{entityRef:T,children:[(0,h.jsx)(P.b,{}),(0,h.jsx)(oe.F,{withSearch:!1})]})};var te=t(18662),B=t(7476);const I="backstage.io/techdocs-ref",K=$=>{var T,z;return Boolean($==null||(T=$.metadata)===null||T===void 0||(z=T.annotations)===null||z===void 0?void 0:z[I])},ce=()=>(0,h.jsxs)(W.Z5,{children:[(0,h.jsx)(W.AW,{path:"/",element:(0,h.jsx)(te.TechDocsIndexPage,{})}),(0,h.jsx)(W.AW,{path:"/:namespace/:kind/:name/*",element:(0,h.jsx)(B.TechDocsReaderPage,{})})]}),se=$=>{var T;const{children:z}=$,{entity:R}=(0,O.X2)(),C=(0,W.V$)([{path:"/*",element:(0,h.jsx)(_,{entity:R}),children:[{path:"*",element:z}]}]);return((T=R.metadata.annotations)===null||T===void 0?void 0:T[I])?C:(0,h.jsx)(m.sk,{annotation:I})}},92077:function(At,Be,t){"use strict";t.d(Be,{k:function(){return m},p:function(){return O}});var h=t(23054),n=t(76372),W=t.n(n);class O{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(l){const{kind:P,namespace:oe,name:_}=l,B=`${await this.getApiOrigin()}/metadata/techdocs/${oe}/${P}/${_}`,I=await this.fetchApi.fetch(`${B}`);if(!I.ok)throw await h.VL.fromResponse(I);return await I.json()}async getEntityMetadata(l){const{kind:P,namespace:oe,name:_}=l,B=`${await this.getApiOrigin()}/metadata/entity/${oe}/${P}/${_}`,I=await this.fetchApi.fetch(`${B}`);if(!I.ok)throw await h.VL.fromResponse(I);return await I.json()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.fetchApi=l.fetchApi}}class m{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var l;return(l=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&l!==void 0?l:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(l,P){const{kind:oe,namespace:_,name:te}=l,I=`${await this.getStorageUrl()}/${_}/${oe}/${te}/${P}`,K=await this.fetchApi.fetch(`${I.endsWith("/")?I:`${I}/`}index.html`);let ce="";switch(K.status){case 404:throw ce="Page not found. ",P||(ce+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(ce);case 500:throw ce="Could not generate documentation or an error in the TechDocs backend. ",new Error(ce);default:break}return K.text()}async syncEntityDocs(l,P=()=>{}){const{kind:oe,namespace:_,name:te}=l,I=`${await this.getApiOrigin()}/sync/${_}/${oe}/${te}`,{token:K}=await this.identityApi.getCredentials();return new Promise((ce,se)=>{const $=new n.EventSourcePolyfill(I,{withCredentials:!0,headers:K?{Authorization:`Bearer ${K}`}:{}});$.addEventListener("log",T=>{T.data&&P(JSON.parse(T.data))}),$.addEventListener("finish",T=>{let z=!1;T.data&&({updated:z}=JSON.parse(T.data)),ce(z?"updated":"cached")}),$.onerror=T=>{switch($.close(),T.status){case 404:se(new h.dR(T.message));return;default:se(new Error(T.data));return}}})}async getBaseUrl(l,P,oe){const{kind:_,namespace:te,name:B}=P,K=`${await this.getApiOrigin()}/static/docs/${te}/${_}/${B}/${oe}`;return new URL(l,K.endsWith("/")?K:`${K}/`).toString()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.identityApi=l.identityApi,this.fetchApi=l.fetchApi}}},51953:function(At,Be,t){"use strict";t.d(Be,{D:function(){return h}});function h(n,W){return W.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?n:n.toLocaleLowerCase("en-US")}},3482:function(At,Be,t){"use strict";t.d(Be,{u:function(){return P}});var h=t(52322),n=t(2784),W=t(23196),O=t(56941),m=t(42081),S=t(48431),l=t(68435);const P=oe=>{const{initialFilter:_="owned",columns:te,actions:B}=oe;return(0,h.jsx)(m.j,{children:(0,h.jsxs)(W.VY,{children:[(0,h.jsx)(W.yW,{title:"",children:(0,h.jsx)(W.qt,{children:"Discover documentation in your ecosystem."})}),(0,h.jsx)(O.UO,{children:(0,h.jsxs)(O._i,{children:[(0,h.jsxs)(O._i.Filters,{children:[(0,h.jsx)(S.f,{}),(0,h.jsx)(O.EW,{initialFilter:_}),(0,h.jsx)(O.dq,{}),(0,h.jsx)(O.xE,{})]}),(0,h.jsx)(O._i.Content,{children:(0,h.jsx)(l.n,{actions:B,columns:te})})]})})]})})}},85478:function(At,Be,t){"use strict";t.d(Be,{f:function(){return te}});var h=t(52322),n=t(95573),W=t(51953),O=t(25248),m=t(23196),S=t(94339),l=t(16111),P=t(24579),oe=t(14503),_=t(2784);const te=se=>{const{entities:$}=se,T=(0,O.tg)(n.Fw),z=(0,O.h_)(O.Ds);if(!$)return null;var R,C;return(0,h.jsx)(m.Oh,{"data-testid":"docs-explore",children:$!=null&&$.length?$.map((X,Se)=>(0,h.jsxs)(S.Z,{children:[(0,h.jsx)(l.Z,{children:(0,h.jsx)(m.hu,{title:(R=X.metadata.title)!==null&&R!==void 0?R:X.metadata.name})}),(0,h.jsx)(P.Z,{children:X.metadata.description}),(0,h.jsx)(oe.Z,{children:(0,h.jsx)(m.zx,{to:T({namespace:(0,W.D)((C=X.metadata.namespace)!==null&&C!==void 0?C:"default",z),kind:(0,W.D)(X.kind,z),name:(0,W.D)(X.metadata.name,z)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},Se)):null})};var B=t(56941);const I={title:"All Documentation",filterPredicate:()=>!0},K=({entities:se,group:$})=>{const{loading:T,isOwnedEntity:z}=useEntityOwnership(),R=se.filter(X=>$.filterPredicate==="ownedByUser"?T?!1:z(X):typeof $.filterPredicate=="function"&&$.filterPredicate(X)),C=(()=>typeof $.title=="string"?_jsx(ContentHeader,{title:$.title}):$.title)();return R.length===0?null:_jsxs(Content,{children:[C,_jsx(DocsCardGrid,{entities:R})]})},ce=({groups:se})=>{const{loading:$,error:T,entities:z}=useEntityList();if(T)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:T.toString()})});if($)return _jsx(Progress,{});if(z.length===0)return _jsx("div",{"data-testid":"doc-not-found",children:_jsxs(Typography,{variant:"body2",children:["No documentation found that match your filter. Learn more about"," ",_jsx(Link,{to:"https://backstage.io/docs/features/techdocs/creating-and-publishing",children:"publishing documentation"}),"."]})});var R,C;return z.sort((X,Se)=>((R=X.metadata.title)!==null&&R!==void 0?R:X.metadata.name).localeCompare((C=Se.metadata.title)!==null&&C!==void 0?C:Se.metadata.name)),_jsx(Content,{children:(se||[I]).map((X,Se)=>_jsx(K,{entities:z,group:X},`${X.title}-${Se}`))})}},68435:function(At,Be,t){"use strict";t.d(Be,{H:function(){return z},n:function(){return R}});var h=t(52322),n=t(2784),W=t(95074),O=t(76635),m=t(23196),S=t(56941),l=t(25248),P=t(25271),oe=t(95573),_=t(39981),te=t(2337),B=t(11640),I=t(28347);const K=(0,te.Z)({root:{color:"#f3ba37"}})(B.Z),ce={createCopyDocsUrlAction(C){return X=>({icon:()=>(0,h.jsx)(_.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>C(`${window.location.origin}${X.resolved.docsUrl}`)})},createStarEntityAction(C,X){return({entity:Se})=>{const Ge=C(Se);return{cellStyle:{paddingLeft:"1em"},icon:()=>Ge?(0,h.jsx)(K,{}):(0,h.jsx)(I.Z,{}),tooltip:Ge?"Remove from favorites":"Add to favorites",onClick:()=>X(Se)}}}};function se(C){return C.metadata.title||C.metadata.name}const $={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:C=>(0,h.jsx)(m.uw,{value:(0,h.jsx)(m.rU,{to:C.resolved.docsUrl,children:se(C.entity)}),subvalue:C.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:C})=>(0,h.jsx)(S.rI,{entityRefs:C.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var T=t(51953);const z=C=>{const{entities:X,title:Se,loading:Ge,columns:Ye,actions:dt,options:ze}=C,[,at]=(0,W.Z)(),ot=(0,l.tg)(oe.Fw),Ke=(0,l.h_)(l.Ds);if(!X)return null;const Qe=X.map(gt=>{const Ct=(0,S.hF)(gt,P.S4);var $t;return{entity:gt,resolved:{docsUrl:ot({namespace:(0,T.D)(($t=gt.metadata.namespace)!==null&&$t!==void 0?$t:"default",Ke),kind:(0,T.D)(gt.kind,Ke),name:(0,T.D)(gt.metadata.name,Ke)}),ownedByRelations:Ct,ownedByRelationsTitle:Ct.map(Lt=>(0,S.$3)(Lt,{defaultKind:"group"})).join(", ")}}}),$e=[$.createNameColumn(),$.createOwnerColumn(),$.createTypeColumn()],ht=[ce.createCopyDocsUrlAction(at)];return(0,h.jsx)(h.Fragment,{children:Ge||Qe&&Qe.length>0?(0,h.jsx)(m.iA,{isLoading:Ge,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1,...ze},data:Qe,columns:Ye||$e,actions:dt||ht,title:Se?`${Se} (${Qe.length})`:`All (${Qe.length})`}):(0,h.jsx)(m.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,h.jsx)(m.zx,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};z.columns=$,z.actions=ce;const R=C=>{var X;const{columns:Se,actions:Ge,options:Ye}=C,{loading:dt,error:ze,entities:at,filters:ot}=(0,S.wp)(),{isStarredEntity:Ke,toggleStarredEntity:Qe}=(0,S.CR)(),[,$e]=(0,W.Z)();var ht;const gt=(0,O.capitalize)((ht=(X=ot.user)===null||X===void 0?void 0:X.value)!==null&&ht!==void 0?ht:"all"),Ct=[ce.createCopyDocsUrlAction($e),ce.createStarEntityAction(Ke,Qe)];return ze?(0,h.jsx)(m.GB,{severity:"error",title:"Could not load available documentation.",children:(0,h.jsx)(m.Oi,{language:"text",text:ze.toString()})}):(0,h.jsx)(z,{title:gt,entities:at,loading:dt,actions:Ge||Ct,columns:Se,options:Ye})};R.columns=$,R.actions=ce},18662:function(At,Be,t){"use strict";t.r(Be),t.d(Be,{TechDocsIndexPage:function(){return m}});var h=t(52322),n=t(2784),W=t(79635),O=t(3482);const m=S=>(0,W.pC)()||(0,h.jsx)(O.u,{...S})},42081:function(At,Be,t){"use strict";t.d(Be,{j:function(){return m}});var h=t(52322),n=t(2784),W=t(23196),O=t(25248);const m=S=>{const{children:l}=S,P=(0,O.h_)(O.Ds);var oe;const _=`Documentation available in ${(oe=P.getOptionalString("organization.name"))!==null&&oe!==void 0?oe:"Backstage"}`;return(0,h.jsx)(W.g9,{title:"Documentation",subtitle:_,themeId:"documentation",children:l})}},48431:function(At,Be,t){"use strict";t.d(Be,{f:function(){return O}});var h=t(2784),n=t(56941);class W{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":n.n3}}}const O=()=>{const{updateFilters:m}=(0,n.wp)();return(0,h.useEffect)(()=>{m({techdocs:new W})},[m]),null}},89258:function(At,Be,t){"use strict";t.d(Be,{I6:function(){return te},Jl:function(){return _},s4:function(){return S}});var h=t(61886),n=t(92077),W=t(95573),O=t(25248),m=t(15096);const S=(0,O.rx)({id:"techdocs",apis:[(0,O.ni)({api:h.Dl,deps:{configApi:O.Ds,discoveryApi:O.NW,identityApi:O.$4,fetchApi:O.gP},factory:({configApi:I,discoveryApi:K,identityApi:ce,fetchApi:se})=>new n.k({configApi:I,discoveryApi:K,identityApi:ce,fetchApi:se})}),(0,O.ni)({api:h.gT,deps:{configApi:O.Ds,discoveryApi:O.NW,fetchApi:O.gP},factory:({configApi:I,discoveryApi:K,fetchApi:ce})=>new n.p({configApi:I,discoveryApi:K,fetchApi:ce})})],routes:{root:W._Z,docRoot:W.Fw,entityContent:W.pd}}),l=S.provide((0,O.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(t.bind(t,52943)).then(I=>I.Router),mountPoint:W._Z})),P=S.provide((0,O.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(t.bind(t,52943)).then(I=>I.EmbeddedDocsRouter),mountPoint:W.pd})),oe=S.provide((0,O.P4)({name:"TechDocsCustomHome",component:()=>t.e(7560).then(t.bind(t,27560)).then(I=>I.TechDocsCustomHome),mountPoint:W._Z})),_=S.provide((0,O.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(t.bind(t,18662)).then(I=>I.TechDocsIndexPage),mountPoint:W._Z})),te=S.provide((0,O.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(t.bind(t,7476)).then(I=>I.TechDocsReaderPage),mountPoint:W.Fw})),B=S.provide((0,m.E5)({name:"TechDocsSearchResultListItem",component:()=>Promise.resolve().then(t.bind(t,55511)).then(I=>I.TechDocsSearchResultListItem),predicate:I=>I.type==="techdocs"}))},7476:function(At,Be,t){"use strict";t.r(Be),t.d(Be,{TechDocsReaderLayout:function(){return te},TechDocsReaderPage:function(){return B}});var h=t(52322),n=t(2784),W=t(79635),O=t(23196),m=t(61886),S=t(67896),l=t(93225),P=t(65124),oe=t(95573),_=t(25248);const te=({withSearch:I,withHeader:K=!0})=>(0,h.jsxs)(O.T3,{themeId:"documentation",children:[K&&(0,h.jsx)(l.S,{}),(0,h.jsx)(P.b,{}),(0,h.jsx)(S.F,{withSearch:I})]}),B=I=>{const{kind:K,name:ce,namespace:se}=(0,_.Oi)(oe.Fw),{children:$,entityRef:T={kind:K,name:ce,namespace:se}}=I,z=(0,W.pC)();if(!$){const C=z?n.Children.toArray(z.props.children):[];var R;const Se=C.flatMap(Ge=>{var Ye;return(R=Ge==null||(Ye=Ge.props)===null||Ye===void 0?void 0:Ye.children)!==null&&R!==void 0?R:[]}).find(Ge=>!(0,_.IY)(Ge,m.Zz)&&!(0,_.IY)(Ge,m.jM));return(0,h.jsx)(m.ZS,{entityRef:T,children:Se||(0,h.jsx)(te,{})})}return(0,h.jsx)(m.ZS,{entityRef:T,children:({metadata:C,entityMetadata:X,onReady:Se})=>(0,h.jsx)("div",{className:"techdocs-reader-page",children:(0,h.jsx)(O.T3,{themeId:"documentation",children:$ instanceof Function?$({entityRef:T,techdocsMetadataValue:C.value,entityMetadataValue:X.value,onReady:Se}):$})})})}},67896:function(At,Be,t){"use strict";t.d(Be,{F:function(){return q}});var h=t(52322),n=t(2784),W=t(79692),O=t(60905),m=t(61886),S=t(23196),l=t(22478),P=t(4614),oe=t(77277),_=t(99688),te=t(12420),B=t(90436),I=t(61837),K=t(4190),ce=t(87685);const se=(0,W.Z)(g=>(0,te.Z)({paper:{width:"100%",[g.breakpoints.up("sm")]:{width:"75%"},[g.breakpoints.up("md")]:{width:"50%"},padding:g.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:g.palette.background.default}})),$=({buildLog:g,onClose:w})=>{const D=se(),G=g.length===0?"Waiting for logs...":g.join(`
|
|
37
|
+
`);return(0,h.jsxs)(O.Z,{container:!0,direction:"column",className:D.root,spacing:0,wrap:"nowrap",children:[(0,h.jsxs)(O.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,h.jsx)(B.Z,{variant:"h5",children:"Build Details"}),(0,h.jsx)(I.Z,{title:"Close the drawer",onClick:w,color:"inherit",children:(0,h.jsx)(ce.Z,{})},"dismiss")]}),(0,h.jsx)(O.Z,{item:!0,xs:!0,children:(0,h.jsx)(S.nU,{text:G,classes:{root:D.logs}})})]})},T=({buildLog:g})=>{const w=se(),[D,G]=(0,n.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(oe.Z,{color:"inherit",onClick:()=>G(!0),children:"Show Build Logs"}),(0,h.jsx)(K.ZP,{classes:{paper:w.paper},anchor:"right",open:D,onClose:()=>G(!1),children:(0,h.jsx)($,{buildLog:g,onClose:()=>G(!1)})})]})};var z=t(25248);const R=({errorMessage:g})=>{const w=(0,z.h_)(z.Ds).getOptionalString("techdocs.builder");let D="";return w!=="local"&&(D="Note that techdocs.builder is not set to 'local' in your config, which means this Backstage app will not generate docs if they are not found. Make sure the project's docs are generated and published by some external process (e.g. CI/CD pipeline). Or change techdocs.builder to 'local' to generate docs from this Backstage instance."),(0,h.jsx)(S.mf,{status:"404",statusMessage:g||"Documentation not found",additionalInfo:D})};var C=t(95481);const X=(0,W.Z)(g=>({root:{marginBottom:g.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),Se=()=>{let g=null;const w=X(),{state:D,contentReload:G,contentErrorMessage:de,syncErrorMessage:pe,buildLog:Ee}=(0,C.DK)();return D==="INITIAL_BUILD"&&(g=(0,h.jsx)(_.Z,{classes:{root:w.root},variant:"outlined",severity:"info",icon:(0,h.jsx)(P.Z,{size:"24px"}),action:(0,h.jsx)(T,{buildLog:Ee}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),D==="CONTENT_STALE_REFRESHING"&&(g=(0,h.jsx)(_.Z,{variant:"outlined",severity:"info",icon:(0,h.jsx)(P.Z,{size:"24px"}),action:(0,h.jsx)(T,{buildLog:Ee}),classes:{root:w.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),D==="CONTENT_STALE_READY"&&(g=(0,h.jsx)(_.Z,{variant:"outlined",severity:"success",action:(0,h.jsx)(oe.Z,{color:"inherit",onClick:()=>G(),children:"Refresh"}),classes:{root:w.root},children:"A newer version of this documentation is now available, please refresh to view."})),D==="CONTENT_STALE_ERROR"&&(g=(0,h.jsxs)(_.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(T,{buildLog:Ee}),classes:{root:w.root,message:w.message},children:["Building a newer version of this documentation failed."," ",pe]})),D==="CONTENT_NOT_FOUND"&&(g=(0,h.jsxs)(h.Fragment,{children:[pe&&(0,h.jsxs)(_.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(T,{buildLog:Ee}),classes:{root:w.root,message:w.message},children:["Building a newer version of this documentation failed."," ",pe]}),(0,h.jsx)(R,{errorMessage:de})]})),g};var Ge=t(79635),Ye=t(60364),dt=t(41156),ze=t(32838),at=t(35368),ot=t.n(at);const Ke=/main\.[A-Fa-f0-9]{8}\.min\.css$/,Qe=/^https:\/\/fonts\.googleapis\.com/,$e=/^https:\/\/fonts\.gstatic\.com/,ht=g=>g.nodeName==="LINK",gt=g=>{const w=(g==null?void 0:g.getAttribute("href"))||"",D=w.match(Ke),G=w.match(Qe),de=w.match($e);return D||G||de},Ct=g=>(ht(g)&&!gt(g)&&g.remove(),g),$t=g=>g.nodeName==="IFRAME",Lt=(g,w)=>{const D=g.getAttribute("src")||"";try{const{host:G}=new URL(D);return w.includes(G)}catch{return!1}},We=g=>w=>($t(w)&&!Lt(w,g)&&w.remove(),w),me=()=>{const g=(0,z.h_)(z.Ds);return(0,n.useMemo)(()=>g.getOptionalConfig("techdocs.sanitizer"),[g])},Le=()=>{const g=me();return(0,n.useCallback)(async w=>{const D=g==null?void 0:g.getOptionalStringArray("allowedIframeHosts");ot().addHook("beforeSanitizeElements",Ct);const G=["link"];return D&&(G.push("iframe"),ot().addHook("beforeSanitizeElements",We(D))),ot().sanitize(w.innerHTML,{ADD_TAGS:G,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[g])};var Pe=t(41128),Fe=({theme:g})=>`
|
|
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: ${g.palette.text.primary};
|
|
47
|
+
--md-default-fg-color--light: ${g.palette.text.secondary};
|
|
48
|
+
--md-default-fg-color--lighter: ${(0,Pe.$n)(g.palette.text.secondary,.7)};
|
|
49
|
+
--md-default-fg-color--lightest: ${(0,Pe.$n)(g.palette.text.secondary,.3)};
|
|
50
|
+
|
|
51
|
+
/* BACKGROUND */
|
|
52
|
+
--md-default-bg-color:${g.palette.background.default};
|
|
53
|
+
--md-default-bg-color--light: ${g.palette.background.paper};
|
|
54
|
+
--md-default-bg-color--lighter: ${(0,Pe.$n)(g.palette.background.paper,.7)};
|
|
55
|
+
--md-default-bg-color--lightest: ${(0,Pe.$n)(g.palette.background.paper,.3)};
|
|
56
|
+
|
|
57
|
+
/* PRIMARY */
|
|
58
|
+
--md-primary-fg-color: ${g.palette.primary.main};
|
|
59
|
+
--md-primary-fg-color--light: ${g.palette.primary.light};
|
|
60
|
+
--md-primary-fg-color--dark: ${g.palette.primary.dark};
|
|
61
|
+
--md-primary-bg-color: ${g.palette.primary.contrastText};
|
|
62
|
+
--md-primary-bg-color--light: ${(0,Pe.$n)(g.palette.primary.contrastText,.7)};
|
|
63
|
+
|
|
64
|
+
/* ACCENT */
|
|
65
|
+
--md-accent-fg-color: var(--md-primary-fg-color);
|
|
66
|
+
|
|
67
|
+
/* SHADOW */
|
|
68
|
+
--md-shadow-z1: ${g.shadows[1]};
|
|
69
|
+
--md-shadow-z2: ${g.shadows[2]};
|
|
70
|
+
--md-shadow-z3: ${g.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: ${g.palette.text.primary};
|
|
107
|
+
--md-code-bg-color: ${g.palette.background.paper};
|
|
108
|
+
--md-code-hl-color: ${(0,Pe.Fq)(g.palette.warning.main,.5)};
|
|
109
|
+
--md-code-hl-keyword-color: ${g.palette.type==="dark"?g.palette.primary.light:g.palette.primary.dark};
|
|
110
|
+
--md-code-hl-function-color: ${g.palette.type==="dark"?g.palette.secondary.light:g.palette.secondary.dark};
|
|
111
|
+
--md-code-hl-string-color: ${g.palette.type==="dark"?g.palette.success.light:g.palette.success.dark};
|
|
112
|
+
--md-code-hl-number-color: ${g.palette.type==="dark"?g.palette.error.light:g.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: var(--md-accent-fg-color);
|
|
126
|
+
--md-typeset-table-color: ${g.palette.text.primary};
|
|
127
|
+
--md-typeset-del-color: ${g.palette.type==="dark"?(0,Pe.Fq)(g.palette.error.dark,.5):(0,Pe.Fq)(g.palette.error.light,.5)};
|
|
128
|
+
--md-typeset-ins-color: ${g.palette.type==="dark"?(0,Pe.Fq)(g.palette.success.dark,.5):(0,Pe.Fq)(g.palette.success.light,.5)};
|
|
129
|
+
--md-typeset-mark-color: ${g.palette.type==="dark"?(0,Pe.Fq)(g.palette.warning.dark,.5):(0,Pe.Fq)(g.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
|
+
`,tt=({theme:g})=>`
|
|
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: ${g.typography.fontFamily};
|
|
152
|
+
font-family: var(--md-text-font-family);
|
|
153
|
+
background-color: unset;
|
|
154
|
+
}
|
|
155
|
+
`;const Zt="224px";var xt=({theme:g,sidebar:w})=>`
|
|
156
|
+
/*================== Layout ==================*/
|
|
157
|
+
|
|
158
|
+
.md-grid {
|
|
159
|
+
max-width: 100%;
|
|
160
|
+
margin: 0;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.md-nav {
|
|
164
|
+
font-size: calc(var(--md-typeset-font-size) * 0.9);
|
|
165
|
+
}
|
|
166
|
+
.md-nav__link {
|
|
167
|
+
display: flex;
|
|
168
|
+
align-items: center;
|
|
169
|
+
justify-content: space-between;
|
|
170
|
+
}
|
|
171
|
+
.md-nav__icon {
|
|
172
|
+
height: 20px !important;
|
|
173
|
+
width: 20px !important;
|
|
174
|
+
margin-left:${g.spacing(1)}px;
|
|
175
|
+
}
|
|
176
|
+
.md-nav__icon svg {
|
|
177
|
+
margin: 0;
|
|
178
|
+
width: 20px !important;
|
|
179
|
+
height: 20px !important;
|
|
180
|
+
}
|
|
181
|
+
.md-nav__icon:after {
|
|
182
|
+
width: 20px !important;
|
|
183
|
+
height: 20px !important;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.md-nav__item--active > .md-nav__link, a.md-nav__link--active {
|
|
187
|
+
text-decoration: underline;
|
|
188
|
+
color: var(--md-typeset-a-color);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.md-main__inner {
|
|
192
|
+
margin-top: 0;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.md-sidebar {
|
|
196
|
+
bottom: 75px;
|
|
197
|
+
position: fixed;
|
|
198
|
+
width: 16rem;
|
|
199
|
+
overflow-y: auto;
|
|
200
|
+
overflow-x: hidden;
|
|
201
|
+
scrollbar-color: rgb(193, 193, 193) #eee;
|
|
202
|
+
scrollbar-width: thin;
|
|
203
|
+
}
|
|
204
|
+
.md-sidebar .md-sidebar__scrollwrap {
|
|
205
|
+
width: calc(12.1rem);
|
|
206
|
+
}
|
|
207
|
+
.md-sidebar--secondary {
|
|
208
|
+
right: ${g.spacing(3)}px;
|
|
209
|
+
}
|
|
210
|
+
.md-sidebar::-webkit-scrollbar {
|
|
211
|
+
width: 5px;
|
|
212
|
+
}
|
|
213
|
+
.md-sidebar::-webkit-scrollbar-button {
|
|
214
|
+
width: 5px;
|
|
215
|
+
height: 5px;
|
|
216
|
+
}
|
|
217
|
+
.md-sidebar::-webkit-scrollbar-track {
|
|
218
|
+
background: #eee;
|
|
219
|
+
border: 1 px solid rgb(250, 250, 250);
|
|
220
|
+
box-shadow: 0px 0px 3px #dfdfdf inset;
|
|
221
|
+
border-radius: 3px;
|
|
222
|
+
}
|
|
223
|
+
.md-sidebar::-webkit-scrollbar-thumb {
|
|
224
|
+
width: 5px;
|
|
225
|
+
background: rgb(193, 193, 193);
|
|
226
|
+
border: transparent;
|
|
227
|
+
border-radius: 3px;
|
|
228
|
+
}
|
|
229
|
+
.md-sidebar::-webkit-scrollbar-thumb:hover {
|
|
230
|
+
background: rgb(125, 125, 125);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.md-content {
|
|
234
|
+
max-width: calc(100% - 16rem * 2);
|
|
235
|
+
margin-left: 16rem;
|
|
236
|
+
margin-bottom: 50px;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.md-footer {
|
|
240
|
+
position: fixed;
|
|
241
|
+
bottom: 0px;
|
|
242
|
+
pointer-events: none;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.md-footer-nav__link {
|
|
246
|
+
pointer-events: all;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.md-footer__title {
|
|
250
|
+
background-color: unset;
|
|
251
|
+
}
|
|
252
|
+
.md-footer-nav__link {
|
|
253
|
+
width: 16rem;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.md-dialog {
|
|
257
|
+
background-color: unset;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
@media screen and (min-width: 76.25em) {
|
|
261
|
+
.md-sidebar {
|
|
262
|
+
height: auto;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
@media screen and (max-width: 76.1875em) {
|
|
267
|
+
.md-nav {
|
|
268
|
+
transition: none !important;
|
|
269
|
+
background-color: var(--md-default-bg-color)
|
|
270
|
+
}
|
|
271
|
+
.md-nav--primary .md-nav__title {
|
|
272
|
+
cursor: auto;
|
|
273
|
+
color: var(--md-default-fg-color);
|
|
274
|
+
font-weight: 700;
|
|
275
|
+
white-space: normal;
|
|
276
|
+
line-height: 1rem;
|
|
277
|
+
height: auto;
|
|
278
|
+
display: flex;
|
|
279
|
+
flex-flow: column;
|
|
280
|
+
row-gap: 1.6rem;
|
|
281
|
+
padding: 1.2rem .8rem .8rem;
|
|
282
|
+
background-color: var(--md-default-bg-color);
|
|
283
|
+
}
|
|
284
|
+
.md-nav--primary .md-nav__title~.md-nav__list {
|
|
285
|
+
box-shadow: none;
|
|
286
|
+
}
|
|
287
|
+
.md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
|
|
288
|
+
border-top: none;
|
|
289
|
+
}
|
|
290
|
+
.md-nav--primary .md-nav__title .md-nav__button {
|
|
291
|
+
display: none;
|
|
292
|
+
}
|
|
293
|
+
.md-nav--primary .md-nav__title .md-nav__icon {
|
|
294
|
+
color: var(--md-default-fg-color);
|
|
295
|
+
position: static;
|
|
296
|
+
height: auto;
|
|
297
|
+
margin: 0 0 0 -0.2rem;
|
|
298
|
+
}
|
|
299
|
+
.md-nav--primary > .md-nav__title [for="none"] {
|
|
300
|
+
padding-top: 0;
|
|
301
|
+
}
|
|
302
|
+
.md-nav--primary .md-nav__item {
|
|
303
|
+
border-top: none;
|
|
304
|
+
}
|
|
305
|
+
.md-nav--primary :is(.md-nav__title,.md-nav__item) {
|
|
306
|
+
font-size : var(--md-typeset-font-size);
|
|
307
|
+
}
|
|
308
|
+
.md-nav .md-source {
|
|
309
|
+
display: none;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.md-sidebar {
|
|
313
|
+
height: 100%;
|
|
314
|
+
}
|
|
315
|
+
.md-sidebar--primary {
|
|
316
|
+
width: 12.1rem !important;
|
|
317
|
+
z-index: 200;
|
|
318
|
+
left: ${w.isPinned?`calc(-12.1rem + ${Zt})`:"calc(-12.1rem + 72px)"} !important;
|
|
319
|
+
}
|
|
320
|
+
.md-sidebar--secondary:not([hidden]) {
|
|
321
|
+
display: none;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.md-content {
|
|
325
|
+
max-width: 100%;
|
|
326
|
+
margin-left: 0;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.md-header__button {
|
|
330
|
+
margin: 0.4rem 0;
|
|
331
|
+
margin-left: 0.4rem;
|
|
332
|
+
padding: 0;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.md-overlay {
|
|
336
|
+
left: 0;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.md-footer {
|
|
340
|
+
position: static;
|
|
341
|
+
padding-left: 0;
|
|
342
|
+
}
|
|
343
|
+
.md-footer-nav__link {
|
|
344
|
+
/* footer links begin to overlap at small sizes without setting width */
|
|
345
|
+
width: 50%;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
@media screen and (max-width: 600px) {
|
|
350
|
+
.md-sidebar--primary {
|
|
351
|
+
left: -12.1rem !important;
|
|
352
|
+
width: 12.1rem;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
`;const wt=["h1","h2","h3","h4","h5","h6"];var bt=({theme:g})=>`
|
|
356
|
+
/*================== Typeset ==================*/
|
|
357
|
+
|
|
358
|
+
.md-typeset {
|
|
359
|
+
font-size: var(--md-typeset-font-size);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
${wt.reduce((w,D)=>{var G;const de=(G=g.typography.htmlFontSize)!==null&&G!==void 0?G:16,pe=g.typography[D],{lineHeight:Ee,fontFamily:lt,fontWeight:ct,fontSize:St}=pe,Tt=st=>{let De=1;return typeof st=="number"&&(De=st/de*.6),typeof st=="string"&&(De=st.replace("rem","")),`calc(${De} * var(--md-typeset-font-size))`};return w.concat(`
|
|
363
|
+
.md-typeset ${D} {
|
|
364
|
+
color: var(--md-default-fg-color);
|
|
365
|
+
line-height: ${Ee};
|
|
366
|
+
font-family: ${lt};
|
|
367
|
+
font-weight: ${ct};
|
|
368
|
+
font-size: ${Tt(St)};
|
|
369
|
+
}
|
|
370
|
+
`)},"")}
|
|
371
|
+
|
|
372
|
+
.md-typeset .md-content__button {
|
|
373
|
+
color: var(--md-default-fg-color);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.md-typeset hr {
|
|
377
|
+
border-bottom: 0.05rem dotted ${g.palette.divider};
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.md-typeset details {
|
|
381
|
+
font-size: var(--md-typeset-font-size) !important;
|
|
382
|
+
}
|
|
383
|
+
.md-typeset details summary {
|
|
384
|
+
padding-left: 2.5rem !important;
|
|
385
|
+
}
|
|
386
|
+
.md-typeset details summary:before,
|
|
387
|
+
.md-typeset details summary:after {
|
|
388
|
+
top: 50% !important;
|
|
389
|
+
width: 20px !important;
|
|
390
|
+
height: 20px !important;
|
|
391
|
+
transform: rotate(0deg) translateY(-50%) !important;
|
|
392
|
+
}
|
|
393
|
+
.md-typeset details[open] > summary:after {
|
|
394
|
+
transform: rotate(90deg) translateX(-50%) !important;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.md-typeset blockquote {
|
|
398
|
+
color: var(--md-default-fg-color--light);
|
|
399
|
+
border-left: 0.2rem solid var(--md-default-fg-color--light);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
.md-typeset table:not([class]) {
|
|
403
|
+
font-size: var(--md-typeset-font-size);
|
|
404
|
+
border: 1px solid var(--md-default-fg-color);
|
|
405
|
+
border-bottom: none;
|
|
406
|
+
border-collapse: collapse;
|
|
407
|
+
}
|
|
408
|
+
.md-typeset table:not([class]) th {
|
|
409
|
+
font-weight: bold;
|
|
410
|
+
}
|
|
411
|
+
.md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
|
|
412
|
+
border-bottom: 1px solid var(--md-default-fg-color);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
.md-typeset pre > code::-webkit-scrollbar-thumb {
|
|
416
|
+
background-color: hsla(0, 0%, 0%, 0.32);
|
|
417
|
+
}
|
|
418
|
+
.md-typeset pre > code::-webkit-scrollbar-thumb:hover {
|
|
419
|
+
background-color: hsla(0, 0%, 0%, 0.87);
|
|
420
|
+
}
|
|
421
|
+
`,Pt=()=>`
|
|
422
|
+
/*================== Animations ==================*/
|
|
423
|
+
/*
|
|
424
|
+
Disable CSS animations on link colors as they lead to issues in dark mode.
|
|
425
|
+
The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
|
|
426
|
+
*/
|
|
427
|
+
.md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
|
|
428
|
+
transition: none;
|
|
429
|
+
}
|
|
430
|
+
`,Gt=({theme:g})=>`
|
|
431
|
+
/*================== Extensions ==================*/
|
|
432
|
+
|
|
433
|
+
/* HIGHLIGHT */
|
|
434
|
+
.highlight .md-clipboard:after {
|
|
435
|
+
content: unset;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.highlight .nx {
|
|
439
|
+
color: ${g.palette.type==="dark"?"#ff53a3":"#ec407a"};
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/* CODE HILITE */
|
|
443
|
+
.codehilite .gd {
|
|
444
|
+
background-color: ${g.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
.codehilite .gi {
|
|
448
|
+
background-color: ${g.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/* TABBED */
|
|
452
|
+
.tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
|
|
453
|
+
.tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
|
|
454
|
+
.tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
|
|
455
|
+
.tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
|
|
456
|
+
.tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
|
|
457
|
+
.tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
|
|
458
|
+
.tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
|
|
459
|
+
.tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
|
|
460
|
+
.tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
|
|
461
|
+
.tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
|
|
462
|
+
.tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
|
|
463
|
+
.tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
|
|
464
|
+
.tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
|
|
465
|
+
.tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
|
|
466
|
+
.tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
|
|
467
|
+
.tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
|
|
468
|
+
.tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
|
|
469
|
+
.tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
|
|
470
|
+
.tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
|
|
471
|
+
.tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
|
|
472
|
+
color: var(--md-accent-fg-color);
|
|
473
|
+
border-color: var(--md-accent-fg-color);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
/* TASK-LIST */
|
|
477
|
+
.task-list-control .task-list-indicator::before {
|
|
478
|
+
background-color: ${g.palette.action.disabledBackground};
|
|
479
|
+
}
|
|
480
|
+
.task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
|
|
481
|
+
background-color: ${g.palette.success.main};
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/* ADMONITION */
|
|
485
|
+
.admonition {
|
|
486
|
+
font-size: var(--md-typeset-font-size) !important;
|
|
487
|
+
}
|
|
488
|
+
.admonition .admonition-title {
|
|
489
|
+
padding-left: 2.5rem !important;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
.admonition .admonition-title:before {
|
|
493
|
+
top: 50% !important;
|
|
494
|
+
width: 20px !important;
|
|
495
|
+
height: 20px !important;
|
|
496
|
+
transform: translateY(-50%) !important;
|
|
497
|
+
}
|
|
498
|
+
`;const Yt=[Fe,tt,xt,bt,Pt,Gt],an=()=>(0,S.Pf)(),Mt=()=>{const g=an(),w=(0,Ye.Z)();return(0,n.useMemo)(()=>{const D={theme:w,sidebar:g};return Yt.reduce((G,de)=>G+de(D),"")},[w,g])},hn=()=>{const g=Mt();return(0,n.useCallback)(w=>(w.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${g}</style>`),w),[g])},bn=(g,w,D)=>{const G=g==="src"&&w.endsWith(".svg"),de=!w.match(/^([a-z]*:)?\/\//i),pe=w.startsWith(D);return G&&(de||pe)},Fn=({techdocsStorageApi:g,entityId:w,path:D})=>async G=>{const de=await g.getApiOrigin(),pe=async(Ee,lt)=>{for(const ct of Ee)if(ct.hasAttribute(lt)){const St=ct.getAttribute(lt);if(!St)return;const Tt=await g.getBaseUrl(St,w,D);if(bn(lt,St,de))try{const De=await(await fetch(Tt,{credentials:"include"})).text();ct.setAttribute(lt,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(De)))}`)}catch{ct.setAttribute("alt",`Error: ${St}`)}else ct.setAttribute(lt,Tt)}};return await Promise.all([pe(G.querySelectorAll("img"),"src"),pe(G.querySelectorAll("script"),"src"),pe(G.querySelectorAll("source"),"src"),pe(G.querySelectorAll("link"),"href"),pe(G.querySelectorAll("a[download]"),"href")]),G};var Sn=t(79158),kn=t(67097),En=t(28316),ln=t(82717),tn=t.n(ln);const Un=g=>w=>{var D;const G=w.querySelector('[title="Edit this page"]');if(!G||!G.href)return w;const de=new URL(G.href),pe=g.byUrl(de);if((pe==null?void 0:pe.type)!=="github"&&(pe==null?void 0:pe.type)!=="gitlab")return w;const Ee=((D=w.querySelector("article>h1"))===null||D===void 0?void 0:D.childNodes[0].textContent)||"",lt=encodeURIComponent(`Documentation Feedback: ${Ee}`),ct=encodeURIComponent(`Page source:
|
|
499
|
+
${G.href}
|
|
500
|
+
|
|
501
|
+
Feedback:`),St=(pe==null?void 0:pe.type)==="github"?(0,Sn.BT)(de.href,"blob"):de.href,Tt=tn()(St),st=`/${Tt.organization}/${Tt.name}`,De=G.cloneNode();switch(pe==null?void 0:pe.type){case"gitlab":De.href=`${de.origin}${st}/issues/new?issue[title]=${lt}&issue[description]=${ct}`;break;case"github":De.href=`${de.origin}${st}/issues/new?title=${lt}&body=${ct}`;break;default:return w}return En.render(n.createElement(kn.Z),De),De.style.paddingLeft="5px",De.title="Leave feedback for this page",De.id="git-feedback-link",G==null||G.insertAdjacentElement("beforebegin",De),w};var Mn=t(44882);const On=()=>g=>{const w=g.querySelector('.md-header label[for="__drawer"]'),D=g.querySelector("article");if(!w||!D)return g;const G=w.cloneNode();return En.render(n.createElement(Mn.Z),G),G.id="toggle-sidebar",G.title="Toggle Sidebar",G.classList.add("md-content__button"),G.style.setProperty("padding","0 0 0 5px"),G.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),D==null||D.prepend(G),g},Bn=()=>g=>(((D,G)=>{Array.from(D).filter(de=>de.hasAttribute(G)).forEach(de=>{const pe=de.getAttribute(G);if(pe){pe.match(/^https?:\/\//i)&&de.setAttribute("target","_blank");try{const Ee=pn(window.location.href);de.setAttribute(G,new URL(pe,Ee).toString())}catch{de.replaceWith(de.textContent||pe)}}})})(Array.from(g.getElementsByTagName("a")),"href"),g);function pn(g){const w=new URL(g);return!w.pathname.endsWith("/")&&!w.pathname.endsWith(".html")&&(w.pathname+="/"),w.toString()}const mn=({baseUrl:g,onClick:w})=>D=>(Array.from(D.getElementsByTagName("a")).forEach(G=>{G.addEventListener("click",de=>{const Ee=G.getAttribute("href");!Ee||Ee.startsWith(g)&&!G.hasAttribute("download")&&(de.preventDefault(),w(de,Ee))})}),D);var Hn=t(15459),Cn=t(80030),An=t(72379),ge=t(41547);const re=(0,Hn.Z)(g=>({tooltip:{fontSize:"inherit",color:g.palette.text.primary,margin:0,padding:g.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Cn.ZP),je=()=>(0,h.jsx)(An.Z,{children:(0,h.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),Ze=({text:g})=>{const[w,D]=(0,n.useState)(!1),G=(0,n.useCallback)(()=>{window.navigator.clipboard.writeText(g),D(!0)},[g]),de=(0,n.useCallback)(()=>{D(!1)},[D]);return(0,h.jsx)(re,{title:"Copied to clipboard",placement:"left",open:w,onClose:de,leaveDelay:1e3,children:(0,h.jsx)(oe.Z,{className:"md-clipboard md-icon",onClick:G,children:(0,h.jsx)(je,{})})})},_e=g=>w=>{const D=w.querySelectorAll("pre > code");for(const de of D){var G;const pe=de.textContent||"",Ee=document.createElement("div");de==null||(G=de.parentElement)===null||G===void 0||G.prepend(Ee),En.render((0,h.jsx)(ge.Z,{theme:g,children:(0,h.jsx)(Ze,{text:pe})}),Ee)}return w},pt=()=>g=>{var w;return(w=g.querySelector(".md-header"))===null||w===void 0||w.remove(),g},ue=()=>g=>{var w,D;return(w=g.querySelector(".md-footer .md-copyright"))===null||w===void 0||w.remove(),(D=g.querySelector(".md-footer-copyright"))===null||D===void 0||D.remove(),g},F=({onLoading:g,onLoaded:w})=>D=>(g(),D.addEventListener(m.Ox,function G(){w(),D.removeEventListener(m.Ox,G)}),D),he=()=>g=>(g.addEventListener(m.Ox,function w(){if(window.location.hash){var D;const G=window.location.hash.slice(1);(D=g==null?void 0:g.querySelector(`[id="${G}"]`))===null||D===void 0||D.scrollIntoView()}g.removeEventListener(m.Ox,w)}),g),Re=()=>g=>(setTimeout(()=>{const w=g==null?void 0:g.querySelectorAll("li.md-nav__item--active");w.length!==0&&(w.forEach(G=>{const de=G==null?void 0:G.querySelector("input");de!=null&&de.checked||de==null||de.click()}),w[w.length-1].scrollIntoView())},200),g),et=async(g,w)=>{let D;if(typeof g=="string")D=new DOMParser().parseFromString(g,"text/html").documentElement;else if(g instanceof Element)D=g;else throw new Error("dom is not a recognized type");for(const G of w)D=await G(D);return D},Ue="screen and (max-width: 76.1875em)",Et=g=>{const w=(0,Ge.s0)(),D=(0,Ye.Z)(),G=(0,dt.Z)(Ue),de=Le(),pe=hn(),Ee=(0,z.z$)(),lt=(0,z.h_)(m.Dl),ct=(0,z.h_)(ze.q3),{state:St,path:Tt,content:st}=(0,C.DK)(),[De,ft]=(0,n.useState)(null),It=(0,m.ux)(De),zt=(0,n.useCallback)(()=>{if(!De)return;De.querySelectorAll(".md-sidebar").forEach(nt=>{if(G)nt.style.top="0px";else{const sn=document==null?void 0:document.querySelector(".techdocs-reader-page");var rt;const zn=(rt=sn==null?void 0:sn.getBoundingClientRect().top)!==null&&rt!==void 0?rt:0;var Wt;let Jn=(Wt=De.getBoundingClientRect().top)!==null&&Wt!==void 0?Wt:0;const vn=De.querySelector(".md-container > .md-tabs");var fn;const Wn=(fn=vn==null?void 0:vn.getBoundingClientRect().height)!==null&&fn!==void 0?fn:0;Jn<zn&&(Jn=zn),nt.style.top=`${Math.max(Jn,0)+Wn}px`}nt.style.setProperty("opacity","1")})},[De,G]);(0,n.useEffect)(()=>(window.addEventListener("resize",zt),window.addEventListener("scroll",zt,!0),()=>{window.removeEventListener("resize",zt),window.removeEventListener("scroll",zt,!0)}),[De,zt]);const mt=(0,n.useCallback)(()=>{if(!De)return;const Rt=De.querySelector(".md-footer");Rt&&(Rt.style.width=`${De.getBoundingClientRect().width}px`)},[De]);(0,n.useEffect)(()=>(window.addEventListener("resize",mt),()=>{window.removeEventListener("resize",mt)}),[De,mt]),(0,n.useEffect)(()=>{It||(mt(),zt())},[St,It,mt,zt]);const Dt=(0,n.useCallback)((Rt,nt)=>et(Rt,[de,Fn({techdocsStorageApi:lt,entityId:g,path:nt}),Bn(),On(),pt(),ue(),Un(ct),pe]),[g,ct,lt,de,pe]),Ht=(0,n.useCallback)(async Rt=>et(Rt,[he(),Re(),_e(D),mn({baseUrl:window.location.origin,onClick:(nt,rt)=>{var Wt;const fn=nt.ctrlKey||nt.metaKey,sn=new URL(rt),zn=`${sn.pathname}${sn.search}${sn.hash}`,Jn=((Wt=nt.target)===null||Wt===void 0?void 0:Wt.innerText)||rt,vn=rt.replace(window.location.origin,"");if(Ee.captureEvent("click",Jn,{attributes:{to:vn}}),sn.hash)if(fn)window.open(zn,"_blank");else{var Wn;w(zn),(Wn=Rt==null?void 0:Rt.querySelector(`[id="${sn.hash.slice(1)}"]`))===null||Wn===void 0||Wn.scrollIntoView()}else fn?window.open(zn,"_blank"):w(zn)}}),F({onLoading:()=>{},onLoaded:()=>{var nt;(nt=Rt.querySelector(".md-nav__title"))===null||nt===void 0||nt.removeAttribute("for")}}),F({onLoading:()=>{Array.from(Rt.querySelectorAll(".md-sidebar")).forEach(rt=>{rt.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[D,w,Ee]);return(0,n.useEffect)(()=>{if(!st)return()=>{};let Rt=!0;return Dt(st,Tt).then(async nt=>{if(!(nt!=null&&nt.innerHTML)||!Rt)return;window.scroll({top:0});const rt=await Ht(nt);ft(rt)}),()=>{Rt=!1}},[st,Tt,Dt,Ht]),De};var Vt=t(8560);const Jt=()=>{const g=(0,m.$L)(),{shadowRoot:w}=(0,m.x1)(),D=w==null?void 0:w.querySelector('[data-md-component="content"]'),G=w==null?void 0:w.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let de=G==null?void 0:G.querySelector('[data-techdocs-addons-location="primary sidebar"]');de||(de=document.createElement("div"),de.setAttribute("data-techdocs-addons-location","primary sidebar"),G==null||G.prepend(de));const pe=w==null?void 0:w.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Ee=pe==null?void 0:pe.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Ee||(Ee=document.createElement("div"),Ee.setAttribute("data-techdocs-addons-location","secondary sidebar"),pe==null||pe.prepend(Ee)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Vt.Z,{container:de,children:g.renderComponentsByLocation(m.oZ.PrimarySidebar)}),(0,h.jsx)(Vt.Z,{container:D,children:g.renderComponentsByLocation(m.oZ.Content)}),(0,h.jsx)(Vt.Z,{container:Ee,children:g.renderComponentsByLocation(m.oZ.SecondarySidebar)})]})},Xt=(0,W.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),q=(0,C.m1)(g=>{var w;const{withSearch:D=!0,onReady:G}=g,de=Xt(),{entityMetadata:{value:pe,loading:Ee},entityRef:lt,setShadowRoot:ct}=(0,m.x1)(),St=Et(lt),Tt=(0,n.useCallback)(st=>{ct(st),G instanceof Function&&G()},[ct,G]);return Ee===!1&&!pe?(0,h.jsx)(S.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):St?(0,h.jsx)(S.VY,{children:(0,h.jsxs)(O.Z,{container:!0,children:[(0,h.jsx)(O.Z,{xs:12,item:!0,children:(0,h.jsx)(Se,{})}),D&&(0,h.jsx)(O.Z,{className:de.search,xs:"auto",item:!0,children:(0,h.jsx)(l.S,{entityId:lt,entityTitle:pe==null||(w=pe.metadata)===null||w===void 0?void 0:w.title})}),(0,h.jsx)(O.Z,{xs:12,item:!0,children:(0,h.jsx)(m.VA,{element:St,onAppend:Tt,children:(0,h.jsx)(Jt,{})})})]})}):(0,h.jsx)(S.VY,{children:(0,h.jsx)(O.Z,{container:!0,children:(0,h.jsx)(O.Z,{xs:12,item:!0,children:(0,h.jsx)(Se,{})})})})}),H=null},93225:function(At,Be,t){"use strict";t.d(Be,{S:function(){return ce}});var h=t(52322),n=t(2784),W=t(18671),O=t(60905),m=t(98069),S=t(73250),l=t(61886),P=t(56941),oe=t(25271),_=t(23196),te=t(25248),B=t(76635),I=t(95573);const K=(0,h.jsx)(m.Z,{animation:"wave",variant:"text",height:40}),ce=se=>{const{children:$}=se,T=(0,l.$L)(),z=(0,te.h_)(te.Ds),{title:R,setTitle:C,subtitle:X,setSubtitle:Se,entityRef:Ge,metadata:{value:Ye,loading:dt},entityMetadata:{value:ze,loading:at}}=(0,l.x1)();(0,n.useEffect)(()=>{!Ye||(C(Ye.site_name),Se(()=>{let{site_description:me}=Ye;return(!me||me==="None")&&(me=""),me}))},[Ye,C,Se]);const ot=z.getOptional("app.title")||"Backstage",Ke=[R,X,ot].filter(Boolean).join(" | "),{locationMetadata:Qe,spec:$e}=ze||{},ht=$e==null?void 0:$e.lifecycle,gt=ze?(0,P.hF)(ze,oe.S4):[],Ct=(0,te.tg)(I._Z)(),$t=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(_.i9,{label:(0,B.capitalize)((ze==null?void 0:ze.kind)||"entity"),value:(0,h.jsx)(P.dx,{color:"inherit",entityRef:Ge,title:ze==null?void 0:ze.metadata.title,defaultKind:"Component"})}),gt.length>0&&(0,h.jsx)(_.i9,{label:"Owner",value:(0,h.jsx)(P.rI,{color:"inherit",entityRefs:gt,defaultKind:"group"})}),ht?(0,h.jsx)(_.i9,{label:"Lifecycle",value:ht}):null,Qe&&Qe.type!=="dir"&&Qe.type!=="file"?(0,h.jsx)(_.i9,{label:"",value:(0,h.jsxs)(O.Z,{container:!0,direction:"column",alignItems:"center",style:{color:"#fff"},children:[(0,h.jsx)(O.Z,{style:{padding:0},item:!0,children:(0,h.jsx)(S.Z,{style:{marginTop:"-25px"}})}),(0,h.jsx)(O.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:Qe.target}):null]});return!at&&ze===void 0||!dt&&Ye===void 0?null:(0,h.jsxs)(_.h4,{type:"Documentation",typeLink:Ct,title:R||K,subtitle:X===""?void 0:X||K,children:[(0,h.jsx)(W.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:Ke})}),$t,$,T.renderComponentsByLocation(l.oZ.Header)]})}},65124:function(At,Be,t){"use strict";t.d(Be,{b:function(){return B}});var h=t(52322),n=t(2784),W=t(79692),O=t(15223),m=t(95544),S=t(80030),l=t(61837),P=t(48348),oe=t(47603),_=t(61886);const te=(0,W.Z)(I=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:I.spacing(3,3,0)}})),B=I=>{const K=te(),[ce,se]=(0,n.useState)(null),$=(0,n.useCallback)(Ge=>{se(Ge.currentTarget)},[]),T=(0,n.useCallback)(()=>{se(null)},[]),{entityMetadata:{value:z,loading:R}}=(0,_.x1)(),C=(0,_.$L)(),X=C.renderComponentsByLocation(_.oZ.Subheader),Se=C.renderComponentsByLocation(_.oZ.Settings);return!X&&!Se||R===!1&&!z?null:(0,h.jsx)(O.Z,{classes:K,...I.toolbarProps,children:(0,h.jsxs)(m.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[X,Se?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(S.ZP,{title:"Settings",children:(0,h.jsx)(l.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:$,children:(0,h.jsx)(oe.Z,{})})}),(0,h.jsx)(P.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:ce,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(ce),onClose:T,keepMounted:!0,children:Se})]}):null]})})}},95481:function(At,Be,t){"use strict";t.d(Be,{DK:function(){return B},m1:function(){return K}});var h=t(52322),n=t(2784),W=t(79635),O=t(61886),m=t(25248),S=t(64279),l=t(77446);function P({contentLoading:ce,content:se,activeSyncState:$}){return ce||$==="BUILD_READY_RELOAD"||!se&&$==="CHECKING"?"CHECKING":!se&&$==="BUILDING"?"INITIAL_BUILD":se?$==="BUILDING"?"CONTENT_STALE_REFRESHING":$==="BUILD_READY"?"CONTENT_STALE_READY":$==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function oe(ce,se){const $={...ce};switch(se.type){case"sync":se.state==="CHECKING"&&($.buildLog=[]),$.activeSyncState=se.state,$.syncError=se.syncError;break;case"contentLoading":$.contentLoading=!0,$.contentError=void 0;break;case"content":typeof se.path=="string"&&($.path=se.path),$.contentLoading=!1,$.content=se.content,$.contentError=se.contentError;break;case"buildLog":$.buildLog=$.buildLog.concat(se.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes($.activeSyncState)&&["contentLoading","content"].includes(se.type)&&($.activeSyncState="UP_TO_DATE",$.buildLog=[]),$}function _(ce,se,$,T){var z,R;const[C,X]=(0,n.useReducer)(oe,{activeSyncState:"CHECKING",path:T,contentLoading:!0,buildLog:[]}),Se=(0,m.h_)(O.Dl),{retry:Ge}=(0,l.Z)(async()=>{X({type:"contentLoading"});try{const ze=await Se.getEntityDocs({kind:ce,namespace:se,name:$},T);return X({type:"content",content:ze,path:T}),ze}catch(ze){X({type:"content",contentError:ze,path:T})}},[Se,ce,se,$,T]),Ye=(0,n.useRef)({content:void 0,reload:()=>{}});return Ye.current={content:C.content,reload:Ge},(0,S.default)(async()=>{X({type:"sync",state:"CHECKING"});const ze=setTimeout(()=>{X({type:"sync",state:"BUILDING"})},1e3);try{switch(await Se.syncEntityDocs({kind:ce,namespace:se,name:$},ot=>{X({type:"buildLog",log:ot})})){case"updated":Ye.current.content?X({type:"sync",state:"BUILD_READY"}):(Ye.current.reload(),X({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":X({type:"sync",state:"UP_TO_DATE"});break;default:X({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(at){X({type:"sync",state:"ERROR",syncError:at})}finally{clearTimeout(ze)}},[ce,$,se,Se,X,Ye]),{state:(0,n.useMemo)(()=>P({activeSyncState:C.activeSyncState,contentLoading:C.contentLoading,content:C.content}),[C.activeSyncState,C.content,C.contentLoading]),contentReload:Ge,path:C.path,content:C.content,contentErrorMessage:(z=C.contentError)===null||z===void 0?void 0:z.toString(),syncErrorMessage:(R=C.syncError)===null||R===void 0?void 0:R.toString(),buildLog:C.buildLog}}const te=(0,n.createContext)({}),B=()=>(0,n.useContext)(te),I=({children:ce})=>{const{"*":se=""}=(0,W.UO)(),{entityRef:$}=(0,O.x1)(),{kind:T,namespace:z,name:R}=$,C=_(T,z,R,se);return(0,h.jsx)(te.Provider,{value:C,children:ce instanceof Function?ce(C):ce})},K=ce=>se=>(0,h.jsx)(I,{children:(0,h.jsx)(ce,{...se})})},95573:function(At,Be,t){"use strict";t.d(Be,{Fw:function(){return W},_Z:function(){return n},pd:function(){return O}});var h=t(25248);const n=(0,h.NT)({id:"techdocs:index-page"}),W=(0,h.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),O=(0,h.NT)({id:"techdocs:catalog-reader-view"})},55511:function(At,Be,t){"use strict";t.r(Be),t.d(Be,{TechDocsSearchResultListItem:function(){return _}});var h=t(52322),n=t(2784),W=t(79692),O=t(49378),m=t(86136),S=t(90436),l=t(23196),P=t(15096);const oe=(0,W.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),_=te=>{const{result:B,highlight:I,lineClamp:K=5,asListItem:ce=!0,asLink:se=!0,title:$,icon:T}=te,z=oe(),R=({children:Se})=>se?(0,h.jsx)(l.rU,{noTrack:!0,to:B.location,children:Se}):(0,h.jsx)(h.Fragment,{children:Se}),C=()=>{const Se=I!=null&&I.fields.title?(0,h.jsx)(P.FA,{text:I.fields.title,preTag:I.preTag,postTag:I.postTag}):B.title,Ge=I!=null&&I.fields.entityTitle?(0,h.jsx)(P.FA,{text:I.fields.entityTitle,preTag:I.preTag,postTag:I.postTag}):B.entityTitle,Ye=I!=null&&I.fields.name?(0,h.jsx)(P.FA,{text:I.fields.name,preTag:I.preTag,postTag:I.postTag}):B.name;return B?(0,h.jsx)(O.Z,{className:z.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,h.jsx)(R,{children:$||(0,h.jsxs)(h.Fragment,{children:[Se," | ",Ge!=null?Ge:Ye," docs"]})}),secondary:(0,h.jsx)(S.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:K,overflow:"hidden"},children:I!=null&&I.fields.text?(0,h.jsx)(P.FA,{text:I.fields.text,preTag:I.preTag,postTag:I.postTag}):B.text})}):null},X=({children:Se})=>ce?(0,h.jsxs)(h.Fragment,{children:[T&&(0,h.jsx)(m.Z,{children:T}),(0,h.jsx)("div",{className:z.flexContainer,children:Se})]}):(0,h.jsx)(h.Fragment,{children:Se});return(0,h.jsx)(X,{children:(0,h.jsx)(C,{})})}},22478:function(At,Be,t){"use strict";t.d(Be,{S:function(){return te}});var h=t(52322),n=t(15096),W=t(79692),O=t(27556),m=t(2784),S=t(79635),l=t(55511);const P=(0,W.Z)(B=>({root:{width:"100%"},bar:{padding:B.spacing(1)}})),oe=B=>B==null?void 0:B.document,_=B=>{const{entityId:I,entityTitle:K,debounceTime:ce=150}=B,[se,$]=(0,m.useState)(!1),T=(0,S.s0)(),{setFilters:z,result:{loading:R,value:C}}=(0,n.Rx)(),X=P(),[Se,Ge]=(0,m.useState)([]);(0,m.useEffect)(()=>{let ot=!0;if(ot&&C){const Ke=C.results.slice(0,10);Ge(Ke)}return()=>{ot=!1}},[R,C]);const{kind:Ye,name:dt,namespace:ze}=I;(0,m.useEffect)(()=>{z(ot=>({...ot,kind:Ye,namespace:ze,name:dt}))},[Ye,ze,dt,z]);const at=(ot,Ke)=>{if(oe(Ke)){const{location:Qe}=Ke.document;T(Qe)}};return(0,h.jsx)(O.Z,{className:X.bar,variant:"outlined",children:(0,h.jsx)(n.qO,{classes:{root:X.root},"data-testid":"techdocs-search-bar",size:"small",open:se,getOptionLabel:()=>"",filterOptions:ot=>ot,onClose:()=>{$(!1)},onFocus:()=>{$(!0)},onChange:at,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Se,renderOption:({document:ot,highlight:Ke})=>(0,h.jsx)(l.TechDocsSearchResultListItem,{result:ot,lineClamp:3,asListItem:!1,asLink:!1,title:ot.title,highlight:Ke}),loading:R,inputDebounceTime:ce,inputPlaceholder:`Search ${K||I.name} docs`,freeSolo:!1})})},te=B=>{const I={term:"",types:["techdocs"],pageCursor:"",filters:B.entityId};return(0,h.jsx)(n.Nd,{initialState:I,children:(0,h.jsx)(_,{...B})})}},53260:function(){}},function(At){var Be=function(h){return At(At.s=h)};At.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,5924,4736],function(){return Be(26309)});var t=At.O()}]);})();
|
|
502
|
+
|
|
503
|
+
//# sourceMappingURL=main.a942e8cf.js.map
|