@techdocs/cli 1.4.3-next.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/{migrate-0697fdb4.cjs.js → migrate-32510d4d.cjs.js} +2 -2
- package/dist/cjs/migrate-32510d4d.cjs.js.map +1 -0
- package/dist/cjs/{publish-ac098b56.cjs.js → publish-2c1fe164.cjs.js} +2 -2
- package/dist/cjs/publish-2c1fe164.cjs.js.map +1 -0
- package/dist/embedded-app/.config-schema.json +50 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/main.6328c68d.js +522 -0
- package/dist/embedded-app/static/main.6328c68d.js.map +1 -0
- package/dist/embedded-app/static/{module-octokit.fe13bd50.js → module-octokit.a126d1a6.js} +2 -2
- package/dist/embedded-app/static/{module-octokit.fe13bd50.js.map → module-octokit.a126d1a6.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.f4c9013f.js → runtime.6328c68d.js} +1 -1
- package/dist/embedded-app/static/{runtime.f4c9013f.js.map → runtime.6328c68d.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.f4c9013f.js → vendor.6328c68d.js} +1 -1
- package/dist/embedded-app/static/{vendor.f4c9013f.js.map → vendor.6328c68d.js.map} +1 -1
- package/dist/index.cjs.js +3 -3
- package/package.json +6 -6
- package/dist/cjs/migrate-0697fdb4.cjs.js.map +0 -1
- package/dist/cjs/publish-ac098b56.cjs.js.map +0 -1
- package/dist/embedded-app/static/main.f4c9013f.js +0 -522
- package/dist/embedded-app/static/main.f4c9013f.js.map +0 -1
|
@@ -1,522 +0,0 @@
|
|
|
1
|
-
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{4791:function(Ct,ke,n){"use strict";n.d(ke,{n3:function(){return g},MS:function(){return ge}});var r=n(87612),p=n(25271),W=n(23054),f=n(96279),z=n.n(f);const g=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");function u(de){return!de.cursor}function D(de){return!u(de)}class ge{async getEntityAncestors(V,te){const{kind:L,namespace:A,name:ae}=(0,p.of)(V.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(L)}/${encodeURIComponent(A)}/${encodeURIComponent(ae)}/ancestry`,te)}async getLocationById(V,te){return await this.requestOptional("GET",`/locations/${encodeURIComponent(V)}`,te)}async getEntities(V,te){const{filter:L=[],fields:A=[],order:ae,offset:oe,limit:ie,after:q}=V!=null?V:{},H=this.getParams(L);if(A.length&&H.push(`fields=${A.map(encodeURIComponent).join(",")}`),ae)for(const G of[ae].flat())G&&H.push(`order=${encodeURIComponent(G.order)}:${encodeURIComponent(G.field)}`);oe!==void 0&&H.push(`offset=${oe}`),ie!==void 0&&H.push(`limit=${ie}`),q!==void 0&&H.push(`after=${encodeURIComponent(q)}`);const T=H.length?`?${H.join("&")}`:"",R=await this.requestRequired("GET",`/entities${T}`,te),P=(G,je)=>{var Pe,N;if(((Pe=G.metadata)===null||Pe===void 0?void 0:Pe.name)===void 0||G.kind===void 0||((N=je.metadata)===null||N===void 0?void 0:N.name)===void 0||je.kind===void 0)return 0;const _e=(0,p.eE)(G),at=(0,p.eE)(je);return _e<at?-1:_e>at?1:0};return{items:R.sort(P)}}async getEntitiesByRefs(V,te){var L;const A={entityRefs:V.entityRefs};!((L=V.fields)===null||L===void 0)&&L.length&&(A.fields=V.fields);const oe=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,ie=await this.fetchApi.fetch(oe,{headers:{"Content-Type":"application/json",...(te==null?void 0:te.token)&&{Authorization:`Bearer ${te==null?void 0:te.token}`}},method:"POST",body:JSON.stringify(A)});if(!ie.ok)throw await W.VL.fromResponse(ie);const{items:q}=await ie.json();return{items:q.map(H=>H!=null?H:void 0)}}async queryEntities(V={},te){const L=[];if(u(V)){var A,ae;const{fields:ie=[],filter:q,limit:H,orderFields:T,fullTextFilter:R}=V;L.push(...this.getParams(q)),H!==void 0&&L.push(`limit=${H}`),T!==void 0&&(Array.isArray(T)?T:[T]).forEach(({field:G,order:je})=>L.push(`orderField=${G},${je}`)),ie.length&&L.push(`fields=${ie.map(encodeURIComponent).join(",")}`);const P=R==null||(A=R.term)===null||A===void 0?void 0:A.trim();P&&L.push(`fullTextFilterTerm=${P}`),!(R==null||(ae=R.fields)===null||ae===void 0)&&ae.length&&L.push(`fullTextFilterFields=${R.fields.join(",")}`)}else{const{fields:ie=[],limit:q,cursor:H}=V;L.push(`cursor=${H}`),q!==void 0&&L.push(`limit=${q}`),ie.length&&L.push(`fields=${ie.map(encodeURIComponent).join(",")}`)}const oe=L.length?`?${L.join("&")}`:"";return this.requestRequired("GET",`/entities/by-query${oe}`,te)}async getEntityByRef(V,te){const{kind:L,namespace:A,name:ae}=(0,p.of)(V);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(L)}/${encodeURIComponent(A)}/${encodeURIComponent(ae)}`,te)}async getEntityByName(V,te){const{kind:L,namespace:A="default",name:ae}=V;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(L)}/${encodeURIComponent(A)}/${encodeURIComponent(ae)}`,te)}async refreshEntity(V,te){const L=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(te==null?void 0:te.token)&&{Authorization:`Bearer ${te==null?void 0:te.token}`}},method:"POST",body:JSON.stringify({entityRef:V})});if(L.status!==200)throw new Error(await L.text())}async getEntityFacets(V,te){const{filter:L=[],facets:A}=V,ae=this.getParams(L);for(const ie of A)ae.push(`facet=${encodeURIComponent(ie)}`);const oe=ae.length?`?${ae.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${oe}`,te)}async addLocation(V,te){const{type:L="url",target:A,dryRun:ae}=V,oe=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${ae?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(te==null?void 0:te.token)&&{Authorization:`Bearer ${te==null?void 0:te.token}`}},method:"POST",body:JSON.stringify({type:L,target:A})});if(oe.status!==201)throw new Error(await oe.text());const{location:ie,entities:q,exists:H}=await oe.json();if(!ie)throw new Error(`Location wasn't added: ${A}`);return{location:ie,entities:q,exists:H}}async getLocationByRef(V,te){return(await this.requestRequired("GET","/locations",te)).map(A=>A.data).find(A=>V===(0,p.NZ)(A))}async removeLocationById(V,te){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(V)}`,te)}async removeEntityByUid(V,te){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(V)}`,te)}async validateEntity(V,te,L){const A=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(L==null?void 0:L.token)&&{Authorization:`Bearer ${L==null?void 0:L.token}`}},method:"POST",body:JSON.stringify({entity:V,location:te})});if(A.ok)return{valid:!0};if(A.status!==400)throw await W.VL.fromResponse(A);const{errors:ae=[]}=await A.json();return{valid:!1,errors:ae}}async requestIgnored(V,te,L){const A=`${await this.discoveryApi.getBaseUrl("catalog")}${te}`,ae=L!=null&&L.token?{Authorization:`Bearer ${L.token}`}:{},oe=await this.fetchApi.fetch(A,{method:V,headers:ae});if(!oe.ok)throw await W.VL.fromResponse(oe)}async requestRequired(V,te,L){const A=`${await this.discoveryApi.getBaseUrl("catalog")}${te}`,ae=L!=null&&L.token?{Authorization:`Bearer ${L.token}`}:{},oe=await this.fetchApi.fetch(A,{method:V,headers:ae});if(!oe.ok)throw await W.VL.fromResponse(oe);return oe.json()}async requestOptional(V,te,L){const A=`${await this.discoveryApi.getBaseUrl("catalog")}${te}`,ae=L!=null&&L.token?{Authorization:`Bearer ${L.token}`}:{},oe=await this.fetchApi.fetch(A,{method:V,headers:ae});if(!oe.ok){if(oe.status===404)return;throw await W.VL.fromResponse(oe)}return await oe.json()}getParams(V=[]){const te=[];for(const L of[V].flat()){const A=[];for(const[ae,oe]of Object.entries(L))for(const ie of[oe].flat())ie===g?A.push(encodeURIComponent(ae)):typeof ie=="string"&&A.push(`${encodeURIComponent(ae)}=${encodeURIComponent(ie)}`);A.length&&te.push(`filter=${A.join(",")}`)}return te}constructor(V){(0,r._)(this,"discoveryApi",void 0),(0,r._)(this,"fetchApi",void 0),this.discoveryApi=V.discoveryApi,this.fetchApi=V.fetchApi||{fetch:z()}}}},25271:function(Ct,ke,n){"use strict";n.d(ke,{Tf:function(){return W},P1:function(){return Ln},q1:function(){return Zn},M6:function(){return Se},l2:function(){return p},zG:function(){return r},w$:function(){return rn},nP:function(){return Yt},aS:function(){return sn},S4:function(){return pt},cz:function(){return nt},wI:function(){return je},iB:function(){return Zt},CV:function(){return Ve},of:function(){return Dt},Ou:function(){return Ie},eE:function(){return et},NZ:function(){return Ue}});const r="default",p="backstage.io/view-url",W="backstage.io/edit-url",f="kubernetes.io/api-server",z="kubernetes.io/api-server-certificate-authority",g="kubernetes.io/auth-provider";var u=n(76635),D=n.n(u);class ge{async enforce(U){return U.metadata.namespace?U:lodash.merge({metadata:{namespace:this.namespace}},U)}constructor(U=DEFAULT_NAMESPACE){_define_property(this,"namespace",void 0),this.namespace=U}}class de{static isValidPrefixAndOrSuffix(U,he,$e,Ke){if(typeof U!="string")return!1;const Je=U.split(he);return Je.length===1?Ke(Je[0]):Je.length===2?$e(Je[0])&&Ke(Je[1]):!1}static isJsonSafe(U){try{return D().isEqual(U,JSON.parse(JSON.stringify(U)))}catch{return!1}}static isValidDnsSubdomain(U){return typeof U=="string"&&U.length>=1&&U.length<=253&&U.split(".").every(de.isValidDnsLabel)}static isValidDnsLabel(U){return typeof U=="string"&&U.length>=1&&U.length<=63&&/^[a-z0-9]+(?:\-+[a-z0-9]+)*$/.test(U)}static isValidTag(U){return typeof U=="string"&&U.length>=1&&U.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(U)}static isValidUrl(U){if(typeof U!="string")return!1;try{return new URL(U),!0}catch{return!1}}static isValidString(U){var he;return typeof U=="string"&&((he=U==null?void 0:U.trim())===null||he===void 0?void 0:he.length)>=1}static isNonEmptyString(U){var he;return typeof U=="string"&&((he=U==null?void 0:U.trim())===null||he===void 0?void 0:he.length)>=1}}var V=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityEnvelope","description":"The envelope skeleton parts of an entity - whatever is necessary to be able to give it a ref and pass to further validation / policy checking.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":true,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"type":"object","required":["name"],"additionalProperties":true,"properties":{"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1}}}}}'),te=n(27991),L=n.n(te),A=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"Entity","description":"The parts of the format that's common to all versions/kinds of entity.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":false,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"$ref":"EntityMeta"},"spec":{"type":"object","description":"The specification data describing the entity itself."},"relations":{"type":"array","description":"The relations that this entity has with other entities.","items":{"$ref":"common#relation"}},"status":{"$ref":"common#status"}}}`),ae=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}}}}}}'),oe=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","targetRef"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference","deprecated":true},"targetRef":{"type":"string","minLength":1,"description":"The entity ref of the target of this relation."}}},"status":{"$id":"#status","type":"object","description":"The current status of the entity, as claimed by various sources.","required":[],"additionalProperties":true,"properties":{"items":{"type":"array","items":{"$ref":"#statusItem"}}}},"statusItem":{"$id":"#statusItem","type":"object","description":"A specific status item on a well known format.","required":["type","level","message"],"additionalProperties":true,"properties":{"type":{"type":"string","minLength":1},"level":{"$ref":"#statusLevel","description":"The status level / severity of the status item."},"message":{"type":"string","description":"A brief message describing the status, intended for human consumption."},"error":{"$ref":"#error","description":"An optional serialized error object related to the status."}}},"statusLevel":{"$id":"#statusLevel","type":"string","description":"A status level / severity.","enum":["info","warning","error"]},"error":{"$id":"#error","type":"object","description":"A serialized error object.","required":["name","message"],"additionalProperties":true,"properties":{"name":{"type":"string","examples":["Error","InputError"],"description":"The type name of the error","minLength":1},"message":{"type":"string","description":"The message of the error"},"code":{"type":"string","description":"An error code associated with the error"},"stack":{"type":"string","description":"An error stack trace"}}}}}');const ie=new Map,q=[V,A,ae,oe];function H(le){if(!(le!=null&&le.length))throw new TypeError("Unknown error");const U=le[0];throw new TypeError(`${U.instancePath||"<root>"} ${U.message}${U.params?` - ${Object.entries(U.params).map(([he,$e])=>`${he}: ${$e}`).join(", ")}`:""}`)}function T(le,U={}){var he;const $e=(he=U==null?void 0:U.disableCache)!==null&&he!==void 0?he:!1,Ke=$e?"":JSON.stringify(le);if(!$e){const en=ie.get(Ke);if(en)return en}const Je=R(le),Ft=new(L())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});Je.length&&Ft.addSchema(Je,void 0,void 0,!0);const Vt=Ft.compile(le);return $e||ie.set(Ke,Vt),Vt}function R(le){if(typeof le!="object")return[];const U=new Set;le.$id&&U.add(le.$id);const he=new Array,$e=[le];for(;$e.length;){const Ke=$e.pop();for(const Je of P(Ke))if(!U.has(Je)){U.add(Je);const Ft=q.find(Vt=>Vt.$id===Je);Ft&&(he.push(Ft),$e.push(Ft))}}return he}function*P(le){const U=[le];for(;U.length;){const he=U.pop();if(typeof he=="object"&&he)for(const[$e,Ke]of Object.entries(he))$e==="$ref"&&typeof Ke=="string"?yield Ke.split("#")[0]:U.push(Ke)}}function G(le){const U=compileAjvSchema(le||entityEnvelopeSchema);return he=>{if(U(he)===!0)return he;throw throwAjvError(U.errors)}}function je(le){const U=T(le);return he=>{var $e;if(U(he)===!0)return he;const Je=($e=U.errors)===null||$e===void 0?void 0:$e.filter(Ft=>["/kind","/apiVersion"].includes(Ft.instancePath));if(Je!=null&&Je.length&&Je.every(Ft=>Ft.keyword==="enum"))return!1;throw H(U.errors)}}function Pe(le){const U=compileAjvSchema(le||entitySchema);return he=>{if(U(he)===!0)return he;throw throwAjvError(U.errors)}}class N{static isValidApiVersion(U){return de.isValidPrefixAndOrSuffix(U,"/",de.isValidDnsSubdomain,he=>he.length>=1&&he.length<=63&&/^[a-z0-9A-Z]+$/.test(he))}static isValidKind(U){return typeof U=="string"&&U.length>=1&&U.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(U)}static isValidObjectName(U){return typeof U=="string"&&U.length>=1&&U.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(U)}static isValidNamespace(U){return de.isValidDnsLabel(U)}static isValidLabelKey(U){return de.isValidPrefixAndOrSuffix(U,"/",de.isValidDnsSubdomain,N.isValidObjectName)}static isValidLabelValue(U){return U===""||N.isValidObjectName(U)}static isValidAnnotationKey(U){return de.isValidPrefixAndOrSuffix(U,"/",de.isValidDnsSubdomain,N.isValidObjectName)}static isValidAnnotationValue(U){return typeof U=="string"}}const _e={isValidApiVersion:N.isValidApiVersion,isValidKind:N.isValidKind,isValidEntityName:N.isValidObjectName,isValidNamespace:N.isValidNamespace,isValidLabelKey:N.isValidLabelKey,isValidLabelValue:N.isValidLabelValue,isValidAnnotationKey:N.isValidAnnotationKey,isValidAnnotationValue:N.isValidAnnotationValue,isValidTag:le=>typeof le=="string"&&le.length>=1&&le.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(le)};function at(le={}){return{..._e,...le}}class It{async enforce(U){function he(ee,v,O){if(v==null)throw new Error(`${ee} must have a value`);let J;try{J=O(v)}catch(M){throw new Error(`${ee} could not be validated, ${M}`)}if(!J){let M;switch(O.name){case"isValidLabelValue":case"isValidObjectName":M="a string that is sequences of [a-zA-Z0-9] separated by any of [-_.], at most 63 characters in total";break;case"isValidLabelKey":case"isValidApiVersion":case"isValidAnnotationKey":M="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":M="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":M="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":M="a string";break;case"isValidKind":M="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":M="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":M="a non empty string";break;default:M=void 0;break}const ue=M?` expected ${M} but found "${v}".`:"";throw new Error(`"${ee}" is not valid;${ue} To learn more about catalog file format, visit: https://github.com/backstage/backstage/blob/master/docs/architecture-decisions/adr002-default-catalog-file-format.md`)}}function $e(ee,v,O){return v===void 0||he(ee,v,O)}he("apiVersion",U.apiVersion,this.validators.isValidApiVersion),he("kind",U.kind,this.validators.isValidKind),he("metadata.name",U.metadata.name,this.validators.isValidEntityName),$e("metadata.namespace",U.metadata.namespace,this.validators.isValidNamespace);var Ke;for(const[ee,v]of Object.entries((Ke=U.metadata.labels)!==null&&Ke!==void 0?Ke:[]))he(`labels.${ee}`,ee,this.validators.isValidLabelKey),he(`labels.${ee}`,v,this.validators.isValidLabelValue);var Je;for(const[ee,v]of Object.entries((Je=U.metadata.annotations)!==null&&Je!==void 0?Je:[]))he(`annotations.${ee}`,ee,this.validators.isValidAnnotationKey),he(`annotations.${ee}`,v,this.validators.isValidAnnotationValue);var Ft;const Vt=(Ft=U.metadata.tags)!==null&&Ft!==void 0?Ft:[];for(let ee=0;ee<Vt.length;++ee)he(`tags.${ee}`,Vt[ee],this.validators.isValidTag);var en;const Xt=(en=U.metadata.links)!==null&&en!==void 0?en:[];for(let ee=0;ee<Xt.length;++ee){var tn,_,X;he(`links.${ee}.url`,(tn=Xt[ee])===null||tn===void 0?void 0:tn.url,CommonValidatorFunctions.isValidUrl),$e(`links.${ee}.title`,(_=Xt[ee])===null||_===void 0?void 0:_.title,CommonValidatorFunctions.isNonEmptyString),$e(`links.${ee}.icon`,(X=Xt[ee])===null||X===void 0?void 0:X.icon,KubernetesValidatorFunctions.isValidObjectName)}return U}constructor(U=makeValidator()){_define_property(this,"validators",void 0),this.validators=U}}class zt{async enforce(U){if(!this.validate){const Ke=new Ajv({allowUnionTypes:!0});this.validate=Ke.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(U)===!0)return U;const[$e]=this.validate.errors||[];throw $e?new Error(`Malformed envelope, ${$e.instancePath||"<root>"} ${$e.message}`):new Error("Malformed envelope, Unknown error")}constructor(){_define_property(this,"validate",void 0)}}function xt(le){let U=le.indexOf(":");const he=le.indexOf("/");he!==-1&&he<U&&(U=-1);const $e=U===-1?void 0:le.slice(0,U),Ke=he===-1?void 0:le.slice(U+1,he),Je=le.slice(Math.max(U+1,he+1));if($e===""||Ke===""||Je==="")throw new TypeError(`Entity reference "${le}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:$e,namespace:Ke,name:Je}}function Zt(le){return{kind:le.kind,namespace:le.metadata.namespace||r,name:le.metadata.name}}function Dt(le,U){if(!le)throw new Error("Entity reference must not be empty");const he=U==null?void 0:U.defaultKind,$e=(U==null?void 0:U.defaultNamespace)||r;let Ke,Je,Ft;if(typeof le=="string"){const _=xt(le);var Vt;Ke=(Vt=_.kind)!==null&&Vt!==void 0?Vt:he;var en;Je=(en=_.namespace)!==null&&en!==void 0?en:$e,Ft=_.name}else{var Xt;Ke=(Xt=le.kind)!==null&&Xt!==void 0?Xt:he;var tn;Je=(tn=le.namespace)!==null&&tn!==void 0?tn:$e,Ft=le.name}if(Ke)if(Je){if(!Ft){const _=JSON.stringify(le);throw new Error(`Entity reference ${_} had missing or empty name`)}}else{const _=JSON.stringify(le);throw new Error(`Entity reference ${_} had missing or empty namespace`)}else{const _=JSON.stringify(le);throw new Error(`Entity reference ${_} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:Ke,namespace:Je,name:Ft}}function et(le){let U,he,$e;if("metadata"in le){U=le.kind;var Ke;he=(Ke=le.metadata.namespace)!==null&&Ke!==void 0?Ke:r,$e=le.metadata.name}else{U=le.kind;var Je;he=(Je=le.namespace)!==null&&Je!==void 0?Je:r,$e=le.name}return`${U.toLocaleLowerCase("en-US")}:${he.toLocaleLowerCase("en-US")}/${$e.toLocaleLowerCase("en-US")}`}var lt=n(87612);class yt{async enforce(U){let he=U;for(const $e of this.policies){const Ke=await $e.enforce(he);if(!Ke)throw new Error(`Policy ${$e.constructor.name} did not return a result`);he=Ke}return he}constructor(U){(0,lt._)(this,"policies",void 0),this.policies=U}}class At{async enforce(U){for(const he of this.policies){const $e=await he.enforce(U);if($e)return $e}throw new Error("The entity did not match any known policy")}constructor(U){(0,lt._)(this,"policies",void 0),this.policies=U}}const $t={allOf(le){return new yt(le)},oneOf(le){return new At(le)}};var Gt=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ApiV1alpha1","description":"An API describes an interface that can be exposed by a component. The API can be defined in different formats, like OpenAPI, AsyncAPI, GraphQL, gRPC, or other formats.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"API","metadata":{"name":"artist-api","description":"Retrieve artist details","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"openapi","lifecycle":"production","owner":"artist-relations-team","system":"artist-engagement-portal","definition":"openapi: \\"3.0.0\\"\\ninfo:..."}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["API"]},"spec":{"type":"object","required":["type","lifecycle","owner","definition"],"properties":{"type":{"type":"string","description":"The type of the API definition.","examples":["openapi","asyncapi","graphql","grpc","trpc"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the API.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the API.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the API belongs to.","minLength":1},"definition":{"type":"string","description":"The definition of the API, based on the format defined by the type.","minLength":1}}}}}]}');function xe(le){let U;return{async check(he){return U||(U=je(le)),U(he)===he}}}const Ce=xe(Gt);var Ye=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ComponentV1alpha1","description":"A Component describes a software component. It is typically intimately linked to the source code that constitutes the component, and should be what a developer may regard a \\"unit of software\\", usually with a distinct deployable or linkable artifact.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Component"]},"spec":{"type":"object","required":["type","lifecycle","owner"],"properties":{"type":{"type":"string","description":"The type of component.","examples":["service","website","library"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the component.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the component belongs to.","minLength":1},"subcomponentOf":{"type":"string","description":"An entity reference to another component of which the component is a part.","minLength":1},"providesApis":{"type":"array","description":"An array of entity references to the APIs that are provided by the component.","items":{"type":"string","minLength":1}},"consumesApis":{"type":"array","description":"An array of entity references to the APIs that are consumed by the component.","items":{"type":"string","minLength":1}},"dependsOn":{"type":"array","description":"An array of references to other entities that the component depends on to function.","items":{"type":"string","minLength":1}}}}}}]}');const Le=xe(Ye);var ct=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 wt=xe(ct);var dt=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 Qe=xe(dt);var Ge=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"LocationV1alpha1","description":"A location is a marker that references other places to look for catalog data.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Location","metadata":{"name":"org-data"},"spec":{"type":"url","targets":["http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-consultants.yaml"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Location"]},"spec":{"type":"object","required":[],"properties":{"type":{"type":"string","description":"The single location type, that's common to the targets specified in the spec. If it is left out, it is inherited from the location type that originally read the entity data.","examples":["url"],"minLength":1},"target":{"type":"string","description":"A single target as a string. Can be either an absolute path/URL (depending on the type), or a relative path such as ./details/catalog-info.yaml which is resolved relative to the location of this Location entity itself.","examples":["./details/catalog-info.yaml"],"minLength":1},"targets":{"type":"array","description":"A list of targets as strings. They can all be either absolute paths/URLs (depending on the type), or relative paths such as ./details/catalog-info.yaml which are resolved relative to the location of this Location entity itself.","items":{"type":"string","examples":["./details/catalog-info.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml"],"minLength":1}},"presence":{"type":"string","description":"Whether the presence of the location target is required and it should be considered an error if it can not be found","default":"required","examples":["required"],"enum":["required","optional"]}}}}}]}`);const ut=xe(Ge),pt="ownedBy",hn="ownerOf",pn="consumesApi",fn="apiConsumedBy",_t="providesApi",Sn="apiProvidedBy",Yt="dependsOn",rn="dependencyOf",jn="parentOf",on="childOf",En="memberOf",Fn="hasMember",nt="partOf",sn="hasPart";var Jt=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ResourceV1alpha1","description":"A resource describes the infrastructure a system needs to operate, like BigTable databases, Pub/Sub topics, S3 buckets or CDNs. Modelling them together with components and systems allows to visualize resource footprint, and create tooling around them.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Resource","metadata":{"name":"artists-db","description":"Stores artist details"},"spec":{"type":"database","owner":"artist-relations-team","system":"artist-engagement-portal"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Resource"]},"spec":{"type":"object","required":["type","owner"],"properties":{"type":{"type":"string","description":"The type of resource.","examples":["database","s3-bucket","cluster"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the resource.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"dependsOn":{"type":"array","description":"An array of references to other entities that the resource depends on to function.","items":{"type":"string","minLength":1}},"system":{"type":"string","description":"An entity reference to the system that the resource belongs to.","minLength":1}}}}}]}');const rt=xe(Jt);var In=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"SystemV1alpha1","description":"A system is a collection of resources and components. The system may expose or consume one or several APIs. It is viewed as abstraction level that provides potential consumers insights into exposed features without needing a too detailed view into the details of all components. This also gives the owning team the possibility to decide about published artifacts and APIs.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"System","metadata":{"name":"artist-engagement-portal","description":"Handy tools to keep artists in the loop"},"spec":{"owner":"artist-relations-team","domain":"artists"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["System"]},"spec":{"type":"object","required":["owner"],"properties":{"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"domain":{"type":"string","description":"An entity reference to the domain that the system belongs to.","examples":["artists"],"minLength":1}}}}}]}');const Qt=xe(In);var Pn=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"UserV1alpha1","description":"A user describes a person, such as an employee, a contractor, or similar. Users belong to Group entities in the catalog. These catalog user entries are connected to the way that authentication within the Backstage ecosystem works. See the auth section of the docs for a discussion of these concepts.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"User","metadata":{"name":"jdoe"},"spec":{"profile":{"displayName":"Jenny Doe","email":"jenny-doe@example.com","picture":"https://example.com/staff/jenny-with-party-hat.jpeg"},"memberOf":["team-b","employees"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["User"]},"spec":{"type":"object","required":["memberOf"],"properties":{"profile":{"type":"object","description":"Optional profile information about the user, mainly for display purposes. All fields of this structure are also optional. The email would be a primary email of some form, that the user may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the user, and that a browser could fetch and render on a profile page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Jenny Doe"],"minLength":1},"email":{"type":"string","description":"An email where this user can be reached.","examples":["jenny-doe@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this user.","examples":["https://example.com/staff/jenny-with-party-hat.jpeg"],"minLength":1}}},"memberOf":{"type":"array","description":"The list of groups that the user is a direct member of (i.e., no transitive memberships are listed here). The list must be present, but may be empty if the user is not member of any groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["team-b","employees"],"minLength":1}}}}}}]}`);const Nn=xe(Pn),Ln="backstage.io/managed-by-location",Zn="backstage.io/managed-by-origin-location",Se="backstage.io/source-location",ce=/^[\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 Ie(le){if(typeof le!="string")throw new TypeError(`Unable to parse location ref '${le}', unexpected argument ${typeof le}`);const U=le.indexOf(":");if(U<0)throw new TypeError(`Unable to parse location ref '${le}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const he=le.substring(0,U).trim(),$e=le.substring(U+1).trim();if(!he||!$e)throw new TypeError(`Unable to parse location ref '${le}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(he==="http"||he==="https")throw new TypeError(`Invalid location ref '${le}', please prefix it with 'url:', e.g. 'url:${le}'`);if(ce.test($e))throw new TypeError(`Invalid location ref '${le}', target is a javascript: URL`);return{type:he,target:$e}}function Ue(le){const{type:U,target:he}=le;if(U){if(!he)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");if(ce.test(he))throw new TypeError(`Invalid location ref '${U}:${he}', target is a javascript: URL`);return`${U}:${he}`}function Ve(le){var U,he,$e,Ke,Je;const Ft=(Je=(U=le.metadata)===null||U===void 0||(he=U.annotations)===null||he===void 0?void 0:he[Se])!==null&&Je!==void 0?Je:($e=le.metadata)===null||$e===void 0||(Ke=$e.annotations)===null||Ke===void 0?void 0:Ke[Ln];if(!Ft)throw new Error(`Entity '${et(le)}' is missing location`);return Ie(Ft)}},15332:function(Ct,ke,n){"use strict";n.d(ke,{r:function(){return R}});var r=n(52322),p=n(60871),W=n(86689),f=n(79692),z=n(90436),g=n(72779),u=n.n(g),D=n(76635),ge=n(2784),de=n(73557),V=n(71597);function te(){const[P]=(0,de.is)((0,r.jsx)(de.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!P.index}const L=(0,f.Z)({visuallyHidden:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",height:1,width:1},externalLink:{position:"relative"}},{name:"Link"}),A=P=>/^([a-z+.-]+):/.test(P),ae=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i,oe=window.open;if(oe&&!oe.__backstage){const P=function(...je){const Pe=String(je[0]);if(ae.test(Pe))throw new Error("Rejected window.open() with a javascript: URL as a security precaution");return oe.apply(this,je)};P.__backstage=!0,window.open=P}const ie=()=>{try{return(0,p.h_)(p.Ds).getOptionalString("app.baseUrl")}catch{return}},q=()=>{const P="http://sample.dev";var G;const je=(G=ie())!==null&&G!==void 0?G:"/",{pathname:Pe}=new URL(je,P);return(0,D.trimEnd)(Pe,"/")},H=P=>{let G=String(P);const je=q(),Pe=A(G),N=G.startsWith(je);return!Pe&&!N&&(G=je.concat(G)),G},T=P=>{if(P instanceof Array)return P.map(T).join(" ").trim();if(typeof P=="object"&&P){var G;return T(P==null||(G=P.props)===null||G===void 0?void 0:G.children)}return["string","number"].includes(typeof P)?String(P):""},R=ge.forwardRef(({onClick:P,noTrack:G,...je},Pe)=>{const N=L(),_e=(0,p.z$)(),at=te()?H(je.to):je.to,It=T(je.children)||at,zt=A(at),xt=zt&&!!/^https?:/.exec(at);if(ae.test(at))throw new Error("Link component rejected javascript: URL as a security precaution");const Zt=Dt=>{P==null||P(Dt),G||_e.captureEvent("click",It,{attributes:{to:at}})};return zt?(0,r.jsxs)(W.Z,{...xt?{target:"_blank",rel:"noopener"}:{},...je,...je["aria-label"]?{"aria-label":`${je["aria-label"]}, Opens in a new window`}:{},ref:Pe,href:at,onClick:Zt,className:u()(N.externalLink,je.className),children:[je.children,(0,r.jsx)(z.Z,{component:"span",className:N.visuallyHidden,children:", Opens in a new window"})]}):(0,r.jsx)(W.Z,{...je,ref:Pe,component:V.rU,to:at,onClick:Zt})})},53974:function(Ct,ke,n){"use strict";n.d(ke,{Oi:function(){return je},VY:function(){return Js},yW:function(){return Xi},XF:function(){return at},mn:function(){return rn},NX:function(){return yt},ub:function(){return ce},mf:function(){return Ja},yu:function(){return st},h4:function(){return Oa},M6:function(){return Zr},i9:function(){return il},aR:function(){return Qs},rJ:function(){return lr},Oh:function(){return hl},hu:function(){return cl},rU:function(){return de.r},Qj:function(){return te},nU:function(){return Xe},SA:function(){return mo},sk:function(){return Je},Or:function(){return Or},T3:function(){return ka},g9:function(){return gl},Ex:function(){return to},Gk:function(){return qt},tn:function(){return Xs},Ph:function(){return bo},YE:function(){return Ei},v7:function(){return Aa},R6:function(){return ki},tR:function(){return wi},uw:function(){return Vi},qt:function(){return hi},iA:function(){return Wt},GB:function(){return ht},po:function(){return br},mZ:function(){return ts},Pf:function(){return Eo}});var r=n(52322),p=n(60871),W=n(19928),f=n(2784);function z(e){const[o,l]=useState([]),d=useApi(alertApiRef),{anchorOrigin:m={vertical:"top",horizontal:"center"},transientTimeoutMs:x}=e,I=x!=null?x:5e3;useEffect(()=>{const Z=d.alert$().subscribe(fe=>l(pe=>pe.concat(fe)));return()=>{Z.unsubscribe()}},[d]);const[$]=o;if(useEffect(()=>{if($&&$.display==="transient"){const Z=setTimeout(()=>{l(fe=>{const pe=fe.filter(Te=>Te!==$);return pe.length===fe.length?fe:pe})},I);return()=>clearTimeout(Z)}},[$,I]),o.length===0)return null;const Y=()=>{l(Z=>Z.filter(fe=>fe!==$))};return _jsx(Snackbar,{open:!0,anchorOrigin:m,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:Y,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:$.severity,children:_jsxs(Typography,{component:"span",children:[String($.message),o.length>1&&_jsx("em",{children:` (${o.length-1} older ${pluralize("message",o.length-1)})`})]})})})}var g=n(79692);const u=(0,g.Z)(e=>({avatar:{width:"4rem",height:"4rem",color:e.palette.common.white},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function D(e){const{displayName:o,picture:l,customStyles:d}=e,m=u();let x={...d};const I={fontFamily:x.fontFamily,fontSize:x.fontSize,fontWeight:x.fontWeight};return l||(x={backgroundColor:stringToColor(o||""),...d}),_jsx(MaterialAvatar,{alt:o,src:l,className:m.avatar,style:x,children:o&&_jsx(Typography,{variant:"h6",component:"span",className:m.avatarText,style:I,children:extractInitials(o)})})}var ge=n(77277),de=n(15332);const V=f.forwardRef((e,o)=>(0,r.jsx)(de.r,{ref:o,...e,color:"initial"})),te=f.forwardRef((e,o)=>(0,r.jsx)(ge.Z,{ref:o,component:V,...e})),L=null;var A=n(95544),ae=n(60364),oe=n(83229),ie=n(26639),q=n(39595),H=n(61837),T=n(80030),R=n(19353),P=n(95074);function G(e){const{text:o,tooltipDelay:l=1e3,tooltipText:d="Text copied to clipboard","aria-label":m="Copy text"}=e,x=(0,p.h_)(p.VE),[I,$]=(0,f.useState)(!1),[{error:Y},Z]=(0,P.Z)();(0,f.useEffect)(()=>{Y&&x.post(Y)},[Y,x]);const fe=pe=>{pe.stopPropagation(),$(!0),Z(o)};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(T.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:l,onClose:()=>$(!1),open:I,children:(0,r.jsx)(H.Z,{onClick:fe,"aria-label":m,children:(0,r.jsx)(R.Z,{})})})})}function je(e){const{text:o,language:l,showLineNumbers:d=!1,highlightedNumbers:m,customStyle:x,showCopyCodeButton:I=!1}=e,$=(0,ae.Z)(),Y=$.palette.type==="dark"?ie.Z:q.Z,Z=$.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,r.jsxs)(A.Z,{position:"relative",children:[(0,r.jsx)(oe.Z,{customStyle:x,language:l,style:Y,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:$.palette.textVerySubtle},lineProps:fe=>m!=null&&m.includes(fe)?{style:{backgroundColor:Z}}:{},children:o}),I&&(0,r.jsx)(A.Z,{position:"absolute",top:0,right:0,children:(0,r.jsx)(G,{text:o})})]})}var Pe=n(41156),N=n(71597),_e=n(88188);function at(e){const{title:o,to:l}=e,d=(0,Pe.Z)(m=>m.breakpoints.down("xs"));return l?d?(0,r.jsx)(H.Z,{component:N.rU,color:"primary",title:o,size:"small",to:l,children:(0,r.jsx)(_e.Z,{})}):(0,r.jsx)(ge.Z,{component:N.rU,variant:"contained",color:"primary",to:l,children:o}):null}var It=n(27397),zt=n(11105),xt=n(97963),Zt=n(46506),Dt=n.n(Zt),et=n(54073),lt=n.n(et),yt;(function(e){let o;(function(x){x.TOP_BOTTOM="TB",x.BOTTOM_TOP="BT",x.LEFT_RIGHT="LR",x.RIGHT_LEFT="RL"})(o=e.Direction||(e.Direction={}));let l;(function(x){x.UP_LEFT="UL",x.UP_RIGHT="UR",x.DOWN_LEFT="DL",x.DOWN_RIGHT="DR"})(l=e.Alignment||(e.Alignment={}));let d;(function(x){x.NETWORK_SIMPLEX="network-simplex",x.TIGHT_TREE="tight-tree",x.LONGEST_PATH="longest-path"})(d=e.Ranker||(e.Ranker={}));let m;(function(x){x.LEFT="l",x.RIGHT="r",x.CENTER="c"})(m=e.LabelPosition||(e.LabelPosition={}))})(yt||(yt={}));var At=n(10368);const $t=(0,g.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function Gt({node:{id:e}}){const o=$t(),[l,d]=f.useState(0),[m,x]=f.useState(0),I=f.useRef(null);f.useLayoutEffect(()=>{if(I.current){let{height:fe,width:pe}=I.current.getBBox();fe=Math.round(fe),pe=Math.round(pe),(fe!==m||pe!==l)&&(d(pe),x(fe))}},[l,m]);const $=10,Y=l+$*2,Z=m+$*2;return(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{className:o.node,width:Y,height:Z,rx:10}),(0,r.jsx)("text",{ref:I,className:o.text,y:Z/2,x:Y/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const xe="arrow-marker",Ce="node",Ye="edge",Le="label",ct=(0,At.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),wt=e=>(0,r.jsx)(Gt,{...e});function dt({render:e=wt,setNode:o,node:l}){const{width:d,height:m,x=0,y:I=0}=l,$=l,Y=ct(),Z=f.useRef(null);return f.useLayoutEffect(()=>{if(Z.current){let{height:fe,width:pe}=Z.current.getBBox();fe=Math.round(fe),pe=Math.round(pe),(fe!==m||pe!==d)&&o(l.id,{...l,height:fe,width:pe})}},[l,d,m,o]),(0,r.jsx)("g",{ref:Z,"data-testid":Ce,className:Y.node,transform:`translate(${x-d/2},${I-m/2})`,children:e({node:$})})}var Qe=n(76985),Ge=n(39829),ut=n(19574),pt=n.n(ut);const hn=(0,At.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function pn({edge:{label:e}}){const o=hn();return(0,r.jsx)("text",{className:o.text,textAnchor:"middle",children:e})}const fn=(0,At.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"}),_t=e=>(0,r.jsx)(pn,{...e});function Sn({render:e=_t,setEdge:o,id:l,edge:d,curve:m}){const{x=0,y:I=0,width:$,height:Y,points:Z}=d,fe=d,pe=fn(),Te=f.useRef(null);f.useLayoutEffect(()=>{if(Te.current){let{height:it,width:Pt}=Te.current.getBBox();it=Math.round(it),Pt=Math.round(Pt),(it!==Y||Pt!==$)&&o(l,{...d,height:it,width:Pt})}},[d,Y,$,o,l]);let Ee="";const Ze=f.useMemo(()=>Qe.Z().x(it=>it.x).y(it=>it.y).curve(Ge[m]),[m]);if(Z){const it=Z.filter(Pt=>pt()(Pt.x)&&pt()(Pt.y));Ee=Ze(it)||""}return(0,r.jsxs)(r.Fragment,{children:[Ee&&(0,r.jsx)("path",{"data-testid":Ye,className:pe.path,d:Ee}),fe.label?(0,r.jsx)("g",{ref:Te,"data-testid":Le,className:pe.label,transform:`translate(${x},${I})`,children:e({edge:fe})}):null]})}const Yt="workspace";function rn(e){var o,l;const{edges:d,nodes:m,renderNode:x,direction:I=yt.Direction.TOP_BOTTOM,align:$,nodeMargin:Y=50,edgeMargin:Z=10,rankMargin:fe=50,paddingX:pe=0,paddingY:Te=0,acyclicer:Ee,ranker:Ze=yt.Ranker.NETWORK_SIMPLEX,labelPosition:it=yt.LabelPosition.RIGHT,labelOffset:Pt=10,edgeRanks:mn=1,edgeWeight:$n=1,renderLabel:or,defs:Bt,zoom:vn="enabled",curve:yn="curveMonotoneX",fit:gr="grow",...wr}=e,jr=(0,xt.Z)(),[Er,ms]=f.useState(100),[Xr,oa]=f.useState(100),un=f.useRef(new(Dt()).graphlib.Graph),[Po,ti]=f.useState(((o=un.current.graph())===null||o===void 0?void 0:o.width)||0),[qr,sa]=f.useState(((l=un.current.graph())===null||l===void 0?void 0:l.height)||0),[Vn,Lr]=f.useState([]),[po,fo]=f.useState([]),An=Math.max(Po,Er),kn=Math.max(qr,Xr),Lo=Math.min(qr,Xr),go=gr==="grow"?kn:Lo,vs=f.useMemo(()=>lt()(Rn=>{if(!Rn)return;const Hn=zt.Z(Rn),Tn=zt.Z(Rn.getElementById(Yt));function Ar(){Hn.call(It.sP().scaleExtent([1,10]).on("zoom",Fr=>{Fr.transform.x=Math.min(0,Math.max(Fr.transform.x,An-An*Fr.transform.k)),Fr.transform.y=Math.min(0,Math.max(Fr.transform.y,kn-kn*Fr.transform.k)),Tn.attr("transform",Fr.transform)}))}vn==="enabled"?Ar():vn==="enable-on-click"&&Hn.on("click",()=>Ar());const{width:Tr,height:ni}=Rn.getBoundingClientRect();Er!==Tr&&ms(Tr),Xr!==ni&&oa(ni)},100),[Xr,Er,An,kn,vn]),Ua=f.useCallback(()=>{const Rn=un.current.nodes(),Hn=un.current.edges();Rn.forEach(Tn=>{m.some(Tr=>Tr.id===Tn)||un.current.removeNode(Tn)}),Hn.forEach(Tn=>{d.some(Tr=>Tr.from===Tn.v&&Tr.to===Tn.w)||un.current.removeEdge(Tn.v,Tn.w)}),m.forEach(Tn=>{const Ar=un.current.nodes().find(Tr=>Tn.id===Tr);if(Ar&&un.current.node(Ar)){const{width:Tr,height:ni,x:Fr,y:Bl}=un.current.node(Ar);un.current.setNode(Ar,{...Tn,width:Tr,height:ni,x:Fr,y:Bl})}else un.current.setNode(Tn.id,{...Tn,width:0,height:0})}),d.forEach(Tn=>{un.current.setEdge(Tn.from,Tn.to,{...Tn,label:Tn.label,width:0,height:0,labelpos:it,labeloffset:Pt,weight:$n,minlen:mn})})},[d,m,it,Pt,$n,mn]),ys=f.useMemo(()=>lt()(()=>{Dt().layout(un.current);const{height:Rn,width:Hn}=un.current.graph(),Tn=Math.max(0,Rn||0),Ar=Math.max(0,Hn||0);ti(Ar),sa(Tn),Lr(un.current.nodes()),fo(un.current.edges())},250,{leading:!0}),[]);f.useEffect(()=>(un.current.setGraph({rankdir:I,align:$,nodesep:Y,edgesep:Z,ranksep:fe,marginx:pe,marginy:Te,acyclicer:Ee,ranker:Ze}),Ua(),ys(),ys.cancel),[Ee,$,I,Z,pe,Te,Y,fe,Ze,Ua,ys]);function Ol(Rn,Hn){return un.current.setNode(Rn,Hn),ys(),un.current}function kl(Rn,Hn){return un.current.setEdge(Rn,Hn),ys(),un.current}return(0,r.jsxs)("svg",{ref:vs,...wr,width:"100%",height:go,viewBox:`0 0 ${An} ${kn}`,children:[(0,r.jsxs)("defs",{children:[(0,r.jsx)("marker",{id:xe,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{fill:jr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),Bt]}),(0,r.jsx)("g",{id:Yt,children:(0,r.jsxs)("svg",{width:Po,height:qr,y:kn/2-qr/2,x:An/2-Po/2,viewBox:`0 0 ${Po} ${qr}`,children:[po.map(Rn=>{const Hn=un.current.edge(Rn);return Hn?(0,r.jsx)(Sn,{id:Rn,setEdge:kl,render:or,edge:Hn,curve:yn},`${Rn.v}-${Rn.w}`):null}),Vn.map(Rn=>{const Hn=un.current.node(Rn);return Hn?(0,r.jsx)(dt,{setNode:Ol,render:x,node:Hn},Rn):null})]})})]})}var jn=n(72779),on=n.n(jn),En,Fn;const nt=(0,g.Z)(e=>({root:{padding:e.spacing(0),marginBottom:e.spacing(0),marginTop:e.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:e.spacing(6),marginTop:-e.spacing(3),zIndex:"unset"},icon:{fontSize:e.typography.h6.fontSize},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap",color:e.palette.banner.text},message:{display:"flex",alignItems:"center","& a":{color:e.palette.banner.link}},button:{color:(En=e.palette.banner.closeButtonColor)!==null&&En!==void 0?En:"inherit"},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(Fn=e.palette.banner.warning)!==null&&Fn!==void 0?Fn:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),sn=e=>{const{variant:o,message:l,id:d,fixed:m=!1}=e,x=nt(),$=useApi(storageApiRef).forBucket("notifications");var Y;const Z=(Y=$.snapshot("dismissedBanners").value)!==null&&Y!==void 0?Y:[],[fe,pe]=useState(new Set(Z)),Te=useObservable($.observe$("dismissedBanners"));useEffect(()=>{if(Te!=null&&Te.value){var Ze;const it=(Ze=Te==null?void 0:Te.value)!==null&&Ze!==void 0?Ze:[];pe(new Set(it))}},[Te==null?void 0:Te.value]);const Ee=()=>{$.set("dismissedBanners",[...fe,d])};return _jsx(Snackbar,{anchorOrigin:m?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!fe.has(d),classes:{root:classNames(x.root,!m&&x.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(x.content,x[o]),message:x.message},message:l,action:[_jsx(IconButton,{title:"Permanently dismiss this message",className:x.button,onClick:Ee,children:_jsx(Close,{className:x.icon})},"dismiss")]})})};var Jt=n(60905),rt=n(90436),In=n.p+"static/missingAnnotation.67f79e98..svg",Qt=n.p+"static/noInformation.4b426325..svg",Pn=n.p+"static/createComponent.975d1e1e..svg",Nn=n.p+"static/noBuild.1715fa71..svg";const Ln=(0,g.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),Zn=({missing:e})=>{const o=Ln();switch(e){case"field":return(0,r.jsx)("img",{src:In,className:o.generalImg,alt:"annotation is missing"});case"info":return(0,r.jsx)("img",{src:Qt,alt:"no Information",className:o.generalImg});case"content":return(0,r.jsx)("img",{src:Pn,alt:"create Component",className:o.generalImg});case"data":return(0,r.jsx)("img",{src:Nn,alt:"no Build",className:o.generalImg});default:return null}},Se=(0,g.Z)(e=>({root:{backgroundColor:e.palette.background.default,padding:e.spacing(2,0,0,0)},action:{marginTop:e.spacing(2)},imageContainer:{position:"relative"}}),{name:"BackstageEmptyState"});function ce(e){const{title:o,description:l,missing:d,action:m}=e,x=Se();return(0,r.jsxs)(Jt.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:x.root,spacing:2,children:[(0,r.jsx)(Jt.Z,{item:!0,xs:12,md:6,children:(0,r.jsxs)(Jt.Z,{container:!0,direction:"column",children:[(0,r.jsx)(Jt.Z,{item:!0,xs:!0,children:(0,r.jsx)(rt.Z,{variant:"h5",children:o})}),(0,r.jsx)(Jt.Z,{item:!0,xs:!0,children:(0,r.jsx)(rt.Z,{variant:"body1",children:l})}),(0,r.jsx)(Jt.Z,{item:!0,xs:!0,className:x.action,children:m})]})}),(0,r.jsx)(Jt.Z,{item:!0,xs:12,md:6,className:x.imageContainer,children:typeof d=="string"?(0,r.jsx)(Zn,{missing:d}):d.customImage})]})}const Ie=`apiVersion: backstage.io/v1alpha1
|
|
2
|
-
kind: Component
|
|
3
|
-
metadata:
|
|
4
|
-
name: example
|
|
5
|
-
description: example.com
|
|
6
|
-
annotations:
|
|
7
|
-
ANNOTATION: value
|
|
8
|
-
spec:
|
|
9
|
-
type: website
|
|
10
|
-
lifecycle: production
|
|
11
|
-
owner: user:guest`,Ue=/^.*ANNOTATION.*$/m,Ve=Ie.match(Ue)[0],le=Ie.split(`
|
|
12
|
-
`).findIndex(e=>Ue.test(e)),U=(0,g.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":e.palette.common.white}}),{name:"BackstageMissingAnnotationEmptyState"});function he(e){return Array.from(Array(e+1).keys(),o=>o+le)}function $e(e){const o=e.map(l=>Ve.replace("ANNOTATION",l)).join(`
|
|
13
|
-
`);return Ie.replace(Ve,o)}function Ke(e){const o=e.length<=1;return(0,r.jsxs)(r.Fragment,{children:["The ",o?"annotation":"annotations"," ",e.map(l=>(0,r.jsx)("code",{children:l})).reduce((l,d)=>(0,r.jsxs)(r.Fragment,{children:[l,", ",d]}))," ",o?"is":"are"," missing. You need to add the"," ",o?"annotation":"annotations"," to your component if you want to enable this tool."]})}function Je(e){const{annotation:o,readMoreUrl:l}=e,d=Array.isArray(o)?o:[o],m=l||"https://backstage.io/docs/features/software-catalog/well-known-annotations",x=U();return(0,r.jsx)(ce,{missing:"field",title:"Missing Annotation",description:Ke(d),action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rt.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,r.jsx)(A.Z,{className:x.code,children:(0,r.jsx)(je,{text:$e(d),language:"yaml",showLineNumbers:!0,highlightedNumbers:he(d.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,r.jsx)(ge.Z,{color:"primary",component:de.r,to:m,children:"Read more"})]})})}var Ft=n(11776),Vt=n(38402),en=n(49378),Xt=n(41128),tn=n(27616),_=n(8284),X=n(70660),ee=n(91750),v=n(38016);const O=(e,o)=>(o.palette.type==="light"?Xt._j:Xt.$n)(o.palette[e].light,.6),J=(e,o)=>(o.palette.type==="light"?Xt.$n:Xt._j)(o.palette[e].light,.9),M=(0,g.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:o})=>O(o,e)}})),ue=({severity:e})=>{const o=M({severity:e});return(0,r.jsx)(ee.Z,{classes:o})},ye=({severity:e})=>{const o=M({severity:e});return(0,r.jsx)(v.Z,{classes:o})},Me=(0,g.Z)(e=>({panel:{backgroundColor:({severity:o})=>J(o,e),color:({severity:o})=>O(o,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:o})=>O(o,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:o})=>O(o,e),backgroundColor:({severity:o})=>J(o,e)},details:{width:"100%",display:"block",color:e.palette.textContrast,backgroundColor:e.palette.background.default,border:`1px solid ${e.palette.border}`,padding:e.spacing(2),fontFamily:"sans-serif"}}),{name:"BackstageWarningPanel"}),ot=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function ht(e){const{severity:o="warning",title:l,message:d,children:m,defaultExpanded:x}=e,I=Me({severity:o}),$=ot(o)+(l?`: ${l}`:"");return(0,r.jsxs)(tn.Z,{defaultExpanded:x!=null?x:!1,className:I.panel,role:"alert",children:[(0,r.jsxs)(_.Z,{expandIcon:(0,r.jsx)(ye,{severity:o}),className:I.summary,children:[(0,r.jsx)(ue,{severity:o}),(0,r.jsx)(rt.Z,{className:I.summaryText,variant:"subtitle1",children:$})]}),(d||m)&&(0,r.jsx)(X.Z,{children:(0,r.jsxs)(Jt.Z,{container:!0,children:[d&&(0,r.jsx)(Jt.Z,{item:!0,xs:12,children:(0,r.jsx)(rt.Z,{className:I.message,variant:"body1",children:d})}),m&&(0,r.jsx)(Jt.Z,{item:!0,xs:12,className:I.details,children:m})]})})]})}const Tt=(0,g.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),jt=({error:e,message:o,stack:l,children:d})=>{const m=Tt();return(0,r.jsxs)(Ft.Z,{dense:!0,children:[(0,r.jsxs)(Vt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(en.Z,{classes:{secondary:m.text},primary:"Error",secondary:e}),(0,r.jsx)(G,{text:e})]}),(0,r.jsxs)(Vt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(en.Z,{classes:{secondary:m.text},primary:"Message",secondary:o}),(0,r.jsx)(G,{text:o})]}),l&&(0,r.jsxs)(Vt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(en.Z,{classes:{secondary:m.text},primary:"Stack Trace",secondary:l}),(0,r.jsx)(G,{text:l})]}),d]})};function st(e){const{title:o,error:l,defaultExpanded:d,children:m}=e;return(0,r.jsx)(ht,{severity:"error",title:o!=null?o:l.message,defaultExpanded:d,children:(0,r.jsx)(jt,{error:l.name,message:l.message,stack:l.stack,children:m})})}var Ne=n(85256);const Ut=(0,g.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function qt(e){var o;const{title:l,error:d,defaultExpanded:m}=e,x=Ut();if(d.name!=="ResponseError")return(0,r.jsx)(st,{title:l!=null?l:d.message,defaultExpanded:m,error:d});const{body:I,cause:$}=d,{request:Y,response:Z}=I,fe=`${Z.statusCode}: ${$.name}`,pe=Y&&`${Y.method} ${Y.url}`,Te=$.message.replace(/\\n/g,`
|
|
14
|
-
`),Ee=(o=$.stack)===null||o===void 0?void 0:o.replace(/\\n/g,`
|
|
15
|
-
`),Ze=JSON.stringify(I,void 0,2);return(0,r.jsxs)(st,{title:l!=null?l:d.message,defaultExpanded:m,error:{name:fe,message:Te,stack:Ee},children:[pe&&(0,r.jsxs)(Vt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(en.Z,{classes:{secondary:x.text},primary:"Request",secondary:Y?`${pe}`:void 0}),(0,r.jsx)(G,{text:pe})]}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ne.Z,{component:"li",className:x.divider}),(0,r.jsx)(Vt.Z,{alignItems:"flex-start",children:(0,r.jsx)(en.Z,{classes:{secondary:x.text},primary:"Full Error as JSON"})}),(0,r.jsx)(je,{language:"json",text:Ze,showCopyCodeButton:!0})]})]})}var bt=n(28316);function Nt(e){const o=document.createElement("div");return o.setAttribute("id",e),o}function gn(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function Cn(e){const o=useRef(null);useEffect(function(){const m=document.querySelector(`#${e}`),x=m||Nt(e);return m||gn(x),x.appendChild(o.current),function(){o.current.remove(),x.childNodes.length===-1&&x.remove()}},[e]);function l(){return o.current||(o.current=document.createElement("div")),o.current}return l()}var vt=null;const He="core.calloutSeen";function Lt(){const[e,o]=useState(()=>{const d=localStorage.getItem(He);return d?JSON.parse(d):{}}),l=useCallback((d,m)=>{const x=localStorage.getItem(He),$={...x?JSON.parse(x):{},[d]:m};o($),localStorage.setItem(He,JSON.stringify($))},[]);return{states:e,setState:l}}function xn(e){const{states:o,setState:l}=Lt(),d=useCallback(()=>{l(e,!0)},[l,e]);return{seen:o[e]===!0,markSeen:d}}function nn(e){const{seen:o,markSeen:l}=xn(e);return{show:o===!1,hide:l}}const sr=(0,g.Z)(e=>({"@keyframes pulsateSlightly":{"0%":{transform:"scale(1.0)"},"100%":{transform:"scale(1.1)"}},"@keyframes pulsateAndFade":{"0%":{transform:"scale(1.0)",opacity:.9},"100%":{transform:"scale(1.5)",opacity:0}},featureWrapper:{position:"relative"},backdrop:{zIndex:2e3,position:"fixed",overflow:"hidden",left:0,right:0,top:0,bottom:0},dot:{position:"absolute",backgroundColor:"transparent",borderRadius:"100%",border:"1px solid rgba(103, 146, 180, 0.98)",boxShadow:"0px 0px 0px 20000px rgba(0, 0, 0, 0.5)",zIndex:2001,transformOrigin:"center center",animation:"$pulsateSlightly 1744ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) alternate infinite"},pulseCircle:{width:"100%",height:"100%",backgroundColor:"transparent",borderRadius:"100%",border:`2px solid ${e.palette.common.white}`,zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:e.palette.common.white,zIndex:2003}}),{name:"BackstageFeatureCalloutCircular"});function mr(e){const{featureId:o,title:l,description:d,children:m}=e,{show:x,hide:I}=useShowCallout(o),$=usePortal("core.callout"),Y=useRef(null),[Z,fe]=useState(),pe=sr(),Te=useCallback(()=>{if(Y.current){const Ee=Y.current.getBoundingClientRect(),Ze=Math.max(Ee.width,Ee.height),it=800,Pt=Ee.x-(Ze-Ee.width)/2-it,mn=Ee.y-(Ze-Ee.height)/2-it,$n=Ze+2*it,or=450,Bt=Ee.x+Ee.width/2-or,vn=Ee.y-(Ze-Ee.height)/2+Ze+20;fe({dotLeft:Pt,dotTop:mn,dotSize:$n,borderWidth:it,textTop:vn,textLeft:Bt,textWidth:or})}},[]);return useEffect(()=>(window.addEventListener("resize",Te),window.addEventListener("scroll",Te),()=>{window.removeEventListener("resize",Te),window.removeEventListener("scroll",Te)}),[Te]),useLayoutEffect(Te,[Y.current,Te]),x?_jsxs(_Fragment,{children:[_jsx(Box,{className:pe.featureWrapper,ref:Y,children:m}),createPortal(_jsx(Box,{className:pe.backdrop,children:_jsx(ClickAwayListener,{onClickAway:I,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:pe.dot,"data-testid":"dot",style:{left:Z==null?void 0:Z.dotLeft,top:Z==null?void 0:Z.dotTop,width:Z==null?void 0:Z.dotSize,height:Z==null?void 0:Z.dotSize,borderWidth:Z==null?void 0:Z.borderWidth},onClick:I,onKeyDown:I,role:"button",tabIndex:0,children:_jsx(Box,{className:pe.pulseCircle})}),_jsxs(Box,{className:pe.text,"data-testid":"text",style:{left:Z==null?void 0:Z.textLeft,top:Z==null?void 0:Z.textTop,width:Z==null?void 0:Z.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:l}),_jsx(Typography,{children:d})]})]})})}),$)]}):_jsx(_Fragment,{children:m})}var Gn=n(35292);const cn=(0,g.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function ir({color:e="primary",disabled:o=!1,href:l="#",icon:d=(0,r.jsx)(Gn.Z,{}),label:m,onClick:x,title:I}){const $=cn();return o?(0,r.jsxs)(A.Z,{title:I,className:on()($.link,$.disabled),children:[d,(0,r.jsx)(rt.Z,{variant:"caption",component:"span",className:$.label,children:m})]}):(0,r.jsxs)(de.r,{title:I,className:on()($.link,$[e]),to:l,onClick:x,children:[d,(0,r.jsx)(rt.Z,{variant:"caption",component:"span",className:$.label,children:m})]})}const Nr=(0,g.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function Zr(e){const{links:o}=e,l=Nr();return(0,r.jsx)("nav",{className:l.links,children:o.map((d,m)=>(0,r.jsx)(ir,{...d},m+1))})}const Kn=e=>{const o=e==="dark"?"16%":"97%";return`
|
|
16
|
-
hsl(0, 0%, ${o}) 0%,
|
|
17
|
-
hsla(0, 0%, ${o}, 0.987) 8.1%,
|
|
18
|
-
hsla(0, 0%, ${o}, 0.951) 15.5%,
|
|
19
|
-
hsla(0, 0%, ${o}, 0.896) 22.5%,
|
|
20
|
-
hsla(0, 0%, ${o}, 0.825) 29%,
|
|
21
|
-
hsla(0, 0%, ${o}, 0.741) 35.3%,
|
|
22
|
-
hsla(0, 0%, ${o}, 0.648) 41.2%,
|
|
23
|
-
hsla(0, 0%, ${o}, 0.55) 47.1%,
|
|
24
|
-
hsla(0, 0%, ${o}, 0.45) 52.9%,
|
|
25
|
-
hsla(0, 0%, ${o}, 0.352) 58.8%,
|
|
26
|
-
hsla(0, 0%, ${o}, 0.259) 64.7%,
|
|
27
|
-
hsla(0, 0%, ${o}, 0.175) 71%,
|
|
28
|
-
hsla(0, 0%, ${o}, 0.104) 77.5%,
|
|
29
|
-
hsla(0, 0%, ${o}, 0.049) 84.5%,
|
|
30
|
-
hsla(0, 0%, ${o}, 0.013) 91.9%,
|
|
31
|
-
hsla(0, 0%, ${o}, 0) 100%
|
|
32
|
-
`},Rr=100,S=10,c=(0,g.Z)(e=>({root:{position:"relative",display:"flex",flexFlow:"row nowrap",alignItems:"center"},container:{overflow:"auto",scrollbarWidth:0,"&::-webkit-scrollbar":{display:"none"}},fade:{position:"absolute",width:Rr,height:`calc(100% + ${S}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-S,background:`linear-gradient(90deg, ${Kn(e.palette.type)})`},fadeRight:{right:-S,background:`linear-gradient(270deg, ${Kn(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function b(e){const[[o,l],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const m=e.current;if(!m){d([0,0]);return}const x=()=>{const I=m.scrollLeft,$=m.scrollWidth-m.offsetWidth-m.scrollLeft;d([I,$])};return x(),m.addEventListener("scroll",x),window.addEventListener("resize",x),()=>{m.removeEventListener("scroll",x),window.removeEventListener("resize",x)}},[e]),[o,l]}function j(e,o,l){const[d,m]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const x=window.performance.now(),I=requestAnimationFrame($=>{if(!e.current)return;const Y=$-x,Z=Math.abs(d)*Y/o,pe=Math.max(l,Z)*Math.sign(d);e.current.scrollBy({left:pe});const Te=d-pe;Math.sign(d)!==Math.sign(Te)?m(0):m(Te)});return()=>cancelAnimationFrame(I)},[e,d,o,l]),m}function K(e){const{scrollStep:o=100,scrollSpeed:l=50,minScrollDistance:d=5,children:m,...x}=e,I=c(e),$=React.useRef(),[Y,Z]=b($),fe=j($,l,d),pe=Te=>{$.current&&fe(Te?o:-o)};return _jsxs(Box,{...x,className:I.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:I.container,ref:$,children:m}),_jsx(Box,{className:classNames(I.fade,I.fadeLeft,{[I.fadeHidden]:Y===0})}),_jsx(Box,{className:classNames(I.fade,I.fadeRight,{[I.fadeHidden]:Z===0})}),Y>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>pe(!1),className:classNames(I.button,I.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),Z>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>pe(!0),className:classNames(I.button,I.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const me=(0,g.Z)(e=>({alpha:{color:e.palette.common.white,fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}}),{name:"BackstageLifecycle"});function we(e){const o=me(e),{shorthand:l,alpha:d}=e;return l?_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],style:{fontSize:"120%"},children:d?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],children:d?"Alpha":"Beta"})}const Fe=(0,f.lazy)(()=>Promise.all([n.e(1049),n.e(6051)]).then(n.bind(n,76051)).then(e=>({default:e.RealLogViewer})));function Xe(e){const{Progress:o}=(0,p.qD)().getComponents();return(0,r.jsx)(f.Suspense,{fallback:(0,r.jsx)(o,{}),children:(0,r.jsx)(Fe,{...e})})}var Mt=n(28865),wn=n(60251);const Qn=(0,g.Z)(e=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${e.palette.border}`},"& th, & td":{border:`1px solid ${e.palette.border}`,padding:e.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:e.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:e.palette.background.paper},"& tr":{backgroundColor:e.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:e.palette.background.default},"& a":{color:e.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),ar=(e,o)=>o?typeof o=="string"?e+o:f.Children.toArray(o.props.children).reduce(ar,e):e,vr=({level:e,children:o})=>{const m=f.Children.toArray(o).reduce(ar,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return f.createElement(`h${e}`,{id:m},o)},an={code:({inline:e,className:o,children:l,...d})=>{const m=String(l).replace(/\n+$/,""),x=/language-(\w+)/.exec(o||"");return!e&&x?(0,r.jsx)(je,{language:x[1],text:m}):(0,r.jsx)("code",{className:o,...d,children:l})},h1:vr,h2:vr,h3:vr,h4:vr,h5:vr,h6:vr};function mo(e){const{content:o,dialect:l="gfm",linkTarget:d,transformLinkUri:m,transformImageUri:x,className:I}=e,$=Qn();return(0,r.jsx)(Mt.D,{remarkPlugins:l==="gfm"?[wn.Z]:[],className:`${$.markdown} ${I}`,children:o,components:an,linkTarget:d,transformLinkUri:m,transformImageUri:x})}var _r=n(23054);const Oo=(0,g.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),eo=({request:e,busy:o,setBusy:l})=>{const d=Oo(),[m,x]=useState(),I=async()=>{l(!0);try{await e.trigger()}catch(Y){x(isError(Y)?Y.message:"An unspecified error occurred")}finally{l(!1)}},$=e.provider.icon;return _jsxs(ListItem,{disabled:o,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx($,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:m&&_jsx(Typography,{color:"error",children:m})}),_jsx(Button,{color:"primary",variant:"contained",onClick:I,children:"Log in"})]})};var vo=null;const ko=(0,g.Z)(e=>({dialog:{paddingTop:e.spacing(1)},title:{minWidth:0},titleHeading:{fontSize:e.typography.h6.fontSize},contentList:{padding:0},actionButtons:{padding:e.spacing(2,0)}}),{name:"OAuthRequestDialog"});function xs(e){const o=ko(),[l,d]=useState(!1),m=useApi(oauthRequestApiRef),x=useApi(configApiRef);var I;const $=(I=x.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&I!==void 0?I:!1,Y=useObservable(useMemo(()=>m.authRequest$(),[m]),[]),Z=()=>{Y.forEach(fe=>fe.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:[_jsxs(DialogTitle,{classes:{root:o.title},id:"oauth-req-dialog-title",children:[_jsx(Typography,{className:o.titleHeading,variant:"h1",variantMapping:{h1:"span"},children:"Login Required"}),$?_jsx(Typography,{children:"This will trigger a http redirect to OAuth Login."}):null]}),_jsx(DialogContent,{dividers:!0,classes:{root:o.contentList},children:_jsx(List,{children:Y.map(fe=>_jsx(LoginRequestListItem,{request:fe,busy:l,setBusy:d},fe.provider.title))})})]}),_jsx(DialogActions,{classes:{root:o.actionButtons},children:_jsx(Button,{onClick:Z,children:"Reject All"})})]})}var Bo=n(15277),$o=n.n(Bo),yr=n(29862);const er=(0,g.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Or(e){const[o,l]=(0,f.useState)(!1),d=(0,yr.t)(),m=er(),x=$=>{d()&&l($)};var I;return(0,r.jsx)(T.ZP,{title:(I=e.title)!==null&&I!==void 0?I:e.text||"",placement:e.placement,disableHoverListener:!o,children:(0,r.jsx)($o(),{text:e.text,line:e.line,onToggled:x,containerClassName:m.container})})}var Ur=n(67358);function to(e){const o=(0,ae.Z)(),[l,d]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{const m=setTimeout(()=>d(!0),o.transitions.duration.short);return()=>clearTimeout(m)},[o.transitions.duration.short]),l?(0,r.jsx)(Ur.Z,{...e,"data-testid":"progress"}):(0,r.jsx)(A.Z,{display:"none"})}var no=n(94339),Mr=n(14503),Do=n(24579),yo=n(32552),On=n(15459),Xn=n(27597);const kr=(0,g.Z)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function zr(e){const{link:o,title:l,onClick:d}=e,m=kr();return(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(Ne.Z,{}),(0,r.jsx)(de.r,{to:o,onClick:d,underline:"none",children:(0,r.jsxs)(A.Z,{display:"flex",alignItems:"center",className:m.root,children:[(0,r.jsx)(A.Z,{className:m.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)(rt.Z,{children:(0,r.jsx)("strong",{children:l})})}),(0,r.jsx)(Xn.Z,{className:m.arrow})]})})]})}const Ir=e=>{const{slackChannel:o}=e;if(o){if(typeof o=="string")return(0,r.jsxs)(rt.Z,{children:["Please contact ",o," for help."]});if(!o.href)return(0,r.jsxs)(rt.Z,{children:["Please contact ",o.name," for help."]})}else return null;return(0,r.jsx)(te,{to:o.href,variant:"contained",children:o.name})},ro=class extends f.Component{componentDidCatch(o,l){console.error(`ErrorBoundary, error: ${o}, info: ${l}`),this.setState({error:o,errorInfo:l})}render(){const{slackChannel:o,children:l}=this.props,{error:d}=this.state;return d?(0,r.jsx)(st,{title:"Something Went Wrong",error:d,children:(0,r.jsx)(Ir,{slackChannel:o})}):l}constructor(o){super(o),this.state={error:void 0,errorInfo:void 0}}},oo=(0,g.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),Fo=(0,On.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Mr.Z),xo={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px",breakInside:"avoid-page","@media print":{height:"auto"}}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function lr(e){const{title:o,subheader:l,divider:d=!0,deepLink:m,slackChannel:x,errorBoundaryProps:I,variant:$,children:Y,headerStyle:Z,headerProps:fe,icon:pe,action:Te,actionsClassName:Ee,actions:Ze,cardClassName:it,actionsTopRight:Pt,className:mn,noPadding:$n,titleTypographyProps:or}=e,Bt=oo();let vn={},yn={};$&&$.split(/[\s]+/g).forEach(Er=>{vn={...vn,...xo.card[Er]},yn={...yn,...xo.cardContent[Er]}});const gr=()=>!l&&!pe?null:(0,r.jsxs)("div",{className:Bt.headerSubheader,"data-testid":"info-card-subheader",children:[l&&(0,r.jsx)("div",{className:Bt.subheader,children:l}),pe]}),wr=I||(x?{slackChannel:x}:{});return(0,r.jsx)(no.Z,{style:vn,className:mn,children:(0,r.jsxs)(ro,{...wr,children:[o&&(0,r.jsx)(yo.Z,{classes:{root:Bt.header,title:Bt.headerTitle,subheader:Bt.headerSubheader,avatar:Bt.headerAvatar,action:Bt.headerAction,content:Bt.headerContent},title:o,subheader:gr(),action:Te,style:{...Z},titleTypographyProps:or,...fe}),Pt&&(0,r.jsx)(Fo,{children:Pt}),d&&(0,r.jsx)(Ne.Z,{}),(0,r.jsx)(Do.Z,{className:on()(it,{[Bt.noPadding]:$n}),style:yn,children:Y}),Ze&&(0,r.jsx)(Mr.Z,{className:Ee,children:Ze}),m&&(0,r.jsx)(zr,{...m})]})})}var bs=n(39307);const No=(0,g.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:e.typography.pxToRem(45),fontWeight:e.typography.fontWeightBold,color:e.palette.textContrast},description:{fontSize:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)",position:"absolute",wordBreak:"break-all",display:"inline-block"},circle:{width:"80%",transform:"translate(10%, 0)"},colorUnknown:{}}),{name:"BackstageGauge"}),Wr={fractional:!0,inverse:!1,unit:"%",max:100},Zo=({palette:e,value:o,inverse:l,max:d})=>{if(isNaN(o))return"#ddd";const m=d||Wr.max,x=l?m-o:o;return x<m/3?e.status.error:x<m*(2/3)?e.status.warning:e.status.ok};function Uo(e){const[o,l]=useState(null),{getColor:d=Zo}=e,m=No(e),{palette:x}=useTheme(),{value:I,fractional:$,inverse:Y,unit:Z,max:fe,description:pe}={...Wr,...e},Te=$?Math.round(I*fe):I,Ee=fe!==100?Math.round(I):Te,[Ze,it]=useState(!1);return useEffect(()=>{const Pt=o,mn=()=>it(!0),$n=()=>it(!1);return Pt&&pe?(Pt.addEventListener("mouseenter",mn),Pt.addEventListener("mouseleave",$n),()=>{Pt.removeEventListener("mouseenter",mn),Pt.removeEventListener("mouseleave",$n)}):()=>{it(!1)}},[pe,o]),_jsxs(Box,{ref:l,className:m.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:Te,strokeWidth:12,trailWidth:12,strokeColor:d({palette:x,value:Ee,inverse:Y,max:fe}),className:m.circle}),pe&&Ze?_jsx(Box,{className:m.description,children:pe}):_jsx(Box,{className:m.overlay,children:isNaN(I)?"N/A":`${Ee}${Z}`})]})}const qn=(0,g.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function ri(e){const o=qn(e),{title:l,subheader:d,progress:m,inverse:x,deepLink:I,description:$,icon:Y,variant:Z,getColor:fe}=e,pe={inverse:x,description:$,getColor:fe,value:m};return _jsx(Box,{className:o.root,children:_jsx(InfoCard,{title:l,subheader:d,deepLink:I,variant:Z,icon:Y,children:_jsx(Gauge,{...pe})})})}function Ss(e){const{value:o,getColor:l=getProgressColor}=e,{palette:d}=useTheme();if(isNaN(o))return null;let m=Math.round(o*100*100)/100;m>100&&(m=100);const x=l({palette:d,value:m,inverse:!1,max:100});return _jsx(Tooltip,{title:`${m}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:m,strokeWidth:4,trailWidth:4,strokeColor:x})})})}var Cs=n(21324),ws=n(7089),so=n(42494),Vr=n(74603),Hr=n(56939),cr=n(12231),Mo=n(73698),Yn=n(12420),io=n(72379);const zo=(0,g.Z)(e=>(0,Yn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var Wo=()=>{const e=zo();return(0,r.jsx)(io.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const Vo=(0,g.Z)(e=>(0,Yn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Ho=()=>{const e=Vo();return(0,r.jsx)(io.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const lo=(0,On.Z)(e=>(0,Yn.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"})(Vr.Z),Go=(0,g.Z)(e=>(0,Yn.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 bo(e){const{multiple:o,items:l,label:d,placeholder:m,selected:x,onChange:I,triggerReset:$,native:Y=!1,disabled:Z=!1,margin:fe}=e,pe=Go(),[Te,Ee]=(0,f.useState)(x||(o?[]:"")),[Ze,it]=(0,f.useState)(!1);(0,f.useEffect)(()=>{Ee(o?[]:"")},[$,o]),(0,f.useEffect)(()=>{Ee(x||(o?[]:""))},[x,o]);const Pt=Bt=>{Ee(Bt.target.value),I(Bt.target.value)},mn=Bt=>{if(Z){Bt.preventDefault();return}it(vn=>o&&!(Bt.target instanceof HTMLElement)?!0:!vn)},$n=()=>{it(!1)},or=Bt=>()=>{const vn=Te.filter(yn=>yn!==Bt);Ee(vn),I(vn)};return(0,r.jsx)(A.Z,{className:pe.root,children:(0,r.jsxs)(so.Z,{className:pe.formControl,children:[(0,r.jsx)(Hr.Z,{className:pe.formLabel,children:d}),(0,r.jsxs)(Mo.Z,{"aria-label":d,value:Te,native:Y,disabled:Z,"data-testid":"select",displayEmpty:!0,multiple:o,margin:fe,onChange:Pt,open:Ze,onOpen:mn,onClose:$n,input:(0,r.jsx)(lo,{}),label:d,tabIndex:0,renderValue:Bt=>{var vn;return o&&Te.length!==0?(0,r.jsx)(A.Z,{className:pe.chips,children:Bt.map(yn=>{var gr,wr;return(0,r.jsx)(ws.Z,{label:(gr=l.find(jr=>jr.value===yn))===null||gr===void 0?void 0:gr.label,clickable:!0,onDelete:or(yn),className:pe.chip},(wr=l.find(jr=>jr.value===yn))===null||wr===void 0?void 0:wr.value)})}):(0,r.jsx)(rt.Z,{children:Te.length===0?m||"":(vn=l.find(yn=>yn.value===Bt))===null||vn===void 0?void 0:vn.label})},IconComponent:()=>Ze?(0,r.jsx)(Ho,{}):(0,r.jsx)(Wo,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[m&&!o&&(0,r.jsx)(cr.Z,{value:[],children:m}),Y?l&&l.map(Bt=>(0,r.jsx)("option",{value:Bt.value,children:Bt.label},Bt.value)):l&&l.map(Bt=>(0,r.jsxs)(cr.Z,{value:Bt.value,children:[o&&(0,r.jsx)(Cs.Z,{color:"primary",checked:Te.includes(Bt.value)||!1,className:pe.checkbox}),Bt.label]},Bt.value))]})]})})}const So=()=>{},Es=f.createContext({stepperLength:0,stepIndex:0,setStepIndex:So,stepHistory:[],setStepHistory:So,onStepChange:So});function As(e){const{children:o,elevated:l,onStepChange:d,activeStep:m=0}=e,[x,I]=useState(m),[$,Y]=useState([0]);useEffect(()=>{I(m)},[m]);const Z=[];let fe;return Children.forEach(o,pe=>{isValidElement(pe)&&(pe.props.end?fe=pe:Z.push(pe))}),_jsxs(_Fragment,{children:[_jsx(Es.Provider,{value:{stepIndex:x,setStepIndex:I,stepHistory:$,setStepHistory:Y,onStepChange:d,stepperLength:Children.count(o)},children:_jsx(MuiStepper,{activeStep:x,orientation:"vertical",elevation:l?2:0,children:Z})}),x>=Children.count(o)-1&&fe]})}const Ko=(0,g.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),ln=({text:e,handleClick:o})=>_jsx(Button,{onClick:o,children:e||"Reset"}),Yo=({text:e,handleClick:o,disabled:l,last:d,stepIndex:m})=>_jsx(Button,{variant:"contained",color:"primary",disabled:l,"data-testid":`nextButton-${m}`,onClick:o,children:e||(d?"Finish":"Next")}),Ts=({text:e,handleClick:o,disabled:l,stepIndex:d})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:l,"data-testid":`skipButton-${d}`,onClick:o,children:e||"Skip"}),y=({text:e,handleClick:o,disabled:l,stepIndex:d})=>_jsx(Button,{onClick:o,"data-testid":`backButton-${d}`,disabled:l,children:e||"Back"}),C=({actions:e={},children:o})=>{const l=Ko(),{stepperLength:d,stepIndex:m,setStepIndex:x,stepHistory:I,setStepHistory:$,onStepChange:Y}=useContext(VerticalStepperContext),Z=(Ee,Ze)=>{Ze&&Ze(),Y&&Y(m,Ee),x(Ee)},fe=()=>{const Ee=e.nextStep?e.nextStep(m,d-1):m+1;Z(Ee,e.onNext),$([...I,Ee])},pe=()=>{I.pop(),Z(I[I.length-1],e.onBack),$([...I])},Te=()=>{Z(0,e.onRestart),$([0])};return _jsxs(Box,{className:l.root,children:[[void 0,!0].includes(e.showBack)&&m!==0&&_jsx(y,{text:e.backText,handleClick:pe,disabled:m===0,stepIndex:m}),e.showSkip&&_jsx(Ts,{text:e.skipText,handleClick:fe,disabled:!!d&&m>=d||!!e.canSkip&&!e.canSkip(),stepIndex:m}),[void 0,!0].includes(e.showNext)&&_jsx(Yo,{text:e.nextText,handleClick:fe,disabled:!!d&&m>=d||!!e.canNext&&!e.canNext(),stepIndex:m}),e.showRestart&&m!==0&&_jsx(ln,{text:e.restartText,handleClick:Te,stepIndex:m}),o]})},E=(0,g.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function B(e){const{title:o,children:l,end:d,actions:m,...x}=e,I=E();return d?_jsxs(Box,{className:I.end,children:[_jsx(Typography,{variant:"h6",children:o}),l,_jsx(SimpleStepperFooter,{actions:{...m||{},showNext:!1}})]}):_jsxs(MuiStep,{...x,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:o})}),_jsxs(StepContent,{children:[l,_jsx(SimpleStepperFooter,{actions:m})]})]})}const Q=(0,g.Z)(e=>({status:{fontWeight:e.typography.fontWeightMedium,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:e.spacing(1),borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:e.palette.status.ok}},warning:{"&::before":{backgroundColor:e.palette.status.warning}},error:{"&::before":{backgroundColor:e.palette.status.error}},pending:{"&::before":{backgroundColor:e.palette.status.pending}},running:{"&::before":{backgroundColor:e.palette.status.running}},aborted:{"&::before":{backgroundColor:e.palette.status.aborted}}}),{name:"BackstageStatus"});function ne(e){const o=Q(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function re(e){const o=Q(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function ve(e){const o=Q(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.error),"aria-label":"Status error","aria-hidden":"true",...e})}function Ae(e){const o=Q(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function Oe(e){const o=Q(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.running),"aria-label":"Status running","aria-hidden":"true",...e})}function De(e){const o=Q(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var Be=n(74600),tt=n(15584);const ft=e=>(0,Yn.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),qe={root:{border:"0",verticalAlign:"top"}},We=e=>(0,Yn.Z)({root:{margin:e.spacing(0,0,-1,0)}}),gt=e=>(0,Yn.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),Ot=(0,On.Z)(ft,{name:"BackstageMetadataTableTitleCell"})(tt.Z),bn=(0,On.Z)(qe,{name:"BackstageMetadataTableCell"})(tt.Z),Rt=({dense:e,children:o})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:o})}),Kt=({title:e,children:o,...l})=>_jsxs(TableRow,{children:[e&&_jsx(Ot,{children:e}),_jsx(bn,{colSpan:e?1:2,...l,children:o})]}),kt=(0,On.Z)(We,{name:"BackstageMetadataTableList"})(({classes:e,children:o})=>(0,r.jsx)(Ft.Z,{disablePadding:!0,className:e.root,children:o})),dn=(0,On.Z)(gt,{name:"BackstageMetadataTableListItem"})(({classes:e,children:o})=>(0,r.jsx)(Vt.Z,{className:e.root,children:o})),Bn=(0,Yn.Z)({root:{margin:"0 0",listStyleType:"none"}}),Pr=e=>(0,Yn.Z)({root:{...Bn.root,paddingLeft:e.spacing(1)}}),dr=(0,On.Z)(Bn,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:o})=>(0,r.jsx)(kt,{classes:e,children:o})),Gr=(0,On.Z)(Pr,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:o})=>(0,r.jsx)(kt,{classes:e,children:o}));function Dn(e,o){const l=e.map((d,m)=>_jsx(MetadataListItem,{children:xr(d)},m));return o?_jsx(Gr,{children:l}):_jsx(dr,{children:l})}function Un(e,o,l){const d=Object.keys(e).map(m=>{const x=xr(e[m],!0),I=l&&l.titleFormat?l.titleFormat(m):startCase(m);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${I}: `}),x]},m)});return o?_jsx(Gr,{children:d}):_jsx(dr,{children:d})}function xr(e,o,l){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?Un(e,o,l):Array.isArray(e)?Dn(e,l):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const oi=({value:e,options:o})=>_jsx(Fragment,{children:xr(e,o)}),Rs=({title:e,value:o,options:l})=>_jsx(MetadataTableItem,{title:l&&l.titleFormat?l.titleFormat(e):startCase(e),children:_jsx(oi,{value:o,options:l})});function Is(e,o){return Object.keys(e).map(l=>_jsx(Rs,{title:l,value:e[l],options:o},l))}function Br(e){const{metadata:o,dense:l=!0,options:d}=e,m=Is(o,d||{});return _jsx(MetadataTable,{dense:l,children:m})}var ur=n(49429),hr=n(86136),tr=n(79784),Kr=n(76635),si=n(19126),Ps=n.n(si);function ii(e){return qs.stringify(e,{strictNullHandling:!0})}function Jo(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function Yr(e,o){return Jo(e)[o]}function Ls(e,o,l){const d={...Jo(e),[o]:l};return ii(d)}function ai(e,o=250){const[l,d]=useSearchParams(),m=l.toString(),[x,I]=useState(Yr(m,e));return useEffect(()=>{const $=Yr(m,e);I(Y=>isEqual($,Y)?Y:$)},[m,I,e]),useDebouncedEffect(()=>{const $=Ls(m,e,x);m!==$&&d($,{replace:!0})},[d,x,m,e],o),[x,I]}const ia={url:"https://github.com/backstage/backstage/issues",items:[{title:"Support Not Configured",icon:"warning",links:[{title:"Add `app.support` config key",url:"https://github.com/backstage/backstage/blob/master/app-config.yaml"}]}]};function co(){const o=(0,p.I_)().get(p.Ds),l=o==null?void 0:o.getOptionalConfig("app.support");if(!l)return ia;var d;return{url:l.getString("url"),items:l.getConfigArray("items").flatMap(m=>({title:m.getString("title"),icon:m.getOptionalString("icon"),links:((d=m.getOptionalConfigArray("links"))!==null&&d!==void 0?d:[]).flatMap(x=>({url:x.getString("url"),title:x.getString("title")}))}))}}var Os=n(80079);function nr(e,o){const d=(0,p.qD)().getSystemIcon(e);return d?(0,r.jsx)(d,{...o}):(0,r.jsx)(Os.Z,{...o})}function aa(e){return nr("brokenImage",e)}function la(e){return nr("catalog",e)}function ca(e){return nr("chat",e)}function da(e){return nr("dashboard",e)}function ua(e){return nr("docs",e)}function ha(e){return nr("email",e)}function pa(e){return nr("github",e)}function li(e){return nr("group",e)}function Co(e){return nr("help",e)}function fa(e){return nr("user",e)}function ci(e){return nr("warning",e)}const ga=(0,g.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),ma=({icon:e})=>{const o=(0,p.qD)();var l;const d=e&&(l=o.getSystemIcon(e))!==null&&l!==void 0?l:Co;return(0,r.jsx)(d,{})};var Qo;const di=({link:e})=>(0,r.jsx)(de.r,{to:e.url,children:(Qo=e.title)!==null&&Qo!==void 0?Qo:e.url}),ui=({item:e})=>{var o;return(0,r.jsxs)(Vt.Z,{children:[(0,r.jsx)(hr.Z,{children:(0,r.jsx)(ma,{icon:e.icon})}),(0,r.jsx)(en.Z,{primary:e.title,secondary:(o=e.links)===null||o===void 0?void 0:o.reduce((l,d,m)=>[...l,m>0&&(0,r.jsx)("br",{},m),(0,r.jsx)(di,{link:d},d.url)],[])})]})};function hi(e){const{title:o,items:l,children:d}=e,{items:m}=co(),[x,I]=(0,f.useState)(!1),[$,Y]=(0,f.useState)(null),Z=ga(),fe=(0,Pe.Z)(Ee=>Ee.breakpoints.down("sm")),pe=Ee=>{Y(Ee.currentTarget),I(!0)},Te=()=>{I(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{display:"flex",ml:1,children:fe?(0,r.jsx)(H.Z,{color:"primary",size:"small",onClick:pe,"data-testid":"support-button","aria-label":"Support",children:(0,r.jsx)(Co,{})}):(0,r.jsx)(ge.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:pe,startIcon:(0,r.jsx)(Co,{}),children:"Support"})}),(0,r.jsxs)(tr.ZP,{"data-testid":"support-button-popover",open:x,anchorEl:$,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:Te,children:[(0,r.jsxs)(Ft.Z,{className:Z.popoverList,children:[o&&(0,r.jsx)(Vt.Z,{alignItems:"flex-start",children:(0,r.jsx)(rt.Z,{variant:"subtitle1",children:o})}),f.Children.map(d,(Ee,Ze)=>(0,r.jsx)(Vt.Z,{alignItems:"flex-start",children:Ee},`child-${Ze}`)),(l!=null?l:m).map((Ee,Ze)=>(0,r.jsx)(ui,{item:Ee},`item-${Ze}`))]}),(0,r.jsx)(ur.Z,{children:(0,r.jsx)(ge.Z,{color:"primary",onClick:Te,"aria-label":"Close",children:"Close"})})]})]})}var Jr=n(18671),rr=n(73557),Xo=n(84800);const wo=72,pi=24,$r=18,br={drawerWidthClosed:wo,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:wo,iconSize:wo-pi*2,iconPadding:pi,selectedIndicatorWidth:3,userBadgePadding:$r,userBadgeDiameter:wo-$r*2,mobileSidebarHeight:56},Mn=e=>({...br,...e,iconContainerWidth:br.drawerWidthClosed,iconSize:br.drawerWidthClosed-br.iconPadding*2,userBadgeDiameter:br.drawerWidthClosed-br.userBadgePadding*2}),fi={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:br.defaultOpenDelayMs+200},va=e=>({...fi,...e}),Ma="@backstage/core/sidebar-intro-dismissed",pr=(0,f.createContext)({sidebarConfig:br,submenuConfig:fi}),gi=(0,f.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var ya=n(50023),qo=n(4190),mi=n(87685),jo=n(44882),Dr=n(51837);const uo={isOpen:!1,setOpen:()=>{}},ks=(0,f.createContext)(uo),_o=(0,Dr.CT)("sidebar-open-state-context");function es(e){const{children:o,value:l}=e;return(0,r.jsx)(ks.Provider,{value:l,children:(0,r.jsx)(_o.Provider,{value:(0,Dr.EI)({1:l}),children:o})})}const ts=()=>{const e=(0,f.useContext)(_o),o=(0,f.useContext)(ks);if(e===void 0)return o||uo;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l};var vi=n(57998);const Bs={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},$s=(0,f.createContext)(Bs),Ds=(0,Dr.CT)("sidebar-pin-state-context");function xa(e){const{children:o,value:l}=e;return(0,r.jsx)($s.Provider,{value:l,children:(0,r.jsx)(Ds.Provider,{value:(0,Dr.EI)({1:l}),children:o})})}const Eo=()=>{const e=(0,f.useContext)(Ds),o=(0,f.useContext)($s);if(e===void 0)return o||Bs;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l},yi=(0,g.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:o=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${o.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),ns=e=>{const{to:o,label:l,icon:d,value:m}=e,{sidebarConfig:x}=(0,f.useContext)(pr),I=yi({sidebarConfig:x}),$=(0,rr.TH)(),{selectedMenuItemIndex:Y,setSelectedMenuItemIndex:Z}=(0,f.useContext)(Us),fe=(Te,Ee)=>{Z(Ee===Y?-1:Ee)},pe=m===Y&&Y>=0||m!==Y&&!(Y>=0)&&o===$.pathname;return(0,r.jsx)(vi.Z,{"aria-label":l,label:l,icon:d,component:de.r,to:o||$.pathname,onChange:fe,value:m,selected:pe,classes:I})},Fs=e=>{const{children:o,to:l,label:d,icon:m,value:x}=e,{isMobile:I}=Eo();return I?(0,r.jsx)(ns,{to:l,label:d,icon:m,value:x}):(0,r.jsx)(r.Fragment,{children:o})},Ns=(0,g.Z)(e=>({root:{position:"fixed",backgroundColor:e.palette.navigation.background,color:e.palette.navigation.color,bottom:0,left:0,right:0,zIndex:e.zIndex.snackbar,borderTop:"1px solid #383838","@media print":{display:"none"}},overlay:o=>({background:e.palette.navigation.background,width:"100%",bottom:`${o.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${o.sidebarConfig.mobileSidebarHeight}px)`,flex:"0 1 auto",overflow:"auto"}),overlayHeader:{display:"flex",color:e.palette.text.primary,alignItems:"center",justifyContent:"space-between",padding:e.spacing(2,3)},overlayHeaderClose:{color:e.palette.text.primary},marginMobileSidebar:o=>({marginBottom:`${o.sidebarConfig.mobileSidebarHeight}px`})})),Zs=e=>(0,Kr.orderBy)(e,({props:{priority:o}})=>Number.isInteger(o)?o:-1,"desc"),xi=f.createElement(Fs).type,bi=({children:e,label:o="Menu",open:l,onClose:d})=>{const{sidebarConfig:m}=(0,f.useContext)(pr),x=Ns({sidebarConfig:m});return(0,r.jsxs)(qo.ZP,{anchor:"bottom",open:l,onClose:d,ModalProps:{BackdropProps:{classes:{root:x.marginMobileSidebar}}},classes:{root:x.marginMobileSidebar,paperAnchorBottom:x.overlay},children:[(0,r.jsxs)(A.Z,{className:x.overlayHeader,children:[(0,r.jsx)(rt.Z,{variant:"h3",children:o}),(0,r.jsx)(H.Z,{onClick:d,classes:{root:x.overlayHeaderClose},children:(0,r.jsx)(mi.Z,{})})]}),(0,r.jsx)(A.Z,{component:"nav",children:e})]})},Us=(0,f.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),Si=e=>{const{sidebarConfig:o}=(0,f.useContext)(pr),{children:l}=e,d=Ns({sidebarConfig:o}),m=(0,rr.TH)(),[x,I]=(0,f.useState)(-1);(0,f.useEffect)(()=>{I(-1)},[m.pathname]);let $=(0,p.vJ)(l,Z=>Z.getElements().filter(fe=>fe.type===xi));if(l)$.length?$=Zs($):$.push((0,r.jsx)(Fs,{icon:(0,r.jsx)(jo.Z,{}),children:l},"default_menu"));else return null;const Y=x>=0&&!$[x].props.to;return(0,r.jsx)(es,{value:{isOpen:!0,setOpen:()=>{}},children:(0,r.jsxs)(Us.Provider,{value:{selectedMenuItemIndex:x,setSelectedMenuItemIndex:I},children:[(0,r.jsx)(bi,{label:$[x]&&$[x].props.label,open:Y,onClose:()=>I(-1),children:$[x]&&$[x].props.children}),(0,r.jsx)(ya.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:$})]})})};var rs;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(rs||(rs={}));const Ms={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(rs.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(rs.SIDEBAR_PIN_STATE,JSON.stringify(e))}},Ci=(0,g.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:o=>o.isPinned?o.sidebarConfig.drawerWidthOpen:o.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:o=>o.sidebarConfig.mobileSidebarHeight},"@media print":{padding:"0px !important"}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),zs=(0,f.createContext)({content:{contentRef:void 0}});function wi(e){const[o,l]=(0,f.useState)(()=>Ms.getSidebarPinState()),{sidebarConfig:d}=(0,f.useContext)(pr),m=(0,f.useRef)(null),x=(0,f.useMemo)(()=>({content:{contentRef:m}}),[m]);(0,f.useEffect)(()=>{Ms.setSidebarPinState(o)},[o]);const I=(0,Pe.Z)(Z=>Z.breakpoints.down("xs"),{noSsr:!0}),$=()=>l(!o),Y=Ci({isPinned:o,sidebarConfig:d});return(0,r.jsx)(xa,{value:{isPinned:o,toggleSidebarPinState:$,isMobile:I},children:(0,r.jsx)(zs.Provider,{value:x,children:(0,r.jsx)(A.Z,{className:Y.root,children:e.children})})})}function os(){const{content:e}=(0,f.useContext)(zs);return{focusContent:(0,f.useCallback)(()=>{var l,d;e==null||(l=e.contentRef)===null||l===void 0||(d=l.current)===null||d===void 0||d.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const Ao=(0,g.Z)(e=>({drawer:{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:e.zIndex.appBar,background:e.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"},"@media print":{display:"none"}},drawerWidth:o=>({width:o.sidebarConfig.drawerWidthClosed}),drawerOpen:o=>({width:o.sidebarConfig.drawerWidthOpen,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shorter})}),visuallyHidden:{top:0,position:"absolute",zIndex:1e3,transform:"translateY(-200%)","&:focus":{transform:"translateY(5px)"}}}),{name:"BackstageSidebar"});var Jn;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Jn||(Jn={}));const ji=e=>{const{sidebarConfig:o}=(0,f.useContext)(pr),{openDelayMs:l=o.defaultOpenDelayMs,closeDelayMs:d=o.defaultCloseDelayMs,disableExpandOnHover:m,children:x}=e,I=Ao({sidebarConfig:o}),$=(0,Pe.Z)(mn=>mn.breakpoints.down("md"),{noSsr:!0}),[Y,Z]=(0,f.useState)(Jn.Closed),fe=(0,f.useRef)(),{isPinned:pe,toggleSidebarPinState:Te}=Eo(),Ee=()=>{pe||m||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),Y!==Jn.Open&&!$&&(fe.current=window.setTimeout(()=>{fe.current=void 0,Z(Jn.Open)},l),Z(Jn.Idle)))},Ze=()=>{pe||m||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),Y===Jn.Idle?Z(Jn.Closed):Y===Jn.Open&&(fe.current=window.setTimeout(()=>{fe.current=void 0,Z(Jn.Closed)},d)))},it=Y===Jn.Open&&!$||pe,Pt=mn=>{mn?(Z(Jn.Open),Te()):(Z(Jn.Closed),Te())};return(0,r.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,r.jsx)(Ai,{}),(0,r.jsx)(es,{value:{isOpen:it,setOpen:Pt},children:(0,r.jsx)(A.Z,{className:I.root,"data-testid":"sidebar-root",onMouseEnter:m?()=>{}:Ee,onFocus:m?()=>{}:Ee,onMouseLeave:m?()=>{}:Ze,onBlur:m?()=>{}:Ze,children:(0,r.jsx)(A.Z,{className:on()(I.drawer,I.drawerWidth,{[I.drawerOpen]:it}),children:x})})})]})},Ei=e=>{var o;const l=Mn((o=e.sidebarOptions)!==null&&o!==void 0?o:{});var d;const m=va((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:x,disableExpandOnHover:I,openDelayMs:$,closeDelayMs:Y}=e,{isMobile:Z}=Eo();return Z?(0,r.jsx)(Si,{children:x}):(0,r.jsx)(pr.Provider,{value:{sidebarConfig:l,submenuConfig:m},children:(0,r.jsx)(ji,{openDelayMs:$,closeDelayMs:Y,disableExpandOnHover:I,children:x})})};function Ai(){const{sidebarConfig:e}=(0,f.useContext)(pr),{focusContent:o,contentRef:l}=os(),d=Ao({sidebarConfig:e});return l!=null&&l.current?(0,r.jsx)(ge.Z,{onClick:o,variant:"contained",className:on()(d.visuallyHidden),children:"Skip to content"}):null}function Ti(e,o,l=!1){const d=new URLSearchParams(o.search).toString(),m=Ps().parse(d),x=new URLSearchParams(e.search).toString(),I=Ps().parse(x),$=l?Kr.isEqual:Kr.isMatch;return(0,Kr.isEqual)(o.pathname,e.pathname)&&$(I,m)}const ho=(0,g.Z)(e=>{var o,l;return{item:{height:48,width:"100%","&:hover":{background:((o=e.palette.navigation.navItem)===null||o===void 0?void 0:o.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:e.spacing(2.5),cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:e.palette.common.white},label:{margin:e.spacing(1.75),marginLeft:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:((l=e.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}},{name:"BackstageSidebarSubmenuItem"}),za=e=>{const{title:o,subtitle:l,to:d,icon:m,dropdownItems:x,exact:I}=e,$=ho(),{setIsHoveredOn:Y}=useContext(SidebarItemWithSubmenuContext),Z=()=>{Y(!1)},fe=useResolvedPath(d!=null?d:""),pe=useLocation();let Te=isLocationMatch(pe,fe,I);const[Ee,Ze]=useState(!1),it=()=>{Ze(!Ee)};return x!==void 0?(x.some(Pt=>{const mn=resolvePath(Pt.to);return Te=isLocationMatch(pe,mn,I),Te}),_jsxs(Box,{className:$.itemContainer,children:[_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:it,onTouchStart:Pt=>Pt.stopPropagation(),className:classnames($.item,Te?$.selected:void 0),children:[m&&_jsx(m,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",component:"span",className:$.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",component:"span",className:$.subtitle,children:l})]}),Ee?_jsx(ArrowDropUpIcon,{className:$.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:$.dropdownArrow})]})}),x&&Ee&&_jsx(Box,{className:$.dropdown,children:x.map((Pt,mn)=>_jsx(Tooltip,{title:Pt.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:Pt.to,underline:"none",className:$.dropdownItem,onClick:Z,onTouchStart:$n=>$n.stopPropagation(),children:_jsx(Typography,{component:"span",className:$.textContent,children:Pt.title})})},mn))})]})):_jsx(Box,{className:$.itemContainer,children:_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames($.item,Te?$.selected:void 0),onClick:Z,onTouchStart:Pt=>Pt.stopPropagation(),children:[m&&_jsx(m,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",component:"span",className:$.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",component:"span",className:$.subtitle,children:l})]})]})})})};var Ws;const Ri=(0,g.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:o=>{var l;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:o.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(Ws=(l=e.palette.navigation.submenu)===null||l===void 0?void 0:l.background)!==null&&Ws!==void 0?Ws:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:o.submenuConfig.drawerWidthClosed,transitionDelay:`${o.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:o=>({width:o.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium,color:e.palette.common.white,padding:e.spacing(2.5),[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),Ii=e=>{const{isOpen:o}=ts(),{sidebarConfig:l,submenuConfig:d}=(0,f.useContext)(pr),m=o?l.drawerWidthOpen:l.drawerWidthClosed,x=Ri({left:m,submenuConfig:d}),{isHoveredOn:I}=(0,f.useContext)(gi),[$,Y]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{Y(I)},[I]),(0,r.jsxs)(A.Z,{className:on()(x.drawer,{[x.drawerOpen]:$}),children:[(0,r.jsx)(rt.Z,{variant:"h5",component:"span",className:x.title,children:e.title}),e.children]})};var Vs=n(26739),ss=n(76600),ba=n(83543),Hs=n(59797),is=n(98989);const Pi=(0,g.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Sa=()=>{const e=Pi();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})})]})};var as=null;const Ca=(0,g.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Wa=()=>{const e=Ca();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 Va=null,Gs,ls;const zn=e=>(0,g.Z)(o=>{var l,d;return{root:{color:o.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit",textTransform:"none"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[o.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(Gs=(l=o.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)!==null&&Gs!==void 0?Gs:"#404040"}},highlighted:{background:(ls=(d=o.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&ls!==void 0?ls:"#404040"},label:{fontWeight:"bold",whiteSpace:"nowrap",lineHeight:"auto",flex:"3 1 auto",width:"110px",overflow:"hidden","text-overflow":"ellipsis"},iconContainer:{boxSizing:"border-box",height:"100%",width:e.iconContainerWidth,marginRight:-o.spacing(2),display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"0"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:o.typography.fontWeightBold,fontSize:o.typography.fontSize},searchFieldHTMLInput:{padding:o.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:o.spacing(6),textAlign:"center",marginRight:o.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:o.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${o.palette.navigation.indicator}`,color:o.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function cs(e){return(0,f.useMemo)(()=>zn(e),[e])()}const Li=(e,o)=>(0,p.vJ)(e.props.children,l=>{let d=!1;return l.getElements().forEach(({props:{to:m,dropdownItems:x}})=>{if(!d){if(x!=null&&x.length){x.forEach(({to:I})=>d=d||Ti(o,(0,Xo.i3)(I)));return}m&&(d=Ti(o,(0,Xo.i3)(m)))}}),d},[o.pathname]);function Ks(e){return e.to===void 0}const wa=f.createElement(Ii).type,ja=f.forwardRef(function({to:o,end:l,style:d,className:m,activeStyle:x,caseSensitive:I,activeClassName:$="active","aria-current":Y="page",...Z},fe){let{pathname:pe}=(0,rr.TH)(),{pathname:Te}=(0,rr.WU)(o);I||(pe=pe.toLocaleLowerCase("en-US"),Te=Te.toLocaleLowerCase("en-US"));let Ee=pe===Te;!Ee&&!l&&(Ee=pe.startsWith(`${Te}/`));const Ze=Ee?Y:void 0;return(0,r.jsx)(N.rU,{...Z,to:o,ref:fe,"aria-current":Ze,style:{...d,...Ee?x:void 0},className:on()([m,Ee?$:void 0])})}),Oi=(0,f.forwardRef)((e,o)=>{const{icon:l,text:d,hasNotifications:m=!1,hasSubmenu:x=!1,disableHighlight:I=!1,onClick:$,noTrack:Y,children:Z,className:fe,...pe}=e,{sidebarConfig:Te}=(0,f.useContext)(pr),Ee=cs(Te),{isOpen:Ze}=ts(),it=!Ze&&x?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},Pt=(0,r.jsxs)(A.Z,{style:it,children:[(0,r.jsx)(l,{fontSize:"small"}),!Ze&&x?(0,r.jsx)(is.Z,{fontSize:"small"}):(0,r.jsx)(r.Fragment,{})]}),mn=(0,r.jsx)(Vs.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!m,className:on()({[Ee.closedItemIcon]:!Ze}),children:Pt}),$n=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{"data-testid":"login-button",className:Ee.iconContainer,children:mn}),d&&(0,r.jsx)(rt.Z,{variant:"subtitle2",component:"span",className:Ee.label,children:d}),(0,r.jsx)("div",{className:Ee.secondaryAction,children:Z})]}),or=Ze?$n:mn,Bt={onClick:$,className:on()(fe,Ee.root,Ze?Ee.open:Ee.closed,Ks(e)&&Ee.buttonItem,{[Ee.highlightable]:!I})},vn=(0,p.z$)(),{pathname:yn}=(0,rr.WU)(!Ks(e)&&e.to?e.to:""),gr=(0,f.useCallback)(wr=>{if(!Y){const jr="click",Er=d!=null?d:"Sidebar Item",ms=yn?{attributes:{to:yn}}:void 0;vn.captureEvent(jr,Er,ms)}$==null||$(wr)},[vn,d,yn,Y,$]);return Ks(e)?(0,r.jsx)(ge.Z,{role:"button","aria-label":d,...Bt,ref:o,onClick:gr,children:or}):(0,r.jsx)(ja,{...Bt,activeClassName:Ee.selected,to:e.to?e.to:"",ref:o,"aria-label":d||e.to,...pe,onClick:gr,children:or})}),Ea=({children:e,...o})=>{const{sidebarConfig:l}=(0,f.useContext)(pr),d=cs(l),[m,x]=(0,f.useState)(!1),I=(0,rr.TH)(),$=Li(e,I),Y=(0,Pe.Z)(Te=>Te.breakpoints.down("sm")),Z=()=>{x(!0)},fe=()=>{x(!1)},pe=()=>Y?m?(0,r.jsx)(Hs.Z,{fontSize:"small",className:d.submenuArrow}):(0,r.jsx)(ba.Z,{fontSize:"small",className:d.submenuArrow}):!m&&(0,r.jsx)(is.Z,{fontSize:"small",className:d.submenuArrow});return(0,r.jsx)(gi.Provider,{value:{isHoveredOn:m,setIsHoveredOn:x},children:(0,r.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:fe,onTouchStart:m?fe:Z,onMouseEnter:Z,className:on()(m&&d.highlighted),children:[(0,r.jsx)(Oi,{hasSubmenu:!0,className:$?d.selected:"",...o,children:pe()}),m&&e]})})},ki=(0,f.forwardRef)((e,o)=>{const[l]=(0,p.vJ)(e.children,d=>d.getElements().filter(m=>m.type===wa));return l?(0,r.jsx)(Ea,{...e,children:l}):(0,r.jsx)(Oi,{...e,ref:o})});function Ha(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),[l,d]=useState(""),m=cs(o),x=e.icon?e.icon:SearchIcon,I=()=>{e.onSearch(l),d("")},$=pe=>{pe.key==="Enter"&&(pe.preventDefault(),I())},Y=pe=>{d(pe.target.value)},Z=pe=>{pe.preventDefault(),pe.stopPropagation()},fe=pe=>{I(),pe.preventDefault()};return _jsx(Box,{className:m.searchRoot,children:_jsx(ki,{icon:x,to:e.to,onClick:fe,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:l,onClick:Z,onChange:Y,onKeyDown:$,className:m.searchContainer,InputProps:{disableUnderline:!0,className:m.searchField},inputProps:{className:m.searchFieldHTMLInput}})})})}const Ga=(0,ss.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),Ka=(0,ss.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),Aa=(0,ss.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),Ta=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.secondary,borderRadius:"5px"}}),Ya=(0,ss.Z)("div")(({theme:e})=>{const o=Ta(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":o,"&:hover":o}}),Bi=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),o=cs(e),{isOpen:l,setOpen:d}=useSidebarOpenState();if(useMediaQuery(I=>I.breakpoints.down("md"),{noSsr:!0}))return null;const x=()=>{d(!l)};return _jsx(Button,{role:"button",onClick:x,className:o.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:o.arrows,children:l?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},$i=(0,g.Z)(e=>({introCard:o=>({color:"#b5b5b5",fontSize:12,width:o.sidebarConfig.drawerWidthOpen,marginTop:e.spacing(2.25),marginBottom:e.spacing(1.5),paddingLeft:o.sidebarConfig.iconPadding,paddingRight:o.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:e.spacing(1.5)},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:e.spacing(.5),"&:hover":{color:e.palette.linkHover,transition:e.transitions.create("color",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:e.spacing(1.5)}}),{name:"BackstageSidebarIntro"});function Di(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),l=$i({sidebarConfig:o}),{text:d,onClose:m}=e,x=()=>m();return _jsxs(Box,{className:l.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:d}),_jsx(Box,{className:l.introDismiss,children:_jsxs(IconButton,{onClick:x,className:l.introDismissLink,children:[_jsx(CloseIcon,{className:l.introDismissIcon}),_jsx(Typography,{component:"span",className:l.introDismissText,children:"Dismiss"})]})})]})}const Ys=e=>{const{text:o,onDismiss:l}=e,[d,m]=useState(!1),x=()=>{m(!0)};return _jsx(Collapse,{in:!d,onExited:l,children:_jsx(Di,{text:o,onClose:x})})},Fi=null,Ni="And your recently viewed plugins will pop up here!";function Ra(e){const{isOpen:o}=useSidebarOpenState(),l={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:d,set:m}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:x,recentlyViewedItemsDismissed:I}=d!=null?d:{},$=()=>{m(Z=>({...l,...Z,starredItemsDismissed:!0}))},Y=()=>{m(Z=>({...l,...Z,recentlyViewedItemsDismissed:!0}))};return o?_jsxs(_Fragment,{children:[!x&&_jsxs(_Fragment,{children:[_jsx(Ys,{text:Fi,onDismiss:$}),_jsx(SidebarDivider,{})]}),!I&&_jsx(Ys,{text:Ni,onDismiss:Y})]}):null}const Zi=(0,g.Z)(e=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:e.spacing(3),paddingBottom:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function Js(e){const{className:o,stretch:l,noPadding:d,children:m,...x}=e,{contentRef:I}=os(),$=Zi();return(0,r.jsx)("article",{ref:I,tabIndex:-1,...x,className:on()($.root,o,{[$.stretch]:l,[$.noPadding]:d}),children:m})}var Ui=n(6487),Ia=n(99152);const Mi=(0,g.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{...e.typography.caption,padding:e.spacing(3,3),textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,color:e.palette.text.secondary},selected:{color:e.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:e.palette.background.default,color:e.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function Qs(e){const{tabs:o,onChange:l,selectedIndex:d}=e,[m,x]=(0,f.useState)(d!=null?d:0),I=Mi(),$=(0,f.useCallback)((Y,Z)=>{d===void 0&&x(Z),l&&d!==Z&&l(Z)},[d,l]);return(0,f.useEffect)(()=>{d!==void 0&&x(d)},[d]),(0,r.jsx)(A.Z,{className:I.tabsWrapper,children:(0,r.jsx)(Ia.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:$,value:m,children:o.map((Y,Z)=>(0,f.createElement)(Ui.Z,{...Y.tabProps,"data-testid":`header-tab-${Z}`,label:Y.label,key:Y.id,value:Z,className:I.defaultTab,classes:{selected:I.selected,root:I.tabRoot}}))})})}function Pa(e){const o=(0,rr.UO)(),d=e.map(({path:Te,children:Ee})=>({caseSensitive:!1,path:`${Te}/*`,element:Ee})).sort((Te,Ee)=>Ee.path.replace(/\/\*$/,"").localeCompare(Te.path.replace(/\/\*$/,"")));var m;const x=(m=(0,rr.V$)(d))!==null&&m!==void 0?m:e[0].children;var I;let $=(I=o["*"])!==null&&I!==void 0?I:"";$.startsWith("/")||($=`/${$}`);var Y;const[Z]=(Y=(0,Xo.fp)(d,$))!==null&&Y!==void 0?Y:[],fe=Z?e.findIndex(Te=>`${Te.path}/*`===Z.route.path):0;var pe;return{index:fe===-1?0:fe,element:x,route:(pe=e[fe])!==null&&pe!==void 0?pe:e[0]}}function Xs(e){const{routes:o}=e,l=(0,rr.s0)(),{index:d,route:m,element:x}=Pa(o),I=(0,f.useMemo)(()=>o.map(Y=>({id:Y.path,label:Y.title,tabProps:Y.tabProps})),[o]),$=Y=>{let{path:Z}=o[Y];Z=Z.replace(/\/\*$/,""),Z=Z.replace(/^\//,""),l(Z)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Qs,{tabs:I,selectedIndex:d,onChange:$}),(0,r.jsxs)(Js,{children:[(0,r.jsx)(Jr.q,{title:m.title}),x]})]})}const ds=()=>null;(0,p.R5)(ds,"core.gatherMountPoints",!0);function _s(e){const o=(0,r.jsx)(ds,{path:"",title:"",children:(0,r.jsx)("div",{})}).type;return f.Children.toArray(e).flatMap(l=>{if(!(0,f.isValidElement)(l))return[];if(l.type===f.Fragment)return _s(l.props.children);if(l.type!==o)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:m,children:x,tabProps:I}=l.props;return[{path:d,title:m,children:x,tabProps:I}]})}function zi(e){const o=_s(e.children);return(0,r.jsx)(Xs,{routes:o})}zi.Route=ds;const Wi=(0,g.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function Vi(e){const{value:o,subvalue:l}=e,d=Wi();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{className:d.value,children:o}),(0,r.jsx)(A.Z,{className:d.subvalue,children:l})]})}var To=n(67222),fr=n(21070),Hi=n(90324),Gi=n(98281),Ki=n(48049),us=n(51209),ei=n(33375),Yi=n(44233),Ji=n(27604),hs=n(36444),La=n(37971),Qi=n(59709),i=n(17373),t=n(3702),s=n(93111);const a=(0,g.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:e.spacing(7.5),justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),h=e=>{var o;const l=a(),{onChangeFilters:d}=e,[m,x]=(0,f.useState)({...e.selectedFilters}),[I,$]=(0,f.useState)(!1),Y=()=>{x({}),$(Z=>!Z)};return(0,f.useEffect)(()=>{d(m)},[m,d]),(0,r.jsxs)(A.Z,{className:l.root,children:[(0,r.jsxs)(A.Z,{className:l.header,children:[(0,r.jsx)(A.Z,{className:l.value,children:"Filters"}),(0,r.jsx)(ge.Z,{color:"primary",onClick:Y,children:"Clear all"})]}),(0,r.jsx)(A.Z,{className:l.filters,children:((o=e.filters)===null||o===void 0?void 0:o.length)&&e.filters.map(Z=>(0,r.jsx)(bo,{triggerReset:I,...Z.element,selected:m[Z.element.label],onChange:fe=>x({...m,[Z.element.label]:fe})},Z.element.label))})]})},w={Add:(0,f.forwardRef)((e,o)=>(0,r.jsx)(fr.Z,{...e,ref:o})),Check:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Gi.Z,{...e,ref:o})),Clear:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ei.Z,{...e,ref:o})),Delete:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Yi.Z,{...e,ref:o})),DetailPanel:(0,f.forwardRef)((e,o)=>(0,r.jsx)(us.Z,{...e,ref:o})),Edit:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Ji.Z,{...e,ref:o})),Export:(0,f.forwardRef)((e,o)=>(0,r.jsx)(t.Z,{...e,ref:o})),Filter:(0,f.forwardRef)((e,o)=>(0,r.jsx)(hs.Z,{...e,ref:o})),FirstPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(La.Z,{...e,ref:o})),LastPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Qi.Z,{...e,ref:o})),NextPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(us.Z,{...e,ref:o})),PreviousPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Ki.Z,{...e,ref:o})),ResetSearch:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ei.Z,{...e,ref:o})),Search:(0,f.forwardRef)((e,o)=>(0,r.jsx)(hs.Z,{...e,ref:o})),SortArrow:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Hi.Z,{...e,ref:o})),ThirdStateCheck:(0,f.forwardRef)((e,o)=>(0,r.jsx)(i.Z,{...e,ref:o})),ViewColumn:(0,f.forwardRef)((e,o)=>(0,r.jsx)(s.Z,{...e,ref:o}))};function k(e,o){const l=o.split(".");let d=e[l[0]];for(let m=1;m<l.length;++m){if(d===void 0)return d;const x=l[m];d=d[x]}return d}const F=(0,On.Z)(e=>({header:{padding:e.spacing(1,2,1,2.5),borderTop:`1px solid ${e.palette.grey.A100}`,borderBottom:`1px solid ${e.palette.grey.A100}`,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(To.W$),se=(0,On.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"})(To.UW),be=(0,g.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Re=(0,g.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function ze(e,o){return e.map(l=>{var d;const m=(d=l.headerStyle)!==null&&d!==void 0?d:{};let x=l.cellStyle||{};if(l.highlight)if(m.color=o.palette.textContrast,typeof x=="object")x.fontWeight=o.typography.fontWeightBold;else{const I=x;x=($,Y,Z)=>({...I($,Y,Z),fontWeight:o.typography.fontWeightBold})}return{...l,headerStyle:m,cellStyle:x}})}function mt(e,o){return(0,Kr.transform)(e,(l,d,m)=>{(0,Kr.isEqual)(d,o[m])||(l[m]=d)})}const St={search:"",filtersOpen:!1,filters:{}};function Et(e){const{toolbarRef:o,setSearch:l,hasFilters:d,selectedFiltersLength:m,toggleFilters:x}=e,I=be(),$=(0,f.useCallback)(Y=>{e.onSearchChanged(Y),l(Y)},[e,l]);return d?(0,r.jsxs)(A.Z,{className:I.root,children:[(0,r.jsxs)(A.Z,{className:I.root,children:[(0,r.jsx)(H.Z,{onClick:x,"aria-label":"filter list",children:(0,r.jsx)(hs.Z,{})}),(0,r.jsxs)(rt.Z,{className:I.title,children:["Filters (",m,")"]})]}),(0,r.jsx)(se,{...e,ref:o,onSearchChanged:$})]}):(0,r.jsx)(se,{...e,ref:o,onSearchChanged:$})}function Wt(e){const{data:o,columns:l,options:d,title:m,subtitle:x,filters:I,initialState:$,emptyContent:Y,onStateChange:Z,components:fe,...pe}=e,Te=Re(),Ee=(0,ae.Z)(),Ze={...St,...$},[it,Pt]=(0,f.useState)(Ze.filtersOpen),mn=(0,f.useCallback)(()=>Pt(Vn=>!Vn),[Pt]),[$n,or]=(0,f.useState)(0),[Bt,vn]=(0,f.useState)(o),[yn,gr]=(0,f.useState)(Ze.filters),wr=ze(l,Ee),[jr,Er]=(0,f.useState)(Ze.search);(0,f.useEffect)(()=>{if(Z){const Vn=mt({search:jr,filtersOpen:it,filters:yn},St);Z(Vn)}},[jr,it,yn,Z]);const ms={headerStyle:{textTransform:"uppercase"}},Xr=(0,f.useCallback)(Vn=>{var Lr;return(Lr=l.find(po=>po.title===Vn))===null||Lr===void 0?void 0:Lr.field},[l]);(0,f.useEffect)(()=>{if(typeof o=="function")return;if(!yn){vn(o);return}const Vn=Object.values(yn);if(o&&Vn.flat().length){const Lr=o.filter(po=>!!Object.entries(yn).filter(([,fo])=>!!fo.length).every(([fo,An])=>{const kn=k(po,Xr(fo));return Array.isArray(kn)&&Array.isArray(An)?kn.some(Lo=>An.includes(Lo)):Array.isArray(kn)?kn.includes(An):Array.isArray(An)?An.includes(kn):kn===An}));vn(Lr)}else vn(o);or(Vn.flat().length)},[o,yn,Xr]);const oa=(Vn,Lr)=>{const po=An=>{const kn=new Set,Lo=go=>{go!=null&&kn.add(go)};return Lr&&Lr.forEach(go=>{const vs=k(go,Xr(An));Array.isArray(vs)?vs.forEach(Lo):Lo(vs)}),kn},fo=An=>({placeholder:"All results",label:An.column,multiple:An.type==="multiple-select",items:[...po(An.column)].sort().map(kn=>({label:kn,value:kn}))});return Vn.map(An=>({type:An.type,element:fo(An)}))},un=!!(I!=null&&I.length),Po=(0,f.useCallback)(Vn=>(0,r.jsx)(Et,{setSearch:Er,hasFilters:un,selectedFiltersLength:$n,toggleFilters:mn,...Vn}),[mn,un,$n,Er]),ti=typeof o!="function"&&o.length===0,qr=l.length,sa=(0,f.useCallback)(Vn=>Y&&ti?(0,r.jsx)("tbody",{children:(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:qr,children:Y})})}):(0,r.jsx)(To.os,{...Vn}),[ti,Y,qr]);return(0,r.jsxs)(A.Z,{className:Te.root,children:[it&&o&&typeof o!="function"&&(I==null?void 0:I.length)&&(0,r.jsx)(h,{filters:oa(I,o),selectedFilters:yn,onChangeFilters:gr}),(0,r.jsx)(To.ZP,{components:{Header:F,Toolbar:Po,Body:sa,...fe},options:{...ms,...d},columns:wr,icons:w,title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rt.Z,{variant:"h5",component:"h2",children:m}),x&&(0,r.jsx)(rt.Z,{color:"textSecondary",variant:"body1",children:x})]}),data:typeof o=="function"?o:Bt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...pe})]})}Wt.icons=Object.freeze(w);var Ht=n(44311);function Wn(e,o){const l=e[e.length-1];if(l)return l>=.9?o.palette.status.ok:l>=.5?o.palette.status.warning:o.palette.status.error}function Sr(e){const o=useTheme();if(!e.data)return null;var l;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(l=e.color)!==null&&l!==void 0?l:Wn(e.data,o)})]})}const Cr=e=>(0,g.Z)(o=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:o.spacing(2),textAlign:e.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:o.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),Ro=({title:e="Unknown page",className:o})=>(0,r.jsx)(rt.Z,{variant:"h4",component:"h2",className:o,"data-testid":"header-title",children:e});function Xi(e){const{description:o,title:l,titleComponent:d=void 0,children:m,textAlign:x="left"}=e,I=Cr({textAlign:x})(),$=d||(0,r.jsx)(Ro,{title:l,className:I.title});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Jr.q,{title:l}),(0,r.jsxs)(A.Z,{className:I.container,children:[(0,r.jsxs)(A.Z,{className:I.leftItemsBox,children:[$,o&&(0,r.jsx)(rt.Z,{className:I.description,variant:"body2",children:o})]}),(0,r.jsx)(A.Z,{className:I.rightItemsBox,children:m})]})]})}var qi=n.p+"static/mic-drop.fe3ef4d0..svg";const ps=(0,g.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),_i=()=>{const e=ps();return(0,r.jsx)("img",{src:qi,className:e.micDrop,alt:"Girl dropping mic from her hands"})},Qr=(0,g.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:e.typography.h3.fontSize}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function Ja(e){const{status:o,statusMessage:l,additionalInfo:d,supportUrl:m}=e,x=Qr(),I=(0,rr.s0)(),$=co();return(0,r.jsxs)(Jt.Z,{container:!0,spacing:0,className:x.container,children:[(0,r.jsxs)(Jt.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,r.jsxs)(rt.Z,{"data-testid":"error",variant:"body1",className:x.subtitle,children:["ERROR ",o,": ",l]}),(0,r.jsx)(rt.Z,{variant:"body1",className:x.subtitle,children:d}),(0,r.jsx)(rt.Z,{variant:"h2",className:x.title,children:"Looks like someone dropped the mic!"}),(0,r.jsxs)(rt.Z,{variant:"h6",children:[(0,r.jsx)(de.r,{to:"#","data-testid":"go-back-link",onClick:()=>I(-1),children:"Go back"}),"... or please"," ",(0,r.jsx)(de.r,{to:m||$.url,children:"contact support"})," if you think this is a bug."]})]}),(0,r.jsx)(_i,{})]})}var Qa=n(16173);const Xa=(0,On.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(rt.Z),ea=(0,On.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(A.Z);function qa(e){const{children:o,...l}=e,[d,m]=f.useState(null),x=f.Children.toArray(o),[I,$,...Y]=x,Z=Y.length?Y.pop():x[x.length-1],fe=x.length>3,pe=Ze=>{m(Ze.currentTarget)},Te=()=>{m(null)},Ee=Boolean(d);return(0,r.jsxs)(f.Fragment,{children:[(0,r.jsxs)(Qa.Z,{"aria-label":"breadcrumb",...l,children:[x.length>1&&(0,r.jsx)(ea,{clone:!0,children:I}),x.length>2&&(0,r.jsx)(ea,{clone:!0,children:$}),fe&&(0,r.jsx)(Xa,{onClick:pe,children:"..."}),(0,r.jsx)(A.Z,{style:{fontStyle:"italic"},children:Z})]}),(0,r.jsx)(tr.ZP,{open:Ee,anchorEl:d,onClose:Te,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,r.jsx)(Ft.Z,{children:Y.map((Ze,it)=>(0,r.jsx)(Vt.Z,{button:!0,children:(0,r.jsx)(ea,{clone:!0,children:Ze})},it))})})]})}const _a=(0,g.Z)(e=>({header:{gridArea:"pageHeader",padding:e.spacing(3),width:"100%",boxShadow:e.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:e.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[e.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto",alignItems:"center"},title:{color:e.page.fontColor,wordBreak:"break-word",fontSize:e.typography.h3.fontSize,marginBottom:0},subtitle:{color:e.page.fontColor,opacity:.8,display:"inline-block",marginTop:e.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:e.spacing(1),color:e.page.fontColor},breadcrumb:{color:e.page.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-e.spacing(.3),marginBottom:e.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-e.spacing(.3),marginBottom:e.spacing(.3)}}),{name:"BackstageHeader"}),el=({type:e,typeLink:o,classes:l,pageTitle:d})=>e?o?(0,r.jsxs)(qa,{className:l.breadcrumb,children:[(0,r.jsx)(de.r,{to:o,children:e}),(0,r.jsx)(rt.Z,{children:d})]}):(0,r.jsx)(rt.Z,{className:l.type,children:e}):null,tl=({pageTitle:e,classes:o,tooltip:l})=>{const d=(0,r.jsx)(rt.Z,{className:o.title,variant:"h1",children:e});return l?(0,r.jsx)(T.ZP,{title:l,placement:"top-start",children:d}):d},nl=({classes:e,subtitle:o})=>o?typeof o!="string"?(0,r.jsx)(r.Fragment,{children:o}):(0,r.jsx)(rt.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:o}):null;function Oa(e){const{children:o,pageTitleOverride:l,style:d,subtitle:m,title:x,tooltip:I,type:$,typeLink:Y}=e,Z=_a(),pe=(0,p.h_)(p.Ds).getOptionalString("app.title")||"Backstage",Te=l||x,Ee=x||l,Ze=`${Te} | %s | ${pe}`,it=`${Te} | ${pe}`;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Jr.q,{titleTemplate:Ze,defaultTitle:it}),(0,r.jsxs)("header",{style:d,className:Z.header,children:[(0,r.jsxs)(A.Z,{className:Z.leftItemsBox,children:[(0,r.jsx)(el,{classes:Z,type:$,typeLink:Y,pageTitle:Ee}),(0,r.jsx)(tl,{classes:Z,pageTitle:Ee,tooltip:I}),(0,r.jsx)(nl,{classes:Z,subtitle:m})]}),(0,r.jsx)(Jt.Z,{container:!0,className:Z.rightItemsBox,spacing:4,children:o})]})]})}const rl=({label:e,secondaryLabel:o,icon:l,disabled:d=!1,onClick:m})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:d,button:!0,onClick:x=>{m&&m(x)},children:[l&&_jsx(ListItemIcon,{children:l}),_jsx(ListItemText,{primary:e,secondary:o})]})});function $l(e){const{palette:{common:{white:o}}}=useTheme(),{actionItems:l}=e,[d,m]=React.useState(!1),x=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>m(!0),"data-testid":"header-action-menu",ref:x,style:{color:o,height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:d,anchorEl:x.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>m(!1),children:_jsx(List,{children:l.map((I,$)=>_jsx(rl,{...I},`header-action-menu-${$}`))})})]})}const ol=(0,g.Z)(e=>({root:{textAlign:"left"},label:{color:e.page.fontColor,fontWeight:e.typography.fontWeightBold,letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:(0,Xt.Fq)(e.page.fontColor,.8),fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),sl=({value:e,className:o})=>(0,r.jsx)(rt.Z,{component:typeof e=="string"?"p":"span",className:o,children:e});function il(e){const{label:o,value:l,url:d}=e,m=ol(),x=(0,r.jsx)(sl,{className:m.value,value:l||"<Unknown>"});return(0,r.jsx)(Jt.Z,{item:!0,children:(0,r.jsxs)(rt.Z,{component:"span",className:m.root,children:[(0,r.jsx)(rt.Z,{className:m.label,children:o}),d?(0,r.jsx)(de.r,{to:d,children:x}):x]})})}const al=e=>(0,Yn.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),ll=(0,g.Z)(al,{name:"BackstageItemCardHeader"});function cl(e){const{title:o,subtitle:l,children:d}=e,m=ll(e);return(0,r.jsxs)(A.Z,{className:m.root,children:[l&&(0,r.jsx)(rt.Z,{variant:"subtitle2",component:"h3",children:l}),o&&(0,r.jsx)(rt.Z,{variant:"h6",component:"h4",children:o}),d]})}function Dl(e){const{description:o,tags:l,title:d,type:m,subtitle:x,label:I,onClick:$,href:Y}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:d,subtitle:x||m})}),_jsxs(CardContent,{children:[l!=null&&l.length?_jsx(Box,{children:l.map((Z,fe)=>_jsx(Chip,{size:"small",label:Z},fe))}):null,o]}),_jsxs(CardActions,{children:[!Y&&_jsx(LinkButton,{to:"#",onClick:$,color:"primary",children:I}),Y&&_jsx(LinkButton,{to:Y,color:"primary",children:I})]})]})}const dl=e=>(0,Yn.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),ul=(0,g.Z)(dl,{name:"BackstageItemCardGrid"});function hl(e){const{children:o,...l}=e,d=ul(l);return(0,r.jsx)(A.Z,{className:d.root,...l,children:o})}var pl=n(41547);const fl=(0,g.Z)(e=>({root:{display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",overflowY:"auto",height:"100vh",[e.breakpoints.down("xs")]:{height:"100%"},"@media print":{display:"block",height:"auto",overflowY:"inherit"}}}),{name:"BackstagePage"});function ka(e){const{themeId:o,children:l}=e,d=fl();return(0,r.jsx)(pl.Z,{theme:m=>({...m,page:m.getPageTheme({themeId:o})}),children:(0,r.jsx)("main",{className:d.root,children:l})})}function gl(e){const{themeId:o,children:l,...d}=e;return(0,r.jsxs)(ka,{themeId:o,children:[(0,r.jsx)(Oa,{...d}),l]})}var _n=n(30195);const Fl=_n.z.object({providerInfo:_n.z.object({}).catchall(_n.z.unknown()).optional(),profile:_n.z.object({email:_n.z.string().optional(),displayName:_n.z.string().optional(),picture:_n.z.string().optional()}),backstageIdentity:_n.z.object({token:_n.z.string(),identity:_n.z.object({type:_n.z.literal("user"),userEntityRef:_n.z.string(),ownershipEntityRefs:_n.z.array(_n.z.string())})})}),Ba={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function ml(e){const o=new Date(Date.now()+Ba.defaultTokenExpiryMillis);if(!e)return o;const[l,d,m]=e.split("."),x=JSON.parse(window.atob(d));return typeof x.exp!="number"?o:new Date(x.exp*1e3-Ba.tokenExpiryMarginMillis)}class Nl{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:o}=this.getSessionSync(),l=o.identity.userEntityRef,d=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(l);if(!d)throw new TypeError(`Invalid user entity reference "${l}"`);return d[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const o=this.state.type==="active"?this.state.session:void 0,l=this.fetchSession().then(d=>(this.state={type:"active",session:d,expiresAt:ml(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:l,previous:o},l}async fetchSession(){const o=await this.options.discoveryApi.getBaseUrl("auth"),l=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,d=new Headers(l);d.set("X-Requested-With","XMLHttpRequest");const m=await fetch(`${o}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:d,credentials:"include"});if(!m.ok)throw await ResponseError.fromResponse(m);return proxiedSessionSchema.parse(await m.json())}constructor(o){_define_property(this,"options",void 0),_define_property(this,"abortController",void 0),_define_property(this,"state",void 0),this.options=o,this.abortController=new AbortController,this.state={type:"empty"}}}const Zl=e=>{const o=useApi(discoveryApiRef),[{status:l,error:d},{execute:m}]=useAsync(async()=>{const x=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:o,headers:e.headers});await x.start(),e.onSignInSuccess(x)});return useMountEffect(m),l==="loading"?_jsx(Progress,{}):d?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},vl=(0,g.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),ta=({children:e})=>{const o=vl();return(0,r.jsx)(Jt.Z,{component:"li",item:!0,classes:o,children:e})};var fs=n(87612);class na{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 yl(e){const[o,l,d]=e.split(".");return JSON.parse(window.atob(l))}class ra{getUserId(){return this.result.userId}static fromResult(o){return new ra(o)}async getIdToken(){var o,l;return(l=(o=this.result).getIdToken)===null||l===void 0?void 0:l.call(o)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const o=await this.getIdToken();if(!o){const m=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:m,ownershipEntityRefs:[m]}}const{sub:l,ent:d}=yl(o);return{type:"user",userEntityRef:l,ownershipEntityRefs:d!=null?d:[]}}async getCredentials(){var o,l;return{token:await((l=(o=this.result).getIdToken)===null||l===void 0?void 0:l.call(o))}}async signOut(){var o,l;return(l=(o=this.result).signOut)===null||l===void 0?void 0:l.call(o)}constructor(o){(0,fs._)(this,"result",void 0),this.result=o}}class gs{static createGuest(){return new na}static fromLegacy(o){return ra.fromResult(o)}static create(o){return new gs(o.identity,o.authApi,o.profile)}getUserId(){const o=this.identity.userEntityRef,l=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(o);if(!l)throw new TypeError(`Invalid user entity reference "${o}"`);return l[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(o){throw this.profilePromise=void 0,o}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(o,l,d){(0,fs._)(this,"identity",void 0),(0,fs._)(this,"authApi",void 0),(0,fs._)(this,"profile",void 0),(0,fs._)(this,"profilePromise",void 0),this.identity=o,this.authApi=l,this.profile=d}}const xl={Component:({config:e,onSignInStarted:o,onSignInSuccess:l,onSignInFailure:d})=>{const{apiRef:m,title:x,message:I}=e,$=(0,p.h_)(m),Y=(0,p.h_)(p.VE),Z=async()=>{try{o();const fe=await $.getBackstageIdentity({instantPopup:!0});if(!fe)throw d(),new Error(`The ${x} provider is not configured to support sign-in`);const pe=await $.getProfile();l(gs.create({identity:fe.identity,profile:pe,authApi:$}))}catch(fe){d(),Y.post(new _r.SP("Login failed",fe))}};return(0,r.jsx)(ta,{children:(0,r.jsx)(lr,{variant:"fullHeight",title:x,actions:(0,r.jsx)(ge.Z,{color:"primary",variant:"outlined",onClick:Z,children:"Sign In"}),children:(0,r.jsx)(rt.Z,{variant:"body1",children:I})})})},loader:async(e,o)=>{const l=e.get(o),d=await l.getBackstageIdentity({optional:!0});if(!d)return;const m=await l.getProfile();return gs.create({identity:d.identity,profile:m,authApi:l})}},bl={Component:({onSignInStarted:e,onSignInSuccess:o})=>(0,r.jsx)(ta,{children:(0,r.jsx)(lr,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(ge.Z,{color:"primary",variant:"outlined",onClick:()=>{e(),o(new na)},children:"Enter"}),children:(0,r.jsxs)(rt.Z,{variant:"body1",children:["Enter as a Guest User.",(0,r.jsx)("br",{}),"You will not have a verified identity,",(0,r.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new na};var Sl=n(63955),$a=n(86619),Da=n(74828),Cl=n(45455),wl=n.n(Cl);const jl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,El=(0,g.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Fa=e=>{const{ref:o,...l}=e;return{inputRef:o,...l}},Al={Component:({onSignInStarted:e,onSignInSuccess:o})=>{const l=El(),{register:d,handleSubmit:m,formState:x}=(0,Sl.cI)({mode:"onChange"}),{errors:I}=x,$=({userId:Y,idToken:Z})=>{e(),o(gs.fromLegacy({userId:Y,getIdToken:Z!==void 0?async()=>Z:void 0,profile:{email:`${Y}@example.com`}}))};return(0,r.jsx)(ta,{children:(0,r.jsxs)(lr,{title:"Custom User",variant:"fullHeight",children:[(0,r.jsxs)(rt.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,r.jsx)("br",{}),"This selection will not be stored."]}),(0,r.jsxs)("form",{className:l.form,onSubmit:m($),children:[(0,r.jsxs)(so.Z,{children:[(0,r.jsx)($a.Z,{...Fa(d("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(I.userId)}),I.userId&&(0,r.jsx)(Da.Z,{error:!0,children:I.userId.message})]}),(0,r.jsxs)(so.Z,{children:[(0,r.jsx)($a.Z,{...Fa(d("idToken",{required:!1,validate:Y=>!Y||jl.test(Y)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(I.idToken)}),I.idToken&&(0,r.jsx)(Da.Z,{error:!0,children:I.idToken.message})]}),(0,r.jsx)(ge.Z,{type:"submit",color:"primary",variant:"outlined",className:l.button,disabled:!(x!=null&&x.isDirty)||!wl()(I),children:"Continue"})]})]})})},loader:async()=>{}},Io="@backstage/core:SignInPage:provider",Na={guest:bl,custom:Al,common:xl};function Za(e,o){if(e in o)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function Gl(e){return e.reduce((l,d)=>{if(typeof d=="string")return Za(d,l),l[d]={components:Na[d],id:d},l;const{id:m}=d;return Za(m,l),l[m]={components:Na.common,id:m,config:d},l},{})}const Kl=(e,o)=>{const l=useApi(errorApiRef),d=useApiHolder(),[m,x]=useState(!0),I=useCallback(Y=>{o(IdentityApiSignOutProxy.from({identityApi:Y,signOut:async()=>{var Z;localStorage.removeItem(Io),await((Z=Y.signOut)===null||Z===void 0?void 0:Z.call(Y))}}))},[o]);useLayoutEffect(()=>{var Y;if(!m)return;const Z=localStorage.getItem(Io);if(Z===null){x(!1);return}const fe=e[Z];if(!fe){x(!1);return}let pe=!1;return fe.components.loader(d,(Y=fe.config)===null||Y===void 0?void 0:Y.apiRef).then(Te=>{if(pe){localStorage.removeItem(Io);return}Te?I(Te):x(!1)}).catch(Te=>{localStorage.removeItem(Io),!pe&&(l.post(Te),x(!1))}),()=>{pe=!0}},[m,l,o,d,e,I]);const $=useMemo(()=>Object.keys(e).map(Y=>{const Z=e[Y],{Component:fe}=Z.components,pe=Ze=>{I(Ze)},Te=()=>{var Ze;localStorage.setItem(Io,(Z==null||(Ze=Z.config)===null||Ze===void 0?void 0:Ze.id)||Z.id)},Ee=()=>{localStorage.removeItem(Io)};return _jsx(fe,{config:Z.config,onSignInStarted:Te,onSignInSuccess:pe,onSignInFailure:Ee},Z.id)}),[e,I]);return[m,$]},Tl=({onSignInSuccess:e,providers:o=[],title:l,align:d="left"})=>{const m=useApi(configApiRef),x=useStyles(),I=getSignInProviders(o),[$,Y]=useSignInProviders(I,e);return $?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:m.getString("app.title")}),_jsxs(Content,{children:[l&&_jsx(ContentHeader,{title:l,textAlign:d}),_jsx(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:x,children:Y})]})]})},Rl=({provider:e,auto:o,onSignInSuccess:l})=>{const d=useStyles(),m=useApi(e.apiRef),x=useApi(configApiRef),[I,$]=useState(),[Y,Z]=useState(!1),fe=async({checkExisting:pe,showPopup:Te})=>{try{let Ee;if(pe&&(Ee=await m.getBackstageIdentity({optional:!0})),!Ee&&(Te||o)&&(Z(!0),Ee=await m.getBackstageIdentity({instantPopup:!0}),!Ee))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Ee){Z(!0);return}const Ze=await m.getProfile();l(UserIdentity.create({identity:Ee.identity,authApi:m,profile:Ze}))}catch(Ee){$(Ee),Z(!0)}};return useMountEffect(()=>fe({checkExisting:!0})),Y?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:x.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:d,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{fe({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),I&&I.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:I.message})]})})})})]}):_jsx(Progress,{})};function Yl(e){return"provider"in e?_jsx(Rl,{...e}):_jsx(Tl,{...e})}const Il=(0,g.Z)(e=>({root:{padding:e.spacing(0,2,0,2.5),minHeight:e.spacing(3)},indicator:{backgroundColor:e.palette.info.main,height:e.spacing(.3)}}),{name:"BackstageTabbedCard"}),Pl=(0,On.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(yo.Z);function Jl(e){const{slackChannel:o,errorBoundaryProps:l,children:d,title:m,deepLink:x,value:I,onChange:$}=e,Y=Il(),[Z,fe]=useState(0),pe=$||((Ze,it)=>fe(it));let Te;I?React.Children.map(d,Ze=>{if(React.isValidElement(Ze)&&(Ze==null?void 0:Ze.props.value)===I){var it;Te=Ze==null||(it=Ze.props)===null||it===void 0?void 0:it.children}}):React.Children.map(d,(Ze,it)=>{React.isValidElement(Ze)&&it===Z&&(Te=Ze==null?void 0:Ze.props.children)});const Ee=l||(o?{slackChannel:o}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Ee,children:[m&&_jsx(Pl,{title:m}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:Y,value:I||Z,onChange:pe,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:Te}),x&&_jsx(BottomLink,{...x})]})})}const Ll=(0,g.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:e.typography.fontWeightBold}}),{name:"BackstageCardTab"});function Ql(e){const{children:o,...l}=e,d=Ll();return _jsx(Tab,{disableRipple:!0,classes:d,...l})}},60871:function(Ct,ke,n){"use strict";n.d(ke,{fC:function(){return g},CL:function(){return xt},sM:function(){return ae},$v:function(){return Pe},v_:function(){return N},hg:function(){return _e},uB:function(){return je},R5:function(){return Le},bq:function(){return P},Km:function(){return G},Ds:function(){return at},ni:function(){return A},T0:function(){return L},CO:function(){return rt},x8:function(){return jn},rx:function(){return Zn},YO:function(){return In},P4:function(){return Jt},NT:function(){return ut},NW:function(){return It},VE:function(){return zt},W0:function(){return Zt},gP:function(){return Dt},IY:function(){return ct},F4:function(){return ie},ux:function(){return H},Kp:function(){return oe},$4:function(){return et},p_:function(){return T},ZM:function(){return lt},D:function(){return q},gW:function(){return R},E6:function(){return yt},z$:function(){return Gt},h_:function(){return ge},I_:function(){return D},qD:function(){return xe},vJ:function(){return Nn},tg:function(){return En},Oi:function(){return Fn}});var r=n(52322),p=n(51837),W=n(2784);const f=(0,p.CT)("analytics-context"),z=()=>{const Se=(0,W.useContext)(f);if(Se===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const ce=Se.atVersion(1);if(ce===void 0)throw new Error("No context found for version 1.");return ce},g=Se=>{const{attributes:ce,children:Ie}=Se,Ve={...z(),...ce},le=(0,p.EI)({1:Ve});return(0,r.jsx)(f.Provider,{value:le,children:Ie})};function u(Se,ce){const Ie=Ue=>_jsx(g,{attributes:ce,children:_jsx(Se,{...Ue})});return Ie.displayName=`WithAnalyticsContext(${Se.displayName||Se.name||"Component"})`,Ie}function D(){const Se=(0,p.Vt)("api-context");if(!Se)throw new Error("API context is not available");const ce=Se.atVersion(1);if(!ce)throw new Error("ApiContext v1 not available");return ce}function ge(Se){const Ie=D().get(Se);if(!Ie)throw new Error(`No implementation available for ${Se}`);return Ie}function de(Se){return function(Ie){const Ue=le=>{const U=D(),he={};for(const $e in Se)if(Se.hasOwnProperty($e)){const Ke=Se[$e],Je=U.get(Ke);if(!Je)throw new Error(`No implementation available for ${Ke}`);he[$e]=Je}return _jsx(Ie,{...le,...he})},Ve=Ie.displayName||Ie.name||"Component";return Ue.displayName=`withApis(${Ve})`,Ue}}var V=n(87612);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(ce){if((0,V._)(this,"config",void 0),this.config=ce,!ce.id.split(".").flatMap(Ue=>Ue.split("-")).every(Ue=>Ue.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${ce.id}'`)}}function L(Se){return new te(Se)}function A(Se,ce){return"id"in Se?{api:Se,deps:{},factory:()=>ce}:Se}var ae;(function(Se){Se.SignedIn="SignedIn",Se.SignedOut="SignedOut"})(ae||(ae={}));const oe=L({id:"core.auth.google"}),ie=L({id:"core.auth.github"}),q=L({id:"core.auth.okta"}),H=L({id:"core.auth.gitlab"}),T=L({id:"core.auth.microsoft"}),R=L({id:"core.auth.onelogin"}),P=L({id:"core.auth.bitbucket"}),G=L({id:"core.auth.bitbucket-server"}),je=L({id:"core.auth.atlassian"}),Pe=L({id:"core.alert"}),N=L({id:"core.analytics"}),_e=L({id:"core.apptheme"}),at=L({id:"core.config"}),It=L({id:"core.discovery"}),zt=L({id:"core.error"});var xt;(function(Se){Se[Se.None=0]="None",Se[Se.Active=1]="Active"})(xt||(xt={}));const Zt=L({id:"core.featureflags"}),Dt=L({id:"core.fetch"}),et=L({id:"core.identity"}),lt=L({id:"core.oauthrequest"}),yt=L({id:"core.storage"});class At{setContext(ce){this.context=ce}captureEvent(ce,Ie,{value:Ue,attributes:Ve}={}){try{this.analyticsApi.captureEvent({action:ce,subject:Ie,value:Ue,attributes:Ve,context:this.context})}catch(le){console.warn("Error during analytics event capture. %o",le)}}constructor(ce,Ie={routeRef:"unknown",pluginId:"root",extension:"App"}){(0,V._)(this,"analyticsApi",void 0),(0,V._)(this,"context",void 0),this.analyticsApi=ce,this.context=Ie}}function $t(){try{return ge(N)}catch{return{captureEvent:()=>{}}}}function Gt(){const Se=(0,W.useRef)(null),ce=z(),Ie=$t();function Ue(){return Se.current===null&&(Se.current=new At(Ie)),Se.current}const Ve=Ue();return Ve.setContext(ce),Ve}const xe=()=>{const Se=(0,p.Vt)("app-context");if(!Se)throw new Error("App context is not available");const ce=Se.atVersion(1);if(!ce)throw new Error("AppContext v1 not available");return ce},Ce=(0,p.uW)("component-data-store",()=>new WeakMap),Ye="__backstage_data";function Le(Se,ce,Ie){const Ue=Se;var Ve;let le=(Ve=Ue[Ye])!==null&&Ve!==void 0?Ve:Ce.get(Se);if(le||(le={map:new Map},Object.defineProperty(Ue,Ye,{enumerable:!1,configurable:!0,writable:!1,value:le}),Ce.set(Se,le)),le.map.has(ce)){const U=Se.displayName||Se.name;throw new Error(`Attempted to attach duplicate data "${ce}" to component "${U}"`)}le.map.set(ce,Ie)}function ct(Se,ce){if(!Se)return;const Ie=Se.type;if(!Ie)return;var Ue;const Ve=(Ue=Ie[Ye])!==null&&Ue!==void 0?Ue:Ce.get(Ie);if(Ve)return Ve.map.get(ce)}const wt=(0,p.uW)("route-ref-type",()=>Symbol("route-ref-type"));let dt=wt,Qe=dt;class Ge{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(ce,Ie){(0,V._)(this,"id",void 0),(0,V._)(this,"params",void 0),(0,V._)(this,Qe,void 0),this.id=ce,this.params=Ie,this[dt]="absolute"}}function ut(Se){var ce;return new Ge(Se.id,(ce=Se.params)!==null&&ce!==void 0?ce:[])}const pt=/^\w+$/;let hn=null,pn=null;class fn{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(ce,Ie,Ue,Ve){_define_property(this,"id",void 0),_define_property(this,"path",void 0),_define_property(this,"parent",void 0),_define_property(this,"params",void 0),_define_property(this,pn,void 0),this.id=ce,this.path=Ie,this.parent=Ue,this.params=Ve,this[hn]="sub"}}function _t(Se){const{id:ce,path:Ie,parent:Ue}=Se,Ve=Ie.split("/").filter(he=>he.startsWith(":")).map(he=>he.substring(1)),le=[...Ue.params,...Ve];if(Ue.params.some(he=>Ve.includes(he)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Ie.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Ie}'`);if(Ie.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Ie}'`);for(const he of Ve)if(!pt.test(he))throw new Error(`SubRouteRef path has invalid param, got '${he}'`);return new fn(ce,Ie,Ue,le)}let Sn=wt,Yt=Sn;class rn{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(ce,Ie,Ue){(0,V._)(this,"id",void 0),(0,V._)(this,"params",void 0),(0,V._)(this,"optional",void 0),(0,V._)(this,Yt,void 0),this.id=ce,this.params=Ie,this.optional=Ue,this[Sn]="external"}}function jn(Se){var ce;return new rn(Se.id,(ce=Se.params)!==null&&ce!==void 0?ce:[],Boolean(Se.optional))}var on=n(73557);function En(Se){const{pathname:ce}=(0,on.TH)(),Ie=(0,p.Vt)("routing-context");if(!Ie)throw new Error("Routing context is not available");const Ue=Ie.atVersion(1),Ve=(0,W.useMemo)(()=>Ue&&Ue.resolve(Se,{pathname:ce}),[Ue,Se,ce]);if(!Ie)throw new Error("useRouteRef used outside of routing context");if(!Ue)throw new Error("RoutingContext v1 not available");const le="optional"in Se&&Se.optional;if(!Ve&&!le)throw new Error(`No path for ${Se}`);return Ve}function Fn(Se){return(0,on.UO)()}class nt extends W.Component{static getDerivedStateFromError(ce){return{error:ce}}render(){const{error:ce}=this.state,{app:Ie,plugin:Ue}=this.props,{ErrorBoundaryFallback:Ve}=Ie.getComponents();return ce?(0,r.jsx)(Ve,{error:ce,resetError:this.handleErrorReset,plugin:Ue}):this.props.children}constructor(...ce){super(...ce),(0,V._)(this,"state",{error:void 0}),(0,V._)(this,"handleErrorReset",()=>{this.setState({error:void 0})})}}var sn=n(64355);function Jt(Se){const{component:ce,mountPoint:Ie,name:Ue}=Se;return In({component:{lazy:()=>ce().then(Ve=>{const le=he=>{try{En(Ie)}catch($e){if(typeof $e=="object"&&$e!==null){const{message:Ke}=$e;if(typeof Ke=="string"&&Ke.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Ie} was not discovered in the app element tree. Routable extension components may not be rendered by other components and must be directly available as an element within the App provider component.`)}throw $e}return(0,r.jsx)(Ve,{...he})},U=Ue||Ve.displayName||Ve.name||"LazyComponent";return le.displayName=`RoutableExtension(${U})`,le},Ve=>U=>{const he=xe(),{BootErrorPage:$e}=he.getComponents();return(0,r.jsx)($e,{step:"load-chunk",error:Ve})})},data:{"core.mountPoint":Ie},name:Ue})}function rt(Se){const{component:ce,name:Ie}=Se;return In({component:ce,name:Ie})}function In(Se){const{data:ce={},name:Ie}=Se;Ie||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Ue;if("lazy"in Se.component){const le=Se.component.lazy;Ue=(0,W.lazy)(()=>le().then(U=>({default:U})))}else Ue=Se.component.sync;const Ve=Ie||Ue.displayName||Ue.name||"Component";return{expose(le){const U=he=>{const $e=xe(),{Progress:Ke}=$e.getComponents(),Je=ce==null?void 0:ce["core.mountPoint"];return(0,r.jsx)(W.Suspense,{fallback:(0,r.jsx)(Ke,{}),children:(0,r.jsx)(nt,{app:$e,plugin:le,children:(0,r.jsx)(g,{attributes:{pluginId:le.getId(),...Ie&&{extension:Ie},...Je&&{routeRef:Je.id}},children:(0,r.jsx)(sn.o,{plugin:le,children:(0,r.jsx)(Ue,{...he})})})})})};Le(U,"core.plugin",le),Le(U,"core.extensionName",Ie);for(const[he,$e]of Object.entries(ce))Le(U,he,$e);return U.displayName=`Extension(${Ve})`,U}}}function Qt(Se,ce,Ie,Ue){return W.Children.toArray(Se).flatMap(Ve=>{if(!(0,W.isValidElement)(Ve))return[];if(Ve.type===W.Fragment)return Qt(Ve.props.children,ce,Ie,Ue);if(ct(Ve,"core.featureFlagged")){const le=Ve.props;return("with"in le?ce.isActive(le.with):!ce.isActive(le.without))?Qt(Ve.props.children,ce,Ie,Ue):[]}if(Ie===void 0||Ie(Ve))return[Ve];if(Ue)throw new Error(Ue);return Qt(Ve.props.children,ce,Ie,Ue)})}class Pn{selectByComponentData(ce){const Ie=Qt(this.node,this.featureFlagsApi,Ue=>ct(Ue,ce.key)!==void 0,ce.withStrictError);return new Pn(Ie,this.featureFlagsApi)}findComponentData(ce){return Qt(this.node,this.featureFlagsApi,Ue=>ct(Ue,ce.key)!==void 0).map(Ue=>ct(Ue,ce.key)).filter(Ue=>Ue!==void 0)}getElements(){return Qt(this.node,this.featureFlagsApi)}constructor(ce,Ie){(0,V._)(this,"node",void 0),(0,V._)(this,"featureFlagsApi",void 0),this.node=ce,this.featureFlagsApi=Ie}}function Nn(Se,ce,Ie=[]){const Ue=ge(Zt),Ve=new Pn(Se,Ue);return(0,W.useMemo)(()=>ce(Ve),[Se,...Ie])}class Ln{getId(){return this.config.id}getApis(){var ce;return(ce=this.config.apis)!==null&&ce!==void 0?ce:[]}getFeatureFlags(){var ce,Ie;return(Ie=(ce=this.config.featureFlags)===null||ce===void 0?void 0:ce.slice())!==null&&Ie!==void 0?Ie:[]}get routes(){var ce;return(ce=this.config.routes)!==null&&ce!==void 0?ce:{}}get externalRoutes(){var ce;return(ce=this.config.externalRoutes)!==null&&ce!==void 0?ce:{}}provide(ce){return ce.expose(this)}__experimentalReconfigure(ce){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(ce))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var ce;return(ce=this.options)!==null&&ce!==void 0?ce:{}}toString(){return`plugin{${this.config.id}}`}constructor(ce){(0,V._)(this,"config",void 0),(0,V._)(this,"options",void 0),this.config=ce,this.options=void 0}}function Zn(Se){return new Ln(Se)}},64355:function(Ct,ke,n){"use strict";n.d(ke,{o:function(){return z},y:function(){return g}});var r=n(52322),p=n(51837),W=n(2784);const f="plugin-context",z=u=>{const{children:D,plugin:ge}=u,{Provider:de}=(0,p.CT)(f);return(0,r.jsx)(de,{value:(0,p.EI)({1:{plugin:ge}}),children:D})};function g(){const u=(0,p.Vt)(f);if(!u)throw new Error("Plugin Options context is not available");const D=u.atVersion(1);if(!D)throw new Error("Plugin Options v1 is not available");return D.plugin.getPluginOptions()}},23054:function(Ct,ke,n){"use strict";n.d(ke,{SP:function(){return ie},dR:function(){return te},VL:function(){return H},BD:function(){return p}});function r(T){if(typeof T!="object"||T===null||Array.isArray(T))return!1;const R=T;return!(typeof R.name!="string"||R.name===""||typeof R.message!="string")}function p(T){if(typeof T!="object"||T===null||Array.isArray(T))throw new Error(`Encountered invalid error, not an object, got '${T}'`);const R=T;if(typeof R.name!="string"||R.name==="")throw new Error(`Encountered error object without a name, got '${T}'`);if(typeof R.message!="string")throw new Error(`Encountered error object without a message, got '${T}'`)}var W=n(87612),f=n(24852);function z(T,R){const G={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(T)};return R!=null&&R.includeStack||delete G.stack,G}function g(T){const R=(0,f.deserializeError)(T);return T.stack||(R.stack=void 0),R}function u(T){if(r(T)){const R=String(T);return R!=="[object Object]"?R:`${T.name}: ${T.message}`}return`unknown error '${T}'`}class D extends Error{constructor(R,P){var G;let je=R;if(P!==void 0){const Pe=u(P);je?je+=`; caused by ${Pe}`:je=`caused by ${Pe}`}super(je),(0,W._)(this,"cause",void 0),(G=Error.captureStackTrace)===null||G===void 0||G.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=r(P)?P:void 0}}class ge extends null{}class de extends null{}class V extends null{}class te extends D{}class L extends null{}class A extends null{}class ae extends null{}class oe extends null{}class ie extends D{constructor(R,P){super(R,P),this.name=r(P)?P.name:"Error"}}async function q(T){try{const P=await T.text();if(P){var R;if(!((R=T.headers.get("content-type"))===null||R===void 0)&&R.startsWith("application/json"))try{const G=JSON.parse(P);if(G.error&&G.response)return G}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}, ${P}`},response:{statusCode:T.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}`},response:{statusCode:T.status}}}class H extends Error{static async fromResponse(R){const P=await q(R),G=P.response.statusCode||R.status,je=P.error.name||R.statusText,Pe=`Request failed with ${G} ${je}`,N=g(P.error);return new H({message:Pe,response:R,data:P,cause:N})}constructor(R){super(R.message),(0,W._)(this,"response",void 0),(0,W._)(this,"body",void 0),(0,W._)(this,"cause",void 0),this.name="ResponseError",this.response=R.response,this.body=R.data,this.cause=R.cause}}},32838:function(Ct,ke,n){"use strict";n.d(ke,{nW:function(){return oe},ae:function(){return V},q3:function(){return te}});var r=n(60871);const p=(0,r.T0)({id:"core.scmauth"});var W=new WeakMap;class f{async getCredentials(q){const H=new URL(q.url),T=_class_private_field_get(this,W).find(R=>R.isUrlSupported(H));if(!T)throw new Error(`No auth provider available for '${q.url}', see https://backstage.io/link?scm-auth`);return T.getCredentials(q)}constructor(q){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_set(this,W,q)}}var z=new WeakMap,g=new WeakMap,u=new WeakMap,D=new WeakMap;class ge{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:q,gitlab:H,azure:T,bitbucket:R})=>ge.merge(ge.forGithub(q),ge.forGitlab(H),ge.forAzure(T),ge.forBitbucket(R))})}static forAuthApi(q,H){return new ge("generic",q,H.host,H.scopeMapping)}static forGithub(q,H){var T;const R=(T=H==null?void 0:H.host)!==null&&T!==void 0?T:"github.com";return new ge("github",q,R,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(q,H){var T;const R=(T=H==null?void 0:H.host)!==null&&T!==void 0?T:"gitlab.com";return new ge("gitlab",q,R,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(q,H){var T;const R=(T=H==null?void 0:H.host)!==null&&T!==void 0?T:"dev.azure.com";return new ge("azure",q,R,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(q,H){var T;const R=(T=H==null?void 0:H.host)!==null&&T!==void 0?T:"bitbucket.org";return new ge("bitbucket",q,R,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...q){return new f(q)}isUrlSupported(q){return q.host===_class_private_field_get(this,g)}getAdditionalScopesForProvider(q){var H;if(!(q!=null&&q.customScopes)||_class_private_field_get(this,D)==="generic")return[];var T;return(T=(H=q.customScopes)===null||H===void 0?void 0:H[_class_private_field_get(this,D)])!==null&&T!==void 0?T:[]}async getCredentials(q){const{url:H,additionalScope:T,...R}=q,P=_class_private_field_get(this,u).default.slice();T!=null&&T.repoWrite&&P.push(..._class_private_field_get(this,u).repoWrite);const G=this.getAdditionalScopesForProvider(T);G.length&&P.push(...G);const je=[...new Set(P)],Pe=await _class_private_field_get(this,z).getAccessToken(je,R);return{token:Pe,headers:{Authorization:`Bearer ${Pe}`}}}constructor(q,H,T,R){_class_private_field_init(this,z,{writable:!0,value:void 0}),_class_private_field_init(this,g,{writable:!0,value:void 0}),_class_private_field_init(this,u,{writable:!0,value:void 0}),_class_private_field_init(this,D,{writable:!0,value:void 0}),_class_private_field_set(this,z,H),_class_private_field_set(this,g,T),_class_private_field_set(this,u,R),_class_private_field_set(this,D,q)}}var de=n(40556);class V{static fromConfig(q){return de.Lx.fromConfig(q)}}const te=(0,r.T0)({id:"integration.scmintegrations"});var L=n(52322),A=n(73250),ae=n(2784);const oe=ie=>{const{type:q}=ie,H=(0,r.qD)(),T=A.Z;var R;const P=q&&(R=H.getSystemIcon(q))!==null&&R!==void 0?R:T;return(0,L.jsx)(P,{})}},40556:function(Ct,ke,n){"use strict";n.d(ke,{Lx:function(){return Rr},BT:function(){return Ut}});var r=n(87612),p=n(82717),W=n.n(p),f=n(76635);function z(S){const c=new URL("http://example.com");return c.host=S,c.host===S}function g(S){try{return new URL(S),!0}catch{return!1}}function u(S,c){return{list(){return S},byUrl(b){try{const j=typeof b=="string"?new URL(b):b;return S.find(K=>c(K)===j.host)}catch{return}},byHost(b){return S.find(j=>c(j)===b)}}}function D(S){const{url:c,base:b,lineNumber:j}=S;try{return new URL(c),c}catch{}let K;if(c.startsWith("/")){const{filepath:me}=W()(b);K=new URL(b);const we=(0,f.trimEnd)(K.pathname.substring(0,K.pathname.length-me.length),"/");K.pathname=`${we}${c}`}else K=new URL(c,b);return K.search=new URL(b).search,j&&(K.hash=`L${j}`),K.toString()}function ge(S){beforeAll(()=>S.listen({onUnhandledRequest:"error"})),afterAll(()=>S.close()),afterEach(()=>S.resetHandlers())}const de="amazonaws.com";function V(S){const c=S.getOptionalString("endpoint");var b;const j=(b=S.getOptionalBoolean("s3ForcePathStyle"))!==null&&b!==void 0?b:!1;let K,me;if(c){try{const wn=new URL(c);K=wn.host,me=wn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${c}' is not a valid URL`)}if(me!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${c}'`)}else K=de;const we=S.getOptionalString("accessKeyId"),Fe=S.getOptionalString("secretAccessKey"),Xe=S.getOptionalString("roleArn"),Mt=S.getOptionalString("externalId");return{host:K,endpoint:c,s3ForcePathStyle:j,accessKeyId:we,secretAccessKey:Fe,roleArn:Xe,externalId:Mt}}function te(S){const c=S.map(V);return c.some(b=>b.host===de)||c.push({host:de}),c}class L{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return D(c)}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(L,"factory",({config:S})=>{var c;const b=te((c=S.getOptionalConfigArray("integrations.awsS3"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new L(j)),j=>j.config.host)});var A=n(88412),ae=n(50629),oe=n(80956);const ie="GB";var q=new WeakMap,H=new WeakMap,T=new WeakMap,R=new WeakMap,P=new WeakMap,G=new WeakMap,je=new WeakMap;class Pe{static fromRepoUrl(c){const b=new URL(c);let j,K,me;const we=b.pathname.split("/").map(Qn=>decodeURIComponent(Qn));if(we[2]==="_git"?(j=we[1],K=me=we[3]):we[3]==="_git"?(j=we[1],K=we[2],me=we[4]):we[4]==="_git"&&(j=`${we[1]}/${we[2]}`,K=we[3],me=we[5]),!j||!K||!me)throw new Error("Azure URL must point to a git repository");var Fe;const Xe=(Fe=b.searchParams.get("path"))!==null&&Fe!==void 0?Fe:void 0;let Mt;const wn=b.searchParams.get("version");if(wn){if(wn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Mt=wn.slice(2)}return new Pe(b.origin,j,K,me,Xe,Mt)}toRepoUrl(){let c;return(0,A._)(this,T)===(0,A._)(this,R)?c=(0,A._)(this,je).call(this,(0,A._)(this,H),"_git",(0,A._)(this,R)):c=(0,A._)(this,je).call(this,(0,A._)(this,H),(0,A._)(this,T),"_git",(0,A._)(this,R)),(0,A._)(this,P)&&c.searchParams.set("path",(0,A._)(this,P)),(0,A._)(this,G)&&c.searchParams.set("version",ie+(0,A._)(this,G)),c.toString()}toFileUrl(){if(!(0,A._)(this,P))throw new Error("Azure URL must point to a specific path to be able to download a file");const c=(0,A._)(this,je).call(this,(0,A._)(this,H),(0,A._)(this,T),"_apis","git","repositories",(0,A._)(this,R),"items");return c.searchParams.set("api-version","6.0"),c.searchParams.set("path",(0,A._)(this,P)),(0,A._)(this,G)&&c.searchParams.set("version",(0,A._)(this,G)),c.toString()}toArchiveUrl(){const c=(0,A._)(this,je).call(this,(0,A._)(this,H),(0,A._)(this,T),"_apis","git","repositories",(0,A._)(this,R),"items");return c.searchParams.set("recursionLevel","full"),c.searchParams.set("download","true"),c.searchParams.set("api-version","6.0"),(0,A._)(this,P)&&c.searchParams.set("scopePath",(0,A._)(this,P)),(0,A._)(this,G)&&c.searchParams.set("version",(0,A._)(this,G)),c.toString()}toCommitsUrl(){const c=(0,A._)(this,je).call(this,(0,A._)(this,H),(0,A._)(this,T),"_apis","git","repositories",(0,A._)(this,R),"commits");return c.searchParams.set("api-version","6.0"),(0,A._)(this,G)&&c.searchParams.set("searchCriteria.itemVersion.version",(0,A._)(this,G)),c.toString()}getOwner(){return(0,A._)(this,H)}getProject(){return(0,A._)(this,T)}getRepo(){return(0,A._)(this,R)}getPath(){return(0,A._)(this,P)}getRef(){return(0,A._)(this,G)}constructor(c,b,j,K,me,we){(0,ae._)(this,q,{writable:!0,value:void 0}),(0,ae._)(this,H,{writable:!0,value:void 0}),(0,ae._)(this,T,{writable:!0,value:void 0}),(0,ae._)(this,R,{writable:!0,value:void 0}),(0,ae._)(this,P,{writable:!0,value:void 0}),(0,ae._)(this,G,{writable:!0,value:void 0}),(0,ae._)(this,je,{writable:!0,value:(...Fe)=>{const Xe=new URL((0,A._)(this,q));return Xe.pathname=Fe.map(Mt=>encodeURIComponent(Mt)).join("/"),Xe}}),(0,oe._)(this,q,c),(0,oe._)(this,H,b),(0,oe._)(this,T,j),(0,oe._)(this,R,K),(0,oe._)(this,P,me),(0,oe._)(this,G,we)}}const N="dev.azure.com",_e=S=>{const c=S;return Object.keys(S).length===3&&c.clientId!==void 0&&c.clientSecret!==void 0&&c.tenantId!==void 0},at=S=>Object.keys(S).length===1&&S.clientId!==void 0;function It(S){var c;const b=(c=S.getOptionalString("host"))!==null&&c!==void 0?c:N,j=S.getOptionalString("token"),K=S.getOptional("credential")?{tenantId:S.getOptionalString("credential.tenantId"),clientId:S.getOptionalString("credential.clientId"),clientSecret:S.getOptionalString("credential.clientSecret")}:void 0;if(!z(b))throw new Error(`Invalid Azure integration config, '${b}' is not a valid host`);if(K&&!_e(K)&&!at(K))throw new Error("Invalid Azure integration config, credential is not valid");if(K&&b!==N)throw new Error(`Invalid Azure integration config, credential can only be used with ${N}`);if(K&&j)throw new Error("Invalid Azure integration config, specify either a token or a credential but not both");return{host:b,token:j,credential:K}}function zt(S){const c=S.map(It);return c.some(b=>b.host===N)||c.push({host:N}),c}class xt{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:j}=c;if(g(b))return b;try{const me=Pe.fromRepoUrl(j),we=new URL(j);var K;const Fe=new URL(`https://a.com${(K=me.getPath())!==null&&K!==void 0?K:""}`),Xe=new URL(b,Fe).pathname;return we.searchParams.set("path",Xe),c.lineNumber&&(we.searchParams.set("line",String(c.lineNumber)),we.searchParams.set("lineEnd",String(c.lineNumber+1)),we.searchParams.set("lineStartColumn","1"),we.searchParams.set("lineEndColumn","1")),we.toString()}catch{return new URL(b,j).toString()}}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(xt,"factory",({config:S})=>{var c;const b=zt((c=S.getOptionalConfigArray("integrations.azure"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new xt(j)),j=>j.config.host)});var Zt=n(48834).lW;function Dt(S){return AzureUrl.fromRepoUrl(S).toFileUrl()}function et(S){return AzureUrl.fromRepoUrl(S).toArchiveUrl()}function lt(S){return AzureUrl.fromRepoUrl(S).toCommitsUrl()}async function yt(S,c){const b="499b84ac-1321-427f-aa17-267ca6975798/.default",j=c?{...c}:{},{token:K,credential:me}=S;if(me){if(isServicePrincipal(me)){const Fe=await new ClientSecretCredential(me.tenantId,me.clientId,me.clientSecret).getToken(b);j.Authorization=`Bearer ${Fe.token}`}else if(isManagedIdentity(me)){const Fe=await new ManagedIdentityCredential(me.clientId).getToken(b);j.Authorization=`Bearer ${Fe.token}`}}else if(K){const we=Zt.from(`:${S.token}`,"utf8");j.Authorization=`Basic ${we.toString("base64")}`}return{headers:j}}const At="bitbucket.org",$t="https://api.bitbucket.org/2.0";function Gt(S){var c;const b=(c=S.getOptionalString("host"))!==null&&c!==void 0?c:At;let j=S.getOptionalString("apiBaseUrl");const K=S.getOptionalString("token"),me=S.getOptionalString("username"),we=S.getOptionalString("appPassword");if(!z(b))throw new Error(`Invalid Bitbucket integration config, '${b}' is not a valid host`);return j?j=(0,f.trimEnd)(j,"/"):b===At?j=$t:j=`https://${b}/rest/api/1.0`,{host:b,apiBaseUrl:j,token:K,username:me,appPassword:we}}function xe(S){const c=S.map(Gt);return c.some(b=>b.host===At)||c.push({host:At,apiBaseUrl:$t}),c}class Ce{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=D(c);if(!c.lineNumber)return b;const j=new URL(b);return this.integrationConfig.host==="bitbucket.org"?j.hash=`lines-${c.lineNumber}`:j.hash=`${c.lineNumber}`,j.toString()}resolveEditUrl(c){const b=W()(c),j=new URL(c);return j.searchParams.set("mode","edit"),j.searchParams.set("spa","0"),j.searchParams.set("at",b.ref),j.toString()}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Ce,"factory",({config:S})=>{var c,b,j;const K=xe((j=S.getOptionalConfigArray("integrations.bitbucket"))!==null&&j!==void 0?j:[...(c=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[],...(b=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&b!==void 0?b:[]]);return u(K.map(me=>new Ce(me)),me=>me.config.host)});var Ye=n(96279),Le=n(48834).lW;async function ct(S,c){const{name:b,owner:j,resource:K}=parseGitUrl(S),me=K==="bitbucket.org";let we=me?`${c.apiBaseUrl}/repositories/${j}/${b}`:`${c.apiBaseUrl}/projects/${j}/repos/${b}/default-branch`,Fe=await fetch(we,Qe(c));if(Fe.status===404&&!me&&(we=`${c.apiBaseUrl}/projects/${j}/repos/${b}/branches/default`,Fe=await fetch(we,Qe(c))),!Fe.ok){const Mt=`Failed to retrieve default branch from ${we}, ${Fe.status} ${Fe.statusText}`;throw new Error(Mt)}let Xe;if(me)Xe=(await Fe.json()).mainbranch.name;else{const{displayId:Mt}=await Fe.json();Xe=Mt}if(!Xe)throw new Error(`Failed to read default branch from ${we}. Response ${Fe.status} ${Fe.json()}`);return Xe}async function wt(S,c){const{name:b,owner:j,ref:K,protocol:me,resource:we,filepath:Fe}=parseGitUrl(S),Xe=we==="bitbucket.org";let Mt=K;Mt||(Mt=await ct(S,c));const wn=Fe?`&path=${encodeURIComponent(decodeURIComponent(Fe))}`:"";return Xe?`${me}://${we}/${j}/${b}/get/${Mt}.tar.gz`:`${c.apiBaseUrl}/projects/${j}/repos/${b}/archive?format=tgz&at=${Mt}&prefix=${j}-${b}${wn}`}function dt(S,c){try{const{owner:b,name:j,ref:K,filepathtype:me,filepath:we}=parseGitUrl(S);if(!b||!j||me!=="browse"&&me!=="raw"&&me!=="src")throw new Error("Invalid Bitbucket URL or file path");const Fe=we.replace(/^\//,"");if(c.host==="bitbucket.org"){if(!K)throw new Error("Invalid Bitbucket URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${j}/src/${K}/${Fe}`}return`${c.apiBaseUrl}/projects/${b}/repos/${j}/raw/${Fe}?at=${K}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function Qe(S){const c={};if(S.token)c.Authorization=`Bearer ${S.token}`;else if(S.username&&S.appPassword){const b=Le.from(`${S.username}:${S.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}const Ge="bitbucket.org",ut="https://api.bitbucket.org/2.0";function pt(S){const c=Ge,b=ut,j=S.getString("username"),K=S.getString("appPassword");return{host:c,apiBaseUrl:b,username:j,appPassword:K}}function hn(S){const c=S.map(pt);return c.length===0&&c.push({host:Ge,apiBaseUrl:ut}),c}class pn{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=D(c);if(c.lineNumber){const j=new URL(b);return j.hash=`lines-${c.lineNumber}`,j.toString()}return b}resolveEditUrl(c){const b=W()(c),j=new URL(c);return j.searchParams.set("mode","edit"),j.searchParams.set("at",b.ref),j.toString()}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(pn,"factory",({config:S})=>{var c;const b=hn((c=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new pn(j)),j=>j.config.host)});var fn=n(48834).lW;async function _t(S,c){const{name:b,owner:j}=parseGitUrl(S),K=`${c.apiBaseUrl}/repositories/${j}/${b}`,me=await fetch(K,rn(c));if(!me.ok){const Xe=`Failed to retrieve default branch from ${K}, ${me.status} ${me.statusText}`;throw new Error(Xe)}const Fe=(await me.json()).mainbranch.name;if(!Fe)throw new Error(`Failed to read default branch from ${K}. Response ${me.status} ${me.json()}`);return Fe}async function Sn(S,c){const{name:b,owner:j,ref:K,protocol:me,resource:we}=parseGitUrl(S);let Fe=K;return Fe||(Fe=await _t(S,c)),`${me}://${we}/${j}/${b}/get/${Fe}.tar.gz`}function Yt(S,c){try{const{owner:b,name:j,ref:K,filepathtype:me,filepath:we}=parseGitUrl(S);if(!b||!j||me!=="src"&&me!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Fe=we.replace(/^\//,"");if(!K)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${j}/src/${K}/${Fe}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function rn(S){const c={};if(S.username&&S.appPassword){const b=fn.from(`${S.username}:${S.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function jn(S){const c=S.getString("host");let b=S.getOptionalString("apiBaseUrl");const j=S.getOptionalString("token"),K=S.getOptionalString("username"),me=S.getOptionalString("password");if(!z(c))throw new Error(`Invalid Bitbucket Server integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}/rest/api/1.0`,{host:c,apiBaseUrl:b,token:j,username:K,password:me}}function on(S){return S.map(jn)}class En{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=D(c);if(c.lineNumber){const j=new URL(b);return j.hash=c.lineNumber.toString(),j.toString()}return b}resolveEditUrl(c){return c.includes("?")?c.substring(0,c.indexOf("?")):c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(En,"factory",({config:S})=>{var c;const b=on((c=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new En(j)),j=>j.config.host)});var Fn=n(48834).lW;async function nt(S,c){const{name:b,owner:j}=parseGitUrl(S);let K=`${c.apiBaseUrl}/projects/${j}/repos/${b}/default-branch`,me=await fetch(K,rt(c));if(me.status===404&&(K=`${c.apiBaseUrl}/projects/${j}/repos/${b}/branches/default`,me=await fetch(K,rt(c))),!me.ok){const Xe=`Failed to retrieve default branch from ${K}, ${me.status} ${me.statusText}`;throw new Error(Xe)}const{displayId:we}=await me.json(),Fe=we;if(!Fe)throw new Error(`Failed to read default branch from ${K}. Response ${me.status} ${me.json()}`);return Fe}async function sn(S,c){const{name:b,owner:j,ref:K,filepath:me}=parseGitUrl(S);let we=K;we||(we=await nt(S,c));const Fe=me?`&path=${encodeURIComponent(decodeURIComponent(me))}`:"";return`${c.apiBaseUrl}/projects/${j}/repos/${b}/archive?format=tgz&at=${we}&prefix=${j}-${b}${Fe}`}function Jt(S,c){try{const{owner:b,name:j,ref:K,filepathtype:me,filepath:we}=parseGitUrl(S);if(!b||!j||me!=="browse"&&me!=="raw"&&me!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Fe=we.replace(/^\//,"");return`${c.apiBaseUrl}/projects/${b}/repos/${j}/raw/${Fe}?at=${K}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function rt(S){const c={};if(S.token)c.Authorization=`Bearer ${S.token}`;else if(S.username&&S.password){const b=Fn.from(`${S.username}:${S.password}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function In(S){const c=S.getString("host");let b=S.getOptionalString("baseUrl"),j=S.getOptionalString("cloneUrl"),K=S.getOptionalString("gitilesBaseUrl");const me=S.getOptionalString("username"),we=S.getOptionalString("password");if(z(c)){if(b&&!g(b))throw new Error(`Invalid Gerrit integration config, '${b}' is not a valid baseUrl`);if(j&&!g(j))throw new Error(`Invalid Gerrit integration config, '${j}' is not a valid cloneUrl`);if(K&&!g(K))throw new Error(`Invalid Gerrit integration config, '${K}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,K?K=(0,f.trimEnd)(K,"/"):K=`https://${c}`,j?j=(0,f.trimEnd)(j,"/"):j=b,{host:c,baseUrl:b,cloneUrl:j,gitilesBaseUrl:K,username:me,password:we}}function Qt(S){return S.map(In)}var Pn=n(48834).lW;const Nn=")]}'";function Ln(S,c){const j=c.replace(S.gitilesBaseUrl,"").split("/").filter(Mt=>!!Mt),K=j.indexOf("+");if(K<=0)throw new Error(`Unable to parse project from url: ${c}`);const me=(0,f.trimStart)(j.slice(0,K).join("/"),"/"),we=j.indexOf("heads");if(we<=0)throw new Error(`Unable to parse branch from url: ${c}`);const Fe=j[we+1],Xe=j.slice(we+2).join("/");return{branch:Fe,filePath:Xe===""?"/":Xe,project:me}}function Zn(S,c,b,j){return`${S.gitilesBaseUrl}/${c}/+/refs/heads/${b}/${(0,f.trimStart)(j,"/")}`}function Se(S){return S.password?"/a/":"/"}function ce(S,c){const{branch:b,project:j}=Ln(S,c);return`${S.baseUrl}${Se(S)}projects/${encodeURIComponent(j)}/branches/${b}`}function Ie(S,c){const{project:b}=Ln(S,c);return`${S.cloneUrl}${Se(S)}${b}`}function Ue(S,c){const{branch:b,filePath:j,project:K}=Ln(S,c);return`${S.baseUrl}${Se(S)}projects/${encodeURIComponent(K)}/branches/${b}/files/${encodeURIComponent(j)}/content`}function Ve(S){return`${S.baseUrl}${Se(S)}projects/`}function le(S){const c={};if(!S.password)return c;const b=Pn.from(`${S.username}:${S.password}`,"utf8");return c.Authorization=`Basic ${b.toString("base64")}`,{headers:c}}async function U(S){const c=await S.text();if(c.startsWith(Nn))try{return JSON.parse(c.slice(Nn.length))}catch(b){throw new Error(`Invalid response from Gerrit: ${c.slice(0,10)} - ${b}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${c.slice(0,10)}`)}class he{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:j,lineNumber:K}=c;let me;if(b.startsWith("/")){const{branch:we,project:Fe}=Ln(this.config,j);return Zn(this.config,Fe,we,b)}return b?me=new URL(b,j):me=new URL(j),K&&(me.hash=K.toString()),me.toString()}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(he,"factory",({config:S})=>{var c;const b=Qt((c=S.getOptionalConfigArray("integrations.gerrit"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new he(j)),j=>j.config.host)});function $e(S){const c=S.getString("host");let b=S.getOptionalString("baseUrl");const j=S.getOptionalString("username"),K=S.getOptionalString("password");if(!z(c))throw new Error(`Invalid Gitea integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,{host:c,baseUrl:b,username:j,password:K}}var Ke=n(48834).lW;function Je(S,c){try{var b;const j=(b=S.baseUrl)!==null&&b!==void 0?b:`https://${S.host}`,[K,me,we,Fe,Xe,Mt,...wn]=c.replace(j,"").split("/"),Qn=wn.join("/").replace(/^\//,"");return`${j}/${me}/${we}/_edit/${Mt}/${Qn}`}catch(j){throw new Error(`Incorrect URL: ${c}, ${j}`)}}function Ft(S,c){try{var b;const j=(b=S.baseUrl)!==null&&b!==void 0?b:`https://${S.host}`,[K,me,we,Fe,Xe,Mt,...wn]=c.replace(j,"").split("/"),Qn=wn.join("/").replace(/^\//,"");return`${j}/api/v1/repos/${me}/${we}/contents/${Qn}?ref=${Mt}`}catch(j){throw new Error(`Incorrect URL: ${c}, ${j}`)}}function Vt(S){const c={},{username:b,password:j}=S;return j?(b?c.Authorization=`basic ${Ke.from(`${b}:${j}`).toString("base64")}`:c.Authorization=`token ${j}`,{headers:c}):c}class en{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(c){return D(c)}resolveEditUrl(c){return Je(this.config,c)}constructor(c){(0,r._)(this,"config",void 0),this.config=c}}(0,r._)(en,"factory",({config:S})=>{var c;const j=((c=S.getOptionalConfigArray("integrations.gitea"))!==null&&c!==void 0?c:[]).map(K=>$e(K));return u(j.map(K=>new en(K)),K=>K.config.host)});const Xt="github.com",tn="https://api.github.com",_="https://raw.githubusercontent.com";function X(S){var c,b;const j=(b=S.getOptionalString("host"))!==null&&b!==void 0?b:Xt;let K=S.getOptionalString("apiBaseUrl"),me=S.getOptionalString("rawBaseUrl");const we=S.getOptionalString("token"),Fe=(c=S.getOptionalConfigArray("apps"))===null||c===void 0?void 0:c.map(Xe=>({appId:Xe.getNumber("appId"),clientId:Xe.getString("clientId"),clientSecret:Xe.getString("clientSecret"),webhookSecret:Xe.getString("webhookSecret"),privateKey:Xe.getString("privateKey"),allowedInstallationOwners:Xe.getOptionalStringArray("allowedInstallationOwners")}));if(!z(j))throw new Error(`Invalid GitHub integration config, '${j}' is not a valid host`);return K?K=(0,f.trimEnd)(K,"/"):j===Xt&&(K=tn),me?me=(0,f.trimEnd)(me,"/"):j===Xt&&(me=_),{host:j,apiBaseUrl:K,rawBaseUrl:me,token:we,apps:Fe}}function ee(S){const c=S.map(X);return c.some(b=>b.host===Xt)||c.push({host:Xt,apiBaseUrl:tn,rawBaseUrl:_}),c}function v(S,c,b){try{const{owner:j,name:K,ref:me,filepathtype:we,filepath:Fe}=parseGitUrl(S);if(!j||!K||!me||we!=="blob"&&we!=="raw"&&we!=="tree")throw new Error("Invalid GitHub URL or file path");const Xe=Fe.replace(/^\//,"");return J(c,b)==="api"?`${c.apiBaseUrl}/repos/${j}/${K}/contents/${Xe}?ref=${me}`:`${c.rawBaseUrl}/${j}/${K}/${me}/${Xe}`}catch(j){throw new Error(`Incorrect URL: ${S}, ${j}`)}}function O(S,c){const b={};return J(S,c)==="api"&&(b.Accept="application/vnd.github.v3.raw"),c.token&&(b.Authorization=`token ${c.token}`),{headers:b}}function J(S,c){return S.apiBaseUrl&&(c.token||!S.rawBaseUrl)?"api":"raw"}var M=n(35355),ue=n(89393),ye=n(26228);class Me{async getOrCreateToken(c,b,j){let K=this.tokenCache.get(c);if((!K||this.isExpired(K.expiresAt))&&(K=await j(),K.expiresAt=K.expiresAt.minus({minutes:10}),this.tokenCache.set(c,K)),!this.appliesToRepo(K,b))throw new Error(`The Backstage GitHub application used in the ${c} organization does not have access to a repository with the name ${b}`);return{accessToken:K.token}}appliesToRepo(c,b){return b===void 0?!0:c.repositories!==void 0?c.repositories.includes(b):!0}constructor(){(0,r._)(this,"tokenCache",new Map),(0,r._)(this,"isExpired",c=>ye.ou.local()>c)}}const ot={Accept:"application/vnd.github.machine-man-preview+json"};class ht{async getInstallationCredentials(c,b){if(this.allowedInstallationOwners){var j;if(!(!((j=this.allowedInstallationOwners)===null||j===void 0)&&j.includes(c)))return{accessToken:void 0}}return this.cache.getOrCreateToken(c,b,async()=>{const{installationId:K,suspended:me}=await this.getInstallationData(c);if(me)throw new Error(`The GitHub application for ${c} is suspended`);const we=await this.appClient.apps.createInstallationAccessToken({installation_id:K,headers:ot});let Fe;if(we.data.repository_selection==="selected"){const Mt=new ue.v({baseUrl:this.baseUrl,auth:we.data.token}),wn=await Mt.paginate(Mt.apps.listReposAccessibleToInstallation);var Xe;Fe=((Xe=wn.repositories)!==null&&Xe!==void 0?Xe:wn).map(ar=>ar.name)}return{token:we.data.token,expiresAt:ye.ou.fromISO(we.data.expires_at),repositories:Fe}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(c){const j=(await this.getInstallations()).find(me=>{var we;return me.account&&"login"in me.account&&((we=me.account.login)===null||we===void 0?void 0:we.toLocaleLowerCase("en-US"))===c.toLocaleLowerCase("en-US")});if(j)return{installationId:j.id,suspended:Boolean(j.suspended_by)};const K=new Error(`No app installation found for ${c} in ${this.baseAuthConfig.appId}`);throw K.name="NotFoundError",K}constructor(c,b){(0,r._)(this,"appClient",void 0),(0,r._)(this,"baseUrl",void 0),(0,r._)(this,"baseAuthConfig",void 0),(0,r._)(this,"cache",new Me),(0,r._)(this,"allowedInstallationOwners",void 0),this.allowedInstallationOwners=c.allowedInstallationOwners,this.baseUrl=b,this.baseAuthConfig={appId:c.appId,privateKey:c.privateKey.replace(/\\n/gm,`
|
|
33
|
-
`)},this.appClient=new ue.v({baseUrl:b,headers:ot,authStrategy:M.i,auth:this.baseAuthConfig})}}class Tt{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(b=>b.getInstallations()))).flat():[]}async getAppToken(c,b){if(this.apps.length===0)return;const j=await Promise.all(this.apps.map(Fe=>Fe.getInstallationCredentials(c,b).then(Xe=>({credentials:Xe,error:void 0}),Xe=>({credentials:void 0,error:Xe})))),K=j.find(Fe=>{var Xe;return(Xe=Fe.credentials)===null||Xe===void 0?void 0:Xe.accessToken});if(K)return K.credentials.accessToken;const we=j.map(Fe=>Fe.error).find(Fe=>(Fe==null?void 0:Fe.name)!=="NotFoundError");if(we)throw we}constructor(c){var b;(0,r._)(this,"apps",void 0);var j;this.apps=(j=(b=c.apps)===null||b===void 0?void 0:b.map(K=>new ht(K,c.apiBaseUrl)))!==null&&j!==void 0?j:[]}}class jt{async getCredentials(c){const b=W()(c.url),j=b.owner||b.name,K=b.owner?b.name:void 0;let me="app",we=await this.githubAppCredentialsMux.getAppToken(j,K);return we||(me="token",we=this.token),{headers:we?{Authorization:`Bearer ${we}`}:void 0,token:we,type:me}}constructor(c,b){(0,r._)(this,"githubAppCredentialsMux",void 0),(0,r._)(this,"token",void 0),this.githubAppCredentialsMux=c,this.token=b}}(0,r._)(jt,"create",S=>new jt(new Tt(S),S.token));class st{static fromIntegrations(c){const b=new Map;return c.github.list().forEach(j=>{const K=SingleInstanceGithubCredentialsProvider.create(j.config);b.set(j.config.host,K)}),new st(b)}async getCredentials(c){const b=new URL(c.url),j=this.providers.get(b.host);if(!j)throw new Error(`There is no GitHub integration that matches ${c.url}. Please add a configuration for an integration.`);return j.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class Ne{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return Ut(D(c),"tree")}resolveEditUrl(c){return Ut(c,"edit")}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Ne,"factory",({config:S})=>{var c;const b=ee((c=S.getOptionalConfigArray("integrations.github"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new Ne(j)),j=>j.config.host)});function Ut(S,c){return S.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(b,j,K,me)=>`//${j}/${K}/${me}/${c}/`)}const qt=null;class bt extends Ne{get config(){return super.config}constructor(c){super(c)}}(0,r._)(bt,"factory",Ne.factory);const Nt=null,gn=null,Cn=null,vt="gitlab.com",He="https://gitlab.com/api/v4";function Lt(S){const c=S.getString("host");let b=S.getOptionalString("apiBaseUrl");const j=S.getOptionalString("token");let K=S.getOptionalString("baseUrl");if(b?b=(0,f.trimEnd)(b,"/"):c===vt&&(b=He),K?K=(0,f.trimEnd)(K,"/"):K=`https://${c}`,z(c)){if(!b||!g(b))throw new Error(`Invalid GitLab integration config, '${b}' is not a valid apiBaseUrl`);if(!g(K))throw new Error(`Invalid GitLab integration config, '${K}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${c}' is not a valid host`);return{host:c,token:j,apiBaseUrl:b,baseUrl:K}}function xn(S){const c=S.map(Lt);return c.some(b=>b.host===vt)||c.push({host:vt,apiBaseUrl:He,baseUrl:`https://${vt}`}),c}function nn(S){let c="";return S.host!==vt&&(c=new URL(S.baseUrl).pathname),trimEnd(c,"/")}async function sr(S,c){const b=await cn(S,c);return Gn(S,b,c).toString()}function mr(S){const{token:c=""}=S;return{headers:{"PRIVATE-TOKEN":c}}}function Gn(S,c,b){try{const j=new URL(S),K=j.pathname.split("/blob/").slice(1).join("/blob/"),[me,...we]=K.split("/"),Fe=getGitLabIntegrationRelativePath(b);return j.pathname=[...Fe?[Fe]:[],"api/v4/projects",c,"repository/files",encodeURIComponent(decodeURIComponent(we.join("/"))),"raw"].join("/"),j.search=`?ref=${me}`,j}catch(j){throw new Error(`Incorrect url: ${S}, ${j}`)}}async function cn(S,c){const b=new URL(S);if(!b.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let j=b.pathname.split("/-/blob/")[0].split("/blob/")[0];const K=getGitLabIntegrationRelativePath(c);K&&(j=j.replace(K,""));const me=new URL(`${b.origin}${K}/api/v4/projects/${encodeURIComponent(j.replace(/^\//,""))}`),we=await fetch(me.toString(),mr(c)),Fe=await we.json();if(!we.ok)throw new Error(`GitLab Error '${Fe.error}', ${Fe.error_description}`);return Number(Fe.id)}catch(j){throw new Error(`Could not get GitLab project ID for: ${S}, ${j}`)}}class ir{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return D(c)}resolveEditUrl(c){return Nr(c,"edit")}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(ir,"factory",({config:S})=>{var c;const b=xn((c=S.getOptionalConfigArray("integrations.gitlab"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new ir(j)),j=>j.config.host)});function Nr(S,c){return S.replace(/\/\-\/(blob|tree|edit)\//,`/-/${c}/`)}class Zr{async getCredentials(c){return this.token?{headers:{Authorization:`Bearer ${this.token}`},token:this.token}:{}}constructor(c){(0,r._)(this,"token",void 0),this.token=c}}(0,r._)(Zr,"create",S=>new Zr(S.token));class Kn{static fromIntegrations(c){const b=new Map;return c.gitlab.list().forEach(j=>{const K=SingleInstanceGitlabCredentialsProvider.create(j.config);b.set(j.config.host,K)}),new Kn(b)}async getCredentials(c){const b=new URL(c.url),j=this.providers.get(b.host);if(!j)throw new Error(`There is no GitLab integration that matches ${c.url}. Please add a configuration for an integration.`);return j.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class Rr{static fromConfig(c){return new Rr({awsS3:L.factory({config:c}),azure:xt.factory({config:c}),bitbucket:Ce.factory({config:c}),bitbucketCloud:pn.factory({config:c}),bitbucketServer:En.factory({config:c}),gerrit:he.factory({config:c}),github:Ne.factory({config:c}),gitlab:ir.factory({config:c}),gitea:en.factory({config:c})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(c=>c.list())}byUrl(c){let b=Object.values(this.byType).map(j=>j.byUrl(c)).filter(Boolean);if(b.length>1){const j=b.filter(K=>!(K instanceof Ce));j.length!==0&&(b=j)}return b[0]}byHost(c){return Object.values(this.byType).map(b=>b.byHost(c)).find(Boolean)}resolveUrl(c){const b=this.byUrl(c.base);return b?b.resolveUrl(c):D(c)}resolveEditUrl(c){const b=this.byUrl(c);return b?b.resolveEditUrl(c):c}constructor(c){(0,r._)(this,"byType",void 0),this.byType=c}}},30966:function(Ct,ke,n){"use strict";var r={};n.r(r),n.d(r,{TechDocsPlugin:function(){return R.s4}});var p=n(52322),W=n(2784),f=n(28316),z=n(73557),g=n(60871);const u=(0,g.T0)({id:"plugin.techdocs.storageservice"}),D=(0,g.T0)({id:"plugin.techdocs.service"});var ge=n(92077),de=n(95481),V=n(7476),te=n(93225),L=n(86317),A=n(65124),ae=n(22478),oe=n(85478),ie=n(68435),q=n(3482),H=n(42081),T=n(48431),R=n(89258),P=n(52943),G=n(61886),je=n(13980),Pe=n.n(je),N=n(87612);class _e{get(t){for(const s of this.holders){const a=s.get(t);if(a)return a}}constructor(...t){(0,N._)(this,"holders",void 0),this.holders=t}}var at=n(51837);const It=(0,at.CT)("api-context"),zt=i=>{var t;const{apis:s,children:a}=i,h=(t=(0,W.useContext)(It))===null||t===void 0?void 0:t.atVersion(1),w=h?new _e(s,h):s;return(0,p.jsx)(It.Provider,{value:(0,at.EI)({1:w}),children:a})};zt.propTypes={apis:Pe().shape({get:Pe().func.isRequired}).isRequired,children:Pe().node};class xt{static validateFactories(t,s){for(const a of s){const h=[a],w=new Set;for(;h.length;){const k=h.shift(),F=t.get(k);if(F)for(const se of Object.values(F.deps)){if(se.id===a.id)throw new Error(`Circular dependency of api factory for ${a}`);w.has(se)||(w.add(se),h.push(se))}}}}get(t){return this.load(t)}load(t,s=[]){const a=this.apis.get(t.id);if(a)return a;const h=this.factories.get(t);if(!h)return;if(s.includes(h.api))throw new Error(`Circular dependency of api factory for ${h.api}`);const w=this.loadDeps(t,h.deps,[...s,h.api]),k=h.factory(w);return this.apis.set(t.id,k),k}loadDeps(t,s,a){const h={};for(const w in s)if(s.hasOwnProperty(w)){const k=s[w],F=this.load(k,a);if(!F)throw new Error(`No API factory available for dependency ${k} of dependent ${t}`);h[w]=F}return h}constructor(t){(0,N._)(this,"factories",void 0),(0,N._)(this,"apis",void 0),this.factories=t,this.apis=new Map}}var Zt;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(Zt||(Zt={}));class Dt{register(t,s){const a=Zt[t],h=this.factories.get(s.api.id);return h&&h.priority>=a?!1:(this.factories.set(s.api.id,{priority:a,factory:s}),!0)}get(t){const s=this.factories.get(t.id);if(s)return s.factory}getAllApis(){const t=new Set;for(const{factory:s}of this.factories.values())t.add(s.api);return t}constructor(){(0,N._)(this,"factories",new Map)}}function et(i){return new Promise((t,s)=>{const a=i.width||500,h=i.height||700,w=window.screen.width/2-a/2,k=window.screen.height/2-h/2,F=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${a},height=${h},top=${k},left=${w}`);let se="";if(!F||typeof F.closed=="undefined"||F.closed){const mt=new Error("Failed to open auth popup.");mt.name="PopupRejectedError",s(mt);return}const be=mt=>{if(mt.source!==F||mt.origin!==i.origin)return;const{data:St}=mt;if(St.type==="config_info"){se=St.targetOrigin;return}if(St.type!=="authorization_response")return;const Et=St;if("error"in Et){const Wt=new Error(Et.error.message);Wt.name=Et.error.name,s(Wt)}else t(Et.response);ze()},Re=setInterval(()=>{if(F.closed){const mt=`Login failed, ${se&&se!==window.location.origin?`Incorrect app origin, expected ${se}`:"popup was closed"}`,St=new Error(mt);St.name="PopupClosedError",s(St),ze()}},100);function ze(){window.removeEventListener("message",be),clearInterval(Re)}window.addEventListener("message",be)})}let lt=!1;function yt(i){return[...i].join(" ")}class At{async createSession(t){return t.instantPopup?this.enableExperimentalRedirectFlow?this.executeRedirect(t.scopes):this.showPopup(t.scopes):this.authRequester(t.scopes)}async refreshSession(t){const s=await fetch(await this.buildUrl("/refresh",{optional:!0,...t&&{scope:this.joinScopesFunc(t)}}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(h=>{throw new Error(`Auth refresh request failed, ${h}`)});if(!s.ok){const h=new Error(`Auth refresh request failed, ${s.statusText}`);throw h.status=s.status,h}const a=await s.json();if(a.error){const h=new Error(a.error.message);throw a.error.name&&(h.name=a.error.name),h}return await this.sessionTransform(a)}async removeSession(){const t=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(s=>{throw new Error(`Logout request failed, ${s}`)});if(!t.ok){const s=new Error(`Logout request failed, ${t.statusText}`);throw s.status=t.status,s}}async showPopup(t){const s=this.joinScopesFunc(t),a=await this.buildUrl("/start",{scope:s,origin:window.location.origin,flow:"popup"}),h=await et({url:a,name:`${this.provider.title} Login`,origin:new URL(a).origin,width:450,height:730});return await this.sessionTransform(h)}async executeRedirect(t){const s=this.joinScopesFunc(t);return window.location.href=await this.buildUrl("/start",{scope:s,origin:window.location.origin,redirectUrl:window.location.href,flow:"redirect"}),new Promise(()=>{})}async buildUrl(t,s){const a=await this.discoveryApi.getBaseUrl("auth"),h=this.buildQueryString({...s,env:this.environment});return`${a}/${this.provider.id}${t}${h}`}buildQueryString(t){if(!t)return"";const s=Object.entries(t).map(([a,h])=>{if(typeof h=="string")return`${encodeURIComponent(a)}=${encodeURIComponent(h)}`;if(h)return encodeURIComponent(a)}).filter(Boolean).join("&");return s?`?${s}`:""}constructor(t){(0,N._)(this,"discoveryApi",void 0),(0,N._)(this,"environment",void 0),(0,N._)(this,"provider",void 0),(0,N._)(this,"joinScopesFunc",void 0),(0,N._)(this,"authRequester",void 0),(0,N._)(this,"sessionTransform",void 0),(0,N._)(this,"enableExperimentalRedirectFlow",void 0);const{configApi:s,discoveryApi:a,environment:h,provider:w,joinScopes:k=yt,oauthRequestApi:F,sessionTransform:se=Re=>Re}=t;!lt&&!s&&(console.warn("DEPRECATION WARNING: Authentication providers require a configApi instance to configure the authentication flow. Please provide one to the authentication provider constructor."),lt=!0);var be;this.enableExperimentalRedirectFlow=s&&(be=s.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&be!==void 0?be:!1,this.authRequester=F.createAuthRequester({provider:w,onAuthRequest:async Re=>this.enableExperimentalRedirectFlow?this.executeRedirect(Re):this.showPopup(Re)}),this.discoveryApi=a,this.environment=h,this.provider=w,this.joinScopesFunc=k,this.sessionTransform=se}}function $t(i,t){for(const s of t)if(!i.has(s))return!1;return!0}class Gt{sessionExistsAndHasScope(t,s){if(!t)return!1;if(!s||this.options.sessionScopes===void 0)return!0;const a=this.options.sessionScopes(t);return $t(a,s)}getExtendedScope(t,s){const a=new Set(this.options.defaultScopes);if(t&&this.options.sessionScopes!==void 0){const h=this.options.sessionScopes(t);for(const w of h)a.add(w)}if(s)for(const h of s)a.add(h);return a}constructor(t){(0,N._)(this,"options",void 0),this.options=t}}var xe=n(82394),Ce=n.n(xe);let Ye=Symbol.observable;class Le{[Ye](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(s=>s.next(t))}error(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(s=>s.error(t))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,s,a){const h=typeof t=="function"?{next:t,error:s,complete:a}:t;return this.observable.subscribe(h)}constructor(){(0,N._)(this,"isClosed",!1),(0,N._)(this,"terminatingError",void 0),(0,N._)(this,"observable",new(Ce())(t=>this.isClosed?(this.terminatingError?t.error(this.terminatingError):t.complete(),()=>{}):(this.subscribers.add(t),()=>{this.subscribers.delete(t)}))),(0,N._)(this,"subscribers",new Set)}}let ct=Symbol.observable;class wt{[ct](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=t,this.subscribers.forEach(s=>s.next(t))}error(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(s=>s.error(t))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,s,a){const h=typeof t=="function"?{next:t,error:s,complete:a}:t;return this.observable.subscribe(h)}constructor(t){(0,N._)(this,"isClosed",void 0),(0,N._)(this,"currentValue",void 0),(0,N._)(this,"terminatingError",void 0),(0,N._)(this,"observable",void 0),(0,N._)(this,"subscribers",new Set),this.isClosed=!1,this.currentValue=t,this.terminatingError=void 0,this.observable=new(Ce())(s=>this.isClosed?(this.terminatingError?s.error(this.terminatingError):s.complete(),()=>{}):(s.next(this.currentValue),this.subscribers.add(s),()=>{this.subscribers.delete(s)}))}}class dt{setIsSignedIn(t){this.signedIn!==t&&(this.signedIn=t,this.subject.next(this.signedIn?g.sM.SignedIn:g.sM.SignedOut))}sessionState$(){return this.subject}constructor(){(0,N._)(this,"subject",new wt(g.sM.SignedOut)),(0,N._)(this,"signedIn",!1)}}class Qe{async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const a=await this.collapsedSessionRefresh(t.scopes),h=this.sessionScopesFunc(this.currentSession),w=this.sessionScopesFunc(a);return $t(w,h)&&(this.currentSession=a),a}catch(a){if(t.optional)return;throw a}}if(!this.currentSession&&!t.instantPopup)try{const s=await this.collapsedSessionRefresh(t.scopes);return this.currentSession=s,this.getSession(t)}catch{}if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(t){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession(t);try{const s=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),s}finally{delete this.refreshPromise}}constructor(t){(0,N._)(this,"connector",void 0),(0,N._)(this,"helper",void 0),(0,N._)(this,"sessionScopesFunc",void 0),(0,N._)(this,"sessionShouldRefreshFunc",void 0),(0,N._)(this,"stateTracker",new dt),(0,N._)(this,"refreshPromise",void 0),(0,N._)(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:h,sessionShouldRefresh:w}=t;this.connector=s,this.sessionScopesFunc=h,this.sessionShouldRefreshFunc=w,this.helper=new Gt({sessionScopes:h,defaultScopes:a})}}class Ge{setSession(t){this.currentSession=t,this.stateTracker.setIsSignedIn(Boolean(t))}async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes))return this.currentSession;if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(t){_define_property(this,"connector",void 0),_define_property(this,"helper",void 0),_define_property(this,"stateTracker",new SessionStateTracker),_define_property(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:h}=t;this.connector=s,this.helper=new SessionScopeHelper({sessionScopes:h,defaultScopes:a})}}const ut={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class pt{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=ut,oauthRequestApi:k,defaultScopes:F=[],scopeTransform:se=ze=>ze}=t,be=new At({configApi:s,discoveryApi:a,environment:h,provider:w,oauthRequestApi:k,sessionTransform(ze){return{...ze,providerInfo:{idToken:ze.providerInfo.idToken,accessToken:ze.providerInfo.accessToken,scopes:pt.normalizeScopes(se,ze.providerInfo.scope),expiresAt:new Date(Date.now()+ze.providerInfo.expiresInSeconds*1e3)}}}}),Re=new Qe({connector:be,defaultScopes:new Set(F),sessionScopes:ze=>ze.providerInfo.scopes,sessionShouldRefresh:ze=>(ze.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new pt({sessionManager:Re,scopeTransform:se})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(t,s){const a=pt.normalizeScopes(this.scopeTransform,t),h=await this.sessionManager.getSession({...s,scopes:a});var w;return(w=h==null?void 0:h.providerInfo.accessToken)!==null&&w!==void 0?w:""}async getIdToken(t={}){const s=await this.sessionManager.getSession({...t,scopes:new Set(["openid"])});var a;return(a=s==null?void 0:s.providerInfo.idToken)!==null&&a!==void 0?a:""}async getBackstageIdentity(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.backstageIdentity}async getProfile(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.profile}static normalizeScopes(t,s){if(!s)return new Set;const a=Array.isArray(s)?s:s.split(/[\s|,]/).filter(Boolean);return new Set(t(a))}constructor(t){(0,N._)(this,"sessionManager",void 0),(0,N._)(this,"scopeTransform",void 0),this.sessionManager=t.sessionManager,this.scopeTransform=t.scopeTransform}}const hn={id:"github",title:"GitHub",icon:()=>null};class pn{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=hn,oauthRequestApi:k,defaultScopes:F=["read:user"]}=t;return pt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:w,environment:h,defaultScopes:F})}}const fn={id:"gitlab",title:"GitLab",icon:()=>null};class _t{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=fn,oauthRequestApi:k,defaultScopes:F=["read_user"]}=t;return pt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:w,environment:h,defaultScopes:F})}}const Sn={id:"google",title:"Google",icon:()=>null},Yt="https://www.googleapis.com/auth/";class rn{static create(t){const{configApi:s,discoveryApi:a,oauthRequestApi:h,environment:w="development",provider:k=Sn,defaultScopes:F=["openid",`${Yt}userinfo.email`,`${Yt}userinfo.profile`]}=t;return pt.create({configApi:s,discoveryApi:a,oauthRequestApi:h,provider:k,environment:w,defaultScopes:F,scopeTransform(se){return se.map(be=>be==="openid"?be:be==="profile"||be==="email"?`${Yt}userinfo.${be}`:be.startsWith(Yt)?be:`${Yt}${be}`)}})}}const jn={id:"okta",title:"Okta",icon:()=>null},on=new Set(["openid","profile","email","phone","address","groups","offline_access"]),En="okta.";class Fn{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=jn,oauthRequestApi:k,defaultScopes:F=["openid","email","profile","offline_access"]}=t;return pt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:w,environment:h,defaultScopes:F,scopeTransform(se){return se.map(be=>on.has(be)||be.startsWith(En)?be:`${En}${be}`)}})}}var nt=n(30195);const sn=nt.z.object({profile:nt.z.object({email:nt.z.string().optional(),displayName:nt.z.string().optional(),picture:nt.z.string().optional()}),backstageIdentity:nt.z.object({token:nt.z.string(),identity:nt.z.object({type:nt.z.literal("user"),userEntityRef:nt.z.string(),ownershipEntityRefs:nt.z.array(nt.z.string())})})}),Jt={id:"saml",title:"SAML",icon:()=>null};class rt{static create(t){const{discoveryApi:s,environment:a="development",provider:h=Jt}=t,w=new DirectAuthConnector({discoveryApi:s,environment:a,provider:h}),k=new StaticAuthSessionManager({connector:w}),F=new AuthSessionStore({manager:k,storageKey:`${h.id}Session`,schema:samlSessionSchema});return new rt(F)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.backstageIdentity}async getProfile(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.profile}constructor(t){_define_property(this,"sessionManager",void 0),this.sessionManager=t}}const In={id:"microsoft",title:"Microsoft",icon:()=>null};class Qt{static create(t){return new Qt(t)}microsoftGraph(){return this.oauth2[Qt.MicrosoftGraphID]}static resourceForScopes(t){const s=[...new Set(t.split(" ").map(Qt.resourceForScope).filter(w=>w!=="openid"))];if(s.length>1)return Promise.reject(new Error(`Requested access token with scopes from multiple Azure resources: ${s.join(", ")}. Access tokens can only have a single audience.`));var a;const h=(a=s[0])!==null&&a!==void 0?a:Qt.MicrosoftGraphID;return Promise.resolve(h)}static resourceForScope(t){var s;const a=(s=t.match(RegExp("^(?<resourceURI>.*)\\/(?<scp>[^\\/]*)$")))===null||s===void 0?void 0:s.groups;if(a){const{resourceURI:h}=a;return h.replace(/^api:\/\//,"")}switch(t){case"email":case"openid":case"offline_access":case"profile":return"openid";default:return Qt.MicrosoftGraphID}}async getAccessToken(t,s){const a=t===void 0?Qt.MicrosoftGraphID:await Qt.resourceForScopes(Array.isArray(t)?t.join(" "):t);return a in this.oauth2||(this.oauth2[a]=pt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform})),this.oauth2[a].getAccessToken(t,s)}getIdToken(t){return this.microsoftGraph().getIdToken(t)}getProfile(t){return this.microsoftGraph().getProfile(t)}getBackstageIdentity(t){return this.microsoftGraph().getBackstageIdentity(t)}signIn(){return this.microsoftGraph().signIn()}signOut(){return this.microsoftGraph().signOut()}sessionState$(){return this.microsoftGraph().sessionState$()}constructor(t){(0,N._)(this,"oauth2",void 0),(0,N._)(this,"configApi",void 0),(0,N._)(this,"environment",void 0),(0,N._)(this,"provider",void 0),(0,N._)(this,"oauthRequestApi",void 0),(0,N._)(this,"discoveryApi",void 0),(0,N._)(this,"scopeTransform",void 0);const{configApi:s,environment:a="development",provider:h=In,oauthRequestApi:w,discoveryApi:k,defaultScopes:F=["openid","offline_access","profile","email","User.Read"],scopeTransform:se=be=>be.concat("offline_access")}=t;this.configApi=s,this.environment=a,this.provider=h,this.oauthRequestApi=w,this.discoveryApi=k,this.scopeTransform=se,this.oauth2={[Qt.MicrosoftGraphID]:pt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform,defaultScopes:F})}}}(0,N._)(Qt,"MicrosoftGraphID","00000003-0000-0000-c000-000000000000");const Pn={id:"onelogin",title:"onelogin",icon:()=>null},Nn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),Ln="onelogin.";class Zn{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=Pn,oauthRequestApi:k}=t;return pt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:w,environment:h,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(F){return F.map(se=>Nn.has(se)||se.startsWith(Ln)?se:`${Ln}${se}`)}})}}const Se={id:"bitbucket",title:"Bitbucket",icon:()=>null};class ce{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=Se,oauthRequestApi:k,defaultScopes:F=["team"]}=t;return pt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:w,environment:h,defaultScopes:F})}}const Ie={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class Ue{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=Ie,oauthRequestApi:k,defaultScopes:F=["PROJECT_ADMIN"]}=t;return pt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:w,environment:h,defaultScopes:F})}}const Ve={id:"atlassian",title:"Atlassian",icon:()=>null};class le{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=Ve,oauthRequestApi:k}=t;return pt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:w,environment:h})}}class U{post(t){this.subject.next(t)}alert$(){return this.subject}constructor(){(0,N._)(this,"subject",new Le)}}class he{captureEvent(t){}}const $e="theme";class Ke{static createWithStorage(t){const s=new Ke(t);if(!window.localStorage)return s;var a;const h=(a=window.localStorage.getItem($e))!==null&&a!==void 0?a:void 0;return s.setActiveThemeId(h),s.activeThemeId$().subscribe(w=>{w?window.localStorage.setItem($e,w):window.localStorage.removeItem($e)}),window.addEventListener("storage",w=>{if(w.key===$e){var k;const F=(k=localStorage.getItem($e))!==null&&k!==void 0?k:void 0;s.setActiveThemeId(F)}}),s}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(t){this.activeThemeId=t,this.subject.next(t)}constructor(t){(0,N._)(this,"themes",void 0),(0,N._)(this,"activeThemeId",void 0),(0,N._)(this,"subject",void 0),this.themes=t,this.subject=new wt(void 0)}}var Je=n(9850),Ft=n.n(Je),Vt=n(12782),en=n.n(Vt);const Xt=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function tn(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function _(i){if(i===null)return"null";if(Array.isArray(i))return"array";const t=typeof i;return t==="number"&&isNaN(i)?"nan":t==="string"&&i===""?"empty-string":t}const X={type(i,t,s,a){return`Invalid type in config for key '${i}' in '${t}', got ${s}, wanted ${a}`},missing(i){return`Missing required config value at '${i}'`},convert(i,t,s){return`Unable to convert config value for key '${i}' in '${t}' to a ${s}`}};class ee{static fromConfigs(t){return t.length===0?new ee(void 0):t.reduce((s,{data:a,context:h,filteredKeys:w,deprecatedKeys:k})=>{const F=new ee(a,h,s);if(F.filteredKeys=w,k)for(const{key:se,description:be}of k)console.warn(`The configuration key '${se}' of ${h} is deprecated and may be removed soon. ${be||""}`);return F},void 0)}has(t){var s;if(this.readValue(t)!==void 0)return!0;var h;return(h=(s=this.fallback)===null||s===void 0?void 0:s.has(t))!==null&&h!==void 0?h:!1}keys(){var t;const s=this.data?Object.keys(this.data):[];var a;const h=(a=(t=this.fallback)===null||t===void 0?void 0:t.keys())!==null&&a!==void 0?a:[];return[...new Set([...s,...h])]}get(t){const s=this.getOptional(t);if(s===void 0)throw new Error(X.missing(this.fullKey(t!=null?t:"")));return s}getOptional(t){var s;const a=Ft()(this.readValue(t)),h=(s=this.fallback)===null||s===void 0?void 0:s.getOptional(t);if(a===void 0){if(!1)var w;return h}else if(h===void 0)return a;return en()({},{value:h},{value:a},(k,F)=>!tn(F)||!tn(k)?F:void 0).value}getConfig(t){const s=this.getOptionalConfig(t);if(s===void 0)throw new Error(X.missing(this.fullKey(t)));return s}getOptionalConfig(t){var s;const a=this.readValue(t),h=(s=this.fallback)===null||s===void 0?void 0:s.getOptionalConfig(t);if(tn(a))return this.copy(a,t,h);if(a!==void 0)throw new TypeError(X.type(this.fullKey(t),this.context,_(a),"object"));return h}getConfigArray(t){const s=this.getOptionalConfigArray(t);if(s===void 0)throw new Error(X.missing(this.fullKey(t)));return s}getOptionalConfigArray(t){const s=this.readConfigValue(t,h=>{if(!Array.isArray(h))return{expected:"object-array"};for(const[w,k]of h.entries())if(!tn(k))return{expected:"object-array",value:k,key:`${t}[${w}]`};return!0});if(!s){if(!1)var a;return}return s.map((h,w)=>this.copy(h,`${t}[${w}]`))}getNumber(t){const s=this.getOptionalNumber(t);if(s===void 0)throw new Error(X.missing(this.fullKey(t)));return s}getOptionalNumber(t){const s=this.readConfigValue(t,h=>typeof h=="number"||typeof h=="string"||{expected:"number"});if(typeof s=="number"||s===void 0)return s;const a=Number(s);if(!Number.isFinite(a))throw new Error(X.convert(this.fullKey(t),this.context,"number"));return a}getBoolean(t){const s=this.getOptionalBoolean(t);if(s===void 0)throw new Error(X.missing(this.fullKey(t)));return s}getOptionalBoolean(t){const s=this.readConfigValue(t,h=>typeof h=="boolean"||typeof h=="number"||typeof h=="string"||{expected:"boolean"});if(typeof s=="boolean"||s===void 0)return s;const a=String(s).trim();if(/^(?:y|yes|true|1|on)$/i.test(a))return!0;if(/^(?:n|no|false|0|off)$/i.test(a))return!1;throw new Error(X.convert(this.fullKey(t),this.context,"boolean"))}getString(t){const s=this.getOptionalString(t);if(s===void 0)throw new Error(X.missing(this.fullKey(t)));return s}getOptionalString(t){return this.readConfigValue(t,s=>typeof s=="string"&&s!==""||{expected:"string"})}getStringArray(t){const s=this.getOptionalStringArray(t);if(s===void 0)throw new Error(X.missing(this.fullKey(t)));return s}getOptionalStringArray(t){return this.readConfigValue(t,s=>{if(!Array.isArray(s))return{expected:"string-array"};for(const[a,h]of s.entries())if(typeof h!="string"||h==="")return{expected:"string-array",value:h,key:`${t}[${a}]`};return!0})}fullKey(t){return`${this.prefix}${this.prefix?".":""}${t}`}copy(t,s,a){const h=new ee(t,this.context,a,this.fullKey(s));return h.filteredKeys=this.filteredKeys,h}readConfigValue(t,s){const a=this.readValue(t);if(a===void 0){var h;if(!1)var w;return(h=this.fallback)===null||h===void 0?void 0:h.readConfigValue(t,s)}const k=s(a);if(k!==!0){const{key:F=t,value:se=a,expected:be}=k;throw new TypeError(X.type(this.fullKey(F),this.context,_(se),be))}return a}readValue(t){const s=t?t.split("."):[];for(const h of s)if(!Xt.test(h))throw new TypeError(`Invalid config key '${t}'`);if(this.data===void 0)return;let a=this.data;for(const[h,w]of s.entries())if(tn(a))a=a[w];else if(a!==void 0){const k=this.fullKey(s.slice(0,h).join("."));throw new TypeError(X.type(k,this.context,_(a),"object"))}return a}constructor(t,s="mock-config",a,h=""){(0,N._)(this,"data",void 0),(0,N._)(this,"context",void 0),(0,N._)(this,"fallback",void 0),(0,N._)(this,"prefix",void 0),(0,N._)(this,"filteredKeys",void 0),(0,N._)(this,"notifiedFilteredKeys",void 0),this.data=t,this.context=s,this.fallback=a,this.prefix=h,this.notifiedFilteredKeys=new Set}}const v="Invalid discovery URL pattern,";class O{static compile(t){const s=t.split(/\{\{\s*pluginId\s*\}\}/),a=s.join("pluginId");let h;try{h=new URL(a)}catch{throw new Error(`${v} URL '${a}' is invalid`)}if(h.hash)throw new Error(`${v} URL must not have a hash`);if(h.search)throw new Error(`${v} URL must not have a query`);if(a.endsWith("/"))throw new Error(`${v} URL must not end with a slash`);return new O(s)}async getBaseUrl(t){return this.parts.join(encodeURIComponent(t))}constructor(t){(0,N._)(this,"parts",void 0),this.parts=t}}class J{post(t,s){return s!=null&&s.hidden||this.alertApi.post({message:t.message,severity:"error"}),this.errorApi.post(t,s)}error$(){return this.errorApi.error$()}constructor(t,s){(0,N._)(this,"alertApi",void 0),(0,N._)(this,"errorApi",void 0),this.alertApi=t,this.errorApi=s}}class M{post(t,s){this.subject.next({error:t,context:s})}error$(){return this.subject}constructor(){(0,N._)(this,"subject",new Le)}}class ue{static forward(t,s){window.addEventListener("unhandledrejection",a=>{t.post(a.reason,s)})}}function ye(i){if(i.length<3)throw new Error(`The '${i}' feature flag must have a minimum length of three characters.`);if(i.length>150)throw new Error(`The '${i}' feature flag must not exceed 150 characters.`);if(!i.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${i}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class Me{registerFlag(t){ye(t.name),this.registeredFeatureFlags.push(t)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(t){return this.flags||(this.flags=this.load()),this.flags.get(t)===g.CL.Active}save(t){this.flags||(this.flags=this.load()),t.merge||this.flags.clear();for(const[a,h]of Object.entries(t.states))this.flags.set(a,h);const s=Array.from(this.flags.entries()).filter(([,a])=>a===g.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(s)))}load(){try{const t=window.localStorage.getItem("featureFlags");if(!t)return new Map;const s=JSON.parse(t);if(typeof s!="object"||s===null||Array.isArray(s))return new Map;const a=Object.entries(s).filter(([h,w])=>(ye(h),w===g.CL.Active));return new Map(a)}catch{return new Map}}constructor(){(0,N._)(this,"registeredFeatureFlags",[]),(0,N._)(this,"flags",void 0)}}function ot(i){let t=i.baseImplementation||n.g.fetch;var s;const a=[(s=i.middleware)!==null&&s!==void 0?s:[]].flat().reverse();for(const h of a)t=h.apply(t);return{fetch:t}}class ht{static create(t){var s,a;const h=Tt(t),w=((s=t.header)===null||s===void 0?void 0:s.name)||"authorization",k=((a=t.header)===null||a===void 0?void 0:a.value)||(F=>`Bearer ${F}`);return new ht(t.identityApi,h,w,k)}apply(t){return async(s,a)=>{const h=new Request(s,a),{token:w}=await this.identityApi.getCredentials();return h.headers.get(this.headerName)||typeof w!="string"||!w||!this.allowUrl(h.url)?t(s,a):(h.headers.set(this.headerName,this.headerValue(w)),t(h))}}constructor(t,s,a,h){(0,N._)(this,"identityApi",void 0),(0,N._)(this,"allowUrl",void 0),(0,N._)(this,"headerName",void 0),(0,N._)(this,"headerValue",void 0),this.identityApi=t,this.allowUrl=s,this.headerName=a,this.headerValue=h}}function Tt(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?jt(i.urlPrefixAllowlist):i.config?jt([i.config.getString("backend.baseUrl")]):()=>!1}function jt(i){const t=i.map(s=>s.replace(/\/$/,""));return s=>t.some(a=>s===a||s.startsWith(`${a}/`))}function st(i,t){return!t||t==="/"?i:`${i.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}class Ne{apply(t){return async(s,a)=>{const h=new Request(s,a),w="plugin://";if(!h.url.startsWith(w))return t(s,a);const{hostname:k,pathname:F,search:se,hash:be,username:Re,password:ze}=new URL(`http://${h.url.substring(w.length)}`);let mt=await this.discoveryApi.getBaseUrl(k);if(Re||ze){const Et=new URL(mt),Wt=`${Re}${ze?`:${ze}`:""}@`;mt=`${Et.protocol}//${Wt}${Et.host}${Et.pathname}`}const St=`${st(mt,F)}${se}${be}`;return t(St,typeof s=="string"||Ut(s)?a:s)}}constructor(t){(0,N._)(this,"discoveryApi",void 0),this.discoveryApi=t}}function Ut(i){return typeof i=="object"&&(i==null?void 0:i.constructor)===URL}class qt{static resolvePluginProtocol(t){return new Ne(t.discoveryApi)}static injectIdentityAuth(t){return ht.create(t)}constructor(){}}function bt(i,t){for(const s of t)if(!i.has(s))return!1;return!0}function Nt(i,...t){const s=new Set(i);for(const a of t)for(const h of a)s.add(h);return s}class gn{request(t){return new Promise((s,a)=>{this.requests.push({scopes:t,resolve:s,reject:a}),this.subject.next(this.getCurrentPending())})}resolve(t,s){this.requests=this.requests.filter(a=>bt(t,a.scopes)?(a.resolve(s),!1):!0),this.subject.next(this.getCurrentPending())}reject(t){this.requests.forEach(s=>s.reject(t)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const t=this.requests.length===0?void 0:this.requests.slice(1).reduce((s,a)=>Nt(s,a.scopes),this.requests[0].scopes);return{scopes:t,resolve:s=>{t&&this.resolve(t,s)},reject:s=>{t&&this.reject(s)}}}constructor(){(0,N._)(this,"requests",[]),(0,N._)(this,"subject",new wt(this.getCurrentPending()))}}class Cn{createAuthRequester(t){const s=new gn,a=this.handlerCount;return this.handlerCount++,s.pending().subscribe({next:h=>{const w=this.currentRequests.slice(),k=this.makeAuthRequest(h,t);k?w[a]=k:delete w[a],this.currentRequests=w,this.subject.next(w.filter(Boolean))}}),h=>s.request(h)}makeAuthRequest(t,s){const{scopes:a}=t;if(a)return{provider:s.provider,trigger:async()=>{const h=await s.onAuthRequest(a);t.resolve(h)},reject:()=>{const h=new Error("Login failed, rejected by user");h.name="RejectedError",t.reject(h)}}}authRequest$(){return this.subject}constructor(){(0,N._)(this,"subject",new wt([])),(0,N._)(this,"currentRequests",[]),(0,N._)(this,"handlerCount",0)}}const vt=new Map;class He{static create(t){var s;return new He((s=t.namespace)!==null&&s!==void 0?s:"",t.errorApi)}static addStorageEventListener(){window.addEventListener("storage",t=>{for(const[a,h]of vt.entries()){var s;!((s=t.key)===null||s===void 0)&&s.startsWith(a)&&h.handleStorageChange(t.key)}})}get(t){return this.snapshot(t).value}snapshot(t){let s,a="absent";try{const h=localStorage.getItem(this.getKeyName(t));h&&(s=JSON.parse(h,(w,k)=>(typeof k=="object"&&k!==null&&Object.freeze(k),k)),a="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${t}`))}return{key:t,value:s,presence:a}}forBucket(t){const s=`${this.namespace}/${t}`;return vt.has(s)||vt.set(s,new He(s,this.errorApi)),vt.get(s)}async set(t,s){localStorage.setItem(this.getKeyName(t),JSON.stringify(s)),this.notifyChanges(t)}async remove(t){localStorage.removeItem(this.getKeyName(t)),this.notifyChanges(t)}observe$(t){return He.hasSubscribed||(He.addStorageEventListener(),He.hasSubscribed=!0),this.observable.filter(({key:s})=>s===t)}handleStorageChange(t){if(!(t!=null&&t.startsWith(this.namespace)))return;const s=t==null?void 0:t.slice(`${this.namespace}/`.length);s.includes("/")||this.notifyChanges(decodeURIComponent(s))}getKeyName(t){return`${this.namespace}/${encodeURIComponent(t)}`}notifyChanges(t){const s=this.snapshot(t);for(const a of this.subscribers)a.next(s)}constructor(t,s){(0,N._)(this,"namespace",void 0),(0,N._)(this,"errorApi",void 0),(0,N._)(this,"subscribers",void 0),(0,N._)(this,"observable",void 0),this.namespace=t,this.errorApi=s,this.subscribers=new Set,this.observable=new(Ce())(a=>(this.subscribers.add(a),()=>{this.subscribers.delete(a)}))}}(0,N._)(He,"hasSubscribed",!1);const Lt=(0,W.createContext)(void 0);function xn(){const[i]=(0,z.is)((0,p.jsx)(z.AW,{index:!0,element:(0,p.jsx)("div",{})}));return!i.index}var nn=n(84800);const sr=(i,t)=>{try{var s;const a=(0,nn.fp)(t,{pathname:i}),h=a==null?void 0:a.filter(se=>{var be;return((be=se==null?void 0:se.route.routeRefs)===null||be===void 0?void 0:be.size)>0}).pop(),w=h==null?void 0:h.route;if(!w)return;let k;w.routeRefs.size===1&&(k=w.routeRefs.values().next().value);const F=Object.entries((h==null?void 0:h.params)||{}).reduce((se,[be,Re])=>(Re!==void 0&&(se[be]=Re),se),{});return{extension:"App",pluginId:((s=w.plugin)===null||s===void 0?void 0:s.getId())||"root",...k?{routeRef:k.id}:{},params:F}}catch{return}},mr=({pathname:i,search:t,hash:s,attributes:a})=>{const h=(0,g.z$)();return(0,W.useEffect)(()=>{h.captureEvent("navigate",`${i}${t}${s}`,{attributes:a})},[h,i,t,s,a]),null},Gn=({routeObjects:i})=>{const{pathname:t,search:s,hash:a}=(0,z.TH)(),{params:h,...w}=sr(t,i)||{params:{}};return(0,p.jsx)(g.fC,{attributes:w,children:(0,p.jsx)(mr,{pathname:t,search:s,hash:a,attributes:h})})};function cn(i){return xn()?ir(i):""}function ir(i){var t;let{pathname:s}=new URL((t=i.getOptionalString("app.baseUrl"))!==null&&t!==void 0?t:"/","http://sample.dev");return s=s.replace(/\/*$/,""),s}function Nr({component:i,appIdentityProxy:t,children:s}){const[a,h]=(0,W.useState)(),w=(0,g.h_)(g.Ds),k=cn(w);return a?(t.setTarget(a,{signOutTargetUrl:k||"/"}),(0,p.jsx)(p.Fragment,{children:s})):(0,p.jsx)(i,{onSignInSuccess:h})}function Zr(i){const{Router:t,SignInPage:s}=(0,g.qD)().getComponents(),a=(0,g.h_)(g.Ds),h=ir(a),w=`${h}/*`,k=(0,W.useContext)(Lt);if(!k)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:F,appIdentityProxy:se}=k;return s?xn()?(0,p.jsxs)(t,{children:[(0,p.jsx)(Gn,{routeObjects:F}),(0,p.jsx)(Nr,{component:s,appIdentityProxy:se,children:(0,p.jsx)(z.Z5,{children:(0,p.jsx)(z.AW,{path:w,element:(0,p.jsx)(p.Fragment,{children:i.children})})})})]}):(0,p.jsxs)(t,{basename:h,children:[(0,p.jsx)(Gn,{routeObjects:F}),(0,p.jsx)(Nr,{component:s,appIdentityProxy:se,children:i.children})]}):(se.setTarget({getUserId:()=>"guest",getIdToken:async()=>{},getProfile:()=>({email:"guest@example.com",displayName:"Guest"}),getProfileInfo:async()=>({email:"guest@example.com",displayName:"Guest"}),getBackstageIdentity:async()=>({type:"user",userEntityRef:"user:default/guest",ownershipEntityRefs:["user:default/guest"]}),getCredentials:async()=>({}),signOut:async()=>{}},{signOutTargetUrl:h||"/"}),xn()?(0,p.jsxs)(t,{children:[(0,p.jsx)(Gn,{routeObjects:F}),(0,p.jsx)(z.Z5,{children:(0,p.jsx)(z.AW,{path:w,element:(0,p.jsx)(p.Fragment,{children:i.children})})})]}):(0,p.jsxs)(t,{basename:h,children:[(0,p.jsx)(Gn,{routeObjects:F}),i.children]}))}var Kn=n(88412),Rr=n(50629),S=n(80956),c=n(64279);function b(i){const t={};for(const a in i.collectors)i.collectors.hasOwnProperty(a)&&(t[a]=i.collectors[a]());const s=[{node:W.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;s.length!==0;){const{node:a,parent:h,contexts:w}=s.shift();W.Children.forEach(a,k=>{if(!(0,W.isValidElement)(k))return;const F={};for(const se in t)if(t.hasOwnProperty(se)){const be=t[se];F[se]=be.visit(be.accumulator,k,h,w[se])}for(const se of i.discoverers){const be=se(k);be&&s.push({node:be,parent:k,contexts:F})}})}return Object.fromEntries(Object.entries(t).map(([a,h])=>[a,h.accumulator]))}function j(i,t){return()=>({accumulator:i(),visit:t})}function K(i){var t;return(t=i.props)===null||t===void 0?void 0:t.children}function me(i){var t,s;if(!((t=i.props)===null||t===void 0)&&t.path&&(!((s=i.props)===null||s===void 0)&&s.element)){var a;return(a=i.props)===null||a===void 0?void 0:a.element}}const we=j(()=>new Set,(i,t)=>{const s=(0,g.IY)(t,"core.plugin");s&&i.add(s)}),Fe=i=>{const{children:t}=i,s=(0,g.h_)(g.W0),a="with"in i?s.isActive(i.with):!s.isActive(i.without);return(0,p.jsx)(p.Fragment,{children:a?t:null})};(0,g.R5)(Fe,"core.featureFlagged",!0);const Xe={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function Mt(i){const t=i;if(t!=null&&t.type){var s,a;return(a=(s=t.type.displayName)!==null&&s!==void 0?s:t.type.name)!==null&&a!==void 0?a:String(t.type)}return String(t)}function wn(i,t=new Array){return W.Children.forEach(i,s=>{if(!(0,W.isValidElement)(s))return;const a=(0,g.IY)(s,"core.mountPoint");if(a){const h=(0,g.IY)(s,"core.plugin");t.push({routeRef:a,plugin:h})}wn(s.props.children,t)}),t}const Qn=j(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,s,a)=>{var h,w;if(a!=null&&a.isElementAncestor)return a;if((s==null?void 0:s.props.element)===t)return{...a,isElementAncestor:!0};const k=(h=t.props)===null||h===void 0?void 0:h.path,F=(0,g.IY)(t,"core.mountPoint");if(F&&k)throw new Error(`Path property may not be set directly on a routable extension "${Mt(t)}"`);var se;const be=(se=a==null||(w=a.obj)===null||w===void 0?void 0:w.children)!==null&&se!==void 0?se:i.objects;if(k!==void 0){if(typeof k!="string")throw new Error(`Element path must be a string at "${Mt(t)}"`);const St=k.startsWith("/")?k.slice(1):k,Et=t.props.element;if((0,g.IY)(t,"core.gatherMountPoints")){var Re;if(Et)throw new Error(`Mount point gatherers may not have an element prop "${Mt(t)}"`);const Wt={path:St,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Re=t.props)===null||Re===void 0?void 0:Re.caseSensitive),children:[Xe],plugin:void 0};return be.push(Wt),{obj:Wt,gatherPath:St,routeRef:a==null?void 0:a.routeRef,gatherRouteRef:a==null?void 0:a.routeRef}}if(Et){var ze;const[Wt,...Ht]=wn(Et);if(Ht.length>0)throw new Error(`Route element with path "${k}" may not contain multiple routable extensions`);if(!Wt)return a;const{routeRef:Wn,plugin:Sr}=Wt,Cr={path:St,element:"mounted",routeRefs:new Set([Wn]),caseSensitive:Boolean((ze=t.props)===null||ze===void 0?void 0:ze.caseSensitive),children:[Xe],plugin:Sr};return be.push(Cr),i.paths.set(Wn,St),i.parents.set(Wn,a==null?void 0:a.routeRef),{obj:Cr,routeRef:Wn!=null?Wn:a==null?void 0:a.routeRef,gatherPath:St,gatherRouteRef:a==null?void 0:a.gatherRouteRef}}}if(F){var mt;if((a==null?void 0:a.gatherPath)===void 0)throw new Error(`Routable extension "${Mt(t)}" with mount point "${F}" must be assigned a path`);return a==null||(mt=a.obj)===null||mt===void 0||mt.routeRefs.add(F),i.paths.set(F,a.gatherPath),i.parents.set(F,a==null?void 0:a.gatherRouteRef),{...a,routeRef:F}}return a}),ar=j(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,s,a)=>{var h,w,k;if((s==null?void 0:s.props.element)===t)return a;let F=a==null?void 0:a.obj,se=a==null?void 0:a.routeRef,be=a==null?void 0:a.sticky;const Re=(h=t.props)===null||h===void 0?void 0:h.path;var ze;const mt=(ze=F==null?void 0:F.children)!==null&&ze!==void 0?ze:i.objects,St=Boolean((w=t.props)===null||w===void 0?void 0:w.caseSensitive);let Et=a==null?void 0:a.path;if((0,g.IY)(t,"core.gatherMountPoints")){if(!Re)throw new Error("Mount point gatherer must have a path");Et=Re}const Wt=(k=t.props)===null||k===void 0?void 0:k.element;let Ht=(0,g.IY)(t,"core.mountPoint");if(!Ht&&(0,W.isValidElement)(Wt)&&(Ht=(0,g.IY)(Wt,"core.mountPoint")),Ht){let Cr=Re;if(Et&&(Cr?Et=void 0:Cr=Et),!Cr)throw new Error("Mounted routable extension must have a path");i.paths.set(Ht,Cr),se&&be?(i.parents.set(Ht,se),Re&&(se=Ht,be=!1)):(i.parents.set(Ht,se),se=Ht),Re?(F={caseSensitive:St,path:Re,element:"mounted",routeRefs:new Set([Ht]),children:[Xe],plugin:(0,g.IY)(t.props.element,"core.plugin")},mt.push(F)):F==null||F.routeRefs.add(Ht)}if((0,g.IY)(t,"core.gatherMountPoints")&&(be=!0),(0,g.IY)(t,"core.gatherMountPoints")){if(!Re)throw new Error("Mount point gatherer must have a path");if(!Ht){var Sr;F={caseSensitive:St,path:Re,element:"gathered",routeRefs:new Set,children:[Xe],plugin:a==null||(Sr=a.obj)===null||Sr===void 0?void 0:Sr.plugin},mt.push(F)}}return{obj:F,path:Et,routeRef:se,sticky:be}}),vr=j(()=>new Set,(i,t)=>{if(t.type===Fe){const s=t.props;i.add("with"in s?s.with:s.without)}}),an=(0,at.uW)("route-ref-type",()=>Symbol("route-ref-type"));function mo(i){return i[an]==="absolute"}function _r(i){return i[an]==="sub"}function Oo(i){return i[an]==="external"}function eo(...i){const t=i.join("/").replace(/\/\/+/g,"/");return t!=="/"&&t.endsWith("/")?t.slice(0,-1):t}function vo(i,t,s){let a,h="";if(mo(i))a=i;else if(_r(i))a=i.parent,h=i.path;else if(Oo(i)){const F=s.get(i);if(!F)return[void 0,""];if(mo(F))a=F;else if(_r(F))a=F.parent,h=F.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${F}`)}else throw i[an]?new Error(`Unknown or invalid route ref type, ${i[an]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!a)return[void 0,""];const w=t.get(a);if(w===void 0)return[void 0,""];const k=eo(w,h);return[a,k]}function ko(i,t,s,a,h){var w;const k=(w=(0,nn.fp)(h,t))!==null&&w!==void 0?w:[],F=Array();let se=-1;for(let ze=i;ze&&(se=k.findIndex(mt=>mt.route.routeRefs.has(ze)),se===-1);ze=a.get(ze))F.unshift(ze);F.length===0&&(se-=1);const be=se===-1?"":k[se].pathname,Re=F.slice(0,-1).map(ze=>{const mt=s.get(ze);if(mt===void 0)throw new Error(`No path for ${ze}`);if(mt.includes(":"))throw new Error(`Cannot route to ${i} with parent ${ze} as it has parameters`);return mt});return`${eo(be,...Re)}/`}class xs{resolve(t,s){const[a,h]=vo(t,this.routePaths,this.routeBindings);if(!a)return;let w;typeof s=="string"?w=this.trimPath(s):s.pathname?w={...s,pathname:this.trimPath(s.pathname)}:w=s;const k=this.appBasePath+ko(a,w,this.routePaths,this.routeParents,this.routeObjects);return(...[se])=>eo(k,(0,nn.Gn)(h,se))}trimPath(t){return t&&(t.startsWith(this.appBasePath)?t.slice(this.appBasePath.length):t)}constructor(t,s,a,h,w){(0,N._)(this,"routePaths",void 0),(0,N._)(this,"routeParents",void 0),(0,N._)(this,"routeObjects",void 0),(0,N._)(this,"routeBindings",void 0),(0,N._)(this,"appBasePath",void 0),this.routePaths=t,this.routeParents=s,this.routeObjects=a,this.routeBindings=h,this.appBasePath=w}}const Bo=(0,at.CT)("routing-context"),$o=({routePaths:i,routeParents:t,routeObjects:s,routeBindings:a,basePath:h="",children:w})=>{const k=new xs(i,t,s,a,h),F=(0,at.EI)({1:k});return(0,p.jsx)(Bo.Provider,{value:F,children:w})};function yr(i,t){const s=new Set(t.values());s.delete(void 0);for(const a of t.keys()){if(s.has(a))continue;let h=a,w="";for(;h;){const F=i.get(h);if(F===void 0)throw new Error(`No path for ${h}`);w=eo(F,w),h=t.get(h)}const k=w.match(/:(\w+)/g);if(k){for(let F=0;F<k.length;F++)for(let se=F+1;se<k.length;se++)if(k[se]===k[F])throw new Error(`Parameter ${k[se]} is duplicated in path ${w}`)}}}function er(i,t){for(const s of t)if(s.externalRoutes){for(const[a,h]of Object.entries(s.externalRoutes))if(!h.optional&&!i.has(h))throw new Error(`External route '${a}' of the '${s.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const Or=(0,at.CT)("app-context"),Ur=({appContext:i,children:t})=>{const s=(0,at.EI)({1:i});return(0,p.jsx)(Or.Provider,{value:s,children:t})};function to(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function no(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class Mr{setTarget(t,s){this.target=t,this.signOutTargetUrl=s.signOutTargetUrl,this.resolveTarget(t)}getUserId(){if(!this.target)throw to("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return no("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw to("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return no("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(t=>t.getProfileInfo())}async getBackstageIdentity(){const t=await this.waitForTarget.then(s=>s.getBackstageIdentity());return t.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${t.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),t}async getCredentials(){return this.waitForTarget.then(t=>t.getCredentials())}async getIdToken(){return this.waitForTarget.then(t=>{if(!t.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return no("getIdToken"),t.getIdToken()})}async signOut(){await this.waitForTarget.then(t=>t.signOut()),window.location.href=this.signOutTargetUrl}constructor(){(0,N._)(this,"target",void 0),(0,N._)(this,"waitForTarget",void 0),(0,N._)(this,"resolveTarget",()=>{}),(0,N._)(this,"signOutTargetUrl","/"),this.waitForTarget=new Promise(t=>{this.resolveTarget=t})}}var Do=n(72164);function yo(i,t,s){if(i!==void 0){const h=s.find(w=>w.id===i);if(h)return h}if(t){const h=s.find(w=>w.variant==="dark");if(h)return h}const a=s.find(h=>h.variant==="light");return a||s[0]}const On=()=>{const i=(0,W.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[t,s]=(0,W.useState)(i.matches);return(0,W.useEffect)(()=>{const a=h=>{s(h.matches)};return i.addListener(a),()=>{i.removeListener(a)}},[i]),t};function Xn({children:i}){const t=(0,g.h_)(g.hg),s=(0,Do.Z)(t.activeThemeId$(),t.getActiveThemeId()),a=Boolean(window.matchMedia)?On():!1,h=yo(s,a,t.getInstalledThemes());if(!h)throw new Error("App has no themes");return(0,p.jsx)(h.Provider,{children:i})}const kr=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const t=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!t)throw new Error("No static configuration provided");if(!Array.isArray(t))throw new Error("Static configuration has invalid format");const s=t.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const h=JSON.parse(i);Array.isArray(h)?s.push(...h):s.push({data:h,context:"env"})}catch(h){throw new Error(`Failed to load runtime configuration, ${h}`)}const a=window.__APP_CONFIG__;return a&&s.push({context:"window",data:a}),s};class zr{add(t,s){return this.apis.push([t.id,s]),s}build(){return new Ir(new Map(this.apis))}constructor(){(0,N._)(this,"apis",[])}}class Ir{static builder(){return new zr}static from(t){return new Ir(new Map(t.map(([s,a])=>[s.id,a])))}static with(t,s){return new Ir(new Map([[t.id,s]]))}with(t,s){return new Ir(new Map([...this.apis,[t.id,s]]))}get(t){return this.apis.get(t.id)}constructor(t){(0,N._)(this,"apis",void 0),this.apis=t}}function ro(i){const t=new Map;return i&&i({bind:(a,h)=>{for(const[w,k]of Object.entries(h)){const F=a[w];if(!F)throw new Error(`Key ${w} is not an existing external route`);if(!k&&!F.optional)throw new Error(`External route ${w} is required but was undefined`);k&&t.set(F,k)}}}),t}function oo(i){const t=new URL(i);return t.protocol=document.location.protocol,t.hostname=document.location.hostname,t.port=document.location.port,t.toString().replace(/\/$/,"")}function Fo(i,t,s){var a;const h=Boolean(i),w=(0,c.default)(i||(()=>Promise.resolve([])));let k;if(h&&w.loading){const{Progress:be}=t;k=(0,p.jsx)(be,{})}else if(w.error){const{BootErrorPage:be}=t;k=(0,p.jsx)(be,{step:"load-config",error:w.error})}const{ThemeProvider:F=Xn}=t;if(k)return{node:(0,p.jsx)(zt,{apis:Ir.with(g.hg,s),children:(0,p.jsx)(F,{children:k})})};let se;if(!((a=w.value)===null||a===void 0)&&a.length){const be=ee.fromConfigs(w.value),Re=be.getOptionalString("app.baseUrl"),ze=be.getOptionalString("backend.baseUrl");let mt=w.value;const St={data:{},context:"relative-resolver"};if(Re&&ze){const Et=new URL(Re).origin,Wt=new URL(ze).origin;if(Et===Wt){const Ht=oo(ze);ze!==Ht&&(St.data.backend={baseUrl:Ht})}}if(Re){const Et=oo(Re);Re!==Et&&(St.data.app={baseUrl:Et})}Object.keys(St.data).length&&(mt=mt.concat([St])),se=ee.fromConfigs(mt)}else se=ee.fromConfigs([]);return{api:se}}class xo{getPlugins(){return this.app.getPlugins()}getSystemIcon(t){return this.app.getSystemIcon(t)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(t){(0,N._)(this,"app",void 0),this.app=t}}var lr=new WeakMap;class bs{getPlugins(){return Array.from(this.plugins)}getSystemIcon(t){return this.icons[t]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(t){const s=this.getProvider();return()=>(0,p.jsx)(s,{children:t})}getProvider(){if((0,Kn._)(this,lr))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,S._)(this,lr,!0);const t=new xo(this);let s=!1;return({children:h})=>{const w=(0,W.useRef)(!0),k=(0,W.useMemo)(()=>Ke.createWithStorage(this.themes),[]),{routing:F,featureFlags:se,routeBindings:be}=(0,W.useMemo)(()=>{const St=b({root:h,discoverers:[K,me],collectors:{routing:xn()?ar:Qn,collectedPlugins:we,featureFlags:vr}});return St.collectedPlugins.forEach(Et=>this.plugins.add(Et)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...St,routeBindings:ro(this.bindRoutes)}},[h]);s||(s=!0,yr(F.paths,F.parents),er(be,this.plugins));const Re=Fo(this.configLoader,this.components,k),ze="api"in Re;if(ze){const{api:St}=Re;this.configApi=St}if("node"in Re)return Re.node;if(ze&&w.current){w.current=!1;const St=this.getApiHolder().get(g.W0);if(St){for(const Ht of this.featureFlags)St.registerFlag({...Ht,pluginId:""});for(const Ht of this.plugins.values())if("getFeatureFlags"in Ht)for(const Wn of Ht.getFeatureFlags())St.registerFlag({name:Wn.name,pluginId:Ht.getId()});else for(const Wn of Ht.output())Wn.type==="feature-flag"&&St.registerFlag({name:Wn.name,pluginId:Ht.getId()});const Et=St.getRegisteredFlags(),Wt=new Set(Et.map(Ht=>Ht.name));for(const Ht of se)Wt.has(Ht)||St.registerFlag({name:Ht,pluginId:""})}}const{ThemeProvider:mt=Xn}=this.components;return(0,p.jsx)(zt,{apis:this.getApiHolder(),children:(0,p.jsx)(Ur,{appContext:t,children:(0,p.jsx)(mt,{children:(0,p.jsx)($o,{routePaths:F.paths,routeParents:F.parents,routeObjects:F.objects,routeBindings:be,basePath:cn(Re.api),children:(0,p.jsx)(Lt.Provider,{value:{routeObjects:F.objects,appIdentityProxy:this.appIdentityProxy},children:h})})})})})}}getRouter(){return Zr}getApiHolder(){if(this.apiHolder){for(const t of this.plugins)for(const s of t.getApis())this.apiFactoryRegistry.get(s.api)||this.apiFactoryRegistry.register("default",s);return xt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:g.hg,deps:{},factory:()=>Ke.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:g.Ds,deps:{},factory:()=>{if(!this.configApi)throw new Error("Tried to access config API before config was loaded");return this.configApi}}),this.apiFactoryRegistry.register("static",{api:g.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:g.W0,deps:{},factory:()=>new Me});for(const t of this.defaultApis)this.apiFactoryRegistry.register("default",t);for(const t of this.plugins)for(const s of t.getApis())if(!this.apiFactoryRegistry.register("default",s))throw new Error(`Plugin ${t.getId()} tried to register duplicate or forbidden API factory for ${s.api}`);for(const t of this.apis)if(!this.apiFactoryRegistry.register("app",t))throw new Error(`Duplicate or forbidden API factory for ${t.api} in app`);return xt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new xt(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(t){const s=new Set;for(const a of t){const h=a.getId();if(s.has(h))throw new Error(`Duplicate plugin found '${h}'`);s.add(h)}}constructor(t){(0,N._)(this,"apiHolder",void 0),(0,N._)(this,"configApi",void 0),(0,N._)(this,"apis",void 0),(0,N._)(this,"icons",void 0),(0,N._)(this,"plugins",void 0),(0,N._)(this,"featureFlags",void 0),(0,N._)(this,"components",void 0),(0,N._)(this,"themes",void 0),(0,N._)(this,"configLoader",void 0),(0,N._)(this,"defaultApis",void 0),(0,N._)(this,"bindRoutes",void 0),(0,N._)(this,"appIdentityProxy",new Mr),(0,N._)(this,"apiFactoryRegistry",void 0),(0,Rr._)(this,lr,{writable:!0,value:!1});var s;this.apis=(s=t.apis)!==null&&s!==void 0?s:[],this.icons=t.icons;var a;this.plugins=new Set((a=t.plugins)!==null&&a!==void 0?a:[]);var h;this.featureFlags=(h=t.featureFlags)!==null&&h!==void 0?h:[],this.components=t.components,this.themes=t.themes;var w;this.configLoader=(w=t.configLoader)!==null&&w!==void 0?w:kr;var k;this.defaultApis=(k=t.defaultApis)!==null&&k!==void 0?k:[],this.bindRoutes=t.bindRoutes,this.apiFactoryRegistry=new Dt}}function No(i){return new bs(i)}let Wr=!1;const Zo=i=>{const t=(0,g.qD)(),{NotFoundErrorPage:s}=t.getComponents(),a=(0,W.useMemo)(()=>xn(),[]),w=[...(0,g.vJ)(i.children,k=>k.getElements().flatMap(F=>{let se=F.props.path;if(se==="")return[];var be;se=(be=se==null?void 0:se.replace(/\/\*$/,""))!==null&&be!==void 0?be:"/";let Re=a?F:F.props.element;return!a&&!Re&&(Re=F,Wr||(console.warn("DEPRECATION WARNING: All elements within <FlatRoutes> must be of type <Route> with an element prop. Existing usages of <Navigate key=[path] to=[to] /> should be replaced with <Route path=[path] element={<Navigate to=[to] />} />."),Wr=!0)),[{path:se,element:Re,children:F.props.children?[{path:se==="/"?"/":"*",element:F.props.children}]:void 0}]}).sort((F,se)=>se.path.localeCompare(F.path)).map(F=>({...F,path:F.path==="/"?"/":`${F.path}/*`}))),{path:"*",element:(0,p.jsx)(s,{})}];return(0,z.V$)(w)},Uo=(0,g.T0)({id:"plugin.permission.api"});var qn;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(qn||(qn={}));function ri(i,t){return i.name===t.name}function Ss(i,t){return"resourceType"in i?!t||i.resourceType===t:!1}function Cs(i){return i.attributes.action==="create"}function ws(i){return i.attributes.action==="read"}function so(i){return i.attributes.action==="update"}function Vr(i){return i.attributes.action==="delete"}function Hr(i){return{authorize:async(t,s)=>await i.authorize(t,s),authorizeConditional(t,s){const a=t;return i.authorize(a,s)}}}function cr({name:i,attributes:t,resourceType:s}){return s?{type:"resource",name:i,attributes:t,resourceType:s}:{type:"basic",name:i,attributes:t}}var Mo=n(23054),Yn=n(96279),io=n.n(Yn),zo=n(9571);const ao=nt.z.lazy(()=>nt.z.object({rule:nt.z.string(),resourceType:nt.z.string(),params:nt.z.record(nt.z.any()).optional()}).or(nt.z.object({anyOf:nt.z.array(ao).nonempty()})).or(nt.z.object({allOf:nt.z.array(ao).nonempty()})).or(nt.z.object({not:ao}))),Wo=nt.z.object({result:nt.z.literal(qn.ALLOW).or(nt.z.literal(qn.DENY))}),Vo=nt.z.union([nt.z.object({result:nt.z.literal(qn.ALLOW).or(nt.z.literal(qn.DENY))}),nt.z.object({result:nt.z.literal(qn.CONDITIONAL),pluginId:nt.z.string(),resourceType:nt.z.string(),conditions:ao})]),js=(i,t)=>nt.z.object({items:nt.z.array(nt.z.intersection(nt.z.object({id:nt.z.string()}),i)).refine(s=>s.length===t.size&&s.every(({id:a})=>t.has(a)),{message:"Items in response do not match request"})});class Ho{async authorize(t,s){return this.makeRequest(t,Wo,s)}async authorizeConditional(t,s){return this.makeRequest(t,Vo,s)}async makeRequest(t,s,a){if(!this.enabled)return t.map(Re=>({result:qn.ALLOW}));const h={items:t.map(Re=>({id:zo.Z(),...Re}))},w=await this.discovery.getBaseUrl("permission"),k=await io()(`${w}/authorize`,{method:"POST",body:JSON.stringify(h),headers:{...this.getAuthorizationHeader(a==null?void 0:a.token),"content-type":"application/json"}});if(!k.ok)throw await Mo.VL.fromResponse(k);const F=await k.json(),be=js(s,new Set(h.items.map(({id:Re})=>Re))).parse(F).items.reduce((Re,ze)=>(Re[ze.id]=ze,Re),{});return h.items.map(Re=>be[Re.id])}getAuthorizationHeader(t){return t?{Authorization:`Bearer ${t}`}:{}}constructor(t){(0,N._)(this,"enabled",void 0),(0,N._)(this,"discovery",void 0),this.discovery=t.discovery;var s;this.enabled=(s=t.config.getOptionalBoolean("permission.enabled"))!==null&&s!==void 0?s:!1}}class lo{static create(t){const{config:s,discovery:a,identity:h}=t,w=new Ho({discovery:a,config:s});return new lo(w,h)}async authorize(t){return(await this.permissionClient.authorize([t],await this.identityApi.getCredentials()))[0]}constructor(t,s){(0,N._)(this,"permissionClient",void 0),(0,N._)(this,"identityApi",void 0),this.permissionClient=t,this.identityApi=s}}var Go=n(69984);function bo(i){const t=(0,g.h_)(Uo),{data:s,error:a}=(0,Go.ZP)(i,async h=>{if(Ss(h.permission)&&!h.resourceRef)return qn.DENY;const{result:w}=await t.authorize(h);return w});return a?{error:a,loading:!1,allowed:!1}:s===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:s===qn.ALLOW}}const So=i=>{const{permission:t,resourceRef:s,errorComponent:a,...h}=i,w=usePermission(isResourcePermission(t)?{permission:t,resourceRef:s}:{permission:t}),k=useApp(),{NotFoundErrorPage:F}=k.getComponents();let se=a===void 0?_jsx(F,{}):a;return w.loading?se=null:w.allowed&&(se=i.element),_jsx(Route,{...h,element:se})};function Es(i){const{permission:t,resourceRef:s}=i,a=usePermission(isResourcePermission(t)?{permission:t,resourceRef:s}:{permission:t}),h=useApp();if(a.loading)return null;if(a.allowed)return _jsx(_Fragment,{children:i.children});if(i.errorPage)return _jsx(_Fragment,{children:i.errorPage});const{NotFoundErrorPage:w}=h.getComponents();return _jsx(w,{})}const As=[(0,g.ni)({api:g.NW,deps:{configApi:g.Ds},factory:({configApi:i})=>O.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,g.ni)({api:g.$v,deps:{},factory:()=>new U}),(0,g.ni)({api:g.v_,deps:{},factory:()=>new he}),(0,g.ni)({api:g.VE,deps:{alertApi:g.$v},factory:({alertApi:i})=>{const t=new J(i,new M);return ue.forward(t,{hidden:!1}),t}}),(0,g.ni)({api:g.E6,deps:{errorApi:g.VE},factory:({errorApi:i})=>He.create({errorApi:i})}),(0,g.ni)({api:g.gP,deps:{configApi:g.Ds,identityApi:g.$4,discoveryApi:g.NW},factory:({configApi:i,identityApi:t,discoveryApi:s})=>ot({middleware:[qt.resolvePluginProtocol({discoveryApi:s}),qt.injectIdentityAuth({identityApi:t,config:i})]})}),(0,g.ni)({api:g.ZM,deps:{},factory:()=>new Cn}),(0,g.ni)({api:g.Kp,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>rn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.p_,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Qt.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.F4,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>pn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,defaultScopes:["read:user"],environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.D,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Fn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.ux,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>_t.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.gW,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Zn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.bq,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>ce.create({configApi:s,discoveryApi:i,oauthRequestApi:t,defaultScopes:["team"],environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.Km,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Ue.create({configApi:s,discoveryApi:i,oauthRequestApi:t,defaultScopes:["REPO_READ"]})}),(0,g.ni)({api:g.uB,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>le.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:Uo,deps:{discovery:g.NW,identity:g.$4,config:g.Ds},factory:({config:i,discovery:t,identity:s})=>lo.create({config:i,discovery:t,identity:s})})];var Ko=n(77277),ln=n(53974),Yo=n(71597);function Ts({children:i}){return(0,z.GV)()?(0,p.jsx)(p.Fragment,{children:i}):(0,p.jsx)(z.VA,{children:i})}const y=()=>(0,p.jsx)(ln.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),C=({step:i,error:t})=>{let s="";return i==="load-config"?s=`The configuration failed to load, someone should have a look at this error: ${t.message}`:i==="load-chunk"&&(s=`Lazy loaded chunk failed to load, try to reload the page: ${t.message}`),(0,p.jsx)(Ts,{children:(0,p.jsx)(ln.mf,{status:"501",statusMessage:s})})},E=({error:i,resetError:t,plugin:s})=>(0,p.jsx)(ln.yu,{title:`Error in ${s==null?void 0:s.getId()}`,defaultExpanded:!0,error:i,children:(0,p.jsx)(Ko.Z,{variant:"outlined",onClick:t,children:"Retry"})}),B={Progress:ln.Ex,Router:Yo.VK,NotFoundErrorPage:y,BootErrorPage:C,ErrorBoundaryFallback:E};var Q=n(43642),ne=n(80079),re=n(90941),ve=n(32915),Ae=n(40562),Oe=n(21853),De=n(60744),Be=n(66569),tt=n(30254),ft=n(13384),qe=n(15933),We=n(58838),gt=n(86737),Ot=n(4989),bn=n(44407),Rt=n(18628),Kt=n(84219),kt=n(98685),dn=n(39781),Bn=n(39412);const Pr={brokenImage:ne.Z,catalog:Rt.Z,scaffolder:ve.Z,techdocs:Ae.Z,search:Oe.Z,chat:De.Z,dashboard:Be.Z,docs:tt.Z,email:ft.Z,github:We.Z,group:Kt.Z,help:gt.Z,"kind:api":qe.Z,"kind:component":bn.Z,"kind:domain":Q.Z,"kind:group":Kt.Z,"kind:location":Ot.Z,"kind:system":re.Z,"kind:user":kt.Z,"kind:resource":Bn.Z,user:kt.Z,warning:dn.Z};var dr=n(73689),Gr=n(4707);function Dn(i,t){if(!t||typeof t=="string")return;const s=typeof t=="function"?t(i):t;if(s)return{"@global":s}}function Un(i,t){if(!(!t||typeof t=="string"))return typeof t=="object"?Object.fromEntries(Object.entries(t).map(([s,a])=>typeof a=="function"?[s,a({theme:i})]:[s,a])):t}const xr=/^&.Mui-([\w-]+)$/;function oi(i){let t=i;if(!i||typeof i!="object")return t;for(const s of Object.keys(i)){const a=i[s];if(!(!a||typeof a!="object"))for(const h of Object.keys(a)){const w=h,k=w.match(xr);if(k){const[,F]=k,{[w]:se,...be}=a;se&&(t={...t,[s]:be,[F]:se})}}}return t}function Rs(i,t={}){const s={},a={};for(const h of Object.keys(t)){const w=t[h];w&&("styleOverrides"in w&&(h==="MuiCssBaseline"?s[h]=Dn(i,w.styleOverrides):s[h]=oi(Un(i,w.styleOverrides))),"defaultProps"in w&&(a[h]=w.defaultProps))}return{overrides:s,props:a}}var Is=n(47591);const Br={MuiCssBaseline:{styleOverrides:i=>({html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,overscrollBehaviorY:"none",fontSize:"0.875rem",lineHeight:1.43},a:{color:"inherit",textDecoration:"none"}})},MuiGrid:{defaultProps:{spacing:2}},MuiSwitch:{defaultProps:{color:"primary"}},MuiTableRow:{styleOverrides:{root:({theme:i})=>({"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}}),hover:{"&:hover":{cursor:"pointer"}},head:({theme:i})=>({"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}})}},MuiTableCell:{styleOverrides:{root:({theme:i})=>({wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0}),sizeSmall:({theme:i})=>({padding:i.spacing(1.5,2,1.5,2.5)}),head:({theme:i})=>({wordBreak:"break-word",overflow:"hidden",color:i.palette.textSubtle,fontWeight:"normal",lineHeight:"1"})}},MuiTabs:{styleOverrides:{root:{minHeight:24}}},MuiTab:{styleOverrides:{root:({theme:i})=>({color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,Is._j)(i.palette.link,.3),background:(0,Is.$n)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}}),textColorPrimary:({theme:i})=>({color:i.palette.link})}},MuiTableSortLabel:{styleOverrides:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"},"&.Mui-active":{fontWeight:"bold",color:"inherit"}}}},MuiListItemText:{styleOverrides:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}},MuiButton:{styleOverrides:{text:{padding:void 0}}},MuiChip:{styleOverrides:{root:({theme:i})=>({backgroundColor:"#D9D9D9",marginRight:i.spacing(1),marginBottom:i.spacing(1),color:i.palette.grey[900]}),outlined:({theme:i})=>({color:i.palette.text.primary}),label:({theme:i})=>({lineHeight:i.spacing(2.5),fontWeight:i.typography.fontWeightMedium,fontSize:i.spacing(1.75)}),labelSmall:({theme:i})=>({fontSize:i.spacing(1.5)}),deleteIcon:({theme:i})=>({color:i.palette.grey[500],width:i.spacing(3),height:i.spacing(3),margin:`0 ${i.spacing(.75)} 0 -${i.spacing(.75)}`}),deleteIconSmall:({theme:i})=>({width:i.spacing(2),height:i.spacing(2),margin:`0 ${i.spacing(.5)} 0 -${i.spacing(.5)}`})}},MuiCard:{styleOverrides:{root:{display:"flex",flexDirection:"column"}}},MuiCardHeader:{styleOverrides:{root:{paddingBottom:0}}},MuiCardContent:{styleOverrides:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}}},MuiCardActions:{styleOverrides:{root:{justifyContent:"flex-end"}}}},ur={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")`},hr={darkGrey:["#171717","#383838"],marineBlue:["#006D8F","#0049A1"],veryBlue:["#0027AF","#270094"],rubyRed:["#98002B","#8D1134"],toastyOrange:["#BE2200","#A41D00"],purpleSky:["#8912CA","#3E00EA"],eveningSea:["#00FFF2","#035355"],teal:["#005B4B"],pinkSea:["#C8077A","#C2297D"],greens:["#4BB8A5","#187656"]};function tr(i){const{colors:t,shape:s,options:a}=i,w=`linear-gradient(90deg, ${(t.length===1?[t[0],t[0]]:t).join(", ")})`,k=`${s}, ${w}`;var F;const se=(F=a==null?void 0:a.fontColor)!==null&&F!==void 0?F:"#FFFFFF";return{colors:t,shape:s,backgroundImage:k,fontColor:se}}const Kr={home:tr({colors:hr.teal,shape:ur.wave}),documentation:tr({colors:hr.pinkSea,shape:ur.wave2}),tool:tr({colors:hr.purpleSky,shape:ur.round}),service:tr({colors:hr.marineBlue,shape:ur.wave}),website:tr({colors:hr.veryBlue,shape:ur.wave}),library:tr({colors:hr.rubyRed,shape:ur.wave}),other:tr({colors:hr.darkGrey,shape:ur.wave}),app:tr({colors:hr.toastyOrange,shape:ur.wave}),apis:tr({colors:hr.teal,shape:ur.wave2}),card:tr({colors:hr.greens,shape:ur.wave})},si=16,Ps='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif',ii="home";function Jo(i){const{palette:t,htmlFontSize:s=si,fontFamily:a=Ps,defaultPageTheme:h=ii,pageTheme:w=Kr}=i;if(!w[h])throw new Error(`${h} is not defined in pageTheme.`);var k;return{palette:t,typography:{htmlFontSize:s,fontFamily:a,h1:{fontSize:54,fontWeight:700,marginBottom:10},h2:{fontSize:40,fontWeight:700,marginBottom:8},h3:{fontSize:32,fontWeight:700,marginBottom:6},h4:{fontWeight:700,fontSize:28,marginBottom:6},h5:{fontWeight:700,fontSize:24,marginBottom:4},h6:{fontWeight:700,fontSize:20,marginBottom:2}},page:w[h],getPageTheme:({themeId:F})=>(k=w[F])!==null&&k!==void 0?k:w[h]}}var Yr=new WeakMap;class Ls{getTheme(t){return(0,Kn._)(this,Yr).get(t)}constructor(t,s){(0,Rr._)(this,Yr,{writable:!0,value:new Map}),(0,S._)(this,Yr,new Map),t&&(0,Kn._)(this,Yr).set("v4",t),s&&(0,Kn._)(this,Yr).set("v5",s)}}function ai(i){const t=Jo(i),s={...Br,...i.components},a=(0,Gr.Z)({...t,components:s}),h=Rs(a,s),w={...(0,dr.Z)(t),...h};return new Ls(w,a)}function ia(i){const t=adaptV4Theme(i),s=createTheme(i);return new Ls(s,t)}const co={light:{type:"light",mode:"light",background:{default:"#F8F8F8",paper:"#FFFFFF"},status:{ok:"#1DB954",warning:"#FF9800",error:"#E22134",running:"#1F5493",pending:"#FFED51",aborted:"#757575"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#1F5493"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#000000",textVerySubtle:"#DDD",textSubtle:"#6E6E6E",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#2196F3",link:"#0A6EBE",gold:"#FFD600",navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},dark:{type:"dark",mode:"dark",background:{default:"#333333",paper:"#424242"},status:{ok:"#71CF88",warning:"#FFB84D",error:"#F84C55",running:"#3488E3",pending:"#FEF071",aborted:"#9E9E9E"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#9CC9FF",dark:"#82BAFD"},secondary:{main:"#FF88B2"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#FFFFFF",textVerySubtle:"#727272",textSubtle:"#CCCCCC",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#82BAFD",link:"#9CC9FF",gold:"#FFD600",navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}}},Os={light:ai({palette:co.light}),dark:ai({palette:co.dark})};var nr=n(68542);nr.Z.configure(i=>`v5-${i}`);var aa=n(12536),la=n(19219),ca=n(41547),da=n(3493),ua=n(76919),ha=n(91994);const pa=(0,aa.Z)({productionPrefix:"jss4-"});function li(i){const{children:t,theme:s,noCssBaseline:a=!1}=i,h=s.getTheme("v4"),w=s.getTheme("v5");let k;a||(k=(0,p.jsx)(ha.ZP,{}));let F=(0,p.jsxs)(p.Fragment,{children:[k,t]});return h&&(F=(0,p.jsx)(la.ZP,{generateClassName:pa,children:(0,p.jsx)(ca.Z,{theme:h,children:F})})),w&&(F=(0,p.jsx)(da.Z,{injectFirst:!0,children:(0,p.jsx)(ua.Z,{theme:w,children:F})})),F}function Co(i){var t,s;return{props:{MuiGrid:Br==null||(t=Br.MuiGrid)===null||t===void 0?void 0:t.defaultProps,MuiSwitch:Br==null||(s=Br.MuiSwitch)===null||s===void 0?void 0:s.defaultProps},...Jo(i)}}function fa(i){return Rs(i,Br).overrides}function ci(i){const t=Co(i),s=(0,dr.Z)(t),a=fa(s);return{...s,overrides:a}}const ga=ci({palette:co.light}),ma=ci({palette:co.dark});var Qo=n(98192),di=n(15222);const ui=[{id:"light",title:"Light Theme",variant:"light",icon:(0,p.jsx)(di.Z,{}),Provider:({children:i})=>(0,p.jsx)(li,{theme:Os.light,children:i})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,p.jsx)(Qo.Z,{}),Provider:({children:i})=>(0,p.jsx)(li,{theme:Os.dark,children:i})}];function hi(i){var t,s,a,h;return No({...i,apis:(t=i==null?void 0:i.apis)!==null&&t!==void 0?t:[],bindRoutes:i==null?void 0:i.bindRoutes,components:{...B,...i==null?void 0:i.components},configLoader:i==null?void 0:i.configLoader,defaultApis:As,icons:{...Pr,...i==null?void 0:i.icons},plugins:(s=i==null?void 0:i.plugins)!==null&&s!==void 0?s:[],featureFlags:(a=i==null?void 0:i.featureFlags)!==null&&a!==void 0?a:[],themes:(h=i==null?void 0:i.themes)!==null&&h!==void 0?h:ui})}var Jr=n(25271),rr=n(76635);async function Xo({storageApi:i}){const t=i.forBucket("settings"),s=i.forBucket("starredEntities"),a=t.snapshot("starredEntities").value;if(!(0,rr.isArray)(a))return;var h;const w=new Set((h=s.snapshot("entityRefs").value)!==null&&h!==void 0?h:[]);a.filter(rr.isString).map(k=>k.split(":")).filter(k=>k.length===4&&k[0]==="entity").map(([k,F,se,be])=>(0,Jr.eE)({kind:F,namespace:se,name:be})).forEach(k=>w.add(k)),await s.set("entityRefs",Array.from(w)),await t.remove("starredEntities")}class wo{async toggleStarred(t){this.starredEntities.has(t)?this.starredEntities.delete(t):this.starredEntities.add(t),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const t of this.subscribers)t.next(new Set(this.starredEntities))}constructor(t){(0,N._)(this,"settingsStore",void 0),(0,N._)(this,"starredEntities",void 0),(0,N._)(this,"subscribers",new Set),(0,N._)(this,"observable",new(Ce())(a=>(a.next(new Set(this.starredEntities)),this.subscribers.add(a),()=>{this.subscribers.delete(a)}))),Xo(t).then(),this.settingsStore=t.storageApi.forBucket("starredEntities");var s;this.starredEntities=new Set((s=this.settingsStore.snapshot("entityRefs").value)!==null&&s!==void 0?s:[]),this.settingsStore.observe$("entityRefs").subscribe({next:a=>{var h;this.starredEntities=new Set((h=a.value)!==null&&h!==void 0?h:[]),this.notifyChanges()}})}}var pi=n(8799),$r=n(79692),br=n(12420),Mn=n(39709),fi=n(19928);function va(){const i=useApi(catalogApiRef),{error:t,loading:s,value:a}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(w=>{var k;return((k=w.facets.kind)===null||k===void 0?void 0:k.map(F=>F.value).sort())||[]}),[i]);return{loading:s,error:t,allKinds:a!=null?a:[]}}function Ma(i,t,s){let a=i;return t&&(a=a.filter(w=>t.some(k=>k.toLocaleLowerCase("en-US")===w.toLocaleLowerCase("en-US")))),s&&!i.some(w=>w.toLocaleLowerCase("en-US")===s.toLocaleLowerCase("en-US"))&&(a=a.concat([s])),a.sort().reduce((w,k)=>(w[k.toLocaleLowerCase("en-US")]=k,w),{})}const pr=(0,$r.Z)(i=>(0,br.Z)({root:{...i.typography.h4}}));function gi(i){var t;const{initialFilter:s="component",allowedKinds:a}=i,h=pr(),{allKinds:w}=useAllKinds(),{filters:k,updateFilters:F,queryParameters:{kind:se}}=useEntityList(),be=useMemo(()=>[se].flat()[0],[se]);var Re;const[ze,mt]=useState((Re=be!=null?be:(t=k.kind)===null||t===void 0?void 0:t.value)!==null&&Re!==void 0?Re:s);useEffect(()=>{be&&mt(be)},[be]),useEffect(()=>{var Et;if(!((Et=k.kind)===null||Et===void 0)&&Et.value){var Wt;mt((Wt=k.kind)===null||Wt===void 0?void 0:Wt.value)}},[k.kind]),useEffect(()=>{F({kind:ze?new EntityKindFilter(ze):void 0})},[ze,F]);const St=filterKinds(w,a,ze);return _jsx(Select,{input:_jsx(InputBase,{}),value:ze.toLocaleLowerCase("en-US"),onChange:Et=>mt(Et.target.value),classes:h,children:Object.keys(St).map(Et=>_jsx(MenuItem,{value:Et,children:`${pluralize(St[Et])}`},Et))})}var ya=n(86359),qo=n(95544),mi=n(99688),jo=n(12231),Dr=n(86136),uo=n(49378),ks=n(85256),_o=n(80030),es=n(61837),ts=n(79784),vi=n(50758),Bs=n(31654),$s=n(43054),Ds=n(65759),xa=n(49280),Eo=n(96641);function yi(i){const{entity:t,loading:s,error:a}=(0,Eo.ce)(),{allowed:h,loading:w,error:k}=bo({permission:i,resourceRef:t?(0,Jr.eE)(t):void 0});return s||w?{loading:!0,allowed:!1}:a?{loading:!1,allowed:!1,error:a}:{loading:!1,allowed:h,error:k}}const ns="catalog-entity",Fs=cr({name:"catalog.entity.read",attributes:{action:"read"},resourceType:ns}),Ns=cr({name:"catalog.entity.create",attributes:{action:"create"}}),Zs=cr({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:ns}),xi=cr({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:ns}),bi=cr({name:"catalog.location.read",attributes:{action:"read"}}),Us=cr({name:"catalog.location.create",attributes:{action:"create"}}),Si=cr({name:"catalog.location.delete",attributes:{action:"delete"}}),rs=[Fs,Ns,Zs,xi,bi,Us,Si];var Ms=n(49166);function Ci(i){const{unregisterEntityOptions:t,isUnregisterAllowed:s,onUnregisterEntity:a,onClose:h}=i,w=typeof(t==null?void 0:t.disableUnregister)=="boolean";var k;const F=(k=!s||(w?!!(t!=null&&t.disableUnregister):(t==null?void 0:t.disableUnregister)==="disable"))!==null&&k!==void 0?k:!1;let se=(0,p.jsx)(p.Fragment,{});return(t==null?void 0:t.disableUnregister)!=="hidden"&&(se=(0,p.jsxs)(jo.Z,{onClick:()=>{h(),a()},disabled:F,children:[(0,p.jsx)(Dr.Z,{children:(0,p.jsx)(Ms.Z,{fontSize:"small"})}),(0,p.jsx)(uo.Z,{primary:"Unregister entity"})]})),(0,p.jsx)(p.Fragment,{children:se})}const zs=(0,$r.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function wi(i){const{UNSTABLE_extraContextMenuItems:t,UNSTABLE_contextMenuOptions:s,onUnregisterEntity:a,onInspectEntity:h}=i,[w,k]=(0,W.useState)(),F=zs(),be=yi(Zs).allowed,Re=Wt=>{k(Wt.currentTarget)},ze=()=>{k(void 0)},mt=(0,g.h_)(g.$v),St=(0,W.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>mt.post({message:"Copied!",severity:"info",display:"transient"}))},[mt]),Et=t&&[...t.map(Wt=>(0,p.jsxs)(jo.Z,{onClick:()=>{ze(),Wt.onClick()},children:[(0,p.jsx)(Dr.Z,{children:(0,p.jsx)(Wt.Icon,{fontSize:"small"})}),(0,p.jsx)(uo.Z,{primary:Wt.title})]},Wt.title)),(0,p.jsx)(ks.Z,{},"the divider is here!")];return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(_o.ZP,{title:"More",arrow:!0,children:(0,p.jsx)(es.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!w,role:"button",onClick:Re,"data-testid":"menu-button",className:F.button,id:"long-menu",children:(0,p.jsx)($s.Z,{})})}),(0,p.jsx)(ts.ZP,{open:Boolean(w),onClose:ze,anchorEl:w,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,p.jsxs)(vi.Z,{autoFocusItem:Boolean(w),children:[Et,(0,p.jsx)(Ci,{unregisterEntityOptions:s,isUnregisterAllowed:be,onUnregisterEntity:a,onClose:ze}),(0,p.jsxs)(jo.Z,{onClick:()=>{ze(),h()},children:[(0,p.jsx)(Dr.Z,{children:(0,p.jsx)(Bs.Z,{fontSize:"small"})}),(0,p.jsx)(uo.Z,{primary:"Inspect entity"})]}),(0,p.jsxs)(jo.Z,{onClick:()=>{ze(),St()},children:[(0,p.jsx)(Dr.Z,{children:(0,p.jsx)(Ds.Z,{fontSize:"small"})}),(0,p.jsx)(uo.Z,{primary:"Copy entity URL"})]})]})})]})}const os="plugin.catalog.entityLayoutRoute",Ao=()=>null;(0,g.R5)(Ao,os,!0),(0,g.R5)(Ao,"core.gatherMountPoints",!0);function Jn(i){const{entity:t,title:s}=i;return(0,p.jsxs)(qo.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,p.jsx)(qo.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:s}),t&&(0,p.jsx)(Mn.LH,{entity:t})]})}function ji(i,t,s,a){var h;const w=(h=i!=null?i:a==null?void 0:a.kind)!==null&&h!==void 0?h:"";var k;const F=(k=t!=null?t:a==null?void 0:a.metadata.namespace)!==null&&k!==void 0?k:"";var se,be,Re;return{headerTitle:`${(Re=(be=(se=a==null?void 0:a.metadata.title)!==null&&se!==void 0?se:s)!==null&&be!==void 0?be:a==null?void 0:a.metadata.name)!==null&&Re!==void 0?Re:""}${F&&F!==Jr.zG?` in ${F}`:""}`,headerType:(()=>{let mt=w.toLocaleLowerCase("en-US");return a&&a.spec&&"type"in a.spec&&(mt+=" \u2014 ",mt+=a.spec.type.toLocaleLowerCase("en-US")),mt})()}}function Ei(i){var t;const{entity:s}=i,a=(0,Mn.hF)(s,Jr.S4);return(0,p.jsxs)(p.Fragment,{children:[a.length>0&&(0,p.jsx)(ln.i9,{label:"Owner",value:(0,p.jsx)(Mn.rI,{entityRefs:a,defaultKind:"Group",color:"inherit"})}),((t=s.spec)===null||t===void 0?void 0:t.lifecycle)&&(0,p.jsx)(ln.i9,{label:"Lifecycle",value:s.spec.lifecycle})]})}const Ai=i=>{var t,s;const{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:h,children:w,NotFoundComponent:k}=i,{kind:F,namespace:se,name:be}=(0,g.Oi)(Mn.wi),{entity:Re,loading:ze,error:mt}=(0,Mn.ce)(),St=(0,z.TH)(),Et=(0,g.vJ)(w,_i=>_i.selectByComponentData({key:os,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Qr})=>{if(Re){if(Qr.if&&!Qr.if(Re))return[]}else return[];return[{path:Qr.path,title:Qr.title,children:Qr.children,tabProps:Qr.tabProps}]}),[Re]),{headerTitle:Wt,headerType:Ht}=ji(F,se,be,Re),[Wn,Sr]=(0,W.useState)(!1),[Cr,Ro]=(0,W.useState)(!1),Xi=(0,z.s0)(),qi=async()=>{Sr(!1),Ro(!1),Xi("/")};(0,W.useEffect)(()=>{Sr(!1),Ro(!1)},[St.pathname]);var ps;return(0,p.jsxs)(ln.T3,{themeId:(ps=Re==null||(t=Re.spec)===null||t===void 0||(s=t.type)===null||s===void 0?void 0:s.toString())!==null&&ps!==void 0?ps:"home",children:[(0,p.jsx)(ln.h4,{title:(0,p.jsx)(Jn,{title:Wt,entity:Re}),pageTitleOverride:Wt,type:Ht,children:Re&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Ei,{entity:Re}),(0,p.jsx)(wi,{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:h,onUnregisterEntity:()=>Sr(!0),onInspectEntity:()=>Ro(!0)})]})}),ze&&(0,p.jsx)(ln.Ex,{}),Re&&(0,p.jsx)(ln.tn,{routes:Et}),mt&&(0,p.jsx)(ln.VY,{children:(0,p.jsx)(mi.Z,{severity:"error",children:mt.toString()})}),!ze&&!mt&&!Re&&(0,p.jsx)(ln.VY,{children:k||(0,p.jsxs)(ln.GB,{title:"Entity not found",children:["There is no ",F," with the requested"," ",(0,p.jsx)(ln.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,p.jsx)(Mn.pp,{open:Wn,entity:Re,onConfirm:qi,onClose:()=>Sr(!1)}),(0,p.jsx)(Mn.U_,{open:Cr,entity:Re,onClose:()=>Ro(!1)})]})};Ai.Route=Ao;function Ti(i){const{open:t,onClose:s,onConfirm:a,entity:h}=i,[w,k]=useState(!1),F=useApi(catalogApiRef),se=useApi(alertApiRef),be=async()=>{k(!0);try{const Re=h.metadata.uid;await F.removeEntityByUid(Re),a()}catch(Re){assertError(Re),se.post({message:Re.message})}finally{k(!1)}};return _jsxs(Dialog,{open:t,onClose:s,children:[_jsx(DialogTitle,{id:"responsive-dialog-title",children:"Are you sure you want to delete this entity?"}),_jsxs(DialogActions,{children:[_jsx(Button,{variant:"contained",color:"secondary",disabled:w,onClick:be,children:"Delete"}),_jsx(Button,{onClick:s,color:"primary",children:"Cancel"})]})]})}var ho=n(19625);function za(i){var t,s;return(i==null||(t=i.metadata)===null||t===void 0||(s=t.annotations)===null||s===void 0?void 0:s["backstage.io/orphan"])==="true"}function Ws(){const i=useNavigate(),t=useRouteRef(rootRouteRef),[s,a]=useState(!1),{entity:h}=useEntity(),w=async()=>{a(!1),i(t())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>a(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:s,entity:h,onConfirm:w,onClose:()=>a(!1)})]})}var Ri=n(4791);const Ii=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function Vs(i,t){return{items:(await t.getEntityAncestors({entityRef:i})).items.map(h=>{var w,k;return{errors:((k=(w=h.entity.status)===null||w===void 0?void 0:w.items)!==null&&k!==void 0?k:[]).filter(Ii).map(be=>be.error).filter(be=>Boolean(be)),entity:h.entity}}).filter(h=>h.errors.length>0)}}async function ss(i,t){const s=t.apis.get(catalogApiRef);if(!s)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Vs(stringifyEntityRef(i),s)).items.length>0}function ba(){const{entity:i}=useEntity(),t=stringifyEntityRef(i),s=useApi(catalogApiRef),{loading:a,error:h,value:w}=useAsync(async()=>Vs(t,s),[t,s]);return h?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:h})}):a||!w?null:_jsx(_Fragment,{children:w.items.map((k,F)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(k.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:k.entity})]}),k.errors.map((se,be)=>_jsx(ResponseErrorPanel,{error:se},be))]},F))})}const Hs="core.backstage.entitySwitch",is=i=>null;(0,g.R5)(is,Hs,!0);const Pi=i=>{var t;const{entity:s,loading:a}=(0,Mn.ce)(),h=(0,g.I_)(),w=(0,g.vJ)(i.children,se=>se.selectByComponentData({key:Hs,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(be=>{if(a)return[];const{if:Re,children:ze}=be.props;return s?[{if:Re==null?void 0:Re(s,{apis:h}),children:ze}]:[{if:Re===void 0,children:ze}]}),[h,s,a]);if(w.some(se=>typeof se.if=="object"&&"then"in se.if))return(0,p.jsx)(Sa,{results:w,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const se=w.filter(be=>be.if).map(be=>be.children);return se.length===0?as(w):(0,p.jsx)(p.Fragment,{children:se})}var F;return(F=(t=w.find(se=>se.if))===null||t===void 0?void 0:t.children)!==null&&F!==void 0?F:as(w)};function Sa({results:i,renderMultipleMatches:t}){const{loading:s,value:a}=(0,c.default)(async()=>{const h=i.map(async({if:k,children:F})=>{try{if(await k)return F}catch{}return null});if(t==="all"){const k=(await Promise.all(h)).filter(Boolean);return k.length===0?as(i):(0,p.jsx)(p.Fragment,{children:k})}var w;return(w=(await Promise.all(h)).find(Boolean))!==null&&w!==void 0?w:as(i)},[i]);return s||!a?null:a}function as(i){var t,s;return(s=(t=i.filter(a=>a.if===void 0)[0])===null||t===void 0?void 0:t.children)!==null&&s!==void 0?s:null}Pi.Case=is;const Ca=null,Wa=Mn._i.Filters,Va=Mn._i.Content;var Gs=n(85877),ls=n(15096);const zn=(0,g.rx)({id:"catalog",apis:[(0,g.ni)({api:Mn.Ah,deps:{discoveryApi:g.NW,fetchApi:g.gP},factory:({discoveryApi:i,fetchApi:t})=>new Ri.MS({discoveryApi:i,fetchApi:t})}),(0,g.ni)({api:Mn.p3,deps:{storageApi:g.E6},factory:({storageApi:i})=>new wo({storageApi:i})})],routes:{catalogIndex:ho._Z,catalogEntity:Mn.wi},externalRoutes:{createComponent:ho.yw,viewTechDoc:ho.jU,createFromTemplate:ho.ql},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),cs=zn.provide((0,g.P4)({name:"CatalogIndexPage",component:()=>n.e(9323).then(n.bind(n,89323)).then(i=>i.CatalogPage),mountPoint:ho._Z})),Li=zn.provide((0,g.P4)({name:"CatalogEntityPage",component:()=>n.e(8951).then(n.bind(n,78951)).then(i=>i.CatalogEntityPage),mountPoint:Mn.wi})),Ks=zn.provide((0,g.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,8799)).then(i=>i.AboutCard)}})),wa=zn.provide((0,g.CO)({name:"EntityLinksCard",component:{lazy:()=>n.e(7750).then(n.bind(n,17750)).then(i=>i.EntityLinksCard)}})),ja=zn.provide((0,g.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,85877)).then(i=>i.EntityLabelsCard)}})),Oi=zn.provide((0,g.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>n.e(5458).then(n.bind(n,5458)).then(i=>i.HasSystemsCard)}})),Ea=zn.provide((0,g.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>n.e(1105).then(n.bind(n,1105)).then(i=>i.HasComponentsCard)}})),ki=zn.provide((0,g.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>n.e(2440).then(n.bind(n,82440)).then(i=>i.HasSubcomponentsCard)}})),Ha=zn.provide((0,g.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>n.e(9770).then(n.bind(n,79770)).then(i=>i.HasResourcesCard)}})),Ga=zn.provide((0,g.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>n.e(9545).then(n.bind(n,19545)).then(i=>i.DependsOnComponentsCard)}})),Ka=zn.provide((0,g.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>n.e(184).then(n.bind(n,40184)).then(i=>i.DependencyOfComponentsCard)}})),Aa=zn.provide((0,g.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>n.e(1032).then(n.bind(n,81032)).then(i=>i.DependsOnResourcesCard)}})),Ta=zn.provide((0,g.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>n.e(732).then(n.bind(n,732)).then(i=>i.RelatedEntitiesCard)}})),Ya=zn.provide((0,ls.E5)({name:"CatalogSearchResultListItem",component:()=>n.e(7670).then(n.bind(n,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var Bi=n(32838);class $i{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(t,s){const h=`${await this.getApiOrigin()}/${s}`,w=await fetch(`${h.endsWith("/")?h:`${h}/`}index.html`);if(w.status===404)throw new Error("Page not found");return w.text()}async syncEntityDocs(t){return"cached"}async getBaseUrl(t,s,a){const h=await this.getApiOrigin();return new URL(t,`${h}/${a}`).toString()}constructor({configApi:t,discoveryApi:s,identityApi:a}){(0,N._)(this,"configApi",void 0),(0,N._)(this,"discoveryApi",void 0),(0,N._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=s,this.identityApi=a}}class Di{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(t){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(t){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:t,discoveryApi:s,identityApi:a}){(0,N._)(this,"configApi",void 0),(0,N._)(this,"discoveryApi",void 0),(0,N._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=s,this.identityApi=a}}const Ys=[(0,g.ni)({api:G.Dl,deps:{configApi:g.Ds,discoveryApi:g.NW,identityApi:g.$4},factory:({configApi:i,discoveryApi:t,identityApi:s})=>new $i({configApi:i,discoveryApi:t,identityApi:s})}),(0,g.ni)({api:G.gT,deps:{configApi:g.Ds,discoveryApi:g.NW,identityApi:g.$4},factory:({configApi:i,discoveryApi:t,identityApi:s})=>new Di({configApi:i,discoveryApi:t,identityApi:s})}),(0,g.ni)({api:Bi.q3,deps:{configApi:g.Ds},factory:({configApi:i})=>Bi.ae.fromConfig(i)})],Fi={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},Ni={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function Ra(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function Zi(){const i=await kr(),t=await Ra();return[...i,{context:"detected",data:t?Fi:Ni}]}var Js=n(58845);const Ui=(0,$r.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var Mi=()=>{const i=Ui();return(0,p.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,p.jsx)("path",{className:i.path,d:"M302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Zm241-88.84q7.94,0,17.09.17t18.12,1a139.3,139.3,0,0,1,16.74,2.57,42.78,42.78,0,0,1,13.3,5.14,64.27,64.27,0,0,1,20.54,19.89Q662,168,662,186.54q0,19.54-9.49,33.78t-27.1,21.09v.68q22.78,4.82,34.87,20.58t12.08,38.4a72.62,72.62,0,0,1-4.83,26.06,65.29,65.29,0,0,1-14.33,22.46,71.57,71.57,0,0,1-23.47,15.78q-14,6-32.28,6H478.38V126.54Zm9,105.27q28,0,40.21-9.78t12.26-29.31q0-13-4.14-20.58a29.47,29.47,0,0,0-11.4-11.66A45,45,0,0,0,597,155.17a161.2,161.2,0,0,0-20.19-1.2h-65.6v77.84Zm16.57,112.13q21.74,0,34-11.66T639.59,300q0-12-4.48-19.88a34.85,34.85,0,0,0-11.91-12.52,50.14,50.14,0,0,0-17.09-6.52,105,105,0,0,0-20-1.88H511.17v84.7Zm274.79,26.74q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58A41.19,41.19,0,0,1,705,348.56q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.08-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7T736.6,249.29H707.26q.69-16.46,6.9-27.77a52.21,52.21,0,0,1,16.57-18.35,70,70,0,0,1,23.65-10.11A125.51,125.51,0,0,1,782.86,190a168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7A41.23,41.23,0,0,1,844,213.59q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-18,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.5,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14ZM1002.07,225q-11.05-9.25-29.69-9.26-15.89,0-26.58,5.83A47.29,47.29,0,0,0,928.71,237a64.66,64.66,0,0,0-9.15,22.12A119.83,119.83,0,0,0,916.8,285a98.22,98.22,0,0,0,2.93,24,64.18,64.18,0,0,0,9.15,20.74,46.2,46.2,0,0,0,16.23,14.58q10,5.49,23.82,5.48,21.75,0,34-11.31t15-31.89h30q-4.83,32.91-24.68,50.75t-54,17.83q-20.37,0-36.07-6.52A69.86,69.86,0,0,1,907,350.11a79.92,79.92,0,0,1-15.88-28.63A118.64,118.64,0,0,1,885.73,285a129.41,129.41,0,0,1,5.18-37.21,85.63,85.63,0,0,1,15.71-30.17A73.46,73.46,0,0,1,933,197.35Q948.91,190,970,190a108.54,108.54,0,0,1,28.48,3.6,69.59,69.59,0,0,1,23.48,11.15,61,61,0,0,1,16.74,19q6.55,11.49,8.29,27.26h-30.38Q1013.11,234.21,1002.07,225Zm109.77-98.41v145l81.47-77.49h39.36l-70.77,64.46,75.95,112.82h-37.29l-61.1-92.59-27.62,25.38v67.21H1082.5V126.54Zm170.54,205.22a31.07,31.07,0,0,0,10.87,10.63,49,49,0,0,0,15.19,5.66,87.06,87.06,0,0,0,17.44,1.71,109.18,109.18,0,0,0,14.5-1,53.22,53.22,0,0,0,14-3.78,26.27,26.27,0,0,0,10.53-8q4.14-5.32,4.14-13.55,0-11.31-8.63-17.14a73.69,73.69,0,0,0-21.58-9.43q-12.94-3.6-28.13-6.52a146,146,0,0,1-28.14-8.23A58.16,58.16,0,0,1,1261,267.13q-8.64-9.6-8.63-26.75,0-13.38,6-23a49.26,49.26,0,0,1,15.53-15.61,71.76,71.76,0,0,1,21.4-8.91A99.41,99.41,0,0,1,1319,190a141.31,141.31,0,0,1,28,2.58,64.85,64.85,0,0,1,22.62,8.91,46.16,46.16,0,0,1,15.7,17.15q5.87,10.8,6.91,26.91h-29.35q-.69-8.57-4.48-14.23a29.36,29.36,0,0,0-9.67-9.08,44.16,44.16,0,0,0-12.94-5,67.68,67.68,0,0,0-14.33-1.54,87.29,87.29,0,0,0-13.29,1,45.28,45.28,0,0,0-12.26,3.6,24.49,24.49,0,0,0-9,6.86q-3.46,4.29-3.46,11.14a16.32,16.32,0,0,0,5.36,12.52,42.75,42.75,0,0,0,13.63,8.23,120,120,0,0,0,18.64,5.48q10.37,2.24,20.72,4.63,11,2.4,21.57,5.83A70.74,70.74,0,0,1,1382,284.1a44.55,44.55,0,0,1,13.12,14.23q5,8.58,5,21.26,0,16.13-6.73,26.75a52.5,52.5,0,0,1-17.61,17.14,73.89,73.89,0,0,1-24.51,9.09,146.3,146.3,0,0,1-27.1,2.57,126.24,126.24,0,0,1-28.31-3.09A69.56,69.56,0,0,1,1272,361.94a51.74,51.74,0,0,1-16.57-18.52q-6.21-11.49-6.9-27.95h29.34A32.65,32.65,0,0,0,1282.38,331.76Zm226.46-137.67v25.72h-35.56V329.88a31.37,31.37,0,0,0,.87,8.23,8.42,8.42,0,0,0,3.28,4.8,14.61,14.61,0,0,0,6.73,2.23,99.19,99.19,0,0,0,11.22.51h13.46v25.72H1486.4a105.8,105.8,0,0,1-19.5-1.55,28.65,28.65,0,0,1-13.12-5.65,24.09,24.09,0,0,1-7.42-11.66q-2.43-7.54-2.42-19.89V219.81h-30.38V194.09h30.38V140.94h29.34v53.15ZM1699.4,370.68q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58,41.19,41.19,0,0,1-12.6-15.26q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.07-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7t-13.46,26.57h-29.34q.67-16.46,6.9-27.77A52.21,52.21,0,0,1,1562,203.17a70,70,0,0,1,23.65-10.11,125.51,125.51,0,0,1,28.48-3.09,168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7,41.23,41.23,0,0,1,15.53,14.89q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-17.95,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.51,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14Zm208.85,141.62q-20,21.6-62.83,21.6a122.11,122.11,0,0,1-25.37-2.74,78,78,0,0,1-23.48-8.92,54.41,54.41,0,0,1-17.43-16.11q-6.91-10-7.6-24.35h29.35a21.47,21.47,0,0,0,5,13.38,36.67,36.67,0,0,0,11.4,8.91,55.52,55.52,0,0,0,14.67,5,79.51,79.51,0,0,0,15.19,1.55q14.49,0,24.51-5A46,46,0,0,0,1840.59,401a56.53,56.53,0,0,0,9.49-21.09,117.46,117.46,0,0,0,2.94-27.09V341.19h-.7q-7.59,16.46-23,24.18a71.8,71.8,0,0,1-32.63,7.71q-20,0-34.86-7.2A72.88,72.88,0,0,1,1737,346.51a82.13,82.13,0,0,1-15-28.46,116.62,116.62,0,0,1-5-34.47,133.92,133.92,0,0,1,4.14-32.4A88.17,88.17,0,0,1,1735,221a75.49,75.49,0,0,1,25.55-22.29q15.87-8.75,39-8.75a66.21,66.21,0,0,1,31.07,7.38,52.13,52.13,0,0,1,22.09,22.11h.35V194.09h27.61V356.28Q1880.63,399.83,1860.61,421.43Zm-37.46-79.72a47.94,47.94,0,0,0,16.4-15.78,71.89,71.89,0,0,0,9.15-22.11,106.77,106.77,0,0,0,2.93-24.69,96.71,96.71,0,0,0-2.76-23,64,64,0,0,0-8.8-20.4,45.76,45.76,0,0,0-15.71-14.57q-9.66-5.49-23.47-5.49-14.16,0-24.17,5.32a46.77,46.77,0,0,0-16.4,14.23,60.14,60.14,0,0,0-9.32,20.57,99.69,99.69,0,0,0-2.93,24.35,120.63,120.63,0,0,0,2.42,24,67.5,67.5,0,0,0,8.28,21.77,46.37,46.37,0,0,0,15.54,15.78q9.66,6,24.16,6T1823.15,341.71Zm228,18.34q-20,15.09-50.41,15.09-21.4,0-37.11-6.86a73.16,73.16,0,0,1-26.41-19.2,81.52,81.52,0,0,1-16-29.49,141.12,141.12,0,0,1-6-37.38,106.1,106.1,0,0,1,6.21-37A88.56,88.56,0,0,1,1938.8,216a79.09,79.09,0,0,1,26.58-19.2A81.66,81.66,0,0,1,1999,190q23.82,0,39.53,9.78a78,78,0,0,1,25.2,24.86,98.18,98.18,0,0,1,13.12,32.91,140.6,140.6,0,0,1,2.93,34h-133.6a70,70,0,0,0,2.76,22.12,49.9,49.9,0,0,0,10,18.51A49.1,49.1,0,0,0,1976.6,345q10.7,4.82,25.2,4.8,18.65,0,30.55-8.57t15.71-26.06h29Q2071.18,345,2051.17,360.05Zm-7.08-113.84a50,50,0,0,0-10.7-16,53.1,53.1,0,0,0-56.62-10.63,47.48,47.48,0,0,0-15.71,10.81,51.69,51.69,0,0,0-10.35,15.94,60.18,60.18,0,0,0-4.49,19.37h102.53A59.47,59.47,0,0,0,2044.09,246.21ZM302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Z"})})};const Qs=(0,$r.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Xs=()=>{const i=Qs();return(0,p.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,p.jsx)("path",{className:i.path,d:"M303,166.05a80.69,80.69,0,0,0,13.45-10.37c.79-.77,1.55-1.53,2.3-2.3a83.12,83.12,0,0,0,7.93-9.38A63.69,63.69,0,0,0,333,133.23a48.58,48.58,0,0,0,4.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56,0,78.3,115.23,0,190.25l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.22,49.22,0,0,0-6.8-8.87A89.17,89.17,0,0,0,259,178.29h.15a85.08,85.08,0,0,0,31-5.79A80.88,80.88,0,0,0,303,166.05ZM202.45,225.86c-19.32,18.51-50.4,21.23-75.7,5.9L51.61,186.15l67.45-64.64,76.41,46.38C223,184.58,221.49,207.61,202.45,225.86Zm8.93-82.22-70.65-42.89L205.14,39,274.51,81.1c25.94,15.72,29.31,37,10.55,55A60.69,60.69,0,0,1,211.38,143.64Zm29.86,190c-19.57,18.75-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,282.52v24.67L108.6,373.1a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.27,87.27,0,0,1,241.24,333.68Zm0-39c-19.57,18.75-46.17,29.08-74.88,29.08a123.81,123.81,0,0,1-64.1-18.19L0,243.53v24.68l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.5v-1.78A87.27,87.27,0,0,1,241.24,294.7Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.81,123.81,0,0,1-64.1-18.19L0,204.55v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.82A86.09,86.09,0,0,1,241.24,255.71Zm83.7,25.74a94.15,94.15,0,0,1-60.2,25.86h0V334a81.6,81.6,0,0,0,51.74-22.37c14-13.38,21.14-28.11,21-42.64v-2.19A94.92,94.92,0,0,1,324.94,281.45Zm-83.7,91.21c-19.57,18.76-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,321.5v24.68l108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A86.29,86.29,0,0,1,241.24,372.66ZM327,162.45c-.68.69-1.35,1.38-2.05,2.06a94.37,94.37,0,0,1-10.64,8.65,91.35,91.35,0,0,1-11.6,7,94.53,94.53,0,0,1-26.24,8.71,97.69,97.69,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a53.27,53.27,0,0,1,1.14,12V217h.05a84.41,84.41,0,0,0,25.35-5.55,81,81,0,0,0,26.39-16.82c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,172.17a48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08,1.54-2.25,3.09A96.73,96.73,0,0,1,327,162.45Zm0,77.92c-.69.7-1.31,1.41-2,2.1a94.2,94.2,0,0,1-60.2,25.86h0l0,26.67h0a81.6,81.6,0,0,0,51.74-22.37A73.51,73.51,0,0,0,333,250.13a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74,1.07-1.46,2.15-2.27,3.21A95.68,95.68,0,0,1,327,240.37Zm0-39c-.69.7-1.31,1.41-2,2.1a93.18,93.18,0,0,1-10.63,8.65,91.63,91.63,0,0,1-11.63,7,95.47,95.47,0,0,1-37.94,10.18h0V256h0a81.65,81.65,0,0,0,51.74-22.37c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,211.15a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.46,2.16-2.27,3.22A95.68,95.68,0,0,1,327,201.39Z"})})};const ds=(0,$r.Z)({root:{width:ln.po.drawerWidthClosed,height:3*ln.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:ln.po.drawerWidthClosed,marginLeft:24}}),_s=()=>{const i=ds(),{isOpen:t}=(0,ln.mZ)();return(0,p.jsx)("div",{className:i.root,children:(0,p.jsx)(ln.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:t?(0,p.jsx)(Mi,{}):(0,p.jsx)(Xs,{})})})},zi=({children:i})=>(0,p.jsxs)(ln.tR,{children:[(0,p.jsxs)(ln.YE,{children:[(0,p.jsx)(_s,{}),(0,p.jsx)(ln.v7,{}),(0,p.jsx)(ln.R6,{icon:Js.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var Wi=n(32388),Vi=n(4142);const To=(0,$r.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 fr;(function(i){i.LIGHT="light",i.DARK="dark"})(fr||(fr={}));const Hi=()=>{const i=(0,g.h_)(g.hg),t=To(),[s,a]=(0,W.useState)(i.getActiveThemeId()===fr.DARK?fr.DARK:fr.LIGHT),h={[fr.LIGHT]:{icon:Vi.Z,title:"Dark theme"},[fr.DARK]:{icon:Wi.Z,title:"Light theme"}},{title:w,icon:k}=h[s],F=()=>{a(se=>{const be=se===fr.LIGHT?fr.DARK:fr.LIGHT;return i.setActiveThemeId(be),be})};return(0,p.jsx)(qo.Z,{display:"flex",alignItems:"center",mr:2,children:(0,p.jsx)(_o.ZP,{title:w,arrow:!0,children:(0,p.jsx)(es.Z,{size:"small",onClick:F,children:(0,p.jsx)(k,{className:t.headerIcon})})})})},Gi=()=>(0,p.jsxs)(R.I6,{children:[(0,p.jsx)(te.S,{}),(0,p.jsx)(L.F,{withSearch:!1})]}),Ki=(0,p.jsx)(Gi,{}),us=hi({apis:Ys,configLoader:Zi,plugins:Object.values(r)}),ei=us.getProvider(),Yi=us.getRouter(),Ji=R.s4.provide((0,G.KY)({name:"ThemeToggleAddon",component:Hi,location:G.oZ.Header})),hs=(0,p.jsxs)(Zo,{children:[(0,p.jsx)(z.Fg,{to:"/docs/default/component/local/"},"/"),(0,p.jsx)(z.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,p.jsx)(Li,{})}),(0,p.jsx)(z.AW,{path:"/docs",element:(0,p.jsx)(R.Jl,{}),children:(0,p.jsx)(q.u,{})}),(0,p.jsxs)(z.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,p.jsx)(R.I6,{}),children:[Ki,(0,p.jsx)(G.DR,{children:(0,p.jsx)(Ji,{})})]})]});var Qi=()=>(0,p.jsx)(ei,{children:(0,p.jsx)(Yi,{children:(0,p.jsx)(zi,{children:hs})})});f.render((0,p.jsx)(Qi,{}),document.getElementById("root"))},51837:function(Ct,ke,n){"use strict";n.d(ke,{CT:function(){return g},EI:function(){return ge},uW:function(){return f},Vt:function(){return u}});function r(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const p=r(),W=de=>`__@backstage/${de}__`;function f(de,V){const te=W(de);let L=p[te];return L||(L=V(),p[te]=L,L)}var z=n(2784);function g(de){return f(de,()=>(0,z.createContext)(void 0))}function u(de){return(0,z.useContext)(g(de))}function D(de){return{set(V){globalThis[`__@backstage/${de}__`]=createContext(createVersionedValueMap(V))},reset(){delete globalThis[`__@backstage/${de}__`]}}}function ge(de){Object.freeze(de);const V={atVersion(te){return de[te]}};return Object.defineProperty(V,"$map",{configurable:!0,enumerable:!0,get(){return de}}),V}},96641:function(Ct,ke,n){"use strict";n.d(ke,{X2:function(){return ge},ce:function(){return de},h$:function(){return u}});var r=n(52322),p=n(25271),W=n(60871),f=n(51837),z=n(2784);const g=(0,f.CT)("entity-context"),u=V=>{const{children:te,entity:L,loading:A,error:ae,refresh:oe}=V,ie={entity:L,loading:A,error:ae,refresh:oe};return(0,r.jsx)(g.Provider,{value:(0,f.EI)({1:ie}),children:(0,r.jsx)(W.fC,{attributes:{...L?{entityRef:(0,p.eE)(L)}:void 0},children:te})})},D=V=>_jsx(u,{entity:V.entity,loading:!Boolean(V.entity),error:void 0,refresh:void 0,children:V.children});function ge(){const V=(0,f.Vt)("entity-context");if(!V)throw new Error("Entity context is not available");const te=V.atVersion(1);if(!te)throw new Error("EntityContext v1 not available");if(!te.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:te.entity}}function de(){const V=(0,f.Vt)("entity-context");if(!V)throw new Error("Entity context is not available");const te=V.atVersion(1);if(!te)throw new Error("EntityContext v1 not available");const{entity:L,loading:A,error:ae,refresh:oe}=te;return{entity:L,loading:A,error:ae,refresh:oe}}},39709:function(Ct,ke,n){"use strict";n.d(ke,{h$:function(){return et.h$},n3:function(){return r.n3},_i:function(){return H},tW:function(){return nt},df:function(){return Ke},UO:function(){return Le},ph:function(){return Yo},dq:function(){return jt},nl:function(){return Ko},dx:function(){return bt},rI:function(){return gn},u3:function(){return Kn},xE:function(){return S},sL:function(){return c},LH:function(){return Fe},U_:function(){return cr},pp:function(){return Wo},EW:function(){return bo},Ah:function(){return W},wi:function(){return Ne},hF:function(){return G.hF},CV:function(){return G.CV},$3:function(){return tn},p3:function(){return f},ce:function(){return et.ce},X2:function(){return et.X2},wp:function(){return ct},ZW:function(){return jn},eK:function(){return hn},CR:function(){return _t}});var r=n(4791),p=n(60871);const W=(0,p.T0)({id:"plugin.catalog.service"}),f=(0,p.T0)({id:"catalog-react.starred-entities"});var z=n(82394);class g{async toggleStarred(C){this.starredEntities.delete(C)||this.starredEntities.add(C);for(const E of this.subscribers)E.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){_define_property(this,"starredEntities",new Set),_define_property(this,"subscribers",new Set),_define_property(this,"observable",new ObservableImpl(C=>(C.next(new Set(this.starredEntities)),this.subscribers.add(C),()=>{this.subscribers.delete(C)})))}}var u=n(52322),D=n(2784),ge=n(41156),de=n(60364),V=n(77277),te=n(4190),L=n(95544),A=n(90436),ae=n(60905),oe=n(36444);const ie=y=>{const C=(0,ge.Z)(ne=>ne.breakpoints.down("md")),E=(0,de.Z)(),[B,Q]=(0,D.useState)(!1);return C?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(V.Z,{style:{marginTop:E.spacing(1),marginLeft:E.spacing(1)},onClick:()=>Q(!0),startIcon:(0,u.jsx)(oe.Z,{}),children:"Filters"}),(0,u.jsx)(te.ZP,{open:B,onClose:()=>Q(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,u.jsxs)(L.Z,{m:2,children:[(0,u.jsx)(A.Z,{variant:"h6",component:"h2",style:{marginBottom:E.spacing(1)},children:"Filters"}),y.children]})})]}):(0,u.jsx)(ae.Z,{item:!0,lg:2,children:y.children})},q=y=>(0,u.jsx)(ae.Z,{item:!0,xs:12,lg:10,children:y.children}),H=y=>(0,u.jsx)(ae.Z,{container:!0,style:{position:"relative"},children:y.children});H.Filters=ie,H.Content=q;var T=n(53974),R=n(87612),P=n(25271),G=n(49280);class je{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(C){(0,R._)(this,"value",void 0),this.value=C}}class Pe{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(C){(0,R._)(this,"value",void 0),this.value=C}}class N{filterEntity(C){var E;return this.values.every(B=>((E=C.metadata.tags)!==null&&E!==void 0?E:[]).includes(B))}toQueryValue(){return this.values}constructor(C){(0,R._)(this,"values",void 0),this.values=C}}class _e{filterEntity(C){const E=this.toUpperArray(this.value.split(/\s/)),B=this.toUpperArray([C.metadata.tags]),Q=this.toUpperArray([C.metadata.name,C.metadata.title]);for(const ne of E)if(B.every(re=>re!==ne)&&Q.every(re=>!re.includes(ne)))return!1;return!0}toUpperArray(C){return C.flat().filter(E=>Boolean(E)).map(E=>E.toLocaleUpperCase("en-US"))}constructor(C){_define_property(this,"value",void 0),this.value=C}}class at{filterEntity(C){return this.values.some(E=>(0,G.hF)(C,P.S4).some(B=>(0,P.eE)(B)===E))}toQueryValue(){return this.values}constructor(C){(0,R._)(this,"values",void 0),this.values=C.reduce((E,B)=>{try{return E.push((0,P.eE)((0,P.of)(B,{defaultKind:"Group"}))),E}catch{return E}},[])}}class It{filterEntity(C){return this.values.some(E=>{var B;return((B=C.spec)===null||B===void 0?void 0:B.lifecycle)===E})}toQueryValue(){return this.values}constructor(C){(0,R._)(this,"values",void 0),this.values=C}}class zt{filterEntity(C){return this.values.some(E=>C.metadata.namespace===E)}toQueryValue(){return this.values}constructor(C){(0,R._)(this,"values",void 0),this.values=C}}class xt{filterEntity(C){switch(this.value){case"owned":return this.isOwnedEntity(C);case"starred":return this.isStarredEntity(C);default:return!0}}toQueryValue(){return this.value}constructor(C,E,B){(0,R._)(this,"value",void 0),(0,R._)(this,"isOwnedEntity",void 0),(0,R._)(this,"isStarredEntity",void 0),this.value=C,this.isOwnedEntity=E,this.isStarredEntity=B}}class Zt{filterEntity(C){var E;const B=(E=C.metadata.annotations)===null||E===void 0?void 0:E["backstage.io/orphan"];return B!==void 0&&this.value.toString()===B}constructor(C){(0,R._)(this,"value",void 0),this.value=C}}class Dt{filterEntity(C){var E,B;const Q=(C==null||(E=C.status)===null||E===void 0||(B=E.items)===null||B===void 0?void 0:B.length)>0;return Q!==void 0&&this.value===Q}constructor(C){(0,R._)(this,"value",void 0),this.value=C}}var et=n(96641),lt=n(76635),yt=n(19126),At=n.n(yt),$t=n(73557),Gt=n(69294),xe=n(48760),Ce=n(90736);const Ye=(0,D.createContext)(void 0),Le=y=>{const C=(0,Ce.default)(),E=(0,p.h_)(W),[B,Q]=(0,D.useState)({}),ne=(0,$t.TH)();var re;const ve=(0,D.useMemo)(()=>(re=At().parse(ne.search,{ignoreQueryPrefix:!0}).filters)!==null&&re!==void 0?re:{},[ne]),[Ae,Oe]=(0,D.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:De,error:Be},tt]=(0,Gt.default)(async()=>{const We=(0,lt.compact)(Object.values(B)),gt=(0,G.Gz)(We),Ot=(0,G.wq)(We),bn=(0,G.wq)((0,lt.compact)(Object.values(Ae.appliedFilters))),Rt=Object.keys(B).reduce((kt,dn)=>{const Bn=B[dn];return Bn!=null&&Bn.toQueryValue&&(kt[dn]=Bn.toQueryValue()),kt},{});if((0,lt.isEqual)(bn,Ot))Oe({appliedFilters:B,backendEntities:Ae.backendEntities,entities:Ae.backendEntities.filter(gt)});else{const kt=await E.getEntities({filter:Ot});Oe({appliedFilters:B,backendEntities:kt.items,entities:kt.items.filter(gt)})}if(C()){var Kt;const kt=At().parse(ne.search,{ignoreQueryPrefix:!0}),dn=At().stringify({...kt,filters:Rt},{addQueryPrefix:!0,arrayFormat:"repeat"}),Bn=`${window.location.pathname}${dn}`;(Kt=window.history)===null||Kt===void 0||Kt.replaceState(null,document.title,Bn)}},[E,ve,B,Ae],{loading:!0});(0,xe.Z)(tt,10,[B]);const ft=(0,D.useCallback)(We=>{Q(gt=>{const Ot=typeof We=="function"?We(gt):We;return{...gt,...Ot}})},[]),qe=(0,D.useMemo)(()=>({filters:Ae.appliedFilters,entities:Ae.entities,backendEntities:Ae.backendEntities,updateFilters:ft,queryParameters:ve,loading:De,error:Be}),[Ae,ft,ve,De,Be]);return(0,u.jsx)(Ye.Provider,{value:qe,children:y.children})};function ct(){const y=(0,D.useContext)(Ye);if(!y)throw new Error("useEntityList must be used within EntityListProvider");return y}var wt=n(64279),dt=n(18149),Qe=n.n(dt),Ge=n(829),ut=n.n(Ge);function pt(){const y=(0,p.h_)(W),{filters:{kind:C,type:E},queryParameters:{type:B},updateFilters:Q}=ct(),ne=(0,D.useMemo)(()=>[B].flat().filter(Boolean),[B]);var re;const[ve,Ae]=(0,D.useState)(ne.length?ne:(re=E==null?void 0:E.getTypes())!==null&&re!==void 0?re:[]);(0,D.useEffect)(()=>{ne.length&&Ae(ne)},[ne]);const[Oe,De]=(0,D.useState)([]),Be=(0,D.useMemo)(()=>C==null?void 0:C.value,[C]),{error:tt,loading:ft,value:qe}=(0,wt.default)(async()=>Be?await y.getEntityFacets({filter:{kind:Be},facets:["spec.type"]}).then(Ot=>Ot.facets["spec.type"]||[]):[],[Be,y]),We=(0,D.useRef)(qe);return(0,D.useEffect)(()=>{const gt=We.current;if(We.current=qe,ft||!Be||gt===qe||!qe)return;const Ot=[...new Set(ut()(qe,Rt=>-Rt.count).map(Rt=>Rt.value.toLocaleLowerCase("en-US")))];De(Ot);const bn=ve.filter(Rt=>Ot.includes(Rt));Qe()(ve,bn)||Ae(bn)},[ft,Be,ve,Ae,qe]),(0,D.useEffect)(()=>{Q({type:ve.length?new Pe(ve):void 0})},[ve,Q]),{loading:ft,error:tt,availableTypes:Oe,selectedTypes:ve,setSelectedTypes:Ae}}function hn(y,C){var E,B;const Q=C==null||(E=C.type)===null||E===void 0?void 0:E.toLocaleLowerCase("en-US"),ne=C==null||(B=C.kind)===null||B===void 0?void 0:B.toLocaleLowerCase("en-US"),re=(0,p.h_)(W),{loading:ve,value:Ae,error:Oe}=(0,wt.default)(async()=>{var De;const Be=(De=y.relations)===null||De===void 0?void 0:De.filter(ft=>(!Q||ft.type.toLocaleLowerCase("en-US")===Q)&&(!ne||(0,P.of)(ft.targetRef).kind===ne));if(!(Be!=null&&Be.length))return[];const{items:tt}=await re.getEntitiesByRefs({entityRefs:Be.map(ft=>ft.targetRef)});return tt.filter(ft=>Boolean(ft))},[y,Q,ne]);return{entities:Ae,loading:ve,error:Oe}}var pn=n(72164);function fn(y){return typeof y=="string"?y:(0,P.eE)(y)}function _t(){const y=(0,p.h_)(f),C=(0,pn.Z)(y.starredEntitie$(),new Set),E=(0,D.useCallback)(Q=>C.has(fn(Q)),[C]),B=(0,D.useCallback)(Q=>y.toggleStarred(fn(Q)).then(),[y]);return{starredEntities:C,toggleStarredEntity:B,isStarredEntity:E}}function Sn(y){return typeof y=="string"?y:(0,P.eE)(y)}function Yt(y){const C=(0,p.h_)(f),[E,B]=(0,D.useState)(!1);return(0,D.useEffect)(()=>{const ne=C.starredEntitie$().subscribe({next(re){B(re.has(Sn(y)))}});return()=>{ne.unsubscribe()}},[y,C]),{toggleStarredEntity:(0,D.useCallback)(()=>C.toggleStarred(Sn(y)).then(),[y,C]),isStarredEntity:E}}var rn=n(75435);function jn(){const y=(0,p.h_)(p.$4),{loading:C,value:E}=(0,wt.default)(async()=>{const{ownershipEntityRefs:Q}=await y.getBackstageIdentity();return Q},[]),B=(0,D.useMemo)(()=>{const Q=new Set(E!=null?E:[]);return ne=>{const re=(0,rn.h)(ne,P.S4).map(P.eE);for(const ve of re)if(Q.has(ve))return!0;return!1}},[E]);return(0,D.useMemo)(()=>({loading:C,isOwnedEntity:B}),[C,B])}function on(){const y=(0,p.h_)(W),{error:C,loading:E,value:B}=(0,wt.default)(async()=>await y.getEntityFacets({facets:["kind"]}).then(ne=>{var re;return((re=ne.facets.kind)===null||re===void 0?void 0:re.map(ve=>ve.value).sort())||[]}),[y]);return{loading:E,error:C,allKinds:B!=null?B:[]}}function En(y,C,E){let B=y;return C&&(B=B.filter(ne=>C.some(re=>re.toLocaleLowerCase("en-US")===ne.toLocaleLowerCase("en-US")))),E&&!y.some(ne=>ne.toLocaleLowerCase("en-US")===E.toLocaleLowerCase("en-US"))&&(B=B.concat([E])),B.sort().reduce((ne,re)=>(ne[re.toLocaleLowerCase("en-US")]=re,ne),{})}function Fn(y){var C;const{filters:E,queryParameters:{kind:B},updateFilters:Q}=ct(),ne=(0,D.useMemo)(()=>[B].flat()[0],[B]);var re;const[ve,Ae]=(0,D.useState)((re=ne!=null?ne:(C=E.kind)===null||C===void 0?void 0:C.value)!==null&&re!==void 0?re:y.initialFilter);(0,D.useEffect)(()=>{ne&&Ae(ne)},[ne]),(0,D.useEffect)(()=>{var tt;if(!((tt=E.kind)===null||tt===void 0)&&tt.value){var ft;Ae((ft=E.kind)===null||ft===void 0?void 0:ft.value)}},[E.kind]),(0,D.useEffect)(()=>{Q({kind:ve?new je(ve):void 0})},[ve,Q]);const{allKinds:Oe,loading:De,error:Be}=on();return{loading:De,error:Be,allKinds:Oe!=null?Oe:[],selectedKind:ve,setSelectedKind:Ae}}const nt=y=>{const{allowedKinds:C,hidden:E,initialFilter:B="component"}=y,Q=(0,p.h_)(p.$v),{error:ne,allKinds:re,selectedKind:ve,setSelectedKind:Ae}=Fn({initialFilter:B});if((0,D.useEffect)(()=>{ne&&Q.post({message:"Failed to load entity kinds",severity:"error"})},[ne,Q]),ne)return null;const Oe=En(re,C,ve),De=Object.keys(Oe).map(Be=>({value:Be,label:Oe[Be]}));return E?null:(0,u.jsx)(L.Z,{pb:1,pt:1,children:(0,u.jsx)(T.Ph,{label:"Kind",items:De,selected:ve.toLocaleLowerCase("en-US"),onChange:Be=>Ae(String(Be))})})};var sn=n(79692),Jt=n(38016),rt=n(88013),In=n(21324),Qt=n(5806),Pn=n(19996),Nn=n(25505);const Ln=(0,u.jsx)(Nn.Z,{fontSize:"small"}),Zn=(0,u.jsx)(Pn.Z,{fontSize:"small"});function Se({selected:y}){return(0,u.jsx)(In.Z,{icon:Ln,checkedIcon:Zn,checked:y})}const ce=(0,D.memo)(y=>{const{selected:C,value:E,availableOptions:B,showCounts:Q}=y,ne=Q?`${E} (${B==null?void 0:B[E]})`:E;return(0,u.jsx)(Qt.Z,{control:(0,u.jsx)(Se,{selected:C}),label:ne,onClick:re=>re.preventDefault()})});var Ie=n(86619),Ue=n(72779),Ve=n.n(Ue);const le=(0,sn.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function U(y){const C=le();return(0,u.jsx)(Ie.Z,{variant:"outlined",...y,className:Ve()(C.input,y.className)})}function he(y){var C;const{label:E,name:B,path:Q,showCounts:ne,Filter:re,InputProps:ve,initialSelectedOptions:Ae=[]}=y,{updateFilters:Oe,filters:De,queryParameters:{[B]:Be}}=ct(),tt=(0,p.h_)(W),{value:ft}=(0,wt.default)(async()=>{var kt;const dn=Q,{facets:Bn}=await tt.getEntityFacets({facets:[dn],filter:(kt=De.kind)===null||kt===void 0?void 0:kt.getCatalogFilters()});return Object.fromEntries(Bn[dn].map(({value:Pr,count:dr})=>[Pr,dr]))},[De.kind]),qe=(0,D.useMemo)(()=>[Be].flat().filter(Boolean),[Be]);var We;const[gt,Ot]=(0,D.useState)(qe.length?qe:(We=(C=De[B])===null||C===void 0?void 0:C.values)!==null&&We!==void 0?We:Ae);(0,D.useEffect)(()=>{qe.length&&Ot(qe)},[qe]);const bn=Object.keys(ft!=null?ft:{}),Rt=gt.length&&bn.length;(0,D.useEffect)(()=>{Oe({[B]:Rt?new re(gt):void 0})},[B,Rt,gt,re,Oe]);const Kt=De[B];return Kt&&typeof Kt=="object"&&!("values"in Kt)||!bn.length||bn.length<=1?null:(0,u.jsx)(L.Z,{pb:1,pt:1,children:(0,u.jsxs)(A.Z,{variant:"button",component:"label",children:[E,(0,u.jsx)(rt.ZP,{multiple:!0,disableCloseOnSelect:!0,options:bn,value:gt,onChange:(kt,dn)=>Ot(dn),renderOption:(kt,{selected:dn})=>(0,u.jsx)(ce,{selected:dn,value:kt,availableOptions:ft,showCounts:!!ne}),size:"small",popupIcon:(0,u.jsx)(Jt.Z,{"data-testid":`${String(B)}-picker-expand`}),renderInput:kt=>(0,u.jsx)(U,{...kt,...ve})})]})})}const $e=(0,sn.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),Ke=y=>{const{initialFilter:C=[]}=y,E=$e();return(0,u.jsx)(he,{label:"Lifecycle",name:"lifecycles",path:"spec.lifecycle",Filter:It,InputProps:{className:E.input},initialSelectedOptions:C})};var Je=n(6232),Ft=n(98685),Vt=n(62367),en=n(72579),Xt=n.n(en);function tn(y,C){const E=C==null?void 0:C.defaultKind;let B,Q,ne;return"metadata"in y?(B=y.kind,Q=y.metadata.namespace,ne=y.metadata.name):(B=y.kind,Q=y.namespace,ne=y.name),(Q===void 0||Q==="")&&(Q=P.zG),(C==null?void 0:C.defaultNamespace)!==void 0?(C==null?void 0:C.defaultNamespace)===Q&&(Q=void 0):Q===P.zG&&(Q=void 0),B=B.toLocaleLowerCase("en-US"),B=E&&E.toLocaleLowerCase("en-US")===B?void 0:B,`${B?`${B}:`:""}${Q?`${Q}/`:""}${ne}`}function _(y,C){for(const E of["spec.profile.displayName","metadata.title"]){const B=Xt()(y,E);if(B&&typeof B=="string")return B}return C}function X({enabled:y}){const C=(0,p.h_)(W),[E]=(0,D.useState)(async()=>{if(!y)return[];const B="relations.ownedBy";return C.getEntityFacets({facets:[B]}).then(Q=>Q.facets[B].map(ne=>ne.value).map(ne=>{const{kind:re,name:ve,namespace:Ae}=(0,P.of)(ne);return{apiVersion:"backstage.io/v1beta1",kind:re,metadata:{name:ve,namespace:Ae}}}).sort((ne,re)=>(ne.metadata.namespace||"").localeCompare(re.metadata.namespace||"","en-US")||ne.metadata.name.localeCompare(re.metadata.name,"en-US")||ne.kind.localeCompare(re.kind,"en-US"))).catch(()=>[])});return(0,Gt.default)(async(B,Q)=>{const ne=await E;if(!ne)return{items:[]};var re;const ve=(re=Q==null?void 0:Q.limit)!==null&&re!==void 0?re:20,{text:Ae,start:Oe}=ee(B),De=ne.filter(tt=>J(Ae,tt)),Be=Oe+ve;return{items:De.slice(0,Be),...O({entities:De,limit:Be,payload:{text:Ae,start:Be}})}},[E],{loading:!0,value:{items:[]}})}function ee(y){return v(y)&&y.cursor?JSON.parse(atob(y.cursor)):{text:y.text||"",start:0}}function v(y){return!!y.cursor}function O({entities:y,limit:C,payload:E}){return y.length>C?{cursor:btoa(JSON.stringify(E))}:{}}function J(y,C){var E;const B=y.trim();return C.kind.includes(B)||((E=C.metadata.namespace)===null||E===void 0?void 0:E.includes(B))||C.metadata.name.includes(B)}function M(){const y=(0,p.h_)(W);return(0,Gt.default)(async(C,E)=>{const B=C,Q=C;var ne;const re=(ne=E==null?void 0:E.limit)!==null&&ne!==void 0?ne:20;if(Q.cursor){const Ae=await y.queryEntities({cursor:Q.cursor,limit:re});return{cursor:Ae.pageInfo.nextCursor,items:[...Q.items,...Ae.items]}}const ve=await y.queryEntities({fullTextFilter:{term:B.text||"",fields:["metadata.name","kind","spec.profile.displayname","metadata.title"]},filter:{kind:["User","Group"]},orderFields:[{field:"metadata.name",order:"asc"}],limit:re});return{cursor:ve.pageInfo.nextCursor,items:ve.items}},[],{loading:!0})}var ue=n(21638);function ye({mode:y,initialSelectedOwnersRefs:C}){const E=y==="owners-only",B=M(),Q=X({enabled:E}),[ne,re]=E?Q:B;return[ne,re,Me({enabled:!E,initialSelectedOwnersRefs:C})]}function Me({enabled:y,initialSelectedOwnersRefs:C}){const E=(0,D.useRef)({}),B=(0,p.h_)(W),[,Q]=(0,Gt.default)(async()=>{(await B.getEntitiesByRefs({entityRefs:C})).items.forEach(re=>{re&&(E.current[(0,P.eE)(re)]=re)})},[]);return(0,ue.n)(()=>{y&&C.length>0&&Q()}),{getEntity:ne=>E.current[ne],setEntity:ne=>{E.current[(0,P.eE)(ne)]=ne}}}const ot=(0,sn.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),ht=(0,u.jsx)(Nn.Z,{fontSize:"small"}),Tt=(0,u.jsx)(Pn.Z,{fontSize:"small"}),jt=y=>{var C,E;const B=ot(),{mode:Q="owners-only"}=y||{},{updateFilters:ne,filters:re,queryParameters:{owners:ve}}=ct(),[Ae,Oe]=(0,D.useState)(""),De=(0,D.useMemo)(()=>[ve].flat().filter(Boolean),[ve]);var Be;const[tt,ft]=(0,D.useState)(De.length?De:(Be=(C=re.owners)===null||C===void 0?void 0:C.values)!==null&&Be!==void 0?Be:[]),[{value:qe,loading:We},gt,Ot]=ye({mode:Q,initialSelectedOwnersRefs:tt});(0,Je.b)(()=>gt({text:Ae}),[Ae,gt],250);const bn=(qe==null?void 0:qe.items)||[];return(0,D.useEffect)(()=>{if(De.length){const Rt=new at(De);ft(Rt.values)}},[De]),(0,D.useEffect)(()=>{ne({owners:tt.length?new at(tt):void 0})},[tt,ne]),["user","group"].includes(((E=re.kind)===null||E===void 0?void 0:E.value.toLocaleLowerCase("en-US"))||"")?null:(0,u.jsx)(L.Z,{pb:1,pt:1,children:(0,u.jsxs)(A.Z,{variant:"button",component:"label",children:["Owner",(0,u.jsx)(rt.ZP,{multiple:!0,disableCloseOnSelect:!0,loading:We,options:bn,value:tt,getOptionSelected:(Rt,Kt)=>typeof Kt=="string"?(0,P.eE)(Rt)===Kt:Rt===Kt,getOptionLabel:Rt=>{const Kt=typeof Rt=="string"?Ot.getEntity(Rt)||(0,P.of)(Rt,{defaultKind:"group",defaultNamespace:"default"}):Rt;return _(Kt,tn(Kt))},onChange:(Rt,Kt)=>{Oe(""),ft(Kt.map(kt=>{const dn=typeof kt=="string"?kt:(0,P.eE)(kt);return typeof kt!="string"&&Ot.setEntity(kt),dn}))},filterOptions:Rt=>Rt,renderOption:(Rt,{selected:Kt})=>{const kt=Rt.kind.toLocaleLowerCase("en-US")==="group";return(0,u.jsx)(Qt.Z,{control:(0,u.jsx)(In.Z,{icon:ht,checkedIcon:Tt,checked:Kt}),onClick:dn=>dn.preventDefault(),label:(0,u.jsxs)(L.Z,{display:"flex",flexWrap:"wrap",alignItems:"center",children:[kt?(0,u.jsx)(Vt.Z,{fontSize:"small"}):(0,u.jsx)(Ft.Z,{fontSize:"small"}),"\xA0",_(Rt,tn(Rt,{defaultKind:Rt.kind}))]})})},size:"small",popupIcon:(0,u.jsx)(Jt.Z,{"data-testid":"owner-picker-expand"}),renderInput:Rt=>(0,u.jsx)(Ie.Z,{...Rt,className:B.input,onChange:Kt=>{Oe(Kt.currentTarget.value)},variant:"outlined"}),ListboxProps:{onScroll:Rt=>{const Kt=Rt.currentTarget;Math.abs(Kt.scrollHeight-Kt.clientHeight-Kt.scrollTop)<1&&(qe!=null&&qe.cursor)&>({items:qe.items,cursor:qe.cursor})},"data-testid":"owner-picker-listbox"}})]})})};var st=n(51837);const Ne=(0,st.uW)("catalog:entity-route-ref",()=>(0,p.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function Ut(y){var C,E;return{kind:y.kind.toLocaleLowerCase("en-US"),namespace:(E=(C=y.metadata.namespace)===null||C===void 0?void 0:C.toLocaleLowerCase("en-US"))!==null&&E!==void 0?E:DEFAULT_NAMESPACE,name:y.metadata.name}}var qt=n(80030);const bt=(0,D.forwardRef)((y,C)=>{const{entityRef:E,defaultKind:B,title:Q,children:ne,...re}=y,ve=(0,p.tg)(Ne);let Ae,Oe,De;if(typeof E=="string"){const We=(0,P.of)(E);Ae=We.kind,Oe=We.namespace,De=We.name}else"metadata"in E?(Ae=E.kind,Oe=E.metadata.namespace,De=E.metadata.name):(Ae=E.kind,Oe=E.namespace,De=E.name);Ae=Ae.toLocaleLowerCase("en-US");var Be;Oe=(Be=Oe==null?void 0:Oe.toLocaleLowerCase("en-US"))!==null&&Be!==void 0?Be:P.zG;const tt={kind:Ae,namespace:Oe,name:De},ft=tn({kind:Ae,namespace:Oe,name:De},{defaultKind:B}),qe=(0,u.jsxs)(T.rU,{...re,ref:C,to:ve(tt),children:[ne,!ne&&(Q!=null?Q:ft)]});return Q?(0,u.jsx)(qt.ZP,{title:ft,children:qe}):qe});function Nt(y){const{entityRefs:C,defaultKind:E,getTitle:B,...Q}=y,ne=(0,p.h_)(W),{value:re=new Array,loading:ve,error:Ae}=(0,wt.default)(async()=>{const Oe=C.reduce((Be,tt)=>typeof tt=="object"&&"metadata"in tt?Be:[...Be,(0,P.of)(tt)],new Array),De=C.filter(Be=>typeof Be=="object"&&"metadata"in Be);return Oe.length>0?[...(await ne.getEntities({filter:Oe.map(Be=>({kind:Be.kind,"metadata.namespace":Be.namespace,"metadata.name":Be.name}))})).items,...De]:De},[C]);return ve?(0,u.jsx)(T.Ex,{}):Ae?(0,u.jsx)(T.yu,{error:Ae}):(0,u.jsx)(u.Fragment,{children:re.map((Oe,De)=>(0,u.jsxs)(D.Fragment,{children:[De>0&&", ",(0,u.jsx)(bt,{...Q,defaultKind:E,entityRef:Oe,title:B(Oe)})]},De))})}function gn(y){const{entityRefs:C,defaultKind:E,fetchEntities:B,getTitle:Q,...ne}=y;return B?(0,u.jsx)(Nt,{...ne,defaultKind:E,entityRefs:C,getTitle:Q}):(0,u.jsx)(u.Fragment,{children:C.map((re,ve)=>(0,u.jsxs)(D.Fragment,{children:[ve>0&&", ",(0,u.jsx)(bt,{...ne,defaultKind:E,entityRef:re,title:Q?Q(re):void 0})]},ve))})}const Cn=y=>{const C=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:C(getCompoundEntityRef(y.entity)),children:_jsx(InfoIcon,{})})},vt=y=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${y.email}`,to:`mailto:${y.email}`,children:_jsx(EmailIcon,{})}),He=y=>{var C;const E=(C=y.entity.spec.profile)===null||C===void 0?void 0:C.email;return E?_jsx(EmailCardAction,{email:E}):null},Lt=y=>{var C;const E=(C=y.entity.spec.profile)===null||C===void 0?void 0:C.email;return E?_jsx(EmailCardAction,{email:E}):null},xn=(0,sn.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),nn=4,sr=y=>{var C,E,B;const{entityRef:Q,children:ne,delayTime:re=500}=y,ve=xn(),Ae=useApiHolder(),Oe=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[De,Be]=useState(!1),tt=useMemo(()=>debounce(()=>Be(!0),re),[re]),[{loading:ft,error:qe,value:We},gt]=useAsyncFn(async()=>{const bn=Ae.get(catalogApiRef);if(bn){const Rt=await bn.getEntityByRef(Q);if(!Rt)throw new Error(`${Q} not found`);return Rt}},[Ae,Q]),Ot=()=>{Be(!1),tt.cancel()};return useEffect(()=>{Oe.isOpen&&!We&&!qe&&!ft&>()},[Oe.isOpen,gt,We,qe,ft]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:tt,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Oe),children:ne})}),De&&_jsx(HoverPopover,{PaperProps:{className:ve.popoverPaper},...bindPopover(Oe),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:Ot,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[qe&&_jsx(ResponseErrorPanel,{error:qe}),ft&&_jsx(Progress,{}),We&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:We.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:We.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:We.kind}),We.metadata.description&&_jsx(Typography,{className:ve.descriptionTypography,paragraph:!0,children:We.metadata.description}),_jsx(Typography,{children:(C=We.spec)===null||C===void 0?void 0:C.type}),_jsxs(Box,{marginTop:"0.5em",children:[(We.metadata.tags||[]).slice(0,nn).map(bn=>_jsx(Chip,{size:"small",label:bn},bn)),((E=We.metadata.tags)===null||E===void 0?void 0:E.length)&&((B=We.metadata.tags)===null||B===void 0?void 0:B.length)>nn&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!qe&&We&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity(We)&&_jsx(UserCardActions,{entity:We}),isGroupEntity(We)&&_jsx(GroupCardActions,{entity:We}),_jsx(EntityCardActions,{entity:We})]})})]})})]})},mr=(0,sn.Z)(y=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),Gn=()=>{var y;const C=mr(),{filters:E,updateFilters:B}=useEntityList();var Q;const[ne,re]=useState((Q=(y=E.text)===null||y===void 0?void 0:y.value)!==null&&Q!==void 0?Q:"");return useDebounce(()=>{B({text:ne.length?new EntityTextFilter(ne):void 0})},250,[ne,B]),_jsx(Toolbar,{className:C.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:C.input,placeholder:"Search",autoComplete:"off",onChange:ve=>re(ve.target.value),value:ne,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>re(""),edge:"end",disabled:ne.length===0,children:_jsx(Clear,{})})})})})})},cn=Object.freeze({createEntityRefColumn(y){const{defaultKind:C}=y;function E(B){var Q;return((Q=B.metadata)===null||Q===void 0?void 0:Q.title)||tn(B,{defaultKind:C})}return{title:"Name",highlight:!0,customFilterAndSearch(B,Q){return E(Q).includes(B)},customSort(B,Q){return E(B).localeCompare(E(Q))},render:B=>{var Q;return(0,u.jsx)(bt,{entityRef:B,defaultKind:C,title:(Q=B.metadata)===null||Q===void 0?void 0:Q.title})}}},createEntityRelationColumn(y){const{title:C,relation:E,defaultKind:B,filter:Q}=y;function ne(ve){return(0,G.hF)(ve,E,Q)}function re(ve){return ne(ve).map(Ae=>tn(Ae,{defaultKind:B})).join(", ")}return{title:C,customFilterAndSearch(ve,Ae){return re(Ae).includes(ve)},customSort(ve,Ae){return re(ve).localeCompare(re(Ae))},render:ve=>(0,u.jsx)(gn,{entityRefs:ne(ve),defaultKind:B})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:P.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:P.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:P.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:y=>(0,u.jsx)(T.Or,{text:y.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),ir=[cn.createEntityRefColumn({defaultKind:"system"}),cn.createDomainColumn(),cn.createOwnerColumn(),cn.createMetadataDescriptionColumn()],Nr=[cn.createEntityRefColumn({defaultKind:"component"}),cn.createSystemColumn(),cn.createOwnerColumn(),cn.createSpecTypeColumn(),cn.createSpecLifecycleColumn(),cn.createMetadataDescriptionColumn()],Zr=(0,sn.Z)(y=>({empty:{padding:y.spacing(2),display:"flex",justifyContent:"center"}})),Kn=y=>{const{entities:C,title:E,emptyContent:B,variant:Q="gridItem",columns:ne}=y,re=Zr(),ve={minWidth:"0",width:"100%"};return Q==="gridItem"&&(ve.height="calc(100% - 10px)"),(0,u.jsx)(T.iA,{columns:ne,title:E,style:ve,emptyContent:B&&(0,u.jsx)("div",{className:re.empty,children:B}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:C})};Kn.columns=cn,Kn.systemEntityColumns=ir,Kn.componentEntityColumns=Nr;const Rr=(0,sn.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),S=y=>{const C=Rr();return(0,u.jsx)(he,{label:"Tags",name:"tags",path:"metadata.tags",Filter:N,showCounts:y.showCounts,InputProps:{className:C.input}})},c=y=>{const{hidden:C,initialFilter:E}=y,B=(0,p.h_)(p.$v),{error:Q,availableTypes:ne,selectedTypes:re,setSelectedTypes:ve}=pt();if((0,D.useEffect)(()=>{Q&&B.post({message:"Failed to load entity types",severity:"error"}),E&&ve([E])},[Q,B,E,ve]),ne.length===0||Q)return null;const Ae=[{value:"all",label:"all"},...ne.map(De=>({value:De,label:De}))];var Oe;return C?null:(0,u.jsx)(L.Z,{pb:1,pt:1,children:(0,u.jsx)(T.Ph,{label:"Type",items:Ae,selected:(Oe=Ae.length>1?re[0]:void 0)!==null&&Oe!==void 0?Oe:"all",onChange:De=>ve(De==="all"?[]:[String(De)])})})};var b=n(15459),j=n(61837),K=n(11640),me=n(28347);const we=(0,b.Z)({root:{color:"#f3ba37"}})(K.Z),Fe=y=>{const{toggleStarredEntity:C,isStarredEntity:E}=Yt(y.entity);return(0,u.jsx)(j.Z,{"aria-label":"favorite",color:"inherit",...y,onClick:()=>C(),children:(0,u.jsx)(qt.ZP,{title:E?"Remove from favorites":"Add to favorites",children:E?(0,u.jsx)(we,{}):(0,u.jsx)(me.Z,{})})})};var Xe=n(8629),Mt=n(79249),wn=n(38724),Qn=n(99152),ar=n(6487),vr=n(49429),an=n(55999),mo=n(39412);const _r=mo.Z;function Oo(y,C){if(y)return y.toLocaleLowerCase("en-US");if(C)try{return(0,P.of)(C).kind.toLocaleLowerCase("en-US")}catch{return}}function eo(y,C){const E=(0,p.qD)(),B=Oo(y,C);return B&&E.getSystemIcon(`kind:${B}`)||_r}function vo(y){const{kind:C,entityRef:E,...B}=y,Q=eo(C,E);return(0,u.jsx)(Q,{...B})}const ko=(0,sn.Z)(y=>({node:{fill:y.palette.grey[300],stroke:y.palette.grey[300],"&.primary":{fill:y.palette.primary.light,stroke:y.palette.primary.light},"&.secondary":{fill:y.palette.secondary.light,stroke:y.palette.secondary.light}},text:{fill:y.palette.getContrastText(y.palette.grey[300]),"&.primary":{fill:y.palette.primary.contrastText},"&.secondary":{fill:y.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function xs(y){const C=(0,p.h_)(W),E=(0,P.eE)(y),{loading:B,error:Q,value:ne}=(0,wt.default)(async()=>{const re=await C.getEntityAncestors({entityRef:E}),ve=new Array,Ae=new Array;for(const Oe of re.items){const De=(0,P.eE)(Oe.entity),Be=De===re.rootEntityRef;ve.push({id:De,root:Be,...Oe.entity});for(const tt of Oe.parentEntityRefs)Ae.push({from:De,to:tt})}return{nodes:ve,edges:Ae}},[E]);return{loading:B,error:Q,nodes:(ne==null?void 0:ne.nodes)||[],edges:(ne==null?void 0:ne.edges)||[]}}function Bo({node:y}){const C=ko(),E=(0,$t.s0)(),B=(0,p.tg)(Ne),[Q,ne]=(0,D.useState)(0),[re,ve]=(0,D.useState)(0),Ae=(0,D.useRef)(null);(0,D.useLayoutEffect)(()=>{if(Ae.current){let{height:gt,width:Ot}=Ae.current.getBBox();gt=Math.round(gt),Ot=Math.round(Ot),(gt!==re||Ot!==Q)&&(ne(Ot),ve(gt))}},[Q,re]);const Oe=10,De=re,Be=De+Oe,tt=Be+Q+Oe*2,ft=re+Oe*2,qe=y.metadata.title||(y.kind&&y.metadata.name&&y.metadata.namespace?tn({kind:y.kind,name:y.metadata.name,namespace:y.metadata.namespace||""}):y.id),We=()=>{E(B({kind:y.kind,namespace:y.metadata.namespace||P.zG,name:y.metadata.name}))};return(0,u.jsxs)("g",{onClick:We,className:C.clickable,children:[(0,u.jsx)("rect",{className:Ve()(C.node,y.root?"secondary":"primary"),width:tt,height:ft,rx:10}),(0,u.jsx)(vo,{kind:y.kind,y:Oe,x:Oe,width:De,height:De,className:Ve()(C.text,y.root?"secondary":"primary")}),(0,u.jsx)("text",{ref:Ae,className:Ve()(C.text,y.root?"secondary":"primary"),y:ft/2,x:Be+(Q+Oe*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:qe})]})}function $o(y){const{loading:C,error:E,nodes:B,edges:Q}=xs(y.entity);return C?(0,u.jsx)(T.Ex,{}):E?(0,u.jsx)(T.Gk,{error:E}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(an.Z,{variant:"h2",children:"Ancestry"}),(0,u.jsxs)(an.Z,{gutterBottom:!0,children:["This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where"," ",(0,u.jsx)(T.rU,{to:"https://backstage.io/docs/features/software-catalog/life-of-an-entity",children:"processors emitted"})," ","child entities that ultimately led to the current one existing. Note that this is a completely different mechanism from relations."]}),(0,u.jsx)(L.Z,{mt:4,children:(0,u.jsx)(T.mn,{nodes:B,edges:Q,renderNode:Bo,direction:T.NX.Direction.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var yr=n(11776),er=n(38402),Or=n(86136),Ur=n(99688),to=n(49378),no=n(54506),Mr=n(94339),Do=n(24579),yo=n(27685);const On=(0,sn.Z)(y=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:y.spacing(2)},helpIcon:{marginLeft:y.spacing(1),color:y.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function Xn(y){const C=On();return(0,u.jsx)(to.Z,{...y,primaryTypographyProps:{className:C.monospace},secondaryTypographyProps:{className:C.monospace}})}function kr(y){const C=On();return(0,u.jsx)(no.Z,{className:C.monospace,children:y.children})}function zr(y){return(0,u.jsx)(L.Z,{mt:2,children:(0,u.jsx)(Mr.Z,{variant:"outlined",children:(0,u.jsxs)(Do.Z,{children:[(0,u.jsxs)(A.Z,{variant:"h6",gutterBottom:!0,children:[y.title,y.helpLink&&(0,u.jsx)(oo,{to:y.helpLink})]}),y.children]})})})}function Ir(y){if(y.match(/^url:https?:\/\//))return y.slice(4);if(y.match(/^https?:\/\//))return y}function ro(y){const[C,E]=y.entry,B=Ir(E);return(0,u.jsxs)(er.Z,{children:[y.indent&&(0,u.jsx)(Or.Z,{}),(0,u.jsx)(Xn,{primary:C,secondary:B?(0,u.jsx)(T.rU,{to:B,children:E}):E})]})}function oo(y){const C=On();return(0,u.jsx)(T.rU,{to:y.to,className:C.helpIcon,children:(0,u.jsx)(yo.Z,{fontSize:"inherit"})})}const Fo=(0,sn.Z)({root:{display:"flex",flexDirection:"column"}});function xo(y){var C,E;const B=(0,p.h_)(W),Q=(0,P.eE)(y),ne=(C=y.metadata.annotations)===null||C===void 0?void 0:C[P.P1],re=(E=y.metadata.annotations)===null||E===void 0?void 0:E[P.q1],{loading:ve,error:Ae,value:Oe}=(0,wt.default)(async()=>!ne&&!re?[]:(await B.getEntities({filter:[...ne?[{[`metadata.annotations.${P.P1}`]:ne}]:[],...re?[{[`metadata.annotations.${P.q1}`]:re}]:[]]})).items,[ne,re]);return{loading:ve,error:Ae,location:ne,originLocation:re,colocatedEntities:Oe==null?void 0:Oe.filter(De=>(0,P.eE)(De)!==Q)}}function lr(y){return(0,u.jsxs)(yr.Z,{dense:!0,children:[y.header&&(0,u.jsx)(ro,{entry:y.header},"header"),y.entities.map(C=>(0,u.jsxs)(er.Z,{children:[(0,u.jsx)(Or.Z,{children:(0,u.jsx)(vo,{kind:C.kind})}),(0,u.jsx)(Xn,{primary:(0,u.jsx)(bt,{entityRef:C})})]},(0,P.eE)(C)))]})}function bs(y){const{entity:C}=y,{loading:E,error:B,location:Q,originLocation:ne,colocatedEntities:re}=xo(C);if(E)return(0,u.jsx)(T.Ex,{});if(B)return(0,u.jsx)(T.Gk,{error:B});if(!Q&&!ne)return(0,u.jsx)(Ur.Z,{severity:"warning",children:"Entity had no location information."});if(!(re!=null&&re.length))return(0,u.jsx)(Ur.Z,{severity:"info",children:"There were no other entities on this location."});if(Q===ne)return(0,u.jsx)(lr,{entities:re});const ve=re.filter(Oe=>{var De;return((De=Oe.metadata.annotations)===null||De===void 0?void 0:De[P.P1])===Q}),Ae=re.filter(Oe=>{var De;return((De=Oe.metadata.annotations)===null||De===void 0?void 0:De[P.q1])===ne});return(0,u.jsxs)(u.Fragment,{children:[ve.length>0&&(0,u.jsx)(lr,{entities:ve,header:["At the same location",Q]}),Ae.length>0&&(0,u.jsx)(lr,{entities:Ae,header:["At the same origin",ne]})]})}function No(y){const C=Fo();return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(an.Z,{variant:"h2",children:"Colocated"}),(0,u.jsx)(an.Z,{children:"These are the entities that are colocated with this entity - as in, they originated from the same data source (e.g. came from the same YAML file), or from the same origin (e.g. the originally registered URL)."}),(0,u.jsx)("div",{className:C.root,children:(0,u.jsx)(bs,{entity:y.entity})})]})}function Wr(y){return Object.fromEntries([...Object.entries(y)].sort((C,E)=>C[0]<E[0]?-1:1))}function Zo(y){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(an.Z,{variant:"h2",children:"Entity as JSON"}),(0,u.jsx)(an.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,u.jsx)(an.Z,{children:(0,u.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,u.jsx)(T.Oi,{text:JSON.stringify(Wr(y.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var Uo=n(3440),qn=n.n(Uo);const ri=(0,sn.Z)({root:{display:"flex",flexDirection:"column"}});function Ss(y){var C,E;const B=ri(),{apiVersion:Q,kind:ne,metadata:re,spec:ve,relations:Ae=[],status:Oe={}}=y.entity,De=qn()(ut()(Ae,Be=>Be.targetRef),"type");return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(an.Z,{variant:"h2",children:"Overview"}),(0,u.jsxs)("div",{className:B.root,children:[(0,u.jsx)(zr,{title:"Identity",children:(0,u.jsxs)(yr.Z,{dense:!0,children:[(0,u.jsx)(er.Z,{children:(0,u.jsx)(Xn,{primary:"apiVersion",secondary:Q})}),(0,u.jsx)(er.Z,{children:(0,u.jsx)(Xn,{primary:"kind",secondary:ne})}),(ve==null?void 0:ve.type)&&(0,u.jsx)(er.Z,{children:(0,u.jsx)(Xn,{primary:"spec.type",secondary:ve.type})}),re.uid&&(0,u.jsx)(er.Z,{children:(0,u.jsx)(Xn,{primary:"uid",secondary:re.uid})}),re.etag&&(0,u.jsx)(er.Z,{children:(0,u.jsx)(Xn,{primary:"etag",secondary:re.etag})})]})}),(0,u.jsxs)(zr,{title:"Metadata",children:[!!Object.keys(re.annotations||{}).length&&(0,u.jsx)(yr.Z,{dense:!0,subheader:(0,u.jsxs)(kr,{children:["Annotations",(0,u.jsx)(oo,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(re.annotations).map(Be=>(0,u.jsx)(ro,{indent:!0,entry:Be},Be[0]))}),!!Object.keys(re.labels||{}).length&&(0,u.jsx)(yr.Z,{dense:!0,subheader:(0,u.jsx)(kr,{children:"Labels"}),children:Object.entries(re.labels).map(Be=>(0,u.jsx)(ro,{indent:!0,entry:Be},Be[0]))}),!!(!((C=re.tags)===null||C===void 0)&&C.length)&&(0,u.jsx)(yr.Z,{dense:!0,subheader:(0,u.jsx)(kr,{children:"Tags"}),children:re.tags.map((Be,tt)=>(0,u.jsxs)(er.Z,{children:[(0,u.jsx)(Or.Z,{}),(0,u.jsx)(Xn,{primary:Be})]},`${Be}-${tt}`))})]}),!!Ae.length&&(0,u.jsx)(zr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(De).map(([Be,tt],ft)=>(0,u.jsx)("div",{children:(0,u.jsx)(yr.Z,{dense:!0,subheader:(0,u.jsx)(kr,{children:Be}),children:tt.map(qe=>(0,u.jsxs)(er.Z,{children:[(0,u.jsx)(Or.Z,{children:(0,u.jsx)(vo,{entityRef:qe.targetRef})}),(0,u.jsx)(Xn,{primary:(0,u.jsx)(bt,{entityRef:qe.targetRef})})]},qe.targetRef))})},ft))}),!!(!((E=Oe.items)===null||E===void 0)&&E.length)&&(0,u.jsx)(zr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Oe.items.map((Be,tt)=>(0,u.jsxs)("div",{children:[(0,u.jsxs)(A.Z,{children:[Be.level,": ",Be.type]}),(0,u.jsx)(L.Z,{ml:2,children:Be.message})]},tt))})]})]})}var Cs=n(72847);function ws(y){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(an.Z,{variant:"h2",children:"Entity as YAML"}),(0,u.jsx)(an.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,u.jsx)(an.Z,{children:(0,u.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,u.jsx)(T.Oi,{text:Cs.ZP.stringify(Wr(y.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const so=(0,sn.Z)(y=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:y.palette.background.paper},tabs:{borderRight:`1px solid ${y.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function Vr(y){const{children:C,value:E,index:B,...Q}=y,ne=so();return(0,u.jsx)("div",{role:"tabpanel",hidden:E!==B,id:`vertical-tabpanel-${B}`,"aria-labelledby":`vertical-tab-${B}`,className:ne.tabContents,...Q,children:E===B&&(0,u.jsx)(L.Z,{pl:3,pr:3,children:C})})}function Hr(y){return{id:`vertical-tab-${y}`,"aria-controls":`vertical-tabpanel-${y}`}}function cr(y){const C=so(),[E,B]=D.useState(0);return(0,D.useEffect)(()=>{B(0)},[y.open]),y.entity?(0,u.jsxs)(Xe.Z,{fullWidth:!0,maxWidth:"xl",open:y.open,onClose:y.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:C.fullHeightDialog},children:[(0,u.jsx)(Mt.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,u.jsx)(wn.Z,{dividers:!0,children:(0,u.jsxs)("div",{className:C.root,children:[(0,u.jsxs)(Qn.Z,{orientation:"vertical",variant:"scrollable",value:E,onChange:(Q,ne)=>B(ne),"aria-label":"Inspector options",className:C.tabs,children:[(0,u.jsx)(ar.Z,{label:"Overview",...Hr(0)}),(0,u.jsx)(ar.Z,{label:"Ancestry",...Hr(1)}),(0,u.jsx)(ar.Z,{label:"Colocated",...Hr(2)}),(0,u.jsx)(ar.Z,{label:"Raw JSON",...Hr(3)}),(0,u.jsx)(ar.Z,{label:"Raw YAML",...Hr(4)})]}),(0,u.jsx)(Vr,{value:E,index:0,children:(0,u.jsx)(Ss,{entity:y.entity})}),(0,u.jsx)(Vr,{value:E,index:1,children:(0,u.jsx)($o,{entity:y.entity})}),(0,u.jsx)(Vr,{value:E,index:2,children:(0,u.jsx)(No,{entity:y.entity})}),(0,u.jsx)(Vr,{value:E,index:3,children:(0,u.jsx)(Zo,{entity:y.entity})}),(0,u.jsx)(Vr,{value:E,index:4,children:(0,u.jsx)(ws,{entity:y.entity})})]})}),(0,u.jsx)(vr.Z,{children:(0,u.jsx)(V.Z,{onClick:y.onClose,color:"primary",children:"Close"})})]}):null}var Mo=n(85256);function Yn(y){var C;const E=(0,p.h_)(W),B=(C=y.metadata.annotations)===null||C===void 0?void 0:C[P.q1],Q=y.metadata.uid,ne=B==="bootstrap:bootstrap",re=(0,wt.default)(async()=>{const qe=E.getLocationByRef(B);let We;if(!B)We=Promise.resolve([]);else{const gt=`metadata.annotations.${P.q1}`;We=E.getEntities({filter:{[gt]:B},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Ot=>Ot.items)}return Promise.all([qe,We]).then(([gt,Ot])=>({location:gt,colocatedEntities:Ot}))},[E,y]),ve=(0,D.useCallback)(async function(){const{location:We}=re.value;await E.removeLocationById(We.id)},[E,re]),Ae=(0,D.useCallback)(async function(){await E.removeEntityByUid(Q)},[E,Q]);if(ne)return{type:"bootstrap",location:B,deleteEntity:Ae};const{loading:Oe,error:De,value:Be}=re;if(Oe)return{type:"loading"};if(De)return{type:"error",error:De};const{location:tt,colocatedEntities:ft}=Be;return tt?{type:"unregister",location:B,colocatedEntities:ft.map(P.iB),unregisterLocation:ve,deleteEntity:Ae}:{type:"only-delete",deleteEntity:Ae}}var io=n(23054);const zo=(0,sn.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),ao=({entity:y,onConfirm:C,onClose:E})=>{const B=(0,p.h_)(p.$v),Q=(0,p.h_)(p.Ds),ne=zo(),re=Yn(y),[ve,Ae]=(0,D.useState)(!1),[Oe,De]=(0,D.useState)(!1);var Be;const tt=(Be=Q.getOptionalString("app.title"))!==null&&Be!==void 0?Be:"Backstage",ft=(0,D.useCallback)(async function(){if("unregisterLocation"in re){De(!0);try{await re.unregisterLocation(),C()}catch(Ot){(0,io.BD)(Ot),B.post({message:Ot.message})}finally{De(!1)}}},[B,C,re]),qe=(0,D.useCallback)(async function(){if("deleteEntity"in re){De(!0);try{await re.deleteEntity(),C()}catch(Ot){(0,io.BD)(Ot),B.post({message:Ot.message})}finally{De(!1)}}},[B,C,re]),We=()=>(0,u.jsx)(vr.Z,{className:ne.dialogActions,children:(0,u.jsx)(V.Z,{onClick:E,color:"primary",children:"Cancel"})});return re.type==="loading"?(0,u.jsx)(T.Ex,{}):re.type==="error"?(0,u.jsx)(T.Gk,{error:re.error}):re.type==="bootstrap"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(Ur.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',re.location,'"). If you believe this is in error, please contact the ',tt," ","integrator."]}),(0,u.jsxs)(L.Z,{marginTop:2,children:[!ve&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(V.Z,{variant:"text",size:"small",color:"primary",className:ne.advancedButton,onClick:()=>Ae(!0),children:"Advanced Options"}),(0,u.jsx)(We,{})]}),ve&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(an.Z,{children:"You have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Oe,onClick:qe,children:"Delete Entity"}),(0,u.jsx)(We,{})]})]})]}):re.type==="only-delete"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(an.Z,{children:"This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog."}),(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Oe,onClick:qe,children:"Delete Entity"}),(0,u.jsx)(We,{})]}):re.type==="unregister"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(an.Z,{children:"This action will unregister the following entities:"}),(0,u.jsx)(an.Z,{component:"ul",children:re.colocatedEntities.map(gt=>(0,u.jsx)("li",{children:(0,u.jsx)(bt,{entityRef:gt})},`${gt.kind}:${gt.namespace}/${gt.name}`))}),(0,u.jsx)(an.Z,{children:"Located at the following location:"}),(0,u.jsx)(an.Z,{component:"ul",children:(0,u.jsx)("li",{children:re.location})}),(0,u.jsxs)(an.Z,{children:["To undo, just re-register the entity in ",tt,"."]}),(0,u.jsxs)(L.Z,{marginTop:2,children:[(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Oe,onClick:ft,children:"Unregister Location"}),!ve&&(0,u.jsx)(L.Z,{component:"span",marginLeft:2,children:(0,u.jsx)(V.Z,{variant:"text",size:"small",color:"primary",className:ne.advancedButton,onClick:()=>Ae(!0),children:"Advanced Options"})})]}),ve&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(L.Z,{paddingTop:4,paddingBottom:4,children:(0,u.jsx)(Mo.Z,{})}),(0,u.jsx)(an.Z,{children:"You also have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Oe,onClick:qe,children:"Delete Entity"})]})]}):(0,u.jsx)(Ur.Z,{severity:"error",children:"Internal error: Unknown state"})},Wo=y=>{const{open:C,onConfirm:E,onClose:B,entity:Q}=y;return(0,u.jsxs)(Xe.Z,{open:C,onClose:B,children:[(0,u.jsx)(Mt.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,u.jsx)(wn.Z,{children:(0,u.jsx)(ao,{entity:Q,onConfirm:E,onClose:B})})]})};var Vo=n(12231),js=n(9520),Ho=n(47603);const lo=(0,sn.Z)(y=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:y.spacing(1,0,1,0)},title:{margin:y.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:y.palette.text.primary},menuItem:{minHeight:y.spacing(6)},groupWrapper:{margin:y.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function Go(y){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:Ho.Z},{id:"starred",label:"Starred",icon:K.Z}]},{name:y!=null?y:"Company",items:[{id:"all",label:"All"}]}]}const bo=y=>{const{initialFilter:C,availableFilters:E}=y,B=lo(),Q=(0,p.h_)(p.Ds);var ne;const re=(ne=Q.getOptionalString("organization.name"))!==null&&ne!==void 0?ne:"Company",{filters:ve,updateFilters:Ae,backendEntities:Oe,queryParameters:{kind:De,user:Be},loading:tt}=ct(),ft=["starred","all"],qe=Go(re).map(Dn=>({...Dn,items:Dn.items.filter(({id:Un})=>["group","user"].some(xr=>xr===De)?ft.includes(Un):!E||E.includes(Un))})).filter(({items:Dn})=>!!Dn.length),{isStarredEntity:We}=_t(),{isOwnedEntity:gt,loading:Ot}=jn(),bn=tt||Ot,Rt=(0,D.useMemo)(()=>new xt("owned",gt,We),[gt,We]),Kt=(0,D.useMemo)(()=>new xt("starred",gt,We),[gt,We]),kt=(0,D.useMemo)(()=>[Be].flat()[0],[Be]),[dn,Bn]=(0,D.useState)(kt!=null?kt:C),Pr=(0,D.useMemo)(()=>Oe.filter((0,G.Gz)((0,lt.compact)(Object.values({...ve,user:void 0})))),[ve,Oe]),dr=(0,D.useMemo)(()=>({all:Pr.length,starred:Pr.filter(Dn=>Kt.filterEntity(Dn)).length,owned:Pr.filter(Dn=>Rt.filterEntity(Dn)).length}),[Pr,Kt,Rt]);(0,D.useEffect)(()=>{kt&&Bn(kt)},[kt]),(0,D.useEffect)(()=>{!bn&&dn&&dn!=="all"&&dr[dn]===0&&Bn("all")},[bn,dr,dn,Bn]),(0,D.useEffect)(()=>{Ae({user:dn?new xt(dn,gt,We):void 0})},[dn,gt,We,Ae]);var Gr;return(0,u.jsx)(Mr.Z,{className:B.root,children:qe.map(Dn=>(0,u.jsxs)(D.Fragment,{children:[(0,u.jsx)(A.Z,{variant:"subtitle2",component:"span",className:B.title,children:Dn.name}),(0,u.jsx)(Mr.Z,{className:B.groupWrapper,children:(0,u.jsx)(yr.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":Dn.name,children:Dn.items.map(Un=>{var xr;return(0,u.jsxs)(Vo.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>Bn(Un.id),selected:Un.id===((xr=ve.user)===null||xr===void 0?void 0:xr.value),className:B.menuItem,disabled:dr[Un.id]===0,"data-testid":`user-picker-${Un.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Un.icon&&(0,u.jsx)(Or.Z,{className:B.listIcon,children:(0,u.jsx)(Un.icon,{fontSize:"small"})}),(0,u.jsx)(to.Z,{children:(0,u.jsxs)(A.Z,{variant:"body1",children:[Un.label," "]})}),(0,u.jsx)(js.Z,{children:(Gr=dr[Un.id])!==null&&Gr!==void 0?Gr:"-"})]},Un.id)})})})]},Dn.name))})},So=(0,sn.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Es=(0,u.jsx)(Nn.Z,{fontSize:"small"}),As=(0,u.jsx)(Pn.Z,{fontSize:"small"}),Ko=()=>{const y=So(),{updateFilters:C}=ct(),[E,B]=(0,D.useState)([]);function Q(ve){C({orphan:ve?new Zt(ve):void 0})}function ne(ve){C({error:ve?new Dt(ve):void 0})}const re=["Is Orphan","Has Error"];return(0,u.jsx)(L.Z,{pb:1,pt:1,children:(0,u.jsxs)(A.Z,{variant:"button",component:"label",children:["Processing Status",(0,u.jsx)(rt.ZP,{multiple:!0,disableCloseOnSelect:!0,options:re,value:E,onChange:(ve,Ae)=>{B(Ae),Q(Ae.includes("Is Orphan")),ne(Ae.includes("Has Error"))},renderOption:(ve,{selected:Ae})=>(0,u.jsx)(Qt.Z,{control:(0,u.jsx)(In.Z,{icon:Es,checkedIcon:As,checked:Ae}),onClick:Oe=>Oe.preventDefault(),label:ve}),size:"small",popupIcon:(0,u.jsx)(Jt.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:ve=>(0,u.jsx)(Ie.Z,{...ve,className:y.input,variant:"outlined"})})]})})},ln=(0,sn.Z)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),Yo=()=>{const y=ln();return(0,u.jsx)(he,{label:"Namespace",name:"namespace",path:"metadata.namespace",Filter:zt,InputProps:{className:y.input}})};function Ts(y){const{children:C,value:E}=y;var B;const[Q,ne]=useState((B=E==null?void 0:E.filters)!==null&&B!==void 0?B:{}),re=useCallback(qe=>{ne(We=>{const gt=typeof qe=="function"?qe(We):qe;return{...We,...gt}})},[]),ve=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Ae,Oe,De,Be,tt;const ft=useMemo(()=>({entities:(Ae=E==null?void 0:E.entities)!==null&&Ae!==void 0?Ae:ve.entities,backendEntities:(Oe=E==null?void 0:E.backendEntities)!==null&&Oe!==void 0?Oe:ve.backendEntities,updateFilters:(De=E==null?void 0:E.updateFilters)!==null&&De!==void 0?De:re,filters:Q,loading:(Be=E==null?void 0:E.loading)!==null&&Be!==void 0?Be:!1,queryParameters:(tt=E==null?void 0:E.queryParameters)!==null&&tt!==void 0?tt:ve.queryParameters,error:E==null?void 0:E.error}),[E,ve,Q,re]);return _jsx(EntityListContext.Provider,{value:ft,children:C})}},75435:function(Ct,ke,n){"use strict";n.d(ke,{h:function(){return p}});var r=n(25271);function p(W,f,z){var g;let u=(W==null||(g=W.relations)===null||g===void 0?void 0:g.filter(D=>D.type===f).map(D=>(0,r.of)(D.targetRef)))||[];return z!=null&&z.kind&&(u=u.filter(D=>D.kind.toLocaleLowerCase("en-US")===z.kind.toLocaleLowerCase("en-US"))),u}},49280:function(Ct,ke,n){"use strict";n.d(ke,{hF:function(){return W.h},CV:function(){return z},wq:function(){return r},Gz:function(){return p}});function r(u){return u.reduce((D,ge)=>({...D,...ge.getCatalogFilters?ge.getCatalogFilters():{}}),{})}function p(u){return D=>u.every(ge=>!ge.filterEntity||ge.filterEntity(D))}var W=n(75435),f=n(25271);function z(u,D){var ge;const de=(ge=u.metadata.annotations)===null||ge===void 0?void 0:ge[f.M6];if(de)try{const V=(0,f.Ou)(de),te=D.byUrl(V.target);return{locationTargetUrl:V.target,integrationType:te==null?void 0:te.type}}catch{return}}function g(u,D){const ge=new Set([...getEntityRelations(u,RELATION_MEMBER_OF,{kind:"group"}),...u?[getCompoundEntityRef(u)]:[]].map(stringifyEntityRef)),de=getEntityRelations(D,RELATION_OWNED_BY).map(stringifyEntityRef);for(const V of de)if(ge.has(V))return!0;return!1}},8799:function(Ct,ke,n){"use strict";n.r(ke),n.d(ke,{AboutCard:function(){return Dt},AboutContent:function(){return xt},AboutField:function(){return _e}});var r=n(52322),p=n(25271),W=n(53974),f=n(60871),z=n(32838),g=n(39709),u=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"TemplateV1beta3","description":"A Template describes a scaffolding task for use with the Scaffolder. It describes the required parameters as well as a series of steps that will be taken to execute the scaffolding task.","examples":[{"apiVersion":"scaffolder.backstage.io/v1beta3","kind":"Template","metadata":{"name":"react-ssr-template","title":"React SSR Template","description":"Next.js application skeleton for creating isomorphic web applications.","tags":["recommended","react"]},"spec":{"owner":"artist-relations-team","parameters":{"required":["name","description","repoUrl"],"backstage:permissions":{"tags":["one","two"]},"properties":{"name":{"title":"Name","type":"string","description":"Unique name of the component"},"description":{"title":"Description","type":"string","description":"Description of the component"},"repoUrl":{"title":"Pick a repository","type":"string","ui:field":"RepoUrlPicker"}}},"steps":[{"id":"fetch","name":"Fetch","action":"fetch:plain","parameters":{"url":"./template"},"backstage:permissions":{"tags":["one","two"]}},{"id":"publish","name":"Publish to GitHub","action":"publish:github","parameters":{"repoUrl":"${{ parameters.repoUrl }}"},"if":"${{ parameters.repoUrl }}"}],"output":{"catalogInfoUrl":"${{ steps.publish.output.catalogInfoUrl }}"}}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["scaffolder.backstage.io/v1beta3"]},"kind":{"enum":["Template"]},"spec":{"type":"object","required":["type","steps"],"properties":{"type":{"type":"string","description":"The type of component created by the template. The software catalog accepts any type value, but an organization should take great care to establish a proper taxonomy for these. Tools including Backstage itself may read this field and behave differently depending on its value. For example, a website type component may present tooling in the Backstage interface that is specific to just websites.","examples":["service","website","library"],"minLength":1},"owner":{"type":"string","description":"The user (or group) owner of the template","minLength":1},"parameters":{"oneOf":[{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}},{"type":"array","description":"A list of separate forms to collect parameters.","items":{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}}]},"steps":{"type":"array","description":"A list of steps to execute.","items":{"type":"object","description":"A description of the step to execute.","required":["action"],"properties":{"id":{"type":"string","description":"The ID of the step, which can be used to refer to its outputs."},"name":{"type":"string","description":"The name of the step, which will be displayed in the UI during the scaffolding process."},"action":{"type":"string","description":"The name of the action to execute."},"input":{"type":"object","description":"A templated object describing the inputs to the action."},"if":{"type":["string","boolean"],"description":"A templated condition that skips the step when evaluated to false. If the condition is true or not defined, the step is executed. The condition is true, if the input is not `false`, `undefined`, `null`, `\\"\\"`, `0`, or `[]`."},"backstage:permissions":{"type":"object","description":"Object used for authorizing the step","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}},"output":{"type":"object","description":"A templated object describing the outputs of the scaffolding task.","properties":{"links":{"type":"array","description":"A list of external hyperlinks, typically pointing to resources created or updated by the template","items":{"type":"object","required":[],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://github.com/my-org/my-new-repo"],"minLength":1},"entityRef":{"type":"string","description":"An entity reference to an entity in the catalog.","examples":["Component:default/my-app"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["View new repo"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1}}}},"text":{"type":"array","description":"A list of Markdown text blobs, like output data from the template.","items":{"type":"object","required":[],"properties":{"title":{"type":"string","description":"A user friendly display name for the text.","examples":["Output Content"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"content":{"type":"string","description":"The text blob to display in the UI, rendered as Markdown.","examples":["**hey** _I\'m_ Markdown"]}}}}},"additionalProperties":{"type":"string"}}}}}}]}');const D=(0,p.wI)(u),ge={async check(et){return D(et)===et}},de=et=>et.apiVersion==="scaffolder.backstage.io/v1beta3"&&et.kind==="Template";var V=n(79692),te=n(94339),L=n(32552),A=n(61837),ae=n(85256),oe=n(24579),ie=n(88188),q=n(52866),H=n(30254),T=n(27604),R=n(2784),P=n(19625),G=n(60905),je=n(7089),Pe=n(90436);const N=(0,V.Z)(et=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:et.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function _e(et){const{label:lt,value:yt,gridSizes:At,children:$t}=et,Gt=N(),xe=(0,f.vJ)($t,Ye=>Ye.getElements()),Ce=xe.length>0?xe:(0,r.jsx)(Pe.Z,{variant:"body2",className:Gt.value,children:yt||"unknown"});return(0,r.jsxs)(G.Z,{item:!0,...At,children:[(0,r.jsx)(Pe.Z,{variant:"h2",className:Gt.label,children:lt}),Ce]})}var at=n(24851);const It=(0,V.Z)({description:{wordBreak:"break-word"}});function zt(et,lt,yt){if(lt==="url"||et.includes("://"))return et;const At=yt.type==="file"?`file://${yt.target}`:yt.target;return lt==="file"||yt.type==="file"?new URL(et,At).href:At}function xt(et){var lt,yt,At,$t,Gt,xe,Ce,Ye;const{entity:Le}=et,ct=It(),wt=Le.kind.toLocaleLowerCase("en-US")==="system",dt=Le.kind.toLocaleLowerCase("en-US")==="resource",Qe=Le.kind.toLocaleLowerCase("en-US")==="component",Ge=Le.kind.toLocaleLowerCase("en-US")==="api",ut=Le.kind.toLocaleLowerCase("en-US")==="template",pt=Le.kind.toLocaleLowerCase("en-US")==="location",hn=Le.kind.toLocaleLowerCase("en-US")==="group",pn=(0,g.hF)(Le,p.cz,{kind:"system"}),fn=(0,g.hF)(Le,p.cz,{kind:"component"}),_t=(0,g.hF)(Le,p.cz,{kind:"domain"}),Sn=(0,g.hF)(Le,p.S4);let Yt;try{Yt=(0,p.CV)(Le)}catch{Yt=void 0}return(0,r.jsxs)(G.Z,{container:!0,children:[(0,r.jsx)(_e,{label:"Description",gridSizes:{xs:12},children:(0,r.jsx)(W.SA,{className:ct.description,content:(Le==null||(lt=Le.metadata)===null||lt===void 0?void 0:lt.description)||"No description"})}),(0,r.jsx)(_e,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:Sn.length>0&&(0,r.jsx)(g.rI,{entityRefs:Sn,defaultKind:"group"})}),(wt||_t.length>0)&&(0,r.jsx)(_e,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:_t.length>0&&(0,r.jsx)(g.rI,{entityRefs:_t,defaultKind:"domain"})}),(Ge||Qe||dt||pn.length>0)&&(0,r.jsx)(_e,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:pn.length>0&&(0,r.jsx)(g.rI,{entityRefs:pn,defaultKind:"system"})}),Qe&&fn.length>0&&(0,r.jsx)(_e,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,r.jsx)(g.rI,{entityRefs:fn,defaultKind:"component"})}),(Ge||Qe||dt||ut||hn||pt||typeof(Le==null||(yt=Le.spec)===null||yt===void 0?void 0:yt.type)=="string")&&(0,r.jsx)(_e,{label:"Type",value:Le==null||(At=Le.spec)===null||At===void 0?void 0:At.type,gridSizes:{xs:12,sm:6,lg:4}}),(Ge||Qe||typeof(Le==null||($t=Le.spec)===null||$t===void 0?void 0:$t.lifecycle)=="string")&&(0,r.jsx)(_e,{label:"Lifecycle",value:Le==null||(Gt=Le.spec)===null||Gt===void 0?void 0:Gt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,r.jsx)(_e,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((Le==null||(xe=Le.metadata)===null||xe===void 0?void 0:xe.tags)||[]).map(rn=>(0,r.jsx)(je.Z,{size:"small",label:rn},rn))}),pt&&((Le==null||(Ce=Le.spec)===null||Ce===void 0?void 0:Ce.targets)||(Le==null||(Ye=Le.spec)===null||Ye===void 0?void 0:Ye.target))&&(0,r.jsx)(_e,{label:"Targets",gridSizes:{xs:12},children:(0,r.jsx)(at.s,{cols:1,items:(Le.spec.targets||[Le.spec.target]).map(rn=>rn).map(rn=>{var jn;return{text:rn,href:zt(rn,(Le==null||(jn=Le.spec)===null||jn===void 0?void 0:jn.type)||"unknown",Yt)}})})})]})}const Zt=(0,V.Z)({gridItemCard:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"},fullHeightCard:{display:"flex",flexDirection:"column",height:"100%"},gridItemCardContent:{flex:1},fullHeightCardContent:{flex:1}});function Dt(et){var lt,yt,At;const{variant:$t}=et,Gt=(0,f.qD)(),xe=Zt(),{entity:Ce}=(0,g.X2)(),Ye=(0,f.h_)(z.q3),Le=(0,f.h_)(g.Ah),ct=(0,f.h_)(f.$v),wt=(0,f.h_)(f.VE),dt=(0,f.tg)(P.jU),Qe=(0,f.tg)(P.ql),Ge=(0,g.CV)(Ce,Ye),ut=(lt=Ce.metadata.annotations)===null||lt===void 0?void 0:lt[p.Tf],pt={label:"View Source",disabled:!Ge,icon:(0,r.jsx)(z.nW,{type:Ge==null?void 0:Ge.integrationType}),href:Ge==null?void 0:Ge.locationTargetUrl},hn={label:"View TechDocs",disabled:!(!((yt=Ce.metadata.annotations)===null||yt===void 0)&&yt["backstage.io/techdocs-ref"])||!dt,icon:(0,r.jsx)(H.Z,{}),href:dt&&dt({namespace:Ce.metadata.namespace||p.zG,kind:Ce.kind,name:Ce.metadata.name})},pn=[pt,hn];if(de(Ce)){var fn;const on=(fn=Gt.getSystemIcon("scaffolder"))!==null&&fn!==void 0?fn:ie.Z,En={label:"Launch Template",icon:(0,r.jsx)(on,{}),disabled:!Qe,href:Qe&&Qe({templateName:Ce.metadata.name,namespace:Ce.metadata.namespace||p.zG})};pn.push(En)}let _t="";$t==="gridItem"?_t=xe.gridItemCard:$t==="fullHeight"&&(_t=xe.fullHeightCard);let Sn="";$t==="gridItem"?Sn=xe.gridItemCardContent:$t==="fullHeight"&&(Sn=xe.fullHeightCardContent);const Yt=(At=Ce.metadata.annotations)===null||At===void 0?void 0:At[p.P1],rn=(Yt==null?void 0:Yt.startsWith("url:"))||(Yt==null?void 0:Yt.startsWith("file:")),jn=(0,R.useCallback)(async()=>{try{await Le.refreshEntity((0,p.eE)(Ce)),ct.post({message:"Refresh scheduled",severity:"info"})}catch(on){wt.post(on)}},[Le,ct,wt,Ce]);return(0,r.jsxs)(te.Z,{className:_t,children:[(0,r.jsx)(L.Z,{title:"About",action:(0,r.jsxs)(r.Fragment,{children:[rn&&(0,r.jsx)(A.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:jn,children:(0,r.jsx)(q.Z,{})}),(0,r.jsx)(A.Z,{component:W.rU,"aria-label":"Edit",disabled:!ut,title:"Edit Metadata",to:ut!=null?ut:"#",children:(0,r.jsx)(T.Z,{})})]}),subheader:(0,r.jsx)(W.M6,{links:pn})}),(0,r.jsx)(ae.Z,{}),(0,r.jsx)(oe.Z,{className:Sn,children:(0,r.jsx)(xt,{entity:Ce})})]})}},86359:function(Ct,ke,n){"use strict";n.d(ke,{E:function(){return H}});var r=n(52322),p=n(25271),W=n(53974),f=n(39709),z=n(90436),g=n(15459),u=n(27604),D=n(2997),ge=n(11640),de=n(28347),V=n(76635),te=n(2784),L=n(7089);const A=Object.freeze({createNameColumn(T){function R(P){var G;return((G=P.metadata)===null||G===void 0?void 0:G.title)||(0,f.$3)(P,{defaultKind:T==null?void 0:T.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:P},{entity:G}){return R(P).localeCompare(R(G))},render:({entity:P})=>{var G;return(0,r.jsx)(f.dx,{entityRef:P,defaultKind:(T==null?void 0:T.defaultKind)||"Component",title:(G=P.metadata)===null||G===void 0?void 0:G.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:T})=>(0,r.jsx)(f.rI,{entityRefs:T.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:T})=>(0,r.jsx)(f.rI,{entityRefs:T.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:T})=>{var R,P;return(0,r.jsx)(r.Fragment,{children:((T==null||(R=T.spec)===null||R===void 0?void 0:R.targets)||(T==null||(P=T.spec)===null||P===void 0?void 0:P.target))&&(0,r.jsx)(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,r.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,r.jsx)(r.Fragment,{children:T.metadata.tags&&T.metadata.tags.map(R=>(0,r.jsx)(L.Z,{label:R,size:"small",variant:"outlined",style:{marginBottom:"0px"}},R))}),width:"auto"}},createTitleColumn(T){return{title:"Title",field:"entity.metadata.title",hidden:T==null?void 0:T.hidden,searchable:!0}},createLabelColumn(T,R){return{title:(R==null?void 0:R.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:P})=>{var G;const je=(G=P.metadata)===null||G===void 0?void 0:G.labels,Pe=je&&je[T]||(R==null?void 0:R.defaultValue);return(0,r.jsx)(r.Fragment,{children:Pe&&(0,r.jsx)(L.Z,{label:Pe,size:"small",variant:"outlined"},Pe)})},width:"auto"}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",width:"auto"}}});var ae=n(19928),oe=n.n(ae);const ie=(0,g.Z)({root:{color:"#f3ba37"}})(ge.Z),q=(T,R)=>{const P=G=>G.metadata.title||(0,f.$3)(G,{defaultKind:"Component"});return P(T).localeCompare(P(R))},H=T=>{var R,P,G,je;const{columns:Pe,actions:N,tableOptions:_e,subtitle:at,emptyContent:It}=T,{isStarredEntity:zt,toggleStarredEntity:xt}=(0,f.CR)(),{loading:Zt,error:Dt,entities:et,filters:lt}=(0,f.wp)(),yt=(0,te.useMemo)(()=>{var Qe;return[A.createTitleColumn({hidden:!0}),A.createNameColumn({defaultKind:(Qe=lt.kind)===null||Qe===void 0?void 0:Qe.value}),...Ge(),A.createMetadataDescriptionColumn(),A.createTagsColumn()];function Ge(){var ut;const pt=[A.createSystemColumn(),A.createOwnerColumn(),A.createSpecTypeColumn(),A.createSpecLifecycleColumn()];switch((ut=lt.kind)===null||ut===void 0?void 0:ut.value){case"user":return[];case"domain":case"system":return[A.createOwnerColumn()];case"group":case"template":return[A.createSpecTypeColumn()];case"location":return[A.createSpecTypeColumn(),A.createSpecTargetsColumn()];default:return et.every(hn=>hn.metadata.namespace==="default")?pt:[...pt,A.createNamespaceColumn()]}}},[(R=lt.kind)===null||R===void 0?void 0:R.value,et]),At=lt.type===void 0;var $t;const Gt=(0,V.capitalize)(($t=(P=lt.user)===null||P===void 0?void 0:P.value)!==null&&$t!==void 0?$t:"all");if(Dt)return(0,r.jsx)("div",{children:(0,r.jsx)(W.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,r.jsx)(W.Oi,{language:"text",text:Dt.toString()})})});const xe=[({entity:Qe})=>{var Ge;const ut=(Ge=Qe.metadata.annotations)===null||Ge===void 0?void 0:Ge[p.l2],pt="View";return{icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z.Z,{variant:"srOnly",children:pt}),(0,r.jsx)(D.Z,{fontSize:"small"})]}),tooltip:pt,disabled:!ut,onClick:()=>{ut&&window.open(ut,"_blank")}}},({entity:Qe})=>{var Ge;const ut=(Ge=Qe.metadata.annotations)===null||Ge===void 0?void 0:Ge[p.Tf],pt="Edit";return{icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z.Z,{variant:"srOnly",children:pt}),(0,r.jsx)(u.Z,{fontSize:"small"})]}),tooltip:pt,disabled:!ut,onClick:()=>{ut&&window.open(ut,"_blank")}}},({entity:Qe})=>{const Ge=zt(Qe),ut=Ge?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z.Z,{variant:"srOnly",children:ut}),Ge?(0,r.jsx)(ie,{}):(0,r.jsx)(de.Z,{})]}),tooltip:ut,onClick:()=>xt(Qe)}}],Ce=et.sort(q).map(Qe=>{const Ge=(0,f.hF)(Qe,p.cz,{kind:"system"}),ut=(0,f.hF)(Qe,p.S4);return{entity:Qe,resolved:{name:(0,f.$3)(Qe,{defaultKind:"Component"}),ownedByRelationsTitle:ut.map(pt=>(0,f.$3)(pt,{defaultKind:"group"})).join(", "),ownedByRelations:ut,partOfSystemRelationTitle:Ge.map(pt=>(0,f.$3)(pt,{defaultKind:"system"})).join(", "),partOfSystemRelations:Ge}}}),Ye=(Pe||yt).find(Qe=>Qe.title==="Type");Ye&&(Ye.hidden=!At);const Le=Ce.length>20,ct=((G=lt.kind)===null||G===void 0?void 0:G.value)||"",wt=((je=lt.type)===null||je===void 0?void 0:je.value)||"",dt=[Gt,wt,oe()(ct)].filter(Qe=>Qe).join(" ");return(0,r.jsx)(W.iA,{isLoading:Zt,columns:Pe||yt,options:{paging:Le,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!Zt,padding:"dense",pageSizeOptions:[20,50,100],..._e},title:`${dt} (${et.length})`,data:Ce,actions:N||xe,subtitle:at,emptyContent:It})};H.columns=A},85877:function(Ct,ke,n){"use strict";n.r(ke),n.d(ke,{EntityLabelsCard:function(){return te},hasLabels:function(){return L}});var r=n(52322),p=n(39709),W=n(2784),f=n(53974),z=n(79692),g=n(90436),u=n(77277);const D=`metadata:
|
|
34
|
-
name: example
|
|
35
|
-
labels:
|
|
36
|
-
javaVersion: 1.2.3`,ge=(0,z.Z)(A=>({code:{borderRadius:6,margin:`${A.spacing(2)}px 0px`,background:A.palette.type==="dark"?"#444":A.palette.common.white}}),{name:"PluginCatalogEntityLabelsEmptyState"});function de(){const A=ge();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g.Z,{variant:"body1",children:"No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:"}),(0,r.jsx)("div",{className:A.code,children:(0,r.jsx)(f.Oi,{text:D,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,r.jsx)(u.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:"Read more"})]})}const V=(0,z.Z)(A=>({key:{fontWeight:"bold"}})),te=A=>{var ae;const{variant:oe,title:ie}=A,{entity:q}=(0,p.X2)(),H=V(),T=[{render:P=>(0,r.jsx)(g.Z,{className:H.key,variant:"body2",children:P.key})},{field:"value"}],R=q==null||(ae=q.metadata)===null||ae===void 0?void 0:ae.labels;return(0,r.jsx)(f.rJ,{title:ie||"Labels",variant:oe,children:!R||Object.keys(R).length===0?(0,r.jsx)(de,{}):(0,r.jsx)(f.iA,{columns:T,data:Object.keys(R).map(P=>({key:P,value:R[P]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(R).length>5}})})};function L(A){var ae,oe;return!(A==null||(ae=A.metadata)===null||ae===void 0)&&ae.labels?Object.keys(A==null||(oe=A.metadata)===null||oe===void 0?void 0:oe.labels).some(Boolean):!1}},24851:function(Ct,ke,n){"use strict";n.d(ke,{s:function(){return ae}});var r=n(52322),p=n(90348),W=n(11861),f=n(2784),z=n(79692),g=n(95544),u=n(90436),D=n(52160),ge=n(53974);const de=(0,z.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function V(oe){const{href:ie,text:q,Icon:H}=oe,T=de();return(0,r.jsxs)(g.Z,{display:"flex",children:[(0,r.jsx)(g.Z,{mr:1,className:T.svgIcon,children:(0,r.jsx)(u.Z,{component:"div",children:H?(0,r.jsx)(H,{}):(0,r.jsx)(D.Z,{})})}),(0,r.jsx)(g.Z,{flexGrow:"1",children:(0,r.jsx)(ge.rU,{to:ie,target:"_blank",rel:"noopener",children:q||ie})})]})}var te=n(41156);const L={xs:1,sm:1,md:1,lg:2,xl:3};function A(oe){const ie=[(0,te.Z)(R=>R.breakpoints.up("xl"))?"xl":null,(0,te.Z)(R=>R.breakpoints.up("lg"))?"lg":null,(0,te.Z)(R=>R.breakpoints.up("md"))?"md":null,(0,te.Z)(R=>R.breakpoints.up("sm"))?"sm":null,(0,te.Z)(R=>R.breakpoints.up("xs"))?"xs":null];let q=1;if(typeof oe=="number")q=oe;else{var H;const R=(H=ie.find(P=>P!==null))!==null&&H!==void 0?H:"xs";var T;q=(T=oe==null?void 0:oe[R])!==null&&T!==void 0?T:L[R]}return q}function ae(oe){const{items:ie,cols:q=void 0}=oe,H=A(q);return(0,r.jsx)(p.Z,{rowHeight:"auto",cols:H,children:ie.map(({text:T,href:R,Icon:P},G)=>(0,r.jsx)(W.Z,{children:(0,r.jsx)(V,{href:R,text:T!=null?T:R,Icon:P})},G))})}},19625:function(Ct,ke,n){"use strict";n.d(ke,{_Z:function(){return z},jU:function(){return W},ql:function(){return f},yw:function(){return p}});var r=n(60871);const p=(0,r.x8)({id:"create-component",optional:!0}),W=(0,r.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),f=(0,r.x8)({id:"create-from-template",optional:!0,params:["namespace","templateName"]}),z=(0,r.NT)({id:"catalog"})},15096:function(Ct,ke,n){"use strict";n.d(ke,{FA:function(){return ge},qO:function(){return yt},Nd:function(){return N},E5:function(){return en},Rx:function(){return R}});var r=n(60871);const p=(0,r.T0)({id:"plugin.search.queryservice"});class W{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(X){_define_property(this,"mockedResults",void 0),this.mockedResults=X}}var f=n(52322),z=n(2784),g=n(38402),u=n(79692);const D=(0,u.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),ge=_=>{const{text:X,preTag:ee,postTag:v}=_,O=D(),J=(0,z.useMemo)(()=>X.split(new RegExp(`(${ee}.+?${v})`)),[v,ee,X]);return(0,f.jsx)(f.Fragment,{children:J.map((M,ue)=>M.includes(ee)?(0,f.jsx)("mark",{className:O.highlight,children:M.replace(new RegExp(`${ee}|${v}`,"g"),"")},ue):M)})};var de=n(50581),V=n(61837),te=n(86619),L=n(77277),A=n(21853),ae=n(48760),oe=n(76635),ie=n(64279),q=n(1849),H=n(51837);const T=(0,H.CT)("search-context"),R=()=>{const _=(0,z.useContext)(T);if(!_)throw new Error("useSearch must be used within a SearchContextProvider");const X=_.atVersion(1);if(!X)throw new Error("No SearchContext v1 found");return X},P=()=>(0,z.useContext)(T)!==void 0,G={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},je=(_=G)=>{var X,ee,v,O;const J=(0,r.h_)(p),[M,ue]=(0,z.useState)(_.term),[ye,Me]=(0,z.useState)(_.types),[ot,ht]=(0,z.useState)(_.filters),[Tt,jt]=(0,z.useState)(_.pageLimit),[st,Ne]=(0,z.useState)(_.pageCursor),Ut=(0,q.Z)(M),qt=(0,q.Z)(ot),bt=(0,ie.default)(()=>J.query({term:M,types:ye,filters:ot,pageLimit:Tt,pageCursor:st}),[M,ye,ot,Tt,st]),Nt=!bt.loading&&!bt.error&&((X=bt.value)===null||X===void 0?void 0:X.nextPageCursor),gn=!bt.loading&&!bt.error&&((ee=bt.value)===null||ee===void 0?void 0:ee.previousPageCursor),Cn=(0,z.useCallback)(()=>{var Lt;Ne((Lt=bt.value)===null||Lt===void 0?void 0:Lt.nextPageCursor)},[(v=bt.value)===null||v===void 0?void 0:v.nextPageCursor]),vt=(0,z.useCallback)(()=>{var Lt;Ne((Lt=bt.value)===null||Lt===void 0?void 0:Lt.previousPageCursor)},[(O=bt.value)===null||O===void 0?void 0:O.previousPageCursor]);return(0,z.useEffect)(()=>{Ut!==void 0&&M!==Ut&&Ne(void 0)},[M,Ut,Ne]),(0,z.useEffect)(()=>{qt!==void 0&&!(0,oe.isEqual)(ot,qt)&&Ne(void 0)},[ot,qt,Ne]),{result:bt,term:M,setTerm:ue,types:ye,setTypes:Me,filters:ot,setFilters:ht,pageLimit:Tt,setPageLimit:jt,pageCursor:st,setPageCursor:Ne,fetchNextPage:Nt?Cn:void 0,fetchPreviousPage:gn?vt:void 0}},Pe=_=>{const{initialState:X,children:ee}=_,v=je(X);return(0,f.jsx)(r.fC,{attributes:{searchTypes:v.types.sort().join(",")},children:(0,f.jsx)(T.Provider,{value:(0,H.EI)({1:v}),children:ee})})},N=_=>{const{initialState:X,inheritParentContextIfAvailable:ee,children:v}=_;return P()&&ee?(0,f.jsx)(f.Fragment,{children:v}):(0,f.jsx)(Pe,{initialState:X,children:v})},_e=({children:_})=>{var X;const ee=ot=>(0,q.Z)(ot)!==ot,v=(0,r.z$)(),{term:O,result:J}=R();var M;const ue=(M=(X=J.value)===null||X===void 0?void 0:X.numberOfResults)!==null&&M!==void 0?M:void 0,Me=ee(J.loading)&&!J.loading;return(0,z.useEffect)(()=>{O&&Me&&v.captureEvent("search",O,{value:ue})},[v,O,ue,Me]),(0,f.jsx)(f.Fragment,{children:_})};function at(_){return(0,z.forwardRef)((X,ee)=>(0,f.jsx)(N,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(_,{...X,ref:ee})}))}const It=at((0,z.forwardRef)((_,X)=>{const{onChange:ee,onKeyDown:v=()=>{},onClear:O=()=>{},onSubmit:J=()=>{},debounceTime:M=200,clearButton:ue=!0,fullWidth:ye=!0,value:Me,label:ot,placeholder:ht,inputProps:Tt={},InputProps:jt={},endAdornment:st,...Ne}=_,Ut=(0,r.h_)(r.Ds),[qt,bt]=(0,z.useState)("");(0,z.useEffect)(()=>{bt(nn=>nn!==Me?String(Me):nn)},[Me]),(0,ae.Z)(()=>ee(qt),M,[qt]);const Nt=(0,z.useCallback)(nn=>{bt(nn.target.value)},[bt]),gn=(0,z.useCallback)(nn=>{v&&v(nn),J&&nn.key==="Enter"&&J()},[v,J]),Cn=(0,z.useCallback)(()=>{ee(""),O&&O()},[ee,O]),vt=ot?void 0:"Search",He=ht!=null?ht:`Search in ${Ut.getOptionalString("app.title")||"Backstage"}`,Lt=(0,f.jsx)(de.Z,{position:"start",children:(0,f.jsx)(V.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,f.jsx)(A.Z,{})})}),xn=(0,f.jsx)(de.Z,{position:"end",children:(0,f.jsx)(L.Z,{"aria-label":"Clear",size:"small",onClick:Cn,onKeyDown:nn=>{nn.key==="Enter"&&nn.stopPropagation()},children:"Clear"})});return(0,f.jsx)(_e,{children:(0,f.jsx)(te.Z,{id:"search-bar-text-field","data-testid":"search-bar-next",variant:"outlined",margin:"normal",inputRef:X,value:qt,label:ot,placeholder:He,InputProps:{startAdornment:Lt,endAdornment:ue?xn:st,...jt},inputProps:{"aria-label":vt,...Tt},fullWidth:ye,onChange:Nt,onKeyDown:gn,...Ne})})})),zt=at((0,z.forwardRef)((_,X)=>{const{value:ee="",onChange:v,...O}=_,{term:J,setTerm:M}=R();(0,z.useEffect)(()=>{ee&&M(String(ee))},[ee,M]);const ue=(0,z.useCallback)(ye=>{v?v(ye):M(ye)},[v,M]);return(0,f.jsx)(r.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,f.jsx)(It,{...O,ref:X,value:J,onChange:ue})})}));var xt=n(4614),Zt=n(88013);const Dt=(0,u.Z)(_=>({loading:{right:_.spacing(1),position:"absolute"}})),et=_=>X=>(0,f.jsx)(N,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(_,{...X})}),lt=()=>{const _=Dt();return(0,f.jsx)(xt.Z,{className:_.loading,"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20})},yt=et(function(X){const{loading:ee,value:v,onChange:O=()=>{},options:J=[],getOptionLabel:M=Nt=>String(Nt),inputPlaceholder:ue,inputDebounceTime:ye,freeSolo:Me=!0,fullWidth:ot=!0,clearOnBlur:ht=!1,"data-testid":Tt="search-autocomplete",...jt}=X,{setTerm:st}=R(),Ne=(0,z.useCallback)(Nt=>Nt?typeof Nt=="string"?Nt:M(Nt):"",[M]),Ut=(0,z.useMemo)(()=>Ne(v),[v,Ne]),qt=(0,z.useCallback)((Nt,gn,Cn,vt)=>{st(Ne(gn)),O(Nt,gn,Cn,vt)},[Ne,st,O]),bt=(0,z.useCallback)(({InputProps:{ref:Nt,className:gn,endAdornment:Cn},InputLabelProps:vt,...He})=>(0,f.jsx)(zt,{...He,ref:Nt,clearButton:!1,value:Ut,placeholder:ue,debounceTime:ye,endAdornment:ee?(0,f.jsx)(lt,{}):Cn,InputProps:{className:gn}}),[ee,Ut,ue,ye]);return(0,f.jsx)(Zt.ZP,{...jt,"data-testid":Tt,value:v,onChange:qt,options:J,getOptionLabel:M,renderInput:bt,freeSolo:Me,fullWidth:ot,clearOnBlur:ht})}),At=_=>{const{icon:X,primaryText:ee,primaryTextTypographyProps:v,secondaryText:O,secondaryTextTypographyProps:J,disableTextTypography:M}=_;return _jsxs(_Fragment,{children:[X?_jsx(ListItemIcon,{children:X}):null,_jsx(ListItemText,{primary:ee,primaryTypographyProps:v,secondary:O,secondaryTypographyProps:J,disableTypography:M})]})};var $t=n(42494),Gt=n(84899),xe=n(5806),Ce=n(21324),Ye=n(56939),Le=n(73698),ct=n(12231),wt=n(90436),dt=n(7089),Qe=n(69294);const Ge=(_,X,ee=[],v=250)=>{const O=(0,z.useRef)({}),J=_||(()=>Promise.resolve([])),[M,ue]=(0,Qe.default)(J,[X],{loading:!0});if((0,ae.Z)(()=>{O.current[X]===void 0&&(O.current[X]=ue(X).then(Me=>(O.current[X]=Me,Me)))},v,[ue,X]),ee.length)return{loading:!1,value:ee};const ye=O.current[X];return Array.isArray(ye)?{loading:!1,value:ye}:M},ut=(_,X)=>{const{setFilters:ee}=R();(0,z.useEffect)(()=>{X&&[X].flat().length>0&&ee(v=>({...v,[_]:X}))},[])},pt=_=>{const{className:X,defaultValue:ee,name:v,values:O,valuesDebounceMs:J,label:M,filterSelectedOptions:ue,limitTags:ye,multiple:Me}=_,[ot,ht]=(0,z.useState)("");ut(v,ee);const Tt=typeof O=="function"?O:void 0,jt=typeof O=="function"?void 0:O,{value:st,loading:Ne}=Ge(Tt,ot,jt,J),{filters:Ut,setFilters:qt}=R(),bt=Ut[v]||(Me?[]:null),Nt=(vt,He)=>{qt(Lt=>{const{[v]:xn,...nn}=Lt;return He?{...nn,[v]:He}:{...nn}})},gn=vt=>(0,f.jsx)(te.Z,{...vt,name:"search",variant:"outlined",label:M,fullWidth:!0}),Cn=(vt,He)=>vt.map((Lt,xn)=>(0,f.jsx)(dt.Z,{label:Lt,color:"primary",...He({index:xn})}));return(0,f.jsx)(Zt.ZP,{filterSelectedOptions:ue,limitTags:ye,multiple:Me,className:X,id:`${Me?"multi-":""}select-filter-${v}--select`,options:st||[],loading:Ne,value:bt,onChange:Nt,onInputChange:(vt,He)=>ht(He),renderInput:gn,renderTags:Cn})},hn=(0,u.Z)({label:{textTransform:"capitalize"},checkboxWrapper:{display:"flex",alignItems:"center",width:"100%"},textWrapper:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),pn=_=>{const{className:X,defaultValue:ee,label:v,name:O,values:J=[],valuesDebounceMs:M}=_,ue=hn(),{filters:ye,setFilters:Me}=R();ut(O,ee);const ot=typeof J=="function"?J:void 0,ht=typeof J=="function"?void 0:J,{value:Tt=[],loading:jt}=Ge(ot,"",ht,M),st=Ut=>{const{target:{value:qt,checked:bt}}=Ut;Me(Nt=>{const{[O]:gn,...Cn}=Nt,vt=(gn||[]).filter(Lt=>Lt!==qt),He=bt?[...vt,qt]:vt;return He.length?{...Cn,[O]:He}:Cn})};var Ne;return(0,f.jsxs)($t.Z,{className:X,disabled:jt,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[v?(0,f.jsx)(Gt.Z,{className:ue.label,children:v}):null,Tt.map(Ut=>(0,f.jsx)(xe.Z,{classes:{root:ue.checkboxWrapper,label:ue.textWrapper},label:Ut,control:(0,f.jsx)(Ce.Z,{color:"primary",inputProps:{"aria-labelledby":Ut},value:Ut,name:Ut,onChange:st,checked:((Ne=ye[O])!==null&&Ne!==void 0?Ne:[]).includes(Ut)})},Ut))]})},fn=_=>{const{className:X,defaultValue:ee,label:v,name:O,values:J,valuesDebounceMs:M}=_,ue=hn();ut(O,ee);const ye=typeof J=="function"?J:void 0,Me=typeof J=="function"?void 0:J,{value:ot=[],loading:ht}=Ge(ye,"",Me,M),{filters:Tt,setFilters:jt}=R(),st=Ne=>{const{target:{value:Ut}}=Ne;jt(qt=>{const{[O]:bt,...Nt}=qt;return Ut?{...Nt,[O]:Ut}:Nt})};return(0,f.jsxs)($t.Z,{disabled:ht,className:X,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[v?(0,f.jsx)(Ye.Z,{className:ue.label,margin:"dense",children:v}):null,(0,f.jsxs)(Le.Z,{variant:"outlined",value:Tt[O]||"",onChange:st,children:[(0,f.jsx)(ct.Z,{value:"",children:(0,f.jsx)("em",{children:"All"})}),ot.map(Ne=>(0,f.jsx)(ct.Z,{value:Ne,children:(0,f.jsx)(wt.Z,{variant:"inherit",noWrap:!0,children:Ne})},Ne))]})]})},_t=_=>{const{component:X,...ee}=_;return(0,f.jsx)(X,{...ee})};_t.Checkbox=_=>(0,f.jsx)(_t,{..._,component:pn}),_t.Select=_=>(0,f.jsx)(_t,{..._,component:fn}),_t.Autocomplete=_=>(0,f.jsx)(_t,{..._,component:pt});var Sn=n(48834).lW;const Yt=_=>Sn.from(_.toString(),"utf-8").toString("base64"),rn=_=>_?Number(Sn.from(_,"base64").toString("utf-8")):0,jn=_=>{const{total:X=-1,cursor:ee,hasNextPage:v,onCursorChange:O,limit:J=25,limitLabel:M="Results per page:",limitText:ue=({from:st,to:Ne})=>X>0?`of ${X}`:`${st}-${Ne}`,limitOptions:ye,onLimitChange:Me,...ot}=_,ht=useMemo(()=>rn(ee),[ee]),Tt=useCallback((st,Ne)=>{O==null||O(Yt(Ne))},[O]),jt=useCallback(st=>{const Ne=st.target.value;Me==null||Me(parseInt(Ne,10))},[Me]);return _jsx(TablePagination,{...ot,component:"div",count:X,page:ht,nextIconButtonProps:{...v!==void 0&&{disabled:!v}},onPageChange:Tt,rowsPerPage:J,labelRowsPerPage:M,labelDisplayedRows:ue,rowsPerPageOptions:ye,onRowsPerPageChange:jt})},on=_=>{const{pageLimit:X,setPageLimit:ee,pageCursor:v,setPageCursor:O,fetchNextPage:J}=useSearch(),M=useCallback(ue=>{ee(ue),O(void 0)},[ee,O]);return _jsx(jn,{..._,hasNextPage:!!J,limit:X,onLimitChange:M,cursor:v,onCursorChange:O})};var En=n(53974);const Fn=_=>{const{children:X}=_,ee=useSearch(),{result:v,...O}=ee;return X(v,O)},nt=_=>{const{query:X,children:ee}=_,v=useApi(searchApiRef),O=useAsync(()=>{const{term:J="",types:M=[],filters:ue={},...ye}=X;return v.query({...ye,term:J,types:M,filters:ue})},[X]);return ee(O,X)},sn=_=>{const{query:X,children:ee}=_;return X?_jsx(nt,{query:X,children:ee}):_jsx(Fn,{children:ee})},Jt=_=>{const{query:X,children:ee,noResultsComponent:v=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...O}=_;return _jsx(sn,{query:X,children:({loading:J,error:M,value:ue})=>J?_jsx(Progress,{}):M?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:M}):ue!=null&&ue.results.length?isFunction(ee)?ee(ue):_jsx(SearchResultListItemExtensions,{...O,results:ue.results,children:ee}):v})},rt=_=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(Jt,{..._})}),In=({result:_,highlight:X,icon:ee,secondaryAction:v,lineClamp:O=5})=>_?_jsxs(_Fragment,{children:[ee&&_jsx(ListItemIcon,{children:ee}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:_.location,children:X!=null&&X.fields.title?_jsx(HighlightedSearchResultText,{text:(X==null?void 0:X.fields.title)||"",preTag:(X==null?void 0:X.preTag)||"",postTag:(X==null?void 0:X.postTag)||""}):_.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:O,overflow:"hidden"},color:"textSecondary",variant:"body2",children:X!=null&&X.fields.text?_jsx(HighlightedSearchResultText,{text:X.fields.text,preTag:X.preTag,postTag:X.postTag}):_.text})}),v&&_jsx(Box,{alignItems:"flex-end",children:v})]}):null,Qt=_=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(In,{..._})}),Pn=_=>{const{error:X,loading:ee,resultItems:v,renderResultItem:O=ye=>_jsx(DefaultResultListItem,{result:ye.document},ye.document.location),disableRenderingWithNoResults:J,noResultsComponent:M=J?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...ue}=_;return ee?_jsx(Progress,{}):X?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:X}):v!=null&&v.length?_jsx(List,{...ue,children:v.map(O)}):_jsx(_Fragment,{children:M})},Nn=_=>{const{query:X,renderResultItem:ee,children:v,...O}=_,J=useSearchResultListItemExtensions(v);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:X,children:({loading:M,error:ue,value:ye})=>_jsx(Pn,{...O,error:ue,loading:M,resultItems:ye==null?void 0:ye.results,renderResultItem:ee!=null?ee:J})})})};var Ln=n(19126);const Zn=(0,u.Z)(_=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:_.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:_.palette.text.secondary,margin:_.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:_.palette.text.secondary,margin:_.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:_.spacing(.5)}})),Se=_=>{const X=Zn(),{label:ee,children:v,...O}=_;return _jsx(Chip,{...O,className:X.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[ee,": ",v]})})},ce=()=>null,Ie=(0,u.Z)(_=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:_.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:_.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),Ue=_=>{const X=Ie(),{label:ee,value:v="None",onChange:O,onDelete:J}=_,M=useCallback(ue=>{O(ue.target.value)},[O]);return _jsx(Se,{label:ee,onDelete:J,children:_jsx(Typography,{role:"textbox",component:"span",className:X.root,onChange:M,contentEditable:!0,suppressContentEditableWarning:!0,children:v})})},Ve=(0,u.Z)(_=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:_.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),le=_=>{const X=Ve(),{label:ee,value:v="none",onChange:O,onDelete:J,children:M}=_,ue=useCallback(ye=>{O(ye.target.value)},[O]);return _jsx(Se,{label:ee,onDelete:J,children:_jsxs(Select,{className:X.root,value:v,onChange:ue,input:_jsx(InputBase,{}),IconComponent:ce,children:[_jsx(MenuItem,{value:"none",children:"None"}),M]})})};function U(_){const X=Zn(),[ee,v]=useState(null),{error:O,loading:J,icon:M,title:ue,titleProps:ye={},link:Me=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:X.listSubheaderLinkIcon})]}),linkProps:ot={},filterOptions:ht,renderFilterOption:Tt=He=>_jsx(MenuItem,{value:String(He),children:He},String(He)),filterFields:jt,renderFilterField:st,resultItems:Ne,renderResultItem:Ut=He=>_jsx(DefaultResultListItem,{result:He.document},He.document.location),disableRenderingWithNoResults:qt,noResultsComponent:bt=qt?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Nt}=_,gn=useCallback(He=>{v(He.currentTarget)},[]),Cn=useCallback(()=>{v(null)},[]);if(J)return _jsx(Progress,{});if(O)return _jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:O});if(!(Ne!=null&&Ne.length))return _jsx(_Fragment,{children:bt});var vt;return _jsxs(List,{...Nt,children:[_jsxs(ListSubheader,{className:X.listSubheader,children:[M,_jsx(Typography,{className:X.listSubheaderName,component:"strong",...ye,children:ue}),ht?_jsx(Chip,{className:X.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:gn}):null,ht?_jsx(Menu,{id:"filters-menu",anchorEl:ee,open:Boolean(ee),onClose:Cn,onClick:Cn,keepMounted:!0,children:ht.map(Tt)}):null,jt==null?void 0:jt.map(He=>(vt=st==null?void 0:st(He))!==null&&vt!==void 0?vt:null),_jsx(Link,{className:X.listSubheaderLink,to:"/search",...ot,children:Me})]}),Ne.map(Ut)]})}function he(_){const{query:X,children:ee,renderResultItem:v,linkProps:O={},...J}=_,M=useSearchResultListItemExtensions(ee);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:X,children:({loading:ue,error:ye,value:Me},{term:ot,types:ht,pageCursor:Tt,filters:jt={}})=>{const st=`/search?${qs.stringify({term:ot,types:ht,filters:jt,pageCursor:Tt,query:ot},{arrayFormat:"brackets"})}`;return _jsx(U,{...J,error:ye,loading:ue,linkProps:{to:st,...O},filterFields:Object.keys(jt),resultItems:Me==null?void 0:Me.results,renderResultItem:v!=null?v:M})}})})}const $e=(0,u.Z)(_=>({root:{display:"flex",justifyContent:"space-between",gap:_.spacing(2),margin:_.spacing(2,0)}})),Ke=()=>{const{fetchNextPage:_,fetchPreviousPage:X}=useSearch(),ee=$e();return!_&&!X?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:ee.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!X,onClick:X,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!_,onClick:_,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},Je="search.results.list.items.extensions.v1",Ft=(_,X)=>{for(const ee of _){if(!isValidElement(ee))continue;const v=getComponentData(ee,Je);if(v!=null&&v(X))return cloneElement(ee,{rank:X.rank,highlight:X.highlight,result:X.document,...ee.props})}return null},Vt=_=>{const{rank:X,result:ee,noTrack:v,children:O,alignItems:J="flex-start",...M}=_,ue=(0,r.z$)(),ye=(0,z.useCallback)(()=>{v||ee&&ue.captureEvent("discover",ee.title,{attributes:{to:ee.location},value:X})},[X,ee,v,ue]);return(0,f.jsx)(g.Z,{divider:!0,alignItems:J,onClickCapture:ye,...M,children:O})},en=_=>{const{name:X,component:ee,predicate:v=()=>!0}=_;return(0,r.YO)({name:X,component:{lazy:()=>ee().then(O=>J=>(0,f.jsx)(Vt,{rank:J.rank,result:J.result,noTrack:J.noTrack,children:(0,z.createElement)(O,J)}))},data:{[Je]:v}})},Xt=_=>{const X=useElementFilter(_,ee=>ee.selectByComponentData({key:Je}).getElements(),[_]);return useCallback((ee,v)=>{const O=Ft(X,ee);return _jsx(Fragment,{children:O!=null?O:_jsx(Vt,{rank:ee.rank,result:ee.document,children:_jsx(DefaultResultListItem,{rank:ee.rank,highlight:ee.highlight,result:ee.document})})},v)},[X])},tn=_=>{const{results:X,children:ee,...v}=_,O=Xt(ee);return _jsx(List,{...v,children:X.map(O)})}},61886:function(Ct,ke,n){"use strict";n.d(ke,{Ox:function(){return xt},jM:function(){return z},Zz:function(){return g},oZ:function(){return N},DR:function(){return u},ZS:function(){return je},VA:function(){return et},KY:function(){return ge},gT:function(){return A},Dl:function(){return ae},ux:function(){return Dt},$L:function(){return L},x1:function(){return Pe}});var r=n(52322),p=n(2784),W=n(73557),f=n(60871);const z="techdocs.addons.addon.v1",g="techdocs.addons.wrapper.v1",u=()=>null;(0,f.R5)(u,g,!0);const D=xe=>`${z}.${xe.toLocaleLowerCase("en-US")}`;function ge(xe){const{name:Ce,component:Ye}=xe;return(0,f.YO)({name:Ce,component:{sync:Le=>(0,r.jsx)(Ye,{...Le})},data:{[z]:xe,[D(Ce)]:!0}})}const de=(xe,Ce)=>xe.selectByComponentData({key:Ce}).getElements()[0],V=xe=>xe.selectByComponentData({key:g}).selectByComponentData({key:z}),te=xe=>xe.selectByComponentData({key:g}).findComponentData({key:z}),L=()=>{const xe=(0,W.pC)(),Ce=(0,f.vJ)(xe,V),Ye=(0,f.vJ)(xe,te),Le=(0,p.useCallback)(dt=>{if(!Ce||!dt)return null;const Qe=D(dt.name);var Ge;return(Ge=de(Ce,Qe))!==null&&Ge!==void 0?Ge:null},[Ce]),ct=(0,p.useCallback)(dt=>{const Qe=Ye.find(Ge=>Ge.name===dt);return Qe?Le(Qe):null},[Ye,Le]),wt=(0,p.useCallback)(dt=>{const Qe=Ye.filter(Ge=>Ge.location===dt);return Qe.length?Qe.map(Le):null},[Ye,Le]);return{renderComponentByName:ct,renderComponentsByLocation:wt}},A=(0,f.T0)({id:"plugin.techdocs.service"}),ae=(0,f.T0)({id:"plugin.techdocs.storageservice"});var oe=n(64279),ie=n(77446),q=n(25271),H=n(51837);function T(xe,Ce){return Ce.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(xe.kind=xe.kind.toLocaleLowerCase(),xe.name=xe.name.toLocaleLowerCase(),xe.namespace=xe.namespace.toLocaleLowerCase()),xe}const R=(xe,Ce)=>(0,q.eE)(xe)===(0,q.eE)(Ce),P={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},G=(0,H.CT)("techdocs-reader-page-context"),je=(0,p.memo)(xe=>{const{entityRef:Ce,children:Ye}=xe,Le=(0,f.h_)(A),ct=(0,f.h_)(f.Ds),wt=(0,oe.default)(async()=>Le.getEntityMetadata(Ce),[Ce]),dt=(0,ie.Z)(async()=>Le.getTechDocsMetadata(Ce),[Ce]),[Qe,Ge]=(0,p.useState)(P.title),[ut,pt]=(0,p.useState)(P.subtitle),[hn,pn]=(0,p.useState)(P.shadowRoot);(0,p.useEffect)(()=>{hn&&!dt.value&&!dt.loading&&dt.retry()},[dt.value,dt.loading,hn,dt.retry,dt]);const fn={metadata:dt,entityRef:T(Ce,ct),entityMetadata:wt,shadowRoot:hn,setShadowRoot:pn,title:Qe,setTitle:Ge,subtitle:ut,setSubtitle:pt},_t=(0,H.EI)({1:fn});return(0,r.jsx)(f.fC,{attributes:{entityRef:(0,q.eE)(Ce)},children:(0,r.jsx)(G.Provider,{value:_t,children:Ye instanceof Function?Ye(fn):Ye})})},(xe,Ce)=>R(xe.entityRef,Ce.entityRef)),Pe=()=>{const xe=(0,p.useContext)(G);if(xe===void 0)return P;const Ce=xe.atVersion(1);if(Ce===void 0)throw new Error("No context found for version 1.");return Ce},N=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var _e=n(70882),at=n(50236),It=n(19219),zt=n(53974);const xt="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",Zt=xe=>{(0,p.useEffect)(()=>{if(!xe)return()=>{};const Ce=xe.querySelectorAll('head > link[rel="stylesheet"]');var Ye;let Le=(Ye=Ce==null?void 0:Ce.length)!==null&&Ye!==void 0?Ye:0;const ct=new CustomEvent(xt);if(!Le)return xe.dispatchEvent(ct),()=>{};const wt=()=>{--Le===0&&xe.dispatchEvent(ct)};return Ce==null||Ce.forEach(dt=>{dt.addEventListener("load",wt)}),()=>{Ce==null||Ce.forEach(dt=>{dt.removeEventListener("load",wt)})}},[xe])},Dt=xe=>{const[Ce,Ye]=(0,p.useState)(!1);return(0,p.useEffect)(()=>{if(!xe)return()=>{};Ye(!0);const Le=xe.style;Le.setProperty("opacity","0");const ct=()=>{Ye(!1),Le.setProperty("opacity","1")};return xe.addEventListener(xt,ct),()=>{xe.removeEventListener(xt,ct)}},[xe]),Ce},et=xe=>{const{element:Ce,onAppend:Ye,children:Le}=xe,[ct,wt]=(0,p.useState)((0,_e.Ue)({...(0,at.Z)(),insertionPoint:void 0}));Zt(Ce);const dt=Dt(Ce),Qe=(0,p.useCallback)(Ge=>{if(!Ce||!Ge)return;wt((0,_e.Ue)({...(0,at.Z)(),insertionPoint:Ce.querySelector("head")||void 0}));let ut=Ge.shadowRoot;ut||(ut=Ge.attachShadow({mode:"open"})),ut.replaceChildren(Ce),typeof Ye=="function"&&Ye(ut)},[Ce,Ye]);return(0,r.jsxs)(r.Fragment,{children:[dt&&(0,r.jsx)(zt.Ex,{}),(0,r.jsxs)(It.ZP,{jss:ct,sheetsManager:new Map,children:[(0,r.jsx)("div",{ref:Qe,"data-testid":"techdocs-native-shadowroot"}),Le]})]})};var lt=n(54073);const yt=()=>{const{shadowRoot:xe}=useTechDocsReaderPage();return xe},At=xe=>{const Ce=yt();return Ce?xe.map(Ye=>Ce==null?void 0:Ce.querySelectorAll(Ye)).filter(Ye=>Ye.length).map(Ye=>Array.from(Ye)).flat():[]},$t=xe=>xe.toString()&&xe.rangeCount&&xe.getRangeAt(0).getBoundingClientRect().top,Gt=(xe=0)=>{const Ce=yt(),[Ye,Le]=useState(null),ct=useMemo(()=>debounce(()=>{const wt=Ce,dt=wt.getSelection?wt.getSelection():document.getSelection();dt&&$t(dt)?Le(dt):Le(null)},xe),[Ce,Le,xe]);return useEffect(()=>(window.document.addEventListener("selectionchange",ct),()=>{ct.cancel(),window.document.removeEventListener("selectionchange",ct)}),[ct]),Ye}},52943:function(Ct,ke,n){"use strict";n.r(ke),n.d(ke,{EmbeddedDocsRouter:function(){return oe},Router:function(){return ae},isTechDocsAvailable:function(){return A}});var r=n(52322),p=n(2784),W=n(73557),f=n(39709),z=n(53974),g=n(25271),u=n(89258),D=n(65124),ge=n(86317);const de=({entity:ie})=>{const q=(0,g.iB)(ie);return(0,r.jsxs)(u.I6,{entityRef:q,children:[(0,r.jsx)(D.b,{}),(0,r.jsx)(ge.F,{withSearch:!1})]})};var V=n(18662),te=n(7476);const L="backstage.io/techdocs-ref",A=ie=>{var q,H;return Boolean(ie==null||(q=ie.metadata)===null||q===void 0||(H=q.annotations)===null||H===void 0?void 0:H[L])},ae=()=>(0,r.jsxs)(W.Z5,{children:[(0,r.jsx)(W.AW,{path:"/",element:(0,r.jsx)(V.TechDocsIndexPage,{})}),(0,r.jsx)(W.AW,{path:"/:namespace/:kind/:name/*",element:(0,r.jsx)(te.TechDocsReaderPage,{})})]}),oe=ie=>{var q;const{children:H}=ie,{entity:T}=(0,f.X2)(),R=(0,W.V$)([{path:"/*",element:(0,r.jsx)(de,{entity:T}),children:[{path:"*",element:H}]}]);return((q=T.metadata.annotations)===null||q===void 0?void 0:q[L])?R:(0,r.jsx)(z.sk,{annotation:L})}},92077:function(Ct,ke,n){"use strict";n.d(ke,{k:function(){return g},p:function(){return z}});var r=n(87612),p=n(23054),W=n(54847),f=n.n(W);class z{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(D){const{kind:ge,namespace:de,name:V}=D,L=`${await this.getApiOrigin()}/metadata/techdocs/${de}/${ge}/${V}`,A=await this.fetchApi.fetch(`${L}`);if(!A.ok)throw await p.VL.fromResponse(A);return await A.json()}async getEntityMetadata(D){const{kind:ge,namespace:de,name:V}=D,L=`${await this.getApiOrigin()}/metadata/entity/${de}/${ge}/${V}`,A=await this.fetchApi.fetch(`${L}`);if(!A.ok)throw await p.VL.fromResponse(A);return await A.json()}constructor(D){(0,r._)(this,"configApi",void 0),(0,r._)(this,"discoveryApi",void 0),(0,r._)(this,"fetchApi",void 0),this.configApi=D.configApi,this.discoveryApi=D.discoveryApi,this.fetchApi=D.fetchApi}}class g{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var D;return(D=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&D!==void 0?D:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(D,ge){const{kind:de,namespace:V,name:te}=D,A=`${await this.getStorageUrl()}/${V}/${de}/${te}/${ge}`,ae=await this.fetchApi.fetch(`${A.endsWith("/")?A:`${A}/`}index.html`);let oe="";switch(ae.status){case 404:throw oe="Page not found. ",ge||(oe+="This could be because there is no index.md file in the root of the docs directory of this repository."),new p.dR(oe);case 500:throw oe="Could not generate documentation or an error in the TechDocs backend. ",new Error(oe);default:break}return ae.text()}async syncEntityDocs(D,ge=()=>{}){const{kind:de,namespace:V,name:te}=D,A=`${await this.getApiOrigin()}/sync/${V}/${de}/${te}`,{token:ae}=await this.identityApi.getCredentials();return new Promise((oe,ie)=>{const q=new W.EventSourcePolyfill(A,{withCredentials:!0,headers:ae?{Authorization:`Bearer ${ae}`}:{}});q.addEventListener("log",H=>{H.data&&ge(JSON.parse(H.data))}),q.addEventListener("finish",H=>{let T=!1;H.data&&({updated:T}=JSON.parse(H.data)),oe(T?"updated":"cached")}),q.onerror=H=>{switch(q.close(),H.status){case 404:ie(new p.dR(H.message));return;default:ie(new Error(H.data));return}}})}async getBaseUrl(D,ge,de){const{kind:V,namespace:te,name:L}=ge,ae=`${await this.getApiOrigin()}/static/docs/${te}/${V}/${L}/${de}`;return new URL(D,ae.endsWith("/")?ae:`${ae}/`).toString()}constructor(D){(0,r._)(this,"configApi",void 0),(0,r._)(this,"discoveryApi",void 0),(0,r._)(this,"identityApi",void 0),(0,r._)(this,"fetchApi",void 0),this.configApi=D.configApi,this.discoveryApi=D.discoveryApi,this.identityApi=D.identityApi,this.fetchApi=D.fetchApi}}},51953:function(Ct,ke,n){"use strict";n.d(ke,{D:function(){return r}});function r(p,W){return W.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?p:p.toLocaleLowerCase("en-US")}},3482:function(Ct,ke,n){"use strict";n.d(ke,{u:function(){return D}});var r=n(52322),p=n(2784),W=n(53974),f=n(39709),z=n(42081),g=n(48431),u=n(68435);const D=ge=>{const{initialFilter:de="owned",columns:V,actions:te}=ge;return(0,r.jsx)(z.j,{children:(0,r.jsxs)(W.VY,{children:[(0,r.jsx)(W.yW,{title:"",children:(0,r.jsx)(W.qt,{children:"Discover documentation in your ecosystem."})}),(0,r.jsx)(f.UO,{children:(0,r.jsxs)(f._i,{children:[(0,r.jsxs)(f._i.Filters,{children:[(0,r.jsx)(g.f,{}),(0,r.jsx)(f.EW,{initialFilter:de}),(0,r.jsx)(f.dq,{}),(0,r.jsx)(f.xE,{})]}),(0,r.jsx)(f._i.Content,{children:(0,r.jsx)(u.n,{actions:te,columns:V})})]})})]})})}},85478:function(Ct,ke,n){"use strict";n.d(ke,{f:function(){return V}});var r=n(52322),p=n(95573),W=n(51953),f=n(60871),z=n(53974),g=n(94339),u=n(16111),D=n(24579),ge=n(14503),de=n(2784);const V=oe=>{const{entities:ie}=oe,q=(0,f.tg)(p.Fw),H=(0,f.h_)(f.Ds);if(!ie)return null;var T,R;return(0,r.jsx)(z.Oh,{"data-testid":"docs-explore",children:ie!=null&&ie.length?ie.map((P,G)=>(0,r.jsxs)(g.Z,{children:[(0,r.jsx)(u.Z,{children:(0,r.jsx)(z.hu,{title:(T=P.metadata.title)!==null&&T!==void 0?T:P.metadata.name})}),(0,r.jsx)(D.Z,{children:P.metadata.description}),(0,r.jsx)(ge.Z,{children:(0,r.jsx)(z.Qj,{to:q({namespace:(0,W.D)((R=P.metadata.namespace)!==null&&R!==void 0?R:"default",H),kind:(0,W.D)(P.kind,H),name:(0,W.D)(P.metadata.name,H)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},G)):null})};var te=n(39709);const L={title:"All Documentation",filterPredicate:()=>!0},A=oe=>{const{entities:ie,group:q}=oe,{loading:H,isOwnedEntity:T}=useEntityOwnership(),R=ie.filter(G=>q.filterPredicate==="ownedByUser"?H?!1:T(G):typeof q.filterPredicate=="function"&&q.filterPredicate(G)),P=(()=>typeof q.title=="string"?_jsx(ContentHeader,{title:q.title}):q.title)();return R.length===0?null:_jsxs(Content,{children:[P,_jsx(DocsCardGrid,{entities:R})]})},ae=oe=>{const{loading:ie,error:q,entities:H}=useEntityList();if(q)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:q.toString()})});if(ie)return _jsx(Progress,{});if(H.length===0)return _jsx("div",{"data-testid":"doc-not-found",children:_jsxs(Typography,{variant:"body2",children:["No documentation found that match your filter. Learn more about"," ",_jsx(Link,{to:"https://backstage.io/docs/features/techdocs/creating-and-publishing",children:"publishing documentation"}),"."]})});var T,R;return H.sort((P,G)=>((T=P.metadata.title)!==null&&T!==void 0?T:P.metadata.name).localeCompare((R=G.metadata.title)!==null&&R!==void 0?R:G.metadata.name)),_jsx(Content,{children:(oe.groups||[L]).map((P,G)=>_jsx(A,{entities:H,group:P},`${P.title}-${G}`))})}},68435:function(Ct,ke,n){"use strict";n.d(ke,{H:function(){return H},n:function(){return T}});var r=n(52322),p=n(2784),W=n(95074),f=n(76635),z=n(53974),g=n(39709),u=n(60871),D=n(25271),ge=n(95573),de=n(39981),V=n(2337),te=n(11640),L=n(28347);const A=(0,V.Z)({root:{color:"#f3ba37"}})(te.Z),ae={createCopyDocsUrlAction(R){return P=>({icon:()=>(0,r.jsx)(de.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>R(`${window.location.origin}${P.resolved.docsUrl}`)})},createStarEntityAction(R,P){return G=>{const je=G.entity,Pe=R(je);return{cellStyle:{paddingLeft:"1em"},icon:()=>Pe?(0,r.jsx)(A,{}):(0,r.jsx)(L.Z,{}),tooltip:Pe?"Remove from favorites":"Add to favorites",onClick:()=>P(je)}}}};function oe(R){return R.metadata.title||R.metadata.name}const ie={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:R=>(0,r.jsx)(z.uw,{value:(0,r.jsx)(z.rU,{to:R.resolved.docsUrl,children:oe(R.entity)}),subvalue:R.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:R})=>(0,r.jsx)(g.rI,{entityRefs:R.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var q=n(51953);const H=R=>{const{entities:P,title:G,loading:je,columns:Pe,actions:N,options:_e}=R,[,at]=(0,W.Z)(),It=(0,u.tg)(ge.Fw),zt=(0,u.h_)(u.Ds);if(!P)return null;const xt=P.map(et=>{const lt=(0,g.hF)(et,D.S4);var yt;return{entity:et,resolved:{docsUrl:It({namespace:(0,q.D)((yt=et.metadata.namespace)!==null&&yt!==void 0?yt:"default",zt),kind:(0,q.D)(et.kind,zt),name:(0,q.D)(et.metadata.name,zt)}),ownedByRelations:lt,ownedByRelationsTitle:lt.map(At=>(0,g.$3)(At,{defaultKind:"group"})).join(", ")}}}),Zt=[ie.createNameColumn(),ie.createOwnerColumn(),ie.createTypeColumn()],Dt=[ae.createCopyDocsUrlAction(at)];return(0,r.jsx)(r.Fragment,{children:je||xt&&xt.length>0?(0,r.jsx)(z.iA,{isLoading:je,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1,..._e},data:xt,columns:Pe||Zt,actions:N||Dt,title:G?`${G} (${xt.length})`:`All (${xt.length})`}):(0,r.jsx)(z.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,r.jsx)(z.Qj,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};H.columns=ie,H.actions=ae;const T=R=>{var P;const{columns:G,actions:je,options:Pe}=R,{loading:N,error:_e,entities:at,filters:It}=(0,g.wp)(),{isStarredEntity:zt,toggleStarredEntity:xt}=(0,g.CR)(),[,Zt]=(0,W.Z)();var Dt;const et=(0,f.capitalize)((Dt=(P=It.user)===null||P===void 0?void 0:P.value)!==null&&Dt!==void 0?Dt:"all"),lt=[ae.createCopyDocsUrlAction(Zt),ae.createStarEntityAction(zt,xt)];return _e?(0,r.jsx)(z.GB,{severity:"error",title:"Could not load available documentation.",children:(0,r.jsx)(z.Oi,{language:"text",text:_e.toString()})}):(0,r.jsx)(H,{title:et,entities:at,loading:N,actions:je||lt,columns:G,options:Pe})};T.columns=ie,T.actions=ae},18662:function(Ct,ke,n){"use strict";n.r(ke),n.d(ke,{TechDocsIndexPage:function(){return z}});var r=n(52322),p=n(2784),W=n(73557),f=n(3482);const z=g=>(0,W.pC)()||(0,r.jsx)(f.u,{...g})},42081:function(Ct,ke,n){"use strict";n.d(ke,{j:function(){return z}});var r=n(52322),p=n(2784),W=n(53974),f=n(60871);const z=g=>{const{children:u}=g,D=(0,f.h_)(f.Ds);var ge;const de=`Documentation available in ${(ge=D.getOptionalString("organization.name"))!==null&&ge!==void 0?ge:"Backstage"}`;return(0,r.jsx)(W.g9,{title:"Documentation",subtitle:de,themeId:"documentation",children:u})}},48431:function(Ct,ke,n){"use strict";n.d(ke,{f:function(){return f}});var r=n(2784),p=n(39709);class W{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":p.n3}}}const f=()=>{const{updateFilters:z}=(0,p.wp)();return(0,r.useEffect)(()=>{z({techdocs:new W})},[z]),null}},89258:function(Ct,ke,n){"use strict";n.d(ke,{I6:function(){return V},Jl:function(){return de},s4:function(){return g}});var r=n(61886),p=n(92077),W=n(95573),f=n(60871),z=n(15096);const g=(0,f.rx)({id:"techdocs",apis:[(0,f.ni)({api:r.Dl,deps:{configApi:f.Ds,discoveryApi:f.NW,identityApi:f.$4,fetchApi:f.gP},factory:({configApi:L,discoveryApi:A,identityApi:ae,fetchApi:oe})=>new p.k({configApi:L,discoveryApi:A,identityApi:ae,fetchApi:oe})}),(0,f.ni)({api:r.gT,deps:{configApi:f.Ds,discoveryApi:f.NW,fetchApi:f.gP},factory:({configApi:L,discoveryApi:A,fetchApi:ae})=>new p.p({configApi:L,discoveryApi:A,fetchApi:ae})})],routes:{root:W._Z,docRoot:W.Fw,entityContent:W.pd}}),u=g.provide((0,f.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(n.bind(n,52943)).then(L=>L.Router),mountPoint:W._Z})),D=g.provide((0,f.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(n.bind(n,52943)).then(L=>L.EmbeddedDocsRouter),mountPoint:W.pd})),ge=g.provide((0,f.P4)({name:"TechDocsCustomHome",component:()=>n.e(7560).then(n.bind(n,27560)).then(L=>L.TechDocsCustomHome),mountPoint:W._Z})),de=g.provide((0,f.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(n.bind(n,18662)).then(L=>L.TechDocsIndexPage),mountPoint:W._Z})),V=g.provide((0,f.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(n.bind(n,7476)).then(L=>L.TechDocsReaderPage),mountPoint:W.Fw})),te=g.provide((0,z.E5)({name:"TechDocsSearchResultListItem",component:()=>Promise.resolve().then(n.bind(n,55511)).then(L=>L.TechDocsSearchResultListItem),predicate:L=>L.type==="techdocs"}))},7476:function(Ct,ke,n){"use strict";n.r(ke),n.d(ke,{TechDocsReaderLayout:function(){return V},TechDocsReaderPage:function(){return te}});var r=n(52322),p=n(2784),W=n(73557),f=n(53974),z=n(61886),g=n(86317),u=n(93225),D=n(65124),ge=n(95573),de=n(60871);const V=L=>{const{withSearch:A,withHeader:ae=!0}=L;return(0,r.jsxs)(f.T3,{themeId:"documentation",children:[ae&&(0,r.jsx)(u.S,{}),(0,r.jsx)(D.b,{}),(0,r.jsx)(g.F,{withSearch:A})]})},te=L=>{const{kind:A,name:ae,namespace:oe}=(0,de.Oi)(ge.Fw),{children:ie,entityRef:q={kind:A,name:ae,namespace:oe}}=L,H=(0,W.pC)();if(!ie){const R=H?p.Children.toArray(H.props.children):[];var T;const G=R.flatMap(je=>{var Pe;return(T=je==null||(Pe=je.props)===null||Pe===void 0?void 0:Pe.children)!==null&&T!==void 0?T:[]}).find(je=>!(0,de.IY)(je,z.Zz)&&!(0,de.IY)(je,z.jM));return(0,r.jsx)(z.ZS,{entityRef:q,children:G||(0,r.jsx)(V,{})})}return(0,r.jsx)(z.ZS,{entityRef:q,children:({metadata:R,entityMetadata:P,onReady:G})=>(0,r.jsx)("div",{className:"techdocs-reader-page",children:(0,r.jsx)(f.T3,{themeId:"documentation",children:ie instanceof Function?ie({entityRef:q,techdocsMetadataValue:R.value,entityMetadataValue:P.value,onReady:G}):ie})})})}},86317:function(Ct,ke,n){"use strict";n.d(ke,{F:function(){return X}});var r=n(52322),p=n(2784),W=n(79692),f=n(60905),z=n(61886),g=n(53974),u=n(22478),D=n(4614),ge=n(77277),de=n(99688),V=n(12420),te=n(90436),L=n(61837),A=n(4190),ae=n(87685);const oe=(0,W.Z)(v=>(0,V.Z)({paper:{width:"100%",[v.breakpoints.up("sm")]:{width:"75%"},[v.breakpoints.up("md")]:{width:"50%"},padding:v.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:v.palette.background.default}})),ie=({buildLog:v,onClose:O})=>{const J=oe(),M=v.length===0?"Waiting for logs...":v.join(`
|
|
37
|
-
`);return(0,r.jsxs)(f.Z,{container:!0,direction:"column",className:J.root,spacing:0,wrap:"nowrap",children:[(0,r.jsxs)(f.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,r.jsx)(te.Z,{variant:"h5",children:"Build Details"}),(0,r.jsx)(L.Z,{title:"Close the drawer",onClick:O,color:"inherit",children:(0,r.jsx)(ae.Z,{})},"dismiss")]}),(0,r.jsx)(f.Z,{item:!0,xs:!0,children:(0,r.jsx)(g.nU,{text:M,classes:{root:J.logs}})})]})},q=({buildLog:v})=>{const O=oe(),[J,M]=(0,p.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ge.Z,{color:"inherit",onClick:()=>M(!0),children:"Show Build Logs"}),(0,r.jsx)(A.ZP,{classes:{paper:O.paper},anchor:"right",open:J,onClose:()=>M(!1),children:(0,r.jsx)(ie,{buildLog:v,onClose:()=>M(!1)})})]})};var H=n(60871);const T=({errorMessage:v})=>{const O=(0,H.h_)(H.Ds).getOptionalString("techdocs.builder");let J="";return O!=="local"&&(J="Note that techdocs.builder is not set to 'local' in your config, which means this Backstage app will not generate docs if they are not found. Make sure the project's docs are generated and published by some external process (e.g. CI/CD pipeline). Or change techdocs.builder to 'local' to generate docs from this Backstage instance."),(0,r.jsx)(g.mf,{status:"404",statusMessage:v||"Documentation not found",additionalInfo:J})};var R=n(95481);const P=(0,W.Z)(v=>({root:{marginBottom:v.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),G=()=>{let v=null;const O=P(),{state:J,contentReload:M,contentErrorMessage:ue,syncErrorMessage:ye,buildLog:Me}=(0,R.DK)();return J==="INITIAL_BUILD"&&(v=(0,r.jsx)(de.Z,{classes:{root:O.root},variant:"outlined",severity:"info",icon:(0,r.jsx)(D.Z,{size:"24px"}),action:(0,r.jsx)(q,{buildLog:Me}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),J==="CONTENT_STALE_REFRESHING"&&(v=(0,r.jsx)(de.Z,{variant:"outlined",severity:"info",icon:(0,r.jsx)(D.Z,{size:"24px"}),action:(0,r.jsx)(q,{buildLog:Me}),classes:{root:O.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),J==="CONTENT_STALE_READY"&&(v=(0,r.jsx)(de.Z,{variant:"outlined",severity:"success",action:(0,r.jsx)(ge.Z,{color:"inherit",onClick:()=>M(),children:"Refresh"}),classes:{root:O.root},children:"A newer version of this documentation is now available, please refresh to view."})),J==="CONTENT_STALE_ERROR"&&(v=(0,r.jsxs)(de.Z,{variant:"outlined",severity:"error",action:(0,r.jsx)(q,{buildLog:Me}),classes:{root:O.root,message:O.message},children:["Building a newer version of this documentation failed."," ",ye]})),J==="CONTENT_NOT_FOUND"&&(v=(0,r.jsxs)(r.Fragment,{children:[ye&&(0,r.jsxs)(de.Z,{variant:"outlined",severity:"error",action:(0,r.jsx)(q,{buildLog:Me}),classes:{root:O.root,message:O.message},children:["Building a newer version of this documentation failed."," ",ye]}),(0,r.jsx)(T,{errorMessage:ue})]})),v};var je=n(60364),Pe=n(41156),N=n(32838),_e=n(35368),at=n.n(_e);const It=/main\.[A-Fa-f0-9]{8}\.min\.css$/,zt=/^https:\/\/fonts\.googleapis\.com/,xt=/^https:\/\/fonts\.gstatic\.com/,Zt=v=>v.nodeName==="LINK",Dt=v=>{const O=(v==null?void 0:v.getAttribute("href"))||"",J=O.match(It),M=O.match(zt),ue=O.match(xt);return J||M||ue},et=v=>(Zt(v)&&!Dt(v)&&v.remove(),v),lt=v=>v.nodeName==="IFRAME",yt=(v,O)=>{const J=v.getAttribute("src")||"";try{const{host:M}=new URL(J);return O.includes(M)}catch{return!1}},At=v=>O=>(lt(O)&&!yt(O,v)&&O.remove(),O),$t=()=>{const v=(0,H.h_)(H.Ds);return(0,p.useMemo)(()=>v.getOptionalConfig("techdocs.sanitizer"),[v])},Gt=()=>{const v=$t();return(0,p.useCallback)(async O=>{const J=v==null?void 0:v.getOptionalStringArray("allowedIframeHosts");at().addHook("beforeSanitizeElements",et);const M=["link"];return J&&(M.push("iframe"),at().addHook("beforeSanitizeElements",At(J))),at().sanitize(O.outerHTML,{ADD_TAGS:M,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[v])};var xe=n(41128),Ce=({theme:v})=>`
|
|
38
|
-
/*================== Variables ==================*/
|
|
39
|
-
/*
|
|
40
|
-
As the MkDocs output is rendered in shadow DOM, the CSS variable definitions on the root selector are not applied. Instead, they have to be applied on :host.
|
|
41
|
-
As there is no way to transform the served main*.css yet (for example in the backend), we have to copy from main*.css and modify them.
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
:host {
|
|
45
|
-
/* FONT */
|
|
46
|
-
--md-default-fg-color: ${v.palette.text.primary};
|
|
47
|
-
--md-default-fg-color--light: ${v.palette.text.secondary};
|
|
48
|
-
--md-default-fg-color--lighter: ${(0,xe.$n)(v.palette.text.secondary,.7)};
|
|
49
|
-
--md-default-fg-color--lightest: ${(0,xe.$n)(v.palette.text.secondary,.3)};
|
|
50
|
-
|
|
51
|
-
/* BACKGROUND */
|
|
52
|
-
--md-default-bg-color:${v.palette.background.default};
|
|
53
|
-
--md-default-bg-color--light: ${v.palette.background.paper};
|
|
54
|
-
--md-default-bg-color--lighter: ${(0,xe.$n)(v.palette.background.paper,.7)};
|
|
55
|
-
--md-default-bg-color--lightest: ${(0,xe.$n)(v.palette.background.paper,.3)};
|
|
56
|
-
|
|
57
|
-
/* PRIMARY */
|
|
58
|
-
--md-primary-fg-color: ${v.palette.primary.main};
|
|
59
|
-
--md-primary-fg-color--light: ${v.palette.primary.light};
|
|
60
|
-
--md-primary-fg-color--dark: ${v.palette.primary.dark};
|
|
61
|
-
--md-primary-bg-color: ${v.palette.primary.contrastText};
|
|
62
|
-
--md-primary-bg-color--light: ${(0,xe.$n)(v.palette.primary.contrastText,.7)};
|
|
63
|
-
|
|
64
|
-
/* ACCENT */
|
|
65
|
-
--md-accent-fg-color: var(--md-primary-fg-color);
|
|
66
|
-
|
|
67
|
-
/* SHADOW */
|
|
68
|
-
--md-shadow-z1: ${v.shadows[1]};
|
|
69
|
-
--md-shadow-z2: ${v.shadows[2]};
|
|
70
|
-
--md-shadow-z3: ${v.shadows[3]};
|
|
71
|
-
|
|
72
|
-
/* EXTENSIONS */
|
|
73
|
-
--md-admonition-fg-color: var(--md-default-fg-color);
|
|
74
|
-
--md-admonition-bg-color: var(--md-default-bg-color);
|
|
75
|
-
/* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */
|
|
76
|
-
--md-admonition-icon--note: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>');
|
|
77
|
-
--md-admonition-icon--abstract: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 5h16v2H4V5m0 4h16v2H4V9m0 4h16v2H4v-2m0 4h10v2H4v-2z"/></svg>');
|
|
78
|
-
--md-admonition-icon--info: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10A10 10 0 0012 2z"/></svg>');
|
|
79
|
-
--md-admonition-icon--tip: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.55 11.2c-.23-.3-.5-.56-.76-.82-.65-.6-1.4-1.03-2.03-1.66C13.3 7.26 13 4.85 13.91 3c-.91.23-1.75.75-2.45 1.32-2.54 2.08-3.54 5.75-2.34 8.9.04.1.08.2.08.33 0 .22-.15.42-.35.5-.22.1-.46.04-.64-.12a.83.83 0 01-.15-.17c-1.1-1.43-1.28-3.48-.53-5.12C5.89 10 5 12.3 5.14 14.47c.04.5.1 1 .27 1.5.14.6.4 1.2.72 1.73 1.04 1.73 2.87 2.97 4.84 3.22 2.1.27 4.35-.12 5.96-1.6 1.8-1.66 2.45-4.32 1.5-6.6l-.13-.26c-.2-.46-.47-.87-.8-1.25l.05-.01m-3.1 6.3c-.28.24-.73.5-1.08.6-1.1.4-2.2-.16-2.87-.82 1.19-.28 1.89-1.16 2.09-2.05.17-.8-.14-1.46-.27-2.23-.12-.74-.1-1.37.18-2.06.17.38.37.76.6 1.06.76 1 1.95 1.44 2.2 2.8.04.14.06.28.06.43.03.82-.32 1.72-.92 2.27h.01z"/></svg>');
|
|
80
|
-
--md-admonition-icon--success: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
|
|
81
|
-
--md-admonition-icon--question: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.07 11.25l-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 00-2-2 2 2 0 00-2 2H8a4 4 0 014-4 4 4 0 014 4 3.2 3.2 0 01-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10c0-5.53-4.5-10-10-10z"/></svg>');
|
|
82
|
-
--md-admonition-icon--warning: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 14h-2v-4h2m0 8h-2v-2h2M1 21h22L12 2 1 21z"/></svg>');
|
|
83
|
-
--md-admonition-icon--failure: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12 6.47 2 12 2m3.59 5L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41 15.59 7z"/></svg>');
|
|
84
|
-
--md-admonition-icon--danger: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.5 20l4.86-9.73H13V4l-5 9.73h3.5V20M12 2c2.75 0 5.1 1 7.05 2.95C21 6.9 22 9.25 22 12s-1 5.1-2.95 7.05C17.1 21 14.75 22 12 22s-5.1-1-7.05-2.95C3 17.1 2 14.75 2 12s1-5.1 2.95-7.05C6.9 3 9.25 2 12 2z"/></svg>');
|
|
85
|
-
--md-admonition-icon--bug: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 12h-4v-2h4m0 6h-4v-2h4m6-6h-2.81a5.985 5.985 0 00-1.82-1.96L17 4.41 15.59 3l-2.17 2.17a6.002 6.002 0 00-2.83 0L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8z"/></svg>');
|
|
86
|
-
--md-admonition-icon--example: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 13v-2h14v2H7m0 6v-2h14v2H7M7 7V5h14v2H7M3 8V5H2V4h2v4H3m-1 9v-1h3v4H2v-1h2v-.5H3v-1h1V17H2m2.25-7a.75.75 0 01.75.75c0 .2-.08.39-.21.52L3.12 13H5v1H2v-.92L4 11H2v-1h2.25z"/></svg>');
|
|
87
|
-
--md-admonition-icon--quote: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 17h3l2-4V7h-6v6h3M6 17h3l2-4V7H5v6h3l-2 4z"/></svg>');
|
|
88
|
-
--md-footnotes-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.42L5.83 13H21V7h-2z"/></svg>');
|
|
89
|
-
--md-details-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
|
|
90
|
-
--md-tasklist-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/></svg>');
|
|
91
|
-
--md-tasklist-icon--checked: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
|
|
92
|
-
--md-nav-icon--prev: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>');
|
|
93
|
-
--md-nav-icon--next: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
|
|
94
|
-
--md-toc-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 9h14V7H3v2m0 4h14v-2H3v2m0 4h14v-2H3v2m16 0h2v-2h-2v2m0-10v2h2V7h-2m0 6h2v-2h-2v2z"/></svg>');
|
|
95
|
-
--md-clipboard-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1z"/></svg>');
|
|
96
|
-
--md-search-result-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h7c-.41-.25-.8-.56-1.14-.9-.33-.33-.61-.7-.86-1.1H6V4h7v5h5v1.18c.71.16 1.39.43 2 .82V8l-6-6m6.31 16.9c1.33-2.11.69-4.9-1.4-6.22-2.11-1.33-4.91-.68-6.22 1.4-1.34 2.11-.69 4.89 1.4 6.22 1.46.93 3.32.93 4.79.02L22 23.39 23.39 22l-3.08-3.1m-3.81.1a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5z"/></svg>');
|
|
97
|
-
--md-source-forks-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 2.122a2.25 2.25 0 1 0-1.5 0v.878A2.25 2.25 0 0 0 5.75 8.5h1.5v2.128a2.251 2.251 0 1 0 1.5 0V8.5h1.5a2.25 2.25 0 0 0 2.25-2.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75h-4.5A.75.75 0 0 1 5 6.25v-.878zm3.75 7.378a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm3-8.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5z"/></svg>');
|
|
98
|
-
--md-source-repositories-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 1 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 0 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 0 1 1-1h8zM5 12.25v3.25a.25.25 0 0 0 .4.2l1.45-1.087a.25.25 0 0 1 .3 0L8.6 15.7a.25.25 0 0 0 .4-.2v-3.25a.25.25 0 0 0-.25-.25h-3.5a.25.25 0 0 0-.25.25z"/></svg>');
|
|
99
|
-
--md-source-stars-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694v.001z"/></svg>');
|
|
100
|
-
--md-source-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2.5 7.775V2.75a.25.25 0 0 1 .25-.25h5.025a.25.25 0 0 1 .177.073l6.25 6.25a.25.25 0 0 1 0 .354l-5.025 5.025a.25.25 0 0 1-.354 0l-6.25-6.25a.25.25 0 0 1-.073-.177zm-1.5 0V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.75 1.75 0 0 1 1 7.775zM6 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>');
|
|
101
|
-
--md-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="m310.6 246.6-127.1 128c-7.1 6.3-15.3 9.4-23.5 9.4s-16.38-3.125-22.63-9.375l-127.1-128C.224 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75s3.12 25.75-6.08 34.85z"/></svg>');
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
:host > * {
|
|
105
|
-
/* CODE */
|
|
106
|
-
--md-code-fg-color: ${v.palette.text.primary};
|
|
107
|
-
--md-code-bg-color: ${v.palette.background.paper};
|
|
108
|
-
--md-code-hl-color: ${(0,xe.Fq)(v.palette.warning.main,.5)};
|
|
109
|
-
--md-code-hl-keyword-color: ${v.palette.type==="dark"?v.palette.primary.light:v.palette.primary.dark};
|
|
110
|
-
--md-code-hl-function-color: ${v.palette.type==="dark"?v.palette.secondary.light:v.palette.secondary.dark};
|
|
111
|
-
--md-code-hl-string-color: ${v.palette.type==="dark"?v.palette.success.light:v.palette.success.dark};
|
|
112
|
-
--md-code-hl-number-color: ${v.palette.type==="dark"?v.palette.error.light:v.palette.error.dark};
|
|
113
|
-
--md-code-hl-constant-color: var(--md-code-hl-function-color);
|
|
114
|
-
--md-code-hl-special-color: var(--md-code-hl-function-color);
|
|
115
|
-
--md-code-hl-name-color: var(--md-code-fg-color);
|
|
116
|
-
--md-code-hl-comment-color: var(--md-default-fg-color--light);
|
|
117
|
-
--md-code-hl-generic-color: var(--md-default-fg-color--light);
|
|
118
|
-
--md-code-hl-variable-color: var(--md-default-fg-color--light);
|
|
119
|
-
--md-code-hl-operator-color: var(--md-default-fg-color--light);
|
|
120
|
-
--md-code-hl-punctuation-color: var(--md-default-fg-color--light);
|
|
121
|
-
|
|
122
|
-
/* TYPESET */
|
|
123
|
-
--md-typeset-font-size: 1rem;
|
|
124
|
-
--md-typeset-color: var(--md-default-fg-color);
|
|
125
|
-
--md-typeset-a-color: ${v.palette.link};
|
|
126
|
-
--md-typeset-table-color: ${v.palette.text.primary};
|
|
127
|
-
--md-typeset-del-color: ${v.palette.type==="dark"?(0,xe.Fq)(v.palette.error.dark,.5):(0,xe.Fq)(v.palette.error.light,.5)};
|
|
128
|
-
--md-typeset-ins-color: ${v.palette.type==="dark"?(0,xe.Fq)(v.palette.success.dark,.5):(0,xe.Fq)(v.palette.success.light,.5)};
|
|
129
|
-
--md-typeset-mark-color: ${v.palette.type==="dark"?(0,xe.Fq)(v.palette.warning.dark,.5):(0,xe.Fq)(v.palette.warning.light,.5)};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
@media screen and (max-width: 76.1875em) {
|
|
133
|
-
:host > * {
|
|
134
|
-
/* TYPESET */
|
|
135
|
-
--md-typeset-font-size: .9rem;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
@media screen and (max-width: 600px) {
|
|
140
|
-
:host > * {
|
|
141
|
-
/* TYPESET */
|
|
142
|
-
--md-typeset-font-size: .7rem;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
`,Ye=({theme:v})=>`
|
|
146
|
-
/*================== Reset ==================*/
|
|
147
|
-
|
|
148
|
-
body {
|
|
149
|
-
--md-text-color: var(--md-default-fg-color);
|
|
150
|
-
--md-text-link-color: var(--md-accent-fg-color);
|
|
151
|
-
--md-text-font-family: ${v.typography.fontFamily};
|
|
152
|
-
font-family: var(--md-text-font-family);
|
|
153
|
-
background-color: unset;
|
|
154
|
-
}
|
|
155
|
-
`;const Le="224px";var ct=({theme:v,sidebar:O})=>`
|
|
156
|
-
/*================== Layout ==================*/
|
|
157
|
-
|
|
158
|
-
/* mkdocs material v9 compat */
|
|
159
|
-
.md-nav__title {
|
|
160
|
-
color: var(--md-default-fg-color);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.md-grid {
|
|
164
|
-
max-width: 100%;
|
|
165
|
-
margin: 0;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.md-nav {
|
|
169
|
-
font-size: calc(var(--md-typeset-font-size) * 0.9);
|
|
170
|
-
}
|
|
171
|
-
.md-nav__link {
|
|
172
|
-
display: flex;
|
|
173
|
-
align-items: center;
|
|
174
|
-
justify-content: space-between;
|
|
175
|
-
}
|
|
176
|
-
.md-nav__icon {
|
|
177
|
-
height: 20px !important;
|
|
178
|
-
width: 20px !important;
|
|
179
|
-
margin-left:${v.spacing(1)}px;
|
|
180
|
-
}
|
|
181
|
-
.md-nav__icon svg {
|
|
182
|
-
margin: 0;
|
|
183
|
-
width: 20px !important;
|
|
184
|
-
height: 20px !important;
|
|
185
|
-
}
|
|
186
|
-
.md-nav__icon:after {
|
|
187
|
-
width: 20px !important;
|
|
188
|
-
height: 20px !important;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.md-nav__item--active > .md-nav__link, a.md-nav__link--active {
|
|
192
|
-
text-decoration: underline;
|
|
193
|
-
color: var(--md-typeset-a-color);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.md-main__inner {
|
|
197
|
-
margin-top: 0;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.md-sidebar {
|
|
201
|
-
bottom: 75px;
|
|
202
|
-
position: fixed;
|
|
203
|
-
width: 16rem;
|
|
204
|
-
overflow-y: auto;
|
|
205
|
-
overflow-x: hidden;
|
|
206
|
-
scrollbar-color: rgb(193, 193, 193) #eee;
|
|
207
|
-
scrollbar-width: thin;
|
|
208
|
-
}
|
|
209
|
-
.md-sidebar .md-sidebar__scrollwrap {
|
|
210
|
-
width: calc(12.1rem);
|
|
211
|
-
}
|
|
212
|
-
.md-sidebar--secondary {
|
|
213
|
-
right: ${v.spacing(3)}px;
|
|
214
|
-
}
|
|
215
|
-
.md-sidebar::-webkit-scrollbar {
|
|
216
|
-
width: 5px;
|
|
217
|
-
}
|
|
218
|
-
.md-sidebar::-webkit-scrollbar-button {
|
|
219
|
-
width: 5px;
|
|
220
|
-
height: 5px;
|
|
221
|
-
}
|
|
222
|
-
.md-sidebar::-webkit-scrollbar-track {
|
|
223
|
-
background: #eee;
|
|
224
|
-
border: 1 px solid rgb(250, 250, 250);
|
|
225
|
-
box-shadow: 0px 0px 3px #dfdfdf inset;
|
|
226
|
-
border-radius: 3px;
|
|
227
|
-
}
|
|
228
|
-
.md-sidebar::-webkit-scrollbar-thumb {
|
|
229
|
-
width: 5px;
|
|
230
|
-
background: rgb(193, 193, 193);
|
|
231
|
-
border: transparent;
|
|
232
|
-
border-radius: 3px;
|
|
233
|
-
}
|
|
234
|
-
.md-sidebar::-webkit-scrollbar-thumb:hover {
|
|
235
|
-
background: rgb(125, 125, 125);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.md-content {
|
|
239
|
-
max-width: calc(100% - 16rem * 2);
|
|
240
|
-
margin-left: 16rem;
|
|
241
|
-
margin-bottom: 50px;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
.md-footer {
|
|
245
|
-
position: fixed;
|
|
246
|
-
bottom: 0px;
|
|
247
|
-
pointer-events: none;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.md-footer-nav__link, .md-footer__link {
|
|
251
|
-
pointer-events: all;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
.md-footer__title {
|
|
255
|
-
background-color: unset;
|
|
256
|
-
}
|
|
257
|
-
.md-footer-nav__link {
|
|
258
|
-
width: 16rem;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
.md-dialog {
|
|
262
|
-
background-color: unset;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
@media screen and (min-width: 76.25em) {
|
|
266
|
-
.md-sidebar {
|
|
267
|
-
height: auto;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
@media screen and (max-width: 76.1875em) {
|
|
272
|
-
.md-nav {
|
|
273
|
-
transition: none !important;
|
|
274
|
-
background-color: var(--md-default-bg-color)
|
|
275
|
-
}
|
|
276
|
-
.md-nav--primary .md-nav__title {
|
|
277
|
-
cursor: auto;
|
|
278
|
-
color: var(--md-default-fg-color);
|
|
279
|
-
font-weight: 700;
|
|
280
|
-
white-space: normal;
|
|
281
|
-
line-height: 1rem;
|
|
282
|
-
height: auto;
|
|
283
|
-
display: flex;
|
|
284
|
-
flex-flow: column;
|
|
285
|
-
row-gap: 1.6rem;
|
|
286
|
-
padding: 1.2rem .8rem .8rem;
|
|
287
|
-
background-color: var(--md-default-bg-color);
|
|
288
|
-
}
|
|
289
|
-
.md-nav--primary .md-nav__title~.md-nav__list {
|
|
290
|
-
box-shadow: none;
|
|
291
|
-
}
|
|
292
|
-
.md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
|
|
293
|
-
border-top: none;
|
|
294
|
-
}
|
|
295
|
-
.md-nav--primary .md-nav__title .md-nav__button {
|
|
296
|
-
display: none;
|
|
297
|
-
}
|
|
298
|
-
.md-nav--primary .md-nav__title .md-nav__icon {
|
|
299
|
-
color: var(--md-default-fg-color);
|
|
300
|
-
position: static;
|
|
301
|
-
height: auto;
|
|
302
|
-
margin: 0 0 0 -0.2rem;
|
|
303
|
-
}
|
|
304
|
-
.md-nav--primary > .md-nav__title [for="none"] {
|
|
305
|
-
padding-top: 0;
|
|
306
|
-
}
|
|
307
|
-
.md-nav--primary .md-nav__item {
|
|
308
|
-
border-top: none;
|
|
309
|
-
}
|
|
310
|
-
.md-nav--primary :is(.md-nav__title,.md-nav__item) {
|
|
311
|
-
font-size : var(--md-typeset-font-size);
|
|
312
|
-
}
|
|
313
|
-
.md-nav .md-source {
|
|
314
|
-
display: none;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
.md-sidebar {
|
|
318
|
-
height: 100%;
|
|
319
|
-
}
|
|
320
|
-
.md-sidebar--primary {
|
|
321
|
-
width: 12.1rem !important;
|
|
322
|
-
z-index: 200;
|
|
323
|
-
left: ${O.isPinned?`calc(-12.1rem + ${Le})`:"calc(-12.1rem + 72px)"} !important;
|
|
324
|
-
}
|
|
325
|
-
.md-sidebar--secondary:not([hidden]) {
|
|
326
|
-
display: none;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
.md-content {
|
|
330
|
-
max-width: 100%;
|
|
331
|
-
margin-left: 0;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
.md-header__button {
|
|
335
|
-
margin: 0.4rem 0;
|
|
336
|
-
margin-left: 0.4rem;
|
|
337
|
-
padding: 0;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
.md-overlay {
|
|
341
|
-
left: 0;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
.md-footer {
|
|
345
|
-
position: static;
|
|
346
|
-
padding-left: 0;
|
|
347
|
-
}
|
|
348
|
-
.md-footer-nav__link {
|
|
349
|
-
/* footer links begin to overlap at small sizes without setting width */
|
|
350
|
-
width: 50%;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
@media screen and (max-width: 600px) {
|
|
355
|
-
.md-sidebar--primary {
|
|
356
|
-
left: -12.1rem !important;
|
|
357
|
-
width: 12.1rem;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
@media print {
|
|
363
|
-
.md-sidebar,
|
|
364
|
-
#toggle-sidebar {
|
|
365
|
-
display: none;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
.md-content {
|
|
369
|
-
margin: 0;
|
|
370
|
-
width: 100%;
|
|
371
|
-
max-width: 100%;
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
`;const wt=["h1","h2","h3","h4","h5","h6"];var dt=({theme:v})=>`
|
|
375
|
-
/*================== Typeset ==================*/
|
|
376
|
-
|
|
377
|
-
.md-typeset {
|
|
378
|
-
font-size: var(--md-typeset-font-size);
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
${wt.reduce((O,J)=>{var M;const ue=(M=v.typography.htmlFontSize)!==null&&M!==void 0?M:16,ye=v.typography[J],{lineHeight:Me,fontFamily:ot,fontWeight:ht,fontSize:Tt}=ye,jt=st=>{let Ne=1;return typeof st=="number"&&(Ne=st/ue*.6),typeof st=="string"&&(Ne=st.replace("rem","")),`calc(${Ne} * var(--md-typeset-font-size))`};return O.concat(`
|
|
382
|
-
.md-typeset ${J} {
|
|
383
|
-
color: var(--md-default-fg-color);
|
|
384
|
-
line-height: ${Me};
|
|
385
|
-
font-family: ${ot};
|
|
386
|
-
font-weight: ${ht};
|
|
387
|
-
font-size: ${jt(Tt)};
|
|
388
|
-
}
|
|
389
|
-
`)},"")}
|
|
390
|
-
|
|
391
|
-
.md-typeset .md-content__button {
|
|
392
|
-
color: var(--md-default-fg-color);
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
.md-typeset hr {
|
|
396
|
-
border-bottom: 0.05rem dotted ${v.palette.divider};
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
.md-typeset details {
|
|
400
|
-
font-size: var(--md-typeset-font-size) !important;
|
|
401
|
-
}
|
|
402
|
-
.md-typeset details summary {
|
|
403
|
-
padding-left: 2.5rem !important;
|
|
404
|
-
}
|
|
405
|
-
.md-typeset details summary:before,
|
|
406
|
-
.md-typeset details summary:after {
|
|
407
|
-
top: 50% !important;
|
|
408
|
-
width: 20px !important;
|
|
409
|
-
height: 20px !important;
|
|
410
|
-
transform: rotate(0deg) translateY(-50%) !important;
|
|
411
|
-
}
|
|
412
|
-
.md-typeset details[open] > summary:after {
|
|
413
|
-
transform: rotate(90deg) translateX(-50%) !important;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
.md-typeset blockquote {
|
|
417
|
-
color: var(--md-default-fg-color--light);
|
|
418
|
-
border-left: 0.2rem solid var(--md-default-fg-color--light);
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
.md-typeset table:not([class]) {
|
|
422
|
-
font-size: var(--md-typeset-font-size);
|
|
423
|
-
border: 1px solid var(--md-default-fg-color);
|
|
424
|
-
border-bottom: none;
|
|
425
|
-
border-collapse: collapse;
|
|
426
|
-
}
|
|
427
|
-
.md-typeset table:not([class]) th {
|
|
428
|
-
font-weight: bold;
|
|
429
|
-
}
|
|
430
|
-
.md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
|
|
431
|
-
border-bottom: 1px solid var(--md-default-fg-color);
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
.md-typeset pre > code::-webkit-scrollbar-thumb {
|
|
435
|
-
background-color: hsla(0, 0%, 0%, 0.32);
|
|
436
|
-
}
|
|
437
|
-
.md-typeset pre > code::-webkit-scrollbar-thumb:hover {
|
|
438
|
-
background-color: hsla(0, 0%, 0%, 0.87);
|
|
439
|
-
}
|
|
440
|
-
`,Qe=()=>`
|
|
441
|
-
/*================== Animations ==================*/
|
|
442
|
-
/*
|
|
443
|
-
Disable CSS animations on link colors as they lead to issues in dark mode.
|
|
444
|
-
The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
|
|
445
|
-
*/
|
|
446
|
-
.md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
|
|
447
|
-
transition: none;
|
|
448
|
-
}
|
|
449
|
-
`,Ge=({theme:v})=>`
|
|
450
|
-
/*================== Extensions ==================*/
|
|
451
|
-
|
|
452
|
-
/* HIGHLIGHT */
|
|
453
|
-
.highlight .md-clipboard:after {
|
|
454
|
-
content: unset;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
.highlight .nx {
|
|
458
|
-
color: ${v.palette.type==="dark"?"#ff53a3":"#ec407a"};
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
/* CODE HILITE */
|
|
462
|
-
.codehilite .gd {
|
|
463
|
-
background-color: ${v.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
.codehilite .gi {
|
|
467
|
-
background-color: ${v.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
/* TABBED */
|
|
471
|
-
.tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
|
|
472
|
-
.tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
|
|
473
|
-
.tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
|
|
474
|
-
.tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
|
|
475
|
-
.tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
|
|
476
|
-
.tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
|
|
477
|
-
.tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
|
|
478
|
-
.tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
|
|
479
|
-
.tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
|
|
480
|
-
.tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
|
|
481
|
-
.tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
|
|
482
|
-
.tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
|
|
483
|
-
.tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
|
|
484
|
-
.tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
|
|
485
|
-
.tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
|
|
486
|
-
.tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
|
|
487
|
-
.tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
|
|
488
|
-
.tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
|
|
489
|
-
.tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
|
|
490
|
-
.tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
|
|
491
|
-
color: var(--md-accent-fg-color);
|
|
492
|
-
border-color: var(--md-accent-fg-color);
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
/* TASK-LIST */
|
|
496
|
-
.task-list-control .task-list-indicator::before {
|
|
497
|
-
background-color: ${v.palette.action.disabledBackground};
|
|
498
|
-
}
|
|
499
|
-
.task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
|
|
500
|
-
background-color: ${v.palette.success.main};
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
/* ADMONITION */
|
|
504
|
-
.admonition {
|
|
505
|
-
font-size: var(--md-typeset-font-size) !important;
|
|
506
|
-
}
|
|
507
|
-
.admonition .admonition-title {
|
|
508
|
-
padding-left: 2.5rem !important;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
.admonition .admonition-title:before {
|
|
512
|
-
top: 50% !important;
|
|
513
|
-
width: 20px !important;
|
|
514
|
-
height: 20px !important;
|
|
515
|
-
transform: translateY(-50%) !important;
|
|
516
|
-
}
|
|
517
|
-
`;const ut=[Ce,Ye,ct,dt,Qe,Ge],pt=()=>(0,g.Pf)(),hn=()=>{const v=pt(),O=(0,je.Z)();return(0,p.useMemo)(()=>{const J={theme:O,sidebar:v};return ut.reduce((M,ue)=>M+ue(J),"")},[O,v])},pn=()=>{const v=hn();return(0,p.useCallback)(O=>(O.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${v}</style>`),O),[v])},fn=(v,O,J)=>{const M=v==="src"&&O.endsWith(".svg"),ue=!O.match(/^([a-z]*:)?\/\//i),ye=O.startsWith(J);return M&&(ue||ye)},_t=({techdocsStorageApi:v,entityId:O,path:J})=>async M=>{const ue=await v.getApiOrigin(),ye=async(Me,ot)=>{for(const ht of Me)if(ht.hasAttribute(ot)){const Tt=ht.getAttribute(ot);if(!Tt)return;const jt=await v.getBaseUrl(Tt,O,J);if(fn(ot,Tt,ue))try{const Ne=await(await fetch(jt,{credentials:"include"})).text();ht.setAttribute(ot,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(Ne)))}`)}catch{ht.setAttribute("alt",`Error: ${Tt}`)}else ht.setAttribute(ot,jt)}};return await Promise.all([ye(M.querySelectorAll("img"),"src"),ye(M.querySelectorAll("script"),"src"),ye(M.querySelectorAll("source"),"src"),ye(M.querySelectorAll("link"),"href"),ye(M.querySelectorAll("a[download]"),"href")]),M};var Sn=n(40556),Yt=n(67097),rn=n(28316),jn=n(82717),on=n.n(jn);const En=v=>O=>{var J;const M=O.querySelector('[title="Edit this page"]');if(!M||!M.href)return O;const ue=new URL(M.href),ye=v.byUrl(ue);if((ye==null?void 0:ye.type)!=="github"&&(ye==null?void 0:ye.type)!=="gitlab")return O;const Me=((J=O.querySelector("article>h1"))===null||J===void 0?void 0:J.childNodes[0].textContent)||"",ot=encodeURIComponent(`Documentation Feedback: ${Me}`),ht=encodeURIComponent(`Page source:
|
|
518
|
-
${M.href}
|
|
519
|
-
|
|
520
|
-
Feedback:`),Tt=(ye==null?void 0:ye.type)==="github"?(0,Sn.BT)(ue.href,"blob"):ue.href,jt=on()(Tt),st=`/${jt.organization}/${jt.name}`,Ne=M.cloneNode();switch(ye==null?void 0:ye.type){case"gitlab":Ne.href=`${ue.origin}${st}/issues/new?issue[title]=${ot}&issue[description]=${ht}`;break;case"github":Ne.href=`${ue.origin}${st}/issues/new?title=${ot}&body=${ht}`;break;default:return O}return rn.render(p.createElement(Yt.Z),Ne),Ne.style.paddingLeft="5px",Ne.title="Leave feedback for this page",Ne.id="git-feedback-link",M==null||M.insertAdjacentElement("beforebegin",Ne),O};var Fn=n(44882);const nt=()=>v=>{const O=v.querySelector('.md-header label[for="__drawer"]'),J=v.querySelector("article");if(!O||!J)return v;const M=O.cloneNode();return rn.render(p.createElement(Fn.Z),M),M.id="toggle-sidebar",M.title="Toggle Sidebar",M.classList.add("md-content__button"),M.style.setProperty("padding","0 0 0 5px"),M.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),J==null||J.prepend(M),v},sn=()=>v=>(((J,M)=>{Array.from(J).filter(ue=>ue.hasAttribute(M)).forEach(ue=>{const ye=ue.getAttribute(M);if(ye){ye.match(/^https?:\/\//i)&&ue.setAttribute("target","_blank");try{const Me=Jt(window.location.href);ue.setAttribute(M,new URL(ye,Me).toString())}catch{ue.replaceWith(ue.textContent||ye)}}})})(Array.from(v.getElementsByTagName("a")),"href"),v);function Jt(v){const O=new URL(v);return!O.pathname.endsWith("/")&&!O.pathname.endsWith(".html")&&(O.pathname+="/"),O.toString()}const rt=({baseUrl:v,onClick:O})=>J=>(Array.from(J.getElementsByTagName("a")).forEach(M=>{M.addEventListener("click",ue=>{const Me=M.getAttribute("href");Me&&Me.startsWith(v)&&!M.hasAttribute("download")&&(ue.preventDefault(),O(ue,Me))})}),J);var In=n(15459),Qt=n(80030),Pn=n(72379),Nn=n(41547),Ln=n(95074);const Zn=(0,In.Z)(v=>({tooltip:{fontSize:"inherit",color:v.palette.text.primary,margin:0,padding:v.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Qt.ZP),Se=()=>(0,r.jsx)(Pn.Z,{children:(0,r.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),ce=({text:v})=>{const[O,J]=(0,p.useState)(!1),[,M]=(0,Ln.Z)(),ue=(0,p.useCallback)(()=>{M(v),J(!0)},[v,M]),ye=(0,p.useCallback)(()=>{J(!1)},[J]);return(0,r.jsx)(Zn,{title:"Copied to clipboard",placement:"left",open:O,onClose:ye,leaveDelay:1e3,children:(0,r.jsx)(L.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:ue,children:(0,r.jsx)(Se,{})})})},Ie=v=>O=>{const J=O.querySelectorAll("pre > code");for(const ue of J){var M;const ye=ue.textContent||"",Me=document.createElement("div");ue==null||(M=ue.parentElement)===null||M===void 0||M.prepend(Me),rn.render((0,r.jsx)(Nn.Z,{theme:v,children:(0,r.jsx)(ce,{text:ye})}),Me)}return O},Ue=()=>v=>{var O;return(O=v.querySelector(".md-header"))===null||O===void 0||O.remove(),v},Ve=()=>v=>{var O,J;return(O=v.querySelector(".md-footer .md-copyright"))===null||O===void 0||O.remove(),(J=v.querySelector(".md-footer-copyright"))===null||J===void 0||J.remove(),v},le=({onLoading:v,onLoaded:O})=>J=>(v(),J.addEventListener(z.Ox,function M(){O(),J.removeEventListener(z.Ox,M)}),J),U=()=>v=>(v.addEventListener(z.Ox,function O(){if(window.location.hash){var J;const M=window.location.hash.slice(1);(J=v==null?void 0:v.querySelector(`[id="${M}"]`))===null||J===void 0||J.scrollIntoView()}v.removeEventListener(z.Ox,O)}),v),he=()=>v=>(setTimeout(()=>{const O=v==null?void 0:v.querySelectorAll("li.md-nav__item--active");O.length!==0&&(O.forEach(M=>{const ue=M==null?void 0:M.querySelector("input");ue!=null&&ue.checked||ue==null||ue.click()}),O[O.length-1].scrollIntoView())},200),v),$e=async(v,O)=>{let J;if(typeof v=="string")J=new DOMParser().parseFromString(v,"text/html").documentElement;else if(v instanceof Element)J=v;else throw new Error("dom is not a recognized type");for(const M of O)J=await M(J);return J};var Ke=n(73557);function Je(v,O){const J=new URL(O),M=`${J.origin}${J.pathname.replace(/\/$/,"")}`,ue=v.replace(M,"").replace(/^\/+/,""),ye=new URL(`http://localhost/${ue}`);return`${ye.pathname}${ye.search}${ye.hash}`}function Ft(){const v=(0,Ke.s0)(),J=(0,H.h_)(H.Ds).getOptionalString("app.baseUrl");return(0,p.useCallback)(ue=>{let ye=ue;if(J)try{ye=Je(ue,J)}catch{}v(ye)},[v,J])}const Vt="screen and (max-width: 76.1875em)",en=v=>{const O=Ft(),J=(0,je.Z)(),M=(0,Pe.Z)(Vt),ue=Gt(),ye=pn(),Me=(0,H.z$)(),ot=(0,H.h_)(z.Dl),ht=(0,H.h_)(N.q3),{state:Tt,path:jt,content:st}=(0,R.DK)(),[Ne,Ut]=(0,p.useState)(null),qt=(0,z.ux)(Ne),bt=(0,p.useCallback)(()=>{if(!Ne)return;Ne.querySelectorAll(".md-sidebar").forEach(He=>{if(M)He.style.top="0px";else{const sr=document==null?void 0:document.querySelector(".techdocs-reader-page");var Lt;const mr=(Lt=sr==null?void 0:sr.getBoundingClientRect().top)!==null&&Lt!==void 0?Lt:0;var xn;let Gn=(xn=Ne.getBoundingClientRect().top)!==null&&xn!==void 0?xn:0;const cn=Ne.querySelector(".md-container > .md-tabs");var nn;const ir=(nn=cn==null?void 0:cn.getBoundingClientRect().height)!==null&&nn!==void 0?nn:0;Gn<mr&&(Gn=mr),He.style.top=`${Math.max(Gn,0)+ir}px`}He.style.setProperty("opacity","1")})},[Ne,M]);(0,p.useEffect)(()=>(window.addEventListener("resize",bt),window.addEventListener("scroll",bt,!0),()=>{window.removeEventListener("resize",bt),window.removeEventListener("scroll",bt,!0)}),[Ne,bt]);const Nt=(0,p.useCallback)(()=>{if(!Ne)return;const vt=Ne.querySelector(".md-footer");vt&&(vt.style.width=`${Ne.getBoundingClientRect().width}px`)},[Ne]);(0,p.useEffect)(()=>(window.addEventListener("resize",Nt),()=>{window.removeEventListener("resize",Nt)}),[Ne,Nt]),(0,p.useEffect)(()=>{qt||(Nt(),bt())},[Tt,qt,Nt,bt]);const gn=(0,p.useCallback)((vt,He)=>$e(vt,[ue,_t({techdocsStorageApi:ot,entityId:v,path:He}),sn(),nt(),Ue(),Ve(),En(ht),ye]),[v,ht,ot,ue,ye]),Cn=(0,p.useCallback)(async vt=>$e(vt,[U(),he(),Ie(J),rt({baseUrl:window.location.origin,onClick:(He,Lt)=>{var xn;const nn=He.ctrlKey||He.metaKey,sr=new URL(Lt),mr=((xn=He.target)===null||xn===void 0?void 0:xn.innerText)||Lt,Gn=Lt.replace(window.location.origin,"");if(Me.captureEvent("click",mr,{attributes:{to:Gn}}),sr.hash)if(nn)window.open(Lt,"_blank");else{var cn;O(Lt),(cn=vt==null?void 0:vt.querySelector(`[id="${sr.hash.slice(1)}"]`))===null||cn===void 0||cn.scrollIntoView()}else nn?window.open(Lt,"_blank"):O(Lt)}}),le({onLoading:()=>{},onLoaded:()=>{var He;(He=vt.querySelector(".md-nav__title"))===null||He===void 0||He.removeAttribute("for")}}),le({onLoading:()=>{Array.from(vt.querySelectorAll(".md-sidebar")).forEach(Lt=>{Lt.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[J,O,Me]);return(0,p.useEffect)(()=>{if(!st)return()=>{};let vt=!0;return gn(st,jt).then(async He=>{if(!(He!=null&&He.innerHTML)||!vt)return;window.scroll({top:0});const Lt=await Cn(He);Ut(Lt)}),()=>{vt=!1}},[st,jt,gn,Cn]),Ne};var Xt=n(8560);const tn=()=>{const v=(0,z.$L)(),{shadowRoot:O}=(0,z.x1)(),J=O==null?void 0:O.querySelector('[data-md-component="content"]'),M=O==null?void 0:O.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let ue=M==null?void 0:M.querySelector('[data-techdocs-addons-location="primary sidebar"]');ue||(ue=document.createElement("div"),ue.setAttribute("data-techdocs-addons-location","primary sidebar"),M==null||M.prepend(ue));const ye=O==null?void 0:O.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Me=ye==null?void 0:ye.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Me||(Me=document.createElement("div"),Me.setAttribute("data-techdocs-addons-location","secondary sidebar"),ye==null||ye.prepend(Me)),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Xt.Z,{container:ue,children:v.renderComponentsByLocation(z.oZ.PrimarySidebar)}),(0,r.jsx)(Xt.Z,{container:J,children:v.renderComponentsByLocation(z.oZ.Content)}),(0,r.jsx)(Xt.Z,{container:Me,children:v.renderComponentsByLocation(z.oZ.SecondarySidebar)})]})},_=(0,W.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"},"@media print":{display:"none"}}}),X=(0,R.m1)(v=>{var O;const{withSearch:J=!0,onReady:M}=v,ue=_(),{entityMetadata:{value:ye,loading:Me},entityRef:ot,setShadowRoot:ht}=(0,z.x1)(),Tt=en(ot),jt=(0,p.useCallback)(st=>{ht(st),M instanceof Function&&M()},[ht,M]);return Me===!1&&!ye?(0,r.jsx)(g.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):Tt?(0,r.jsx)(g.VY,{children:(0,r.jsxs)(f.Z,{container:!0,children:[(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(G,{})}),J&&(0,r.jsx)(f.Z,{className:ue.search,xs:"auto",item:!0,children:(0,r.jsx)(u.S,{entityId:ot,entityTitle:ye==null||(O=ye.metadata)===null||O===void 0?void 0:O.title})}),(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(z.VA,{element:Tt,onAppend:jt,children:(0,r.jsx)(tn,{})})})]})}):(0,r.jsx)(g.VY,{children:(0,r.jsx)(f.Z,{container:!0,children:(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(G,{})})})})}),ee=null},93225:function(Ct,ke,n){"use strict";n.d(ke,{S:function(){return oe}});var r=n(52322),p=n(2784),W=n(18671),f=n(60905),z=n(98069),g=n(60364),u=n(73250),D=n(61886),ge=n(39709),de=n(25271),V=n(53974),te=n(60871),L=n(76635),A=n(95573);const ae=(0,r.jsx)(z.Z,{animation:"wave",variant:"text",height:40}),oe=ie=>{const{palette:{common:{white:q}}}=(0,g.Z)(),{children:H}=ie,T=(0,D.$L)(),R=(0,te.h_)(te.Ds),{title:P,setTitle:G,subtitle:je,setSubtitle:Pe,entityRef:N,metadata:{value:_e,loading:at},entityMetadata:{value:It,loading:zt}}=(0,D.x1)();(0,p.useEffect)(()=>{_e&&(G(_e.site_name),Pe(()=>{let{site_description:Ce}=_e;return(!Ce||Ce==="None")&&(Ce=""),Ce}))},[_e,G,Pe]);const xt=R.getOptional("app.title")||"Backstage",Zt=[P,je,xt].filter(Boolean).join(" | "),{locationMetadata:Dt,spec:et}=It||{},lt=et==null?void 0:et.lifecycle,yt=It?(0,ge.hF)(It,de.S4):[],At=(0,te.tg)(A._Z)(),$t=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.i9,{label:(0,L.capitalize)((It==null?void 0:It.kind)||"entity"),value:(0,r.jsx)(ge.dx,{color:"inherit",entityRef:N,title:It==null?void 0:It.metadata.title,defaultKind:"Component"})}),yt.length>0&&(0,r.jsx)(V.i9,{label:"Owner",value:(0,r.jsx)(ge.rI,{color:"inherit",entityRefs:yt,defaultKind:"group"})}),lt?(0,r.jsx)(V.i9,{label:"Lifecycle",value:lt}):null,Dt&&Dt.type!=="dir"&&Dt.type!=="file"?(0,r.jsx)(V.i9,{label:"",value:(0,r.jsxs)(f.Z,{container:!0,direction:"column",alignItems:"center",style:{color:q},children:[(0,r.jsx)(f.Z,{style:{padding:0},item:!0,children:(0,r.jsx)(u.Z,{style:{marginTop:"-25px"}})}),(0,r.jsx)(f.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:Dt.target}):null]});return!zt&&It===void 0||!at&&_e===void 0?null:(0,r.jsxs)(V.h4,{type:"Documentation",typeLink:At,title:P||ae,subtitle:je===""?void 0:je||ae,children:[(0,r.jsx)(W.Z,{titleTemplate:"%s",children:(0,r.jsx)("title",{children:Zt})}),$t,H,T.renderComponentsByLocation(D.oZ.Header)]})}},65124:function(Ct,ke,n){"use strict";n.d(ke,{b:function(){return te}});var r=n(52322),p=n(2784),W=n(79692),f=n(15223),z=n(95544),g=n(80030),u=n(61837),D=n(48348),ge=n(47603),de=n(61886);const V=(0,W.Z)(L=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:L.spacing(3,3,0),"@media print":{display:"none"}}})),te=L=>{const A=V(),[ae,oe]=(0,p.useState)(null),ie=(0,p.useCallback)(je=>{oe(je.currentTarget)},[]),q=(0,p.useCallback)(()=>{oe(null)},[]),{entityMetadata:{value:H,loading:T}}=(0,de.x1)(),R=(0,de.$L)(),P=R.renderComponentsByLocation(de.oZ.Subheader),G=R.renderComponentsByLocation(de.oZ.Settings);return!P&&!G||T===!1&&!H?null:(0,r.jsx)(f.Z,{classes:A,...L.toolbarProps,children:(0,r.jsxs)(z.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[P,G?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g.ZP,{title:"Settings",children:(0,r.jsx)(u.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:ie,children:(0,r.jsx)(ge.Z,{})})}),(0,r.jsx)(D.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:ae,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(ae),onClose:q,keepMounted:!0,children:(0,r.jsx)("div",{children:G})})]}):null]})})}},95481:function(Ct,ke,n){"use strict";n.d(ke,{DK:function(){return te},m1:function(){return A}});var r=n(52322),p=n(2784),W=n(73557),f=n(61886),z=n(60871),g=n(64279),u=n(77446);function D({contentLoading:ae,content:oe,activeSyncState:ie}){return ae||ie==="BUILD_READY_RELOAD"||!oe&&ie==="CHECKING"?"CHECKING":!oe&&ie==="BUILDING"?"INITIAL_BUILD":oe?ie==="BUILDING"?"CONTENT_STALE_REFRESHING":ie==="BUILD_READY"?"CONTENT_STALE_READY":ie==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ge(ae,oe){const ie={...ae};switch(oe.type){case"sync":oe.state==="CHECKING"&&(ie.buildLog=[]),ie.activeSyncState=oe.state,ie.syncError=oe.syncError;break;case"contentLoading":ie.contentLoading=!0,ie.contentError=void 0;break;case"content":typeof oe.path=="string"&&(ie.path=oe.path),ie.contentLoading=!1,ie.content=oe.content,ie.contentError=oe.contentError;break;case"buildLog":ie.buildLog=ie.buildLog.concat(oe.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(ie.activeSyncState)&&["contentLoading","content"].includes(oe.type)&&(ie.activeSyncState="UP_TO_DATE",ie.buildLog=[]),ie}function de(ae,oe,ie,q){var H,T;const[R,P]=(0,p.useReducer)(ge,{activeSyncState:"CHECKING",path:q,contentLoading:!0,buildLog:[]}),G=(0,z.h_)(f.Dl),{retry:je}=(0,u.Z)(async()=>{P({type:"contentLoading"});try{const _e=await G.getEntityDocs({kind:ae,namespace:oe,name:ie},q);return P({type:"content",content:_e,path:q}),_e}catch(_e){P({type:"content",contentError:_e,path:q})}},[G,ae,oe,ie,q]),Pe=(0,p.useRef)({content:void 0,reload:()=>{}});return Pe.current={content:R.content,reload:je},(0,g.default)(async()=>{P({type:"sync",state:"CHECKING"});const _e=setTimeout(()=>{P({type:"sync",state:"BUILDING"})},1e3);try{switch(await G.syncEntityDocs({kind:ae,namespace:oe,name:ie},It=>{P({type:"buildLog",log:It})})){case"updated":Pe.current.content?P({type:"sync",state:"BUILD_READY"}):(Pe.current.reload(),P({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":P({type:"sync",state:"UP_TO_DATE"});break;default:P({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(at){P({type:"sync",state:"ERROR",syncError:at})}finally{clearTimeout(_e)}},[ae,ie,oe,G,P,Pe]),{state:(0,p.useMemo)(()=>D({activeSyncState:R.activeSyncState,contentLoading:R.contentLoading,content:R.content}),[R.activeSyncState,R.content,R.contentLoading]),contentReload:je,path:R.path,content:R.content,contentErrorMessage:(H=R.contentError)===null||H===void 0?void 0:H.toString(),syncErrorMessage:(T=R.syncError)===null||T===void 0?void 0:T.toString(),buildLog:R.buildLog}}const V=(0,p.createContext)({}),te=()=>(0,p.useContext)(V),L=ae=>{const{children:oe}=ae,{"*":ie=""}=(0,W.UO)(),{entityRef:q}=(0,f.x1)(),{kind:H,namespace:T,name:R}=q,P=de(H,T,R,ie);return(0,r.jsx)(V.Provider,{value:P,children:oe instanceof Function?oe(P):oe})},A=ae=>oe=>(0,r.jsx)(L,{children:(0,r.jsx)(ae,{...oe})})},95573:function(Ct,ke,n){"use strict";n.d(ke,{Fw:function(){return W},_Z:function(){return p},pd:function(){return f}});var r=n(60871);const p=(0,r.NT)({id:"techdocs:index-page"}),W=(0,r.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),f=(0,r.NT)({id:"techdocs:catalog-reader-view"})},55511:function(Ct,ke,n){"use strict";n.r(ke),n.d(ke,{TechDocsSearchResultListItem:function(){return de}});var r=n(52322),p=n(2784),W=n(79692),f=n(49378),z=n(86136),g=n(90436),u=n(53974),D=n(15096);const ge=(0,W.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),de=V=>{const{result:te,highlight:L,lineClamp:A=5,asListItem:ae=!0,asLink:oe=!0,title:ie,icon:q}=V,H=ge(),T=({children:G})=>oe?(0,r.jsx)(u.rU,{noTrack:!0,to:te.location,children:G}):(0,r.jsx)(r.Fragment,{children:G}),R=()=>{const G=L!=null&&L.fields.title?(0,r.jsx)(D.FA,{text:L.fields.title,preTag:L.preTag,postTag:L.postTag}):te.title,je=L!=null&&L.fields.entityTitle?(0,r.jsx)(D.FA,{text:L.fields.entityTitle,preTag:L.preTag,postTag:L.postTag}):te.entityTitle,Pe=L!=null&&L.fields.name?(0,r.jsx)(D.FA,{text:L.fields.name,preTag:L.preTag,postTag:L.postTag}):te.name;return te?(0,r.jsx)(f.Z,{className:H.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,r.jsx)(T,{children:ie||(0,r.jsxs)(r.Fragment,{children:[G," | ",je!=null?je:Pe," docs"]})}),secondary:(0,r.jsx)(g.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:A,overflow:"hidden"},color:"textSecondary",variant:"body2",children:L!=null&&L.fields.text?(0,r.jsx)(D.FA,{text:L.fields.text,preTag:L.preTag,postTag:L.postTag}):te.text})}):null},P=({children:G})=>ae?(0,r.jsxs)(r.Fragment,{children:[q&&(0,r.jsx)(z.Z,{children:typeof q=="function"?q(te):q}),(0,r.jsx)("div",{className:H.flexContainer,children:G})]}):(0,r.jsx)(r.Fragment,{children:G});return(0,r.jsx)(P,{children:(0,r.jsx)(R,{})})}},22478:function(Ct,ke,n){"use strict";n.d(ke,{S:function(){return D}});var r=n(52322),p=n(15096),W=n(2784),f=n(73557),z=n(55511);const g=ge=>ge==null?void 0:ge.document,u=ge=>{const{entityId:de,entityTitle:V,debounceTime:te=150}=ge,[L,A]=(0,W.useState)(!1),ae=(0,f.s0)(),{setFilters:oe,result:{loading:ie,value:q}}=(0,p.Rx)(),[H,T]=(0,W.useState)([]);(0,W.useEffect)(()=>{let Pe=!0;if(Pe&&q){const N=q.results.slice(0,10);T(N)}return()=>{Pe=!1}},[ie,q]);const{kind:R,name:P,namespace:G}=de;(0,W.useEffect)(()=>{oe(Pe=>({...Pe,kind:R,namespace:G,name:P}))},[R,G,P,oe]);const je=(Pe,N)=>{if(g(N)){const{location:_e}=N.document;ae(_e)}};return(0,r.jsx)(p.qO,{"data-testid":"techdocs-search-bar",size:"small",open:L,getOptionLabel:()=>"",filterOptions:Pe=>Pe,onClose:()=>{A(!1)},onFocus:()=>{A(!0)},onChange:je,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:H,renderOption:({document:Pe,highlight:N})=>(0,r.jsx)(z.TechDocsSearchResultListItem,{result:Pe,lineClamp:3,asListItem:!1,asLink:!1,title:Pe.title,highlight:N}),loading:ie,inputDebounceTime:te,inputPlaceholder:`Search ${V||de.name} docs`,freeSolo:!1})},D=ge=>{const de={term:"",types:["techdocs"],pageCursor:"",filters:ge.entityId};return(0,r.jsx)(p.Nd,{initialState:de,children:(0,r.jsx)(u,{...ge})})}},53260:function(){}},function(Ct){var ke=function(r){return Ct(Ct.s=r)};Ct.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,242,5109,6816,5218,4736],function(){return ke(30966)});var n=Ct.O()}]);})();
|
|
521
|
-
|
|
522
|
-
//# sourceMappingURL=main.f4c9013f.js.map
|