@techdocs/cli 1.2.4-next.2 → 1.2.4-next.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.
Files changed (24) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/embedded-app/.config-schema.json +109 -0
  3. package/dist/embedded-app/index.html +1 -1
  4. package/dist/embedded-app/static/{5837.c94ef7e1.chunk.js → 5837.76513d4f.chunk.js} +2 -2
  5. package/dist/embedded-app/static/{5837.c94ef7e1.chunk.js.map → 5837.76513d4f.chunk.js.map} +1 -1
  6. package/dist/embedded-app/static/{6051.be13f244.chunk.js → 6051.0cb12f85.chunk.js} +2 -2
  7. package/dist/embedded-app/static/{6051.be13f244.chunk.js.map → 6051.0cb12f85.chunk.js.map} +1 -1
  8. package/dist/embedded-app/static/{8951.4ac24e92.chunk.js → 8951.ab95d8c1.chunk.js} +2 -2
  9. package/dist/embedded-app/static/{8951.4ac24e92.chunk.js.map → 8951.ab95d8c1.chunk.js.map} +1 -1
  10. package/dist/embedded-app/static/main.6b6e0820.js +494 -0
  11. package/dist/embedded-app/static/main.6b6e0820.js.map +1 -0
  12. package/dist/embedded-app/static/module-remix-run.e15d5a2e.js +12 -0
  13. package/dist/embedded-app/static/module-remix-run.e15d5a2e.js.map +1 -0
  14. package/dist/embedded-app/static/{runtime.11a8d7f1.js → runtime.6b6e0820.js} +2 -2
  15. package/dist/embedded-app/static/{runtime.11a8d7f1.js.map → runtime.6b6e0820.js.map} +1 -1
  16. package/dist/embedded-app/static/{vendor.11a8d7f1.js → vendor.6b6e0820.js} +85 -85
  17. package/dist/embedded-app/static/vendor.6b6e0820.js.map +1 -0
  18. package/dist/index.cjs.js +1 -1
  19. package/package.json +4 -4
  20. package/dist/embedded-app/static/main.11a8d7f1.js +0 -494
  21. package/dist/embedded-app/static/main.11a8d7f1.js.map +0 -1
  22. package/dist/embedded-app/static/module-remix-run.ed639a8d.js +0 -12
  23. package/dist/embedded-app/static/module-remix-run.ed639a8d.js.map +0 -1
  24. package/dist/embedded-app/static/vendor.11a8d7f1.js.map +0 -1
@@ -1,494 +0,0 @@
1
- (()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{29644:function(It,ze,t){"use strict";t.d(ze,{n3:function(){return g},MS:function(){return b}});var h=t(25271),n=t(23054),W=t(96279),$=t.n(W);const g=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class b{async getEntityAncestors(P,ne){const{kind:Q,namespace:X,name:M}=(0,h.of)(P.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(Q)}/${encodeURIComponent(X)}/${encodeURIComponent(M)}/ancestry`,ne)}async getLocationById(P,ne){return await this.requestOptional("GET",`/locations/${encodeURIComponent(P)}`,ne)}async getEntities(P,ne){const{filter:Q=[],fields:X=[],offset:M,limit:z,after:_}=P!=null?P:{},ae=[];for(const O of[Q].flat()){const T=[];for(const[S,q]of Object.entries(O))for(const Te of[q].flat())Te===g?T.push(encodeURIComponent(S)):typeof Te=="string"&&T.push(`${encodeURIComponent(S)}=${encodeURIComponent(Te)}`);T.length&&ae.push(`filter=${T.join(",")}`)}X.length&&ae.push(`fields=${X.map(encodeURIComponent).join(",")}`),M!==void 0&&ae.push(`offset=${M}`),z!==void 0&&ae.push(`limit=${z}`),_!==void 0&&ae.push(`after=${encodeURIComponent(_)}`);const le=ae.length?`?${ae.join("&")}`:"",A=await this.requestRequired("GET",`/entities${le}`,ne),L=(O,T)=>{var S,q;if(((S=O.metadata)===null||S===void 0?void 0:S.name)===void 0||O.kind===void 0||((q=T.metadata)===null||q===void 0?void 0:q.name)===void 0||T.kind===void 0)return 0;const Te=(0,h.eE)(O),et=(0,h.eE)(T);return Te<et?-1:Te>et?1:0};return{items:A.sort(L)}}async getEntitiesByRefs(P,ne){var Q;const X=[];!((Q=P.fields)===null||Q===void 0)&&Q.length&&X.push(`fields=${P.fields.map(encodeURIComponent).join(",")}`);const M=await this.discoveryApi.getBaseUrl("catalog"),z=X.length?`?${X.join("&")}`:"",_=`${M}/entities/by-refs${z}`,ae=await this.fetchApi.fetch(_,{headers:{"Content-Type":"application/json",...(ne==null?void 0:ne.token)&&{Authorization:`Bearer ${ne==null?void 0:ne.token}`}},method:"POST",body:JSON.stringify({entityRefs:P.entityRefs})});if(!ae.ok)throw await n.VL.fromResponse(ae);const{items:le}=await ae.json();return{items:le}}async getEntityByRef(P,ne){const{kind:Q,namespace:X,name:M}=(0,h.of)(P);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(Q)}/${encodeURIComponent(X)}/${encodeURIComponent(M)}`,ne)}async getEntityByName(P,ne){const{kind:Q,namespace:X="default",name:M}=P;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(Q)}/${encodeURIComponent(X)}/${encodeURIComponent(M)}`,ne)}async refreshEntity(P,ne){const Q=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(ne==null?void 0:ne.token)&&{Authorization:`Bearer ${ne==null?void 0:ne.token}`}},method:"POST",body:JSON.stringify({entityRef:P})});if(Q.status!==200)throw new Error(await Q.text())}async getEntityFacets(P,ne){const{filter:Q=[],facets:X}=P,M=[];for(const _ of[Q].flat()){const ae=[];for(const[le,A]of Object.entries(_))for(const L of[A].flat())L===g?ae.push(encodeURIComponent(le)):typeof L=="string"&&ae.push(`${encodeURIComponent(le)}=${encodeURIComponent(L)}`);ae.length&&M.push(`filter=${ae.join(",")}`)}for(const _ of X)M.push(`facet=${encodeURIComponent(_)}`);const z=M.length?`?${M.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${z}`,ne)}async addLocation(P,ne){const{type:Q="url",target:X,dryRun:M}=P,z=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${M?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(ne==null?void 0:ne.token)&&{Authorization:`Bearer ${ne==null?void 0:ne.token}`}},method:"POST",body:JSON.stringify({type:Q,target:X})});if(z.status!==201)throw new Error(await z.text());const{location:_,entities:ae,exists:le}=await z.json();if(!_)throw new Error(`Location wasn't added: ${X}`);return{location:_,entities:ae,exists:le}}async getLocationByRef(P,ne){return(await this.requestRequired("GET","/locations",ne)).map(X=>X.data).find(X=>P===(0,h.NZ)(X))}async removeLocationById(P,ne){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(P)}`,ne)}async removeEntityByUid(P,ne){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(P)}`,ne)}async validateEntity(P,ne,Q){const X=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(Q==null?void 0:Q.token)&&{Authorization:`Bearer ${Q==null?void 0:Q.token}`}},method:"POST",body:JSON.stringify({entity:P,location:ne})});if(X.ok)return{valid:!0};if(X.status!==400)throw await n.VL.fromResponse(X);const{errors:M=[]}=await X.json();return{valid:!1,errors:M}}async requestIgnored(P,ne,Q){const X=`${await this.discoveryApi.getBaseUrl("catalog")}${ne}`,M=Q!=null&&Q.token?{Authorization:`Bearer ${Q.token}`}:{},z=await this.fetchApi.fetch(X,{method:P,headers:M});if(!z.ok)throw await n.VL.fromResponse(z)}async requestRequired(P,ne,Q){const X=`${await this.discoveryApi.getBaseUrl("catalog")}${ne}`,M=Q!=null&&Q.token?{Authorization:`Bearer ${Q.token}`}:{},z=await this.fetchApi.fetch(X,{method:P,headers:M});if(!z.ok)throw await n.VL.fromResponse(z);return await z.json()}async requestOptional(P,ne,Q){const X=`${await this.discoveryApi.getBaseUrl("catalog")}${ne}`,M=Q!=null&&Q.token?{Authorization:`Bearer ${Q.token}`}:{},z=await this.fetchApi.fetch(X,{method:P,headers:M});if(!z.ok){if(z.status===404)return;throw await n.VL.fromResponse(z)}return await z.json()}constructor(P){this.discoveryApi=P.discoveryApi,this.fetchApi=P.fetchApi||{fetch:$()}}}},25271:function(It,ze,t){"use strict";t.d(ze,{Tf:function(){return W},P1:function(){return ge},q1:function(){return ee},M6:function(){return Ae},l2:function(){return n},zG:function(){return h},w$:function(){return bn},nP:function(){return Zn},aS:function(){return Fn},S4:function(){return Xt},cz:function(){return Nn},iB:function(){return mt},CV:function(){return bt},of:function(){return rt},Ou:function(){return Fe},eE:function(){return ot},NZ:function(){return qe}});const h="default",n="backstage.io/view-url",W="backstage.io/edit-url",$="kubernetes.io/api-server",g="kubernetes.io/api-server-certificate-authority",b="kubernetes.io/auth-provider";var l=t(76635),P=t.n(l);class ne{async enforce(k){return k.metadata.namespace?k:lodash.merge({metadata:{namespace:this.namespace}},k)}constructor(k=DEFAULT_NAMESPACE){this.namespace=k}}class Q{static isValidPrefixAndOrSuffix(k,ce,Be,D){if(typeof k!="string")return!1;const U=k.split(ce);return U.length===1?D(U[0]):U.length===2?Be(U[0])&&D(U[1]):!1}static isJsonSafe(k){try{return P().isEqual(k,JSON.parse(JSON.stringify(k)))}catch{return!1}}static isValidDnsSubdomain(k){return typeof k=="string"&&k.length>=1&&k.length<=253&&k.split(".").every(Q.isValidDnsLabel)}static isValidDnsLabel(k){return typeof k=="string"&&k.length>=1&&k.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(k)}static isValidTag(k){return typeof k=="string"&&k.length>=1&&k.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(k)}static isValidUrl(k){if(typeof k!="string")return!1;try{return new URL(k),!0}catch{return!1}}static isValidString(k){var ce;return typeof k=="string"&&((ce=k==null?void 0:k.trim())===null||ce===void 0?void 0:ce.length)>=1}static isNonEmptyString(k){var ce;return typeof k=="string"&&((ce=k==null?void 0:k.trim())===null||ce===void 0?void 0:ce.length)>=1}}var X=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}}}}}'),M=t(27991),z=t.n(M),_=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}}}}}}'),le=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"common","type":"object","description":"Common definitions to import from other schemas","definitions":{"reference":{"$id":"#reference","type":"object","description":"A reference by name to another entity.","required":["kind","namespace","name"],"additionalProperties":false,"properties":{"kind":{"type":"string","description":"The kind field of the entity.","minLength":1},"namespace":{"type":"string","description":"The metadata.namespace field of the entity.","minLength":1},"name":{"type":"string","description":"The metadata.name field of the entity.","minLength":1}}},"relation":{"$id":"#relation","type":"object","description":"A directed relation from one entity to another.","required":["type","target"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference"},"targetRef":{"type":"string","minLength":1,"description":"The entity ref of the target of this relation."}}},"status":{"$id":"#status","type":"object","description":"The current status of the entity, as claimed by various sources.","required":[],"additionalProperties":true,"properties":{"items":{"type":"array","items":{"$ref":"#statusItem"}}}},"statusItem":{"$id":"#statusItem","type":"object","description":"A specific status item on a well known format.","required":["type","level","message"],"additionalProperties":true,"properties":{"type":{"type":"string","minLength":1},"level":{"$ref":"#statusLevel","description":"The status level / severity of the status item."},"message":{"type":"string","description":"A brief message describing the status, intended for human consumption."},"error":{"$ref":"#error","description":"An optional serialized error object related to the status."}}},"statusLevel":{"$id":"#statusLevel","type":"string","description":"A status level / severity.","enum":["info","warning","error"]},"error":{"$id":"#error","type":"object","description":"A serialized error object.","required":["name","message"],"additionalProperties":true,"properties":{"name":{"type":"string","examples":["Error","InputError"],"description":"The type name of the error","minLength":1},"message":{"type":"string","description":"The message of the error"},"code":{"type":"string","description":"An error code associated with the error"},"stack":{"type":"string","description":"An error stack trace"}}}}}');const A=new Map,L=[X,_,ae,le];function O(ie){if(!(ie!=null&&ie.length))throw new TypeError("Unknown error");const k=ie[0];throw new TypeError(`${k.instancePath||"<root>"} ${k.message}${k.params?` - ${Object.entries(k.params).map(([ce,Be])=>`${ce}: ${Be}`).join(", ")}`:""}`)}function T(ie,k={}){var ce;const Be=(ce=k==null?void 0:k.disableCache)!==null&&ce!==void 0?ce:!1,D=Be?"":JSON.stringify(ie);if(!Be){const ye=A.get(D);if(ye)return ye}const U=S(ie),de=new(z())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});U.length&&de.addSchema(U,void 0,void 0,!0);const fe=de.compile(ie);return Be||A.set(D,fe),fe}function S(ie){if(typeof ie!="object")return[];const k=new Set;ie.$id&&k.add(ie.$id);const ce=new Array,Be=[ie];for(;Be.length;){const D=Be.pop();for(const U of q(D))if(!k.has(U)){k.add(U);const de=L.find(fe=>fe.$id===U);de&&(ce.push(de),Be.push(de))}}return ce}function*q(ie){const k=[ie];for(;k.length;){const ce=k.pop();if(typeof ce=="object"&&ce)for(const[Be,D]of Object.entries(ce))Be==="$ref"&&typeof D=="string"?yield D.split("#")[0]:k.push(D)}}function Te(ie){const k=compileAjvSchema(ie||entityEnvelopeSchema);return ce=>{if(k(ce)===!0)return ce;throw throwAjvError(k.errors)}}function et(ie){const k=T(ie);return ce=>{var Be;if(k(ce)===!0)return ce;const U=(Be=k.errors)===null||Be===void 0?void 0:Be.filter(de=>["/kind","/apiVersion"].includes(de.instancePath));if((U==null?void 0:U.length)&&U.every(de=>de.keyword==="enum"))return!1;throw O(k.errors)}}function Xe(ie){const k=compileAjvSchema(ie||entitySchema);return ce=>{if(k(ce)===!0)return ce;throw throwAjvError(k.errors)}}class Je{static isValidApiVersion(k){return Q.isValidPrefixAndOrSuffix(k,"/",Q.isValidDnsSubdomain,ce=>ce.length>=1&&ce.length<=63&&/^[a-z0-9A-Z]+$/.test(ce))}static isValidKind(k){return typeof k=="string"&&k.length>=1&&k.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(k)}static isValidObjectName(k){return typeof k=="string"&&k.length>=1&&k.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(k)}static isValidNamespace(k){return Q.isValidDnsLabel(k)}static isValidLabelKey(k){return Q.isValidPrefixAndOrSuffix(k,"/",Q.isValidDnsSubdomain,Je.isValidObjectName)}static isValidLabelValue(k){return k===""||Je.isValidObjectName(k)}static isValidAnnotationKey(k){return Q.isValidPrefixAndOrSuffix(k,"/",Q.isValidDnsSubdomain,Je.isValidObjectName)}static isValidAnnotationValue(k){return typeof k=="string"}}const He={isValidApiVersion:Je.isValidApiVersion,isValidKind:Je.isValidKind,isValidEntityName:Je.isValidObjectName,isValidNamespace:Je.isValidNamespace,isValidLabelKey:Je.isValidLabelKey,isValidLabelValue:Je.isValidLabelValue,isValidAnnotationKey:Je.isValidAnnotationKey,isValidAnnotationValue:Je.isValidAnnotationValue,isValidTag:ie=>typeof ie=="string"&&ie.length>=1&&ie.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(ie)};function gt(ie={}){return{...He,...ie}}class Ee{async enforce(k){function ce(C,H,me){if(H==null)throw new Error(`${C} must have a value`);let ue;try{ue=me(H)}catch(Ce){throw new Error(`${C} could not be validated, ${Ce}`)}if(!ue){let Ce;switch(me.name){case"isValidLabelValue":case"isValidObjectName":Ce="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":Ce="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":Ce="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":Ce="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":Ce="a string";break;case"isValidKind":Ce="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":Ce="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":Ce="a non empty string";break;default:Ce=void 0;break}const ke=Ce?` expected ${Ce} but found "${H}".`:"";throw new Error(`"${C}" is not valid;${ke} 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 Be(C,H,me){return H===void 0||ce(C,H,me)}ce("apiVersion",k.apiVersion,this.validators.isValidApiVersion),ce("kind",k.kind,this.validators.isValidKind),ce("metadata.name",k.metadata.name,this.validators.isValidEntityName),Be("metadata.namespace",k.metadata.namespace,this.validators.isValidNamespace);var D;for(const[C,H]of Object.entries((D=k.metadata.labels)!==null&&D!==void 0?D:[]))ce(`labels.${C}`,C,this.validators.isValidLabelKey),ce(`labels.${C}`,H,this.validators.isValidLabelValue);var U;for(const[C,H]of Object.entries((U=k.metadata.annotations)!==null&&U!==void 0?U:[]))ce(`annotations.${C}`,C,this.validators.isValidAnnotationKey),ce(`annotations.${C}`,H,this.validators.isValidAnnotationValue);var de;const fe=(de=k.metadata.tags)!==null&&de!==void 0?de:[];for(let C=0;C<fe.length;++C)ce(`tags.${C}`,fe[C],this.validators.isValidTag);var ye;const Pe=(ye=k.metadata.links)!==null&&ye!==void 0?ye:[];for(let C=0;C<Pe.length;++C){var Le,Me,nt;ce(`links.${C}.url`,(Le=Pe[C])===null||Le===void 0?void 0:Le.url,CommonValidatorFunctions.isValidUrl),Be(`links.${C}.title`,(Me=Pe[C])===null||Me===void 0?void 0:Me.title,CommonValidatorFunctions.isNonEmptyString),Be(`links.${C}.icon`,(nt=Pe[C])===null||nt===void 0?void 0:nt.icon,KubernetesValidatorFunctions.isValidObjectName)}return k}constructor(k=makeValidator()){this.validators=k}}class Ke{async enforce(k){if(!this.validate){const D=new Ajv({allowUnionTypes:!0});this.validate=D.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(k)===!0)return k;const[Be]=this.validate.errors||[];throw Be?new Error(`Malformed envelope, ${Be.instancePath||"<root>"} ${Be.message}`):new Error("Malformed envelope, Unknown error")}}function st(ie){let k=ie.indexOf(":");const ce=ie.indexOf("/");ce!==-1&&ce<k&&(k=-1);const Be=k===-1?void 0:ie.slice(0,k),D=ce===-1?void 0:ie.slice(k+1,ce),U=ie.slice(Math.max(k+1,ce+1));if(Be===""||D===""||U==="")throw new TypeError(`Entity reference "${ie}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Be,namespace:D,name:U}}function mt(ie){return{kind:ie.kind,namespace:ie.metadata.namespace||h,name:ie.metadata.name}}function rt(ie,k){if(!ie)throw new Error("Entity reference must not be empty");const ce=k==null?void 0:k.defaultKind,Be=(k==null?void 0:k.defaultNamespace)||h;let D,U,de;if(typeof ie=="string"){const Me=st(ie);var fe;D=(fe=Me.kind)!==null&&fe!==void 0?fe:ce;var ye;U=(ye=Me.namespace)!==null&&ye!==void 0?ye:Be,de=Me.name}else{var Pe;D=(Pe=ie.kind)!==null&&Pe!==void 0?Pe:ce;var Le;U=(Le=ie.namespace)!==null&&Le!==void 0?Le:Be,de=ie.name}if(D)if(U){if(!de){const Me=JSON.stringify(ie);throw new Error(`Entity reference ${Me} had missing or empty name`)}}else{const Me=JSON.stringify(ie);throw new Error(`Entity reference ${Me} had missing or empty namespace`)}else{const Me=JSON.stringify(ie);throw new Error(`Entity reference ${Me} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:D,namespace:U,name:de}}function ot(ie){let k,ce,Be;if("metadata"in ie){k=ie.kind;var D;ce=(D=ie.metadata.namespace)!==null&&D!==void 0?D:h,Be=ie.metadata.name}else{k=ie.kind;var U;ce=(U=ie.namespace)!==null&&U!==void 0?U:h,Be=ie.name}return`${k.toLocaleLowerCase("en-US")}:${ce.toLocaleLowerCase("en-US")}/${Be.toLocaleLowerCase("en-US")}`}class ut{async enforce(k){let ce=k;for(const Be of this.policies){const D=await Be.enforce(ce);if(!D)throw new Error(`Policy ${Be.constructor.name} did not return a result`);ce=D}return ce}constructor(k){this.policies=k}}class xt{async enforce(k){for(const ce of this.policies){const Be=await ce.enforce(k);if(Be)return Be}throw new Error("The entity did not match any known policy")}constructor(k){this.policies=k}}const Rt={allOf(ie){return new ut(ie)},oneOf(ie){return new xt(ie)}};var We=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ApiV1alpha1","description":"An API describes an interface that can be exposed by a component. The API can be defined in different formats, like OpenAPI, AsyncAPI, GraphQL, gRPC, or other formats.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"API","metadata":{"name":"artist-api","description":"Retrieve artist details","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"openapi","lifecycle":"production","owner":"artist-relations-team","system":"artist-engagement-portal","definition":"openapi: \\"3.0.0\\"\\ninfo:..."}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["API"]},"spec":{"type":"object","required":["type","lifecycle","owner","definition"],"properties":{"type":{"type":"string","description":"The type of the API definition.","examples":["openapi","asyncapi","graphql","grpc"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the API.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the API.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the API belongs to.","minLength":1},"definition":{"type":"string","description":"The definition of the API, based on the format defined by the type.","minLength":1}}}}}]}');function se(ie){let k;return{async check(ce){return k||(k=et(ie)),k(ce)===ce}}}const Ie=se(We);var Re=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 tt=se(Re);var vt=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"DomainV1alpha1","description":"A Domain groups a collection of systems that share terminology, domain models, business purpose, or documentation, i.e. form a bounded context.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Domain","metadata":{"name":"artists","description":"Everything about artists"},"spec":{"owner":"artist-relations-team"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Domain"]},"spec":{"type":"object","required":["owner"],"properties":{"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1}}}}}]}');const $t=se(vt);var pt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"GroupV1alpha1","description":"A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Group","metadata":{"name":"infrastructure","description":"The infra business unit"},"spec":{"type":"business-unit","profile":{"displayName":"Infrastructure","email":"infrastructure@example.com","picture":"https://example.com/groups/bu-infrastructure.jpeg"},"parent":"ops","children":["backstage","other"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Group"]},"spec":{"type":"object","required":["type","children"],"properties":{"type":{"type":"string","description":"The type of group. There is currently no enforced set of values for this field, so it is left up to the adopting organization to choose a nomenclature that matches their org hierarchy.","examples":["team","business-unit","product-area","root"],"minLength":1},"profile":{"type":"object","description":"Optional profile information about the group, mainly for display purposes. All fields of this structure are also optional. The email would be a group email of some form, that the group may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the group, and that a browser could fetch and render on a group page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Infrastructure"],"minLength":1},"email":{"type":"string","description":"An email where this entity can be reached.","examples":["infrastructure@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this entity.","examples":["https://example.com/groups/bu-infrastructure.jpeg"],"minLength":1}}},"parent":{"type":"string","description":"The immediate parent group in the hierarchy, if any. Not all groups must have a parent; the catalog supports multi-root hierarchies. Groups may however not have more than one parent. This field is an entity reference.","examples":["ops"],"minLength":1},"children":{"type":"array","description":"The immediate child groups of this group in the hierarchy (whose parent field points to this group). The list must be present, but may be empty if there are no child groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["backstage","other"],"minLength":1}},"members":{"type":"array","description":"The users that are members of this group. The entries of this array are entity references.","items":{"type":"string","examples":["jdoe"],"minLength":1}}}}}}]}`);const Et=se(pt);var At=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 kt=se(At),Xt="ownedBy",Wt="ownerOf",Vt="consumesApi",Yt="apiConsumedBy",cn="providesApi",on="apiProvidedBy",Zn="dependsOn",bn="dependencyOf",Dn="parentOf",pn="childOf",dn="memberOf",Jt="hasMember",Nn="partOf",Fn="hasPart";var un=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 fn=se(un);var gn=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 In=se(gn);var Rn=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 mn=se(Rn),ge="backstage.io/managed-by-location",ee="backstage.io/managed-by-origin-location",Ae="backstage.io/source-location";function Fe(ie){if(typeof ie!="string")throw new TypeError(`Unable to parse location ref '${ie}', unexpected argument ${typeof ie}`);const k=ie.indexOf(":");if(k<0)throw new TypeError(`Unable to parse location ref '${ie}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const ce=ie.substring(0,k).trim(),Be=ie.substring(k+1).trim();if(!ce||!Be)throw new TypeError(`Unable to parse location ref '${ie}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(ce==="http"||ce==="https")throw new TypeError(`Invalid location ref '${ie}', please prefix it with 'url:', e.g. 'url:${ie}'`);return{type:ce,target:Be}}function qe(ie){const{type:k,target:ce}=ie;if(k){if(!ce)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");return`${k}:${ce}`}function bt(ie){var k,ce,Be,D,U;const de=(U=(k=ie.metadata)===null||k===void 0||(ce=k.annotations)===null||ce===void 0?void 0:ce[Ae])!==null&&U!==void 0?U:(Be=ie.metadata)===null||Be===void 0||(D=Be.annotations)===null||D===void 0?void 0:D[ge];if(!de)throw new Error(`Entity '${ot(ie)}' is missing location`);return Fe(de)}},93414:function(It,ze,t){"use strict";t.d(ze,{zx:function(){return gt},Oi:function(){return se},VY:function(){return Ri},yW:function(){return Ja},XF:function(){return tt},mn:function(){return bt},NX:function(){return h},ub:function(){return Me},mf:function(){return el},yu:function(){return tn},h4:function(){return Ui},M6:function(){return rr},i9:function(){return ul},aR:function(){return Li},rJ:function(){return Tr},Oh:function(){return vl},hu:function(){return fl},rU:function(){return Je},nU:function(){return Er},sk:function(){return lt},Or:function(){return mr},T3:function(){return Mi},g9:function(){return bl},Ex:function(){return zt},Gk:function(){return w},tn:function(){return Pi},Ph:function(){return jn},YE:function(){return a},v7:function(){return la},R6:function(){return Ti},tR:function(){return qo},uw:function(){return Sa},qt:function(){return Si},iA:function(){return Fi},GB:function(){return vn},po:function(){return ur},mZ:function(){return Ps},Pf:function(){return Wr}});var h={};t.r(h),t.d(h,{Nm:function(){return vt},ht:function(){return Et},LJ:function(){return pt}});var n=t(52322),W=t(25248),$=t(19928),g=t(2784);function b(e){const[s,i]=useState([]),u=useApi(alertApiRef),{anchorOrigin:p={vertical:"top",horizontal:"center"},transientTimeoutMs:m}=e,E=m!=null?m:5e3;useEffect(()=>{const F=u.alert$().subscribe(pe=>i(re=>re.concat(pe)));return()=>{F.unsubscribe()}},[u]);const[B]=s;if(useEffect(()=>{if(B&&B.display==="transient"){const F=setTimeout(()=>{i(pe=>{const re=pe.filter(xe=>xe!==B);return re.length===pe.length?pe:re})},E);return()=>clearTimeout(F)}},[B,E]),s.length===0)return null;const G=()=>{i(F=>F.filter(pe=>pe!==B))};return _jsx(Snackbar,{open:!0,anchorOrigin:p,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:G,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:B.severity,children:_jsxs(Typography,{component:"span",children:[String(B.message),s.length>1&&_jsx("em",{children:` (${s.length-1} older ${pluralize("message",s.length-1)})`})]})})})}var l=t(79692),P=t(12420);const ne=(0,l.Z)(e=>(0,P.Z)({avatar:{width:"4rem",height:"4rem",color:"#fff"},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function Q(e){const{displayName:s,picture:i,customStyles:u}=e,p=ne();let m={...u};const E={fontFamily:m.fontFamily,fontSize:m.fontSize,fontWeight:m.fontWeight};return i||(m={backgroundColor:stringToColor(s||""),...u}),_jsx(MaterialAvatar,{alt:s,src:i,className:p.avatar,style:m,children:s&&_jsx(Typography,{variant:"h6",component:"span",className:p.avatarText,style:E,children:extractInitials(s)})})}var X=t(77277),M=t(86689),z=t(90436),_=t(72779),ae=t.n(_),le=t(76635),A=t(73557),L=t(39857);function O(){const[e]=(0,A.is)((0,n.jsx)(A.AW,{index:!0,element:(0,n.jsx)("div",{})}));return!e.index}const T=(0,l.Z)({visuallyHidden:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",height:1,width:1},externalLink:{position:"relative"}},{name:"Link"}),S=e=>/^([a-z+.-]+):/.test(e),q=()=>{try{return(0,W.h_)(W.Ds).getOptionalString("app.baseUrl")}catch{return}},Te=()=>{const e="http://sample.dev";var s;const i=(s=q())!==null&&s!==void 0?s:"/",{pathname:u}=new URL(i,e);return(0,le.trimEnd)(u,"/")},et=e=>{let s=String(e);const i=Te(),u=S(s),p=s.startsWith(i);return!u&&!p&&(s=i.concat(s)),s},Xe=e=>{if(e instanceof Array)return e.map(Xe).join(" ").trim();if(typeof e=="object"&&e){var s;return Xe(e==null||(s=e.props)===null||s===void 0?void 0:s.children)}return["string","number"].includes(typeof e)?String(e):""},Je=g.forwardRef(({onClick:e,noTrack:s,...i},u)=>{const p=T(),m=(0,W.z$)(),E=O()?et(i.to):i.to,B=Xe(i.children)||E,G=S(E),F=G&&!!/^https?:/.exec(E),pe=re=>{e==null||e(re),s||m.captureEvent("click",B,{attributes:{to:E}})};return G?(0,n.jsxs)(M.Z,{...F?{target:"_blank",rel:"noopener"}:{},...i,ref:u,href:E,onClick:pe,className:ae()(p.externalLink,i.className),children:[i.children,(0,n.jsx)(z.Z,{component:"span",className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,n.jsx)(M.Z,{...i,ref:u,component:L.rU,to:E,onClick:pe})}),He=g.forwardRef((e,s)=>(0,n.jsx)(Je,{ref:s,...e,color:"initial"})),gt=g.forwardRef((e,s)=>(0,n.jsx)(X.Z,{ref:s,component:He,...e}));var Ee=t(95544),Ke=t(60364),st=t(83229),mt=t(26639),rt=t(39595),ot=t(61837),ut=t(80030),xt=t(19353),Rt=t(95074);function We(e){const{text:s,tooltipDelay:i=1e3,tooltipText:u="Text copied to clipboard","aria-label":p="Copy text"}=e,m=(0,W.h_)(W.VE),[E,B]=(0,g.useState)(!1),[{error:G},F]=(0,Rt.Z)();(0,g.useEffect)(()=>{G&&m.post(G)},[G,m]);const pe=re=>{re.stopPropagation(),B(!0),F(s)};return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(ut.ZP,{id:"copy-test-tooltip",title:u,placement:"top",leaveDelay:i,onClose:()=>B(!1),open:E,children:(0,n.jsx)(ot.Z,{onClick:pe,"aria-label":p,children:(0,n.jsx)(xt.Z,{})})})})}function se(e){const{text:s,language:i,showLineNumbers:u=!1,highlightedNumbers:p,customStyle:m,showCopyCodeButton:E=!1}=e,B=(0,Ke.Z)(),G=B.palette.type==="dark"?mt.Z:rt.Z,F=B.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,n.jsxs)(Ee.Z,{position:"relative",children:[(0,n.jsx)(st.Z,{customStyle:m,language:i,style:G,showLineNumbers:u,wrapLines:!0,lineNumberStyle:{color:B.palette.textVerySubtle},lineProps:pe=>p!=null&&p.includes(pe)?{style:{backgroundColor:F}}:{},children:s}),E&&(0,n.jsx)(Ee.Z,{position:"absolute",top:0,right:0,children:(0,n.jsx)(We,{text:s})})]})}var Ie=t(41156),Re=t(88188);function tt(e){const{title:s,to:i}=e,u=(0,Ie.Z)(p=>p.breakpoints.down("xs"));return i?u?(0,n.jsx)(ot.Z,{component:L.rU,color:"primary",title:s,size:"small",to:i,children:(0,n.jsx)(Re.Z,{})}):(0,n.jsx)(X.Z,{component:L.rU,variant:"contained",color:"primary",to:i,children:s}):null}var vt;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(vt||(vt={}));var $t;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})($t||($t={}));var pt;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(pt||(pt={}));var Et;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(Et||(Et={}));var At=t(27397),kt=t(11105),Xt=t(97963),Wt=t(46506),Vt=t.n(Wt),Yt=t(54073),cn=t.n(Yt),on=t(10368);const Zn=(0,l.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function bn({node:{id:e}}){const s=Zn(),[i,u]=g.useState(0),[p,m]=g.useState(0),E=g.useRef(null);g.useLayoutEffect(()=>{if(E.current){let{height:pe,width:re}=E.current.getBBox();pe=Math.round(pe),re=Math.round(re),(pe!==p||re!==i)&&(u(re),m(pe))}},[i,p]);const B=10,G=i+B*2,F=p+B*2;return(0,n.jsxs)("g",{children:[(0,n.jsx)("rect",{className:s.node,width:G,height:F,rx:10}),(0,n.jsx)("text",{ref:E,className:s.text,y:F/2,x:G/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const Dn="arrow-marker",pn="node",dn="edge",Jt="label",Nn=(0,on.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),Fn=e=>(0,n.jsx)(bn,{...e});function un({render:e=Fn,setNode:s,node:i}){const{width:u,height:p,x:m=0,y:E=0}=i,B=i,G=Nn(),F=g.useRef(null);return g.useLayoutEffect(()=>{if(F.current){let{height:pe,width:re}=F.current.getBBox();pe=Math.round(pe),re=Math.round(re),(pe!==p||re!==u)&&s(i.id,{...i,height:pe,width:re})}},[i,u,p,s]),(0,n.jsx)("g",{ref:F,"data-testid":pn,className:G.node,transform:`translate(${m-u/2},${E-p/2})`,children:e({node:B})})}var fn=t(76985),gn=t(27916),In=t(19574),Rn=t.n(In);const mn=(0,on.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function ge({edge:{label:e}}){const s=mn();return(0,n.jsx)("text",{className:s.text,textAnchor:"middle",children:e})}const ee=(0,on.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"}),Ae=e=>(0,n.jsx)(ge,{...e});function Fe({render:e=Ae,setEdge:s,id:i,edge:u,curve:p}){const{x:m=0,y:E=0,width:B,height:G,points:F}=u,pe=u,re=ee(),xe=g.useRef(null);g.useLayoutEffect(()=>{if(xe.current){let{height:Qe,width:Lt}=xe.current.getBBox();Qe=Math.round(Qe),Lt=Math.round(Lt),(Qe!==G||Lt!==B)&&s(i,{...u,height:Qe,width:Lt})}},[u,G,B,s,i]);let je="";const Ge=g.useMemo(()=>fn.Z().x(Qe=>Qe.x).y(Qe=>Qe.y).curve(gn[p]),[p]);if(F){const Qe=F.filter(Lt=>Rn()(Lt.x)&&Rn()(Lt.y));je=Ge(Qe)||""}return(0,n.jsxs)(n.Fragment,{children:[je&&(0,n.jsx)("path",{"data-testid":dn,className:re.path,d:je}),pe.label?(0,n.jsx)("g",{ref:xe,"data-testid":Jt,className:re.label,transform:`translate(${m},${E})`,children:e({edge:pe})}):null]})}const qe="workspace";function bt(e){var s,i;const{edges:u,nodes:p,renderNode:m,direction:E=vt.TOP_BOTTOM,align:B,nodeMargin:G=50,edgeMargin:F=10,rankMargin:pe=50,paddingX:re=0,paddingY:xe=0,acyclicer:je,ranker:Ge=pt.NETWORK_SIMPLEX,labelPosition:Qe=Et.RIGHT,labelOffset:Lt=10,edgeRanks:Ht=1,edgeWeight:_t=1,renderLabel:en,defs:Pt,zoom:Qt="enabled",curve:Gt="curveMonotoneX",fit:xr="grow",...br}=e,Sr=(0,Xt.Z)(),[Cr,ai]=g.useState(100),[Or,li]=g.useState(100),Kt=g.useRef(new(Vt()).graphlib.Graph),[is,xo]=g.useState(((s=Kt.current.graph())===null||s===void 0?void 0:s.width)||0),[Br,ci]=g.useState(((i=Kt.current.graph())===null||i===void 0?void 0:i.height)||0),[Bn,hr]=g.useState([]),[Vr,Hr]=g.useState([]),rn=Math.max(is,Cr),hn=Math.max(Br,Or),as=Math.min(Br,Or),Gr=xr==="grow"?hn:as,Bs=g.useMemo(()=>cn()(ln=>{if(!ln)return;const $n=kt.Z(ln),sn=kt.Z(ln.getElementById(qe));function lr(){$n.call(At.sP().scaleExtent([1,10]).on("zoom",wr=>{wr.transform.x=Math.min(0,Math.max(wr.transform.x,rn-rn*wr.transform.k)),wr.transform.y=Math.min(0,Math.max(wr.transform.y,hn-hn*wr.transform.k)),sn.attr("transform",wr.transform)}))}Qt==="enabled"?lr():Qt==="enable-on-click"&&$n.on("click",()=>lr());const{width:cr,height:bo}=ln.getBoundingClientRect();Cr!==cr&&ai(cr),Or!==bo&&li(bo)},100),[Or,Cr,rn,hn,Qt]),Yi=g.useCallback(()=>{const ln=Kt.current.nodes(),$n=Kt.current.edges();ln.forEach(sn=>{p.some(cr=>cr.id===sn)||Kt.current.removeNode(sn)}),$n.forEach(sn=>{u.some(cr=>cr.from===sn.v&&cr.to===sn.w)||Kt.current.removeEdge(sn.v,sn.w)}),p.forEach(sn=>{const lr=Kt.current.nodes().find(cr=>sn.id===cr);if(lr&&Kt.current.node(lr)){const{width:cr,height:bo,x:wr,y:Fl}=Kt.current.node(lr);Kt.current.setNode(lr,{...sn,width:cr,height:bo,x:wr,y:Fl})}else Kt.current.setNode(sn.id,{...sn,width:0,height:0})}),u.forEach(sn=>{Kt.current.setEdge(sn.from,sn.to,{...sn,label:sn.label,width:0,height:0,labelpos:Qe,labeloffset:Lt,weight:_t,minlen:Ht})})},[u,p,Qe,Lt,_t,Ht]),$s=g.useMemo(()=>cn()(()=>{Vt().layout(Kt.current);const{height:ln,width:$n}=Kt.current.graph(),sn=Math.max(0,ln||0),lr=Math.max(0,$n||0);xo(lr),ci(sn),hr(Kt.current.nodes()),Hr(Kt.current.edges())},250,{leading:!0}),[]);g.useEffect(()=>(Kt.current.setGraph({rankdir:E,align:B,nodesep:G,edgesep:F,ranksep:pe,marginx:re,marginy:xe,acyclicer:je,ranker:Ge}),Yi(),$s(),$s.cancel),[je,B,E,F,re,xe,G,pe,Ge,Yi,$s]);function Dl(ln,$n){return Kt.current.setNode(ln,$n),$s(),Kt.current}function Nl(ln,$n){return Kt.current.setEdge(ln,$n),$s(),Kt.current}return(0,n.jsxs)("svg",{ref:Bs,...br,width:"100%",height:Gr,viewBox:`0 0 ${rn} ${hn}`,children:[(0,n.jsxs)("defs",{children:[(0,n.jsx)("marker",{id:Dn,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,n.jsx)("path",{fill:Sr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),Pt]}),(0,n.jsx)("g",{id:qe,children:(0,n.jsxs)("svg",{width:is,height:Br,y:hn/2-Br/2,x:rn/2-is/2,viewBox:`0 0 ${is} ${Br}`,children:[Vr.map(ln=>{const $n=Kt.current.edge(ln);return $n?(0,n.jsx)(Fe,{id:ln,setEdge:Nl,render:en,edge:$n,curve:Gt},`${ln.v}-${ln.w}`):null}),Bn.map(ln=>{const $n=Kt.current.node(ln);return $n?(0,n.jsx)(un,{setNode:Dl,render:m,node:$n},ln):null})]})})]})}var ie;const k=(0,l.Z)(e=>({root:{padding:e.spacing(0),marginBottom:e.spacing(0),marginTop:e.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:e.spacing(6),marginTop:-e.spacing(3),zIndex:"unset"},icon:{fontSize:e.typography.h6.fontSize},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap"},message:{display:"flex",alignItems:"center",color:e.palette.banner.text,"& a":{color:e.palette.banner.link}},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(ie=e.palette.banner.warning)!==null&&ie!==void 0?ie:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),ce=e=>{const{variant:s,message:i,id:u,fixed:p=!1}=e,m=k(),B=useApi(storageApiRef).forBucket("notifications");var G;const F=(G=B.snapshot("dismissedBanners").value)!==null&&G!==void 0?G:[],[pe,re]=useState(new Set(F)),xe=useObservable(B.observe$("dismissedBanners"));useEffect(()=>{if(xe!=null&&xe.value){var Ge;const Qe=(Ge=xe==null?void 0:xe.value)!==null&&Ge!==void 0?Ge:[];re(new Set(Qe))}},[xe==null?void 0:xe.value]);const je=()=>{B.set("dismissedBanners",[...pe,u])};return _jsx(Snackbar,{anchorOrigin:p?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!pe.has(u),classes:{root:classNames(m.root,!p&&m.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(m.content,m[s]),message:m.message},message:i,action:[_jsx(IconButton,{title:"Permanently dismiss this message",color:"inherit",onClick:je,children:_jsx(Close,{className:m.icon})},"dismiss")]})})};var Be=t(60905),D=t.p+"static/missingAnnotation.67f79e98..svg",U=t.p+"static/noInformation.4b426325..svg",de=t.p+"static/createComponent.975d1e1e..svg",fe=t.p+"static/noBuild.1715fa71..svg";const ye=(0,l.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),Pe=({missing:e})=>{const s=ye();switch(e){case"field":return(0,n.jsx)("img",{src:D,className:s.generalImg,alt:"annotation is missing"});case"info":return(0,n.jsx)("img",{src:U,alt:"no Information",className:s.generalImg});case"content":return(0,n.jsx)("img",{src:de,alt:"create Component",className:s.generalImg});case"data":return(0,n.jsx)("img",{src:fe,alt:"no Build",className:s.generalImg});default:return null}},Le=(0,l.Z)(e=>({root:{backgroundColor:e.palette.background.default,padding:e.spacing(2,0,0,0)},action:{marginTop:e.spacing(2)},imageContainer:{position:"relative"}}),{name:"BackstageEmptyState"});function Me(e){const{title:s,description:i,missing:u,action:p}=e,m=Le();return(0,n.jsxs)(Be.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:m.root,spacing:2,children:[(0,n.jsx)(Be.Z,{item:!0,xs:12,md:6,children:(0,n.jsxs)(Be.Z,{container:!0,direction:"column",children:[(0,n.jsx)(Be.Z,{item:!0,xs:!0,children:(0,n.jsx)(z.Z,{variant:"h5",children:s})}),(0,n.jsx)(Be.Z,{item:!0,xs:!0,children:(0,n.jsx)(z.Z,{variant:"body1",children:i})}),(0,n.jsx)(Be.Z,{item:!0,xs:!0,className:m.action,children:p})]})}),(0,n.jsx)(Be.Z,{item:!0,xs:12,md:6,className:m.imageContainer,children:typeof u=="string"?(0,n.jsx)(Pe,{missing:u}):u.customImage})]})}const nt=`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`,C=/^.*ANNOTATION.*$/m,H=nt.match(C)[0],me=nt.split(`
12
- `).findIndex(e=>C.test(e)),ue=(0,l.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":"#fff"}}),{name:"BackstageMissingAnnotationEmptyState"});function Ce(e){return Array.from(Array(e+1).keys(),s=>s+me)}function ke(e){const s=e.map(i=>H.replace("ANNOTATION",i)).join(`
13
- `);return nt.replace(H,s)}function Ue(e){const s=e.length<=1;return(0,n.jsxs)(n.Fragment,{children:["The ",s?"annotation":"annotations"," ",e.map(i=>(0,n.jsx)("code",{children:i})).reduce((i,u)=>(0,n.jsxs)(n.Fragment,{children:[i,", ",u]}))," ",s?"is":"are"," missing. You need to add the"," ",s?"annotation":"annotations"," to your component if you want to enable this tool."]})}function lt(e){const{annotation:s,readMoreUrl:i}=e,u=Array.isArray(s)?s:[s],p=i||"https://backstage.io/docs/features/software-catalog/well-known-annotations",m=ue();return(0,n.jsx)(Me,{missing:"field",title:"Missing Annotation",description:Ue(u),action:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(z.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,n.jsx)(Ee.Z,{className:m.code,children:(0,n.jsx)(se,{text:ke(u),language:"yaml",showLineNumbers:!0,highlightedNumbers:Ce(u.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(X.Z,{color:"primary",component:Je,to:p,children:"Read more"})]})})}var St=t(11776),Ye=t(38402),ft=t(49378),yt=t(41128),ct=t(27616),Tt=t(8284),Nt=t(70660),Ft=t(91750),Un=t(38016);const Mn=(e,s)=>(s.palette.type==="light"?yt._j:yt.$n)(s.palette[e].light,.6),Sn=(e,s)=>(s.palette.type==="light"?yt.$n:yt._j)(s.palette[e].light,.9),Ut=(0,l.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:s})=>Mn(s,e)}})),Mt=({severity:e})=>{const s=Ut({severity:e});return(0,n.jsx)(Ft.Z,{classes:s})},an=({severity:e})=>{const s=Ut({severity:e});return(0,n.jsx)(Un.Z,{classes:s})},Cn=(0,l.Z)(e=>({panel:{backgroundColor:({severity:s})=>Sn(s,e),color:({severity:s})=>Mn(s,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:s})=>Mn(s,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:s})=>Mn(s,e),backgroundColor:({severity:s})=>Sn(s,e)},details:{width:"100%",display:"block",color:e.palette.textContrast,backgroundColor:e.palette.background.default,border:`1px solid ${e.palette.border}`,padding:e.spacing(2),fontFamily:"sans-serif"}}),{name:"BackstageWarningPanel"}),Jn=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function vn(e){const{severity:s="warning",title:i,message:u,children:p,defaultExpanded:m}=e,E=Cn({severity:s}),B=Jn(s)+(i?`: ${i}`:"");return(0,n.jsxs)(ct.Z,{defaultExpanded:m!=null?m:!1,className:E.panel,role:"alert",children:[(0,n.jsxs)(Tt.Z,{expandIcon:(0,n.jsx)(an,{severity:s}),className:E.summary,children:[(0,n.jsx)(Mt,{severity:s}),(0,n.jsx)(z.Z,{className:E.summaryText,variant:"subtitle1",children:B})]}),(u||p)&&(0,n.jsx)(Nt.Z,{children:(0,n.jsxs)(Be.Z,{container:!0,children:[u&&(0,n.jsx)(Be.Z,{item:!0,xs:12,children:(0,n.jsx)(z.Z,{className:E.message,variant:"body1",children:u})}),p&&(0,n.jsx)(Be.Z,{item:!0,xs:12,className:E.details,children:p})]})})]})}const Ln=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),zn=({error:e,message:s,stack:i,children:u})=>{const p=Ln();return(0,n.jsxs)(St.Z,{dense:!0,children:[(0,n.jsxs)(Ye.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ft.Z,{classes:{secondary:p.text},primary:"Error",secondary:e}),(0,n.jsx)(We,{text:e})]}),(0,n.jsxs)(Ye.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ft.Z,{classes:{secondary:p.text},primary:"Message",secondary:s}),(0,n.jsx)(We,{text:s})]}),i&&(0,n.jsxs)(Ye.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ft.Z,{classes:{secondary:p.text},primary:"Stack Trace",secondary:i}),(0,n.jsx)(We,{text:i})]}),u]})};function tn(e){const{title:s,error:i,defaultExpanded:u,children:p}=e;return(0,n.jsx)(vn,{severity:"error",title:s!=null?s:i.message,defaultExpanded:u,children:(0,n.jsx)(zn,{error:i.name,message:i.message,stack:i.stack,children:p})})}var yn=t(85256);const Hn=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function w(e){var s;const{title:i,error:u,defaultExpanded:p}=e,m=Hn();if(u.name!=="ResponseError")return(0,n.jsx)(tn,{title:i!=null?i:u.message,defaultExpanded:p,error:u});const{body:E,cause:B}=u,{request:G,response:F}=E,pe=`${F.statusCode}: ${B.name}`,re=G&&`${G.method} ${G.url}`,xe=B.message.replace(/\\n/g,`
14
- `),je=(s=B.stack)===null||s===void 0?void 0:s.replace(/\\n/g,`
15
- `),Ge=JSON.stringify(E,void 0,2);return(0,n.jsxs)(tn,{title:i!=null?i:u.message,defaultExpanded:p,error:{name:pe,message:xe,stack:je},children:[re&&(0,n.jsxs)(Ye.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ft.Z,{classes:{secondary:m.text},primary:"Request",secondary:G?`${re}`:void 0}),(0,n.jsx)(We,{text:re})]}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(yn.Z,{component:"li",className:m.divider}),(0,n.jsx)(Ye.Z,{alignItems:"flex-start",children:(0,n.jsx)(ft.Z,{classes:{secondary:m.text},primary:"Full Error as JSON"})}),(0,n.jsx)(se,{language:"json",text:Ge,showCopyCodeButton:!0})]})]})}var d=t(28316);function y(e){const s=document.createElement("div");return s.setAttribute("id",e),s}function j(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function Y(e){const s=useRef(null);useEffect(function(){const p=document.querySelector(`#${e}`),m=p||y(e);return p||j(m),m.appendChild(s.current),function(){s.current.remove(),m.childNodes.length===-1&&m.remove()}},[e]);function i(){return s.current||(s.current=document.createElement("div")),s.current}return i()}var ve=null;const be="core.calloutSeen";function Ne(){const[e,s]=useState(()=>{const u=localStorage.getItem(be);return u?JSON.parse(u):{}}),i=useCallback((u,p)=>{const m=localStorage.getItem(be),B={...m?JSON.parse(m):{},[u]:p};s(B),localStorage.setItem(be,JSON.stringify(B))},[]);return{states:e,setState:i}}function dt(e){const{states:s,setState:i}=Ne(),u=useCallback(()=>{i(e,!0)},[i,e]);return{seen:s[e]===!0,markSeen:u}}function Dt(e){const{seen:s,markSeen:i}=dt(e);return{show:s===!1,hide:i}}const nn=(0,l.Z)({"@keyframes pulsateSlightly":{"0%":{transform:"scale(1.0)"},"100%":{transform:"scale(1.1)"}},"@keyframes pulsateAndFade":{"0%":{transform:"scale(1.0)",opacity:.9},"100%":{transform:"scale(1.5)",opacity:0}},featureWrapper:{position:"relative"},backdrop:{zIndex:2e3,position:"fixed",overflow:"hidden",left:0,right:0,top:0,bottom:0},dot:{position:"absolute",backgroundColor:"transparent",borderRadius:"100%",border:"1px solid rgba(103, 146, 180, 0.98)",boxShadow:"0px 0px 0px 20000px rgba(0, 0, 0, 0.5)",zIndex:2001,transformOrigin:"center center",animation:"$pulsateSlightly 1744ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) alternate infinite"},pulseCircle:{width:"100%",height:"100%",backgroundColor:"transparent",borderRadius:"100%",border:"2px solid white",zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:"white",zIndex:2003}},{name:"BackstageFeatureCalloutCircular"});function Qn(e){const{featureId:s,title:i,description:u,children:p}=e,{show:m,hide:E}=useShowCallout(s),B=usePortal("core.callout"),G=useRef(null),[F,pe]=useState(),re=nn(),xe=useCallback(()=>{if(G.current){const je=G.current.getBoundingClientRect(),Ge=Math.max(je.width,je.height),Qe=800,Lt=je.x-(Ge-je.width)/2-Qe,Ht=je.y-(Ge-je.height)/2-Qe,_t=Ge+2*Qe,en=450,Pt=je.x+je.width/2-en,Qt=je.y-(Ge-je.height)/2+Ge+20;pe({dotLeft:Lt,dotTop:Ht,dotSize:_t,borderWidth:Qe,textTop:Qt,textLeft:Pt,textWidth:en})}},[]);return useEffect(()=>(window.addEventListener("resize",xe),window.addEventListener("scroll",xe),()=>{window.removeEventListener("resize",xe),window.removeEventListener("scroll",xe)}),[xe]),useLayoutEffect(xe,[G.current,xe]),m?_jsxs(_Fragment,{children:[_jsx(Box,{className:re.featureWrapper,ref:G,children:p}),createPortal(_jsx(Box,{className:re.backdrop,children:_jsx(ClickAwayListener,{onClickAway:E,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:re.dot,"data-testid":"dot",style:{left:F==null?void 0:F.dotLeft,top:F==null?void 0:F.dotTop,width:F==null?void 0:F.dotSize,height:F==null?void 0:F.dotSize,borderWidth:F==null?void 0:F.borderWidth},onClick:E,onKeyDown:E,role:"button",tabIndex:0,children:_jsx(Box,{className:re.pulseCircle})}),_jsxs(Box,{className:re.text,"data-testid":"text",style:{left:F==null?void 0:F.textLeft,top:F==null?void 0:F.textTop,width:F==null?void 0:F.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:i}),_jsx(Typography,{children:u})]})]})})}),B)]}):_jsx(_Fragment,{children:p})}var $r=t(35292);const nr=(0,l.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function Xn({color:e="primary",disabled:s=!1,href:i="#",icon:u=(0,n.jsx)($r.Z,{}),label:p,onClick:m,title:E}){const B=nr();return s?(0,n.jsxs)(Ee.Z,{title:E,className:ae()(B.link,B.disabled),children:[u,(0,n.jsx)(z.Z,{variant:"caption",component:"span",className:B.label,children:p})]}):(0,n.jsxs)(Je,{title:E,className:ae()(B.link,B[e]),to:i,onClick:m,children:[u,(0,n.jsx)(z.Z,{variant:"caption",component:"span",className:B.label,children:p})]})}const pr=(0,l.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function rr(e){const{links:s}=e,i=pr();return(0,n.jsx)("nav",{className:i.links,children:s.map((u,p)=>(0,n.jsx)(Xn,{...u},p+1))})}const Zr=e=>{const s=e==="dark"?"16%":"97%";return`
16
- hsl(0, 0%, ${s}) 0%,
17
- hsla(0, 0%, ${s}, 0.987) 8.1%,
18
- hsla(0, 0%, ${s}, 0.951) 15.5%,
19
- hsla(0, 0%, ${s}, 0.896) 22.5%,
20
- hsla(0, 0%, ${s}, 0.825) 29%,
21
- hsla(0, 0%, ${s}, 0.741) 35.3%,
22
- hsla(0, 0%, ${s}, 0.648) 41.2%,
23
- hsla(0, 0%, ${s}, 0.55) 47.1%,
24
- hsla(0, 0%, ${s}, 0.45) 52.9%,
25
- hsla(0, 0%, ${s}, 0.352) 58.8%,
26
- hsla(0, 0%, ${s}, 0.259) 64.7%,
27
- hsla(0, 0%, ${s}, 0.175) 71%,
28
- hsla(0, 0%, ${s}, 0.104) 77.5%,
29
- hsla(0, 0%, ${s}, 0.049) 84.5%,
30
- hsla(0, 0%, ${s}, 0.013) 91.9%,
31
- hsla(0, 0%, ${s}, 0) 100%
32
- `},ls=100,fr=10,cs=(0,l.Z)(e=>({root:{position:"relative",display:"flex",flexFlow:"row nowrap",alignItems:"center"},container:{overflow:"auto",scrollbarWidth:0,"&::-webkit-scrollbar":{display:"none"}},fade:{position:"absolute",width:ls,height:`calc(100% + ${fr}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-fr,background:`linear-gradient(90deg, ${Zr(e.palette.type)})`},fadeRight:{right:-fr,background:`linear-gradient(270deg, ${Zr(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function Kr(e){const[[s,i],u]=React.useState([0,0]);return React.useLayoutEffect(()=>{const p=e.current;if(!p){u([0,0]);return}const m=()=>{const E=p.scrollLeft,B=p.scrollWidth-p.offsetWidth-p.scrollLeft;u([E,B])};return m(),p.addEventListener("scroll",m),window.addEventListener("resize",m),()=>{p.removeEventListener("scroll",m),window.removeEventListener("resize",m)}},[e]),[s,i]}function gr(e,s,i){const[u,p]=React.useState(0);return React.useLayoutEffect(()=>{if(u===0)return;const m=window.performance.now(),E=requestAnimationFrame(B=>{if(!e.current)return;const G=B-m,F=Math.abs(u)*G/s,re=Math.max(i,F)*Math.sign(u);e.current.scrollBy({left:re});const xe=u-re;Math.sign(u)!==Math.sign(xe)?p(0):p(xe)});return()=>cancelAnimationFrame(E)},[e,u,s,i]),p}function tr(e){const{scrollStep:s=100,scrollSpeed:i=50,minScrollDistance:u=5,children:p,...m}=e,E=cs(e),B=React.useRef(),[G,F]=Kr(B),pe=gr(B,i,u),re=xe=>{!B.current||pe(xe?s:-s)};return _jsxs(Box,{...m,className:E.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:E.container,ref:B,children:p}),_jsx(Box,{className:classNames(E.fade,E.fadeLeft,{[E.fadeHidden]:G===0})}),_jsx(Box,{className:classNames(E.fade,E.fadeRight,{[E.fadeHidden]:F===0})}),G>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>re(!1),className:classNames(E.button,E.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),F>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>re(!0),className:classNames(E.button,E.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const jr=(0,l.Z)({alpha:{color:"#ffffff",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}},{name:"BackstageLifecycle"});function Dr(e){const s=jr(e),{shorthand:i,alpha:u}=e;return i?_jsx(Typography,{component:"span",className:s[u?"alpha":"beta"],style:{fontSize:"120%"},children:u?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:s[u?"alpha":"beta"],children:u?"Alpha":"Beta"})}const ds=(0,g.lazy)(()=>Promise.all([t.e(5869),t.e(6051)]).then(t.bind(t,76051)).then(e=>({default:e.RealLogViewer})));function Er(e){const{Progress:s}=(0,W.qD)().getComponents();return(0,n.jsx)(g.Suspense,{fallback:(0,n.jsx)(s,{}),children:(0,n.jsx)(ds,{...e})})}const Nr=(0,l.Z)(e=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${e.palette.border}`},"& th, & td":{border:`1px solid ${e.palette.border}`,padding:e.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:e.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:e.palette.background.paper},"& tr":{backgroundColor:e.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:e.palette.background.default},"& a":{color:e.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),Yr=(e,s)=>s?typeof s=="string"?e+s:g.Children.toArray(s.props.children).reduce(Yr,e):e,Wn=({level:e,children:s})=>{const p=g.Children.toArray(s).reduce(Yr,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return g.createElement(`h${e}`,{id:p},s)},Fr={code:({inline:e,className:s,children:i,...u})=>{const p=String(i).replace(/\n+$/,""),m=/language-(\w+)/.exec(s||"");return!e&&m?(0,n.jsx)(se,{language:m[1],text:p}):(0,n.jsx)("code",{className:s,...u,children:i})},h1:Wn,h2:Wn,h3:Wn,h4:Wn,h5:Wn,h6:Wn};function Ar(e){const{content:s,dialect:i="gfm",linkTarget:u,transformLinkUri:p,transformImageUri:m,className:E}=e,B=Nr();return _jsx(ReactMarkdown,{remarkPlugins:i==="gfm"?[gfm]:[],className:`${B.markdown} ${E}`,children:s,components:Fr,linkTarget:u,transformLinkUri:p,transformImageUri:m})}var Jr=t(23054);const Ur=(0,l.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),us=({request:e,busy:s,setBusy:i})=>{const u=Ur(),[p,m]=useState(),E=async()=>{i(!0);try{await e.trigger()}catch(G){m(isError(G)?G.message:"An unspecified error occurred")}finally{i(!1)}},B=e.provider.icon;return _jsxs(ListItem,{disabled:s,classes:{root:u.root},children:[_jsx(ListItemAvatar,{children:_jsx(B,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:p&&_jsx(Typography,{color:"error",children:p})}),_jsx(Button,{color:"primary",variant:"contained",onClick:E,children:"Log in"})]})};var Zs=null;const hs=(0,l.Z)(e=>({dialog:{paddingTop:e.spacing(1)},title:{minWidth:0},titleHeading:{fontSize:e.typography.h6.fontSize},contentList:{padding:0},actionButtons:{padding:e.spacing(2,0)}}),{name:"OAuthRequestDialog"});function Ds(e){const s=hs(),[i,u]=useState(!1),p=useApi(oauthRequestApiRef),m=useObservable(useMemo(()=>p.authRequest$(),[p]),[]),E=()=>{m.forEach(B=>B.reject())};return _jsxs(Dialog,{open:Boolean(m.length),fullWidth:!0,maxWidth:"xs",classes:{paper:s.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsx(DialogTitle,{classes:{root:s.title},id:"oauth-req-dialog-title",children:_jsx(Typography,{className:s.titleHeading,variant:"h1",children:"Login Required"})}),_jsx(DialogContent,{dividers:!0,classes:{root:s.contentList},children:_jsx(List,{children:m.map(B=>_jsx(LoginRequestListItem,{request:B,busy:i,setBusy:u},B.provider.title))})})]}),_jsx(DialogActions,{classes:{root:s.actionButtons},children:_jsx(Button,{onClick:E,children:"Reject All"})})]})}var ps=t(15277),Qr=t.n(ps),fs=t(29862);const Mr=(0,l.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function mr(e){const[s,i]=(0,g.useState)(!1),u=(0,fs.t)(),p=Mr(),m=B=>{u()&&i(B)};var E;return(0,n.jsx)(ut.ZP,{title:(E=e.title)!==null&&E!==void 0?E:e.text||"",placement:e.placement,disableHoverListener:!s,children:(0,n.jsx)(Qr(),{text:e.text,line:e.line,onToggled:m,containerClassName:p.container})})}var vr=t(67358);function zt(e){const s=(0,Ke.Z)(),[i,u]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{const p=setTimeout(()=>u(!0),s.transitions.duration.short);return()=>clearTimeout(p)},[s.transitions.duration.short]),i?(0,n.jsx)(vr.Z,{...e,"data-testid":"progress"}):(0,n.jsx)(Ee.Z,{display:"none"})}var gs=t(94339),Xr=t(14503),qr=t(24579),_r=t(32552),wn=t(15459),ms=t(27597);const vs=(0,l.Z)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function ys(e){const{link:s,title:i,onClick:u}=e,p=vs();return(0,n.jsxs)(Ee.Z,{children:[(0,n.jsx)(yn.Z,{}),(0,n.jsx)(Je,{to:s,onClick:u,underline:"none",children:(0,n.jsxs)(Ee.Z,{display:"flex",alignItems:"center",className:p.root,children:[(0,n.jsx)(Ee.Z,{className:p.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,n.jsx)(z.Z,{children:(0,n.jsx)("strong",{children:i})})}),(0,n.jsx)(ms.Z,{className:p.arrow})]})})]})}const xs=e=>{const{slackChannel:s}=e;if(s){if(typeof s=="string")return(0,n.jsxs)(z.Z,{children:["Please contact ",s," for help."]});if(!s.href)return(0,n.jsxs)(z.Z,{children:["Please contact ",s.name," for help."]})}else return null;return(0,n.jsx)(gt,{to:s.href,variant:"contained",children:s.name})},bs=class extends g.Component{componentDidCatch(s,i){console.error(`ErrorBoundary, error: ${s}, info: ${i}`),this.setState({error:s,errorInfo:i})}render(){const{slackChannel:s,children:i}=this.props,{error:u}=this.state;return u?(0,n.jsx)(tn,{title:"Something Went Wrong",error:u,children:(0,n.jsx)(xs,{slackChannel:s})}):i}constructor(s){super(s),this.state={error:void 0,errorInfo:void 0}}},Ss=(0,l.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),Cs=(0,wn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Xr.Z),es={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function Tr(e){const{title:s,subheader:i,divider:u=!0,deepLink:p,slackChannel:m,errorBoundaryProps:E,variant:B,children:G,headerStyle:F,headerProps:pe,icon:re,action:xe,actionsClassName:je,actions:Ge,cardClassName:Qe,actionsTopRight:Lt,className:Ht,noPadding:_t,titleTypographyProps:en}=e,Pt=Ss();let Qt={},Gt={};B&&B.split(/[\s]+/g).forEach(Cr=>{Qt={...Qt,...es.card[Cr]},Gt={...Gt,...es.cardContent[Cr]}});const xr=()=>!i&&!re?null:(0,n.jsxs)("div",{className:Pt.headerSubheader,"data-testid":"info-card-subheader",children:[i&&(0,n.jsx)("div",{className:Pt.subheader,children:i}),re]}),br=E||(m?{slackChannel:m}:{});return(0,n.jsx)(gs.Z,{style:Qt,className:Ht,children:(0,n.jsxs)(bs,{...br,children:[s&&(0,n.jsx)(_r.Z,{classes:{root:Pt.header,title:Pt.headerTitle,subheader:Pt.headerSubheader,avatar:Pt.headerAvatar,action:Pt.headerAction,content:Pt.headerContent},title:s,subheader:xr(),action:xe,style:{...F},titleTypographyProps:en,...pe}),Lt&&(0,n.jsx)(Cs,{children:Lt}),u&&(0,n.jsx)(yn.Z,{}),(0,n.jsx)(qr.Z,{className:ae()(Qe,{[Pt.noPadding]:_t}),style:Gt,children:G}),Ge&&(0,n.jsx)(Xr.Z,{className:je,children:Ge}),p&&(0,n.jsx)(ys,{...p})]})})}var Ns=t(39307);const ws=(0,l.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:e.typography.pxToRem(45),fontWeight:e.typography.fontWeightBold,color:e.palette.textContrast},description:{fontSize:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)",position:"absolute",wordBreak:"break-all",display:"inline-block"},circle:{width:"80%",transform:"translate(10%, 0)"},colorUnknown:{}}),{name:"BackstageGauge"}),js={fractional:!0,inverse:!1,unit:"%",max:100},v=({palette:e,value:s,inverse:i,max:u})=>{if(isNaN(s))return"#ddd";const p=u||js.max,m=i?p-s:s;return m<p/3?e.status.error:m<p*(2/3)?e.status.warning:e.status.ok};function x(e){const[s,i]=useState(null),{getColor:u=v}=e,p=ws(e),{palette:m}=useTheme(),{value:E,fractional:B,inverse:G,unit:F,max:pe,description:re}={...js,...e},xe=B?Math.round(E*pe):E,je=pe!==100?Math.round(E):xe,[Ge,Qe]=useState(!1);return useEffect(()=>{const Lt=s,Ht=()=>Qe(!0),_t=()=>Qe(!1);return Lt&&re?(Lt.addEventListener("mouseenter",Ht),Lt.addEventListener("mouseleave",_t),()=>{Lt.removeEventListener("mouseenter",Ht),Lt.removeEventListener("mouseleave",_t)}):()=>{Qe(!1)}},[re,s]),_jsxs(Box,{ref:i,className:p.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:xe,strokeWidth:12,trailWidth:12,strokeColor:u({palette:m,value:je,inverse:G,max:pe}),className:p.circle}),re&&Ge?_jsx(Box,{className:p.description,children:re}):_jsx(Box,{className:p.overlay,children:isNaN(E)?"N/A":`${je}${F}`})]})}const R=(0,l.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function Z(e){const s=R(e),{title:i,subheader:u,progress:p,inverse:m,deepLink:E,description:B,icon:G,variant:F,getColor:pe}=e,re={inverse:m,description:B,getColor:pe,value:p};return _jsx(Box,{className:s.root,children:_jsx(InfoCard,{title:i,subheader:u,deepLink:E,variant:F,icon:G,children:_jsx(Gauge,{...re})})})}function J(e){const{value:s,getColor:i=getProgressColor}=e,{palette:u}=useTheme();if(isNaN(s))return null;let p=Math.round(s*100*100)/100;p>100&&(p=100);const m=i({palette:u,value:p,inverse:!1,max:100});return _jsx(Tooltip,{title:`${p}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:p,strokeWidth:4,trailWidth:4,strokeColor:m})})})}var K=t(21324),oe=t(7089),he=t(1292),Se=t(42494),$e=t(74603),De=t(56939),we=t(12231),Ve=t(73698),it=t(72379);const Ct=(0,l.Z)(e=>(0,P.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var Zt=()=>{const e=Ct();return(0,n.jsx)(it.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const qt=(0,l.Z)(e=>(0,P.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Vn=()=>{const e=qt();return(0,n.jsx)(it.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const sr=(0,wn.Z)(e=>(0,P.Z)({root:{"label + &":{marginTop:e.spacing(3)}},input:{borderRadius:e.shape.borderRadius,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:e.typography.body1.fontSize,padding:e.spacing(1.25,3.25,1.25,1.5),transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:e.shape.borderRadius}}}),{name:"BackstageSelectInputBase"})($e.Z),xn=(0,l.Z)(e=>(0,P.Z)({formControl:{margin:`${e.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:2},checkbox:{},root:{display:"flex",flexDirection:"column"}}),{name:"BackstageSelect"});function jn(e){const{multiple:s,items:i,label:u,placeholder:p,selected:m,onChange:E,triggerReset:B,native:G=!1,disabled:F=!1,margin:pe}=e,re=xn(),[xe,je]=(0,g.useState)(m||(s?[]:"")),[Ge,Qe]=(0,g.useState)(!1);(0,g.useEffect)(()=>{je(s?[]:"")},[B,s]),(0,g.useEffect)(()=>{m!==void 0&&je(m)},[m]);const Lt=Pt=>{je(Pt.target.value),E(Pt.target.value)},Ht=Pt=>{if(F){Pt.preventDefault();return}Qe(Qt=>s&&!(Pt.target instanceof HTMLElement)?!0:!Qt)},_t=()=>{Qe(!1)},en=Pt=>()=>{const Qt=xe.filter(Gt=>Gt!==Pt);je(Qt),E(Qt)};return(0,n.jsx)(Ee.Z,{className:re.root,children:(0,n.jsx)(he.Z,{onClickAway:_t,children:(0,n.jsxs)(Se.Z,{className:re.formControl,children:[(0,n.jsx)(De.Z,{className:re.formLabel,children:u}),(0,n.jsxs)(Ve.Z,{"aria-label":u,value:xe,native:G,disabled:F,"data-testid":"select",displayEmpty:!0,multiple:s,margin:pe,onChange:Lt,onClick:Ht,open:Ge,input:(0,n.jsx)(sr,{}),label:u,tabIndex:0,renderValue:Pt=>{var Qt;return s&&xe.length!==0?(0,n.jsx)(Ee.Z,{className:re.chips,children:Pt.map(Gt=>{var xr,br;return(0,n.jsx)(oe.Z,{label:(xr=i.find(Sr=>Sr.value===Gt))===null||xr===void 0?void 0:xr.label,clickable:!0,onDelete:en(Gt),className:re.chip},(br=i.find(Sr=>Sr.value===Gt))===null||br===void 0?void 0:br.value)})}):(0,n.jsx)(z.Z,{children:xe.length===0?p||"":(Qt=i.find(Gt=>Gt.value===Pt))===null||Qt===void 0?void 0:Qt.label})},IconComponent:()=>Ge?(0,n.jsx)(Vn,{}):(0,n.jsx)(Zt,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[p&&!s&&(0,n.jsx)(we.Z,{value:[],children:p}),G?i&&i.map(Pt=>(0,n.jsx)("option",{value:Pt.value,children:Pt.label},Pt.value)):i&&i.map(Pt=>(0,n.jsxs)(we.Z,{value:Pt.value,children:[s&&(0,n.jsx)(K.Z,{color:"primary",checked:xe.includes(Pt.value)||!1,className:re.checkbox}),Pt.label]},Pt.value))]})]})})})}const En=()=>{},Ir=g.createContext({stepperLength:0,stepIndex:0,setStepIndex:En,stepHistory:[],setStepHistory:En,onStepChange:En});function Rr(e){const{children:s,elevated:i,onStepChange:u,activeStep:p=0}=e,[m,E]=useState(p),[B,G]=useState([0]);useEffect(()=>{E(p)},[p]);const F=[];let pe;return Children.forEach(s,re=>{isValidElement(re)&&(re.props.end?pe=re:F.push(re))}),_jsxs(_Fragment,{children:[_jsx(Ir.Provider,{value:{stepIndex:m,setStepIndex:E,stepHistory:B,setStepHistory:G,onStepChange:u,stepperLength:Children.count(s)},children:_jsx(MuiStepper,{activeStep:m,orientation:"vertical",elevation:i?2:0,children:F})}),m>=Children.count(s)-1&&pe]})}const Lr=(0,l.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),An=({text:e,handleClick:s})=>_jsx(Button,{onClick:s,children:e||"Reset"}),Pn=({text:e,handleClick:s,disabled:i,last:u,stepIndex:p})=>_jsx(Button,{variant:"contained",color:"primary",disabled:i,"data-testid":`nextButton-${p}`,onClick:s,children:e||(u?"Finish":"Next")}),or=({text:e,handleClick:s,disabled:i,stepIndex:u})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:i,"data-testid":`skipButton-${u}`,onClick:s,children:e||"Skip"}),Fs=({text:e,handleClick:s,disabled:i,stepIndex:u})=>_jsx(Button,{onClick:s,"data-testid":`backButton-${u}`,disabled:i,children:e||"Back"}),di=({actions:e={},children:s})=>{const i=Lr(),{stepperLength:u,stepIndex:p,setStepIndex:m,stepHistory:E,setStepHistory:B,onStepChange:G}=useContext(VerticalStepperContext),F=(je,Ge)=>{Ge&&Ge(),G&&G(p,je),m(je)},pe=()=>{const je=e.nextStep?e.nextStep(p,u-1):p+1;F(je,e.onNext),B([...E,je])},re=()=>{E.pop(),F(E[E.length-1],e.onBack),B([...E])},xe=()=>{F(0,e.onRestart),B([0])};return _jsxs(Box,{className:i.root,children:[[void 0,!0].includes(e.showBack)&&p!==0&&_jsx(Fs,{text:e.backText,handleClick:re,disabled:p===0,stepIndex:p}),e.showSkip&&_jsx(or,{text:e.skipText,handleClick:pe,disabled:!!u&&p>=u||!!e.canSkip&&!e.canSkip(),stepIndex:p}),[void 0,!0].includes(e.showNext)&&_jsx(Pn,{text:e.nextText,handleClick:pe,disabled:!!u&&p>=u||!!e.canNext&&!e.canNext(),stepIndex:p}),e.showRestart&&p!==0&&_jsx(An,{text:e.restartText,handleClick:xe,stepIndex:p}),s]})},So=(0,l.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function Ji(e){const{title:s,children:i,end:u,actions:p,...m}=e,E=So();return u?_jsxs(Box,{className:E.end,children:[_jsx(Typography,{variant:"h6",children:s}),i,_jsx(SimpleStepperFooter,{actions:{...p||{},showNext:!1}})]}):_jsxs(MuiStep,{...m,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:s})}),_jsxs(StepContent,{children:[i,_jsx(SimpleStepperFooter,{actions:p})]})]})}const Gn=(0,l.Z)(e=>({status:{fontWeight:e.typography.fontWeightMedium,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:e.spacing(1),borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:e.palette.status.ok}},warning:{"&::before":{backgroundColor:e.palette.status.warning}},error:{"&::before":{backgroundColor:e.palette.status.error}},pending:{"&::before":{backgroundColor:e.palette.status.pending}},running:{"&::before":{backgroundColor:e.palette.status.running}},aborted:{"&::before":{backgroundColor:e.palette.status.aborted}}}),{name:"BackstageStatus"});function ui(e){const s=Gn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function kn(e){const s=Gn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function Qi(e){const s=Gn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.error),"aria-label":"Status error","aria-hidden":"true",...e})}function Xi(e){const s=Gn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function qi(e){const s=Gn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.running),"aria-label":"Status running","aria-hidden":"true",...e})}function hi(e){const s=Gn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var _i=t(74600),Co=t(15584);const wo=e=>(0,P.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),pi={root:{border:"0",verticalAlign:"top"}},fi=e=>(0,P.Z)({root:{margin:e.spacing(0,0,-1,0)}}),Es=e=>(0,P.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),jo=(0,wn.Z)(wo,{name:"BackstageMetadataTableTitleCell"})(Co.Z),ts=(0,wn.Z)(pi,{name:"BackstageMetadataTableCell"})(Co.Z),As=({dense:e,children:s})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:s})}),Ts=({title:e,children:s,...i})=>_jsxs(TableRow,{children:[e&&_jsx(jo,{children:e}),_jsx(ts,{colSpan:e?1:2,...i,children:s})]}),Us=(0,wn.Z)(fi,{name:"BackstageMetadataTableList"})(({classes:e,children:s})=>(0,n.jsx)(St.Z,{disablePadding:!0,className:e.root,children:s})),Eo=(0,wn.Z)(Es,{name:"BackstageMetadataTableListItem"})(({classes:e,children:s})=>(0,n.jsx)(Ye.Z,{className:e.root,children:s})),Ms=(0,P.Z)({root:{margin:"0 0",listStyleType:"none"}}),Ao=e=>(0,P.Z)({root:{...Ms.root,paddingLeft:e.spacing(1)}}),zs=(0,wn.Z)(Ms,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:s})=>(0,n.jsx)(Us,{classes:e,children:s})),Ws=(0,wn.Z)(Ao,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:s})=>(0,n.jsx)(Us,{classes:e,children:s}));function To(e,s){const i=e.map((u,p)=>_jsx(MetadataListItem,{children:zr(u)},p));return s?_jsx(Ws,{children:i}):_jsx(zs,{children:i})}function yr(e,s,i){const u=Object.keys(e).map(p=>{const m=zr(e[p],!0),E=i&&i.titleFormat?i.titleFormat(p):startCase(p);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${E}: `}),m]},p)});return s?_jsx(Ws,{children:u}):_jsx(zs,{children:u})}function zr(e,s,i){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?yr(e,s,i):Array.isArray(e)?To(e,i):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const Io=({value:e,options:s})=>_jsx(Fragment,{children:zr(e,s)}),Ro=({title:e,value:s,options:i})=>_jsx(MetadataTableItem,{title:i&&i.titleFormat?i.titleFormat(e):startCase(e),children:_jsx(Io,{value:s,options:i})});function Vs(e,s){return Object.keys(e).map(i=>_jsx(Ro,{title:i,value:e[i],options:s},i))}function gi(e){const{metadata:s,dense:i=!0,options:u}=e,p=Vs(s,u||{});return _jsx(MetadataTable,{dense:i,children:p})}var Lo=t(49429),Po=t(86136),Hs=t(79784),mi=t(19126),Gs=t.n(mi);function ko(e){return qs.stringify(e,{strictNullHandling:!0})}function Ks(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function Ys(e,s){return Ks(e)[s]}function Js(e,s,i){const u={...Ks(e),[s]:i};return ko(u)}function Qs(e,s=250){const[i,u]=useSearchParams(),p=i.toString(),[m,E]=useState(Ys(p,e));return useEffect(()=>{const B=Ys(p,e);E(G=>isEqual(B,G)?G:B)},[p,E,e]),useDebouncedEffect(()=>{const B=Js(p,e,m);p!==B&&u(B,{replace:!0})},[u,m,p,e],s),[m,E]}const Oo={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 Xs(){const s=(0,W.I_)().get(W.Ds),i=s==null?void 0:s.getOptionalConfig("app.support");if(!i)return Oo;var u;return{url:i.getString("url"),items:i.getConfigArray("items").flatMap(p=>({title:p.getString("title"),icon:p.getOptionalString("icon"),links:((u=p.getOptionalConfigArray("links"))!==null&&u!==void 0?u:[]).flatMap(m=>({url:m.getString("url"),title:m.getString("title")}))}))}}var Bo=t(80079);function qn(e,s){const u=(0,W.qD)().getSystemIcon(e);return u?(0,n.jsx)(u,{...s}):(0,n.jsx)(Bo.Z,{...s})}function ea(e){return qn("brokenImage",e)}function ta(e){return qn("catalog",e)}function Is(e){return qn("chat",e)}function na(e){return qn("dashboard",e)}function ra(e){return qn("docs",e)}function vi(e){return qn("email",e)}function yi(e){return qn("github",e)}function $o(e){return qn("group",e)}function Rs(e){return qn("help",e)}function sa(e){return qn("user",e)}function Zo(e){return qn("warning",e)}const _s=(0,l.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),Do=({icon:e})=>{const s=(0,W.qD)();var i;const u=e&&(i=s.getSystemIcon(e))!==null&&i!==void 0?i:Rs;return(0,n.jsx)(u,{})};var Ls;const xi=({link:e})=>(0,n.jsx)(Je,{to:e.url,children:(Ls=e.title)!==null&&Ls!==void 0?Ls:e.url}),bi=({item:e})=>{var s;return(0,n.jsxs)(Ye.Z,{children:[(0,n.jsx)(Po.Z,{children:(0,n.jsx)(Do,{icon:e.icon})}),(0,n.jsx)(ft.Z,{primary:e.title,secondary:(s=e.links)===null||s===void 0?void 0:s.reduce((i,u,p)=>[...i,p>0&&(0,n.jsx)("br",{},p),(0,n.jsx)(xi,{link:u},u.url)],[])})]})};function Si(e){const{title:s,items:i,children:u}=e,{items:p}=Xs(),[m,E]=(0,g.useState)(!1),[B,G]=(0,g.useState)(null),F=_s(),pe=(0,Ie.Z)(je=>je.breakpoints.down("sm")),re=je=>{G(je.currentTarget),E(!0)},xe=()=>{E(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ee.Z,{display:"flex",ml:1,children:pe?(0,n.jsx)(ot.Z,{color:"primary",size:"small",onClick:re,"data-testid":"support-button",children:(0,n.jsx)(Rs,{})}):(0,n.jsx)(X.Z,{"data-testid":"support-button","aria-label":"support",color:"primary",onClick:re,startIcon:(0,n.jsx)(Rs,{}),children:"Support"})}),(0,n.jsxs)(Hs.ZP,{"data-testid":"support-button-popover",open:m,anchorEl:B,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:xe,children:[(0,n.jsxs)(St.Z,{className:F.popoverList,children:[s&&(0,n.jsx)(Ye.Z,{alignItems:"flex-start",children:(0,n.jsx)(z.Z,{variant:"subtitle1",children:s})}),g.Children.map(u,(je,Ge)=>(0,n.jsx)(Ye.Z,{alignItems:"flex-start",children:je},`child-${Ge}`)),(i!=null?i:p).map((je,Ge)=>(0,n.jsx)(bi,{item:je},`item-${Ge}`))]}),(0,n.jsx)(Lo.Z,{children:(0,n.jsx)(X.Z,{color:"primary",onClick:xe,children:"Close"})})]})]})}var On=t(18671),eo=t(16060);const ns=72,No=24,Fo=18,ur={drawerWidthClosed:ns,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:ns,iconSize:ns-No*2,iconPadding:No,selectedIndicatorWidth:3,userBadgePadding:Fo,userBadgeDiameter:ns-Fo*2,mobileSidebarHeight:56},Ci=e=>({...ur,...e,iconContainerWidth:ur.drawerWidthClosed,iconSize:ur.drawerWidthClosed-ur.iconPadding*2,userBadgeDiameter:ur.drawerWidthClosed-ur.userBadgePadding*2}),Uo={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:ur.defaultOpenDelayMs+200},wi=e=>({...Uo,...e}),oa="@backstage/core/sidebar-intro-dismissed",ir=(0,g.createContext)({sidebarConfig:ur,submenuConfig:Uo}),Mo=(0,g.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var ji=t(50023),to=t(4190),zo=t(87685),Wo=t(44882),rs=t(51837);const no={isOpen:!1,setOpen:()=>{}},ro=(0,g.createContext)(no),so=(0,rs.CT)("sidebar-open-state-context");function oo(e){const{children:s,value:i}=e;return(0,n.jsx)(ro.Provider,{value:i,children:(0,n.jsx)(so.Provider,{value:(0,rs.EI)({1:i}),children:s})})}const Ps=()=>{const e=(0,g.useContext)(so),s=(0,g.useContext)(ro);if(e===void 0)return s||no;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i};var Vo=t(57998);const Ho={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},io=(0,g.createContext)(Ho),ao=(0,rs.CT)("sidebar-pin-state-context");function Ei(e){const{children:s,value:i}=e;return(0,n.jsx)(io.Provider,{value:i,children:(0,n.jsx)(ao.Provider,{value:(0,rs.EI)({1:i}),children:s})})}const Wr=()=>{const e=(0,g.useContext)(ao),s=(0,g.useContext)(io);if(e===void 0)return s||Ho;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i},Go=(0,l.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:s=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${s.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),Ko=e=>{const{to:s,label:i,icon:u,value:p}=e,{sidebarConfig:m}=(0,g.useContext)(ir),E=Go({sidebarConfig:m}),B=(0,A.TH)(),{selectedMenuItemIndex:G,setSelectedMenuItemIndex:F}=(0,g.useContext)(_n),pe=(xe,je)=>{F(je===G?-1:je)},re=p===G&&G>=0||p!==G&&!(G>=0)&&s===B.pathname;return(0,n.jsx)(Vo.Z,{label:i,icon:u,component:Je,to:s||B.pathname,onChange:pe,value:p,selected:re,classes:E})},lo=e=>{const{children:s,to:i,label:u,icon:p,value:m}=e,{isMobile:E}=Wr();return E?(0,n.jsx)(Ko,{to:i,label:u,icon:p,value:m}):(0,n.jsx)(n.Fragment,{children:s})},co=(0,l.Z)(e=>({root:{position:"fixed",backgroundColor:e.palette.navigation.background,color:e.palette.navigation.color,bottom:0,left:0,right:0,zIndex:e.zIndex.snackbar,borderTop:"1px solid #383838"},overlay:s=>({background:e.palette.navigation.background,width:"100%",bottom:`${s.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${s.sidebarConfig.mobileSidebarHeight}px)`,flex:"0 1 auto",overflow:"auto"}),overlayHeader:{display:"flex",color:e.palette.text.primary,alignItems:"center",justifyContent:"space-between",padding:e.spacing(2,3)},overlayHeaderClose:{color:e.palette.text.primary},marginMobileSidebar:s=>({marginBottom:`${s.sidebarConfig.mobileSidebarHeight}px`})})),Yo=e=>(0,le.orderBy)(e,({props:{priority:s}})=>Number.isInteger(s)?s:-1,"desc"),Jo=g.createElement(lo).type,Qo=({children:e,label:s="Menu",open:i,onClose:u})=>{const{sidebarConfig:p}=(0,g.useContext)(ir),m=co({sidebarConfig:p});return(0,n.jsxs)(to.ZP,{anchor:"bottom",open:i,onClose:u,ModalProps:{BackdropProps:{classes:{root:m.marginMobileSidebar}}},classes:{root:m.marginMobileSidebar,paperAnchorBottom:m.overlay},children:[(0,n.jsxs)(Ee.Z,{className:m.overlayHeader,children:[(0,n.jsx)(z.Z,{variant:"h3",children:s}),(0,n.jsx)(ot.Z,{onClick:u,classes:{root:m.overlayHeaderClose},children:(0,n.jsx)(zo.Z,{})})]}),(0,n.jsx)(Ee.Z,{component:"nav",children:e})]})},_n=(0,g.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),Xo=e=>{const{sidebarConfig:s}=(0,g.useContext)(ir),{children:i}=e,u=co({sidebarConfig:s}),p=(0,A.TH)(),[m,E]=(0,g.useState)(-1);(0,g.useEffect)(()=>{E(-1)},[p.pathname]);let B=(0,W.vJ)(i,F=>F.getElements().filter(pe=>pe.type===Jo));if(i)B.length?B=Yo(B):B.push((0,n.jsx)(lo,{icon:(0,n.jsx)(Wo.Z,{}),children:i},"default_menu"));else return null;const G=m>=0&&!B[m].props.to;return(0,n.jsx)(oo,{value:{isOpen:!0,setOpen:()=>{}},children:(0,n.jsxs)(_n.Provider,{value:{selectedMenuItemIndex:m,setSelectedMenuItemIndex:E},children:[(0,n.jsx)(Qo,{label:B[m]&&B[m].props.label,open:G,onClose:()=>E(-1),children:B[m]&&B[m].props.children}),(0,n.jsx)(ji.Z,{className:u.root,"data-testid":"mobile-sidebar-root",component:"nav",children:B})]})})};var ss;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(ss||(ss={}));const uo={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(ss.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(ss.SIDEBAR_PIN_STATE,JSON.stringify(e))}},ho=(0,l.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:s=>s.isPinned?s.sidebarConfig.drawerWidthOpen:s.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:s=>s.sidebarConfig.mobileSidebarHeight}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),po=(0,g.createContext)({content:{contentRef:void 0}});function qo(e){const[s,i]=(0,g.useState)(()=>uo.getSidebarPinState()),{sidebarConfig:u}=(0,g.useContext)(ir),p=(0,g.useRef)(null),m=(0,g.useMemo)(()=>({content:{contentRef:p}}),[p]);(0,g.useEffect)(()=>{uo.setSidebarPinState(s)},[s]);const E=(0,Ie.Z)(F=>F.breakpoints.down("xs"),{noSsr:!0}),B=()=>i(!s),G=ho({isPinned:s,sidebarConfig:u});return(0,n.jsx)(Ei,{value:{isPinned:s,toggleSidebarPinState:B,isMobile:E},children:(0,n.jsx)(po.Provider,{value:m,children:(0,n.jsx)(Ee.Z,{className:G.root,children:e.children})})})}function fo(){const{content:e}=(0,g.useContext)(po);return{focusContent:(0,g.useCallback)(()=>{var i,u;e==null||(i=e.contentRef)===null||i===void 0||(u=i.current)===null||u===void 0||u.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const go=(0,l.Z)(e=>({drawer:s=>({display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:e.zIndex.appBar,background:e.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",width:s.sidebarConfig.drawerWidthClosed,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}),drawerOpen:s=>({width:s.sidebarConfig.drawerWidthOpen,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shorter})}),visuallyHidden:{top:0,position:"absolute",zIndex:1e3,transform:"translateY(-200%)","&:focus":{transform:"translateY(5px)"}}}),{name:"BackstageSidebar"});var Kn;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Kn||(Kn={}));const _o=e=>{const{sidebarConfig:s}=(0,g.useContext)(ir),{openDelayMs:i=s.defaultOpenDelayMs,closeDelayMs:u=s.defaultCloseDelayMs,disableExpandOnHover:p,children:m}=e,E=go({sidebarConfig:s}),B=(0,Ie.Z)(Ht=>Ht.breakpoints.down("md"),{noSsr:!0}),[G,F]=(0,g.useState)(Kn.Closed),pe=(0,g.useRef)(),{isPinned:re,toggleSidebarPinState:xe}=Wr(),je=()=>{re||p||(pe.current&&(clearTimeout(pe.current),pe.current=void 0),G!==Kn.Open&&!B&&(pe.current=window.setTimeout(()=>{pe.current=void 0,F(Kn.Open)},i),F(Kn.Idle)))},Ge=()=>{re||p||(pe.current&&(clearTimeout(pe.current),pe.current=void 0),G===Kn.Idle?F(Kn.Closed):G===Kn.Open&&(pe.current=window.setTimeout(()=>{pe.current=void 0,F(Kn.Closed)},u)))},Qe=G===Kn.Open&&!B||re,Lt=Ht=>{Ht?(F(Kn.Open),xe()):(F(Kn.Closed),xe())};return(0,n.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,n.jsx)(r,{}),(0,n.jsx)(oo,{value:{isOpen:Qe,setOpen:Lt},children:(0,n.jsx)(Ee.Z,{className:E.root,"data-testid":"sidebar-root",onMouseEnter:p?()=>{}:je,onFocus:p?()=>{}:je,onMouseLeave:p?()=>{}:Ge,onBlur:p?()=>{}:Ge,children:(0,n.jsx)(Ee.Z,{className:ae()(E.drawer,{[E.drawerOpen]:Qe}),children:m})})})]})},a=e=>{var s;const i=Ci((s=e.sidebarOptions)!==null&&s!==void 0?s:{});var u;const p=wi((u=e.submenuOptions)!==null&&u!==void 0?u:{}),{children:m,disableExpandOnHover:E,openDelayMs:B,closeDelayMs:G}=e,{isMobile:F}=Wr();return F?(0,n.jsx)(Xo,{children:m}):(0,n.jsx)(ir.Provider,{value:{sidebarConfig:i,submenuConfig:p},children:(0,n.jsx)(_o,{openDelayMs:B,closeDelayMs:G,disableExpandOnHover:E,children:m})})};function r(){const{sidebarConfig:e}=(0,g.useContext)(ir),{focusContent:s,contentRef:i}=fo(),u=go({sidebarConfig:e});return i!=null&&i.current?(0,n.jsx)(X.Z,{onClick:s,variant:"contained",className:ae()(u.visuallyHidden),children:"Skip to content"}):null}function o(e,s){const i=new URLSearchParams(s.search).toString(),u=Gs().parse(i),p=new URLSearchParams(e.search).toString(),m=Gs().parse(p);return(0,le.isEqual)(s.pathname,e.pathname)&&(0,le.isMatch)(m,u)}const c=(0,l.Z)(e=>({item:{height:48,width:"100%","&:hover":{background:"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:e.spacing(2.5),cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:"#FFF"},label:{margin:e.spacing(1.75),marginLeft:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}),{name:"BackstageSidebarSubmenuItem"}),f=e=>{const{title:s,subtitle:i,to:u,icon:p,dropdownItems:m}=e,E=c(),{setIsHoveredOn:B}=useContext(SidebarItemWithSubmenuContext),G=()=>{B(!1)},F=useResolvedPath(u!=null?u:""),pe=useLocation();let re=isLocationMatch(pe,F);const[xe,je]=useState(!1),Ge=()=>{je(!xe)};return m!==void 0?(m.some(Qe=>{const Lt=resolvePath(Qe.to);return re=isLocationMatch(pe,Lt),re}),_jsxs(Box,{className:E.itemContainer,children:[_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs("button",{onClick:Ge,onTouchStart:Qe=>Qe.stopPropagation(),className:classnames(E.item,re?E.selected:void 0),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:E.label,children:[s,_jsx("br",{}),i&&_jsx(Typography,{variant:"caption",className:E.subtitle,children:i})]}),xe?_jsx(ArrowDropUpIcon,{className:E.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:E.dropdownArrow})]})}),m&&xe&&_jsx(Box,{className:E.dropdown,children:m.map((Qe,Lt)=>_jsx(Tooltip,{title:Qe.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:Qe.to,underline:"none",className:E.dropdownItem,onClick:G,onTouchStart:Ht=>Ht.stopPropagation(),children:_jsx(Typography,{className:E.textContent,children:Qe.title})})},Lt))})]})):_jsx(Box,{className:E.itemContainer,children:_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:u,underline:"none",className:classnames(E.item,re?E.selected:void 0),onClick:G,onTouchStart:Qe=>Qe.stopPropagation(),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:E.label,children:[s,_jsx("br",{}),i&&_jsx(Typography,{variant:"caption",className:E.subtitle,children:i})]})]})})})};var I;const N=(0,l.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:s=>{var i;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:s.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(I=(i=e.palette.navigation.submenu)===null||i===void 0?void 0:i.background)!==null&&I!==void 0?I:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:s.submenuConfig.drawerWidthClosed,transitionDelay:`${s.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:s=>({width:s.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium,color:"#FFF",padding:e.spacing(2.5),[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),V=e=>{const{isOpen:s}=Ps(),{sidebarConfig:i,submenuConfig:u}=(0,g.useContext)(ir),p=s?i.drawerWidthOpen:i.drawerWidthClosed,m=N({left:p,submenuConfig:u}),{isHoveredOn:E}=(0,g.useContext)(Mo),[B,G]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{G(E)},[E]),(0,n.jsxs)(Ee.Z,{className:ae()(m.drawer,{[m.drawerOpen]:B}),children:[(0,n.jsx)(z.Z,{variant:"h5",className:m.title,children:e.title}),e.children]})};var te=t(26739),Ze=t(76600),Oe=t(83543),ht=t(59797),at=t(98989);const wt=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),jt=()=>{const e=wt();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 Ot=null;const Bt=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Tn=()=>{const e=Bt();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 ar=null,er,Pr;const ei=e=>(0,l.Z)(s=>{var i,u;return{root:{color:s.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[s.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(er=(i=s.palette.navigation.navItem)===null||i===void 0?void 0:i.hoverBackground)!==null&&er!==void 0?er:"#404040"}},highlighted:{background:(Pr=(u=s.palette.navigation.navItem)===null||u===void 0?void 0:u.hoverBackground)!==null&&Pr!==void 0?Pr:"#404040"},label:{fontWeight:"bold",whiteSpace:"nowrap",lineHeight:"auto",flex:"3 1 auto",width:"110px",overflow:"hidden","text-overflow":"ellipsis"},iconContainer:{boxSizing:"border-box",height:"100%",width:e.iconContainerWidth,marginRight:-s.spacing(2),display:"flex",alignItems:"center",justifyContent:"center"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:s.typography.fontWeightBold,fontSize:s.typography.fontSize},searchFieldHTMLInput:{padding:s.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:s.spacing(6),textAlign:"center",marginRight:s.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:s.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${s.palette.navigation.indicator}`,color:s.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function os(e){return(0,g.useMemo)(()=>ei(e),[e])()}const ks=(e,s)=>(0,W.vJ)(e.props.children,i=>{let u=!1;return i.getElements().forEach(({props:{to:p,dropdownItems:m}})=>{if(!u){if(m!=null&&m.length){m.forEach(({to:E})=>u=u||o(s,(0,eo.i3)(E)));return}p&&(u=o(s,(0,eo.i3)(p)))}}),u},[s.pathname]);function mo(e){return e.to===void 0}const kr=g.createElement(V).type,ia=g.forwardRef(function({to:s,end:i,style:u,className:p,activeStyle:m,caseSensitive:E,activeClassName:B="active","aria-current":G="page",...F},pe){let{pathname:re}=(0,A.TH)(),{pathname:xe}=(0,A.WU)(s);E||(re=re.toLocaleLowerCase("en-US"),xe=xe.toLocaleLowerCase("en-US"));let je=re===xe;!je&&!i&&(je=re.startsWith(`${xe}/`));const Ge=je?G:void 0;return(0,n.jsx)(L.rU,{...F,to:s,ref:pe,"aria-current":Ge,style:{...u,...je?m:void 0},className:ae()([p,je?B:void 0])})}),Ai=(0,g.forwardRef)((e,s)=>{const{icon:i,text:u,hasNotifications:p=!1,hasSubmenu:m=!1,disableHighlight:E=!1,onClick:B,children:G,className:F,...pe}=e,{sidebarConfig:re}=(0,g.useContext)(ir),xe=os(re),{isOpen:je}=Ps(),Ge=!je&&m?{display:"flex",marginLeft:"24px"}:{},Qe=(0,n.jsxs)(Ee.Z,{style:Ge,children:[(0,n.jsx)(i,{fontSize:"small"}),!je&&m?(0,n.jsx)(at.Z,{}):(0,n.jsx)(n.Fragment,{})]}),Lt=(0,n.jsx)(te.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!p,className:ae()({[xe.closedItemIcon]:!je}),children:Qe}),Ht=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ee.Z,{"data-testid":"login-button",className:xe.iconContainer,children:Lt}),u&&(0,n.jsx)(z.Z,{variant:"subtitle2",className:xe.label,children:u}),(0,n.jsx)("div",{className:xe.secondaryAction,children:G})]}),_t=je?Ht:Lt,en={onClick:B,className:ae()(F,xe.root,je?xe.open:xe.closed,mo(e)&&xe.buttonItem,{[xe.highlightable]:!E})};return mo(e)?(0,n.jsx)("button",{"aria-label":u,...en,ref:s,children:_t}):(0,n.jsx)(ia,{...en,activeClassName:xe.selected,to:e.to?e.to:"",ref:s,"aria-label":u||e.to,...pe,children:_t})}),aa=({children:e,...s})=>{const{sidebarConfig:i}=(0,g.useContext)(ir),u=os(i),[p,m]=(0,g.useState)(!1),E=(0,A.TH)(),B=ks(e,E),G=(0,Ie.Z)(xe=>xe.breakpoints.down("sm")),F=()=>{m(!0)},pe=()=>{m(!1)},re=()=>G?p?(0,n.jsx)(ht.Z,{fontSize:"small",className:u.submenuArrow}):(0,n.jsx)(Oe.Z,{fontSize:"small",className:u.submenuArrow}):!p&&(0,n.jsx)(at.Z,{fontSize:"small",className:u.submenuArrow});return(0,n.jsx)(Mo.Provider,{value:{isHoveredOn:p,setIsHoveredOn:m},children:(0,n.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:pe,onTouchStart:p?pe:F,onMouseEnter:F,className:ae()(p&&u.highlighted),children:[(0,n.jsx)(Ai,{hasSubmenu:!0,className:B?u.selected:"",...s,children:re()}),p&&e]})})},Ti=(0,g.forwardRef)((e,s)=>{const[i]=(0,W.vJ)(e.children,u=>u.getElements().filter(p=>p.type===kr));return i?(0,n.jsx)(aa,{...e,children:i}):(0,n.jsx)(Ai,{...e,ref:s})});function Ul(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),[i,u]=useState(""),p=os(s),m=e.icon?e.icon:SearchIcon,E=()=>{e.onSearch(i),u("")},B=re=>{re.key==="Enter"&&(re.preventDefault(),E())},G=re=>{u(re.target.value)},F=re=>{re.preventDefault(),re.stopPropagation()},pe=re=>{E(),re.preventDefault()};return _jsx(Box,{className:p.searchRoot,children:_jsx(Ti,{icon:m,to:e.to,onClick:pe,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:i,onClick:F,onChange:G,onKeyDown:B,className:p.searchContainer,InputProps:{disableUnderline:!0,className:p.searchField},inputProps:{className:p.searchFieldHTMLInput}})})})}const Ml=(0,Ze.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),zl=(0,Ze.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),la=(0,Ze.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),ca=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),Wl=(0,Ze.Z)("div")(({theme:e})=>{const s=ca(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":s,"&:hover":s}}),Vl=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),s=os(e),{isOpen:i,setOpen:u}=useSidebarOpenState();if(useMediaQuery(E=>E.breakpoints.down("md"),{noSsr:!0}))return null;const m=()=>{u(!i)};return _jsx("button",{onClick:m,className:s.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:s.arrows,children:i?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},da=(0,l.Z)(e=>({introCard:s=>({color:"#b5b5b5",fontSize:12,width:s.sidebarConfig.drawerWidthOpen,marginTop:e.spacing(2.25),marginBottom:e.spacing(1.5),paddingLeft:s.sidebarConfig.iconPadding,paddingRight:s.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:e.spacing(1.5)},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:e.spacing(.5),"&:hover":{color:e.palette.linkHover,transition:e.transitions.create("color",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:e.spacing(1.5)}}),{name:"BackstageSidebarIntro"});function ua(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),i=da({sidebarConfig:s}),{text:u,onClose:p}=e,m=()=>p();return _jsxs(Box,{className:i.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:u}),_jsx(Box,{className:i.introDismiss,children:_jsxs(IconButton,{onClick:m,className:i.introDismissLink,children:[_jsx(CloseIcon,{className:i.introDismissIcon}),_jsx(Typography,{component:"span",className:i.introDismissText,children:"Dismiss"})]})})]})}const Ii=e=>{const{text:s,onDismiss:i}=e,[u,p]=useState(!1),m=()=>{p(!0)};return _jsx(Collapse,{in:!u,onExited:i,children:_jsx(ua,{text:s,onClose:m})})},ha=null,pa="And your recently viewed plugins will pop up here!";function Hl(e){const{isOpen:s}=useSidebarOpenState(),i={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:u,set:p}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:m,recentlyViewedItemsDismissed:E}=u!=null?u:{},B=()=>{p(F=>({...i,...F,starredItemsDismissed:!0}))},G=()=>{p(F=>({...i,...F,recentlyViewedItemsDismissed:!0}))};return s?_jsxs(_Fragment,{children:[!m&&_jsxs(_Fragment,{children:[_jsx(Ii,{text:ha,onDismiss:B}),_jsx(SidebarDivider,{})]}),!E&&_jsx(Ii,{text:pa,onDismiss:G})]}):null}const fa=(0,l.Z)(e=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:e.spacing(3),paddingBottom:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function Ri(e){const{className:s,stretch:i,noPadding:u,children:p,...m}=e,{contentRef:E}=fo(),B=fa();return(0,n.jsx)("article",{ref:E,tabIndex:-1,...m,className:ae()(B.root,s,{[B.stretch]:i,[B.noPadding]:u}),children:p})}var ga=t(6487),ma=t(99152);const va=(0,l.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{...e.typography.caption,padding:e.spacing(3,3),textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,color:e.palette.text.secondary},selected:{color:e.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:e.palette.background.default,color:e.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function Li(e){const{tabs:s,onChange:i,selectedIndex:u}=e,[p,m]=(0,g.useState)(u!=null?u:0),E=va(),B=(0,g.useCallback)((G,F)=>{u===void 0&&m(F),i&&u!==F&&i(F)},[u,i]);return(0,g.useEffect)(()=>{u!==void 0&&m(u)},[u]),(0,n.jsx)(Ee.Z,{className:E.tabsWrapper,children:(0,n.jsx)(ma.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"scrollable auto tabs example",onChange:B,value:p,children:s.map((G,F)=>(0,g.createElement)(ga.Z,{...G.tabProps,"data-testid":`header-tab-${F}`,label:G.label,key:G.id,value:F,className:E.defaultTab,classes:{selected:E.selected,root:E.tabRoot}}))})})}function ya(e){const s=(0,A.UO)(),u=e.map(({path:xe,children:je})=>({caseSensitive:!1,path:`${xe}/*`,element:je})).sort((xe,je)=>je.path.replace(/\/\*$/,"").localeCompare(xe.path.replace(/\/\*$/,"")));var p;const m=(p=(0,A.V$)(u))!==null&&p!==void 0?p:e[0].children;var E;let B=(E=s["*"])!==null&&E!==void 0?E:"";B.startsWith("/")||(B=`/${B}`);var G;const[F]=(G=(0,eo.fp)(u,B))!==null&&G!==void 0?G:[],pe=F?e.findIndex(xe=>`${xe.path}/*`===F.route.path):0;var re;return{index:pe===-1?0:pe,element:m,route:(re=e[pe])!==null&&re!==void 0?re:e[0]}}function Pi(e){const{routes:s}=e,i=(0,A.s0)(),{index:u,route:p,element:m}=ya(s),E=(0,g.useMemo)(()=>s.map(G=>({id:G.path,label:G.title,tabProps:G.tabProps})),[s]),B=G=>{let{path:F}=s[G];F=F.replace(/\/\*$/,""),F=F.replace(/^\//,""),i(F)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Li,{tabs:E,selectedIndex:u,onChange:B}),(0,n.jsxs)(Ri,{children:[(0,n.jsx)(On.q,{title:p.title}),m]})]})}const ti=()=>null;(0,W.R5)(ti,"core.gatherMountPoints",!0);function ki(e){const s=(0,n.jsx)(ti,{path:"",title:"",children:(0,n.jsx)("div",{})}).type;return g.Children.toArray(e).flatMap(i=>{if(!(0,g.isValidElement)(i))return[];if(i.type===g.Fragment)return ki(i.props.children);if(i.type!==s)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:u,title:p,children:m,tabProps:E}=i.props;return[{path:u,title:p,children:m,tabProps:E}]})}function xa(e){const s=ki(e.children);return(0,n.jsx)(Pi,{routes:s})}xa.Route=ti;const ba=(0,l.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function Sa(e){const{value:s,subvalue:i}=e,u=ba();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ee.Z,{className:u.value,children:s}),(0,n.jsx)(Ee.Z,{className:u.subvalue,children:i})]})}var vo=t(67222),Ca=t(21070),wa=t(90324),ja=t(98281),Ea=t(48049),Oi=t(51209),Bi=t(33375),Aa=t(44233),Ta=t(27604),ni=t(36444),Ia=t(37971),Ra=t(59709),La=t(17373),Pa=t(3702),ka=t(93111);const Oa=(0,l.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:e.spacing(7.5),justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),Ba=e=>{var s;const i=Oa(),{onChangeFilters:u}=e,[p,m]=(0,g.useState)({...e.selectedFilters}),[E,B]=(0,g.useState)(!1),G=()=>{m({}),B(F=>!F)};return(0,g.useEffect)(()=>{u(p)},[p,u]),(0,n.jsxs)(Ee.Z,{className:i.root,children:[(0,n.jsxs)(Ee.Z,{className:i.header,children:[(0,n.jsx)(Ee.Z,{className:i.value,children:"Filters"}),(0,n.jsx)(X.Z,{color:"primary",onClick:G,children:"Clear all"})]}),(0,n.jsx)(Ee.Z,{className:i.filters,children:((s=e.filters)===null||s===void 0?void 0:s.length)&&e.filters.map(F=>(0,n.jsx)(jn,{triggerReset:E,...F.element,selected:p[F.element.label],onChange:pe=>m({...p,[F.element.label]:pe})},F.element.label))})]})},$i={Add:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ca.Z,{...e,ref:s})),Check:(0,g.forwardRef)((e,s)=>(0,n.jsx)(ja.Z,{...e,ref:s})),Clear:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Bi.Z,{...e,ref:s})),Delete:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Aa.Z,{...e,ref:s})),DetailPanel:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Oi.Z,{...e,ref:s})),Edit:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ta.Z,{...e,ref:s})),Export:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Pa.Z,{...e,ref:s})),Filter:(0,g.forwardRef)((e,s)=>(0,n.jsx)(ni.Z,{...e,ref:s})),FirstPage:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ia.Z,{...e,ref:s})),LastPage:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ra.Z,{...e,ref:s})),NextPage:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Oi.Z,{...e,ref:s})),PreviousPage:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ea.Z,{...e,ref:s})),ResetSearch:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Bi.Z,{...e,ref:s})),Search:(0,g.forwardRef)((e,s)=>(0,n.jsx)(ni.Z,{...e,ref:s})),SortArrow:(0,g.forwardRef)((e,s)=>(0,n.jsx)(wa.Z,{...e,ref:s})),ThirdStateCheck:(0,g.forwardRef)((e,s)=>(0,n.jsx)(La.Z,{...e,ref:s})),ViewColumn:(0,g.forwardRef)((e,s)=>(0,n.jsx)(ka.Z,{...e,ref:s}))};function Zi(e,s){const i=s.split(".");let u=e[i[0]];for(let p=1;p<i.length;++p){if(u===void 0)return u;const m=i[p];u=u[m]}return u}const $a=(0,wn.Z)(e=>({header:{padding:e.spacing(1,2,1,2.5),borderTop:`1px solid ${e.palette.grey.A100}`,borderBottom:`1px solid ${e.palette.grey.A100}`,color:e.palette.textSubtle,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(vo.W$),Di=(0,wn.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:e.typography.fontWeightBold}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(vo.UW),Za=(0,l.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Da=(0,l.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Na(e,s){return e.map(i=>{const u={};let p=i.cellStyle||{};if(i.highlight)if(u.color=s.palette.textContrast,typeof p=="object")p.fontWeight=s.typography.fontWeightBold;else{const m=p;p=(E,B,G)=>({...m(E,B,G),fontWeight:s.typography.fontWeightBold})}return{...i,headerStyle:u,cellStyle:p}})}function Fa(e,s){return(0,le.transform)(e,(i,u,p)=>{(0,le.isEqual)(u,s[p])||(i[p]=u)})}const Ni={search:"",filtersOpen:!1,filters:{}};function Ua(e){const{toolbarRef:s,setSearch:i,hasFilters:u,selectedFiltersLength:p,toggleFilters:m}=e,E=Za(),B=(0,g.useCallback)(G=>{e.onSearchChanged(G),i(G)},[e,i]);return u?(0,n.jsxs)(Ee.Z,{className:E.root,children:[(0,n.jsxs)(Ee.Z,{className:E.root,children:[(0,n.jsx)(ot.Z,{onClick:m,"aria-label":"filter list",children:(0,n.jsx)(ni.Z,{})}),(0,n.jsxs)(z.Z,{className:E.title,children:["Filters (",p,")"]})]}),(0,n.jsx)(Di,{...e,ref:s,onSearchChanged:B})]}):(0,n.jsx)(Di,{...e,ref:s,onSearchChanged:B})}function Fi(e){const{data:s,columns:i,options:u,title:p,subtitle:m,filters:E,initialState:B,emptyContent:G,onStateChange:F,components:pe,...re}=e,xe=Da(),je=(0,Ke.Z)(),Ge={...Ni,...B},[Qe,Lt]=(0,g.useState)(Ge.filtersOpen),Ht=(0,g.useCallback)(()=>Lt(Bn=>!Bn),[Lt]),[_t,en]=(0,g.useState)(0),[Pt,Qt]=(0,g.useState)(s),[Gt,xr]=(0,g.useState)(Ge.filters),br=Na(i,je),[Sr,Cr]=(0,g.useState)(Ge.search);(0,g.useEffect)(()=>{if(F){const Bn=Fa({search:Sr,filtersOpen:Qe,filters:Gt},Ni);F(Bn)}},[Sr,Qe,Gt,F]);const ai={headerStyle:{textTransform:"uppercase"}},Or=(0,g.useCallback)(Bn=>{var hr;return(hr=i.find(Vr=>Vr.title===Bn))===null||hr===void 0?void 0:hr.field},[i]);(0,g.useEffect)(()=>{if(typeof s=="function")return;if(!Gt){Qt(s);return}const Bn=Object.values(Gt);if(s&&Bn.flat().length){const hr=s.filter(Vr=>!!Object.entries(Gt).filter(([,Hr])=>!!Hr.length).every(([Hr,rn])=>{const hn=Zi(Vr,Or(Hr));return Array.isArray(hn)&&Array.isArray(rn)?hn.some(as=>rn.includes(as)):Array.isArray(hn)?hn.includes(rn):Array.isArray(rn)?rn.includes(hn):hn===rn}));Qt(hr)}else Qt(s);en(Bn.flat().length)},[s,Gt,Or]);const li=(Bn,hr)=>{const Vr=rn=>{const hn=new Set,as=Gr=>{Gr!=null&&hn.add(Gr)};return hr&&hr.forEach(Gr=>{const Bs=Zi(Gr,Or(rn));Array.isArray(Bs)?Bs.forEach(as):as(Bs)}),hn},Hr=rn=>({placeholder:"All results",label:rn.column,multiple:rn.type==="multiple-select",items:[...Vr(rn.column)].sort().map(hn=>({label:hn,value:hn}))});return Bn.map(rn=>({type:rn.type,element:Hr(rn)}))},Kt=!!(E!=null&&E.length),is=(0,g.useCallback)(Bn=>(0,n.jsx)(Ua,{setSearch:Cr,hasFilters:Kt,selectedFiltersLength:_t,toggleFilters:Ht,...Bn}),[Ht,Kt,_t,Cr]),xo=typeof s!="function"&&s.length===0,Br=i.length,ci=(0,g.useCallback)(Bn=>G&&xo?(0,n.jsx)("tbody",{children:(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:Br,children:G})})}):(0,n.jsx)(vo.os,{...Bn}),[xo,G,Br]);return(0,n.jsxs)(Ee.Z,{className:xe.root,children:[Qe&&s&&typeof s!="function"&&(E==null?void 0:E.length)&&(0,n.jsx)(Ba,{filters:li(E,s),selectedFilters:Gt,onChangeFilters:xr}),(0,n.jsx)(vo.ZP,{components:{Header:$a,Toolbar:is,Body:ci,...pe},options:{...ai,...u},columns:br,icons:$i,title:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(z.Z,{variant:"h5",component:"h2",children:p}),m&&(0,n.jsx)(z.Z,{color:"textSecondary",variant:"body1",children:m})]}),data:typeof s=="function"?s:Pt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...re})]})}Fi.icons=Object.freeze($i);const Gl=e=>{const{children:s,value:i,index:u,...p}=e;return _jsx(Box,{role:"tabpanel",hidden:i!==u,"aria-labelledby":`scrollable-auto-tab-${u}`,...p,children:i===u&&_jsx(Box,{p:3,children:s})})},Ma=(0,l.Z)(e=>({root:{color:"#6E6E6E",overflow:"visible",fontSize:e.typography.h5.fontSize,textAlign:"center",borderRadius:"50%",backgroundColor:"#E6E6E6",marginLeft:s=>s.isNext?"auto":"0",marginRight:s=>s.isNext?"0":e.spacing(1.25),"&:hover":{backgroundColor:"#E6E6E6",opacity:"1"}}}),{name:"BackstageTabIcon"}),Kl=e=>{const s=Ma(e),{ariaLabel:i,onClick:u}=e;return _jsx(IconButton,{onClick:u,className:s.root,size:"small",disableRipple:!0,disableFocusRipple:!0,"aria-label":i,children:e.children})},za=(e,s)=>s?e?"20px":"0":"40px",Wa=(0,l.Z)(e=>({root:{textTransform:"none",height:"64px",fontWeight:e.typography.fontWeightBold,fontSize:e.typography.pxToRem(13),color:e.palette.textSubtle,marginLeft:s=>za(s.isFirstNav,s.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:e.palette.textSubtle}}}),{name:"BackstageTab"}),Yl=e=>{const s=Wa(e),{isFirstNav:i,isFirstIndex:u,...p}=e;return _jsx(Tab,{classes:s,disableRipple:!0,...p})},Va=(0,l.Z)(e=>({indicator:{display:"flex",justifyContent:"center",backgroundColor:e.palette.tabbar.indicator,height:e.spacing(.5)},flexContainer:{alignItems:"center"},root:{"&:last-child":{marginLeft:"auto"}}}),{name:"BackstageTabBar"}),Jl=e=>{const s=Va(e);return _jsx(Tabs,{classes:s,...e,TabIndicatorProps:{children:_jsx("span",{})}})},Ha=(0,l.Z)(e=>({root:{flexGrow:1,width:"100%"},styledTabs:{backgroundColor:e.palette.background.paper},appbar:{boxShadow:"none",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(1.25),paddingRight:e.spacing(1.25)}}),{name:"BackstageTabs"});function Ql(e){const{tabs:s}=e,i=Ha(),[u,p]=useState([0,0]),[m,E]=useState(0),[B,G]=useState(0),[F,pe]=useState([[]]),re=useRef(),{width:xe}=useWindowSize(),je=(_t,en)=>{p([m,en])},Ge=()=>{E(m-1)},Qe=()=>{E(m+1)},Lt=()=>m+1<F.length;useEffect(()=>{const en=m===0?1:2,Pt=re.current.offsetWidth-20-en*30,Qt=u[0]*B+u[1],Gt=Math.floor(Pt/170);G(Gt),pe(chunkArray(s,Gt)),p([Math.floor(Qt/Gt),Qt%Gt])},[xe,s]);const Ht=m===u[0]?u[1]:!1;return _jsxs(Box,{className:i.root,children:[_jsx(AppBar,{ref:re,className:i.appbar,position:"static",children:_jsx(Box,{children:_jsxs(StyledTabs,{value:Ht,onChange:je,selectionFollowsFocus:!0,children:[m!==0&&_jsx(StyledIcon,{onClick:Ge,ariaLabel:"navigate-before",children:_jsx(NavigateBeforeIcon,{})}),F[m].map((_t,en)=>_jsx(StyledTab,{value:en,isFirstIndex:en===0,isFirstNav:m===0,icon:_t.icon||void 0,label:_t.label||void 0},en)),Lt()&&_jsx(StyledIcon,{isNext:!0,onClick:Qe,ariaLabel:"navigate-next",children:_jsx(NavigateNextIcon,{})})]})})}),Ht!==!1?F[m].map((_t,en)=>_jsx(TabPanel,{value:en,index:Ht,children:_t.content},en)):_jsx(TabPanel,{value:u[1],index:u[1],children:F[u[0]][u[1]].content},"panel_outside_chunked_array")]})}var Xl=t(44311);function Ga(e,s){const i=e[e.length-1];if(!!i)return i>=.9?s.palette.status.ok:i>=.5?s.palette.status.warning:s.palette.status.error}function ql(e){const s=useTheme();if(!e.data)return null;var i;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(i=e.color)!==null&&i!==void 0?i:Ga(e.data,s)})]})}const Ka=e=>(0,l.Z)(s=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:s.spacing(2),textAlign:e.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:s.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),Ya=({title:e="Unknown page",className:s})=>(0,n.jsx)(z.Z,{variant:"h4",component:"h2",className:s,"data-testid":"header-title",children:e});function Ja(e){const{description:s,title:i,titleComponent:u=void 0,children:p,textAlign:m="left"}=e,E=Ka({textAlign:m})(),B=u||(0,n.jsx)(Ya,{title:i,className:E.title});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(On.q,{title:i}),(0,n.jsxs)(Ee.Z,{className:E.container,children:[(0,n.jsxs)(Ee.Z,{className:E.leftItemsBox,children:[B,s&&(0,n.jsx)(z.Z,{className:E.description,variant:"body2",children:s})]}),(0,n.jsx)(Ee.Z,{className:E.rightItemsBox,children:p})]})]})}var Qa=t.p+"static/mic-drop.fe3ef4d0..svg";const Xa=(0,l.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),qa=()=>{const e=Xa();return(0,n.jsx)("img",{src:Qa,className:e.micDrop,alt:"Girl dropping mic from her hands"})},_a=(0,l.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:e.typography.h3.fontSize}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function el(e){const{status:s,statusMessage:i,additionalInfo:u,supportUrl:p}=e,m=_a(),E=(0,A.s0)(),B=Xs();return(0,n.jsxs)(Be.Z,{container:!0,spacing:0,className:m.container,children:[(0,n.jsxs)(Be.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,n.jsxs)(z.Z,{"data-testid":"error",variant:"body1",className:m.subtitle,children:["ERROR ",s,": ",i]}),(0,n.jsx)(z.Z,{variant:"body1",className:m.subtitle,children:u}),(0,n.jsx)(z.Z,{variant:"h2",className:m.title,children:"Looks like someone dropped the mic!"}),(0,n.jsxs)(z.Z,{variant:"h6",children:[(0,n.jsx)(Je,{to:"#","data-testid":"go-back-link",onClick:()=>E(-1),children:"Go back"}),"... or please"," ",(0,n.jsx)(Je,{to:p||B.url,children:"contact support"})," if you think this is a bug."]})]}),(0,n.jsx)(qa,{})]})}var tl=t(16173);const nl=(0,wn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(z.Z),ri=(0,wn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(Ee.Z);function rl(e){const{children:s,...i}=e,[u,p]=g.useState(null),m=g.Children.toArray(s),[E,B,...G]=m,F=G.length?G.pop():m[m.length-1],pe=m.length>3,re=Ge=>{p(Ge.currentTarget)},xe=()=>{p(null)},je=Boolean(u);return(0,n.jsxs)(g.Fragment,{children:[(0,n.jsxs)(tl.Z,{"aria-label":"breadcrumb",...i,children:[m.length>1&&(0,n.jsx)(ri,{clone:!0,children:E}),m.length>2&&(0,n.jsx)(ri,{clone:!0,children:B}),pe&&(0,n.jsx)(nl,{onClick:re,children:"..."}),(0,n.jsx)(Ee.Z,{style:{fontStyle:"italic"},children:F})]}),(0,n.jsx)(Hs.ZP,{open:je,anchorEl:u,onClose:xe,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,n.jsx)(St.Z,{children:G.map((Ge,Qe)=>(0,n.jsx)(Ye.Z,{button:!0,children:(0,n.jsx)(ri,{clone:!0,children:Ge})},Qe))})})]})}const sl=(0,l.Z)(e=>({header:{gridArea:"pageHeader",padding:e.spacing(3),width:"100%",boxShadow:e.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:e.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[e.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto",alignItems:"center"},title:{color:e.page.fontColor,wordBreak:"break-word",fontSize:e.typography.h3.fontSize,marginBottom:0},subtitle:{color:e.page.fontColor,opacity:.8,display:"inline-block",marginTop:e.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:e.spacing(1),color:e.page.fontColor},breadcrumb:{color:e.page.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-e.spacing(.3),marginBottom:e.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-e.spacing(.3),marginBottom:e.spacing(.3)}}),{name:"BackstageHeader"}),ol=({type:e,typeLink:s,classes:i,pageTitle:u})=>e?s?(0,n.jsxs)(rl,{className:i.breadcrumb,children:[(0,n.jsx)(Je,{to:s,children:e}),(0,n.jsx)(z.Z,{children:u})]}):(0,n.jsx)(z.Z,{className:i.type,children:e}):null,il=({pageTitle:e,classes:s,tooltip:i})=>{const u=(0,n.jsx)(z.Z,{className:s.title,variant:"h1",children:e});return i?(0,n.jsx)(ut.ZP,{title:i,placement:"top-start",children:u}):u},al=({classes:e,subtitle:s})=>s?typeof s!="string"?(0,n.jsx)(n.Fragment,{children:s}):(0,n.jsx)(z.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:s}):null;function Ui(e){const{children:s,pageTitleOverride:i,style:u,subtitle:p,title:m,tooltip:E,type:B,typeLink:G}=e,F=sl(),re=(0,W.h_)(W.Ds).getOptionalString("app.title")||"Backstage",xe=i||m,je=m||i,Ge=`${xe} | %s | ${re}`,Qe=`${xe} | ${re}`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(On.q,{titleTemplate:Ge,defaultTitle:Qe}),(0,n.jsxs)("header",{style:u,className:F.header,children:[(0,n.jsxs)(Ee.Z,{className:F.leftItemsBox,children:[(0,n.jsx)(ol,{classes:F,type:B,typeLink:G,pageTitle:je}),(0,n.jsx)(il,{classes:F,pageTitle:je,tooltip:E}),(0,n.jsx)(al,{classes:F,subtitle:p})]}),(0,n.jsx)(Be.Z,{container:!0,className:F.rightItemsBox,spacing:4,children:s})]})]})}const ll=({label:e,secondaryLabel:s,icon:i,disabled:u=!1,onClick:p})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:u,button:!0,onClick:m=>{p&&p(m)},children:[i&&_jsx(ListItemIcon,{children:i}),_jsx(ListItemText,{primary:e,secondary:s})]})});function _l(e){const{actionItems:s}=e,[i,u]=React.useState(!1),p=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>u(!0),"data-testid":"header-action-menu",ref:p,style:{color:"white",height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:i,anchorEl:p.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>u(!1),children:_jsx(List,{children:s.map((m,E)=>_jsx(ll,{...m},`header-action-menu-${E}`))})})]})}const cl=(0,l.Z)(e=>({root:{textAlign:"left"},label:{color:e.palette.common.white,fontWeight:e.typography.fontWeightBold,letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:"rgba(255, 255, 255, 0.8)",fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),dl=({value:e,className:s})=>(0,n.jsx)(z.Z,{className:s,children:e});function ul(e){const{label:s,value:i,url:u}=e,p=cl(),m=(0,n.jsx)(dl,{className:p.value,value:i||"<Unknown>"});return(0,n.jsx)(Be.Z,{item:!0,children:(0,n.jsxs)(z.Z,{component:"span",className:p.root,children:[(0,n.jsx)(z.Z,{className:p.label,children:s}),u?(0,n.jsx)(Je,{to:u,children:m}):m]})})}const hl=e=>(0,P.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),pl=(0,l.Z)(hl,{name:"BackstageItemCardHeader"});function fl(e){const{title:s,subtitle:i,children:u}=e,p=pl(e);return(0,n.jsxs)(Ee.Z,{className:p.root,children:[i&&(0,n.jsx)(z.Z,{variant:"subtitle2",component:"h3",children:i}),s&&(0,n.jsx)(z.Z,{variant:"h6",component:"h4",children:s}),u]})}function ec(e){const{description:s,tags:i,title:u,type:p,subtitle:m,label:E,onClick:B,href:G}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:u,subtitle:m||p})}),_jsxs(CardContent,{children:[i!=null&&i.length?_jsx(Box,{children:i.map((F,pe)=>_jsx(Chip,{size:"small",label:F},pe))}):null,s]}),_jsxs(CardActions,{children:[!G&&_jsx(Button,{to:"#",onClick:B,color:"primary",children:E}),G&&_jsx(Button,{to:G,color:"primary",children:E})]})]})}const gl=e=>(0,P.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),ml=(0,l.Z)(gl,{name:"BackstageItemCardGrid"});function vl(e){const{children:s,...i}=e,u=ml(i);return(0,n.jsx)(Ee.Z,{className:u.root,...i,children:s})}var yl=t(41547);const xl=(0,l.Z)(()=>({root:({isMobile:e})=>({display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",height:e?"100%":"100vh",overflowY:"auto"})}),{name:"BackstagePage"});function Mi(e){const{themeId:s,children:i}=e,{isMobile:u}=Wr(),p=xl({isMobile:u});return(0,n.jsx)(yl.Z,{theme:m=>({...m,page:m.getPageTheme({themeId:s})}),children:(0,n.jsx)("main",{className:p.root,children:i})})}function bl(e){const{themeId:s,children:i,...u}=e;return(0,n.jsxs)(Mi,{themeId:s,children:[(0,n.jsx)(Ui,{...u}),i]})}var Yn=t(30195);const tc=Yn.z.object({providerInfo:Yn.z.object({}).catchall(Yn.z.unknown()).optional(),profile:Yn.z.object({email:Yn.z.string().optional(),displayName:Yn.z.string().optional(),picture:Yn.z.string().optional()}),backstageIdentity:Yn.z.object({token:Yn.z.string(),identity:Yn.z.object({type:Yn.z.literal("user"),userEntityRef:Yn.z.string(),ownershipEntityRefs:Yn.z.array(Yn.z.string())})})}),zi={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function Sl(e){const s=new Date(Date.now()+zi.defaultTokenExpiryMillis);if(!e)return s;const[i,u,p]=e.split("."),m=JSON.parse(atob(u));return typeof m.exp!="number"?s:new Date(m.exp*1e3-zi.tokenExpiryMarginMillis)}class nc{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:s}=this.getSessionSync(),i=s.identity.userEntityRef,u=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(i);if(!u)throw new TypeError(`Invalid user entity reference "${i}"`);return u[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const s=this.state.type==="active"?this.state.session:void 0,i=this.fetchSession().then(u=>(this.state={type:"active",session:u,expiresAt:Sl(u.backstageIdentity.token)},u),u=>{throw this.state={type:"failed",error:u},u});return this.state={type:"fetching",promise:i,previous:s},i}async fetchSession(){const s=await this.options.discoveryApi.getBaseUrl("auth"),i=await fetch(`${s}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"});if(!i.ok)throw await ResponseError.fromResponse(i);return proxiedSessionSchema.parse(await i.json())}constructor(s){this.options=s,this.abortController=new AbortController,this.state={type:"empty"}}}const rc=e=>{const s=useApi(discoveryApiRef),[{status:i,error:u},{execute:p}]=useAsync(async()=>{const m=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:s});await m.start(),e.onSignInSuccess(m)});return useMountEffect(p),i==="loading"?_jsx(Progress,{}):u?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:u}):null},Cl=(0,l.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),si=({children:e})=>{const s=Cl();return(0,n.jsx)(Be.Z,{component:"li",item:!0,classes:s,children:e})};class oi{getUserId(){return"guest"}async getIdToken(){}getProfile(){return{email:"guest@example.com",displayName:"Guest"}}async getProfileInfo(){return{email:"guest@example.com",displayName:"Guest"}}async getBackstageIdentity(){const s="user:default/guest";return{type:"user",userEntityRef:s,ownershipEntityRefs:[s]}}async getCredentials(){return{}}async signOut(){}}function wl(e){const[s,i,u]=e.split(".");return JSON.parse(atob(i))}class ii{getUserId(){return this.result.userId}static fromResult(s){return new ii(s)}async getIdToken(){var s,i;return(i=(s=this.result).getIdToken)===null||i===void 0?void 0:i.call(s)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const s=await this.getIdToken();if(!s){const p=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:p,ownershipEntityRefs:[p]}}const{sub:i,ent:u}=wl(s);return{type:"user",userEntityRef:i,ownershipEntityRefs:u!=null?u:[]}}async getCredentials(){var s,i;return{token:await((i=(s=this.result).getIdToken)===null||i===void 0?void 0:i.call(s))}}async signOut(){var s,i;return(i=(s=this.result).signOut)===null||i===void 0?void 0:i.call(s)}constructor(s){this.result=s}}class Os{static createGuest(){return new oi}static fromLegacy(s){return ii.fromResult(s)}static create(s){return new Os(s.identity,s.authApi,s.profile)}getUserId(){const s=this.identity.userEntityRef,i=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(s);if(!i)throw new TypeError(`Invalid user entity reference "${s}"`);return i[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(s){throw this.profilePromise=void 0,s}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(s,i,u){this.identity=s,this.authApi=i,this.profile=u}}const jl={Component:({config:e,onSignInSuccess:s})=>{const{apiRef:i,title:u,message:p}=e,m=(0,W.h_)(i),E=(0,W.h_)(W.VE),B=async()=>{try{const G=await m.getBackstageIdentity({instantPopup:!0});if(!G)throw new Error(`The ${u} provider is not configured to support sign-in`);const F=await m.getProfile();s(Os.create({identity:G.identity,profile:F,authApi:m}))}catch(G){E.post(new Jr.SP("Login failed",G))}};return(0,n.jsx)(si,{children:(0,n.jsx)(Tr,{variant:"fullHeight",title:u,actions:(0,n.jsx)(X.Z,{color:"primary",variant:"outlined",onClick:B,children:"Sign In"}),children:(0,n.jsx)(z.Z,{variant:"body1",children:p})})})},loader:async(e,s)=>{const i=e.get(s),u=await i.getBackstageIdentity({optional:!0});if(!u)return;const p=await i.getProfile();return Os.create({identity:u.identity,profile:p,authApi:i})}},El={Component:({onSignInSuccess:e})=>(0,n.jsx)(si,{children:(0,n.jsx)(Tr,{title:"Guest",variant:"fullHeight",actions:(0,n.jsx)(X.Z,{color:"primary",variant:"outlined",onClick:()=>e(new oi),children:"Enter"}),children:(0,n.jsxs)(z.Z,{variant:"body1",children:["Enter as a Guest User.",(0,n.jsx)("br",{}),"You will not have a verified identity,",(0,n.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new oi};var Al=t(63955),Wi=t(86619),Vi=t(74828),Tl=t(45455),Il=t.n(Tl);const Rl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Ll=(0,l.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Hi=e=>{const{ref:s,...i}=e;return{inputRef:s,...i}},Pl={Component:({onSignInSuccess:e})=>{const s=Ll(),{register:i,handleSubmit:u,formState:p}=(0,Al.cI)({mode:"onChange"}),{errors:m}=p,E=({userId:B})=>{e(Os.fromLegacy({userId:B,profile:{email:`${B}@example.com`}}))};return(0,n.jsx)(si,{children:(0,n.jsxs)(Tr,{title:"Custom User",variant:"fullHeight",children:[(0,n.jsxs)(z.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,n.jsx)("br",{}),"This selection will not be stored."]}),(0,n.jsxs)("form",{className:s.form,onSubmit:u(E),children:[(0,n.jsxs)(Se.Z,{children:[(0,n.jsx)(Wi.Z,{...Hi(i("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(m.userId)}),m.userId&&(0,n.jsx)(Vi.Z,{error:!0,children:m.userId.message})]}),(0,n.jsxs)(Se.Z,{children:[(0,n.jsx)(Wi.Z,{...Hi(i("idToken",{required:!1,validate:B=>!B||Rl.test(B)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(m.idToken)}),m.idToken&&(0,n.jsx)(Vi.Z,{error:!0,children:m.idToken.message})]}),(0,n.jsx)(X.Z,{type:"submit",color:"primary",variant:"outlined",className:s.button,disabled:!(p!=null&&p.isDirty)||!Il()(m),children:"Continue"})]})]})})},loader:async()=>{}},yo="@backstage/core:SignInPage:provider",Gi={guest:El,custom:Pl,common:jl};function Ki(e,s){if(e in s)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function dc(e){return e.reduce((i,u)=>{if(typeof u=="string")return Ki(u,i),i[u]={components:Gi[u],id:u},i;const{id:p}=u;return Ki(p,i),i[p]={components:Gi.common,id:p,config:u},i},{})}const uc=(e,s)=>{const i=useApi(errorApiRef),u=useApiHolder(),[p,m]=useState(!0),E=useCallback(G=>{s(IdentityApiSignOutProxy.from({identityApi:G,signOut:async()=>{var F;localStorage.removeItem(yo),await((F=G.signOut)===null||F===void 0?void 0:F.call(G))}}))},[s]);useLayoutEffect(()=>{var G;if(!p)return;const F=localStorage.getItem(yo);if(F===null){m(!1);return}const pe=e[F];if(!pe){m(!1);return}let re=!1;return pe.components.loader(u,(G=pe.config)===null||G===void 0?void 0:G.apiRef).then(xe=>{re||(xe?E(xe):m(!1))}).catch(xe=>{re||(localStorage.removeItem(yo),i.post(xe),m(!1))}),()=>{re=!0}},[p,i,s,u,e,E]);const B=useMemo(()=>Object.keys(e).map(G=>{const F=e[G],{Component:pe}=F.components,re=xe=>{localStorage.setItem(yo,F.id),E(xe)};return _jsx(pe,{config:F.config,onSignInSuccess:re},F.id)}),[e,E]);return[p,B]},kl=({onSignInSuccess:e,providers:s=[],title:i,align:u="left"})=>{const p=useApi(configApiRef),m=useStyles(),E=getSignInProviders(s),[B,G]=useSignInProviders(E,e);return B?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:p.getString("app.title")}),_jsxs(Content,{children:[i&&_jsx(ContentHeader,{title:i,textAlign:u}),_jsx(Grid,{container:!0,justifyContent:u==="center"?u:"flex-start",spacing:2,component:"ul",classes:m,children:G})]})]})},Ol=({provider:e,auto:s,onSignInSuccess:i})=>{const u=useStyles(),p=useApi(e.apiRef),m=useApi(configApiRef),[E,B]=useState(),[G,F]=useState(!1),pe=async({checkExisting:re,showPopup:xe})=>{try{let je;if(re&&(je=await p.getBackstageIdentity({optional:!0})),!je&&(xe||s)&&(F(!0),je=await p.getBackstageIdentity({instantPopup:!0}),!je))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!je){F(!0);return}const Ge=await p.getProfile();i(UserIdentity.create({identity:je.identity,authApi:p,profile:Ge}))}catch(je){B(je),F(!0)}};return useMountEffect(()=>pe({checkExisting:!0})),G?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:m.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:u,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{pe({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),E&&E.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:E.message})]})})})})]}):_jsx(Progress,{})};function hc(e){return"provider"in e?_jsx(Ol,{...e}):_jsx(kl,{...e})}const Bl=(0,l.Z)(e=>({root:{padding:e.spacing(0,2,0,2.5),minHeight:e.spacing(3)},indicator:{backgroundColor:e.palette.info.main,height:e.spacing(.3)}}),{name:"BackstageTabbedCard"}),$l=(0,wn.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(_r.Z);function pc(e){const{slackChannel:s,errorBoundaryProps:i,children:u,title:p,deepLink:m,value:E,onChange:B}=e,G=Bl(),[F,pe]=useState(0),re=B||((Ge,Qe)=>pe(Qe));let xe;E?React.Children.map(u,Ge=>{if(React.isValidElement(Ge)&&(Ge==null?void 0:Ge.props.value)===E){var Qe;xe=Ge==null||(Qe=Ge.props)===null||Qe===void 0?void 0:Qe.children}}):React.Children.map(u,(Ge,Qe)=>{React.isValidElement(Ge)&&Qe===F&&(xe=Ge==null?void 0:Ge.props.children)});const je=i||(s?{slackChannel:s}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...je,children:[p&&_jsx($l,{title:p}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:G,value:E||F,onChange:re,children:u}),_jsx(Divider,{}),_jsx(CardContent,{children:xe}),m&&_jsx(BottomLink,{...m})]})})}const Zl=(0,l.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:e.typography.fontWeightBold}}),{name:"BackstageCardTab"});function fc(e){const{children:s,...i}=e,u=Zl();return _jsx(Tab,{disableRipple:!0,classes:u,...i})}},25248:function(It,ze,t){"use strict";t.d(ze,{fC:function(){return b},CL:function(){return Ee},sM:function(){return _},$v:function(){return Te},v_:function(){return et},hg:function(){return Xe},uB:function(){return q},R5:function(){return $t},bq:function(){return S},Ds:function(){return Je},ni:function(){return z},T0:function(){return M},CO:function(){return Fn},x8:function(){return bn},rx:function(){return mn},YO:function(){return un},P4:function(){return Nn},NT:function(){return Xt},NW:function(){return He},VE:function(){return gt},W0:function(){return Ke},gP:function(){return st},IY:function(){return pt},F4:function(){return le},ux:function(){return L},Kp:function(){return ae},$4:function(){return mt},p_:function(){return O},ZM:function(){return rt},D:function(){return A},gW:function(){return T},E6:function(){return ot},z$:function(){return Rt},h_:function(){return ne},I_:function(){return P},qD:function(){return Re},vJ:function(){return In},yx:function(){return Ie},tg:function(){return pn},Oi:function(){return dn}});var h=t(52322),n=t(51837),W=t(2784);const $=(0,n.CT)("analytics-context"),g=()=>{const ge=(0,W.useContext)($);if(ge===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const ee=ge.atVersion(1);if(ee===void 0)throw new Error("No context found for version 1.");return ee},b=ge=>{const{attributes:ee,children:Ae}=ge,qe={...g(),...ee},bt=(0,n.EI)({1:qe});return(0,h.jsx)($.Provider,{value:bt,children:Ae})};function l(ge,ee){const Ae=Fe=>_jsx(b,{attributes:ee,children:_jsx(ge,{...Fe})});return Ae.displayName=`WithAnalyticsContext(${ge.displayName||ge.name||"Component"})`,Ae}function P(){const ge=(0,n.Vt)("api-context");if(!ge)throw new Error("API context is not available");const ee=ge.atVersion(1);if(!ee)throw new Error("ApiContext v1 not available");return ee}function ne(ge){const Ae=P().get(ge);if(!Ae)throw new Error(`No implementation available for ${ge}`);return Ae}function Q(ge){return function(Ae){const Fe=bt=>{const ie=P(),k={};for(const ce in ge)if(ge.hasOwnProperty(ce)){const Be=ge[ce],D=ie.get(Be);if(!D)throw new Error(`No implementation available for ${Be}`);k[ce]=D}return _jsx(Ae,{...bt,...k})},qe=Ae.displayName||Ae.name||"Component";return Fe.displayName=`withApis(${qe})`,Fe}}class X{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(ee){if(this.config=ee,!ee.id.split(".").flatMap(Fe=>Fe.split("-")).every(Fe=>Fe.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${ee.id}'`)}}function M(ge){return new X(ge)}function z(ge,ee){return"id"in ge?{api:ge,deps:{},factory:()=>ee}:ge}var _;(function(ge){ge.SignedIn="SignedIn",ge.SignedOut="SignedOut"})(_||(_={}));const ae=M({id:"core.auth.google"}),le=M({id:"core.auth.github"}),A=M({id:"core.auth.okta"}),L=M({id:"core.auth.gitlab"}),O=M({id:"core.auth.microsoft"}),T=M({id:"core.auth.onelogin"}),S=M({id:"core.auth.bitbucket"}),q=M({id:"core.auth.atlassian"}),Te=M({id:"core.alert"}),et=M({id:"core.analytics"}),Xe=M({id:"core.apptheme"}),Je=M({id:"core.config"}),He=M({id:"core.discovery"}),gt=M({id:"core.error"});var Ee;(function(ge){ge[ge.None=0]="None",ge[ge.Active=1]="Active"})(Ee||(Ee={}));const Ke=M({id:"core.featureflags"}),st=M({id:"core.fetch"}),mt=M({id:"core.identity"}),rt=M({id:"core.oauthrequest"}),ot=M({id:"core.storage"});class ut{setContext(ee){this.context=ee}captureEvent(ee,Ae,{value:Fe,attributes:qe}={}){try{this.analyticsApi.captureEvent({action:ee,subject:Ae,value:Fe,attributes:qe,context:this.context})}catch(bt){console.warn("Error during analytics event capture. %o",bt)}}constructor(ee,Ae={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=ee,this.context=Ae}}function xt(){try{return ne(et)}catch{return{captureEvent:()=>{}}}}function Rt(){const ge=(0,W.useRef)(null),ee=g(),Ae=xt();function Fe(){return ge.current===null&&(ge.current=new ut(Ae)),ge.current}const qe=Fe();return qe.setContext(ee),qe}const We="plugin-context",se=ge=>{const{children:ee,plugin:Ae}=ge,{Provider:Fe}=(0,n.CT)(We);return(0,h.jsx)(Fe,{value:(0,n.EI)({1:{plugin:Ae}}),children:ee})};function Ie(){const ge=(0,n.Vt)(We);if(!ge)throw new Error("Plugin Options context is not available");const ee=ge.atVersion(1);if(!ee)throw new Error("Plugin Options v1 is not available");return ee.plugin.getPluginOptions()}const Re=()=>{const ge=(0,n.Vt)("app-context");if(!ge)throw new Error("App context is not available");const ee=ge.atVersion(1);if(!ee)throw new Error("AppContext v1 not available");return ee},tt=(0,n.uW)("component-data-store",()=>new WeakMap),vt="__backstage_data";function $t(ge,ee,Ae){const Fe=ge;var qe;let bt=(qe=Fe[vt])!==null&&qe!==void 0?qe:tt.get(ge);if(bt||(bt={map:new Map},Object.defineProperty(Fe,vt,{enumerable:!1,configurable:!0,writable:!1,value:bt}),tt.set(ge,bt)),bt.map.has(ee)){const ie=ge.displayName||ge.name;throw new Error(`Attempted to attach duplicate data "${ee}" to component "${ie}"`)}bt.map.set(ee,Ae)}function pt(ge,ee){if(!ge)return;const Ae=ge.type;if(!Ae)return;var Fe;const qe=(Fe=Ae[vt])!==null&&Fe!==void 0?Fe:tt.get(Ae);if(!!qe)return qe.map.get(ee)}const Et=(0,n.uW)("route-ref-type",()=>Symbol("route-ref-type"));let At=Et;class kt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(ee,Ae){this.id=ee,this.params=Ae,this[At]="absolute"}}function Xt(ge){var ee;return new kt(ge.id,(ee=ge.params)!==null&&ee!==void 0?ee:[])}const Wt=/^\w+$/;let Vt=null;class Yt{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(ee,Ae,Fe,qe){this.id=ee,this.path=Ae,this.parent=Fe,this.params=qe,this[Vt]="sub"}}function cn(ge){const{id:ee,path:Ae,parent:Fe}=ge,qe=Ae.split("/").filter(k=>k.startsWith(":")).map(k=>k.substring(1)),bt=[...Fe.params,...qe];if(Fe.params.some(k=>qe.includes(k)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Ae.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Ae}'`);if(Ae.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Ae}'`);for(const k of qe)if(!Wt.test(k))throw new Error(`SubRouteRef path has invalid param, got '${k}'`);return new Yt(ee,Ae,Fe,bt)}let on=Et;class Zn{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(ee,Ae,Fe){this.id=ee,this.params=Ae,this.optional=Fe,this[on]="external"}}function bn(ge){var ee;return new Zn(ge.id,(ee=ge.params)!==null&&ee!==void 0?ee:[],Boolean(ge.optional))}var Dn=t(73557);function pn(ge){const ee=(0,Dn.TH)(),Ae=(0,n.Vt)("routing-context");if(!Ae)throw new Error("Routing context is not available");const Fe=Ae.atVersion(1),qe=(0,W.useMemo)(()=>Fe&&Fe.resolve(ge,ee),[Fe,ge,ee]);if(!Ae)throw new Error("useRouteRef used outside of routing context");if(!Fe)throw new Error("RoutingContext v1 not available");const bt="optional"in ge&&ge.optional;if(!qe&&!bt)throw new Error(`No path for ${ge}`);return qe}function dn(ge){return(0,Dn.UO)()}class Jt extends W.Component{static getDerivedStateFromError(ee){return{error:ee}}render(){const{error:ee}=this.state,{app:Ae,plugin:Fe}=this.props,{ErrorBoundaryFallback:qe}=Ae.getComponents();return ee?(0,h.jsx)(qe,{error:ee,resetError:this.handleErrorReset,plugin:Fe}):this.props.children}constructor(...ee){super(...ee),this.state={error:void 0},this.handleErrorReset=()=>{this.setState({error:void 0})}}}function Nn(ge){const{component:ee,mountPoint:Ae,name:Fe}=ge;return un({component:{lazy:()=>ee().then(qe=>{const bt=k=>{try{pn(Ae)}catch(ce){if(typeof ce=="object"&&ce!==null){const{message:Be}=ce;if(typeof Be=="string"&&Be.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Ae} 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 ce}return(0,h.jsx)(qe,{...k})},ie=Fe||qe.displayName||qe.name||"LazyComponent";return bt.displayName=`RoutableExtension(${ie})`,bt},qe=>ie=>{const k=Re(),{BootErrorPage:ce}=k.getComponents();return(0,h.jsx)(ce,{step:"load-chunk",error:qe})})},data:{"core.mountPoint":Ae},name:Fe})}function Fn(ge){const{component:ee,name:Ae}=ge;return un({component:ee,name:Ae})}function un(ge){const{data:ee={},name:Ae}=ge;Ae||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Fe;if("lazy"in ge.component){const bt=ge.component.lazy;Fe=(0,W.lazy)(()=>bt().then(ie=>({default:ie})))}else Fe=ge.component.sync;const qe=Ae||Fe.displayName||Fe.name||"Component";return{expose(bt){const ie=k=>{const ce=Re(),{Progress:Be}=ce.getComponents(),D=ee==null?void 0:ee["core.mountPoint"];return(0,h.jsx)(W.Suspense,{fallback:(0,h.jsx)(Be,{}),children:(0,h.jsx)(Jt,{app:ce,plugin:bt,children:(0,h.jsx)(b,{attributes:{pluginId:bt.getId(),...Ae&&{extension:Ae},...D&&{routeRef:D.id}},children:(0,h.jsx)(se,{plugin:bt,children:(0,h.jsx)(Fe,{...k})})})})})};$t(ie,"core.plugin",bt);for(const[k,ce]of Object.entries(ee))$t(ie,k,ce);return ie.displayName=`Extension(${qe})`,ie}}}function fn(ge,ee,Ae,Fe){return W.Children.toArray(ge).flatMap(qe=>{if(!(0,W.isValidElement)(qe))return[];if(qe.type===W.Fragment)return fn(qe.props.children,ee,Ae,Fe);if(pt(qe,"core.featureFlagged")){const bt=qe.props;return("with"in bt?ee.isActive(bt.with):!ee.isActive(bt.without))?fn(qe.props.children,ee,Ae,Fe):[]}if(Ae===void 0||Ae(qe))return[qe];if(Fe)throw new Error(Fe);return fn(qe.props.children,ee,Ae,Fe)})}class gn{selectByComponentData(ee){const Ae=fn(this.node,this.featureFlagsApi,Fe=>pt(Fe,ee.key)!==void 0,ee.withStrictError);return new gn(Ae,this.featureFlagsApi)}findComponentData(ee){return fn(this.node,this.featureFlagsApi,Fe=>pt(Fe,ee.key)!==void 0).map(Fe=>pt(Fe,ee.key)).filter(Fe=>Fe!==void 0)}getElements(){return fn(this.node,this.featureFlagsApi)}constructor(ee,Ae){this.node=ee,this.featureFlagsApi=Ae}}function In(ge,ee,Ae=[]){const Fe=ne(Ke),qe=new gn(ge,Fe);return(0,W.useMemo)(()=>ee(qe),[ge,...Ae])}class Rn{getId(){return this.config.id}getApis(){var ee;return(ee=this.config.apis)!==null&&ee!==void 0?ee:[]}getFeatureFlags(){var ee,Ae;return(Ae=(ee=this.config.featureFlags)===null||ee===void 0?void 0:ee.slice())!==null&&Ae!==void 0?Ae:[]}get routes(){var ee;return(ee=this.config.routes)!==null&&ee!==void 0?ee:{}}get externalRoutes(){var ee;return(ee=this.config.externalRoutes)!==null&&ee!==void 0?ee:{}}provide(ee){return ee.expose(this)}__experimentalReconfigure(ee){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(ee))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var ee;return(ee=this.options)!==null&&ee!==void 0?ee:{}}toString(){return`plugin{${this.config.id}}`}constructor(ee){this.config=ee,this.options=void 0}}function mn(ge){return new Rn(ge)}},23054:function(It,ze,t){"use strict";t.d(ze,{SP:function(){return _},dR:function(){return X},VL:function(){return le},BD:function(){return n}});function h(A){if(typeof A!="object"||A===null||Array.isArray(A))return!1;const L=A;return!(typeof L.name!="string"||L.name===""||typeof L.message!="string")}function n(A){if(typeof A!="object"||A===null||Array.isArray(A))throw new Error(`Encountered invalid error, not an object, got '${A}'`);const L=A;if(typeof L.name!="string"||L.name==="")throw new Error(`Encountered error object without a name, got '${A}'`);if(typeof L.message!="string")throw new Error(`Encountered error object without a message, got '${A}'`)}var W=t(24852);function $(A,L){const T={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(A)};return L!=null&&L.includeStack||delete T.stack,T}function g(A){const L=(0,W.deserializeError)(A);return A.stack||(L.stack=void 0),L}function b(A){if(h(A)){const L=String(A);return L!=="[object Object]"?L:`${A.name}: ${A.message}`}return`unknown error '${A}'`}class l extends Error{constructor(L,O){var T;let S=L;if(O!==void 0){const q=b(O);S?S+=`; caused by ${q}`:S=`caused by ${q}`}super(S),(T=Error.captureStackTrace)===null||T===void 0||T.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=h(O)?O:void 0}}class P extends null{}class ne extends null{}class Q extends null{}class X extends l{}class M extends null{}class z extends null{}class _ extends l{constructor(L,O){super(L,O),this.name=h(O)?O.name:"Error"}}async function ae(A){try{const O=await A.text();if(O){var L;if(!((L=A.headers.get("content-type"))===null||L===void 0)&&L.startsWith("application/json"))try{const T=JSON.parse(O);if(T.error&&T.response)return T}catch{}return{error:{name:"Error",message:`Request failed with status ${A.status} ${A.statusText}, ${O}`},response:{statusCode:A.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${A.status} ${A.statusText}`},response:{statusCode:A.status}}}class le extends Error{static async fromResponse(L){const O=await ae(L),T=O.response.statusCode||L.status,S=O.error.name||L.statusText,q=`Request failed with ${T} ${S}`,Te=g(O.error);return new le({message:q,response:L,data:O,cause:Te})}constructor(L){super(L.message),this.name="ResponseError",this.response=L.response,this.body=L.data,this.cause=L.cause}}},32838:function(It,ze,t){"use strict";t.d(ze,{nW:function(){return le},ae:function(){return X},q3:function(){return M}});var h=t(25248);const n=(0,h.T0)({id:"core.scmauth"});var W=new WeakMap;class ${async getCredentials(L){const O=new URL(L.url),T=_class_private_field_get(this,W).find(S=>S.isUrlSupported(O));if(!T)throw new Error(`No auth provider available for '${L.url}', see https://backstage.io/link?scm-auth`);return T.getCredentials(L)}constructor(L){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_set(this,W,L)}}var g=new WeakMap,b=new WeakMap,l=new WeakMap,P=new WeakMap;class ne{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:L,gitlab:O,azure:T,bitbucket:S})=>ne.merge(ne.forGithub(L),ne.forGitlab(O),ne.forAzure(T),ne.forBitbucket(S))})}static forAuthApi(L,O){return new ne("generic",L,O.host,O.scopeMapping)}static forGithub(L,O){var T;const S=(T=O==null?void 0:O.host)!==null&&T!==void 0?T:"github.com";return new ne("github",L,S,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(L,O){var T;const S=(T=O==null?void 0:O.host)!==null&&T!==void 0?T:"gitlab.com";return new ne("gitlab",L,S,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(L,O){var T;const S=(T=O==null?void 0:O.host)!==null&&T!==void 0?T:"dev.azure.com";return new ne("azure",L,S,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(L,O){var T;const S=(T=O==null?void 0:O.host)!==null&&T!==void 0?T:"bitbucket.org";return new ne("bitbucket",L,S,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...L){return new $(L)}isUrlSupported(L){return L.host===_class_private_field_get(this,b)}getAdditionalScopesForProvider(L){var O;if(!(L!=null&&L.customScopes)||_class_private_field_get(this,P)==="generic")return[];var T;return(T=(O=L.customScopes)===null||O===void 0?void 0:O[_class_private_field_get(this,P)])!==null&&T!==void 0?T:[]}async getCredentials(L){const{url:O,additionalScope:T,...S}=L,q=_class_private_field_get(this,l).default.slice();T!=null&&T.repoWrite&&q.push(..._class_private_field_get(this,l).repoWrite);const Te=this.getAdditionalScopesForProvider(T);Te.length&&q.push(...Te);const et=[...new Set(q)],Xe=await _class_private_field_get(this,g).getAccessToken(et,S);return{token:Xe,headers:{Authorization:`Bearer ${Xe}`}}}constructor(L,O,T,S){_class_private_field_init(this,g,{writable:!0,value:void 0}),_class_private_field_init(this,b,{writable:!0,value:void 0}),_class_private_field_init(this,l,{writable:!0,value:void 0}),_class_private_field_init(this,P,{writable:!0,value:void 0}),_class_private_field_set(this,g,O),_class_private_field_set(this,b,T),_class_private_field_set(this,l,S),_class_private_field_set(this,P,L)}}var Q=t(79158);class X{static fromConfig(L){return Q.Lx.fromConfig(L)}}const M=(0,h.T0)({id:"integration.scmintegrations"});var z=t(52322),_=t(73250),ae=t(2784);const le=A=>{const{type:L}=A,O=(0,h.qD)(),T=_.Z;var S;const q=L&&(S=O.getSystemIcon(L))!==null&&S!==void 0?S:T;return(0,z.jsx)(q,{})}},79158:function(It,ze,t){"use strict";t.d(ze,{Lx:function(){return Hn},BT:function(){return ct}});var h=t(82717),n=t.n(h),W=t(76635);function $(w){const d=new URL("http://example.com");return d.host=w,d.host===w}function g(w){try{return new URL(w),!0}catch{return!1}}function b(w,d){return{list(){return w},byUrl(y){try{const j=typeof y=="string"?new URL(y):y;return w.find(Y=>d(Y)===j.host)}catch{return}},byHost(y){return w.find(j=>d(j)===y)}}}function l(w){const{url:d,base:y,lineNumber:j}=w;try{return new URL(d),d}catch{}let Y;if(d.startsWith("/")){const{filepath:ve}=n()(y);Y=new URL(y);const be=(0,W.trimEnd)(Y.pathname.substring(0,Y.pathname.length-ve.length),"/");Y.pathname=`${be}${d}`}else Y=new URL(d,y);return Y.search=new URL(y).search,j&&(Y.hash=`L${j}`),Y.toString()}const P="amazonaws.com";function ne(w){const d=w.getOptionalString("endpoint");var y;const j=(y=w.getOptionalBoolean("s3ForcePathStyle"))!==null&&y!==void 0?y:!1;let Y,ve;if(d){try{const nn=new URL(d);Y=nn.host,ve=nn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${d}' is not a valid URL`)}if(ve!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${d}'`)}else Y=P;const be=w.getOptionalString("accessKeyId"),Ne=w.getOptionalString("secretAccessKey"),dt=w.getOptionalString("roleArn"),Dt=w.getOptionalString("externalId");return{host:Y,endpoint:d,s3ForcePathStyle:j,accessKeyId:be,secretAccessKey:Ne,roleArn:dt,externalId:Dt}}function Q(w){const d=w.map(ne);return d.some(y=>y.host===P)||d.push({host:P}),d}class X{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return l(d)}resolveEditUrl(d){return d}constructor(d){this.integrationConfig=d}}X.factory=({config:w})=>{var d;const y=Q((d=w.getOptionalConfigArray("integrations.awsS3"))!==null&&d!==void 0?d:[]);return b(y.map(j=>new X(j)),j=>j.config.host)};var M=t(90383),z=t(22504),_=t(69866);const ae="GB";var le=new WeakMap,A=new WeakMap,L=new WeakMap,O=new WeakMap,T=new WeakMap,S=new WeakMap,q=new WeakMap;class Te{static fromRepoUrl(d){const y=new URL(d);let j,Y,ve;const be=y.pathname.split("/").map(Qn=>decodeURIComponent(Qn));if(be[2]==="_git"?(j=be[1],Y=ve=be[3]):be[3]==="_git"?(j=be[1],Y=be[2],ve=be[4]):be[4]==="_git"&&(j=`${be[1]}/${be[2]}`,Y=be[3],ve=be[5]),!j||!Y||!ve)throw new Error("Azure URL must point to a git repository");var Ne;const dt=(Ne=y.searchParams.get("path"))!==null&&Ne!==void 0?Ne:void 0;let Dt;const nn=y.searchParams.get("version");if(nn){if(nn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Dt=nn.slice(2)}return new Te(y.origin,j,Y,ve,dt,Dt)}toRepoUrl(){let d;return(0,M.Z)(this,L)===(0,M.Z)(this,O)?d=(0,M.Z)(this,q).call(this,(0,M.Z)(this,A),"_git",(0,M.Z)(this,O)):d=(0,M.Z)(this,q).call(this,(0,M.Z)(this,A),(0,M.Z)(this,L),"_git",(0,M.Z)(this,O)),(0,M.Z)(this,T)&&d.searchParams.set("path",(0,M.Z)(this,T)),(0,M.Z)(this,S)&&d.searchParams.set("version",ae+(0,M.Z)(this,S)),d.toString()}toFileUrl(){if(!(0,M.Z)(this,T))throw new Error("Azure URL must point to a specific path to be able to download a file");const d=(0,M.Z)(this,q).call(this,(0,M.Z)(this,A),(0,M.Z)(this,L),"_apis","git","repositories",(0,M.Z)(this,O),"items");return d.searchParams.set("api-version","6.0"),d.searchParams.set("path",(0,M.Z)(this,T)),(0,M.Z)(this,S)&&d.searchParams.set("version",(0,M.Z)(this,S)),d.toString()}toArchiveUrl(){const d=(0,M.Z)(this,q).call(this,(0,M.Z)(this,A),(0,M.Z)(this,L),"_apis","git","repositories",(0,M.Z)(this,O),"items");return d.searchParams.set("recursionLevel","full"),d.searchParams.set("download","true"),d.searchParams.set("api-version","6.0"),(0,M.Z)(this,T)&&d.searchParams.set("scopePath",(0,M.Z)(this,T)),(0,M.Z)(this,S)&&d.searchParams.set("version",(0,M.Z)(this,S)),d.toString()}toCommitsUrl(){const d=(0,M.Z)(this,q).call(this,(0,M.Z)(this,A),(0,M.Z)(this,L),"_apis","git","repositories",(0,M.Z)(this,O),"commits");return d.searchParams.set("api-version","6.0"),(0,M.Z)(this,S)&&d.searchParams.set("searchCriteria.itemVersion.version",(0,M.Z)(this,S)),d.toString()}getOwner(){return(0,M.Z)(this,A)}getProject(){return(0,M.Z)(this,L)}getRepo(){return(0,M.Z)(this,O)}getPath(){return(0,M.Z)(this,T)}getRef(){return(0,M.Z)(this,S)}constructor(d,y,j,Y,ve,be){(0,z.Z)(this,le,{writable:!0,value:void 0}),(0,z.Z)(this,A,{writable:!0,value:void 0}),(0,z.Z)(this,L,{writable:!0,value:void 0}),(0,z.Z)(this,O,{writable:!0,value:void 0}),(0,z.Z)(this,T,{writable:!0,value:void 0}),(0,z.Z)(this,S,{writable:!0,value:void 0}),(0,z.Z)(this,q,{writable:!0,value:(...Ne)=>{const dt=new URL((0,M.Z)(this,le));return dt.pathname=Ne.map(Dt=>encodeURIComponent(Dt)).join("/"),dt}}),(0,_.Z)(this,le,d),(0,_.Z)(this,A,y),(0,_.Z)(this,L,j),(0,_.Z)(this,O,Y),(0,_.Z)(this,T,ve),(0,_.Z)(this,S,be)}}const et="dev.azure.com";function Xe(w){var d;const y=(d=w.getOptionalString("host"))!==null&&d!==void 0?d:et,j=w.getOptionalString("token");if(!$(y))throw new Error(`Invalid Azure integration config, '${y}' is not a valid host`);return{host:y,token:j}}function Je(w){const d=w.map(Xe);return d.some(y=>y.host===et)||d.push({host:et}),d}class He{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const{url:y,base:j}=d;if(g(y))return y;try{const ve=Te.fromRepoUrl(j),be=new URL(j);var Y;const Ne=new URL(`https://a.com${(Y=ve.getPath())!==null&&Y!==void 0?Y:""}`),dt=new URL(y,Ne).pathname;return be.searchParams.set("path",dt),d.lineNumber&&(be.searchParams.set("line",String(d.lineNumber)),be.searchParams.set("lineEnd",String(d.lineNumber+1)),be.searchParams.set("lineStartColumn","1"),be.searchParams.set("lineEndColumn","1")),be.toString()}catch{return new URL(y,j).toString()}}resolveEditUrl(d){return d}constructor(d){this.integrationConfig=d}}He.factory=({config:w})=>{var d;const y=Je((d=w.getOptionalConfigArray("integrations.azure"))!==null&&d!==void 0?d:[]);return b(y.map(j=>new He(j)),j=>j.config.host)};var gt=t(48834).lW;function Ee(w){return AzureUrl.fromRepoUrl(w).toFileUrl()}function Ke(w){return AzureUrl.fromRepoUrl(w).toArchiveUrl()}function st(w){return AzureUrl.fromRepoUrl(w).toCommitsUrl()}function mt(w,d){const y=d?{...d}:{};if(w.token){const j=gt.from(`:${w.token}`,"utf8");y.Authorization=`Basic ${j.toString("base64")}`}return{headers:y}}const rt="bitbucket.org",ot="https://api.bitbucket.org/2.0";function ut(w){var d;const y=(d=w.getOptionalString("host"))!==null&&d!==void 0?d:rt;let j=w.getOptionalString("apiBaseUrl");const Y=w.getOptionalString("token"),ve=w.getOptionalString("username"),be=w.getOptionalString("appPassword");if(!$(y))throw new Error(`Invalid Bitbucket integration config, '${y}' is not a valid host`);return j?j=(0,W.trimEnd)(j,"/"):y===rt?j=ot:j=`https://${y}/rest/api/1.0`,{host:y,apiBaseUrl:j,token:Y,username:ve,appPassword:be}}function xt(w){const d=w.map(ut);return d.some(y=>y.host===rt)||d.push({host:rt,apiBaseUrl:ot}),d}class Rt{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const y=l(d);if(!d.lineNumber)return y;const j=new URL(y);return this.integrationConfig.host==="bitbucket.org"?j.hash=`lines-${d.lineNumber}`:j.hash=`${d.lineNumber}`,j.toString()}resolveEditUrl(d){const y=n()(d),j=new URL(d);return j.searchParams.set("mode","edit"),j.searchParams.set("spa","0"),j.searchParams.set("at",y.ref),j.toString()}constructor(d){this.integrationConfig=d}}Rt.factory=({config:w})=>{var d,y,j;const Y=xt((j=w.getOptionalConfigArray("integrations.bitbucket"))!==null&&j!==void 0?j:[...(d=w.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&d!==void 0?d:[],...(y=w.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&y!==void 0?y:[]]);return b(Y.map(ve=>new Rt(ve)),ve=>ve.config.host)};var We=t(96279),se=t(48834).lW;async function Ie(w,d){const{name:y,owner:j,resource:Y}=parseGitUrl(w),ve=Y==="bitbucket.org";let be=ve?`${d.apiBaseUrl}/repositories/${j}/${y}`:`${d.apiBaseUrl}/projects/${j}/repos/${y}/default-branch`,Ne=await fetch(be,vt(d));if(Ne.status===404&&!ve&&(be=`${d.apiBaseUrl}/projects/${j}/repos/${y}/branches/default`,Ne=await fetch(be,vt(d))),!Ne.ok){const Dt=`Failed to retrieve default branch from ${be}, ${Ne.status} ${Ne.statusText}`;throw new Error(Dt)}let dt;if(ve)dt=(await Ne.json()).mainbranch.name;else{const{displayId:Dt}=await Ne.json();dt=Dt}if(!dt)throw new Error(`Failed to read default branch from ${be}. Response ${Ne.status} ${Ne.json()}`);return dt}async function Re(w,d){const{name:y,owner:j,ref:Y,protocol:ve,resource:be,filepath:Ne}=parseGitUrl(w),dt=be==="bitbucket.org";let Dt=Y;Dt||(Dt=await Ie(w,d));const nn=Ne?`&path=${encodeURIComponent(decodeURIComponent(Ne))}`:"";return dt?`${ve}://${be}/${j}/${y}/get/${Dt}.tar.gz`:`${d.apiBaseUrl}/projects/${j}/repos/${y}/archive?format=tgz&at=${Dt}&prefix=${j}-${y}${nn}`}function tt(w,d){try{const{owner:y,name:j,ref:Y,filepathtype:ve,filepath:be}=parseGitUrl(w);if(!y||!j||ve!=="browse"&&ve!=="raw"&&ve!=="src")throw new Error("Invalid Bitbucket URL or file path");const Ne=be.replace(/^\//,"");if(d.host==="bitbucket.org"){if(!Y)throw new Error("Invalid Bitbucket URL or file path");return`${d.apiBaseUrl}/repositories/${y}/${j}/src/${Y}/${Ne}`}return`${d.apiBaseUrl}/projects/${y}/repos/${j}/raw/${Ne}?at=${Y}`}catch(y){throw new Error(`Incorrect URL: ${w}, ${y}`)}}function vt(w){const d={};if(w.token)d.Authorization=`Bearer ${w.token}`;else if(w.username&&w.appPassword){const y=se.from(`${w.username}:${w.appPassword}`,"utf8");d.Authorization=`Basic ${y.toString("base64")}`}return{headers:d}}const $t="bitbucket.org",pt="https://api.bitbucket.org/2.0";function Et(w){const d=$t,y=pt,j=w.getString("username"),Y=w.getString("appPassword");return{host:d,apiBaseUrl:y,username:j,appPassword:Y}}function At(w){const d=w.map(Et);return d.length===0&&d.push({host:$t,apiBaseUrl:pt}),d}class kt{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const y=l(d);if(d.lineNumber){const j=new URL(y);return j.hash=`lines-${d.lineNumber}`,j.toString()}return y}resolveEditUrl(d){const y=n()(d),j=new URL(d);return j.searchParams.set("mode","edit"),j.searchParams.set("at",y.ref),j.toString()}constructor(d){this.integrationConfig=d}}kt.factory=({config:w})=>{var d;const y=At((d=w.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&d!==void 0?d:[]);return b(y.map(j=>new kt(j)),j=>j.config.host)};var Xt=t(48834).lW;async function Wt(w,d){const{name:y,owner:j}=parseGitUrl(w),Y=`${d.apiBaseUrl}/repositories/${j}/${y}`,ve=await fetch(Y,cn(d));if(!ve.ok){const dt=`Failed to retrieve default branch from ${Y}, ${ve.status} ${ve.statusText}`;throw new Error(dt)}const Ne=(await ve.json()).mainbranch.name;if(!Ne)throw new Error(`Failed to read default branch from ${Y}. Response ${ve.status} ${ve.json()}`);return Ne}async function Vt(w,d){const{name:y,owner:j,ref:Y,protocol:ve,resource:be}=parseGitUrl(w);let Ne=Y;return Ne||(Ne=await Wt(w,d)),`${ve}://${be}/${j}/${y}/get/${Ne}.tar.gz`}function Yt(w,d){try{const{owner:y,name:j,ref:Y,filepathtype:ve,filepath:be}=parseGitUrl(w);if(!y||!j||ve!=="src"&&ve!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Ne=be.replace(/^\//,"");if(!Y)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${d.apiBaseUrl}/repositories/${y}/${j}/src/${Y}/${Ne}`}catch(y){throw new Error(`Incorrect URL: ${w}, ${y}`)}}function cn(w){const d={};if(w.username&&w.appPassword){const y=Xt.from(`${w.username}:${w.appPassword}`,"utf8");d.Authorization=`Basic ${y.toString("base64")}`}return{headers:d}}function on(w){const d=w.getString("host");let y=w.getOptionalString("apiBaseUrl");const j=w.getOptionalString("token"),Y=w.getOptionalString("username"),ve=w.getOptionalString("password");if(!$(d))throw new Error(`Invalid Bitbucket Server integration config, '${d}' is not a valid host`);return y?y=(0,W.trimEnd)(y,"/"):y=`https://${d}/rest/api/1.0`,{host:d,apiBaseUrl:y,token:j,username:Y,password:ve}}function Zn(w){return w.map(on)}class bn{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const y=l(d);if(d.lineNumber){const j=new URL(y);return j.hash=d.lineNumber.toString(),j.toString()}return y}resolveEditUrl(d){return d.includes("?")?d.substring(0,d.indexOf("?")):d}constructor(d){this.integrationConfig=d}}bn.factory=({config:w})=>{var d;const y=Zn((d=w.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&d!==void 0?d:[]);return b(y.map(j=>new bn(j)),j=>j.config.host)};var Dn=t(48834).lW;async function pn(w,d){const{name:y,owner:j}=parseGitUrl(w);let Y=`${d.apiBaseUrl}/projects/${j}/repos/${y}/default-branch`,ve=await fetch(Y,Nn(d));if(ve.status===404&&(Y=`${d.apiBaseUrl}/projects/${j}/repos/${y}/branches/default`,ve=await fetch(Y,Nn(d))),!ve.ok){const dt=`Failed to retrieve default branch from ${Y}, ${ve.status} ${ve.statusText}`;throw new Error(dt)}const{displayId:be}=await ve.json(),Ne=be;if(!Ne)throw new Error(`Failed to read default branch from ${Y}. Response ${ve.status} ${ve.json()}`);return Ne}async function dn(w,d){const{name:y,owner:j,ref:Y,filepath:ve}=parseGitUrl(w);let be=Y;be||(be=await pn(w,d));const Ne=ve?`&path=${encodeURIComponent(decodeURIComponent(ve))}`:"";return`${d.apiBaseUrl}/projects/${j}/repos/${y}/archive?format=tgz&at=${be}&prefix=${j}-${y}${Ne}`}function Jt(w,d){try{const{owner:y,name:j,ref:Y,filepathtype:ve,filepath:be}=parseGitUrl(w);if(!y||!j||ve!=="browse"&&ve!=="raw"&&ve!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Ne=be.replace(/^\//,"");return`${d.apiBaseUrl}/projects/${y}/repos/${j}/raw/${Ne}?at=${Y}`}catch(y){throw new Error(`Incorrect URL: ${w}, ${y}`)}}function Nn(w){const d={};if(w.token)d.Authorization=`Bearer ${w.token}`;else if(w.username&&w.password){const y=Dn.from(`${w.username}:${w.password}`,"utf8");d.Authorization=`Basic ${y.toString("base64")}`}return{headers:d}}function Fn(w){const d=w.getString("host");let y=w.getOptionalString("baseUrl"),j=w.getOptionalString("cloneUrl"),Y=w.getOptionalString("gitilesBaseUrl");const ve=w.getOptionalString("username"),be=w.getOptionalString("password");if($(d)){if(y&&!g(y))throw new Error(`Invalid Gerrit integration config, '${y}' is not a valid baseUrl`);if(j&&!g(j))throw new Error(`Invalid Gerrit integration config, '${j}' is not a valid cloneUrl`);if(Y&&!g(Y))throw new Error(`Invalid Gerrit integration config, '${Y}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${d}' is not a valid host`);return y?y=(0,W.trimEnd)(y,"/"):y=`https://${d}`,Y?Y=(0,W.trimEnd)(Y,"/"):Y=`https://${d}`,j?j=(0,W.trimEnd)(j,"/"):j=y,{host:d,baseUrl:y,cloneUrl:j,gitilesBaseUrl:Y,username:ve,password:be}}function un(w){return w.map(Fn)}var fn=t(48834).lW;const gn=")]}'";function In(w,d){const j=d.replace(w.gitilesBaseUrl,"").split("/").filter(Dt=>!!Dt),Y=j.indexOf("+");if(Y<=0)throw new Error(`Unable to parse project from url: ${d}`);const ve=(0,W.trimStart)(j.slice(0,Y).join("/"),"/"),be=j.indexOf("heads");if(be<=0)throw new Error(`Unable to parse branch from url: ${d}`);const Ne=j[be+1],dt=j.slice(be+2).join("/");return{branch:Ne,filePath:dt===""?"/":dt,project:ve}}function Rn(w,d,y,j){return`${w.gitilesBaseUrl}/${d}/+/refs/heads/${y}/${(0,W.trimStart)(j,"/")}`}function mn(w){return w.password?"/a/":"/"}function ge(w,d){const{branch:y,project:j}=In(w,d);return`${w.baseUrl}${mn(w)}projects/${encodeURIComponent(j)}/branches/${y}`}function ee(w,d){const{project:y}=In(w,d);return`${w.cloneUrl}${mn(w)}${y}`}function Ae(w,d){const{branch:y,filePath:j,project:Y}=In(w,d);return`${w.baseUrl}${mn(w)}projects/${encodeURIComponent(Y)}/branches/${y}/files/${encodeURIComponent(j)}/content`}function Fe(w){return`${w.baseUrl}${mn(w)}projects/`}function qe(w){const d={};if(!w.password)return d;const y=fn.from(`${w.username}:${w.password}`,"utf8");return d.Authorization=`Basic ${y.toString("base64")}`,{headers:d}}async function bt(w){const d=await w.text();if(d.startsWith(gn))try{return JSON.parse(d.slice(gn.length))}catch(y){throw new Error(`Invalid response from Gerrit: ${d.slice(0,10)} - ${y}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${d.slice(0,10)}`)}class ie{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const{url:y,base:j,lineNumber:Y}=d;let ve;if(y.startsWith("/")){const{branch:be,project:Ne}=In(this.config,j);return Rn(this.config,Ne,be,y)}return y?ve=new URL(y,j):ve=new URL(j),Y&&(ve.hash=Y.toString()),ve.toString()}resolveEditUrl(d){return d}constructor(d){this.integrationConfig=d}}ie.factory=({config:w})=>{var d;const y=un((d=w.getOptionalConfigArray("integrations.gerrit"))!==null&&d!==void 0?d:[]);return b(y.map(j=>new ie(j)),j=>j.config.host)};function k(w){const d=w.getString("host");let y=w.getOptionalString("baseUrl");const j=w.getOptionalString("username"),Y=w.getOptionalString("password");if(!$(d))throw new Error(`Invalid Gitea integration config, '${d}' is not a valid host`);return y?y=(0,W.trimEnd)(y,"/"):y=`https://${d}`,{host:d,baseUrl:y,username:j,password:Y}}var ce=t(48834).lW;function Be(w,d){try{var y;const j=(y=w.baseUrl)!==null&&y!==void 0?y:`https://${w.host}`,[Y,ve,be,Ne,dt,Dt,...nn]=d.replace(j,"").split("/"),Qn=nn.join("/").replace(/^\//,"");return`${j}/${ve}/${be}/_edit/${Dt}/${Qn}`}catch(j){throw new Error(`Incorrect URL: ${d}, ${j}`)}}function D(w,d){try{var y;const j=(y=w.baseUrl)!==null&&y!==void 0?y:`https://${w.host}`,[Y,ve,be,Ne,dt,Dt,...nn]=d.replace(j,"").split("/"),Qn=nn.join("/").replace(/^\//,"");return`${j}/api/v1/repos/${ve}/${be}/contents/${Qn}?ref=${Dt}`}catch(j){throw new Error(`Incorrect URL: ${d}, ${j}`)}}function U(w){const d={},{username:y,password:j}=w;return j?(y?d.Authorization=`basic ${ce.from(`${y}:${j}`).toString("base64")}`:d.Authorization=`token ${j}`,{headers:d}):d}class de{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(d){return l(d)}resolveEditUrl(d){return Be(this.config,d)}constructor(d){this.config=d}}de.factory=({config:w})=>{var d;const j=((d=w.getOptionalConfigArray("integrations.gitea"))!==null&&d!==void 0?d:[]).map(Y=>k(Y));return b(j.map(Y=>new de(Y)),Y=>Y.config.host)};const fe="github.com",ye="https://api.github.com",Pe="https://raw.githubusercontent.com";function Le(w){var d,y;const j=(y=w.getOptionalString("host"))!==null&&y!==void 0?y:fe;let Y=w.getOptionalString("apiBaseUrl"),ve=w.getOptionalString("rawBaseUrl");const be=w.getOptionalString("token"),Ne=(d=w.getOptionalConfigArray("apps"))===null||d===void 0?void 0:d.map(dt=>({appId:dt.getNumber("appId"),clientId:dt.getString("clientId"),clientSecret:dt.getString("clientSecret"),webhookSecret:dt.getString("webhookSecret"),privateKey:dt.getString("privateKey"),allowedInstallationOwners:dt.getOptionalStringArray("allowedInstallationOwners")}));if(!$(j))throw new Error(`Invalid GitHub integration config, '${j}' is not a valid host`);return Y?Y=(0,W.trimEnd)(Y,"/"):j===fe&&(Y=ye),ve?ve=(0,W.trimEnd)(ve,"/"):j===fe&&(ve=Pe),{host:j,apiBaseUrl:Y,rawBaseUrl:ve,token:be,apps:Ne}}function Me(w){const d=w.map(Le);return d.some(y=>y.host===fe)||d.push({host:fe,apiBaseUrl:ye,rawBaseUrl:Pe}),d}function nt(w,d,y){try{const{owner:j,name:Y,ref:ve,filepathtype:be,filepath:Ne}=parseGitUrl(w);if(!j||!Y||!ve||be!=="blob"&&be!=="raw"&&be!=="tree")throw new Error("Invalid GitHub URL or file path");const dt=Ne.replace(/^\//,"");return H(d,y)==="api"?`${d.apiBaseUrl}/repos/${j}/${Y}/contents/${dt}?ref=${ve}`:`${d.rawBaseUrl}/${j}/${Y}/${ve}/${dt}`}catch(j){throw new Error(`Incorrect URL: ${w}, ${j}`)}}function C(w,d){const y={};return H(w,d)==="api"&&(y.Accept="application/vnd.github.v3.raw"),d.token&&(y.Authorization=`token ${d.token}`),{headers:y}}function H(w,d){return w.apiBaseUrl&&(d.token||!w.rawBaseUrl)?"api":"raw"}var me=t(42822),ue=t(89393),Ce=t(26228);class ke{async getOrCreateToken(d,y,j){let Y=this.tokenCache.get(d);if((!Y||this.isExpired(Y.expiresAt))&&(Y=await j(),Y.expiresAt=Y.expiresAt.minus({minutes:10}),this.tokenCache.set(d,Y)),!this.appliesToRepo(Y,y))throw new Error(`The Backstage GitHub application used in the ${d} organization does not have access to a repository with the name ${y}`);return{accessToken:Y.token}}appliesToRepo(d,y){return y===void 0?!0:d.repositories!==void 0?d.repositories.includes(y):!0}constructor(){this.tokenCache=new Map,this.isExpired=d=>Ce.ou.local()>d}}const Ue={Accept:"application/vnd.github.machine-man-preview+json"};class lt{async getInstallationCredentials(d,y){if(this.allowedInstallationOwners){var j;if(!(!((j=this.allowedInstallationOwners)===null||j===void 0)&&j.includes(d)))return{accessToken:void 0}}return this.cache.getOrCreateToken(d,y,async()=>{const{installationId:Y,suspended:ve}=await this.getInstallationData(d);if(ve)throw new Error(`The GitHub application for ${d} is suspended`);const be=await this.appClient.apps.createInstallationAccessToken({installation_id:Y,headers:Ue});let Ne;if(be.data.repository_selection==="selected"){const Dt=new ue.v({baseUrl:this.baseUrl,auth:be.data.token}),nn=await Dt.paginate(Dt.apps.listReposAccessibleToInstallation);var dt;Ne=((dt=nn.repositories)!==null&&dt!==void 0?dt:nn).map($r=>$r.name)}return{token:be.data.token,expiresAt:Ce.ou.fromISO(be.data.expires_at),repositories:Ne}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(d){const j=(await this.getInstallations()).find(ve=>{var be,Ne;return((be=ve.account)===null||be===void 0||(Ne=be.login)===null||Ne===void 0?void 0:Ne.toLocaleLowerCase("en-US"))===d.toLocaleLowerCase("en-US")});if(j)return{installationId:j.id,suspended:Boolean(j.suspended_by)};const Y=new Error(`No app installation found for ${d} in ${this.baseAuthConfig.appId}`);throw Y.name="NotFoundError",Y}constructor(d,y){this.cache=new ke,this.allowedInstallationOwners=d.allowedInstallationOwners,this.baseUrl=y,this.baseAuthConfig={appId:d.appId,privateKey:d.privateKey.replace(/\\n/gm,`
33
- `)},this.appClient=new ue.v({baseUrl:y,headers:Ue,authStrategy:me.i,auth:this.baseAuthConfig})}}class St{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(y=>y.getInstallations()))).flat():[]}async getAppToken(d,y){if(this.apps.length===0)return;const j=await Promise.all(this.apps.map(Ne=>Ne.getInstallationCredentials(d,y).then(dt=>({credentials:dt,error:void 0}),dt=>({credentials:void 0,error:dt})))),Y=j.find(Ne=>Ne.credentials);if(Y)return Y.credentials.accessToken;const be=j.map(Ne=>Ne.error).find(Ne=>Ne.name!=="NotFoundError");if(be)throw be}constructor(d){var y,j;this.apps=(j=(y=d.apps)===null||y===void 0?void 0:y.map(Y=>new lt(Y,d.apiBaseUrl)))!==null&&j!==void 0?j:[]}}class Ye{async getCredentials(d){const y=n()(d.url),j=y.owner||y.name,Y=y.owner?y.name:void 0;let ve="app",be=await this.githubAppCredentialsMux.getAppToken(j,Y);return be||(ve="token",be=this.token),{headers:be?{Authorization:`Bearer ${be}`}:void 0,token:be,type:ve}}constructor(d,y){this.githubAppCredentialsMux=d,this.token=y}}Ye.create=w=>new Ye(new St(w),w.token);class ft{static fromIntegrations(d){const y=new Map;return d.github.list().forEach(j=>{const Y=SingleInstanceGithubCredentialsProvider.create(j.config);y.set(j.config.host,Y)}),new ft(y)}async getCredentials(d){const y=new URL(d.url),j=this.providers.get(y.host);if(!j)throw new Error(`There is no GitHub integration that matches ${d.url}. Please add a configuration for an integration.`);return j.getCredentials(d)}constructor(d){this.providers=d}}class yt{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return ct(l(d),"tree")}resolveEditUrl(d){return ct(d,"edit")}constructor(d){this.integrationConfig=d}}yt.factory=({config:w})=>{var d;const y=Me((d=w.getOptionalConfigArray("integrations.github"))!==null&&d!==void 0?d:[]);return b(y.map(j=>new yt(j)),j=>j.config.host)};function ct(w,d){return w.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(y,j,Y,ve)=>`//${j}/${Y}/${ve}/${d}/`)}const Tt=null;class Nt extends yt{get config(){return super.config}constructor(d){super(d)}}Nt.factory=yt.factory;const Ft=null,Un=null,Mn=null,Sn="gitlab.com",Ut="https://gitlab.com/api/v4";function Mt(w){const d=w.getString("host");let y=w.getOptionalString("apiBaseUrl");const j=w.getOptionalString("token");let Y=w.getOptionalString("baseUrl");if(y?y=(0,W.trimEnd)(y,"/"):d===Sn&&(y=Ut),Y?Y=(0,W.trimEnd)(Y,"/"):Y=`https://${d}`,$(d)){if(!y||!g(y))throw new Error(`Invalid GitLab integration config, '${y}' is not a valid apiBaseUrl`);if(!g(Y))throw new Error(`Invalid GitLab integration config, '${Y}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${d}' is not a valid host`);return{host:d,token:j,apiBaseUrl:y,baseUrl:Y}}function an(w){const d=w.map(Mt);return d.some(y=>y.host===Sn)||d.push({host:Sn,apiBaseUrl:Ut,baseUrl:`https://${Sn}`}),d}function Cn(w){let d="";return w.host!==Sn&&(d=new URL(w.baseUrl).pathname),trimEnd(d,"/")}async function Jn(w,d){const y=await zn(w,d);return Ln(w,y,d).toString()}function vn(w){const{token:d=""}=w;return{headers:{"PRIVATE-TOKEN":d}}}function Ln(w,d,y){try{const j=new URL(w),Y=j.pathname.split("/blob/").slice(1).join("/blob/"),[ve,...be]=Y.split("/"),Ne=getGitLabIntegrationRelativePath(y);return j.pathname=[...Ne?[Ne]:[],"api/v4/projects",d,"repository/files",encodeURIComponent(decodeURIComponent(be.join("/"))),"raw"].join("/"),j.search=`?ref=${ve}`,j}catch(j){throw new Error(`Incorrect url: ${w}, ${j}`)}}async function zn(w,d){const y=new URL(w);if(!y.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let j=y.pathname.split("/-/blob/")[0].split("/blob/")[0];const Y=getGitLabIntegrationRelativePath(d);Y&&(j=j.replace(Y,""));const ve=new URL(`${y.origin}${Y}/api/v4/projects/${encodeURIComponent(j.replace(/^\//,""))}`),be=await fetch(ve.toString(),vn(d)),Ne=await be.json();if(!be.ok)throw new Error(`GitLab Error '${Ne.error}', ${Ne.error_description}`);return Number(Ne.id)}catch(j){throw new Error(`Could not get GitLab project ID for: ${w}, ${j}`)}}class tn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return l(d)}resolveEditUrl(d){return yn(d,"edit")}constructor(d){this.integrationConfig=d}}tn.factory=({config:w})=>{var d;const y=an((d=w.getOptionalConfigArray("integrations.gitlab"))!==null&&d!==void 0?d:[]);return b(y.map(j=>new tn(j)),j=>j.config.host)};function yn(w,d){return w.replace(/\/\-\/(blob|tree|edit)\//,`/-/${d}/`)}class Hn{static fromConfig(d){return new Hn({awsS3:X.factory({config:d}),azure:He.factory({config:d}),bitbucket:Rt.factory({config:d}),bitbucketCloud:kt.factory({config:d}),bitbucketServer:bn.factory({config:d}),gerrit:ie.factory({config:d}),github:yt.factory({config:d}),gitlab:tn.factory({config:d}),gitea:de.factory({config:d})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(d=>d.list())}byUrl(d){let y=Object.values(this.byType).map(j=>j.byUrl(d)).filter(Boolean);if(y.length>1){const j=y.filter(Y=>!(Y instanceof Rt));j.length!==0&&(y=j)}return y[0]}byHost(d){return Object.values(this.byType).map(y=>y.byHost(d)).find(Boolean)}resolveUrl(d){const y=this.byUrl(d.base);return y?y.resolveUrl(d):l(d)}resolveEditUrl(d){const y=this.byUrl(d);return y?y.resolveEditUrl(d):d}constructor(d){this.byType=d}}},89925:function(It,ze,t){"use strict";var h={};t.r(h),t.d(h,{TechDocsPlugin:function(){return S.s4}});var n=t(52322),W=t(2784),$=t(28316),g=t(73557),b=t(25248);const l=(0,b.T0)({id:"plugin.techdocs.storageservice"}),P=(0,b.T0)({id:"plugin.techdocs.service"});var ne=t(92077),Q=t(95481),X=t(7476),M=t(93225),z=t(67896),_=t(65124),ae=t(17339),le=t(85478),A=t(68435),L=t(3482),O=t(42081),T=t(48431),S=t(89258),q=t(52943),Te=t(61886),et=t(13980),Xe=t.n(et);class Je{get(r){for(const o of this.holders){const c=o.get(r);if(c)return c}}constructor(...r){this.holders=r}}var He=t(51837);const gt=(0,He.CT)("api-context"),Ee=a=>{var r;const{apis:o,children:c}=a,f=(r=(0,W.useContext)(gt))===null||r===void 0?void 0:r.atVersion(1),I=f?new Je(o,f):o;return(0,n.jsx)(gt.Provider,{value:(0,He.EI)({1:I}),children:c})};Ee.propTypes={apis:Xe().shape({get:Xe().func.isRequired}).isRequired,children:Xe().node};class Ke{static validateFactories(r,o){for(const c of o){const f=[c],I=new Set;for(;f.length;){const N=f.shift(),V=r.get(N);if(!!V)for(const te of Object.values(V.deps)){if(te.id===c.id)throw new Error(`Circular dependency of api factory for ${c}`);I.has(te)||(I.add(te),f.push(te))}}}}get(r){return this.load(r)}load(r,o=[]){const c=this.apis.get(r.id);if(c)return c;const f=this.factories.get(r);if(!f)return;if(o.includes(f.api))throw new Error(`Circular dependency of api factory for ${f.api}`);const I=this.loadDeps(r,f.deps,[...o,f.api]),N=f.factory(I);return this.apis.set(r.id,N),N}loadDeps(r,o,c){const f={};for(const I in o)if(o.hasOwnProperty(I)){const N=o[I],V=this.load(N,c);if(!V)throw new Error(`No API factory available for dependency ${N} of dependent ${r}`);f[I]=V}return f}constructor(r){this.factories=r,this.apis=new Map}}var st;(function(a){a[a.default=10]="default",a[a.app=50]="app",a[a.static=100]="static"})(st||(st={}));class mt{register(r,o){const c=st[r],f=this.factories.get(o.api.id);return f&&f.priority>=c?!1:(this.factories.set(o.api.id,{priority:c,factory:o}),!0)}get(r){const o=this.factories.get(r.id);if(!!o)return o.factory}getAllApis(){const r=new Set;for(const{factory:o}of this.factories.values())r.add(o.api);return r}constructor(){this.factories=new Map}}function rt(a){return new Promise((r,o)=>{const c=a.width||500,f=a.height||700,I=window.screen.width/2-c/2,N=window.screen.height/2-f/2,V=window.open(a.url,a.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${c},height=${f},top=${N},left=${I}`);let te="";if(!V||typeof V.closed=="undefined"||V.closed){const at=new Error("Failed to open auth popup.");at.name="PopupRejectedError",o(at);return}const Ze=at=>{if(at.source!==V||at.origin!==a.origin)return;const{data:wt}=at;if(wt.type==="config_info"){te=wt.targetOrigin;return}if(wt.type!=="authorization_response")return;const jt=wt;if("error"in jt){const Ot=new Error(jt.error.message);Ot.name=jt.error.name,o(Ot)}else r(jt.response);ht()},Oe=setInterval(()=>{if(V.closed){const at=`Login failed, ${te&&te!==window.location.origin?`Incorrect app origin, expected ${te}`:"popup was closed"}`,wt=new Error(at);wt.name="PopupClosedError",o(wt),ht()}},100);function ht(){window.removeEventListener("message",Ze),clearInterval(Oe)}window.addEventListener("message",Ze)})}function ot(a){return[...a].join(" ")}class ut{async createSession(r){return r.instantPopup?this.showPopup(r.scopes):this.authRequester(r.scopes)}async refreshSession(){const r=await fetch(await this.buildUrl("/refresh",{optional:!0}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(c=>{throw new Error(`Auth refresh request failed, ${c}`)});if(!r.ok){const c=new Error(`Auth refresh request failed, ${r.statusText}`);throw c.status=r.status,c}const o=await r.json();if(o.error){const c=new Error(o.error.message);throw o.error.name&&(c.name=o.error.name),c}return await this.sessionTransform(o)}async removeSession(){const r=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(o=>{throw new Error(`Logout request failed, ${o}`)});if(!r.ok){const o=new Error(`Logout request failed, ${r.statusText}`);throw o.status=r.status,o}}async showPopup(r){const o=this.joinScopesFunc(r),c=await this.buildUrl("/start",{scope:o,origin:window.location.origin}),f=await rt({url:c,name:`${this.provider.title} Login`,origin:new URL(c).origin,width:450,height:730});return await this.sessionTransform(f)}async buildUrl(r,o){const c=await this.discoveryApi.getBaseUrl("auth"),f=this.buildQueryString({...o,env:this.environment});return`${c}/${this.provider.id}${r}${f}`}buildQueryString(r){if(!r)return"";const o=Object.entries(r).map(([c,f])=>{if(typeof f=="string")return`${encodeURIComponent(c)}=${encodeURIComponent(f)}`;if(f)return encodeURIComponent(c)}).filter(Boolean).join("&");return o?`?${o}`:""}constructor(r){const{discoveryApi:o,environment:c,provider:f,joinScopes:I=ot,oauthRequestApi:N,sessionTransform:V=te=>te}=r;this.authRequester=N.createAuthRequester({provider:f,onAuthRequest:te=>this.showPopup(te)}),this.discoveryApi=o,this.environment=c,this.provider=f,this.joinScopesFunc=I,this.sessionTransform=V}}function xt(a,r){for(const o of r)if(!a.has(o))return!1;return!0}class Rt{sessionExistsAndHasScope(r,o){if(!r)return!1;if(!o||this.options.sessionScopes===void 0)return!0;const c=this.options.sessionScopes(r);return xt(c,o)}getExtendedScope(r,o){const c=new Set(this.options.defaultScopes);if(r&&this.options.sessionScopes!==void 0){const f=this.options.sessionScopes(r);for(const I of f)c.add(I)}if(o)for(const f of o)c.add(f);return c}constructor(r){this.options=r}}var We=t(82394),se=t.n(We);let Ie=Symbol.observable;class Re{[Ie](){return this}get closed(){return this.isClosed}next(r){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(o=>o.next(r))}error(r){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=r,this.subscribers.forEach(o=>o.error(r))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(r=>r.complete())}subscribe(r,o,c){const f=typeof r=="function"?{next:r,error:o,complete:c}:r;return this.observable.subscribe(f)}constructor(){this.isClosed=!1,this.observable=new(se())(r=>this.isClosed?(this.terminatingError?r.error(this.terminatingError):r.complete(),()=>{}):(this.subscribers.add(r),()=>{this.subscribers.delete(r)})),this.subscribers=new Set}}let tt=Symbol.observable;class vt{[tt](){return this}get closed(){return this.isClosed}next(r){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=r,this.subscribers.forEach(o=>o.next(r))}error(r){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=r,this.subscribers.forEach(o=>o.error(r))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(r=>r.complete())}subscribe(r,o,c){const f=typeof r=="function"?{next:r,error:o,complete:c}:r;return this.observable.subscribe(f)}constructor(r){this.subscribers=new Set,this.isClosed=!1,this.currentValue=r,this.terminatingError=void 0,this.observable=new(se())(o=>this.isClosed?(this.terminatingError?o.error(this.terminatingError):o.complete(),()=>{}):(o.next(this.currentValue),this.subscribers.add(o),()=>{this.subscribers.delete(o)}))}}class $t{setIsSignedIn(r){this.signedIn!==r&&(this.signedIn=r,this.subject.next(this.signedIn?b.sM.SignedIn:b.sM.SignedOut))}sessionState$(){return this.subject}constructor(){this.subject=new vt(b.sM.SignedOut),this.signedIn=!1}}class pt{async getSession(r){if(this.helper.sessionExistsAndHasScope(this.currentSession,r.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const c=await this.collapsedSessionRefresh(),f=this.sessionScopesFunc(this.currentSession),I=this.sessionScopesFunc(c);return xt(I,f)&&(this.currentSession=c),c}catch(c){if(r.optional)return;throw c}}if(!this.currentSession&&!r.instantPopup)try{const o=await this.collapsedSessionRefresh();return this.currentSession=o,this.getSession(r)}catch{}if(!r.optional)return this.currentSession=await this.connector.createSession({...r,scopes:this.helper.getExtendedScope(this.currentSession,r.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession();try{const r=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),r}finally{delete this.refreshPromise}}constructor(r){this.stateTracker=new $t;const{connector:o,defaultScopes:c=new Set,sessionScopes:f,sessionShouldRefresh:I}=r;this.connector=o,this.sessionScopesFunc=f,this.sessionShouldRefreshFunc=I,this.helper=new Rt({sessionScopes:f,defaultScopes:c})}}class Et{setSession(r){this.currentSession=r,this.stateTracker.setIsSignedIn(Boolean(r))}async getSession(r){if(this.helper.sessionExistsAndHasScope(this.currentSession,r.scopes))return this.currentSession;if(!r.optional)return this.currentSession=await this.connector.createSession({...r,scopes:this.helper.getExtendedScope(this.currentSession,r.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(r){this.stateTracker=new SessionStateTracker;const{connector:o,defaultScopes:c=new Set,sessionScopes:f}=r;this.connector=o,this.helper=new SessionScopeHelper({sessionScopes:f,defaultScopes:c})}}const At={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class kt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=At,oauthRequestApi:I,defaultScopes:N=[],scopeTransform:V=Oe=>Oe}=r,te=new ut({discoveryApi:o,environment:c,provider:f,oauthRequestApi:I,sessionTransform(Oe){return{...Oe,providerInfo:{idToken:Oe.providerInfo.idToken,accessToken:Oe.providerInfo.accessToken,scopes:kt.normalizeScopes(V,Oe.providerInfo.scope),expiresAt:new Date(Date.now()+Oe.providerInfo.expiresInSeconds*1e3)}}}}),Ze=new pt({connector:te,defaultScopes:new Set(N),sessionScopes:Oe=>Oe.providerInfo.scopes,sessionShouldRefresh:Oe=>(Oe.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new kt({sessionManager:Ze,scopeTransform:V})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(r,o){const c=kt.normalizeScopes(this.scopeTransform,r),f=await this.sessionManager.getSession({...o,scopes:c});var I;return(I=f==null?void 0:f.providerInfo.accessToken)!==null&&I!==void 0?I:""}async getIdToken(r={}){const o=await this.sessionManager.getSession(r);var c;return(c=o==null?void 0:o.providerInfo.idToken)!==null&&c!==void 0?c:""}async getBackstageIdentity(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.backstageIdentity}async getProfile(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.profile}static normalizeScopes(r,o){if(!o)return new Set;const c=Array.isArray(o)?o:o.split(/[\s|,]/).filter(Boolean);return new Set(r(c))}constructor(r){this.sessionManager=r.sessionManager,this.scopeTransform=r.scopeTransform}}const Xt={id:"github",title:"GitHub",icon:()=>null};class Wt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Xt,oauthRequestApi:I,defaultScopes:N=["read:user"]}=r;return kt.create({discoveryApi:o,oauthRequestApi:I,provider:f,environment:c,defaultScopes:N})}}const Vt={id:"gitlab",title:"GitLab",icon:()=>null};class Yt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Vt,oauthRequestApi:I,defaultScopes:N=["read_user"]}=r;return kt.create({discoveryApi:o,oauthRequestApi:I,provider:f,environment:c,defaultScopes:N})}}const cn={id:"google",title:"Google",icon:()=>null},on="https://www.googleapis.com/auth/";class Zn{static create(r){const{discoveryApi:o,oauthRequestApi:c,environment:f="development",provider:I=cn,defaultScopes:N=["openid",`${on}userinfo.email`,`${on}userinfo.profile`]}=r;return kt.create({discoveryApi:o,oauthRequestApi:c,provider:I,environment:f,defaultScopes:N,scopeTransform(V){return V.map(te=>te==="openid"?te:te==="profile"||te==="email"?`${on}userinfo.${te}`:te.startsWith(on)?te:`${on}${te}`)}})}}const bn={id:"okta",title:"Okta",icon:()=>null},Dn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),pn="okta.";class dn{static create(r){const{discoveryApi:o,environment:c="development",provider:f=bn,oauthRequestApi:I,defaultScopes:N=["openid","email","profile","offline_access"]}=r;return kt.create({discoveryApi:o,oauthRequestApi:I,provider:f,environment:c,defaultScopes:N,scopeTransform(V){return V.map(te=>Dn.has(te)||te.startsWith(pn)?te:`${pn}${te}`)}})}}var Jt=t(30195);const Nn=Jt.z.object({profile:Jt.z.object({email:Jt.z.string().optional(),displayName:Jt.z.string().optional(),picture:Jt.z.string().optional()}),backstageIdentity:Jt.z.object({token:Jt.z.string(),identity:Jt.z.object({type:Jt.z.literal("user"),userEntityRef:Jt.z.string(),ownershipEntityRefs:Jt.z.array(Jt.z.string())})})}),Fn={id:"saml",title:"SAML",icon:()=>null};class un{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Fn}=r,I=new DirectAuthConnector({discoveryApi:o,environment:c,provider:f}),N=new StaticAuthSessionManager({connector:I}),V=new AuthSessionStore({manager:N,storageKey:`${f.id}Session`,schema:samlSessionSchema});return new un(V)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.backstageIdentity}async getProfile(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.profile}constructor(r){this.sessionManager=r}}const fn={id:"microsoft",title:"Microsoft",icon:()=>null};class gn{static create(r){const{environment:o="development",provider:c=fn,oauthRequestApi:f,discoveryApi:I,defaultScopes:N=["openid","offline_access","profile","email","User.Read"]}=r;return kt.create({discoveryApi:I,oauthRequestApi:f,provider:c,environment:o,defaultScopes:N})}}const In={id:"onelogin",title:"onelogin",icon:()=>null},Rn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),mn="onelogin.";class ge{static create(r){const{discoveryApi:o,environment:c="development",provider:f=In,oauthRequestApi:I}=r;return kt.create({discoveryApi:o,oauthRequestApi:I,provider:f,environment:c,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(N){return N.map(V=>Rn.has(V)||V.startsWith(mn)?V:`${mn}${V}`)}})}}const ee={id:"bitbucket",title:"Bitbucket",icon:()=>null};class Ae{static create(r){const{discoveryApi:o,environment:c="development",provider:f=ee,oauthRequestApi:I,defaultScopes:N=["team"]}=r;return kt.create({discoveryApi:o,oauthRequestApi:I,provider:f,environment:c,defaultScopes:N})}}const Fe={id:"atlassian",title:"Atlassian",icon:()=>null};class qe{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Fe,oauthRequestApi:I}=r;return kt.create({discoveryApi:o,oauthRequestApi:I,provider:f,environment:c})}}class bt{post(r){this.subject.next(r)}alert$(){return this.subject}constructor(){this.subject=new Re}}class ie{captureEvent(r){}}const k="theme";class ce{static createWithStorage(r){const o=new ce(r);if(!window.localStorage)return o;var c;const f=(c=window.localStorage.getItem(k))!==null&&c!==void 0?c:void 0;return o.setActiveThemeId(f),o.activeThemeId$().subscribe(I=>{I?window.localStorage.setItem(k,I):window.localStorage.removeItem(k)}),window.addEventListener("storage",I=>{if(I.key===k){var N;const V=(N=localStorage.getItem(k))!==null&&N!==void 0?N:void 0;o.setActiveThemeId(V)}}),o}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(r){this.activeThemeId=r,this.subject.next(r)}constructor(r){this.themes=r,this.subject=new vt(void 0)}}var Be=t(9850),D=t.n(Be),U=t(12782),de=t.n(U);const fe=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function ye(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function Pe(a){if(a===null)return"null";if(Array.isArray(a))return"array";const r=typeof a;return r==="number"&&isNaN(a)?"nan":r==="string"&&a===""?"empty-string":r}const Le={type(a,r,o,c){return`Invalid type in config for key '${a}' in '${r}', got ${o}, wanted ${c}`},missing(a){return`Missing required config value at '${a}'`},convert(a,r,o){return`Unable to convert config value for key '${a}' in '${r}' to a ${o}`}};class Me{static fromConfigs(r){return r.length===0?new Me(void 0):r.reduce((o,{data:c,context:f,filteredKeys:I,deprecatedKeys:N})=>{const V=new Me(c,f,o);if(V.filteredKeys=I,N)for(const{key:te,description:Ze}of N)console.warn(`The configuration key '${te}' of ${f} is deprecated and may be removed soon. ${Ze||""}`);return V},void 0)}has(r){var o;if(this.readValue(r)!==void 0)return!0;var f;return(f=(o=this.fallback)===null||o===void 0?void 0:o.has(r))!==null&&f!==void 0?f:!1}keys(){var r;const o=this.data?Object.keys(this.data):[];var c;const f=(c=(r=this.fallback)===null||r===void 0?void 0:r.keys())!==null&&c!==void 0?c:[];return[...new Set([...o,...f])]}get(r){const o=this.getOptional(r);if(o===void 0)throw new Error(Le.missing(this.fullKey(r!=null?r:"")));return o}getOptional(r){var o;const c=D()(this.readValue(r)),f=(o=this.fallback)===null||o===void 0?void 0:o.getOptional(r);if(c===void 0){if(!1)var I;return f}else if(f===void 0)return c;return de()({},{value:f},{value:c},(N,V)=>!ye(V)||!ye(N)?V:void 0).value}getConfig(r){const o=this.getOptionalConfig(r);if(o===void 0)throw new Error(Le.missing(this.fullKey(r)));return o}getOptionalConfig(r){var o;const c=this.readValue(r),f=(o=this.fallback)===null||o===void 0?void 0:o.getOptionalConfig(r);if(ye(c))return this.copy(c,r,f);if(c!==void 0)throw new TypeError(Le.type(this.fullKey(r),this.context,Pe(c),"object"));return f}getConfigArray(r){const o=this.getOptionalConfigArray(r);if(o===void 0)throw new Error(Le.missing(this.fullKey(r)));return o}getOptionalConfigArray(r){const o=this.readConfigValue(r,f=>{if(!Array.isArray(f))return{expected:"object-array"};for(const[I,N]of f.entries())if(!ye(N))return{expected:"object-array",value:N,key:`${r}[${I}]`};return!0});if(!o){if(!1)var c;return}return o.map((f,I)=>this.copy(f,`${r}[${I}]`))}getNumber(r){const o=this.getOptionalNumber(r);if(o===void 0)throw new Error(Le.missing(this.fullKey(r)));return o}getOptionalNumber(r){const o=this.readConfigValue(r,f=>typeof f=="number"||typeof f=="string"||{expected:"number"});if(typeof o=="number"||o===void 0)return o;const c=Number(o);if(!Number.isFinite(c))throw new Error(Le.convert(this.fullKey(r),this.context,"number"));return c}getBoolean(r){const o=this.getOptionalBoolean(r);if(o===void 0)throw new Error(Le.missing(this.fullKey(r)));return o}getOptionalBoolean(r){return this.readConfigValue(r,o=>typeof o=="boolean"||{expected:"boolean"})}getString(r){const o=this.getOptionalString(r);if(o===void 0)throw new Error(Le.missing(this.fullKey(r)));return o}getOptionalString(r){return this.readConfigValue(r,o=>typeof o=="string"&&o!==""||{expected:"string"})}getStringArray(r){const o=this.getOptionalStringArray(r);if(o===void 0)throw new Error(Le.missing(this.fullKey(r)));return o}getOptionalStringArray(r){return this.readConfigValue(r,o=>{if(!Array.isArray(o))return{expected:"string-array"};for(const[c,f]of o.entries())if(typeof f!="string"||f==="")return{expected:"string-array",value:f,key:`${r}[${c}]`};return!0})}fullKey(r){return`${this.prefix}${this.prefix?".":""}${r}`}copy(r,o,c){const f=new Me(r,this.context,c,this.fullKey(o));return f.filteredKeys=this.filteredKeys,f}readConfigValue(r,o){const c=this.readValue(r);if(c===void 0){var f;if(!1)var I;return(f=this.fallback)===null||f===void 0?void 0:f.readConfigValue(r,o)}const N=o(c);if(N!==!0){const{key:V=r,value:te=c,expected:Ze}=N;throw new TypeError(Le.type(this.fullKey(V),this.context,Pe(te),Ze))}return c}readValue(r){const o=r?r.split("."):[];for(const f of o)if(!fe.test(f))throw new TypeError(`Invalid config key '${r}'`);if(this.data===void 0)return;let c=this.data;for(const[f,I]of o.entries())if(ye(c))c=c[I];else if(c!==void 0){const N=this.fullKey(o.slice(0,f).join("."));throw new TypeError(Le.type(N,this.context,Pe(c),"object"))}return c}constructor(r,o="mock-config",c,f=""){this.data=r,this.context=o,this.fallback=c,this.prefix=f,this.notifiedFilteredKeys=new Set}}const nt="Invalid discovery URL pattern,";class C{static compile(r){const o=r.split(/\{\{\s*pluginId\s*\}\}/),c=o.join("pluginId");let f;try{f=new URL(c)}catch{throw new Error(`${nt} URL '${c}' is invalid`)}if(f.hash)throw new Error(`${nt} URL must not have a hash`);if(f.search)throw new Error(`${nt} URL must not have a query`);if(c.endsWith("/"))throw new Error(`${nt} URL must not end with a slash`);return new C(o)}async getBaseUrl(r){return this.parts.join(r)}constructor(r){this.parts=r}}class H{post(r,o){return o!=null&&o.hidden||this.alertApi.post({message:r.message,severity:"error"}),this.errorApi.post(r,o)}error$(){return this.errorApi.error$()}constructor(r,o){this.alertApi=r,this.errorApi=o}}class me{post(r,o){this.subject.next({error:r,context:o})}error$(){return this.subject}constructor(){this.subject=new Re}}class ue{static forward(r,o){window.addEventListener("unhandledrejection",c=>{r.post(c.reason,o)})}}function Ce(a){if(a.length<3)throw new Error(`The '${a}' feature flag must have a minimum length of three characters.`);if(a.length>150)throw new Error(`The '${a}' feature flag must not exceed 150 characters.`);if(!a.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${a}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class ke{registerFlag(r){Ce(r.name),this.registeredFeatureFlags.push(r)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(r){return this.flags||(this.flags=this.load()),this.flags.get(r)===b.CL.Active}save(r){this.flags||(this.flags=this.load()),r.merge||this.flags.clear();for(const[c,f]of Object.entries(r.states))this.flags.set(c,f);const o=Array.from(this.flags.entries()).filter(([,c])=>c===b.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(o)))}load(){try{const r=window.localStorage.getItem("featureFlags");if(!r)return new Map;const o=JSON.parse(r);if(typeof o!="object"||o===null||Array.isArray(o))return new Map;const c=Object.entries(o).filter(([f,I])=>(Ce(f),I===b.CL.Active));return new Map(c)}catch{return new Map}}constructor(){this.registeredFeatureFlags=[]}}function Ue(a){let r=a.baseImplementation||t.g.fetch;var o;const c=[(o=a.middleware)!==null&&o!==void 0?o:[]].flat().reverse();for(const f of c)r=f.apply(r);return{fetch:r}}class lt{static create(r){var o,c;const f=St(r),I=((o=r.header)===null||o===void 0?void 0:o.name)||"authorization",N=((c=r.header)===null||c===void 0?void 0:c.value)||(V=>`Bearer ${V}`);return new lt(r.identityApi,f,I,N)}apply(r){return async(o,c)=>{const f=new Request(o,c),{token:I}=await this.identityApi.getCredentials();return f.headers.get(this.headerName)||typeof I!="string"||!I||!this.allowUrl(f.url)?r(o,c):(f.headers.set(this.headerName,this.headerValue(I)),r(f))}}constructor(r,o,c,f){this.identityApi=r,this.allowUrl=o,this.headerName=c,this.headerValue=f}}function St(a){return a.allowUrl?a.allowUrl:a.urlPrefixAllowlist?Ye(a.urlPrefixAllowlist):a.config?Ye([a.config.getString("backend.baseUrl")]):()=>!1}function Ye(a){const r=a.map(o=>o.replace(/\/$/,""));return o=>r.some(c=>o===c||o.startsWith(`${c}/`))}function ft(a,r){return!r||r==="/"?a:`${a.replace(/\/$/,"")}/${r.replace(/^\//,"")}`}class yt{apply(r){return async(o,c)=>{const f=new Request(o,c),I="plugin://";if(!f.url.startsWith(I))return r(o,c);const{hostname:N,pathname:V,search:te,hash:Ze,username:Oe,password:ht}=new URL(`http://${f.url.substring(I.length)}`);let at=await this.discoveryApi.getBaseUrl(N);if(Oe||ht){const jt=new URL(at),Ot=`${Oe}${ht?`:${ht}`:""}@`;at=`${jt.protocol}//${Ot}${jt.host}${jt.pathname}`}const wt=`${ft(at,V)}${te}${Ze}`;return r(wt,typeof o=="string"||ct(o)?c:o)}}constructor(r){this.discoveryApi=r}}function ct(a){return typeof a=="object"&&(a==null?void 0:a.constructor)===URL}class Tt{static resolvePluginProtocol(r){return new yt(r.discoveryApi)}static injectIdentityAuth(r){return lt.create(r)}constructor(){}}function Nt(a,r){for(const o of r)if(!a.has(o))return!1;return!0}function Ft(a,...r){const o=new Set(a);for(const c of r)for(const f of c)o.add(f);return o}class Un{request(r){return new Promise((o,c)=>{this.requests.push({scopes:r,resolve:o,reject:c}),this.subject.next(this.getCurrentPending())})}resolve(r,o){this.requests=this.requests.filter(c=>Nt(r,c.scopes)?(c.resolve(o),!1):!0),this.subject.next(this.getCurrentPending())}reject(r){this.requests.forEach(o=>o.reject(r)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const r=this.requests.length===0?void 0:this.requests.slice(1).reduce((o,c)=>Ft(o,c.scopes),this.requests[0].scopes);return{scopes:r,resolve:o=>{r&&this.resolve(r,o)},reject:o=>{r&&this.reject(o)}}}constructor(){this.requests=[],this.subject=new vt(this.getCurrentPending())}}class Mn{createAuthRequester(r){const o=new Un,c=this.handlerCount;return this.handlerCount++,o.pending().subscribe({next:f=>{const I=this.currentRequests.slice(),N=this.makeAuthRequest(f,r);N?I[c]=N:delete I[c],this.currentRequests=I,this.subject.next(I.filter(Boolean))}}),f=>o.request(f)}makeAuthRequest(r,o){const{scopes:c}=r;if(!!c)return{provider:o.provider,trigger:async()=>{const f=await o.onAuthRequest(c);r.resolve(f)},reject:()=>{const f=new Error("Login failed, rejected by user");f.name="RejectedError",r.reject(f)}}}authRequest$(){return this.subject}constructor(){this.subject=new vt([]),this.currentRequests=[],this.handlerCount=0}}const Sn=new Map;class Ut{static create(r){var o;return new Ut((o=r.namespace)!==null&&o!==void 0?o:"",r.errorApi)}get(r){return this.snapshot(r).value}snapshot(r){let o,c="absent";try{const f=localStorage.getItem(this.getKeyName(r));f&&(o=JSON.parse(f,(I,N)=>(typeof N=="object"&&N!==null&&Object.freeze(N),N)),c="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${r}`))}return{key:r,value:o,presence:c}}forBucket(r){const o=`${this.namespace}/${r}`;return Sn.has(o)||Sn.set(o,new Ut(o,this.errorApi)),Sn.get(o)}async set(r,o){localStorage.setItem(this.getKeyName(r),JSON.stringify(o)),this.notifyChanges(r)}async remove(r){localStorage.removeItem(this.getKeyName(r)),this.notifyChanges(r)}observe$(r){return this.observable.filter(({key:o})=>o===r)}getKeyName(r){return`${this.namespace}/${encodeURIComponent(r)}`}notifyChanges(r){const o=this.snapshot(r);for(const c of this.subscribers)c.next(o)}constructor(r,o){this.namespace=r,this.errorApi=o,this.subscribers=new Set,this.observable=new(se())(c=>(this.subscribers.add(c),()=>{this.subscribers.delete(c)}))}}var Mt=t(64279);function an(a){const r={};for(const c in a.collectors)a.collectors.hasOwnProperty(c)&&(r[c]=a.collectors[c]());const o=[{node:W.Children.toArray(a.root),parent:void 0,contexts:{}}];for(;o.length!==0;){const{node:c,parent:f,contexts:I}=o.shift();W.Children.forEach(c,N=>{if(!(0,W.isValidElement)(N))return;const V={};for(const te in r)if(r.hasOwnProperty(te)){const Ze=r[te];V[te]=Ze.visit(Ze.accumulator,N,f,I[te])}for(const te of a.discoverers){const Ze=te(N);Ze&&o.push({node:Ze,parent:N,contexts:V})}})}return Object.fromEntries(Object.entries(r).map(([c,f])=>[c,f.accumulator]))}function Cn(a,r){return()=>({accumulator:a(),visit:r})}function Jn(a){var r;return(r=a.props)===null||r===void 0?void 0:r.children}function vn(a){var r,o;if(((r=a.props)===null||r===void 0?void 0:r.path)&&((o=a.props)===null||o===void 0?void 0:o.element)){var c;return(c=a.props)===null||c===void 0?void 0:c.element}}const Ln=Cn(()=>new Set,(a,r)=>{const o=(0,b.IY)(r,"core.plugin");o&&a.add(o)}),zn=a=>{const{children:r}=a,o=(0,b.h_)(b.W0),c="with"in a?o.isActive(a.with):!o.isActive(a.without);return(0,n.jsx)(n.Fragment,{children:c?r:null})};(0,b.R5)(zn,"core.featureFlagged",!0);const tn={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function yn(a){const r=a;if(r!=null&&r.type){var o,c;return(c=(o=r.type.displayName)!==null&&o!==void 0?o:r.type.name)!==null&&c!==void 0?c:String(r.type)}return String(r)}function Hn(a,r=new Array){return W.Children.forEach(a,o=>{if(!(0,W.isValidElement)(o))return;const c=(0,b.IY)(o,"core.mountPoint");if(c){const f=(0,b.IY)(o,"core.plugin");r.push({routeRef:c,plugin:f})}Hn(o.props.children,r)}),r}const w=Cn(()=>({paths:new Map,parents:new Map,objects:new Array}),(a,r,o,c)=>{var f,I;if(c!=null&&c.isElementAncestor)return c;if((o==null?void 0:o.props.element)===r)return{...c,isElementAncestor:!0};const N=(f=r.props)===null||f===void 0?void 0:f.path,V=(0,b.IY)(r,"core.mountPoint");if(V&&N)throw new Error(`Path property may not be set directly on a routable extension "${yn(r)}"`);var te;const Ze=(te=c==null||(I=c.obj)===null||I===void 0?void 0:I.children)!==null&&te!==void 0?te:a.objects;if(N!==void 0){if(typeof N!="string")throw new Error(`Element path must be a string at "${yn(r)}"`);const wt=N.startsWith("/")?N.slice(1):N,jt=r.props.element;if((0,b.IY)(r,"core.gatherMountPoints")){var Oe;if(jt)throw new Error(`Mount point gatherers may not have an element prop "${yn(r)}"`);const Ot={path:wt,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Oe=r.props)===null||Oe===void 0?void 0:Oe.caseSensitive),children:[tn],plugin:void 0};return Ze.push(Ot),{obj:Ot,gatherPath:wt,routeRef:c==null?void 0:c.routeRef,gatherRouteRef:c==null?void 0:c.routeRef}}if(jt){var ht;const[Ot,...Bt]=Hn(jt);if(Bt.length>0)throw new Error(`Route element with path "${N}" may not contain multiple routable extensions`);if(!Ot)return c;const{routeRef:Tn,plugin:ar}=Ot,er={path:wt,element:"mounted",routeRefs:new Set([Tn]),caseSensitive:Boolean((ht=r.props)===null||ht===void 0?void 0:ht.caseSensitive),children:[tn],plugin:ar};return Ze.push(er),a.paths.set(Tn,wt),a.parents.set(Tn,c==null?void 0:c.routeRef),{obj:er,routeRef:Tn!=null?Tn:c==null?void 0:c.routeRef,gatherPath:wt,gatherRouteRef:c==null?void 0:c.gatherRouteRef}}}if(V){var at;if((c==null?void 0:c.gatherPath)===void 0)throw new Error(`Routable extension "${yn(r)}" with mount point "${V}" must be assigned a path`);return c==null||(at=c.obj)===null||at===void 0||at.routeRefs.add(V),a.paths.set(V,c.gatherPath),a.parents.set(V,c==null?void 0:c.gatherRouteRef),{...c,routeRef:V}}return c}),d=Cn(()=>({paths:new Map,parents:new Map,objects:new Array}),(a,r,o,c)=>{var f,I,N;if((o==null?void 0:o.props.element)===r)return c;let V=c==null?void 0:c.obj,te=c==null?void 0:c.routeRef,Ze=c==null?void 0:c.sticky;const Oe=(f=r.props)===null||f===void 0?void 0:f.path;var ht;const at=(ht=V==null?void 0:V.children)!==null&&ht!==void 0?ht:a.objects,wt=Boolean((I=r.props)===null||I===void 0?void 0:I.caseSensitive);let jt=c==null?void 0:c.path;if((0,b.IY)(r,"core.gatherMountPoints")){if(!Oe)throw new Error("Mount point gatherer must have a path");jt=Oe}const Ot=(N=r.props)===null||N===void 0?void 0:N.element;let Bt=(0,b.IY)(r,"core.mountPoint");if(!Bt&&(0,W.isValidElement)(Ot)&&(Bt=(0,b.IY)(Ot,"core.mountPoint")),Bt){let er=Oe;if(jt&&(er?jt=void 0:er=jt),!er)throw new Error("Mounted routable extension must have a path");a.paths.set(Bt,er),te&&Ze?(a.parents.set(Bt,te),Oe&&(te=Bt,Ze=!1)):(a.parents.set(Bt,te),te=Bt),Oe?(V={caseSensitive:wt,path:Oe,element:"mounted",routeRefs:new Set([Bt]),children:[tn],plugin:(0,b.IY)(r.props.element,"core.plugin")},at.push(V)):V==null||V.routeRefs.add(Bt)}if((0,b.IY)(r,"core.gatherMountPoints")&&(Ze=!0),(0,b.IY)(r,"core.gatherMountPoints")){if(!Oe)throw new Error("Mount point gatherer must have a path");if(!Bt){var ar;V={caseSensitive:wt,path:Oe,element:"gathered",routeRefs:new Set,children:[tn],plugin:c==null||(ar=c.obj)===null||ar===void 0?void 0:ar.plugin},at.push(V)}}return{obj:V,path:jt,routeRef:te,sticky:Ze}}),y=Cn(()=>new Set,(a,r)=>{if(r.type===zn){const o=r.props;a.add("with"in o?o.with:o.without)}});var j=t(16060);const Y=(0,He.uW)("route-ref-type",()=>Symbol("route-ref-type"));function ve(a){return a[Y]==="absolute"}function be(a){return a[Y]==="sub"}function Ne(a){return a[Y]==="external"}function dt(...a){const r=a.join("/").replace(/\/\/+/g,"/");return r!=="/"&&r.endsWith("/")?r.slice(0,-1):r}function Dt(a,r,o){let c,f="";if(ve(a))c=a;else if(be(a))c=a.parent,f=a.path;else if(Ne(a)){const V=o.get(a);if(!V)return[void 0,""];if(ve(V))c=V;else if(be(V))c=V.parent,f=V.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${V}`)}else throw a[Y]?new Error(`Unknown or invalid route ref type, ${a[Y]}`):new Error(`Unknown object passed to useRouteRef, got ${a}`);if(!c)return[void 0,""];const I=r.get(c);if(I===void 0)return[void 0,""];const N=dt(I,f);return[c,N]}function nn(a,r,o,c,f){var I;const N=(I=(0,j.fp)(f,r))!==null&&I!==void 0?I:[],V=Array();let te=-1;for(let ht=a;ht&&(te=N.findIndex(at=>at.route.routeRefs.has(ht)),te===-1);ht=c.get(ht))V.unshift(ht);V.length===0&&(te-=1);const Ze=te===-1?"":N[te].pathname,Oe=V.slice(0,-1).map(ht=>{const at=o.get(ht);if(at===void 0)throw new Error(`No path for ${ht}`);if(at.includes(":"))throw new Error(`Cannot route to ${a} with parent ${ht} as it has parameters`);return at});return`${dt(Ze,...Oe)}/`}class Qn{resolve(r,o){const[c,f]=Dt(r,this.routePaths,this.routeBindings);if(!c)return;let I;typeof o=="string"?I=this.trimPath(o):o.pathname?I={...o,pathname:this.trimPath(o.pathname)}:I=o;const N=this.appBasePath+nn(c,I,this.routePaths,this.routeParents,this.routeObjects);return(...[te])=>dt(N,(0,j.Gn)(f,te))}trimPath(r){return r&&(r.startsWith(this.appBasePath)?r.slice(this.appBasePath.length):r)}constructor(r,o,c,f,I){this.routePaths=r,this.routeParents=o,this.routeObjects=c,this.routeBindings=f,this.appBasePath=I}}const $r=(0,He.CT)("routing-context"),nr=({routePaths:a,routeParents:r,routeObjects:o,routeBindings:c,basePath:f="",children:I})=>{const N=new Qn(a,r,o,c,f),V=(0,He.EI)({1:N});return(0,n.jsx)($r.Provider,{value:V,children:I})},Xn=(a,r)=>{try{var o,c;const f=(0,j.fp)(r,{pathname:a}),I=(o=f==null?void 0:f.filter(V=>{var te;return((te=V==null?void 0:V.route.routeRefs)===null||te===void 0?void 0:te.size)>0}).pop())===null||o===void 0?void 0:o.route;if(!I)return{};let N;return I.routeRefs.size===1&&(N=I.routeRefs.values().next().value),{extension:"App",pluginId:((c=I.plugin)===null||c===void 0?void 0:c.getId())||"root",...N?{routeRef:N.id}:{}}}catch{return{}}},pr=({pathname:a,search:r,hash:o})=>{const c=(0,b.z$)();return(0,W.useEffect)(()=>{c.captureEvent("navigate",`${a}${r}${o}`)},[c,a,r,o]),null},rr=({routeObjects:a})=>{const{pathname:r,search:o,hash:c}=(0,g.TH)();return(0,n.jsx)(b.fC,{attributes:Xn(r,a),children:(0,n.jsx)(pr,{pathname:r,search:o,hash:c})})};function Zr(a,r){const o=new Set(r.values());o.delete(void 0);for(const c of r.keys()){if(o.has(c))continue;let f=c,I="";for(;f;){const V=a.get(f);if(V===void 0)throw new Error(`No path for ${f}`);I=dt(V,I),f=r.get(f)}const N=I.match(/:(\w+)/g);if(N){for(let V=0;V<N.length;V++)for(let te=V+1;te<N.length;te++)if(N[te]===N[V])throw new Error(`Parameter ${N[te]} is duplicated in path ${I}`)}}}function ls(a,r){for(const o of r)if(!!o.externalRoutes){for(const[c,f]of Object.entries(o.externalRoutes))if(!f.optional&&!a.has(f))throw new Error(`External route '${c}' of the '${o.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const fr=(0,He.CT)("app-context"),cs=({appContext:a,children:r})=>{const o=(0,He.EI)({1:a});return(0,n.jsx)(fr.Provider,{value:o,children:r})};function Kr(a){return new Error(`Tried to access IdentityApi ${a} before app was loaded`)}function gr(a){console.warn(`WARNING: Call to ${a} is deprecated and will break in the future`)}class tr{setTarget(r,o){this.target=r,this.signOutTargetUrl=o.signOutTargetUrl,this.resolveTarget(r)}getUserId(){if(!this.target)throw Kr("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return gr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw Kr("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return gr("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(r=>r.getProfileInfo())}async getBackstageIdentity(){const r=await this.waitForTarget.then(o=>o.getBackstageIdentity());return r.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${r.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),r}async getCredentials(){return this.waitForTarget.then(r=>r.getCredentials())}async getIdToken(){return this.waitForTarget.then(r=>{if(!r.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return gr("getIdToken"),r.getIdToken()})}async signOut(){await this.waitForTarget.then(r=>r.signOut()),window.location.href=this.signOutTargetUrl}constructor(){this.resolveTarget=()=>{},this.signOutTargetUrl="/",this.waitForTarget=new Promise(r=>{this.resolveTarget=r})}}var jr=t(72164);function Dr(a,r,o){if(a!==void 0){const f=o.find(I=>I.id===a);if(f)return f}if(r){const f=o.find(I=>I.variant==="dark");if(f)return f}const c=o.find(f=>f.variant==="light");return c||o[0]}const ds=()=>{const a=(0,W.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[r,o]=(0,W.useState)(a.matches);return(0,W.useEffect)(()=>{const c=f=>{o(f.matches)};return a.addListener(c),()=>{a.removeListener(c)}},[a]),r};function Er({children:a}){const r=(0,b.h_)(b.hg),o=(0,jr.Z)(r.activeThemeId$(),r.getActiveThemeId()),c=Boolean(window.matchMedia)?ds():!1,f=Dr(o,c,r.getInstalledThemes());if(!f)throw new Error("App has no themes");return(0,n.jsx)(f.Provider,{children:a})}const Nr=async(a="__APP_INJECTED_RUNTIME_CONFIG__")=>{const r=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!r)throw new Error("No static configuration provided");if(!Array.isArray(r))throw new Error("Static configuration has invalid format");const o=r.slice();if(a!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const f=JSON.parse(a);Array.isArray(f)?o.push(...f):o.push({data:f,context:"env"})}catch(f){throw new Error(`Failed to load runtime configuration, ${f}`)}const c=window.__APP_CONFIG__;return c&&o.push({context:"window",data:c}),o};class Yr{add(r,o){return this.apis.push([r.id,o]),o}build(){return new Wn(new Map(this.apis))}constructor(){this.apis=[]}}class Wn{static builder(){return new Yr}static from(r){return new Wn(new Map(r.map(([o,c])=>[o.id,c])))}static with(r,o){return new Wn(new Map([[r.id,o]]))}with(r,o){return new Wn(new Map([...this.apis,[r.id,o]]))}get(r){return this.apis.get(r.id)}constructor(r){this.apis=r}}function Fr(a){const r=new Map;return a&&a({bind:(c,f)=>{for(const[I,N]of Object.entries(f)){const V=c[I];if(!V)throw new Error(`Key ${I} is not an existing external route`);if(!N&&!V.optional)throw new Error(`External route ${I} is required but was undefined`);N&&r.set(V,N)}}}),r}function Ar(){const[a]=(0,g.is)((0,n.jsx)(g.AW,{index:!0,element:(0,n.jsx)("div",{})}));return!a.index}const Jr=(0,W.createContext)({routeObjects:[]});function Ur(a){return Ar()?us(a):""}function us(a){var r;let{pathname:o}=new URL((r=a.getOptionalString("app.baseUrl"))!==null&&r!==void 0?r:"/","http://sample.dev");return o=o.replace(/\/*$/,""),o}function Zs(a,r,o){var c;const f=Boolean(a),I=(0,Mt.default)(a||(()=>Promise.resolve([])));let N;if(f&&I.loading){const{Progress:Ze}=r;N=(0,n.jsx)(Ze,{})}else if(I.error){const{BootErrorPage:Ze}=r;N=(0,n.jsx)(Ze,{step:"load-config",error:I.error})}const{ThemeProvider:V=Er}=r;if(N)return{node:(0,n.jsx)(Ee,{apis:Wn.with(b.hg,o),children:(0,n.jsx)(V,{children:N})})};let te;if(!((c=I.value)===null||c===void 0)&&c.length){const Ze=Me.fromConfigs(I.value),Oe=Bt=>new URL(Bt).origin,ht=Bt=>new URL(Bt.replace(Oe(Bt),""),document.location.origin).href,at=Ze.getOptionalString("app.baseUrl"),wt=Ze.getOptionalString("backend.baseUrl");let jt=I.value;const Ot={data:{},context:"relative-resolver"};if(at&&wt){const Bt=Oe(at),Tn=Oe(wt);Bt===Tn&&(Ot.data.backend={baseUrl:ht(wt)})}at&&(Ot.data.app={baseUrl:ht(at)}),Object.keys(Ot.data).length&&(jt=jt.concat([Ot])),te=Me.fromConfigs(jt)}else te=Me.fromConfigs([]);return{api:te}}class hs{getPlugins(){return this.app.getPlugins()}getSystemIcon(r){return this.app.getSystemIcon(r)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(r){this.app=r}}class Ds{getPlugins(){return Array.from(this.plugins)}getSystemIcon(r){return this.icons[r]}getSystemIcons(){return this.icons}getComponents(){return this.components}getProvider(){const r=new hs(this);let o=!1;return({children:f})=>{const I=(0,W.useRef)(!0),N=(0,W.useMemo)(()=>ce.createWithStorage(this.themes),[]),{routing:V,featureFlags:te,routeBindings:Ze}=(0,W.useMemo)(()=>{const wt=an({root:f,discoverers:[Jn,vn],collectors:{routing:Ar()?d:w,collectedPlugins:Ln,featureFlags:y}});return wt.collectedPlugins.forEach(jt=>this.plugins.add(jt)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...wt,routeBindings:Fr(this.bindRoutes)}},[f]);o||(o=!0,Zr(V.paths,V.parents),ls(Ze,this.plugins));const Oe=Zs(this.configLoader,this.components,N),ht="api"in Oe;if(ht){const{api:wt}=Oe;this.configApi=wt}if("node"in Oe)return Oe.node;if(ht&&I.current){I.current=!1;const wt=this.getApiHolder().get(b.W0);if(wt){for(const Bt of this.plugins.values())if("getFeatureFlags"in Bt)for(const Tn of Bt.getFeatureFlags())wt.registerFlag({name:Tn.name,pluginId:Bt.getId()});else for(const Tn of Bt.output())Tn.type==="feature-flag"&&wt.registerFlag({name:Tn.name,pluginId:Bt.getId()});const jt=wt.getRegisteredFlags(),Ot=new Set(jt.map(Bt=>Bt.name));for(const Bt of te)Ot.has(Bt)||wt.registerFlag({name:Bt,pluginId:""})}}const{ThemeProvider:at=Er}=this.components;return(0,n.jsx)(Ee,{apis:this.getApiHolder(),children:(0,n.jsx)(cs,{appContext:r,children:(0,n.jsx)(at,{children:(0,n.jsx)(nr,{routePaths:V.paths,routeParents:V.parents,routeObjects:V.objects,routeBindings:Ze,basePath:Ur(Oe.api),children:(0,n.jsx)(Jr.Provider,{value:{routeObjects:V.objects},children:f})})})})})}}getRouter(){const{Router:r,SignInPage:o}=this.components,c=({component:I,children:N})=>{const[V,te]=(0,W.useState)(),Ze=(0,b.h_)(b.Ds),Oe=Ur(Ze);return V?(this.appIdentityProxy.setTarget(V,{signOutTargetUrl:Oe||"/"}),N):(0,n.jsx)(I,{onSignInSuccess:te})};return({children:I})=>{const N=(0,b.h_)(b.Ds),V=us(N),te=`${V}/*`,{routeObjects:Ze}=(0,W.useContext)(Jr);return o?Ar()?(0,n.jsxs)(r,{children:[(0,n.jsx)(rr,{routeObjects:Ze}),(0,n.jsx)(c,{component:o,children:(0,n.jsx)(g.Z5,{children:(0,n.jsx)(g.AW,{path:te,element:(0,n.jsx)(n.Fragment,{children:I})})})})]}):(0,n.jsxs)(r,{basename:V,children:[(0,n.jsx)(rr,{routeObjects:Ze}),(0,n.jsx)(c,{component:o,children:(0,n.jsx)(n.Fragment,{children:I})})]}):(this.appIdentityProxy.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:V||"/"}),Ar()?(0,n.jsxs)(r,{children:[(0,n.jsx)(rr,{routeObjects:Ze}),(0,n.jsx)(g.Z5,{children:(0,n.jsx)(g.AW,{path:te,element:(0,n.jsx)(n.Fragment,{children:I})})})]}):(0,n.jsxs)(r,{basename:V,children:[(0,n.jsx)(rr,{routeObjects:Ze}),I]}))}}getApiHolder(){if(this.apiHolder){for(const r of this.plugins)for(const o of r.getApis())this.apiFactoryRegistry.get(o.api)||this.apiFactoryRegistry.register("default",o);return Ke.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:b.hg,deps:{},factory:()=>ce.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:b.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:b.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:b.W0,deps:{},factory:()=>new ke});for(const r of this.defaultApis)this.apiFactoryRegistry.register("default",r);for(const r of this.plugins)for(const o of r.getApis())if(!this.apiFactoryRegistry.register("default",o))throw new Error(`Plugin ${r.getId()} tried to register duplicate or forbidden API factory for ${o.api}`);for(const r of this.apis)if(!this.apiFactoryRegistry.register("app",r))throw new Error(`Duplicate or forbidden API factory for ${r.api} in app`);return Ke.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Ke(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(r){const o=new Set;for(const c of r){const f=c.getId();if(o.has(f))throw new Error(`Duplicate plugin found '${f}'`);o.add(f)}}constructor(r){this.appIdentityProxy=new tr;var o;this.apis=(o=r.apis)!==null&&o!==void 0?o:[],this.icons=r.icons;var c;this.plugins=new Set((c=r.plugins)!==null&&c!==void 0?c:[]),this.components=r.components,this.themes=r.themes;var f;this.configLoader=(f=r.configLoader)!==null&&f!==void 0?f:Nr;var I;this.defaultApis=(I=r.defaultApis)!==null&&I!==void 0?I:[],this.bindRoutes=r.bindRoutes,this.apiFactoryRegistry=new mt}}function ps(a){return new Ds(a)}let Qr=!1;const fs=a=>{const r=(0,b.qD)(),{NotFoundErrorPage:o}=r.getComponents(),c=(0,W.useMemo)(()=>Ar(),[]),I=[...(0,b.vJ)(a.children,N=>N.getElements().flatMap(V=>{let te=V.props.path;if(te==="")return[];var Ze;te=(Ze=te==null?void 0:te.replace(/\/\*$/,""))!==null&&Ze!==void 0?Ze:"/";let Oe=c?V:V.props.element;return!c&&!Oe&&(Oe=V,Qr||(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] />} />."),Qr=!0)),[{path:te,element:Oe,children:V.props.children?[{path:te==="/"?"/":"*",element:V.props.children}]:void 0}]}).sort((V,te)=>te.path.localeCompare(V.path)).map(V=>({...V,path:V.path==="/"?"/":`${V.path}/*`}))),{path:"*",element:(0,n.jsx)(o,{})}];return(0,g.V$)(I)};var Mr=t(25488);const mr=[(0,b.ni)({api:b.NW,deps:{configApi:b.Ds},factory:({configApi:a})=>C.compile(`${a.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,b.ni)({api:b.$v,deps:{},factory:()=>new bt}),(0,b.ni)({api:b.v_,deps:{},factory:()=>new ie}),(0,b.ni)({api:b.VE,deps:{alertApi:b.$v},factory:({alertApi:a})=>{const r=new H(a,new me);return ue.forward(r,{hidden:!1}),r}}),(0,b.ni)({api:b.E6,deps:{errorApi:b.VE},factory:({errorApi:a})=>Ut.create({errorApi:a})}),(0,b.ni)({api:b.gP,deps:{configApi:b.Ds,identityApi:b.$4,discoveryApi:b.NW},factory:({configApi:a,identityApi:r,discoveryApi:o})=>Ue({middleware:[Tt.resolvePluginProtocol({discoveryApi:o}),Tt.injectIdentityAuth({identityApi:r,config:a})]})}),(0,b.ni)({api:b.ZM,deps:{},factory:()=>new Mn}),(0,b.ni)({api:b.Kp,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Zn.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.p_,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>gn.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.F4,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Wt.create({discoveryApi:a,oauthRequestApi:r,defaultScopes:["read:user"],environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.D,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>dn.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.ux,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Yt.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.gW,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>ge.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.bq,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Ae.create({discoveryApi:a,oauthRequestApi:r,defaultScopes:["team"],environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.uB,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>qe.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:Mr.RV,deps:{discovery:b.NW,identity:b.$4,config:b.Ds},factory:({config:a,discovery:r,identity:o})=>Mr.iM.create({config:a,discovery:r,identity:o})})];var vr=t(77277),zt=t(93414),gs=t(39857);function Xr({children:a}){return(0,g.GV)()?(0,n.jsx)(n.Fragment,{children:a}):(0,n.jsx)(g.VA,{children:a})}const qr=()=>(0,n.jsx)(zt.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),_r=({step:a,error:r})=>{let o="";return a==="load-config"?o=`The configuration failed to load, someone should have a look at this error: ${r.message}`:a==="load-chunk"&&(o=`Lazy loaded chunk failed to load, try to reload the page: ${r.message}`),(0,n.jsx)(Xr,{children:(0,n.jsx)(zt.mf,{status:"501",statusMessage:o})})},wn=({error:a,resetError:r,plugin:o})=>(0,n.jsx)(zt.yu,{title:`Error in ${o==null?void 0:o.getId()}`,defaultExpanded:!0,error:a,children:(0,n.jsx)(vr.Z,{variant:"outlined",onClick:r,children:"Retry"})}),ms={Progress:zt.Ex,Router:gs.VK,NotFoundErrorPage:qr,BootErrorPage:_r,ErrorBoundaryFallback:wn};var vs=t(43642),ys=t(80079),xs=t(90941),bs=t(32915),Ss=t(40562),Cs=t(21853),es=t(60744),Tr=t(66569),Ns=t(30254),ws=t(13384),js=t(15933),v=t(58838),x=t(86737),R=t(4989),Z=t(44407),J=t(18628),K=t(84219),oe=t(98685),he=t(39781);const Se={brokenImage:ys.Z,catalog:J.Z,scaffolder:bs.Z,techdocs:Ss.Z,search:Cs.Z,chat:es.Z,dashboard:Tr.Z,docs:Ns.Z,email:ws.Z,github:v.Z,group:K.Z,help:x.Z,"kind:api":js.Z,"kind:component":Z.Z,"kind:domain":vs.Z,"kind:group":K.Z,"kind:location":R.Z,"kind:system":xs.Z,"kind:user":oe.Z,user:oe.Z,warning:he.Z};var $e=t(73689),De=t(48032);const we={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")`},Ve={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 it(a){const{colors:r,shape:o,options:c}=a,I=`linear-gradient(90deg, ${(r.length===1?[r[0],r[0]]:r).join(", ")})`,N=`${o}, ${I}`;var V;const te=(V=c==null?void 0:c.fontColor)!==null&&V!==void 0?V:"#FFFFFF";return{colors:r,shape:o,backgroundImage:N,fontColor:te}}const Ct={home:it({colors:Ve.teal,shape:we.wave}),documentation:it({colors:Ve.pinkSea,shape:we.wave2}),tool:it({colors:Ve.purpleSky,shape:we.round}),service:it({colors:Ve.marineBlue,shape:we.wave}),website:it({colors:Ve.veryBlue,shape:we.wave}),library:it({colors:Ve.rubyRed,shape:we.wave}),other:it({colors:Ve.darkGrey,shape:we.wave}),app:it({colors:Ve.toastyOrange,shape:we.wave}),apis:it({colors:Ve.teal,shape:we.wave2}),card:it({colors:Ve.greens,shape:we.wave})},_e=16,Zt='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function qt(a){const{palette:r,htmlFontSize:o=_e,fontFamily:c=Zt,defaultPageTheme:f,pageTheme:I=Ct}=a;if(!I[f])throw new Error(`${f} is not defined in pageTheme.`);var N;return{palette:r,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:o,fontFamily:c,h6:{fontWeight:700,fontSize:20,marginBottom:2},h5:{fontWeight:700,fontSize:24,marginBottom:4},h4:{fontWeight:700,fontSize:28,marginBottom:6},h3:{fontSize:32,fontWeight:700,marginBottom:6},h2:{fontSize:40,fontWeight:700,marginBottom:8},h1:{fontSize:54,fontWeight:700,marginBottom:10}},page:I[f],getPageTheme:({themeId:V})=>(N=I[V])!==null&&N!==void 0?N:I[f]}}function dr(a){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:a.typography.fontFamily},body:{height:"100%",fontFamily:a.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:a.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:a.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:a.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:a.spacing(1.5,2,1.5,2.5)},head:{wordBreak:"break-word",overflow:"hidden",color:"rgb(179, 179, 179)",fontWeight:"normal",lineHeight:"1"}},MuiTabs:{root:{minHeight:24}},MuiTab:{root:{color:a.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,De.darken)(a.palette.link,.3),background:(0,De.lighten)(a.palette.link,.95)},[a.breakpoints.up("md")]:{minWidth:120,fontSize:a.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:a.palette.link}},MuiTableSortLabel:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"}},active:{fontWeight:"bold",color:"inherit"}},MuiListItemText:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},MuiButton:{text:{padding:void 0}},MuiChip:{root:{backgroundColor:"#D9D9D9",marginRight:a.spacing(1),marginBottom:a.spacing(1),color:a.palette.grey[900]},outlined:{color:a.palette.text.primary},label:{lineHeight:`${a.spacing(2.5)}px`,fontWeight:a.typography.fontWeightMedium,fontSize:`${a.spacing(1.75)}px`},labelSmall:{fontSize:`${a.spacing(1.5)}px`},deleteIcon:{color:a.palette.grey[500],width:`${a.spacing(3)}px`,height:`${a.spacing(3)}px`,margin:`0 ${a.spacing(.75)}px 0 -${a.spacing(.75)}px`},deleteIconSmall:{width:`${a.spacing(2)}px`,height:`${a.spacing(2)}px`,margin:`0 ${a.spacing(.5)}px 0 -${a.spacing(.5)}px`}},MuiCard:{root:{display:"flex",flexDirection:"column"}},MuiCardHeader:{root:{paddingBottom:0}},MuiCardContent:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}},MuiCardActions:{root:{justifyContent:"flex-end"}}}}function Vn(a){const r=qt(a),o=(0,$e.Z)(r),c=dr(o);return{...o,overrides:c}}var sr=t(34505);const xn=Vn({palette:{type:"light",background:{default:"#F8F8F8"},status:{ok:"#1DB954",warning:"#FF9800",error:"#E22134",running:"#2E77D0",pending:"#FFED51",aborted:"#757575"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#2E77D0"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#000000",textVerySubtle:"#DDD",textSubtle:"#6E6E6E",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#2196F3",link:"#0A6EBE",gold:sr.Z.A700,navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:Ct}),jn=Vn({palette:{type:"dark",background:{default:"#333333"},status:{ok:"#71CF88",warning:"#FFB84D",error:"#F84C55",running:"#3488E3",pending:"#FEF071",aborted:"#9E9E9E"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#9CC9FF",dark:"#82BAFD"},secondary:{main:"#FF88B2"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#FFFFFF",textVerySubtle:"#727272",textSubtle:"#CCCCCC",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#82BAFD",link:"#9CC9FF",gold:sr.Z.A700,navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:Ct});var En=t(98192),Ir=t(15222),Rr=t(41547),Lr=t(87561);const An=[{id:"light",title:"Light Theme",variant:"light",icon:(0,n.jsx)(Ir.Z,{}),Provider:({children:a})=>(0,n.jsx)(Rr.Z,{theme:xn,children:(0,n.jsx)(Lr.ZP,{children:a})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,n.jsx)(En.Z,{}),Provider:({children:a})=>(0,n.jsx)(Rr.Z,{theme:jn,children:(0,n.jsx)(Lr.ZP,{children:a})})}];function Pn(a){var r,o,c;return ps({...a,apis:(r=a==null?void 0:a.apis)!==null&&r!==void 0?r:[],bindRoutes:a==null?void 0:a.bindRoutes,components:{...ms,...a==null?void 0:a.components},configLoader:a==null?void 0:a.configLoader,defaultApis:mr,icons:{...Se,...a==null?void 0:a.icons},plugins:(o=a==null?void 0:a.plugins)!==null&&o!==void 0?o:[],themes:(c=a==null?void 0:a.themes)!==null&&c!==void 0?c:An})}var or=t(25271),Fs=t(76635);async function di({storageApi:a}){const r=a.forBucket("settings"),o=a.forBucket("starredEntities"),c=r.snapshot("starredEntities").value;if(!(0,Fs.isArray)(c))return;var f;const I=new Set((f=o.snapshot("entityRefs").value)!==null&&f!==void 0?f:[]);c.filter(Fs.isString).map(N=>N.split(":")).filter(N=>N.length===4&&N[0]==="entity").map(([N,V,te,Ze])=>(0,or.eE)({kind:V,namespace:te,name:Ze})).forEach(N=>I.add(N)),await o.set("entityRefs",Array.from(I)),await r.remove("starredEntities")}class So{async toggleStarred(r){this.starredEntities.has(r)?this.starredEntities.delete(r):this.starredEntities.add(r),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const r of this.subscribers)r.next(new Set(this.starredEntities))}constructor(r){this.subscribers=new Set,this.observable=new(se())(c=>(c.next(new Set(this.starredEntities)),this.subscribers.add(c),()=>{this.subscribers.delete(c)})),di(r).then(),this.settingsStore=r.storageApi.forBucket("starredEntities");var o;this.starredEntities=new Set((o=this.settingsStore.snapshot("entityRefs").value)!==null&&o!==void 0?o:[]),this.settingsStore.observe$("entityRefs").subscribe({next:c=>{var f;this.starredEntities=new Set((f=c.value)!==null&&f!==void 0?f:[]),this.notifyChanges()}})}}var Ji=t(33414),Gn=t(79692),ui=t(12420),kn=t(92848),Qi=t(19928);function Xi(){const a=useApi(catalogApiRef),{error:r,loading:o,value:c}=useAsync(async()=>await a.getEntityFacets({facets:["kind"]}).then(I=>{var N;return((N=I.facets.kind)===null||N===void 0?void 0:N.map(V=>V.value).sort())||[]}),[a]);return{loading:o,error:r,allKinds:c!=null?c:[]}}function qi(a,r,o){let c=a;return r&&(c=c.filter(I=>r.some(N=>N.toLocaleLowerCase("en-US")===I.toLocaleLowerCase("en-US")))),o&&!a.some(I=>I.toLocaleLowerCase("en-US")===o.toLocaleLowerCase("en-US"))&&(c=c.concat([o])),c.sort().reduce((I,N)=>(I[N.toLocaleLowerCase("en-US")]=N,I),{})}const hi=(0,Gn.Z)(a=>(0,ui.Z)({root:{...a.typography.h4}}));function _i(a){var r;const{initialFilter:o="component",allowedKinds:c}=a,f=hi(),{allKinds:I}=useAllKinds(),{filters:N,updateFilters:V,queryParameters:{kind:te}}=useEntityList(),Ze=useMemo(()=>[te].flat()[0],[te]);var Oe;const[ht,at]=useState((Oe=Ze!=null?Ze:(r=N.kind)===null||r===void 0?void 0:r.value)!==null&&Oe!==void 0?Oe:o);useEffect(()=>{Ze&&at(Ze)},[Ze]),useEffect(()=>{var jt;if(!((jt=N.kind)===null||jt===void 0)&&jt.value){var Ot;at((Ot=N.kind)===null||Ot===void 0?void 0:Ot.value)}},[N.kind]),useEffect(()=>{V({kind:ht?new EntityKindFilter(ht):void 0})},[ht,V]);const wt=filterKinds(I,c,ht);return _jsx(Select,{input:_jsx(InputBase,{}),value:ht.toLocaleLowerCase("en-US"),onChange:jt=>at(jt.target.value),classes:f,children:Object.keys(wt).map(jt=>_jsx(MenuItem,{value:jt,children:`${pluralize(wt[jt])}`},jt))})}var Co=t(65826);const wo=(0,Gn.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",wordBreak:"break-all",marginBottom:"1rem"}});function pi(a){const r=a.result,o=a.highlight,c=wo(),f=useAnalytics(),I=()=>{f.captureEvent("discover",r.title,{attributes:{to:r.location},value:a.rank})};return _jsxs(_Fragment,{children:[_jsxs(ListItem,{alignItems:"flex-start",children:[a.icon&&_jsx(ListItemIcon,{children:a.icon}),_jsxs("div",{className:c.flexContainer,children:[_jsx(ListItemText,{className:c.itemText,primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:r.location,onClick:I,children:o!=null&&o.fields.title?_jsx(HighlightedSearchResultText,{text:o.fields.title,preTag:o.preTag,postTag:o.postTag}):r.title}),secondary:o!=null&&o.fields.text?_jsx(HighlightedSearchResultText,{text:o.fields.text,preTag:o.preTag,postTag:o.postTag}):r.text}),_jsxs(Box,{children:[r.kind&&_jsx(Chip,{label:`Kind: ${r.kind}`,size:"small"}),r.lifecycle&&_jsx(Chip,{label:`Lifecycle: ${r.lifecycle}`,size:"small"})]})]})]}),_jsx(Divider,{component:"li"})]})}var fi=t(86359),Es=t(95544),jo=t(99688),ts=t(12231),As=t(86136),Ts=t(49378),Us=t(85256),Eo=t(61837),Ms=t(79784),Ao=t(50758),zs=t(31654),Ws=t(43054),To=t(65759),yr=t(51666);const zr="catalog-entity",Io=(0,yr.J$)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:zr}),Ro=(0,yr.J$)({name:"catalog.entity.create",attributes:{action:"create"}}),Vs=(0,yr.J$)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:zr}),gi=(0,yr.J$)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:zr}),Lo=(0,yr.J$)({name:"catalog.location.read",attributes:{action:"read"}}),Po=(0,yr.J$)({name:"catalog.location.create",attributes:{action:"create"}}),Hs=(0,yr.J$)({name:"catalog.location.delete",attributes:{action:"delete"}}),mi=[Io,Ro,Vs,gi,Lo,Po,Hs];var Gs=t(49166);function ko(a){const{unregisterEntityOptions:r,isUnregisterAllowed:o,onUnregisterEntity:c,onClose:f}=a,I=typeof(r==null?void 0:r.disableUnregister)=="boolean";var N;const V=(N=!o||(I?!!(r!=null&&r.disableUnregister):(r==null?void 0:r.disableUnregister)==="disable"))!==null&&N!==void 0?N:!1;let te=(0,n.jsx)(n.Fragment,{});return(r==null?void 0:r.disableUnregister)!=="hidden"&&(te=(0,n.jsxs)(ts.Z,{onClick:()=>{f(),c()},disabled:V,children:[(0,n.jsx)(As.Z,{children:(0,n.jsx)(Gs.Z,{fontSize:"small"})}),(0,n.jsx)(Ts.Z,{primary:"Unregister entity"})]})),(0,n.jsx)(n.Fragment,{children:te})}const Ks=(0,Gn.Z)(a=>({button:{color:a.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Ys(a){const{UNSTABLE_extraContextMenuItems:r,UNSTABLE_contextMenuOptions:o,onUnregisterEntity:c,onInspectEntity:f}=a,[I,N]=(0,W.useState)(),V=Ks(),Ze=(0,kn.N$)(Vs).allowed,Oe=Ot=>{N(Ot.currentTarget)},ht=()=>{N(void 0)},at=(0,b.h_)(b.$v),wt=(0,W.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>at.post({message:"Copied!",severity:"info"}))},[at]),jt=r&&[...r.map(Ot=>(0,n.jsxs)(ts.Z,{onClick:()=>{ht(),Ot.onClick()},children:[(0,n.jsx)(As.Z,{children:(0,n.jsx)(Ot.Icon,{fontSize:"small"})}),(0,n.jsx)(Ts.Z,{primary:Ot.title})]},Ot.title)),(0,n.jsx)(Us.Z,{},"the divider is here!")];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Eo.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!I,role:"button",onClick:Oe,"data-testid":"menu-button",className:V.button,id:"long-menu",children:(0,n.jsx)(Ws.Z,{})}),(0,n.jsx)(Ms.ZP,{open:Boolean(I),onClose:ht,anchorEl:I,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,n.jsxs)(Ao.Z,{children:[jt,(0,n.jsx)(ko,{unregisterEntityOptions:o,isUnregisterAllowed:Ze,onUnregisterEntity:c,onClose:ht}),(0,n.jsxs)(ts.Z,{onClick:()=>{ht(),f()},children:[(0,n.jsx)(As.Z,{children:(0,n.jsx)(zs.Z,{fontSize:"small"})}),(0,n.jsx)(Ts.Z,{primary:"Inspect entity"})]}),(0,n.jsxs)(ts.Z,{onClick:()=>{ht(),wt()},children:[(0,n.jsx)(As.Z,{children:(0,n.jsx)(To.Z,{fontSize:"small"})}),(0,n.jsx)(Ts.Z,{primary:"Copy entity URL"})]})]})})]})}const Js="plugin.catalog.entityLayoutRoute",Qs=()=>null;(0,b.R5)(Qs,Js,!0),(0,b.R5)(Qs,"core.gatherMountPoints",!0);function Oo(a){const{entity:r,title:o}=a;return(0,n.jsxs)(Es.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,n.jsx)(Es.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:o}),r&&(0,n.jsx)(kn.LH,{entity:r})]})}function Xs(a,r,o,c){var f;const I=(f=a!=null?a:c==null?void 0:c.kind)!==null&&f!==void 0?f:"";var N;const V=(N=r!=null?r:c==null?void 0:c.metadata.namespace)!==null&&N!==void 0?N:"";var te,Ze,Oe;return{headerTitle:`${(Oe=(Ze=(te=c==null?void 0:c.metadata.title)!==null&&te!==void 0?te:o)!==null&&Ze!==void 0?Ze:c==null?void 0:c.metadata.name)!==null&&Oe!==void 0?Oe:""}${V&&V!==or.zG?` in ${V}`:""}`,headerType:(()=>{let at=I.toLocaleLowerCase("en-US");return c&&c.spec&&"type"in c.spec&&(at+=" \u2014 ",at+=c.spec.type.toLocaleLowerCase("en-US")),at})()}}function Bo(a){var r;const{entity:o}=a,c=(0,kn.hF)(o,or.S4);return(0,n.jsxs)(n.Fragment,{children:[c.length>0&&(0,n.jsx)(zt.i9,{label:"Owner",value:(0,n.jsx)(kn.rI,{entityRefs:c,defaultKind:"Group",color:"inherit"})}),((r=o.spec)===null||r===void 0?void 0:r.lifecycle)&&(0,n.jsx)(zt.i9,{label:"Lifecycle",value:o.spec.lifecycle})]})}const qn=a=>{var r,o;const{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,children:I,NotFoundComponent:N}=a,{kind:V,namespace:te,name:Ze}=(0,b.Oi)(kn.wi),{entity:Oe,loading:ht,error:at}=(0,kn.ce)(),wt=(0,g.TH)(),jt=(0,b.vJ)(I,mo=>mo.selectByComponentData({key:Js,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:kr})=>{if(Oe){if(kr.if&&!kr.if(Oe))return[]}else return[];return[{path:kr.path,title:kr.title,children:kr.children,tabProps:kr.tabProps}]}),[Oe]),{headerTitle:Ot,headerType:Bt}=Xs(V,te,Ze,Oe),[Tn,ar]=(0,W.useState)(!1),[er,Pr]=(0,W.useState)(!1),ei=(0,g.s0)(),os=async()=>{ar(!1),Pr(!1),ei("/")};(0,W.useEffect)(()=>{ar(!1),Pr(!1)},[wt.pathname]);var ks;return(0,n.jsxs)(zt.T3,{themeId:(ks=Oe==null||(r=Oe.spec)===null||r===void 0||(o=r.type)===null||o===void 0?void 0:o.toString())!==null&&ks!==void 0?ks:"home",children:[(0,n.jsx)(zt.h4,{title:(0,n.jsx)(Oo,{title:Ot,entity:Oe}),pageTitleOverride:Ot,type:Bt,children:Oe&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Bo,{entity:Oe}),(0,n.jsx)(Ys,{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,onUnregisterEntity:()=>ar(!0),onInspectEntity:()=>Pr(!0)})]})}),ht&&(0,n.jsx)(zt.Ex,{}),Oe&&(0,n.jsx)(zt.tn,{routes:jt}),at&&(0,n.jsx)(zt.VY,{children:(0,n.jsx)(jo.Z,{severity:"error",children:at.toString()})}),!ht&&!at&&!Oe&&(0,n.jsx)(zt.VY,{children:N||(0,n.jsxs)(zt.GB,{title:"Entity not found",children:["There is no ",V," with the requested"," ",(0,n.jsx)(zt.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,n.jsx)(kn.pp,{open:Tn,entity:Oe,onConfirm:os,onClose:()=>ar(!1)}),(0,n.jsx)(kn.U_,{open:er,entity:Oe,onClose:()=>Pr(!1)})]})};qn.Route=Qs;var ea=t(23054);function ta(a){const{open:r,onClose:o,onConfirm:c,entity:f}=a,[I,N]=useState(!1),V=useApi(catalogApiRef),te=useApi(alertApiRef),Ze=async()=>{N(!0);try{const Oe=f.metadata.uid;await V.removeEntityByUid(Oe),c()}catch(Oe){assertError(Oe),te.post({message:Oe.message})}finally{N(!1)}};return _jsxs(Dialog,{open:r,onClose:o,children:[_jsx(DialogTitle,{id:"responsive-dialog-title",children:"Are you sure you want to delete this entity?"}),_jsxs(DialogActions,{children:[_jsx(Button,{variant:"contained",color:"secondary",disabled:I,onClick:Ze,children:"Delete"}),_jsx(Button,{onClick:o,color:"primary",children:"Cancel"})]})]})}var Is=t(19625);function na(a){var r,o;return(a==null||(r=a.metadata)===null||r===void 0||(o=r.annotations)===null||o===void 0?void 0:o["backstage.io/orphan"])==="true"}function ra(){const a=useNavigate(),r=useRouteRef(rootRouteRef),[o,c]=useState(!1),{entity:f}=useEntity(),I=async()=>{c(!1),a(r())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>c(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:o,entity:f,onConfirm:I,onClose:()=>c(!1)})]})}var vi=t(29644);const yi=a=>a.error&&a.level==="error"&&a.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function $o(a,r){return{items:(await r.getEntityAncestors({entityRef:a})).items.map(f=>{var I,N;return{errors:((N=(I=f.entity.status)===null||I===void 0?void 0:I.items)!==null&&N!==void 0?N:[]).filter(yi).map(Ze=>Ze.error).filter(Ze=>Boolean(Ze)),entity:f.entity}}).filter(f=>f.errors.length>0)}}async function Rs(a,r){const o=r.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await $o(stringifyEntityRef(a),o)).items.length>0}function sa(){const{entity:a}=useEntity(),r=stringifyEntityRef(a),o=useApi(catalogApiRef),{loading:c,error:f,value:I}=useAsync(async()=>$o(r,o),[r,o]);return f?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:f})}):c||!I?null:_jsx(_Fragment,{children:I.items.map((N,V)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(a)!==stringifyEntityRef(N.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:N.entity})]}),N.errors.map((te,Ze)=>_jsx(ResponseErrorPanel,{error:te},Ze))]},V))})}const Zo="core.backstage.entitySwitch",_s=a=>null;(0,b.R5)(_s,Zo,!0);const Do=a=>{var r;const{entity:o,loading:c}=(0,kn.ce)(),f=(0,b.I_)(),I=(0,b.vJ)(a.children,te=>te.selectByComponentData({key:Zo,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(Ze=>{if(c)return[];const{if:Oe,children:ht}=Ze.props;if(!o)return[{if:Oe===void 0,children:ht}];var at;return[{if:(at=Oe==null?void 0:Oe(o,{apis:f}))!==null&&at!==void 0?at:!0,children:ht}]}),[f,o,c]);if(I.some(te=>typeof te.if=="object"&&"then"in te.if))return(0,n.jsx)(Ls,{results:I});var V;return(V=(r=I.find(te=>te.if))===null||r===void 0?void 0:r.children)!==null&&V!==void 0?V:null};function Ls({results:a}){const{loading:r,value:o}=(0,Mt.default)(async()=>{const c=a.map(async({if:I,children:N})=>{try{if(await I)return N}catch{}return null});var f;return(f=(await Promise.all(c)).find(Boolean))!==null&&f!==void 0?f:null},[a]);return r||!o?null:o}Do.Case=_s;const xi=null,bi=kn._i.Filters,Si=kn._i.Content,On=(0,b.rx)({id:"catalog",apis:[(0,b.ni)({api:kn.Ah,deps:{discoveryApi:b.NW,fetchApi:b.gP},factory:({discoveryApi:a,fetchApi:r})=>new vi.MS({discoveryApi:a,fetchApi:r})}),(0,b.ni)({api:kn.p3,deps:{storageApi:b.E6},factory:({storageApi:a})=>new So({storageApi:a})})],routes:{catalogIndex:Is._Z,catalogEntity:kn.wi},externalRoutes:{createComponent:Is.yw,viewTechDoc:Is.jU},__experimentalConfigure(a){return{...{createButtonTitle:"Create"},...a}}}),eo=On.provide((0,b.P4)({name:"CatalogIndexPage",component:()=>t.e(5837).then(t.bind(t,95837)).then(a=>a.CatalogPage),mountPoint:Is._Z})),ns=On.provide((0,b.P4)({name:"CatalogEntityPage",component:()=>t.e(8951).then(t.bind(t,78951)).then(a=>a.CatalogEntityPage),mountPoint:kn.wi})),No=On.provide((0,b.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,33414)).then(a=>a.AboutCard)}})),Fo=On.provide((0,b.CO)({name:"EntityLinksCard",component:{lazy:()=>t.e(7750).then(t.bind(t,17750)).then(a=>a.EntityLinksCard)}})),ur=On.provide((0,b.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>t.e(5458).then(t.bind(t,5458)).then(a=>a.HasSystemsCard)}})),Ci=On.provide((0,b.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>t.e(1105).then(t.bind(t,1105)).then(a=>a.HasComponentsCard)}})),Uo=On.provide((0,b.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>t.e(2440).then(t.bind(t,82440)).then(a=>a.HasSubcomponentsCard)}})),wi=On.provide((0,b.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>t.e(9770).then(t.bind(t,79770)).then(a=>a.HasResourcesCard)}})),oa=On.provide((0,b.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>t.e(9545).then(t.bind(t,19545)).then(a=>a.DependsOnComponentsCard)}})),ir=On.provide((0,b.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>t.e(184).then(t.bind(t,40184)).then(a=>a.DependencyOfComponentsCard)}})),Mo=On.provide((0,b.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>t.e(1032).then(t.bind(t,81032)).then(a=>a.DependsOnResourcesCard)}})),ji=On.provide((0,b.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>t.e(732).then(t.bind(t,732)).then(a=>a.RelatedEntitiesCard)}}));var to=t(32838);class zo{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(r,o){const f=`${await this.getApiOrigin()}/${o}`,I=await fetch(`${f.endsWith("/")?f:`${f}/`}index.html`);if(I.status===404)throw new Error("Page not found");return I.text()}async syncEntityDocs(r){return"cached"}async getBaseUrl(r,o,c){const f=await this.getApiOrigin();return new URL(r,`${f}/${c}`).toString()}constructor({configApi:r,discoveryApi:o,identityApi:c}){this.configApi=r,this.discoveryApi=o,this.identityApi=c}}class Wo{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(r){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(r){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:r,discoveryApi:o,identityApi:c}){this.configApi=r,this.discoveryApi=o,this.identityApi=c}}const rs=[(0,b.ni)({api:Te.Dl,deps:{configApi:b.Ds,discoveryApi:b.NW,identityApi:b.$4},factory:({configApi:a,discoveryApi:r,identityApi:o})=>new zo({configApi:a,discoveryApi:r,identityApi:o})}),(0,b.ni)({api:Te.gT,deps:{configApi:b.Ds,discoveryApi:b.NW,identityApi:b.$4},factory:({configApi:a,discoveryApi:r,identityApi:o})=>new Wo({configApi:a,discoveryApi:r,identityApi:o})}),(0,b.ni)({api:to.q3,deps:{configApi:b.Ds},factory:({configApi:a})=>to.ae.fromConfig(a)})],no={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},ro={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function so(){const a=await fetch("/.detect");return a.ok?(await a.text()).trim()==="techdocs-cli-server":!1}async function oo(){const a=await Nr(),r=await so();return[...a,{context:"detected",data:r?no:ro}]}var Ps=t(58845);const Vo=(0,Gn.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var io=()=>{const a=Vo();return(0,n.jsx)("svg",{className:a.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,n.jsx)("path",{className:a.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 ao=(0,Gn.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Wr=()=>{const a=ao();return(0,n.jsx)("svg",{className:a.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,n.jsx)("path",{className:a.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 Go=(0,Gn.Z)({root:{width:zt.po.drawerWidthClosed,height:3*zt.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:zt.po.drawerWidthClosed,marginLeft:24}}),Ko=()=>{const a=Go(),{isOpen:r}=(0,zt.mZ)();return(0,n.jsx)("div",{className:a.root,children:(0,n.jsx)(zt.rU,{to:"/docs/default/component/local/",underline:"none",className:a.link,children:r?(0,n.jsx)(io,{}):(0,n.jsx)(Wr,{})})})},lo=({children:a})=>(0,n.jsxs)(zt.tR,{children:[(0,n.jsxs)(zt.YE,{children:[(0,n.jsx)(Ko,{}),(0,n.jsx)(zt.v7,{}),(0,n.jsx)(zt.R6,{icon:Ps.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),a]});var co=t(80030),Yo=t(32388),Jo=t(4142);const Qo=(0,Gn.Z)(a=>({headerIcon:{color:a.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:a.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var _n;(function(a){a.LIGHT="light",a.DARK="dark"})(_n||(_n={}));const Xo=()=>{const a=(0,b.h_)(b.hg),r=Qo(),[o,c]=(0,W.useState)(a.getActiveThemeId()===_n.DARK?_n.DARK:_n.LIGHT),f={[_n.LIGHT]:{icon:Jo.Z,title:"Dark theme"},[_n.DARK]:{icon:Yo.Z,title:"Light theme"}},{title:I,icon:N}=f[o],V=()=>{c(te=>{const Ze=te===_n.LIGHT?_n.DARK:_n.LIGHT;return a.setActiveThemeId(Ze),Ze})};return(0,n.jsx)(Es.Z,{display:"flex",alignItems:"center",mr:2,children:(0,n.jsx)(co.ZP,{title:I,arrow:!0,children:(0,n.jsx)(Eo.Z,{size:"small",onClick:V,children:(0,n.jsx)(N,{className:r.headerIcon})})})})},ss=()=>(0,n.jsxs)(S.I6,{children:[(0,n.jsx)(M.S,{}),(0,n.jsx)(z.F,{withSearch:!1})]}),uo=(0,n.jsx)(ss,{}),ho=Pn({apis:rs,configLoader:oo,plugins:Object.values(h)}),po=ho.getProvider(),qo=ho.getRouter(),fo=S.s4.provide((0,Te.KY)({name:"ThemeToggleAddon",component:Xo,location:Te.oZ.Header})),go=(0,n.jsxs)(fs,{children:[(0,n.jsx)(g.Fg,{to:"/docs/default/component/local/"},"/"),(0,n.jsx)(g.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,n.jsx)(ns,{})}),(0,n.jsx)(g.AW,{path:"/docs",element:(0,n.jsx)(S.Jl,{}),children:(0,n.jsx)(L.u,{})}),(0,n.jsxs)(g.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,n.jsx)(S.I6,{}),children:[uo,(0,n.jsx)(Te.DR,{children:(0,n.jsx)(fo,{})})]})]});var _o=()=>(0,n.jsx)(po,{children:(0,n.jsx)(qo,{children:(0,n.jsx)(lo,{children:go})})});$.render((0,n.jsx)(_o,{}),document.getElementById("root"))},51837:function(It,ze,t){"use strict";t.d(ze,{CT:function(){return b},EI:function(){return ne},uW:function(){return $},Vt:function(){return l}});function h(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const n=h(),W=Q=>`__@backstage/${Q}__`;function $(Q,X){const M=W(Q);let z=n[M];return z||(z=X(),n[M]=z,z)}var g=t(2784);function b(Q){return $(Q,()=>(0,g.createContext)(void 0))}function l(Q){return(0,g.useContext)(b(Q))}function P(Q){return{set(X){globalThis[`__@backstage/${Q}__`]=createContext(createVersionedValueMap(X))},reset(){delete globalThis[`__@backstage/${Q}__`]}}}function ne(Q){Object.freeze(Q);const X={atVersion(M){return Q[M]}};return Object.defineProperty(X,"$map",{configurable:!0,enumerable:!0,get(){return Q}}),X}},92848:function(It,ze,t){"use strict";t.d(ze,{h$:function(){return Et},n3:function(){return h.n3},_i:function(){return O},tW:function(){return Be},df:function(){return me},UO:function(){return pn},dq:function(){return Ue},nl:function(){return ws},dx:function(){return He},rI:function(){return Ke},u3:function(){return Tt},xE:function(){return Mn},sL:function(){return Sn},LH:function(){return vn},U_:function(){return zt},pp:function(){return ms},EW:function(){return Cs},Ah:function(){return W},wi:function(){return Te},hF:function(){return rt},CV:function(){return ot},$3:function(){return Xe},p3:function(){return $},ce:function(){return Xt},X2:function(){return kt},wp:function(){return dn},ZW:function(){return Fe},N$:function(){return bt},eK:function(){return In},CR:function(){return ge}});var h=t(29644),n=t(25248);const W=(0,n.T0)({id:"plugin.catalog.service"}),$=(0,n.T0)({id:"catalog-react.starred-entities"});var g=t(82394);class b{async toggleStarred(x){this.starredEntities.delete(x)||this.starredEntities.add(x);for(const R of this.subscribers)R.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){this.starredEntities=new Set,this.subscribers=new Set,this.observable=new ObservableImpl(x=>(x.next(new Set(this.starredEntities)),this.subscribers.add(x),()=>{this.subscribers.delete(x)}))}}var l=t(52322),P=t(2784),ne=t(41156),Q=t(60364),X=t(77277),M=t(4190),z=t(95544),_=t(90436),ae=t(60905),le=t(36444);const A=v=>{const x=(0,ne.Z)(K=>K.breakpoints.down("md")),R=(0,Q.Z)(),[Z,J]=(0,P.useState)(!1);return x?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(X.Z,{style:{marginTop:R.spacing(1),marginLeft:R.spacing(1)},onClick:()=>J(!0),startIcon:(0,l.jsx)(le.Z,{}),children:"Filters"}),(0,l.jsx)(M.ZP,{open:Z,onClose:()=>J(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,l.jsxs)(z.Z,{m:2,children:[(0,l.jsx)(_.Z,{variant:"h6",component:"h2",style:{marginBottom:R.spacing(1)},children:"Filters"}),v.children]})})]}):(0,l.jsx)(ae.Z,{item:!0,lg:2,children:v.children})},L=v=>(0,l.jsx)(ae.Z,{item:!0,xs:12,lg:10,children:v.children}),O=v=>(0,l.jsx)(ae.Z,{container:!0,style:{position:"relative"},children:v.children});O.Filters=A,O.Content=L;var T=t(93414),S=t(25271),q=t(51837);const Te=(0,q.uW)("catalog:entity-route-ref",()=>(0,n.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function et(v){var x,R;return{kind:v.kind.toLocaleLowerCase("en-US"),namespace:(R=(x=v.metadata.namespace)===null||x===void 0?void 0:x.toLocaleLowerCase("en-US"))!==null&&R!==void 0?R:DEFAULT_NAMESPACE,name:v.metadata.name}}function Xe(v,x){const R=x==null?void 0:x.defaultKind;let Z,J,K;return"metadata"in v?(Z=v.kind,J=v.metadata.namespace,K=v.metadata.name):(Z=v.kind,J=v.namespace,K=v.name),(J===void 0||J==="")&&(J=S.zG),(x==null?void 0:x.defaultNamespace)!==void 0?(x==null?void 0:x.defaultNamespace)===J&&(J=void 0):J===S.zG&&(J=void 0),Z=Z.toLocaleLowerCase("en-US"),Z=R&&R.toLocaleLowerCase("en-US")===Z?void 0:Z,`${Z?`${Z}:`:""}${J?`${J}/`:""}${K}`}var Je=t(80030);const He=(0,P.forwardRef)((v,x)=>{const{entityRef:R,defaultKind:Z,title:J,children:K,...oe}=v,he=(0,n.tg)(Te);let Se,$e,De;if(typeof R=="string"){const _e=(0,S.of)(R);Se=_e.kind,$e=_e.namespace,De=_e.name}else"metadata"in R?(Se=R.kind,$e=R.metadata.namespace,De=R.metadata.name):(Se=R.kind,$e=R.namespace,De=R.name);Se=Se.toLocaleLowerCase("en-US");var we;$e=(we=$e==null?void 0:$e.toLocaleLowerCase("en-US"))!==null&&we!==void 0?we:S.zG;const Ve={kind:Se,namespace:$e,name:De},it=Xe({kind:Se,namespace:$e,name:De},{defaultKind:Z}),Ct=(0,l.jsxs)(T.rU,{...oe,ref:x,to:he(Ve),children:[K,!K&&(J!=null?J:it)]});return J?(0,l.jsx)(Je.ZP,{title:it,children:Ct}):Ct});var gt=t(64279);function Ee(v){const{entityRefs:x,defaultKind:R,getTitle:Z,...J}=v,K=(0,n.h_)(W),{value:oe=new Array,loading:he,error:Se}=(0,gt.default)(async()=>{const $e=x.reduce((we,Ve)=>"metadata"in Ve?we:[...we,(0,S.of)(Ve)],new Array),De=x.filter(we=>"metadata"in we);return $e.length>0?[...(await K.getEntities({filter:$e.map(we=>({kind:we.kind,"metadata.namespace":we.namespace,"metadata.name":we.name}))})).items,...De]:De},[x]);return he?(0,l.jsx)(T.Ex,{}):Se?(0,l.jsx)(T.yu,{error:Se}):(0,l.jsx)(l.Fragment,{children:oe.map(($e,De)=>(0,l.jsxs)(P.Fragment,{children:[De>0&&", ",(0,l.jsx)(He,{...J,defaultKind:R,entityRef:$e,title:Z($e)})]},De))})}function Ke(v){const{entityRefs:x,defaultKind:R,fetchEntities:Z,getTitle:J,...K}=v;return Z?(0,l.jsx)(Ee,{...K,defaultKind:R,entityRefs:x,getTitle:J}):(0,l.jsx)(l.Fragment,{children:x.map((oe,he)=>(0,l.jsxs)(P.Fragment,{children:[he>0&&", ",(0,l.jsx)(He,{...K,defaultKind:R,entityRef:oe,title:J?J(oe):void 0})]},he))})}function st(v){return v.reduce((x,R)=>({...x,...R.getCatalogFilters?R.getCatalogFilters():{}}),{})}function mt(v){return x=>v.every(R=>!R.filterEntity||R.filterEntity(x))}function rt(v,x,R){var Z;let J=(v==null||(Z=v.relations)===null||Z===void 0?void 0:Z.filter(K=>K.type===x).map(K=>(0,S.of)(K.targetRef)))||[];return R!=null&&R.kind&&(J=J.filter(K=>K.kind.toLocaleLowerCase("en-US")===R.kind.toLocaleLowerCase("en-US"))),J}function ot(v,x){var R;const Z=(R=v.metadata.annotations)===null||R===void 0?void 0:R[S.M6];if(!!Z)try{const J=(0,S.Ou)(Z),K=x.byUrl(J.target);return{locationTargetUrl:J.target,integrationType:K==null?void 0:K.type}}catch{return}}function ut(v,x){const R=new Set([...getEntityRelations(v,RELATION_MEMBER_OF,{kind:"group"}),...v?[getCompoundEntityRef(v)]:[]].map(stringifyEntityRef)),Z=getEntityRelations(x,RELATION_OWNED_BY).map(stringifyEntityRef);for(const J of Z)if(R.has(J))return!0;return!1}class xt{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(x){this.value=x}}class Rt{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(x){this.value=x}}class We{filterEntity(x){var R;return this.values.every(Z=>((R=x.metadata.tags)!==null&&R!==void 0?R:[]).includes(Z))}toQueryValue(){return this.values}constructor(x){this.values=x}}class se{filterEntity(x){const R=this.toUpperArray(this.value.split(/\s/)),Z=this.toUpperArray([x.metadata.tags]),J=this.toUpperArray([x.metadata.name,x.metadata.title]);for(const K of R)if(Z.every(oe=>oe!==K)&&J.every(oe=>!oe.includes(K)))return!1;return!0}toUpperArray(x){return x.flat().filter(R=>Boolean(R)).map(R=>R.toLocaleUpperCase("en-US"))}constructor(x){this.value=x}}class Ie{filterEntity(x){return this.values.some(R=>rt(x,S.S4).some(Z=>Xe(Z,{defaultKind:"group"})===R))}toQueryValue(){return this.values}constructor(x){this.values=x}}class Re{filterEntity(x){return this.values.some(R=>{var Z;return((Z=x.spec)===null||Z===void 0?void 0:Z.lifecycle)===R})}toQueryValue(){return this.values}constructor(x){this.values=x}}class tt{filterEntity(x){switch(this.value){case"owned":return this.isOwnedEntity(x);case"starred":return this.isStarredEntity(x);default:return!0}}toQueryValue(){return this.value}constructor(x,R,Z){this.value=x,this.isOwnedEntity=R,this.isStarredEntity=Z}}class vt{filterEntity(x){var R;const Z=(R=x.metadata.annotations)===null||R===void 0?void 0:R["backstage.io/orphan"];return Z!==void 0&&this.value.toString()===Z}constructor(x){this.value=x}}class $t{filterEntity(x){var R,Z;const J=(x==null||(R=x.status)===null||R===void 0||(Z=R.items)===null||Z===void 0?void 0:Z.length)>0;return J!==void 0&&this.value===J}constructor(x){this.value=x}}const pt=(0,q.CT)("entity-context"),Et=({children:v,entity:x,loading:R,error:Z,refresh:J})=>{const K={entity:x,loading:R,error:Z,refresh:J};return(0,l.jsx)(pt.Provider,{value:(0,q.EI)({1:K}),children:(0,l.jsx)(n.fC,{attributes:{...x?{entityRef:(0,S.eE)(x)}:void 0},children:v})})},At=v=>_jsx(Et,{entity:v.entity,loading:!Boolean(v.entity),error:void 0,refresh:void 0,children:v.children});function kt(){const v=(0,q.Vt)("entity-context");if(!v)throw new Error("Entity context is not available");const x=v.atVersion(1);if(!x)throw new Error("EntityContext v1 not available");if(!x.entity)throw new Error("useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.");return{entity:x.entity}}function Xt(){const v=(0,q.Vt)("entity-context");if(!v)throw new Error("Entity context is not available");const x=v.atVersion(1);if(!x)throw new Error("EntityContext v1 not available");const{entity:R,loading:Z,error:J,refresh:K}=x;return{entity:R,loading:Z,error:J,refresh:K}}var Wt=t(76635),Vt=t(19126),Yt=t.n(Vt),cn=t(73557),on=t(69294),Zn=t(48760),bn=t(90736);const Dn=(0,P.createContext)(void 0),pn=({children:v})=>{const x=(0,bn.default)(),R=(0,n.h_)(W),[Z,J]=(0,P.useState)({}),K=(0,cn.TH)();var oe;const he=(0,P.useMemo)(()=>(oe=Yt().parse(K.search,{ignoreQueryPrefix:!0}).filters)!==null&&oe!==void 0?oe:{},[K]),[Se,$e]=(0,P.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:De,error:we},Ve]=(0,on.default)(async()=>{const _e=(0,Wt.compact)(Object.values(Z)),Zt=mt(_e),qt=st(_e),dr=st((0,Wt.compact)(Object.values(Se.appliedFilters))),Vn=Object.keys(Z).reduce((xn,jn)=>{const En=Z[jn];return En!=null&&En.toQueryValue&&(xn[jn]=En.toQueryValue()),xn},{});if((0,Wt.isEqual)(dr,qt))$e({appliedFilters:Z,backendEntities:Se.backendEntities,entities:Se.backendEntities.filter(Zt)});else{const xn=await R.getEntities({filter:qt});$e({appliedFilters:Z,backendEntities:xn.items,entities:xn.items.filter(Zt)})}if(x()){var sr;const xn=Yt().parse(K.search,{ignoreQueryPrefix:!0}),jn=Yt().stringify({...xn,filters:Vn},{addQueryPrefix:!0,arrayFormat:"repeat"}),En=`${window.location.pathname}${jn}`;(sr=window.history)===null||sr===void 0||sr.replaceState(null,document.title,En)}},[R,he,Z,Se],{loading:!0});(0,Zn.Z)(Ve,10,[Z]);const it=(0,P.useCallback)(_e=>{J(Zt=>{const qt=typeof _e=="function"?_e(Zt):_e;return{...Zt,...qt}})},[]),Ct=(0,P.useMemo)(()=>({filters:Se.appliedFilters,entities:Se.entities,backendEntities:Se.backendEntities,updateFilters:it,queryParameters:he,loading:De,error:we}),[Se,it,he,De,we]);return(0,l.jsx)(Dn.Provider,{value:Ct,children:v})};function dn(){const v=(0,P.useContext)(Dn);if(!v)throw new Error("useEntityList must be used within EntityListProvider");return v}var Jt=t(18149),Nn=t.n(Jt),Fn=t(829),un=t.n(Fn);function fn(){const v=(0,n.h_)(W),{filters:{kind:x,type:R},queryParameters:{type:Z},updateFilters:J}=dn(),K=(0,P.useMemo)(()=>[Z].flat().filter(Boolean),[Z]);var oe;const[he,Se]=(0,P.useState)(K.length?K:(oe=R==null?void 0:R.getTypes())!==null&&oe!==void 0?oe:[]);(0,P.useEffect)(()=>{K.length&&Se(K)},[K]);const[$e,De]=(0,P.useState)([]),we=(0,P.useMemo)(()=>x==null?void 0:x.value,[x]),{error:Ve,loading:it,value:Ct}=(0,gt.default)(async()=>we?await v.getEntityFacets({filter:{kind:we},facets:["spec.type"]}).then(qt=>qt.facets["spec.type"]||[]):[],[we,v]),_e=(0,P.useRef)(Ct);return(0,P.useEffect)(()=>{const Zt=_e.current;if(_e.current=Ct,it||!we||Zt===Ct||!Ct)return;const qt=[...new Set(un()(Ct,Vn=>-Vn.count).map(Vn=>Vn.value.toLocaleLowerCase("en-US")))];De(qt);const dr=he.filter(Vn=>qt.includes(Vn));Nn()(he,dr)||Se(dr)},[it,we,he,Se,Ct]),(0,P.useEffect)(()=>{J({type:he.length?new Rt(he):void 0})},[he,J]),{loading:it,error:Ve,availableTypes:$e,selectedTypes:he,setSelectedTypes:Se}}const gn=20;function In(v,x){var R,Z;const J=x==null||(R=x.type)===null||R===void 0?void 0:R.toLocaleLowerCase("en-US"),K=x==null||(Z=x.kind)===null||Z===void 0?void 0:Z.toLocaleLowerCase("en-US"),oe=(0,n.h_)(W),{loading:he,value:Se,error:$e}=(0,gt.default)(async()=>{var De;const we=(De=v.relations)===null||De===void 0?void 0:De.map(_e=>({type:_e.type,target:(0,S.of)(_e.targetRef)})).filter(_e=>(!J||_e.type.toLocaleLowerCase("en-US")===J)&&(!K||_e.target.kind===K));if(!we)return[];const Ve=Object.values((0,Wt.groupBy)(we,({target:_e})=>`${_e.kind}:${_e.namespace}`.toLocaleLowerCase("en-US"))),it=[];for(const _e of Ve)it.push({kind:_e[0].target.kind,namespace:_e[0].target.namespace,nameBatches:(0,Wt.chunk)(_e.map(Zt=>Zt.target.name),gn)});return(await Promise.all(it.flatMap(_e=>_e.nameBatches.map(Zt=>oe.getEntities({filter:{kind:_e.kind,"metadata.namespace":_e.namespace,"metadata.name":Zt}}))))).flatMap(_e=>_e.items)},[v,J,K]);return{entities:Se,loading:he,error:$e}}var Rn=t(72164);function mn(v){return typeof v=="string"?v:(0,S.eE)(v)}function ge(){const v=(0,n.h_)($),x=(0,Rn.Z)(v.starredEntitie$(),new Set),R=(0,P.useCallback)(J=>x.has(mn(J)),[x]),Z=(0,P.useCallback)(J=>v.toggleStarred(mn(J)).then(),[v]);return{starredEntities:x,toggleStarredEntity:Z,isStarredEntity:R}}function ee(v){return typeof v=="string"?v:(0,S.eE)(v)}function Ae(v){const x=(0,n.h_)($),[R,Z]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{const K=x.starredEntitie$().subscribe({next(oe){Z(oe.has(ee(v)))}});return()=>{K.unsubscribe()}},[v,x]),{toggleStarredEntity:(0,P.useCallback)(()=>x.toggleStarred(ee(v)).then(),[v,x]),isStarredEntity:R}}function Fe(){const v=(0,n.h_)(n.$4),{loading:x,value:R}=(0,gt.default)(async()=>{const{ownershipEntityRefs:J}=await v.getBackstageIdentity();return J},[]),Z=(0,P.useMemo)(()=>{const J=new Set(R!=null?R:[]);return K=>{const oe=rt(K,S.S4).map(S.eE);for(const he of oe)if(J.has(he))return!0;return!1}},[R]);return(0,P.useMemo)(()=>({loading:x,isOwnedEntity:Z}),[x,Z])}var qe=t(25488);function bt(v){const{entity:x,loading:R,error:Z}=Xt(),{allowed:J,loading:K,error:oe}=(0,qe.gI)({permission:v,resourceRef:x?(0,S.eE)(x):void 0});return R||K?{loading:!0,allowed:!1}:Z?{loading:!1,allowed:!1,error:Z}:{loading:!1,allowed:J,error:oe}}function ie(){const v=(0,n.h_)(W),{error:x,loading:R,value:Z}=(0,gt.default)(async()=>await v.getEntityFacets({facets:["kind"]}).then(K=>{var oe;return((oe=K.facets.kind)===null||oe===void 0?void 0:oe.map(he=>he.value).sort())||[]}),[v]);return{loading:R,error:x,allKinds:Z!=null?Z:[]}}function k(v,x,R){let Z=v;return x&&(Z=Z.filter(K=>x.some(oe=>oe.toLocaleLowerCase("en-US")===K.toLocaleLowerCase("en-US")))),R&&!v.some(K=>K.toLocaleLowerCase("en-US")===R.toLocaleLowerCase("en-US"))&&(Z=Z.concat([R])),Z.sort().reduce((K,oe)=>(K[oe.toLocaleLowerCase("en-US")]=oe,K),{})}function ce(v){var x;const{filters:R,queryParameters:{kind:Z},updateFilters:J}=dn(),K=(0,P.useMemo)(()=>[Z].flat()[0],[Z]);var oe;const[he,Se]=(0,P.useState)((oe=K!=null?K:(x=R.kind)===null||x===void 0?void 0:x.value)!==null&&oe!==void 0?oe:v.initialFilter);(0,P.useEffect)(()=>{K&&Se(K)},[K]),(0,P.useEffect)(()=>{var Ve;if(!((Ve=R.kind)===null||Ve===void 0)&&Ve.value){var it;Se((it=R.kind)===null||it===void 0?void 0:it.value)}},[R.kind]),(0,P.useEffect)(()=>{J({kind:he?new xt(he):void 0})},[he,J]);const{allKinds:$e,loading:De,error:we}=ie();return{loading:De,error:we,allKinds:$e!=null?$e:[],selectedKind:he,setSelectedKind:Se}}const Be=v=>{const{allowedKinds:x,hidden:R,initialFilter:Z="component"}=v,J=(0,n.h_)(n.$v),{error:K,allKinds:oe,selectedKind:he,setSelectedKind:Se}=ce({initialFilter:Z});if((0,P.useEffect)(()=>{K&&J.post({message:"Failed to load entity kinds",severity:"error"})},[K,J]),K)return null;const $e=k(oe,x,he),De=Object.keys($e).map(we=>({value:we,label:$e[we]}));return R?null:(0,l.jsx)(z.Z,{pb:1,pt:1,children:(0,l.jsx)(T.Ph,{label:"Kind",items:De,selected:he.toLocaleLowerCase("en-US"),onChange:we=>Se(String(we))})})};var D=t(79692),U=t(5806),de=t(21324),fe=t(86619),ye=t(19996),Pe=t(25505),Le=t(38016),Me=t(88013);const nt=(0,D.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),C=(0,l.jsx)(Pe.Z,{fontSize:"small"}),H=(0,l.jsx)(ye.Z,{fontSize:"small"}),me=()=>{var v;const x=nt(),{updateFilters:R,backendEntities:Z,filters:J,queryParameters:{lifecycles:K}}=dn(),oe=(0,P.useMemo)(()=>[K].flat().filter(Boolean),[K]);var he;const[Se,$e]=(0,P.useState)(oe.length?oe:(he=(v=J.lifecycles)===null||v===void 0?void 0:v.values)!==null&&he!==void 0?he:[]);(0,P.useEffect)(()=>{oe.length&&$e(oe)},[oe]),(0,P.useEffect)(()=>{R({lifecycles:Se.length?new Re(Se):void 0})},[Se,R]);const De=(0,P.useMemo)(()=>[...new Set(Z.map(we=>{var Ve;return(Ve=we.spec)===null||Ve===void 0?void 0:Ve.lifecycle}).filter(Boolean))].sort(),[Z]);return De.length?(0,l.jsx)(z.Z,{pb:1,pt:1,children:(0,l.jsxs)(_.Z,{variant:"button",component:"label",children:["Lifecycle",(0,l.jsx)(Me.ZP,{multiple:!0,options:De,value:Se,onChange:(we,Ve)=>$e(Ve),renderOption:(we,{selected:Ve})=>(0,l.jsx)(U.Z,{control:(0,l.jsx)(de.Z,{icon:C,checkedIcon:H,checked:Ve}),label:we}),size:"small",popupIcon:(0,l.jsx)(Le.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:we=>(0,l.jsx)(fe.Z,{...we,className:x.input,variant:"outlined"})})]})}):null},ue=(0,D.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),Ce=(0,l.jsx)(Pe.Z,{fontSize:"small"}),ke=(0,l.jsx)(ye.Z,{fontSize:"small"}),Ue=()=>{var v;const x=ue(),{updateFilters:R,backendEntities:Z,filters:J,queryParameters:{owners:K}}=dn(),oe=(0,P.useMemo)(()=>[K].flat().filter(Boolean),[K]);var he;const[Se,$e]=(0,P.useState)(oe.length?oe:(he=(v=J.owners)===null||v===void 0?void 0:v.values)!==null&&he!==void 0?he:[]);(0,P.useEffect)(()=>{oe.length&&$e(oe)},[oe]),(0,P.useEffect)(()=>{R({owners:Se.length?new Ie(Se):void 0})},[Se,R]);const De=(0,P.useMemo)(()=>[...new Set(Z.flatMap(we=>rt(we,S.S4).map(Ve=>Xe(Ve,{defaultKind:"group"}))).filter(Boolean))].sort(),[Z]);return De.length?(0,l.jsx)(z.Z,{pb:1,pt:1,children:(0,l.jsxs)(_.Z,{variant:"button",component:"label",children:["Owner",(0,l.jsx)(Me.ZP,{multiple:!0,options:De,value:Se,onChange:(we,Ve)=>$e(Ve),renderOption:(we,{selected:Ve})=>(0,l.jsx)(U.Z,{control:(0,l.jsx)(de.Z,{icon:Ce,checkedIcon:ke,checked:Ve}),label:we}),size:"small",popupIcon:(0,l.jsx)(Le.Z,{"data-testid":"owner-picker-expand"}),renderInput:we=>(0,l.jsx)(fe.Z,{...we,className:x.input,variant:"outlined"})})]})}):null},lt=(0,D.Z)(v=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),St=()=>{var v;const x=lt(),{filters:R,updateFilters:Z}=useEntityList();var J;const[K,oe]=useState((J=(v=R.text)===null||v===void 0?void 0:v.value)!==null&&J!==void 0?J:"");return useDebounce(()=>{Z({text:K.length?new EntityTextFilter(K):void 0})},250,[K,Z]),_jsx(Toolbar,{className:x.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:x.input,placeholder:"Search",autoComplete:"off",onChange:he=>oe(he.target.value),value:K,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>oe(""),edge:"end",disabled:K.length===0,children:_jsx(Clear,{})})})})})})},Ye=Object.freeze({createEntityRefColumn(v){const{defaultKind:x}=v;function R(Z){var J;return((J=Z.metadata)===null||J===void 0?void 0:J.title)||Xe(Z,{defaultKind:x})}return{title:"Name",highlight:!0,customFilterAndSearch(Z,J){return R(J).includes(Z)},customSort(Z,J){return R(Z).localeCompare(R(J))},render:Z=>{var J;return(0,l.jsx)(He,{entityRef:Z,defaultKind:x,title:(J=Z.metadata)===null||J===void 0?void 0:J.title})}}},createEntityRelationColumn(v){const{title:x,relation:R,defaultKind:Z,filter:J}=v;function K(he){return rt(he,R,J)}function oe(he){return K(he).map(Se=>Xe(Se,{defaultKind:Z})).join(", ")}return{title:x,customFilterAndSearch(he,Se){return oe(Se).includes(he)},customSort(he,Se){return oe(he).localeCompare(oe(Se))},render:he=>(0,l.jsx)(Ke,{entityRefs:K(he),defaultKind:Z})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:S.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:S.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:S.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:v=>(0,l.jsx)(T.Or,{text:v.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),ft=[Ye.createEntityRefColumn({defaultKind:"system"}),Ye.createDomainColumn(),Ye.createOwnerColumn(),Ye.createMetadataDescriptionColumn()],yt=[Ye.createEntityRefColumn({defaultKind:"component"}),Ye.createSystemColumn(),Ye.createOwnerColumn(),Ye.createSpecTypeColumn(),Ye.createSpecLifecycleColumn(),Ye.createMetadataDescriptionColumn()],ct=(0,D.Z)(v=>({empty:{padding:v.spacing(2),display:"flex",justifyContent:"center"}})),Tt=v=>{const{entities:x,title:R,emptyContent:Z,variant:J="gridItem",columns:K}=v,oe=ct(),he={minWidth:"0",width:"100%"};return J==="gridItem"&&(he.height="calc(100% - 10px)"),(0,l.jsx)(T.iA,{columns:K,title:R,style:he,emptyContent:Z&&(0,l.jsx)("div",{className:oe.empty,children:Z}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:x})};Tt.columns=Ye,Tt.systemEntityColumns=ft,Tt.componentEntityColumns=yt;const Nt=(0,D.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),Ft=(0,l.jsx)(Pe.Z,{fontSize:"small"}),Un=(0,l.jsx)(ye.Z,{fontSize:"small"}),Mn=v=>{var x;const R=Nt(),{updateFilters:Z,filters:J,queryParameters:{tags:K}}=dn(),oe=(0,n.h_)(W),{value:he}=(0,gt.default)(async()=>{var Ve;const it="metadata.tags",{facets:Ct}=await oe.getEntityFacets({facets:[it],filter:(Ve=J.kind)===null||Ve===void 0?void 0:Ve.getCatalogFilters()});return Object.fromEntries(Ct[it].map(({value:_e,count:Zt})=>[_e,Zt]))},[J.kind]),Se=(0,P.useMemo)(()=>[K].flat().filter(Boolean),[K]);var $e;const[De,we]=(0,P.useState)(Se.length?Se:($e=(x=J.tags)===null||x===void 0?void 0:x.values)!==null&&$e!==void 0?$e:[]);return(0,P.useEffect)(()=>{Se.length&&we(Se)},[Se]),(0,P.useEffect)(()=>{Z({tags:De.length?new We(De):void 0})},[De,Z]),Object.keys(he!=null?he:{}).length?(0,l.jsx)(z.Z,{pb:1,pt:1,children:(0,l.jsxs)(_.Z,{variant:"button",component:"label",children:["Tags",(0,l.jsx)(Me.ZP,{multiple:!0,options:Object.keys(he!=null?he:{}),value:De,onChange:(Ve,it)=>we(it),renderOption:(Ve,{selected:it})=>(0,l.jsx)(U.Z,{control:(0,l.jsx)(de.Z,{icon:Ft,checkedIcon:Un,checked:it}),label:v.showCounts?`${Ve} (${he==null?void 0:he[Ve]})`:Ve}),size:"small",popupIcon:(0,l.jsx)(Le.Z,{"data-testid":"tag-picker-expand"}),renderInput:Ve=>(0,l.jsx)(fe.Z,{...Ve,className:R.input,variant:"outlined"})})]})}):null},Sn=v=>{const{hidden:x,initialFilter:R}=v,Z=(0,n.h_)(n.$v),{error:J,availableTypes:K,selectedTypes:oe,setSelectedTypes:he}=fn();if((0,P.useEffect)(()=>{J&&Z.post({message:"Failed to load entity types",severity:"error"}),R&&he([R])},[J,Z,R,he]),K.length===0||J)return null;const Se=[{value:"all",label:"all"},...K.map(De=>({value:De,label:De}))];var $e;return x?null:(0,l.jsx)(z.Z,{pb:1,pt:1,children:(0,l.jsx)(T.Ph,{label:"Type",items:Se,selected:($e=Se.length>1?oe[0]:void 0)!==null&&$e!==void 0?$e:"all",onChange:De=>he(De==="all"?[]:[String(De)])})})};var Ut=t(15459),Mt=t(61837),an=t(11640),Cn=t(28347);const Jn=(0,Ut.Z)({root:{color:"#f3ba37"}})(an.Z),vn=v=>{const{toggleStarredEntity:x,isStarredEntity:R}=Ae(v.entity);return(0,l.jsx)(Mt.Z,{"aria-label":"favorite",color:"inherit",...v,onClick:()=>x(),children:(0,l.jsx)(Je.ZP,{title:R?"Remove from favorites":"Add to favorites",children:R?(0,l.jsx)(Jn,{}):(0,l.jsx)(Cn.Z,{})})})};var Ln=t(8629),zn=t(79249),tn=t(38724),yn=t(99152),Hn=t(6487),w=t(49429),d=t(55999),y=t(72779),j=t.n(y),Y=t(39412);const ve=Y.Z;function be(v,x){if(v)return v.toLocaleLowerCase("en-US");if(x)try{return(0,S.of)(x).kind.toLocaleLowerCase("en-US")}catch{return}}function Ne(v,x){const R=(0,n.qD)(),Z=be(v,x);return Z&&R.getSystemIcon(`kind:${Z}`)||ve}function dt(v){const{kind:x,entityRef:R,...Z}=v,J=Ne(x,R);return(0,l.jsx)(J,{...Z})}const Dt=(0,D.Z)(v=>({node:{fill:v.palette.grey[300],stroke:v.palette.grey[300],"&.primary":{fill:v.palette.primary.light,stroke:v.palette.primary.light},"&.secondary":{fill:v.palette.secondary.light,stroke:v.palette.secondary.light}},text:{fill:v.palette.getContrastText(v.palette.grey[300]),"&.primary":{fill:v.palette.primary.contrastText},"&.secondary":{fill:v.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function nn(v){const x=(0,n.h_)(W),R=(0,S.eE)(v),{loading:Z,error:J,value:K}=(0,gt.default)(async()=>{const oe=await x.getEntityAncestors({entityRef:R}),he=new Array,Se=new Array;for(const $e of oe.items){const De=(0,S.eE)($e.entity),we=De===oe.rootEntityRef;he.push({id:De,root:we,...$e.entity});for(const Ve of $e.parentEntityRefs)Se.push({from:De,to:Ve})}return{nodes:he,edges:Se}},[R]);return{loading:Z,error:J,nodes:(K==null?void 0:K.nodes)||[],edges:(K==null?void 0:K.edges)||[]}}function Qn({node:v}){const x=Dt(),R=(0,cn.s0)(),Z=(0,n.tg)(Te),[J,K]=(0,P.useState)(0),[oe,he]=(0,P.useState)(0),Se=(0,P.useRef)(null);(0,P.useLayoutEffect)(()=>{if(Se.current){let{height:Zt,width:qt}=Se.current.getBBox();Zt=Math.round(Zt),qt=Math.round(qt),(Zt!==oe||qt!==J)&&(K(qt),he(Zt))}},[J,oe]);const $e=10,De=oe,we=De+$e,Ve=we+J+$e*2,it=oe+$e*2,Ct=v.metadata.title||(v.kind&&v.metadata.name&&v.metadata.namespace?Xe({kind:v.kind,name:v.metadata.name,namespace:v.metadata.namespace||""}):v.id),_e=()=>{R(Z({kind:v.kind,namespace:v.metadata.namespace||S.zG,name:v.metadata.name}))};return(0,l.jsxs)("g",{onClick:_e,className:x.clickable,children:[(0,l.jsx)("rect",{className:j()(x.node,v.root?"secondary":"primary"),width:Ve,height:it,rx:10}),(0,l.jsx)(dt,{kind:v.kind,y:$e,x:$e,width:De,height:De,className:j()(x.text,v.root?"secondary":"primary")}),(0,l.jsx)("text",{ref:Se,className:j()(x.text,v.root?"secondary":"primary"),y:it/2,x:we+(J+$e*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:Ct})]})}function $r(v){const{loading:x,error:R,nodes:Z,edges:J}=nn(v.entity);return x?(0,l.jsx)(T.Ex,{}):R?(0,l.jsx)(T.Gk,{error:R}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(d.Z,{variant:"h2",children:"Ancestry"}),(0,l.jsxs)(d.Z,{gutterBottom:!0,children:["This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where"," ",(0,l.jsx)(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,l.jsx)(z.Z,{mt:4,children:(0,l.jsx)(T.mn,{nodes:Z,edges:J,renderNode:Qn,direction:T.NX.Nm.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var nr=t(11776),Xn=t(38402),pr=t(86136),rr=t(99688),Zr=t(49378),ls=t(54506),fr=t(94339),cs=t(24579),Kr=t(27685);const gr=(0,D.Z)(v=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:v.spacing(2)},helpIcon:{marginLeft:v.spacing(1),color:v.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function tr(v){const x=gr();return(0,l.jsx)(Zr.Z,{...v,primaryTypographyProps:{className:x.monospace},secondaryTypographyProps:{className:x.monospace}})}function jr(v){const x=gr();return(0,l.jsx)(ls.Z,{className:x.monospace,children:v.children})}function Dr(v){return(0,l.jsx)(z.Z,{mt:2,children:(0,l.jsx)(fr.Z,{variant:"outlined",children:(0,l.jsxs)(cs.Z,{children:[(0,l.jsxs)(_.Z,{variant:"h6",gutterBottom:!0,children:[v.title,v.helpLink&&(0,l.jsx)(Nr,{to:v.helpLink})]}),v.children]})})})}function ds(v){if(v.match(/^url:https?:\/\//))return v.slice(4);if(v.match(/^https?:\/\//))return v}function Er(v){const[x,R]=v.entry,Z=ds(R);return(0,l.jsxs)(Xn.Z,{children:[v.indent&&(0,l.jsx)(pr.Z,{}),(0,l.jsx)(tr,{primary:x,secondary:Z?(0,l.jsx)(T.rU,{to:Z,children:R}):R})]})}function Nr(v){const x=gr();return(0,l.jsx)(T.rU,{to:v.to,className:x.helpIcon,children:(0,l.jsx)(Kr.Z,{fontSize:"inherit"})})}const Yr=(0,D.Z)({root:{display:"flex",flexDirection:"column"}});function Wn(v){var x,R;const Z=(0,n.h_)(W),J=(0,S.eE)(v),K=(x=v.metadata.annotations)===null||x===void 0?void 0:x[S.P1],oe=(R=v.metadata.annotations)===null||R===void 0?void 0:R[S.q1],{loading:he,error:Se,value:$e}=(0,gt.default)(async()=>!K&&!oe?[]:(await Z.getEntities({filter:[...K?[{[`metadata.annotations.${S.P1}`]:K}]:[],...oe?[{[`metadata.annotations.${S.q1}`]:oe}]:[]]})).items,[K,oe]);return{loading:he,error:Se,location:K,originLocation:oe,colocatedEntities:$e==null?void 0:$e.filter(De=>(0,S.eE)(De)!==J)}}function Fr(v){return(0,l.jsxs)(nr.Z,{dense:!0,children:[v.header&&(0,l.jsx)(Er,{entry:v.header},"header"),v.entities.map(x=>(0,l.jsxs)(Xn.Z,{children:[(0,l.jsx)(pr.Z,{children:(0,l.jsx)(dt,{kind:x.kind})}),(0,l.jsx)(tr,{primary:(0,l.jsx)(He,{entityRef:x})})]},(0,S.eE)(x)))]})}function Ar(v){const{entity:x}=v,{loading:R,error:Z,location:J,originLocation:K,colocatedEntities:oe}=Wn(x);if(R)return(0,l.jsx)(T.Ex,{});if(Z)return(0,l.jsx)(T.Gk,{error:Z});if(!J&&!K)return(0,l.jsx)(rr.Z,{severity:"warning",children:"Entity had no location information."});if(!(oe!=null&&oe.length))return(0,l.jsx)(rr.Z,{severity:"info",children:"There were no other entities on this location."});if(J===K)return(0,l.jsx)(Fr,{entities:oe});const he=oe.filter($e=>{var De;return((De=$e.metadata.annotations)===null||De===void 0?void 0:De[S.P1])===J}),Se=oe.filter($e=>{var De;return((De=$e.metadata.annotations)===null||De===void 0?void 0:De[S.q1])===K});return(0,l.jsxs)(l.Fragment,{children:[he.length>0&&(0,l.jsx)(Fr,{entities:he,header:["At the same location",J]}),Se.length>0&&(0,l.jsx)(Fr,{entities:Se,header:["At the same origin",K]})]})}function Jr(v){const x=Yr();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(d.Z,{variant:"h2",children:"Colocated"}),(0,l.jsx)(d.Z,{children:"These are the entities that are colocated with this entity - as in, they originated from the same data source (e.g. came from the same YAML file), or from the same origin (e.g. the originally registered URL)."}),(0,l.jsx)("div",{className:x.root,children:(0,l.jsx)(Ar,{entity:v.entity})})]})}function Ur(v){return Object.fromEntries([...Object.entries(v)].sort((x,R)=>x[0]<R[0]?-1:1))}function us(v){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(d.Z,{variant:"h2",children:"Entity as JSON"}),(0,l.jsx)(d.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,l.jsx)(d.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)(T.Oi,{text:JSON.stringify(Ur(v.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var Zs=t(3440),hs=t.n(Zs);const Ds=(0,D.Z)({root:{display:"flex",flexDirection:"column"}});function ps(v){var x,R;const Z=Ds(),{apiVersion:J,kind:K,metadata:oe,spec:he,relations:Se=[],status:$e={}}=v.entity,De=hs()(un()(Se,we=>we.targetRef),"type");return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(d.Z,{variant:"h2",children:"Overview"}),(0,l.jsxs)("div",{className:Z.root,children:[(0,l.jsx)(Dr,{title:"Identity",children:(0,l.jsxs)(nr.Z,{dense:!0,children:[(0,l.jsx)(Xn.Z,{children:(0,l.jsx)(tr,{primary:"apiVersion",secondary:J})}),(0,l.jsx)(Xn.Z,{children:(0,l.jsx)(tr,{primary:"kind",secondary:K})}),(he==null?void 0:he.type)&&(0,l.jsx)(Xn.Z,{children:(0,l.jsx)(tr,{primary:"spec.type",secondary:he.type})}),oe.uid&&(0,l.jsx)(Xn.Z,{children:(0,l.jsx)(tr,{primary:"uid",secondary:oe.uid})}),oe.etag&&(0,l.jsx)(Xn.Z,{children:(0,l.jsx)(tr,{primary:"etag",secondary:oe.etag})})]})}),(0,l.jsxs)(Dr,{title:"Metadata",children:[!!Object.keys(oe.annotations||{}).length&&(0,l.jsx)(nr.Z,{dense:!0,subheader:(0,l.jsxs)(jr,{children:["Annotations",(0,l.jsx)(Nr,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(oe.annotations).map(we=>(0,l.jsx)(Er,{indent:!0,entry:we},we[0]))}),!!Object.keys(oe.labels||{}).length&&(0,l.jsx)(nr.Z,{dense:!0,subheader:(0,l.jsx)(jr,{children:"Labels"}),children:Object.entries(oe.labels).map(we=>(0,l.jsx)(Er,{indent:!0,entry:we},we[0]))}),!!(!((x=oe.tags)===null||x===void 0)&&x.length)&&(0,l.jsx)(nr.Z,{dense:!0,subheader:(0,l.jsx)(jr,{children:"Tags"}),children:oe.tags.map((we,Ve)=>(0,l.jsxs)(Xn.Z,{children:[(0,l.jsx)(pr.Z,{}),(0,l.jsx)(tr,{primary:we})]},`${we}-${Ve}`))})]}),!!Se.length&&(0,l.jsx)(Dr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(De).map(([we,Ve],it)=>(0,l.jsx)("div",{children:(0,l.jsx)(nr.Z,{dense:!0,subheader:(0,l.jsx)(jr,{children:we}),children:Ve.map(Ct=>(0,l.jsxs)(Xn.Z,{children:[(0,l.jsx)(pr.Z,{children:(0,l.jsx)(dt,{entityRef:Ct.targetRef})}),(0,l.jsx)(tr,{primary:(0,l.jsx)(He,{entityRef:Ct.targetRef})})]},Ct.targetRef))})},it))}),!!(!((R=$e.items)===null||R===void 0)&&R.length)&&(0,l.jsx)(Dr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:$e.items.map((we,Ve)=>(0,l.jsxs)("div",{children:[(0,l.jsxs)(_.Z,{children:[we.level,": ",we.type]}),(0,l.jsx)(z.Z,{ml:2,children:we.message})]},Ve))})]})]})}var Qr=t(72847);function fs(v){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(d.Z,{variant:"h2",children:"Entity as YAML"}),(0,l.jsx)(d.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,l.jsx)(d.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)(T.Oi,{text:Qr.ZP.stringify(Ur(v.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const Mr=(0,D.Z)(v=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:v.palette.background.paper},tabs:{borderRight:`1px solid ${v.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function mr(v){const{children:x,value:R,index:Z,...J}=v,K=Mr();return(0,l.jsx)("div",{role:"tabpanel",hidden:R!==Z,id:`vertical-tabpanel-${Z}`,"aria-labelledby":`vertical-tab-${Z}`,className:K.tabContents,...J,children:R===Z&&(0,l.jsx)(z.Z,{pl:3,pr:3,children:x})})}function vr(v){return{id:`vertical-tab-${v}`,"aria-controls":`vertical-tabpanel-${v}`}}function zt(v){const x=Mr(),[R,Z]=P.useState(0);return(0,P.useEffect)(()=>{Z(0)},[v.open]),v.entity?(0,l.jsxs)(Ln.Z,{fullWidth:!0,maxWidth:"xl",open:v.open,onClose:v.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:x.fullHeightDialog},children:[(0,l.jsx)(zn.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,l.jsx)(tn.Z,{dividers:!0,children:(0,l.jsxs)("div",{className:x.root,children:[(0,l.jsxs)(yn.Z,{orientation:"vertical",variant:"scrollable",value:R,onChange:(J,K)=>Z(K),"aria-label":"Inspector options",className:x.tabs,children:[(0,l.jsx)(Hn.Z,{label:"Overview",...vr(0)}),(0,l.jsx)(Hn.Z,{label:"Ancestry",...vr(1)}),(0,l.jsx)(Hn.Z,{label:"Colocated",...vr(2)}),(0,l.jsx)(Hn.Z,{label:"Raw JSON",...vr(3)}),(0,l.jsx)(Hn.Z,{label:"Raw YAML",...vr(4)})]}),(0,l.jsx)(mr,{value:R,index:0,children:(0,l.jsx)(ps,{entity:v.entity})}),(0,l.jsx)(mr,{value:R,index:1,children:(0,l.jsx)($r,{entity:v.entity})}),(0,l.jsx)(mr,{value:R,index:2,children:(0,l.jsx)(Jr,{entity:v.entity})}),(0,l.jsx)(mr,{value:R,index:3,children:(0,l.jsx)(us,{entity:v.entity})}),(0,l.jsx)(mr,{value:R,index:4,children:(0,l.jsx)(fs,{entity:v.entity})})]})}),(0,l.jsx)(w.Z,{children:(0,l.jsx)(X.Z,{onClick:v.onClose,color:"primary",children:"Close"})})]}):null}var gs=t(85256);function Xr(v){var x;const R=(0,n.h_)(W),Z=(x=v.metadata.annotations)===null||x===void 0?void 0:x[S.q1],J=v.metadata.uid,K=Z==="bootstrap:bootstrap",oe=(0,gt.default)(async()=>{const Ct=R.getLocationByRef(Z);let _e;if(!Z)_e=Promise.resolve([]);else{const Zt=`metadata.annotations.${S.q1}`;_e=R.getEntities({filter:{[Zt]:Z},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(qt=>qt.items)}return Promise.all([Ct,_e]).then(([Zt,qt])=>({location:Zt,colocatedEntities:qt}))},[R,v]),he=(0,P.useCallback)(async function(){const{location:_e}=oe.value;await R.removeLocationById(_e.id)},[R,oe]),Se=(0,P.useCallback)(async function(){await R.removeEntityByUid(J)},[R,J]);if(K)return{type:"bootstrap",location:Z,deleteEntity:Se};const{loading:$e,error:De,value:we}=oe;if($e)return{type:"loading"};if(De)return{type:"error",error:De};const{location:Ve,colocatedEntities:it}=we;return Ve?{type:"unregister",location:Z,colocatedEntities:it.map(S.iB),unregisterLocation:he,deleteEntity:Se}:{type:"only-delete",deleteEntity:Se}}var qr=t(23054);const _r=(0,D.Z)({advancedButton:{fontSize:"0.7em"}}),wn=({entity:v,onConfirm:x})=>{const R=(0,n.h_)(n.$v),Z=(0,n.h_)(n.Ds),J=_r(),K=Xr(v),[oe,he]=(0,P.useState)(!1),[Se,$e]=(0,P.useState)(!1);var De;const we=(De=Z.getOptionalString("app.title"))!==null&&De!==void 0?De:"Backstage",Ve=(0,P.useCallback)(async function(){if("unregisterLocation"in K){$e(!0);try{await K.unregisterLocation(),x()}catch(_e){(0,qr.BD)(_e),R.post({message:_e.message})}finally{$e(!1)}}},[R,x,K]),it=(0,P.useCallback)(async function(){if("deleteEntity"in K){$e(!0);try{await K.deleteEntity(),x()}catch(_e){(0,qr.BD)(_e),R.post({message:_e.message})}finally{$e(!1)}}},[R,x,K]);return K.type==="loading"?(0,l.jsx)(T.Ex,{}):K.type==="error"?(0,l.jsx)(T.Gk,{error:K.error}):K.type==="bootstrap"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(rr.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',K.location,'"). If you believe this is in error, please contact the ',we," ","integrator."]}),(0,l.jsxs)(z.Z,{marginTop:2,children:[!oe&&(0,l.jsx)(X.Z,{variant:"text",size:"small",color:"primary",className:J.advancedButton,onClick:()=>he(!0),children:"Advanced Options"}),oe&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(d.Z,{children:"You have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,l.jsx)(X.Z,{variant:"contained",color:"secondary",disabled:Se,onClick:it,children:"Delete Entity"})]})]})]}):K.type==="only-delete"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(d.Z,{children:"This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog."}),(0,l.jsx)(X.Z,{variant:"contained",color:"secondary",disabled:Se,onClick:it,children:"Delete Entity"})]}):K.type==="unregister"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(d.Z,{children:"This action will unregister the following entities:"}),(0,l.jsx)(d.Z,{component:"ul",children:K.colocatedEntities.map(Ct=>(0,l.jsx)("li",{children:(0,l.jsx)(He,{entityRef:Ct})},`${Ct.kind}:${Ct.namespace}/${Ct.name}`))}),(0,l.jsx)(d.Z,{children:"Located at the following location:"}),(0,l.jsx)(d.Z,{component:"ul",children:(0,l.jsx)("li",{children:K.location})}),(0,l.jsxs)(d.Z,{children:["To undo, just re-register the entity in ",we,"."]}),(0,l.jsxs)(z.Z,{marginTop:2,children:[(0,l.jsx)(X.Z,{variant:"contained",color:"secondary",disabled:Se,onClick:Ve,children:"Unregister Location"}),!oe&&(0,l.jsx)(z.Z,{component:"span",marginLeft:2,children:(0,l.jsx)(X.Z,{variant:"text",size:"small",color:"primary",className:J.advancedButton,onClick:()=>he(!0),children:"Advanced Options"})})]}),oe&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(z.Z,{paddingTop:4,paddingBottom:4,children:(0,l.jsx)(gs.Z,{})}),(0,l.jsx)(d.Z,{children:"You also have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,l.jsx)(X.Z,{variant:"contained",color:"secondary",disabled:Se,onClick:it,children:"Delete Entity"})]})]}):(0,l.jsx)(rr.Z,{severity:"error",children:"Internal error: Unknown state"})},ms=v=>{const{open:x,onConfirm:R,onClose:Z,entity:J}=v;return(0,l.jsxs)(Ln.Z,{open:x,onClose:Z,children:[(0,l.jsx)(zn.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,l.jsx)(tn.Z,{children:(0,l.jsx)(wn,{entity:J,onConfirm:R})}),(0,l.jsx)(w.Z,{children:(0,l.jsx)(X.Z,{onClick:Z,color:"primary",children:"Cancel"})})]})};var vs=t(12231),ys=t(9520),xs=t(47603);const bs=(0,D.Z)(v=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:v.spacing(1,0,1,0)},title:{margin:v.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:v.palette.text.primary},menuItem:{minHeight:v.spacing(6)},groupWrapper:{margin:v.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function Ss(v){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:xs.Z},{id:"starred",label:"Starred",icon:an.Z}]},{name:v!=null?v:"Company",items:[{id:"all",label:"All"}]}]}const Cs=v=>{const{initialFilter:x,availableFilters:R}=v,Z=bs(),J=(0,n.h_)(n.Ds);var K;const oe=(K=J.getOptionalString("organization.name"))!==null&&K!==void 0?K:"Company",{filters:he,updateFilters:Se,backendEntities:$e,queryParameters:{kind:De,user:we},loading:Ve}=dn(),it=["starred","all"],Ct=Ss(oe).map(An=>({...An,items:An.items.filter(({id:Pn})=>["group","user"].some(or=>or===De)?it.includes(Pn):!R||R.includes(Pn))})).filter(({items:An})=>!!An.length),{isStarredEntity:_e}=ge(),{isOwnedEntity:Zt,loading:qt}=Fe(),dr=Ve||qt,Vn=(0,P.useMemo)(()=>new tt("owned",Zt,_e),[Zt,_e]),sr=(0,P.useMemo)(()=>new tt("starred",Zt,_e),[Zt,_e]),xn=(0,P.useMemo)(()=>[we].flat()[0],[we]),[jn,En]=(0,P.useState)(xn!=null?xn:x),Ir=(0,P.useMemo)(()=>$e.filter(mt((0,Wt.compact)(Object.values({...he,user:void 0})))),[he,$e]),Rr=(0,P.useMemo)(()=>({all:Ir.length,starred:Ir.filter(An=>sr.filterEntity(An)).length,owned:Ir.filter(An=>Vn.filterEntity(An)).length}),[Ir,sr,Vn]);(0,P.useEffect)(()=>{xn&&En(xn)},[xn]),(0,P.useEffect)(()=>{!dr&&!!jn&&jn!=="all"&&Rr[jn]===0&&En("all")},[dr,Rr,jn,En]),(0,P.useEffect)(()=>{Se({user:jn?new tt(jn,Zt,_e):void 0})},[jn,Zt,_e,Se]);var Lr;return(0,l.jsx)(fr.Z,{className:Z.root,children:Ct.map(An=>(0,l.jsxs)(P.Fragment,{children:[(0,l.jsx)(_.Z,{variant:"subtitle2",component:"span",className:Z.title,children:An.name}),(0,l.jsx)(fr.Z,{className:Z.groupWrapper,children:(0,l.jsx)(nr.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":An.name,children:An.items.map(Pn=>{var or;return(0,l.jsxs)(vs.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>En(Pn.id),selected:Pn.id===((or=he.user)===null||or===void 0?void 0:or.value),className:Z.menuItem,disabled:Rr[Pn.id]===0,"data-testid":`user-picker-${Pn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Pn.icon&&(0,l.jsx)(pr.Z,{className:Z.listIcon,children:(0,l.jsx)(Pn.icon,{fontSize:"small"})}),(0,l.jsx)(Zr.Z,{children:(0,l.jsxs)(_.Z,{variant:"body1",children:[Pn.label," "]})}),(0,l.jsx)(ys.Z,{children:(Lr=Rr[Pn.id])!==null&&Lr!==void 0?Lr:"-"})]},Pn.id)})})})]},An.name))})},es=(0,D.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Tr=(0,l.jsx)(Pe.Z,{fontSize:"small"}),Ns=(0,l.jsx)(ye.Z,{fontSize:"small"}),ws=()=>{const v=es(),{updateFilters:x}=dn(),[R,Z]=(0,P.useState)([]);function J(he){x({orphan:he?new vt(he):void 0})}function K(he){x({error:he?new $t(he):void 0})}const oe=["Is Orphan","Has Error"];return(0,l.jsx)(z.Z,{pb:1,pt:1,children:(0,l.jsxs)(_.Z,{variant:"button",component:"label",children:["Processing Status",(0,l.jsx)(Me.ZP,{multiple:!0,options:oe,value:R,onChange:(he,Se)=>{Z(Se),J(Se.includes("Is Orphan")),K(Se.includes("Has Error"))},renderOption:(he,{selected:Se})=>(0,l.jsx)(U.Z,{control:(0,l.jsx)(de.Z,{icon:Tr,checkedIcon:Ns,checked:Se}),label:he}),size:"small",popupIcon:(0,l.jsx)(Le.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:he=>(0,l.jsx)(fe.Z,{...he,className:v.input,variant:"outlined"})})]})})},js=({children:v,value:x})=>{var R;const[Z,J]=useState((R=x==null?void 0:x.filters)!==null&&R!==void 0?R:{}),K=useCallback(it=>{J(Ct=>{const _e=typeof it=="function"?it(Ct):it;return{...Ct,..._e}})},[]),oe=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var he,Se,$e,De,we;const Ve=useMemo(()=>({entities:(he=x==null?void 0:x.entities)!==null&&he!==void 0?he:oe.entities,backendEntities:(Se=x==null?void 0:x.backendEntities)!==null&&Se!==void 0?Se:oe.backendEntities,updateFilters:($e=x==null?void 0:x.updateFilters)!==null&&$e!==void 0?$e:K,filters:Z,loading:(De=x==null?void 0:x.loading)!==null&&De!==void 0?De:!1,queryParameters:(we=x==null?void 0:x.queryParameters)!==null&&we!==void 0?we:oe.queryParameters,error:x==null?void 0:x.error}),[x,oe,Z,K]);return _jsx(EntityListContext.Provider,{value:Ve,children:v})}},33414:function(It,ze,t){"use strict";t.r(ze),t.d(ze,{AboutCard:function(){return gt},AboutContent:function(){return Je},AboutField:function(){return q}});var h=t(52322),n=t(25271),W=t(93414),$=t(25248),g=t(32838),b=t(92848),l=t(79692),P=t(94339),ne=t(32552),Q=t(61837),X=t(85256),M=t(24579),z=t(52866),_=t(30254),ae=t(27604),le=t(2784),A=t(19625),L=t(60905),O=t(90436),T=t(7089);const S=(0,l.Z)(Ee=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:Ee.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function q(Ee){const{label:Ke,value:st,gridSizes:mt,children:rt}=Ee,ot=S(),ut=(0,$.vJ)(rt,Rt=>Rt.getElements()),xt=ut.length>0?ut:(0,h.jsx)(O.Z,{variant:"body2",className:ot.value,children:st||"unknown"});return(0,h.jsxs)(L.Z,{item:!0,...mt,children:[(0,h.jsx)(O.Z,{variant:"h2",className:ot.label,children:Ke}),xt]})}var Te=t(24851);const et=(0,l.Z)({description:{wordBreak:"break-word"}});function Xe(Ee,Ke,st){if(Ke==="url"||Ee.includes("://"))return Ee;const mt=st.type==="file"?`file://${st.target}`:st.target;return Ke==="file"||st.type==="file"?new URL(Ee,mt).href:mt}function Je(Ee){var Ke,st,mt,rt,ot,ut,xt,Rt;const{entity:We}=Ee,se=et(),Ie=We.kind.toLocaleLowerCase("en-US")==="system",Re=We.kind.toLocaleLowerCase("en-US")==="resource",tt=We.kind.toLocaleLowerCase("en-US")==="component",vt=We.kind.toLocaleLowerCase("en-US")==="api",$t=We.kind.toLocaleLowerCase("en-US")==="template",pt=We.kind.toLocaleLowerCase("en-US")==="location",Et=We.kind.toLocaleLowerCase("en-US")==="group",At=(0,b.hF)(We,n.cz,{kind:"system"}),kt=(0,b.hF)(We,n.cz,{kind:"component"}),Xt=(0,b.hF)(We,n.cz,{kind:"domain"}),Wt=(0,b.hF)(We,n.S4);let Vt;try{Vt=(0,n.CV)(We)}catch{Vt=void 0}return(0,h.jsxs)(L.Z,{container:!0,children:[(0,h.jsx)(q,{label:"Description",gridSizes:{xs:12},children:(0,h.jsx)(O.Z,{variant:"body2",paragraph:!0,className:se.description,children:(We==null||(Ke=We.metadata)===null||Ke===void 0?void 0:Ke.description)||"No description"})}),(0,h.jsx)(q,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:Wt.length>0&&(0,h.jsx)(b.rI,{entityRefs:Wt,defaultKind:"group"})}),(Ie||Xt.length>0)&&(0,h.jsx)(q,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:Xt.length>0&&(0,h.jsx)(b.rI,{entityRefs:Xt,defaultKind:"domain"})}),(vt||tt||Re||At.length>0)&&(0,h.jsx)(q,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:At.length>0&&(0,h.jsx)(b.rI,{entityRefs:At,defaultKind:"system"})}),tt&&kt.length>0&&(0,h.jsx)(q,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,h.jsx)(b.rI,{entityRefs:kt,defaultKind:"component"})}),(vt||tt||Re||$t||Et||pt||typeof(We==null||(st=We.spec)===null||st===void 0?void 0:st.type)=="string")&&(0,h.jsx)(q,{label:"Type",value:We==null||(mt=We.spec)===null||mt===void 0?void 0:mt.type,gridSizes:{xs:12,sm:6,lg:4}}),(vt||tt||typeof(We==null||(rt=We.spec)===null||rt===void 0?void 0:rt.lifecycle)=="string")&&(0,h.jsx)(q,{label:"Lifecycle",value:We==null||(ot=We.spec)===null||ot===void 0?void 0:ot.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,h.jsx)(q,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((We==null||(ut=We.metadata)===null||ut===void 0?void 0:ut.tags)||[]).map(Yt=>(0,h.jsx)(T.Z,{size:"small",label:Yt},Yt))}),pt&&((We==null||(xt=We.spec)===null||xt===void 0?void 0:xt.targets)||(We==null||(Rt=We.spec)===null||Rt===void 0?void 0:Rt.target))&&(0,h.jsx)(q,{label:"Targets",gridSizes:{xs:12},children:(0,h.jsx)(Te.s,{cols:1,items:(We.spec.targets||[We.spec.target]).map(Yt=>Yt).map(Yt=>{var cn;return{text:Yt,href:Xe(Yt,(We==null||(cn=We.spec)===null||cn===void 0?void 0:cn.type)||"unknown",Vt)}})})})]})}const He=(0,l.Z)({gridItemCard:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"},fullHeightCard:{display:"flex",flexDirection:"column",height:"100%"},gridItemCardContent:{flex:1},fullHeightCardContent:{flex:1}});function gt(Ee){var Ke,st,mt;const{variant:rt}=Ee,ot=He(),{entity:ut}=(0,b.X2)(),xt=(0,$.h_)(g.q3),Rt=(0,$.h_)(b.Ah),We=(0,$.h_)($.$v),se=(0,$.h_)($.VE),Ie=(0,$.tg)(A.jU),Re=(0,b.CV)(ut,xt),tt=(Ke=ut.metadata.annotations)===null||Ke===void 0?void 0:Ke[n.Tf],vt={label:"View Source",disabled:!Re,icon:(0,h.jsx)(g.nW,{type:Re==null?void 0:Re.integrationType}),href:Re==null?void 0:Re.locationTargetUrl},$t={label:"View TechDocs",disabled:!(!((st=ut.metadata.annotations)===null||st===void 0)&&st["backstage.io/techdocs-ref"])||!Ie,icon:(0,h.jsx)(_.Z,{}),href:Ie&&Ie({namespace:ut.metadata.namespace||n.zG,kind:ut.kind,name:ut.metadata.name})};let pt="";rt==="gridItem"?pt=ot.gridItemCard:rt==="fullHeight"&&(pt=ot.fullHeightCard);let Et="";rt==="gridItem"?Et=ot.gridItemCardContent:rt==="fullHeight"&&(Et=ot.fullHeightCardContent);const At=(mt=ut.metadata.annotations)===null||mt===void 0?void 0:mt[n.P1],kt=(At==null?void 0:At.startsWith("url:"))||(At==null?void 0:At.startsWith("file:")),Xt=(0,le.useCallback)(async()=>{try{await Rt.refreshEntity((0,n.eE)(ut)),We.post({message:"Refresh scheduled",severity:"info"})}catch(Wt){se.post(Wt)}},[Rt,We,se,ut]);return(0,h.jsxs)(P.Z,{className:pt,children:[(0,h.jsx)(ne.Z,{title:"About",action:(0,h.jsxs)(h.Fragment,{children:[kt&&(0,h.jsx)(Q.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:Xt,children:(0,h.jsx)(z.Z,{})}),(0,h.jsx)(Q.Z,{component:W.rU,"aria-label":"Edit",disabled:!tt,title:"Edit Metadata",to:tt!=null?tt:"#",children:(0,h.jsx)(ae.Z,{})})]}),subheader:(0,h.jsx)(W.M6,{links:[vt,$t]})}),(0,h.jsx)(X.Z,{}),(0,h.jsx)(M.Z,{className:Et,children:(0,h.jsx)(Je,{entity:ut})})]})}},86359:function(It,ze,t){"use strict";t.d(ze,{E:function(){return le}});var h=t(52322),n=t(25271),W=t(93414),$=t(92848),g=t(90436),b=t(15459),l=t(27604),P=t(2997),ne=t(11640),Q=t(28347),X=t(76635),M=t(2784),z=t(7089);const _=Object.freeze({createNameColumn(A){function L(O){var T;return((T=O.metadata)===null||T===void 0?void 0:T.title)||(0,$.$3)(O,{defaultKind:A==null?void 0:A.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:O},{entity:T}){return L(O).localeCompare(L(T))},render:({entity:O})=>{var T;return(0,h.jsx)($.dx,{entityRef:O,defaultKind:(A==null?void 0:A.defaultKind)||"Component",title:(T=O.metadata)===null||T===void 0?void 0:T.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:A})=>(0,h.jsx)($.rI,{entityRefs:A.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:A})=>(0,h.jsx)($.rI,{entityRefs:A.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:A})=>{var L,O;return(0,h.jsx)(h.Fragment,{children:((A==null||(L=A.spec)===null||L===void 0?void 0:L.targets)||(A==null||(O=A.spec)===null||O===void 0?void 0:O.target))&&(0,h.jsx)(W.Or,{text:(A.spec.targets||[A.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:A})=>(0,h.jsx)(W.Or,{text:A.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:A})=>(0,h.jsx)(h.Fragment,{children:A.metadata.tags&&A.metadata.tags.map(L=>(0,h.jsx)(z.Z,{label:L,size:"small",variant:"outlined",style:{marginBottom:"0px"}},L))}),width:"auto"}},createTitleColumn(A){return{title:"Title",field:"entity.metadata.title",hidden:A==null?void 0:A.hidden,searchable:!0}},createLabelColumn(A,L){return{title:(L==null?void 0:L.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:O})=>{var T;const S=(T=O.metadata)===null||T===void 0?void 0:T.labels,q=S&&S[A]||(L==null?void 0:L.defaultValue);return(0,h.jsx)(h.Fragment,{children:q&&(0,h.jsx)(z.Z,{label:q,size:"small",variant:"outlined"},q)})},width:"auto"}}}),ae=(0,b.Z)({root:{color:"#f3ba37"}})(ne.Z),le=A=>{var L,O;const{columns:T,actions:S,tableOptions:q,subtitle:Te,emptyContent:et}=A,{isStarredEntity:Xe,toggleStarredEntity:Je}=(0,$.CR)(),{loading:He,error:gt,entities:Ee,filters:Ke}=(0,$.wp)(),st=(0,M.useMemo)(()=>{var se;return[_.createTitleColumn({hidden:!0}),_.createNameColumn({defaultKind:(se=Ke.kind)===null||se===void 0?void 0:se.value}),...Ie(),_.createMetadataDescriptionColumn(),_.createTagsColumn()];function Ie(){var Re;switch((Re=Ke.kind)===null||Re===void 0?void 0:Re.value){case"user":return[];case"domain":case"system":return[_.createOwnerColumn()];case"group":case"template":return[_.createSpecTypeColumn()];case"location":return[_.createSpecTypeColumn(),_.createSpecTargetsColumn()];default:return[_.createSystemColumn(),_.createOwnerColumn(),_.createSpecTypeColumn(),_.createSpecLifecycleColumn()]}}},[(L=Ke.kind)===null||L===void 0?void 0:L.value]),mt=Ke.type===void 0;var rt;const ot=(0,X.capitalize)((rt=(O=Ke.user)===null||O===void 0?void 0:O.value)!==null&&rt!==void 0?rt:"all");if(gt)return(0,h.jsx)("div",{children:(0,h.jsx)(W.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,h.jsx)(W.Oi,{language:"text",text:gt.toString()})})});const ut=[({entity:se})=>{var Ie;const Re=(Ie=se.metadata.annotations)===null||Ie===void 0?void 0:Ie[n.l2],tt="View";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(g.Z,{variant:"srOnly",children:tt}),(0,h.jsx)(P.Z,{fontSize:"small"})]}),tooltip:tt,disabled:!Re,onClick:()=>{!Re||window.open(Re,"_blank")}}},({entity:se})=>{var Ie;const Re=(Ie=se.metadata.annotations)===null||Ie===void 0?void 0:Ie[n.Tf],tt="Edit";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(g.Z,{variant:"srOnly",children:tt}),(0,h.jsx)(l.Z,{fontSize:"small"})]}),tooltip:tt,disabled:!Re,onClick:()=>{!Re||window.open(Re,"_blank")}}},({entity:se})=>{const Ie=Xe(se),Re=Ie?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(g.Z,{variant:"srOnly",children:Re}),Ie?(0,h.jsx)(ae,{}):(0,h.jsx)(Q.Z,{})]}),tooltip:Re,onClick:()=>Je(se)}}],xt=Ee.map(se=>{const Ie=(0,$.hF)(se,n.cz,{kind:"system"}),Re=(0,$.hF)(se,n.S4);return{entity:se,resolved:{name:(0,$.$3)(se,{defaultKind:"Component"}),ownedByRelationsTitle:Re.map(tt=>(0,$.$3)(tt,{defaultKind:"group"})).join(", "),ownedByRelations:Re,partOfSystemRelationTitle:Ie.map(tt=>(0,$.$3)(tt,{defaultKind:"system"})).join(", "),partOfSystemRelations:Ie}}}),Rt=(T||st).find(se=>se.title==="Type");Rt&&(Rt.hidden=!mt);const We=xt.length>20;return(0,h.jsx)(W.iA,{isLoading:He,columns:T||st,options:{paging:We,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!He,padding:"dense",pageSizeOptions:[20,50,100],...q},title:`${ot} (${Ee.length})`,data:xt,actions:S||ut,subtitle:Te,emptyContent:et})};le.columns=_},24851:function(It,ze,t){"use strict";t.d(ze,{s:function(){return ae}});var h=t(52322),n=t(90348),W=t(11861),$=t(2784),g=t(79692),b=t(95544),l=t(90436),P=t(52160),ne=t(93414);const Q=(0,g.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function X(le){const{href:A,text:L,Icon:O}=le,T=Q();return(0,h.jsxs)(b.Z,{display:"flex",children:[(0,h.jsx)(b.Z,{mr:1,className:T.svgIcon,children:(0,h.jsx)(l.Z,{component:"div",children:O?(0,h.jsx)(O,{}):(0,h.jsx)(P.Z,{})})}),(0,h.jsx)(b.Z,{flexGrow:"1",children:(0,h.jsx)(ne.rU,{to:A,target:"_blank",rel:"noopener",children:L||A})})]})}var M=t(41156);const z={xs:1,sm:1,md:1,lg:2,xl:3};function _(le){const A=[(0,M.Z)(S=>S.breakpoints.up("xl"))?"xl":null,(0,M.Z)(S=>S.breakpoints.up("lg"))?"lg":null,(0,M.Z)(S=>S.breakpoints.up("md"))?"md":null,(0,M.Z)(S=>S.breakpoints.up("sm"))?"sm":null,(0,M.Z)(S=>S.breakpoints.up("xs"))?"xs":null];let L=1;if(typeof le=="number")L=le;else{var O;const S=(O=A.find(q=>q!==null))!==null&&O!==void 0?O:"xs";var T;L=(T=le==null?void 0:le[S])!==null&&T!==void 0?T:z[S]}return L}function ae(le){const{items:A,cols:L=void 0}=le,O=_(L);return(0,h.jsx)(n.Z,{rowHeight:"auto",cols:O,children:A.map(({text:T,href:S,Icon:q},Te)=>(0,h.jsx)(W.Z,{children:(0,h.jsx)(X,{href:S,text:T!=null?T:S,Icon:q})},Te))})}},19625:function(It,ze,t){"use strict";t.d(ze,{_Z:function(){return $},jU:function(){return W},yw:function(){return n}});var h=t(25248);const n=(0,h.x8)({id:"create-component",optional:!0}),W=(0,h.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),$=(0,h.NT)({id:"catalog"})},51666:function(It,ze,t){"use strict";t.d(ze,{rG:function(){return h},Y2:function(){return O},J$:function(){return ne},g2:function(){return W}});var h;(function(T){T.DENY="DENY",T.ALLOW="ALLOW",T.CONDITIONAL="CONDITIONAL"})(h||(h={}));function n(T,S){return T.name===S.name}function W(T,S){return"resourceType"in T?!S||T.resourceType===S:!1}function $(T){return T.attributes.action==="create"}function g(T){return T.attributes.action==="read"}function b(T){return T.attributes.action==="update"}function l(T){return T.attributes.action==="delete"}function P(T){return{authorize:async(S,q)=>await T.authorize(S,q),authorizeConditional(S,q){const Te=S;return T.authorize(Te,q)}}}function ne({name:T,attributes:S,resourceType:q}){return q?{type:"resource",name:T,attributes:S,resourceType:q}:{type:"basic",name:T,attributes:S}}var Q=t(23054),X=t(96279),M=t.n(X),z=t(9571),_=t(30195);const ae=_.z.lazy(()=>_.z.object({rule:_.z.string(),resourceType:_.z.string(),params:_.z.record(_.z.any()).optional()}).or(_.z.object({anyOf:_.z.array(ae).nonempty()})).or(_.z.object({allOf:_.z.array(ae).nonempty()})).or(_.z.object({not:ae}))),le=_.z.object({result:_.z.literal(h.ALLOW).or(_.z.literal(h.DENY))}),A=_.z.union([_.z.object({result:_.z.literal(h.ALLOW).or(_.z.literal(h.DENY))}),_.z.object({result:_.z.literal(h.CONDITIONAL),pluginId:_.z.string(),resourceType:_.z.string(),conditions:ae})]),L=(T,S)=>_.z.object({items:_.z.array(_.z.intersection(_.z.object({id:_.z.string()}),T)).refine(q=>q.length===S.size&&q.every(({id:Te})=>S.has(Te)),{message:"Items in response do not match request"})});class O{async authorize(S,q){return this.makeRequest(S,le,q)}async authorizeConditional(S,q){return this.makeRequest(S,A,q)}async makeRequest(S,q,Te){if(!this.enabled)return S.map(Ke=>({result:h.ALLOW}));const et={items:S.map(Ke=>({id:z.Z(),...Ke}))},Xe=await this.discovery.getBaseUrl("permission"),Je=await M()(`${Xe}/authorize`,{method:"POST",body:JSON.stringify(et),headers:{...this.getAuthorizationHeader(Te==null?void 0:Te.token),"content-type":"application/json"}});if(!Je.ok)throw await Q.VL.fromResponse(Je);const He=await Je.json(),Ee=L(q,new Set(et.items.map(({id:Ke})=>Ke))).parse(He).items.reduce((Ke,st)=>(Ke[st.id]=st,Ke),{});return et.items.map(Ke=>Ee[Ke.id])}getAuthorizationHeader(S){return S?{Authorization:`Bearer ${S}`}:{}}constructor(S){this.discovery=S.discovery;var q;this.enabled=(q=S.config.getOptionalBoolean("permission.enabled"))!==null&&q!==void 0?q:!1}}},25488:function(It,ze,t){"use strict";t.d(ze,{iM:function(){return b},RV:function(){return $},gI:function(){return P}});var h=t(52322),n=t(2784),W=t(25248);const $=(0,W.T0)({id:"plugin.permission.api"});var g=t(51666);class b{static create(M){const{config:z,discovery:_,identity:ae}=M,le=new g.Y2({discovery:_,config:z});return new b(le,ae)}async authorize(M){return(await this.permissionClient.authorize([M],await this.identityApi.getCredentials()))[0]}constructor(M,z){this.permissionClient=M,this.identityApi=z}}var l=t(49857);function P(X){const M=(0,W.h_)($),{data:z,error:_}=(0,l.ZP)(X,async ae=>{if((0,g.g2)(ae.permission)&&!ae.resourceRef)return g.rG.DENY;const{result:le}=await M.authorize(ae);return le});return _?{error:_,loading:!1,allowed:!1}:z===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:z===g.rG.ALLOW}}const ne=X=>{const{permission:M,resourceRef:z,errorComponent:_,...ae}=X,le=usePermission(isResourcePermission(M)?{permission:M,resourceRef:z}:{permission:M}),A=useApp(),{NotFoundErrorPage:L}=A.getComponents();let O=_===void 0?_jsx(L,{}):_;return le.loading?O=null:le.allowed&&(O=X.element),_jsx(Route,{...ae,element:O})};function Q(X){const{permission:M,resourceRef:z}=X,_=usePermission(isResourcePermission(M)?{permission:M,resourceRef:z}:{permission:M}),ae=useApp();if(_.loading)return null;if(_.allowed)return _jsx(_Fragment,{children:X.children});if(X.errorPage)return _jsx(_Fragment,{children:X.errorPage});const{NotFoundErrorPage:le}=ae.getComponents();return _jsx(le,{})}},65826:function(It,ze,t){"use strict";t.d(ze,{FA:function(){return P},qO:function(){return rt},Nd:function(){return Xe},Rx:function(){return T}});var h=t(25248);const n=(0,h.T0)({id:"plugin.search.queryservice"});class W{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(U){this.mockedResults=U}}var $=t(52322),g=t(2784),b=t(79692);const l=(0,b.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),P=({text:D,preTag:U,postTag:de})=>{const fe=l(),ye=(0,g.useMemo)(()=>D.split(new RegExp(`(${U}.+?${de})`)),[de,U,D]);return(0,$.jsx)($.Fragment,{children:ye.map((Pe,Le)=>Pe.includes(U)?(0,$.jsx)("mark",{className:fe.highlight,children:Pe.replace(new RegExp(`${U}|${de}`,"g"),"")},Le):Pe)})};var ne=t(48760),Q=t(50581),X=t(61837),M=t(74603),z=t(21853),_=t(33375),ae=t(76635),le=t(64279),A=t(1849),L=t(51837);const O=(0,L.CT)("search-context"),T=()=>{const D=(0,g.useContext)(O);if(!D)throw new Error("useSearch must be used within a SearchContextProvider");const U=D.atVersion(1);if(!U)throw new Error("No SearchContext v1 found");return U},S=()=>(0,g.useContext)(O)!==void 0,q={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},Te=(D=q)=>{var U,de,fe,ye;const Pe=(0,h.h_)(n),[Le,Me]=(0,g.useState)(D.term),[nt,C]=(0,g.useState)(D.types),[H,me]=(0,g.useState)(D.filters),[ue,Ce]=(0,g.useState)(D.pageLimit),[ke,Ue]=(0,g.useState)(D.pageCursor),lt=(0,A.Z)(Le),St=(0,A.Z)(H),Ye=(0,le.default)(()=>Pe.query({term:Le,types:nt,filters:H,pageLimit:ue,pageCursor:ke}),[Le,nt,H,ue,ke]),ft=!Ye.loading&&!Ye.error&&((U=Ye.value)===null||U===void 0?void 0:U.nextPageCursor),yt=!Ye.loading&&!Ye.error&&((de=Ye.value)===null||de===void 0?void 0:de.previousPageCursor),ct=(0,g.useCallback)(()=>{var Ft;Ue((Ft=Ye.value)===null||Ft===void 0?void 0:Ft.nextPageCursor)},[(fe=Ye.value)===null||fe===void 0?void 0:fe.nextPageCursor]),Tt=(0,g.useCallback)(()=>{var Ft;Ue((Ft=Ye.value)===null||Ft===void 0?void 0:Ft.previousPageCursor)},[(ye=Ye.value)===null||ye===void 0?void 0:ye.previousPageCursor]);return(0,g.useEffect)(()=>{lt!==void 0&&Le!==lt&&Ue(void 0)},[Le,lt,Ue]),(0,g.useEffect)(()=>{St!==void 0&&!(0,ae.isEqual)(H,St)&&Ue(void 0)},[H,St,Ue]),{result:Ye,term:Le,setTerm:Me,types:nt,setTypes:C,filters:H,setFilters:me,pageLimit:ue,setPageLimit:Ce,pageCursor:ke,setPageCursor:Ue,fetchNextPage:ft?ct:void 0,fetchPreviousPage:yt?Tt:void 0}},et=D=>{const{initialState:U,children:de}=D,fe=Te(U);return(0,$.jsx)(h.fC,{attributes:{searchTypes:fe.types.sort().join(",")},children:(0,$.jsx)(O.Provider,{value:(0,L.EI)({1:fe}),children:de})})},Xe=D=>{const{initialState:U,inheritParentContextIfAvailable:de,children:fe}=D;return S()&&de?(0,$.jsx)($.Fragment,{children:fe}):(0,$.jsx)(et,{initialState:U,children:fe})},Je=({children:D})=>{var U;const de=H=>(0,A.Z)(H)!==H,fe=(0,h.z$)(),{term:ye,result:Pe}=T();var Le;const Me=(Le=(U=Pe.value)===null||U===void 0?void 0:U.numberOfResults)!==null&&Le!==void 0?Le:void 0,C=de(Pe.loading)&&!Pe.loading;return(0,g.useEffect)(()=>{ye&&C&&fe.captureEvent("search",ye,{value:Me})},[fe,ye,Me,C]),(0,$.jsx)($.Fragment,{children:D})};function He(D){return(0,g.forwardRef)((U,de)=>(0,$.jsx)(Xe,{inheritParentContextIfAvailable:!0,children:(0,$.jsx)(D,{...U,ref:de})}))}const gt=He((0,g.forwardRef)((D,U)=>{const{onChange:de,onKeyDown:fe=()=>{},onClear:ye=()=>{},onSubmit:Pe=()=>{},debounceTime:Le=200,clearButton:Me=!0,fullWidth:nt=!0,value:C,placeholder:H,inputProps:me={},endAdornment:ue,...Ce}=D,ke=(0,h.h_)(h.Ds),[Ue,lt]=(0,g.useState)("");(0,g.useEffect)(()=>{lt(Nt=>Nt!==C?String(C):Nt)},[C]),(0,ne.Z)(()=>de(Ue),Le,[Ue]);const St=(0,g.useCallback)(Nt=>{lt(Nt.target.value)},[lt]),Ye=(0,g.useCallback)(Nt=>{fe&&fe(Nt),Pe&&Nt.key==="Enter"&&Pe()},[fe,Pe]),ft=(0,g.useCallback)(()=>{de(""),ye&&ye()},[de,ye]),yt=H!=null?H:`Search in ${ke.getOptionalString("app.title")||"Backstage"}`,ct=(0,$.jsx)(Q.Z,{position:"start",children:(0,$.jsx)(X.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,$.jsx)(z.Z,{})})}),Tt=(0,$.jsx)(Q.Z,{position:"end",children:(0,$.jsx)(X.Z,{"aria-label":"Clear",size:"small",onClick:ft,children:(0,$.jsx)(_.Z,{})})});return(0,$.jsx)(Je,{children:(0,$.jsx)(M.Z,{"data-testid":"search-bar-next",ref:U,value:Ue,placeholder:yt,startAdornment:ct,endAdornment:Me?Tt:ue,inputProps:{"aria-label":"Search",...me},fullWidth:nt,onChange:St,onKeyDown:Ye,...Ce})})})),Ee=He((0,g.forwardRef)((D,U)=>{const{value:de="",onChange:fe,...ye}=D,{term:Pe,setTerm:Le}=T();(0,g.useEffect)(()=>{de&&Le(String(de))},[de,Le]);const Me=(0,g.useCallback)(nt=>{fe?fe(nt):Le(nt)},[fe,Le]);return(0,$.jsx)(h.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,$.jsx)(gt,{...ye,ref:U,value:Pe,onChange:Me})})}));var Ke=t(4614),st=t(88013);const rt=(D=>U=>(0,$.jsx)(Xe,{inheritParentContextIfAvailable:!0,children:(0,$.jsx)(D,{...U})}))(function(U){const{loading:de,value:fe,onChange:ye=()=>{},options:Pe=[],getOptionLabel:Le=ft=>String(ft),inputPlaceholder:Me,inputDebounceTime:nt,freeSolo:C=!0,fullWidth:H=!0,clearOnBlur:me=!1,"data-testid":ue="search-autocomplete",...Ce}=U,{setTerm:ke}=T(),Ue=(0,g.useCallback)(ft=>ft?typeof ft=="string"?ft:Le(ft):"",[Le]),lt=(0,g.useMemo)(()=>Ue(fe),[fe,Ue]),St=(0,g.useCallback)((ft,yt,ct,Tt)=>{ke(Ue(yt)),ye(ft,yt,ct,Tt)},[Ue,ke,ye]),Ye=(0,g.useCallback)(({InputProps:{ref:ft,endAdornment:yt},InputLabelProps:ct,...Tt})=>(0,$.jsx)(Ee,{...Tt,ref:ft,clearButton:!1,value:lt,placeholder:Me,debounceTime:nt,endAdornment:de?(0,$.jsx)(Ke.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):yt}),[de,lt,Me,nt]);return(0,$.jsx)(st.ZP,{...Ce,"data-testid":ue,value:fe,onChange:St,options:Pe,getOptionLabel:Le,renderInput:Ye,freeSolo:C,fullWidth:H,clearOnBlur:me})}),ot=({icon:D,primaryText:U,primaryTextTypographyProps:de,secondaryText:fe,secondaryTextTypographyProps:ye,disableTextTypography:Pe})=>_jsxs(_Fragment,{children:[D?_jsx(ListItemIcon,{children:D}):null,_jsx(ListItemText,{primary:U,primaryTypographyProps:de,secondary:fe,secondaryTypographyProps:ye,disableTypography:Pe})]});var ut=t(42494),xt=t(84899),Rt=t(5806),We=t(21324),se=t(56939),Ie=t(73698),Re=t(12231),tt=t(86619),vt=t(7089),$t=t(69294);const pt=(D,U,de=[],fe=250)=>{const ye=(0,g.useRef)({}),Pe=D||(()=>Promise.resolve([])),[Le,Me]=(0,$t.default)(Pe,[U],{loading:!0});if((0,ne.Z)(()=>{ye.current[U]===void 0&&(ye.current[U]=Me(U).then(C=>(ye.current[U]=C,C)))},fe,[Me,U]),de.length)return{loading:!1,value:de};const nt=ye.current[U];return Array.isArray(nt)?{loading:!1,value:nt}:Le},Et=(D,U)=>{const{setFilters:de}=T();(0,g.useEffect)(()=>{U&&[U].flat().length>0&&de(fe=>({...fe,[D]:U}))},[])},At=D=>{const{className:U,defaultValue:de,name:fe,values:ye,valuesDebounceMs:Pe,label:Le,filterSelectedOptions:Me,limitTags:nt,multiple:C}=D,[H,me]=(0,g.useState)("");Et(fe,de);const ue=typeof ye=="function"?ye:void 0,Ce=typeof ye=="function"?void 0:ye,{value:ke,loading:Ue}=pt(ue,H,Ce,Pe),{filters:lt,setFilters:St}=T(),Ye=lt[fe]||(C?[]:null),ft=(Tt,Nt)=>{St(Ft=>{const{[fe]:Un,...Mn}=Ft;return Nt?{...Mn,[fe]:Nt}:{...Mn}})},yt=Tt=>(0,$.jsx)(tt.Z,{...Tt,name:"search",variant:"outlined",label:Le,fullWidth:!0}),ct=(Tt,Nt)=>Tt.map((Ft,Un)=>(0,$.jsx)(vt.Z,{label:Ft,color:"primary",...Nt({index:Un})}));return(0,$.jsx)(st.ZP,{filterSelectedOptions:Me,limitTags:nt,multiple:C,className:U,id:`${C?"multi-":""}select-filter-${fe}--select`,options:ke||[],loading:Ue,value:Ye,onChange:ft,onInputChange:(Tt,Nt)=>me(Nt),renderInput:yt,renderTags:ct})},kt=(0,b.Z)({label:{textTransform:"capitalize"}}),Xt=D=>{const{className:U,defaultValue:de,label:fe,name:ye,values:Pe=[],valuesDebounceMs:Le}=D,Me=kt(),{filters:nt,setFilters:C}=T();Et(ye,de);const H=typeof Pe=="function"?Pe:void 0,me=typeof Pe=="function"?void 0:Pe,{value:ue=[],loading:Ce}=pt(H,"",me,Le),ke=lt=>{const{target:{value:St,checked:Ye}}=lt;C(ft=>{const{[ye]:yt,...ct}=ft,Tt=(yt||[]).filter(Ft=>Ft!==St),Nt=Ye?[...Tt,St]:Tt;return Nt.length?{...ct,[ye]:Nt}:ct})};var Ue;return(0,$.jsxs)(ut.Z,{className:U,disabled:Ce,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[fe?(0,$.jsx)(xt.Z,{className:Me.label,children:fe}):null,ue.map(lt=>(0,$.jsx)(Rt.Z,{control:(0,$.jsx)(We.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":lt},value:lt,name:lt,onChange:ke,checked:((Ue=nt[ye])!==null&&Ue!==void 0?Ue:[]).includes(lt)}),label:lt},lt))]})},Wt=D=>{const{className:U,defaultValue:de,label:fe,name:ye,values:Pe,valuesDebounceMs:Le}=D,Me=kt();Et(ye,de);const nt=typeof Pe=="function"?Pe:void 0,C=typeof Pe=="function"?void 0:Pe,{value:H=[],loading:me}=pt(nt,"",C,Le),{filters:ue,setFilters:Ce}=T(),ke=Ue=>{const{target:{value:lt}}=Ue;Ce(St=>{const{[ye]:Ye,...ft}=St;return lt?{...ft,[ye]:lt}:ft})};return(0,$.jsxs)(ut.Z,{disabled:me,className:U,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[fe?(0,$.jsx)(se.Z,{className:Me.label,margin:"dense",children:fe}):null,(0,$.jsxs)(Ie.Z,{variant:"outlined",value:ue[ye]||"",onChange:ke,children:[(0,$.jsx)(Re.Z,{value:"",children:(0,$.jsx)("em",{children:"All"})}),H.map(Ue=>(0,$.jsx)(Re.Z,{value:Ue,children:Ue},Ue))]})]})},Vt=({component:D,...U})=>(0,$.jsx)(D,{...U});Vt.Checkbox=D=>(0,$.jsx)(Vt,{...D,component:Xt}),Vt.Select=D=>(0,$.jsx)(Vt,{...D,component:Wt}),Vt.Autocomplete=D=>(0,$.jsx)(Vt,{...D,component:At});var Yt=t(93414);const cn=D=>{const{children:U}=D,fe=useSearch().result;return U(fe)},on=D=>{const{query:U,children:de}=D,fe=useApi(searchApiRef),ye=useAsync(()=>{const{term:Pe="",types:Le=[],filters:Me={},...nt}=U;return fe.query({...nt,term:Pe,types:Le,filters:Me})},[U]);return de(ye)},Zn=D=>{const{query:U,children:de}=D;return U?_jsx(on,{query:U,children:de}):_jsx(cn,{children:de})},bn=D=>{const{query:U,children:de}=D;return _jsx(Zn,{query:U,children:({loading:fe,error:ye,value:Pe})=>fe?_jsx(Progress,{}):ye?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:ye}):Pe!=null&&Pe.results.length?de(Pe):_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"})})},Dn=D=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(bn,{...D})}),pn=(0,b.Z)(D=>({root:{display:"flex",justifyContent:"space-between",gap:D.spacing(2),margin:D.spacing(2,0)}})),dn=()=>{const{fetchNextPage:D,fetchPreviousPage:U}=useSearch(),de=pn();return!D&&!U?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:de.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!U,onClick:U,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!D,onClick:D,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})};var Jt=t(48834).lW;const Nn=D=>Jt.from(D.toString(),"utf-8").toString("base64"),Fn=D=>D?Number(Jt.from(D,"base64").toString("utf-8")):0,un=D=>{const{total:U=-1,cursor:de,onCursorChange:fe,limit:ye=25,limitLabel:Pe="Results per page:",limitText:Le=({from:Ce,to:ke})=>U>0?`of ${U}`:`${Ce}-${ke}`,limitOptions:Me,onLimitChange:nt,...C}=D,H=useMemo(()=>Fn(de),[de]),me=useCallback((Ce,ke)=>{fe==null||fe(Nn(ke))},[fe]),ue=useCallback(Ce=>{const ke=Ce.target.value;nt==null||nt(parseInt(ke,10))},[nt]);return _jsx(TablePagination,{...C,component:"div",count:U,page:H,onPageChange:me,rowsPerPage:ye,labelRowsPerPage:Pe,labelDisplayedRows:Le,rowsPerPageOptions:Me,onRowsPerPageChange:ue})},fn=D=>{const{pageLimit:U,setPageLimit:de,pageCursor:fe,setPageCursor:ye}=useSearch();return _jsx(un,{...D,limit:U,onLimitChange:de,cursor:fe,onCursorChange:ye})},gn=({result:D,highlight:U,rank:de,icon:fe,secondaryAction:ye,lineClamp:Pe=5})=>{const Le=useAnalytics(),Me=()=>{Le.captureEvent("discover",D.title,{attributes:{to:D.location},value:de})};return _jsxs(_Fragment,{children:[_jsxs(ListItem,{alignItems:"center",children:[fe&&_jsx(ListItemIcon,{children:fe}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:D.location,onClick:Me,children:U!=null&&U.fields.title?_jsx(HighlightedSearchResultText,{text:(U==null?void 0:U.fields.title)||"",preTag:(U==null?void 0:U.preTag)||"",postTag:(U==null?void 0:U.postTag)||""}):D.title}),secondary:_jsx("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Pe,overflow:"hidden"},children:U!=null&&U.fields.text?_jsx(HighlightedSearchResultText,{text:U.fields.text,preTag:U.preTag,postTag:U.postTag}):D.text})}),ye&&_jsx(Box,{alignItems:"flex-end",children:ye})]}),_jsx(Divider,{})]})},In=D=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(gn,{...D})}),Rn=D=>{const{loading:U,error:de,resultItems:fe,renderResultItem:ye=Me=>_jsx(DefaultResultListItem,{result:Me.document},Me.document.location),noResultsComponent:Pe=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Le}=D;return _jsxs(List,{...Le,children:[U?_jsx(Progress,{}):null,!U&&de?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:de}):null,!U&&!de&&(fe==null?void 0:fe.length)?fe.map(ye):null,!U&&!de&&!(fe!=null&&fe.length)?_jsx(ListItem,{children:Pe}):null]})},mn=D=>{const{query:U,disableRenderingWithNoResults:de,...fe}=D;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:U,children:({loading:ye,error:Pe,value:Le})=>{var Me;return!(!(Le==null||(Me=Le.results)===null||Me===void 0)&&Me.length)&&de?null:_jsx(Rn,{...fe,loading:ye,error:Pe,resultItems:Le==null?void 0:Le.results})}})})};var ge=t(19126);const ee=(0,b.Z)(D=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:D.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:D.palette.text.secondary,margin:D.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:D.palette.text.secondary,margin:D.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:D.spacing(.5)}})),Ae=D=>{const U=ee(),{label:de,children:fe,...ye}=D;return _jsx(Chip,{...ye,className:U.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[de,": ",fe]})})},Fe=()=>null,qe=(0,b.Z)(D=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:D.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:D.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),bt=D=>{const U=qe(),{label:de,value:fe="None",onChange:ye,onDelete:Pe}=D,Le=useCallback(Me=>{ye(Me.target.value)},[ye]);return _jsx(Ae,{label:de,onDelete:Pe,children:_jsx(Typography,{role:"textbox",component:"span",className:U.root,onChange:Le,contentEditable:!0,suppressContentEditableWarning:!0,children:fe})})},ie=(0,b.Z)(D=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:D.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),k=D=>{const U=ie(),{label:de,value:fe="none",onChange:ye,onDelete:Pe,children:Le}=D,Me=useCallback(nt=>{ye(nt.target.value)},[ye]);return _jsx(Ae,{label:de,onDelete:Pe,children:_jsxs(Select,{className:U.root,value:fe,onChange:Me,input:_jsx(InputBase,{}),IconComponent:Fe,children:[_jsx(MenuItem,{value:"none",children:"None"}),Le]})})};function ce(D){const U=ee(),[de,fe]=useState(null),{loading:ye,error:Pe,icon:Le,title:Me,titleProps:nt={},link:C=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:U.listSubheaderLinkIcon})]}),linkProps:H={},filterOptions:me,renderFilterOption:ue=Tt=>_jsx(MenuItem,{value:String(Tt),children:Tt},String(Tt)),filterFields:Ce,renderFilterField:ke,resultItems:Ue,renderResultItem:lt=Tt=>_jsx(DefaultResultListItem,{result:Tt.document},Tt.document.location),noResultsComponent:St=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Ye}=D,ft=useCallback(Tt=>{fe(Tt.currentTarget)},[]),yt=useCallback(()=>{fe(null)},[]);var ct;return _jsxs(List,{...Ye,children:[_jsxs(ListSubheader,{className:U.listSubheader,children:[Le,_jsx(Typography,{className:U.listSubheaderName,component:"strong",...nt,children:Me}),me?_jsx(Chip,{className:U.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:ft}):null,me?_jsx(Menu,{id:"filters-menu",anchorEl:de,open:Boolean(de),onClose:yt,onClick:yt,keepMounted:!0,children:me.map(ue)}):null,Ce==null?void 0:Ce.map(Tt=>(ct=ke==null?void 0:ke(Tt))!==null&&ct!==void 0?ct:null),_jsx(Link,{className:U.listSubheaderLink,to:"/search",...H,children:C})]}),ye?_jsx(Progress,{}):null,!ye&&Pe?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Pe}):null,!ye&&!Pe&&(Ue==null?void 0:Ue.length)?Ue.map(lt):null,!ye&&!Pe&&!(Ue!=null&&Ue.length)?_jsx(ListItem,{children:St}):null]})}function Be(D){const{query:U,linkProps:de={},disableRenderingWithNoResults:fe,...ye}=D,Pe=`/search?${qs.stringify({query:U.term,types:U.types,filters:U.filters,pageCursor:U.pageCursor},{arrayFormat:"brackets"})}`;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:U,children:({loading:Le,error:Me,value:nt})=>{var C;if(!(!(nt==null||(C=nt.results)===null||C===void 0)&&C.length)&&fe)return null;var H;return _jsx(ce,{...ye,loading:Le,error:Me,linkProps:{to:Pe,...de},resultItems:nt==null?void 0:nt.results,filterFields:Object.keys((H=U.filters)!==null&&H!==void 0?H:{})})}})})}},61886:function(It,ze,t){"use strict";t.d(ze,{Ox:function(){return Ke},Zz:function(){return b},oZ:function(){return Xe},DR:function(){return l},ZS:function(){return Te},VA:function(){return rt},KY:function(){return ne},gT:function(){return _},Dl:function(){return ae},ux:function(){return mt},$L:function(){return z},x1:function(){return et}});var h=t(52322),n=t(2784),W=t(73557),$=t(25248);const g="techdocs.addons.addon.v1",b="techdocs.addons.wrapper.v1",l=()=>null;(0,$.R5)(l,b,!0);const P=se=>`${g}.${se.toLocaleLowerCase("en-US")}`;function ne(se){const{name:Ie,component:Re}=se;return(0,$.YO)({name:Ie,component:{sync:tt=>(0,h.jsx)(Re,{...tt})},data:{[g]:se,[P(Ie)]:!0}})}const Q=(se,Ie)=>se.selectByComponentData({key:Ie}).getElements()[0],X=se=>se.selectByComponentData({key:b}).selectByComponentData({key:g}),M=se=>se.selectByComponentData({key:b}).findComponentData({key:g}),z=()=>{const se=(0,W.pC)(),Ie=(0,$.vJ)(se,X),Re=(0,$.vJ)(se,M),tt=(0,n.useCallback)(pt=>{if(!Ie||!pt)return null;const Et=P(pt.name);var At;return(At=Q(Ie,Et))!==null&&At!==void 0?At:null},[Ie]),vt=(0,n.useCallback)(pt=>{const Et=Re.find(At=>At.name===pt);return Et?tt(Et):null},[Re,tt]),$t=(0,n.useCallback)(pt=>{const Et=Re.filter(At=>At.location===pt);return Et.length?Et.map(tt):null},[Re,tt]);return{renderComponentByName:vt,renderComponentsByLocation:$t}},_=(0,$.T0)({id:"plugin.techdocs.service"}),ae=(0,$.T0)({id:"plugin.techdocs.storageservice"});var le=t(64279),A=t(25271),L=t(51837);function O(se,Ie){return Ie.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(se.kind=se.kind.toLocaleLowerCase(),se.name=se.name.toLocaleLowerCase(),se.namespace=se.namespace.toLocaleLowerCase()),se}const T=(se,Ie)=>(0,A.eE)(se)===(0,A.eE)(Ie),S={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},q=(0,L.CT)("techdocs-reader-page-context"),Te=(0,n.memo)(({entityRef:se,children:Ie})=>{const Re=(0,$.h_)(_),tt=(0,$.h_)($.Ds),vt=(0,le.default)(async()=>Re.getTechDocsMetadata(se),[se]),$t=(0,le.default)(async()=>Re.getEntityMetadata(se),[se]),[pt,Et]=(0,n.useState)(S.title),[At,kt]=(0,n.useState)(S.subtitle),[Xt,Wt]=(0,n.useState)(S.shadowRoot),Vt={metadata:vt,entityRef:O(se,tt),entityMetadata:$t,shadowRoot:Xt,setShadowRoot:Wt,title:pt,setTitle:Et,subtitle:At,setSubtitle:kt},Yt=(0,L.EI)({1:Vt});return(0,h.jsx)($.fC,{attributes:{entityRef:(0,A.eE)(se)},children:(0,h.jsx)(q.Provider,{value:Yt,children:Ie instanceof Function?Ie(Vt):Ie})})},(se,Ie)=>T(se.entityRef,Ie.entityRef)),et=()=>{const se=(0,n.useContext)(q);if(se===void 0)return S;const Ie=se.atVersion(1);if(Ie===void 0)throw new Error("No context found for version 1.");return Ie},Xe=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var Je=t(70882),He=t(50236),gt=t(19219),Ee=t(93414);const Ke="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",st=se=>{(0,n.useEffect)(()=>{if(!se)return()=>{};const Ie=se.querySelectorAll('head > link[rel="stylesheet"]');var Re;let tt=(Re=Ie==null?void 0:Ie.length)!==null&&Re!==void 0?Re:0;const vt=new CustomEvent(Ke);if(!tt)return se.dispatchEvent(vt),()=>{};const $t=()=>{--tt===0&&se.dispatchEvent(vt)};return Ie==null||Ie.forEach(pt=>{pt.addEventListener("load",$t)}),()=>{Ie==null||Ie.forEach(pt=>{pt.removeEventListener("load",$t)})}},[se])},mt=se=>{const[Ie,Re]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(!se)return()=>{};Re(!0);const tt=se.style;tt.setProperty("opacity","0");const vt=()=>{Re(!1),tt.setProperty("opacity","1")};return se.addEventListener(Ke,vt),()=>{se.removeEventListener(Ke,vt)}},[se]),Ie},rt=({element:se,onAppend:Ie,children:Re})=>{const[tt,vt]=(0,n.useState)((0,Je.Ue)({...(0,He.Z)(),insertionPoint:void 0}));st(se);const $t=mt(se),pt=(0,n.useCallback)(Et=>{if(!se||!Et)return;vt((0,Je.Ue)({...(0,He.Z)(),insertionPoint:se.querySelector("head")||void 0}));let At=Et.shadowRoot;At||(At=Et.attachShadow({mode:"open"})),At.replaceChildren(se),typeof Ie=="function"&&Ie(At)},[se,Ie]);return(0,h.jsxs)(h.Fragment,{children:[$t&&(0,h.jsx)(Ee.Ex,{}),(0,h.jsxs)(gt.ZP,{jss:tt,sheetsManager:new Map,children:[(0,h.jsx)("div",{ref:pt,"data-testid":"techdocs-native-shadowroot"}),Re]})]})};var ot=t(54073);const ut=()=>{const{shadowRoot:se}=useTechDocsReaderPage();return se},xt=se=>{const Ie=ut();return Ie?se.map(Re=>Ie==null?void 0:Ie.querySelectorAll(Re)).filter(Re=>Re.length).map(Re=>Array.from(Re)).flat():[]},Rt=se=>se.toString()&&se.rangeCount&&se.getRangeAt(0).getBoundingClientRect().top,We=(se=0)=>{const Ie=ut(),[Re,tt]=useState(null),vt=useMemo(()=>debounce(()=>{const $t=Ie,pt=$t.getSelection?$t.getSelection():document.getSelection();pt&&Rt(pt)?tt(pt):tt(null)},se),[Ie,tt,se]);return useEffect(()=>(window.document.addEventListener("selectionchange",vt),()=>window.document.removeEventListener("selectionchange",vt)),[vt]),Re}},52943:function(It,ze,t){"use strict";t.r(ze),t.d(ze,{EmbeddedDocsRouter:function(){return le},Router:function(){return ae},isTechDocsAvailable:function(){return _}});var h=t(52322),n=t(2784),W=t(73557),$=t(92848),g=t(93414),b=t(25271),l=t(89258),P=t(65124),ne=t(67896);const Q=({entity:A})=>{const L=(0,b.iB)(A);return(0,h.jsxs)(l.I6,{entityRef:L,children:[(0,h.jsx)(P.b,{}),(0,h.jsx)(ne.F,{withSearch:!1})]})};var X=t(18662),M=t(7476);const z="backstage.io/techdocs-ref",_=A=>{var L,O;return Boolean(A==null||(L=A.metadata)===null||L===void 0||(O=L.annotations)===null||O===void 0?void 0:O[z])},ae=()=>(0,h.jsxs)(W.Z5,{children:[(0,h.jsx)(W.AW,{path:"/",element:(0,h.jsx)(X.TechDocsIndexPage,{})}),(0,h.jsx)(W.AW,{path:"/:namespace/:kind/:name/*",element:(0,h.jsx)(M.TechDocsReaderPage,{})})]}),le=A=>{var L;const{children:O}=A,{entity:T}=(0,$.X2)(),S=(0,W.V$)([{path:"/*",element:(0,h.jsx)(Q,{entity:T}),children:[{path:"*",element:O}]}]);return((L=T.metadata.annotations)===null||L===void 0?void 0:L[z])?S:(0,h.jsx)(g.sk,{annotation:z})}},92077:function(It,ze,t){"use strict";t.d(ze,{k:function(){return g},p:function(){return $}});var h=t(23054),n=t(76372),W=t.n(n);class ${async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(l){const{kind:P,namespace:ne,name:Q}=l,M=`${await this.getApiOrigin()}/metadata/techdocs/${ne}/${P}/${Q}`,z=await this.fetchApi.fetch(`${M}`);if(!z.ok)throw await h.VL.fromResponse(z);return await z.json()}async getEntityMetadata(l){const{kind:P,namespace:ne,name:Q}=l,M=`${await this.getApiOrigin()}/metadata/entity/${ne}/${P}/${Q}`,z=await this.fetchApi.fetch(`${M}`);if(!z.ok)throw await h.VL.fromResponse(z);return await z.json()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.fetchApi=l.fetchApi}}class g{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var l;return(l=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&l!==void 0?l:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(l,P){const{kind:ne,namespace:Q,name:X}=l,z=`${await this.getStorageUrl()}/${Q}/${ne}/${X}/${P}`,_=await this.fetchApi.fetch(`${z.endsWith("/")?z:`${z}/`}index.html`);let ae="";switch(_.status){case 404:throw ae="Page not found. ",P||(ae+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(ae);case 500:throw ae="Could not generate documentation or an error in the TechDocs backend. ",new Error(ae);default:break}return _.text()}async syncEntityDocs(l,P=()=>{}){const{kind:ne,namespace:Q,name:X}=l,z=`${await this.getApiOrigin()}/sync/${Q}/${ne}/${X}`,{token:_}=await this.identityApi.getCredentials();return new Promise((ae,le)=>{const A=new n.EventSourcePolyfill(z,{withCredentials:!0,headers:_?{Authorization:`Bearer ${_}`}:{}});A.addEventListener("log",L=>{L.data&&P(JSON.parse(L.data))}),A.addEventListener("finish",L=>{let O=!1;L.data&&({updated:O}=JSON.parse(L.data)),ae(O?"updated":"cached")}),A.onerror=L=>{switch(A.close(),L.status){case 404:le(new h.dR(L.message));return;default:le(new Error(L.data));return}}})}async getBaseUrl(l,P,ne){const{kind:Q,namespace:X,name:M}=P,_=`${await this.getApiOrigin()}/static/docs/${X}/${Q}/${M}/${ne}`;return new URL(l,_.endsWith("/")?_:`${_}/`).toString()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.identityApi=l.identityApi,this.fetchApi=l.fetchApi}}},51953:function(It,ze,t){"use strict";t.d(ze,{D:function(){return h}});function h(n,W){return W.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?n:n.toLocaleLowerCase("en-US")}},3482:function(It,ze,t){"use strict";t.d(ze,{u:function(){return P}});var h=t(52322),n=t(2784),W=t(93414),$=t(92848),g=t(42081),b=t(48431),l=t(68435);const P=ne=>{const{initialFilter:Q="owned",columns:X,actions:M}=ne;return(0,h.jsx)(g.j,{children:(0,h.jsxs)(W.VY,{children:[(0,h.jsx)(W.yW,{title:"",children:(0,h.jsx)(W.qt,{children:"Discover documentation in your ecosystem."})}),(0,h.jsx)($.UO,{children:(0,h.jsxs)($._i,{children:[(0,h.jsxs)($._i.Filters,{children:[(0,h.jsx)(b.f,{}),(0,h.jsx)($.EW,{initialFilter:Q}),(0,h.jsx)($.dq,{}),(0,h.jsx)($.xE,{})]}),(0,h.jsx)($._i.Content,{children:(0,h.jsx)(l.n,{actions:M,columns:X})})]})})]})})}},85478:function(It,ze,t){"use strict";t.d(ze,{f:function(){return X}});var h=t(52322),n=t(95573),W=t(51953),$=t(25248),g=t(93414),b=t(94339),l=t(16111),P=t(24579),ne=t(14503),Q=t(2784);const X=le=>{const{entities:A}=le,L=(0,$.tg)(n.Fw),O=(0,$.h_)($.Ds);if(!A)return null;var T,S;return(0,h.jsx)(g.Oh,{"data-testid":"docs-explore",children:A!=null&&A.length?A.map((q,Te)=>(0,h.jsxs)(b.Z,{children:[(0,h.jsx)(l.Z,{children:(0,h.jsx)(g.hu,{title:(T=q.metadata.title)!==null&&T!==void 0?T:q.metadata.name})}),(0,h.jsx)(P.Z,{children:q.metadata.description}),(0,h.jsx)(ne.Z,{children:(0,h.jsx)(g.zx,{to:L({namespace:(0,W.D)((S=q.metadata.namespace)!==null&&S!==void 0?S:"default",O),kind:(0,W.D)(q.kind,O),name:(0,W.D)(q.metadata.name,O)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},Te)):null})};var M=t(92848);const z={title:"All Documentation",filterPredicate:()=>!0},_=({entities:le,group:A})=>{const{loading:L,isOwnedEntity:O}=useEntityOwnership(),T=le.filter(q=>A.filterPredicate==="ownedByUser"?L?!1:O(q):typeof A.filterPredicate=="function"&&A.filterPredicate(q)),S=(()=>typeof A.title=="string"?_jsx(ContentHeader,{title:A.title}):A.title)();return T.length===0?null:_jsxs(Content,{children:[S,_jsx(DocsCardGrid,{entities:T})]})},ae=({groups:le})=>{const{loading:A,error:L,entities:O}=useEntityList();if(L)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:L.toString()})});if(A)return _jsx(Progress,{});if(O.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,S;return O.sort((q,Te)=>((T=q.metadata.title)!==null&&T!==void 0?T:q.metadata.name).localeCompare((S=Te.metadata.title)!==null&&S!==void 0?S:Te.metadata.name)),_jsx(Content,{children:(le||[z]).map((q,Te)=>_jsx(_,{entities:O,group:q},`${q.title}-${Te}`))})}},68435:function(It,ze,t){"use strict";t.d(ze,{H:function(){return O},n:function(){return T}});var h=t(52322),n=t(2784),W=t(95074),$=t(76635),g=t(93414),b=t(92848),l=t(25248),P=t(25271),ne=t(95573),Q=t(39981),X=t(2337),M=t(11640),z=t(28347);const _=(0,X.Z)({root:{color:"#f3ba37"}})(M.Z),ae={createCopyDocsUrlAction(S){return q=>({icon:()=>(0,h.jsx)(Q.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>S(`${window.location.origin}${q.resolved.docsUrl}`)})},createStarEntityAction(S,q){return({entity:Te})=>{const et=S(Te);return{cellStyle:{paddingLeft:"1em"},icon:()=>et?(0,h.jsx)(_,{}):(0,h.jsx)(z.Z,{}),tooltip:et?"Remove from favorites":"Add to favorites",onClick:()=>q(Te)}}}};function le(S){return S.metadata.title||S.metadata.name}const A={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:S=>(0,h.jsx)(g.uw,{value:(0,h.jsx)(g.rU,{to:S.resolved.docsUrl,children:le(S.entity)}),subvalue:S.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:S})=>(0,h.jsx)(b.rI,{entityRefs:S.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var L=t(51953);const O=S=>{const{entities:q,title:Te,loading:et,columns:Xe,actions:Je}=S,[,He]=(0,W.Z)(),gt=(0,l.tg)(ne.Fw),Ee=(0,l.h_)(l.Ds);if(!q)return null;const Ke=q.map(rt=>{const ot=(0,b.hF)(rt,P.S4);var ut;return{entity:rt,resolved:{docsUrl:gt({namespace:(0,L.D)((ut=rt.metadata.namespace)!==null&&ut!==void 0?ut:"default",Ee),kind:(0,L.D)(rt.kind,Ee),name:(0,L.D)(rt.metadata.name,Ee)}),ownedByRelations:ot,ownedByRelationsTitle:ot.map(xt=>(0,b.$3)(xt,{defaultKind:"group"})).join(", ")}}}),st=[A.createNameColumn(),A.createOwnerColumn(),A.createTypeColumn()],mt=[ae.createCopyDocsUrlAction(He)];return(0,h.jsx)(h.Fragment,{children:et||Ke&&Ke.length>0?(0,h.jsx)(g.iA,{isLoading:et,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1},data:Ke,columns:Xe||st,actions:Je||mt,title:Te?`${Te} (${Ke.length})`:`All (${Ke.length})`}):(0,h.jsx)(g.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,h.jsx)(g.zx,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};O.columns=A,O.actions=ae;const T=S=>{var q;const{columns:Te,actions:et}=S,{loading:Xe,error:Je,entities:He,filters:gt}=(0,b.wp)(),{isStarredEntity:Ee,toggleStarredEntity:Ke}=(0,b.CR)(),[,st]=(0,W.Z)();var mt;const rt=(0,$.capitalize)((mt=(q=gt.user)===null||q===void 0?void 0:q.value)!==null&&mt!==void 0?mt:"all"),ot=[ae.createCopyDocsUrlAction(st),ae.createStarEntityAction(Ee,Ke)];return Je?(0,h.jsx)(g.GB,{severity:"error",title:"Could not load available documentation.",children:(0,h.jsx)(g.Oi,{language:"text",text:Je.toString()})}):(0,h.jsx)(O,{title:rt,entities:He,loading:Xe,actions:et||ot,columns:Te})};T.columns=A,T.actions=ae},18662:function(It,ze,t){"use strict";t.r(ze),t.d(ze,{TechDocsIndexPage:function(){return g}});var h=t(52322),n=t(2784),W=t(73557),$=t(3482);const g=b=>(0,W.pC)()||(0,h.jsx)($.u,{...b})},42081:function(It,ze,t){"use strict";t.d(ze,{j:function(){return g}});var h=t(52322),n=t(2784),W=t(93414),$=t(25248);const g=b=>{const{children:l}=b,P=(0,$.h_)($.Ds);var ne;const Q=`Documentation available in ${(ne=P.getOptionalString("organization.name"))!==null&&ne!==void 0?ne:"Backstage"}`;return(0,h.jsx)(W.g9,{title:"Documentation",subtitle:Q,themeId:"documentation",children:l})}},48431:function(It,ze,t){"use strict";t.d(ze,{f:function(){return $}});var h=t(2784),n=t(92848);class W{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":n.n3}}}const $=()=>{const{updateFilters:g}=(0,n.wp)();return(0,h.useEffect)(()=>{g({techdocs:new W})},[g]),null}},89258:function(It,ze,t){"use strict";t.d(ze,{I6:function(){return Q},Jl:function(){return ne},s4:function(){return g}});var h=t(61886),n=t(92077),W=t(95573),$=t(25248);const g=(0,$.rx)({id:"techdocs",apis:[(0,$.ni)({api:h.Dl,deps:{configApi:$.Ds,discoveryApi:$.NW,identityApi:$.$4,fetchApi:$.gP},factory:({configApi:X,discoveryApi:M,identityApi:z,fetchApi:_})=>new n.k({configApi:X,discoveryApi:M,identityApi:z,fetchApi:_})}),(0,$.ni)({api:h.gT,deps:{configApi:$.Ds,discoveryApi:$.NW,fetchApi:$.gP},factory:({configApi:X,discoveryApi:M,fetchApi:z})=>new n.p({configApi:X,discoveryApi:M,fetchApi:z})})],routes:{root:W._Z,docRoot:W.Fw,entityContent:W.pd}}),b=g.provide((0,$.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(t.bind(t,52943)).then(X=>X.Router),mountPoint:W._Z})),l=g.provide((0,$.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(t.bind(t,52943)).then(X=>X.EmbeddedDocsRouter),mountPoint:W.pd})),P=g.provide((0,$.P4)({name:"TechDocsCustomHome",component:()=>t.e(7560).then(t.bind(t,27560)).then(X=>X.TechDocsCustomHome),mountPoint:W._Z})),ne=g.provide((0,$.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(t.bind(t,18662)).then(X=>X.TechDocsIndexPage),mountPoint:W._Z})),Q=g.provide((0,$.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(t.bind(t,7476)).then(X=>X.TechDocsReaderPage),mountPoint:W.Fw}))},7476:function(It,ze,t){"use strict";t.r(ze),t.d(ze,{TechDocsReaderLayout:function(){return X},TechDocsReaderPage:function(){return M}});var h=t(52322),n=t(2784),W=t(73557),$=t(93414),g=t(61886),b=t(67896),l=t(93225),P=t(65124),ne=t(95573),Q=t(25248);const X=({withSearch:z,withHeader:_=!0})=>(0,h.jsxs)($.T3,{themeId:"documentation",children:[_&&(0,h.jsx)(l.S,{}),(0,h.jsx)(P.b,{}),(0,h.jsx)(b.F,{withSearch:z})]}),M=z=>{const{kind:_,name:ae,namespace:le}=(0,Q.Oi)(ne.Fw),{children:A,entityRef:L={kind:_,name:ae,namespace:le}}=z,O=(0,W.pC)();if(!A){const S=O?n.Children.toArray(O.props.children):[];var T;const Te=S.flatMap(et=>{var Xe;return(T=et==null||(Xe=et.props)===null||Xe===void 0?void 0:Xe.children)!==null&&T!==void 0?T:[]}).find(et=>!(0,Q.IY)(et,g.Zz));return(0,h.jsx)(g.ZS,{entityRef:L,children:Te||(0,h.jsx)(X,{})})}return(0,h.jsx)(g.ZS,{entityRef:L,children:({metadata:S,entityMetadata:q,onReady:Te})=>(0,h.jsx)("div",{className:"techdocs-reader-page",children:(0,h.jsx)($.T3,{themeId:"documentation",children:A instanceof Function?A({entityRef:L,techdocsMetadataValue:S.value,entityMetadataValue:q.value,onReady:Te}):A})})})}},67896:function(It,ze,t){"use strict";t.d(ze,{F:function(){return Me}});var h=t(52322),n=t(2784),W=t(79692),$=t(60905),g=t(61886),b=t(93414),l=t(17339),P=t(4614),ne=t(77277),Q=t(99688),X=t(12420),M=t(90436),z=t(61837),_=t(4190),ae=t(87685);const le=(0,W.Z)(C=>(0,X.Z)({paper:{width:"100%",[C.breakpoints.up("sm")]:{width:"75%"},[C.breakpoints.up("md")]:{width:"50%"},padding:C.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:C.palette.background.default}})),A=({buildLog:C,onClose:H})=>{const me=le(),ue=C.length===0?"Waiting for logs...":C.join(`
34
- `);return(0,h.jsxs)($.Z,{container:!0,direction:"column",className:me.root,spacing:0,wrap:"nowrap",children:[(0,h.jsxs)($.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,h.jsx)(M.Z,{variant:"h5",children:"Build Details"}),(0,h.jsx)(z.Z,{title:"Close the drawer",onClick:H,color:"inherit",children:(0,h.jsx)(ae.Z,{})},"dismiss")]}),(0,h.jsx)(b.nU,{text:ue,classes:{root:me.logs}})]})},L=({buildLog:C})=>{const H=le(),[me,ue]=(0,n.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ne.Z,{color:"inherit",onClick:()=>ue(!0),children:"Show Build Logs"}),(0,h.jsx)(_.ZP,{classes:{paper:H.paper},anchor:"right",open:me,onClose:()=>ue(!1),children:(0,h.jsx)(A,{buildLog:C,onClose:()=>ue(!1)})})]})};var O=t(25248);const T=({errorMessage:C})=>{const H=(0,O.h_)(O.Ds).getOptionalString("techdocs.builder");let me="";return H!=="local"&&(me="Note that techdocs.builder is not set to 'local' in your config, which means this Backstage app will not generate docs if they are not found. Make sure the project's docs are generated and published by some external process (e.g. CI/CD pipeline). Or change techdocs.builder to 'local' to generate docs from this Backstage instance."),(0,h.jsx)(b.mf,{status:"404",statusMessage:C||"Documentation not found",additionalInfo:me})};var S=t(95481);const q=(0,W.Z)(C=>({root:{marginBottom:C.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),Te=()=>{let C=null;const H=q(),{state:me,contentReload:ue,contentErrorMessage:Ce,syncErrorMessage:ke,buildLog:Ue}=(0,S.DK)();return me==="INITIAL_BUILD"&&(C=(0,h.jsx)(Q.Z,{classes:{root:H.root},variant:"outlined",severity:"info",icon:(0,h.jsx)(P.Z,{size:"24px"}),action:(0,h.jsx)(L,{buildLog:Ue}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),me==="CONTENT_STALE_REFRESHING"&&(C=(0,h.jsx)(Q.Z,{variant:"outlined",severity:"info",icon:(0,h.jsx)(P.Z,{size:"24px"}),action:(0,h.jsx)(L,{buildLog:Ue}),classes:{root:H.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),me==="CONTENT_STALE_READY"&&(C=(0,h.jsx)(Q.Z,{variant:"outlined",severity:"success",action:(0,h.jsx)(ne.Z,{color:"inherit",onClick:()=>ue(),children:"Refresh"}),classes:{root:H.root},children:"A newer version of this documentation is now available, please refresh to view."})),me==="CONTENT_STALE_ERROR"&&(C=(0,h.jsxs)(Q.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(L,{buildLog:Ue}),classes:{root:H.root,message:H.message},children:["Building a newer version of this documentation failed."," ",ke]})),me==="CONTENT_NOT_FOUND"&&(C=(0,h.jsxs)(h.Fragment,{children:[ke&&(0,h.jsxs)(Q.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(L,{buildLog:Ue}),classes:{root:H.root,message:H.message},children:["Building a newer version of this documentation failed."," ",ke]}),(0,h.jsx)(T,{errorMessage:Ce})]})),C};var et=t(73557),Xe=t(60364),Je=t(41156),He=t(32838),gt=t(35368),Ee=t.n(gt);const Ke=/main\.[A-Fa-f0-9]{8}\.min\.css$/,st=/^https:\/\/fonts\.googleapis\.com/,mt=/^https:\/\/fonts\.gstatic\.com/,rt=C=>C.nodeName==="LINK",ot=C=>{const H=(C==null?void 0:C.getAttribute("href"))||"",me=H.match(Ke),ue=H.match(st),Ce=H.match(mt);return me||ue||Ce},ut=C=>(rt(C)&&!ot(C)&&C.remove(),C),xt=C=>C.nodeName==="IFRAME",Rt=(C,H)=>{const me=C.getAttribute("src")||"";try{const{host:ue}=new URL(me);return H.includes(ue)}catch{return!1}},We=C=>H=>(xt(H)&&!Rt(H,C)&&H.remove(),H),se=()=>{const C=(0,O.h_)(O.Ds);return(0,n.useMemo)(()=>C.getOptionalConfig("techdocs.sanitizer"),[C])},Ie=()=>{const C=se();return(0,n.useCallback)(async H=>{const me=C==null?void 0:C.getOptionalStringArray("allowedIframeHosts");Ee().addHook("beforeSanitizeElements",ut);const ue=["link"];return me&&(ue.push("iframe"),Ee().addHook("beforeSanitizeElements",We(me))),Ee().sanitize(H.innerHTML,{ADD_TAGS:ue,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[C])};var Re=t(41128),tt=({theme:C})=>`
35
- /*================== Variables ==================*/
36
- /*
37
- 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.
38
- 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.
39
- */
40
-
41
- :host {
42
- /* FONT */
43
- --md-default-fg-color: ${C.palette.text.primary};
44
- --md-default-fg-color--light: ${C.palette.text.secondary};
45
- --md-default-fg-color--lighter: ${(0,Re.$n)(C.palette.text.secondary,.7)};
46
- --md-default-fg-color--lightest: ${(0,Re.$n)(C.palette.text.secondary,.3)};
47
-
48
- /* BACKGROUND */
49
- --md-default-bg-color:${C.palette.background.default};
50
- --md-default-bg-color--light: ${C.palette.background.paper};
51
- --md-default-bg-color--lighter: ${(0,Re.$n)(C.palette.background.paper,.7)};
52
- --md-default-bg-color--lightest: ${(0,Re.$n)(C.palette.background.paper,.3)};
53
-
54
- /* PRIMARY */
55
- --md-primary-fg-color: ${C.palette.primary.main};
56
- --md-primary-fg-color--light: ${C.palette.primary.light};
57
- --md-primary-fg-color--dark: ${C.palette.primary.dark};
58
- --md-primary-bg-color: ${C.palette.primary.contrastText};
59
- --md-primary-bg-color--light: ${(0,Re.$n)(C.palette.primary.contrastText,.7)};
60
-
61
- /* ACCENT */
62
- --md-accent-fg-color: var(--md-primary-fg-color);
63
-
64
- /* SHADOW */
65
- --md-shadow-z1: ${C.shadows[1]};
66
- --md-shadow-z2: ${C.shadows[2]};
67
- --md-shadow-z3: ${C.shadows[3]};
68
-
69
- /* EXTENSIONS */
70
- --md-admonition-fg-color: var(--md-default-fg-color);
71
- --md-admonition-bg-color: var(--md-default-bg-color);
72
- /* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */
73
- --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>');
74
- --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>');
75
- --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>');
76
- --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>');
77
- --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>');
78
- --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>');
79
- --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>');
80
- --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>');
81
- --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>');
82
- --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>');
83
- --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>');
84
- --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>');
85
- --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>');
86
- --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>');
87
- --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>');
88
- --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>');
89
- --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>');
90
- --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>');
91
- --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>');
92
- --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>');
93
- --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>');
94
- --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>');
95
- --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>');
96
- --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>');
97
- --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>');
98
- --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>');
99
- }
100
-
101
- :host > * {
102
- /* CODE */
103
- --md-code-fg-color: ${C.palette.text.primary};
104
- --md-code-bg-color: ${C.palette.background.paper};
105
- --md-code-hl-color: ${(0,Re.Fq)(C.palette.warning.main,.5)};
106
- --md-code-hl-keyword-color: ${C.palette.type==="dark"?C.palette.primary.light:C.palette.primary.dark};
107
- --md-code-hl-function-color: ${C.palette.type==="dark"?C.palette.secondary.light:C.palette.secondary.dark};
108
- --md-code-hl-string-color: ${C.palette.type==="dark"?C.palette.success.light:C.palette.success.dark};
109
- --md-code-hl-number-color: ${C.palette.type==="dark"?C.palette.error.light:C.palette.error.dark};
110
- --md-code-hl-constant-color: var(--md-code-hl-function-color);
111
- --md-code-hl-special-color: var(--md-code-hl-function-color);
112
- --md-code-hl-name-color: var(--md-code-fg-color);
113
- --md-code-hl-comment-color: var(--md-default-fg-color--light);
114
- --md-code-hl-generic-color: var(--md-default-fg-color--light);
115
- --md-code-hl-variable-color: var(--md-default-fg-color--light);
116
- --md-code-hl-operator-color: var(--md-default-fg-color--light);
117
- --md-code-hl-punctuation-color: var(--md-default-fg-color--light);
118
-
119
- /* TYPESET */
120
- --md-typeset-font-size: 1rem;
121
- --md-typeset-color: var(--md-default-fg-color);
122
- --md-typeset-a-color: var(--md-accent-fg-color);
123
- --md-typeset-table-color: ${C.palette.text.primary};
124
- --md-typeset-del-color: ${C.palette.type==="dark"?(0,Re.Fq)(C.palette.error.dark,.5):(0,Re.Fq)(C.palette.error.light,.5)};
125
- --md-typeset-ins-color: ${C.palette.type==="dark"?(0,Re.Fq)(C.palette.success.dark,.5):(0,Re.Fq)(C.palette.success.light,.5)};
126
- --md-typeset-mark-color: ${C.palette.type==="dark"?(0,Re.Fq)(C.palette.warning.dark,.5):(0,Re.Fq)(C.palette.warning.light,.5)};
127
- }
128
-
129
- @media screen and (max-width: 76.1875em) {
130
- :host > * {
131
- /* TYPESET */
132
- --md-typeset-font-size: .9rem;
133
- }
134
- }
135
-
136
- @media screen and (max-width: 600px) {
137
- :host > * {
138
- /* TYPESET */
139
- --md-typeset-font-size: .7rem;
140
- }
141
- }
142
- `,vt=({theme:C})=>`
143
- /*================== Reset ==================*/
144
-
145
- body {
146
- --md-text-color: var(--md-default-fg-color);
147
- --md-text-link-color: var(--md-accent-fg-color);
148
- --md-text-font-family: ${C.typography.fontFamily};
149
- font-family: var(--md-text-font-family);
150
- background-color: unset;
151
- }
152
- `;const $t="224px";var pt=({theme:C,sidebar:H})=>`
153
- /*================== Layout ==================*/
154
-
155
- .md-grid {
156
- max-width: 100%;
157
- margin: 0;
158
- }
159
-
160
- .md-nav {
161
- font-size: calc(var(--md-typeset-font-size) * 0.9);
162
- }
163
- .md-nav__link {
164
- display: flex;
165
- align-items: center;
166
- justify-content: space-between;
167
- }
168
- .md-nav__icon {
169
- height: 20px !important;
170
- width: 20px !important;
171
- margin-left:${C.spacing(1)}px;
172
- }
173
- .md-nav__icon svg {
174
- margin: 0;
175
- width: 20px !important;
176
- height: 20px !important;
177
- }
178
- .md-nav__icon:after {
179
- width: 20px !important;
180
- height: 20px !important;
181
- }
182
-
183
- .md-nav__item--active > .md-nav__link, a.md-nav__link--active {
184
- text-decoration: underline;
185
- color: var(--md-typeset-a-color);
186
- }
187
-
188
- .md-main__inner {
189
- margin-top: 0;
190
- }
191
-
192
- .md-sidebar {
193
- bottom: 75px;
194
- position: fixed;
195
- width: 16rem;
196
- overflow-y: auto;
197
- overflow-x: hidden;
198
- scrollbar-color: rgb(193, 193, 193) #eee;
199
- scrollbar-width: thin;
200
- }
201
- .md-sidebar .md-sidebar__scrollwrap {
202
- width: calc(12.1rem);
203
- }
204
- .md-sidebar--secondary {
205
- right: ${C.spacing(3)}px;
206
- }
207
- .md-sidebar::-webkit-scrollbar {
208
- width: 5px;
209
- }
210
- .md-sidebar::-webkit-scrollbar-button {
211
- width: 5px;
212
- height: 5px;
213
- }
214
- .md-sidebar::-webkit-scrollbar-track {
215
- background: #eee;
216
- border: 1 px solid rgb(250, 250, 250);
217
- box-shadow: 0px 0px 3px #dfdfdf inset;
218
- border-radius: 3px;
219
- }
220
- .md-sidebar::-webkit-scrollbar-thumb {
221
- width: 5px;
222
- background: rgb(193, 193, 193);
223
- border: transparent;
224
- border-radius: 3px;
225
- }
226
- .md-sidebar::-webkit-scrollbar-thumb:hover {
227
- background: rgb(125, 125, 125);
228
- }
229
-
230
- .md-content {
231
- max-width: calc(100% - 16rem * 2);
232
- margin-left: 16rem;
233
- margin-bottom: 50px;
234
- }
235
-
236
- .md-footer {
237
- position: fixed;
238
- bottom: 0px;
239
- }
240
- .md-footer__title {
241
- background-color: unset;
242
- }
243
- .md-footer-nav__link {
244
- width: 16rem;
245
- }
246
-
247
- .md-dialog {
248
- background-color: unset;
249
- }
250
-
251
- @media screen and (min-width: 76.25em) {
252
- .md-sidebar {
253
- height: auto;
254
- }
255
- }
256
-
257
- @media screen and (max-width: 76.1875em) {
258
- .md-nav {
259
- transition: none !important;
260
- background-color: var(--md-default-bg-color)
261
- }
262
- .md-nav--primary .md-nav__title {
263
- cursor: auto;
264
- color: var(--md-default-fg-color);
265
- font-weight: 700;
266
- white-space: normal;
267
- line-height: 1rem;
268
- height: auto;
269
- display: flex;
270
- flex-flow: column;
271
- row-gap: 1.6rem;
272
- padding: 1.2rem .8rem .8rem;
273
- background-color: var(--md-default-bg-color);
274
- }
275
- .md-nav--primary .md-nav__title~.md-nav__list {
276
- box-shadow: none;
277
- }
278
- .md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
279
- border-top: none;
280
- }
281
- .md-nav--primary .md-nav__title .md-nav__button {
282
- display: none;
283
- }
284
- .md-nav--primary .md-nav__title .md-nav__icon {
285
- color: var(--md-default-fg-color);
286
- position: static;
287
- height: auto;
288
- margin: 0 0 0 -0.2rem;
289
- }
290
- .md-nav--primary > .md-nav__title [for="none"] {
291
- padding-top: 0;
292
- }
293
- .md-nav--primary .md-nav__item {
294
- border-top: none;
295
- }
296
- .md-nav--primary :is(.md-nav__title,.md-nav__item) {
297
- font-size : var(--md-typeset-font-size);
298
- }
299
- .md-nav .md-source {
300
- display: none;
301
- }
302
-
303
- .md-sidebar {
304
- height: 100%;
305
- }
306
- .md-sidebar--primary {
307
- width: 12.1rem !important;
308
- z-index: 200;
309
- left: ${H.isPinned?`calc(-12.1rem + ${$t})`:"calc(-12.1rem + 72px)"} !important;
310
- }
311
- .md-sidebar--secondary:not([hidden]) {
312
- display: none;
313
- }
314
-
315
- .md-content {
316
- max-width: 100%;
317
- margin-left: 0;
318
- }
319
-
320
- .md-header__button {
321
- margin: 0.4rem 0;
322
- margin-left: 0.4rem;
323
- padding: 0;
324
- }
325
-
326
- .md-overlay {
327
- left: 0;
328
- }
329
-
330
- .md-footer {
331
- position: static;
332
- padding-left: 0;
333
- }
334
- .md-footer-nav__link {
335
- /* footer links begin to overlap at small sizes without setting width */
336
- width: 50%;
337
- }
338
- }
339
-
340
- @media screen and (max-width: 600px) {
341
- .md-sidebar--primary {
342
- left: -12.1rem !important;
343
- width: 12.1rem;
344
- }
345
- }
346
- `;const Et=["h1","h2","h3","h4","h5","h6"];var At=({theme:C})=>`
347
- /*================== Typeset ==================*/
348
-
349
- .md-typeset {
350
- font-size: var(--md-typeset-font-size);
351
- }
352
-
353
- ${Et.reduce((H,me)=>{var ue;const Ce=(ue=C.typography.htmlFontSize)!==null&&ue!==void 0?ue:16,ke=C.typography[me],{lineHeight:Ue,fontFamily:lt,fontWeight:St,fontSize:Ye}=ke,ft=yt=>{let ct=1;return typeof yt=="number"&&(ct=yt/Ce*.6),typeof yt=="string"&&(ct=yt.replace("rem","")),`calc(${ct} * var(--md-typeset-font-size))`};return H.concat(`
354
- .md-typeset ${me} {
355
- color: var(--md-default-fg-color);
356
- line-height: ${Ue};
357
- font-family: ${lt};
358
- font-weight: ${St};
359
- font-size: ${ft(Ye)};
360
- }
361
- `)},"")}
362
-
363
- .md-typeset .md-content__button {
364
- color: var(--md-default-fg-color);
365
- }
366
-
367
- .md-typeset hr {
368
- border-bottom: 0.05rem dotted ${C.palette.divider};
369
- }
370
-
371
- .md-typeset details {
372
- font-size: var(--md-typeset-font-size) !important;
373
- }
374
- .md-typeset details summary {
375
- padding-left: 2.5rem !important;
376
- }
377
- .md-typeset details summary:before,
378
- .md-typeset details summary:after {
379
- top: 50% !important;
380
- width: 20px !important;
381
- height: 20px !important;
382
- transform: rotate(0deg) translateY(-50%) !important;
383
- }
384
- .md-typeset details[open] > summary:after {
385
- transform: rotate(90deg) translateX(-50%) !important;
386
- }
387
-
388
- .md-typeset blockquote {
389
- color: var(--md-default-fg-color--light);
390
- border-left: 0.2rem solid var(--md-default-fg-color--light);
391
- }
392
-
393
- .md-typeset table:not([class]) {
394
- font-size: var(--md-typeset-font-size);
395
- border: 1px solid var(--md-default-fg-color);
396
- border-bottom: none;
397
- border-collapse: collapse;
398
- }
399
- .md-typeset table:not([class]) th {
400
- font-weight: bold;
401
- }
402
- .md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
403
- border-bottom: 1px solid var(--md-default-fg-color);
404
- }
405
-
406
- .md-typeset pre > code::-webkit-scrollbar-thumb {
407
- background-color: hsla(0, 0%, 0%, 0.32);
408
- }
409
- .md-typeset pre > code::-webkit-scrollbar-thumb:hover {
410
- background-color: hsla(0, 0%, 0%, 0.87);
411
- }
412
- `,kt=()=>`
413
- /*================== Animations ==================*/
414
- /*
415
- Disable CSS animations on link colors as they lead to issues in dark mode.
416
- The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
417
- */
418
- .md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
419
- transition: none;
420
- }
421
- `,Xt=({theme:C})=>`
422
- /*================== Extensions ==================*/
423
-
424
- /* HIGHLIGHT */
425
- .highlight .md-clipboard:after {
426
- content: unset;
427
- }
428
-
429
- .highlight .nx {
430
- color: ${C.palette.type==="dark"?"#ff53a3":"#ec407a"};
431
- }
432
-
433
- /* CODE HILITE */
434
- .codehilite .gd {
435
- background-color: ${C.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
436
- }
437
-
438
- .codehilite .gi {
439
- background-color: ${C.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
440
- }
441
-
442
- /* TABBED */
443
- .tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
444
- .tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
445
- .tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
446
- .tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
447
- .tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
448
- .tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
449
- .tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
450
- .tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
451
- .tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
452
- .tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
453
- .tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
454
- .tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
455
- .tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
456
- .tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
457
- .tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
458
- .tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
459
- .tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
460
- .tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
461
- .tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
462
- .tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
463
- color: var(--md-accent-fg-color);
464
- border-color: var(--md-accent-fg-color);
465
- }
466
-
467
- /* TASK-LIST */
468
- .task-list-control .task-list-indicator::before {
469
- background-color: ${C.palette.action.disabledBackground};
470
- }
471
- .task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
472
- background-color: ${C.palette.success.main};
473
- }
474
-
475
- /* ADMONITION */
476
- .admonition {
477
- font-size: var(--md-typeset-font-size) !important;
478
- }
479
- .admonition .admonition-title {
480
- padding-left: 2.5rem !important;
481
- }
482
-
483
- .admonition .admonition-title:before {
484
- top: 50% !important;
485
- width: 20px !important;
486
- height: 20px !important;
487
- transform: translateY(-50%) !important;
488
- }
489
- `;const Wt=[tt,vt,pt,At,kt,Xt],Vt=()=>(0,b.Pf)(),Yt=()=>{const C=Vt(),H=(0,Xe.Z)();return(0,n.useMemo)(()=>{const me={theme:H,sidebar:C};return Wt.reduce((ue,Ce)=>ue+Ce(me),"")},[H,C])},cn=()=>{const C=Yt();return(0,n.useCallback)(H=>(H.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${C}</style>`),H),[C])},on=(C,H,me)=>{const ue=C==="src"&&H.endsWith(".svg"),Ce=!H.match(/^([a-z]*:)?\/\//i),ke=H.startsWith(me);return ue&&(Ce||ke)},Zn=({techdocsStorageApi:C,entityId:H,path:me})=>async ue=>{const Ce=await C.getApiOrigin(),ke=async(Ue,lt)=>{for(const St of Ue)if(St.hasAttribute(lt)){const Ye=St.getAttribute(lt);if(!Ye)return;const ft=await C.getBaseUrl(Ye,H,me);if(on(lt,Ye,Ce))try{const ct=await(await fetch(ft,{credentials:"include"})).text();St.setAttribute(lt,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(ct)))}`)}catch{St.setAttribute("alt",`Error: ${Ye}`)}else St.setAttribute(lt,ft)}};return await Promise.all([ke(ue.querySelectorAll("img"),"src"),ke(ue.querySelectorAll("script"),"src"),ke(ue.querySelectorAll("source"),"src"),ke(ue.querySelectorAll("link"),"href"),ke(ue.querySelectorAll("a[download]"),"href")]),ue};var bn=t(79158),Dn=t(67097),pn=t(28316),dn=t(82717),Jt=t.n(dn);const Nn=C=>H=>{var me;const ue=H.querySelector('[title="Edit this page"]');if(!ue||!ue.href)return H;const Ce=new URL(ue.href),ke=C.byUrl(Ce);if((ke==null?void 0:ke.type)!=="github"&&(ke==null?void 0:ke.type)!=="gitlab")return H;const Ue=((me=H.querySelector("article>h1"))===null||me===void 0?void 0:me.childNodes[0].textContent)||"",lt=encodeURIComponent(`Documentation Feedback: ${Ue}`),St=encodeURIComponent(`Page source:
490
- ${ue.href}
491
-
492
- Feedback:`),Ye=(ke==null?void 0:ke.type)==="github"?(0,bn.BT)(Ce.href,"blob"):Ce.href,ft=Jt()(Ye),yt=`/${ft.organization}/${ft.name}`,ct=ue.cloneNode();switch(ke==null?void 0:ke.type){case"gitlab":ct.href=`${Ce.origin}${yt}/issues/new?issue[title]=${lt}&issue[description]=${St}`;break;case"github":ct.href=`${Ce.origin}${yt}/issues/new?title=${lt}&body=${St}`;break;default:return H}return pn.render(n.createElement(Dn.Z),ct),ct.style.paddingLeft="5px",ct.title="Leave feedback for this page",ct.id="git-feedback-link",ue==null||ue.insertAdjacentElement("beforebegin",ct),H};var Fn=t(44882);const un=()=>C=>{const H=C.querySelector('.md-header label[for="__drawer"]'),me=C.querySelector("article");if(!H||!me)return C;const ue=H.cloneNode();return pn.render(n.createElement(Fn.Z),ue),ue.id="toggle-sidebar",ue.title="Toggle Sidebar",ue.classList.add("md-content__button"),ue.style.setProperty("padding","0 0 0 5px"),ue.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),me==null||me.prepend(ue),C},fn=()=>C=>(((me,ue)=>{Array.from(me).filter(Ce=>Ce.hasAttribute(ue)).forEach(Ce=>{const ke=Ce.getAttribute(ue);if(ke){ke.match(/^https?:\/\//i)&&Ce.setAttribute("target","_blank");try{const Ue=gn(window.location.href);Ce.setAttribute(ue,new URL(ke,Ue).toString())}catch{Ce.replaceWith(Ce.textContent||ke)}}})})(Array.from(C.getElementsByTagName("a")),"href"),C);function gn(C){const H=new URL(C);return!H.pathname.endsWith("/")&&!H.pathname.endsWith(".html")&&(H.pathname+="/"),H.toString()}const In=({baseUrl:C,onClick:H})=>me=>(Array.from(me.getElementsByTagName("a")).forEach(ue=>{ue.addEventListener("click",Ce=>{const Ue=ue.getAttribute("href");!Ue||Ue.startsWith(C)&&!ue.hasAttribute("download")&&(Ce.preventDefault(),H(Ce,Ue))})}),me);var Rn=t(15459),mn=t(80030),ge=t(72379),ee=t(41547);const Ae=(0,Rn.Z)(C=>({tooltip:{fontSize:"inherit",color:C.palette.text.primary,margin:0,padding:C.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(mn.ZP),Fe=()=>(0,h.jsx)(ge.Z,{children:(0,h.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),qe=({text:C})=>{const[H,me]=(0,n.useState)(!1),ue=(0,n.useCallback)(()=>{window.navigator.clipboard.writeText(C),me(!0)},[C]),Ce=(0,n.useCallback)(()=>{me(!1)},[me]);return(0,h.jsx)(Ae,{title:"Copied to clipboard",placement:"left",open:H,onClose:Ce,leaveDelay:1e3,children:(0,h.jsx)("button",{className:"md-clipboard md-icon",onClick:ue,children:(0,h.jsx)(Fe,{})})})},bt=C=>H=>{const me=H.querySelectorAll("pre > code");for(const Ce of me){var ue;const ke=Ce.textContent||"",Ue=document.createElement("div");Ce==null||(ue=Ce.parentElement)===null||ue===void 0||ue.prepend(Ue),pn.render((0,h.jsx)(ee.Z,{theme:C,children:(0,h.jsx)(qe,{text:ke})}),Ue)}return H},ie=()=>C=>{var H;return(H=C.querySelector(".md-header"))===null||H===void 0||H.remove(),C},k=()=>C=>{var H,me;return(H=C.querySelector(".md-footer .md-copyright"))===null||H===void 0||H.remove(),(me=C.querySelector(".md-footer-copyright"))===null||me===void 0||me.remove(),C},ce=({onLoading:C,onLoaded:H})=>me=>(C(),me.addEventListener(g.Ox,function ue(){H(),me.removeEventListener(g.Ox,ue)}),me),Be=()=>C=>(setTimeout(()=>{if(window.location.hash){var H;const me=window.location.hash.slice(1);(H=C==null?void 0:C.querySelector(`[id="${me}"]`))===null||H===void 0||H.scrollIntoView()}},200),C),D=()=>C=>(setTimeout(()=>{const H=C==null?void 0:C.querySelectorAll("li.md-nav__item--active");H.length!==0&&(H.forEach(ue=>{const Ce=ue==null?void 0:ue.querySelector("input");Ce!=null&&Ce.checked||Ce==null||Ce.click()}),H[H.length-1].scrollIntoView())},200),C),U=async(C,H)=>{let me;if(typeof C=="string")me=new DOMParser().parseFromString(C,"text/html").documentElement;else if(C instanceof Element)me=C;else throw new Error("dom is not a recognized type");for(const ue of H)me=await ue(me);return me},de="screen and (max-width: 76.1875em)",fe=C=>{const H=(0,et.s0)(),me=(0,Xe.Z)(),ue=(0,Je.Z)(de),Ce=Ie(),ke=cn(),Ue=(0,O.z$)(),lt=(0,O.h_)(g.Dl),St=(0,O.h_)(He.q3),{state:Ye,path:ft,content:yt}=(0,S.DK)(),[ct,Tt]=(0,n.useState)(null),Nt=(0,g.ux)(ct),Ft=(0,n.useCallback)(()=>{if(!ct)return;ct.querySelectorAll(".md-sidebar").forEach(Mt=>{if(ue)Mt.style.top="0px";else{const vn=document==null?void 0:document.querySelector(".techdocs-reader-page");var an;const Ln=(an=vn==null?void 0:vn.getBoundingClientRect().top)!==null&&an!==void 0?an:0;var Cn;let zn=(Cn=ct.getBoundingClientRect().top)!==null&&Cn!==void 0?Cn:0;const tn=ct.querySelector(".md-container > .md-tabs");var Jn;const yn=(Jn=tn==null?void 0:tn.getBoundingClientRect().height)!==null&&Jn!==void 0?Jn:0;zn<Ln&&(zn=Ln),Mt.style.top=`${Math.max(zn,0)+yn}px`}Mt.style.setProperty("opacity","1")})},[ct,ue]);(0,n.useEffect)(()=>(window.addEventListener("resize",Ft),window.addEventListener("scroll",Ft,!0),()=>{window.removeEventListener("resize",Ft),window.removeEventListener("scroll",Ft,!0)}),[ct,Ft]);const Un=(0,n.useCallback)(()=>{if(!ct)return;const Ut=ct.querySelector(".md-footer");Ut&&(Ut.style.width=`${ct.getBoundingClientRect().width}px`)},[ct]);(0,n.useEffect)(()=>(window.addEventListener("resize",Un),()=>{window.removeEventListener("resize",Un)}),[ct,Un]),(0,n.useEffect)(()=>{Nt||(Un(),Ft())},[Ye,Nt,Un,Ft]);const Mn=(0,n.useCallback)((Ut,Mt)=>U(Ut,[Ce,Zn({techdocsStorageApi:lt,entityId:C,path:Mt}),fn(),un(),ie(),k(),Nn(St),ke]),[C,St,lt,Ce,ke]),Sn=(0,n.useCallback)(async Ut=>U(Ut,[Be(),D(),bt(me),In({baseUrl:window.location.origin,onClick:(Mt,an)=>{var Cn;const Jn=Mt.ctrlKey||Mt.metaKey,vn=new URL(an),Ln=`${vn.pathname}${vn.search}${vn.hash}`,zn=((Cn=Mt.target)===null||Cn===void 0?void 0:Cn.innerText)||an,tn=an.replace(window.location.origin,"");if(Ue.captureEvent("click",zn,{attributes:{to:tn}}),vn.hash)if(Jn)window.open(Ln,"_blank");else{var yn;H(Ln),(yn=Ut==null?void 0:Ut.querySelector(`[id="${vn.hash.slice(1)}"]`))===null||yn===void 0||yn.scrollIntoView()}else Jn?window.open(Ln,"_blank"):H(Ln)}}),ce({onLoading:()=>{},onLoaded:()=>{var Mt;(Mt=Ut.querySelector(".md-nav__title"))===null||Mt===void 0||Mt.removeAttribute("for")}}),ce({onLoading:()=>{Array.from(Ut.querySelectorAll(".md-sidebar")).forEach(an=>{an.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[me,H,Ue]);return(0,n.useEffect)(()=>{if(!yt)return()=>{};let Ut=!0;return Mn(yt,ft).then(async Mt=>{if(!(Mt!=null&&Mt.innerHTML)||!Ut)return;window.scroll({top:0});const an=await Sn(Mt);Tt(an)}),()=>{Ut=!1}},[yt,ft,Mn,Sn]),ct};var ye=t(8560);const Pe=()=>{const C=(0,g.$L)(),{shadowRoot:H}=(0,g.x1)(),me=H==null?void 0:H.querySelector('[data-md-component="content"]'),ue=H==null?void 0:H.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let Ce=ue==null?void 0:ue.querySelector('[data-techdocs-addons-location="primary sidebar"]');Ce||(Ce=document.createElement("div"),Ce.setAttribute("data-techdocs-addons-location","primary sidebar"),ue==null||ue.prepend(Ce));const ke=H==null?void 0:H.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Ue=ke==null?void 0:ke.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Ue||(Ue=document.createElement("div"),Ue.setAttribute("data-techdocs-addons-location","secondary sidebar"),ke==null||ke.prepend(Ue)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ye.Z,{container:Ce,children:C.renderComponentsByLocation(g.oZ.PrimarySidebar)}),(0,h.jsx)(ye.Z,{container:me,children:C.renderComponentsByLocation(g.oZ.Content)}),(0,h.jsx)(ye.Z,{container:Ue,children:C.renderComponentsByLocation(g.oZ.SecondarySidebar)})]})},Le=(0,W.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),Me=(0,S.m1)(C=>{var H;const{withSearch:me=!0,onReady:ue}=C,Ce=Le(),{entityMetadata:{value:ke,loading:Ue},entityRef:lt,setShadowRoot:St}=(0,g.x1)(),Ye=fe(lt),ft=(0,n.useCallback)(yt=>{St(yt),ue instanceof Function&&ue()},[St,ue]);return Ue===!1&&!ke?(0,h.jsx)(b.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):Ye?(0,h.jsx)(b.VY,{children:(0,h.jsxs)($.Z,{container:!0,children:[(0,h.jsx)($.Z,{xs:12,item:!0,children:(0,h.jsx)(Te,{})}),me&&(0,h.jsx)($.Z,{className:Ce.search,xs:"auto",item:!0,children:(0,h.jsx)(l.S,{entityId:lt,entityTitle:ke==null||(H=ke.metadata)===null||H===void 0?void 0:H.title})}),(0,h.jsx)($.Z,{xs:12,item:!0,children:(0,h.jsx)(g.VA,{element:Ye,onAppend:ft,children:(0,h.jsx)(Pe,{})})})]})}):(0,h.jsx)(b.VY,{children:(0,h.jsx)($.Z,{container:!0,children:(0,h.jsx)($.Z,{xs:12,item:!0,children:(0,h.jsx)(Te,{})})})})}),nt=null},93225:function(It,ze,t){"use strict";t.d(ze,{S:function(){return ae}});var h=t(52322),n=t(2784),W=t(18671),$=t(60905),g=t(98069),b=t(73250),l=t(61886),P=t(92848),ne=t(25271),Q=t(93414),X=t(25248),M=t(76635),z=t(95573);const _=(0,h.jsx)(g.Z,{animation:"wave",variant:"text",height:40}),ae=le=>{const{children:A}=le,L=(0,l.$L)(),O=(0,X.h_)(X.Ds),{title:T,setTitle:S,subtitle:q,setSubtitle:Te,entityRef:et,metadata:{value:Xe,loading:Je},entityMetadata:{value:He,loading:gt}}=(0,l.x1)();(0,n.useEffect)(()=>{!Xe||(S(Xe.site_name),Te(()=>{let{site_description:se}=Xe;return(!se||se==="None")&&(se=""),se}))},[Xe,S,Te]);const Ee=O.getOptional("app.title")||"Backstage",Ke=[T,q,Ee].filter(Boolean).join(" | "),{locationMetadata:st,spec:mt}=He||{},rt=mt==null?void 0:mt.lifecycle,ot=He?(0,P.hF)(He,ne.S4):[],ut=(0,X.tg)(z._Z)(),xt=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Q.i9,{label:(0,M.capitalize)((He==null?void 0:He.kind)||"entity"),value:(0,h.jsx)(P.dx,{color:"inherit",entityRef:et,title:He==null?void 0:He.metadata.title,defaultKind:"Component"})}),ot.length>0&&(0,h.jsx)(Q.i9,{label:"Owner",value:(0,h.jsx)(P.rI,{color:"inherit",entityRefs:ot,defaultKind:"group"})}),rt?(0,h.jsx)(Q.i9,{label:"Lifecycle",value:rt}):null,st&&st.type!=="dir"&&st.type!=="file"?(0,h.jsx)(Q.i9,{label:"",value:(0,h.jsxs)($.Z,{container:!0,direction:"column",alignItems:"center",style:{color:"#fff"},children:[(0,h.jsx)($.Z,{style:{padding:0},item:!0,children:(0,h.jsx)(b.Z,{style:{marginTop:"-25px"}})}),(0,h.jsx)($.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:st.target}):null]});return!gt&&He===void 0||!Je&&Xe===void 0?null:(0,h.jsxs)(Q.h4,{type:"Documentation",typeLink:ut,title:T||_,subtitle:q===""?void 0:q||_,children:[(0,h.jsx)(W.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:Ke})}),xt,A,L.renderComponentsByLocation(l.oZ.Header)]})}},65124:function(It,ze,t){"use strict";t.d(ze,{b:function(){return M}});var h=t(52322),n=t(2784),W=t(79692),$=t(15223),g=t(95544),b=t(80030),l=t(61837),P=t(48348),ne=t(47603),Q=t(61886);const X=(0,W.Z)(z=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:z.spacing(3,3,0)}})),M=z=>{const _=X(),[ae,le]=(0,n.useState)(null),A=(0,n.useCallback)(et=>{le(et.currentTarget)},[]),L=(0,n.useCallback)(()=>{le(null)},[]),{entityMetadata:{value:O,loading:T}}=(0,Q.x1)(),S=(0,Q.$L)(),q=S.renderComponentsByLocation(Q.oZ.Subheader),Te=S.renderComponentsByLocation(Q.oZ.Settings);return!q&&!Te||T===!1&&!O?null:(0,h.jsx)($.Z,{classes:_,...z.toolbarProps,children:(0,h.jsxs)(g.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[q,Te?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(b.ZP,{title:"Settings",children:(0,h.jsx)(l.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:A,children:(0,h.jsx)(ne.Z,{})})}),(0,h.jsx)(P.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:ae,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(ae),onClose:L,keepMounted:!0,children:Te})]}):null]})})}},95481:function(It,ze,t){"use strict";t.d(ze,{DK:function(){return M},m1:function(){return _}});var h=t(52322),n=t(2784),W=t(73557),$=t(61886),g=t(25248),b=t(64279),l=t(77446);function P({contentLoading:ae,content:le,activeSyncState:A}){return ae||A==="BUILD_READY_RELOAD"||!le&&A==="CHECKING"?"CHECKING":!le&&A==="BUILDING"?"INITIAL_BUILD":le?A==="BUILDING"?"CONTENT_STALE_REFRESHING":A==="BUILD_READY"?"CONTENT_STALE_READY":A==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ne(ae,le){const A={...ae};switch(le.type){case"sync":le.state==="CHECKING"&&(A.buildLog=[]),A.activeSyncState=le.state,A.syncError=le.syncError;break;case"contentLoading":A.contentLoading=!0,A.contentError=void 0;break;case"content":typeof le.path=="string"&&(A.path=le.path),A.contentLoading=!1,A.content=le.content,A.contentError=le.contentError;break;case"buildLog":A.buildLog=A.buildLog.concat(le.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(A.activeSyncState)&&["contentLoading","content"].includes(le.type)&&(A.activeSyncState="UP_TO_DATE",A.buildLog=[]),A}function Q(ae,le,A,L){var O,T;const[S,q]=(0,n.useReducer)(ne,{activeSyncState:"CHECKING",path:L,contentLoading:!0,buildLog:[]}),Te=(0,g.h_)($.Dl),{retry:et}=(0,l.Z)(async()=>{q({type:"contentLoading"});try{const He=await Te.getEntityDocs({kind:ae,namespace:le,name:A},L);return q({type:"content",content:He,path:L}),He}catch(He){q({type:"content",contentError:He,path:L})}},[Te,ae,le,A,L]),Xe=(0,n.useRef)({content:void 0,reload:()=>{}});return Xe.current={content:S.content,reload:et},(0,b.default)(async()=>{q({type:"sync",state:"CHECKING"});const He=setTimeout(()=>{q({type:"sync",state:"BUILDING"})},1e3);try{switch(await Te.syncEntityDocs({kind:ae,namespace:le,name:A},Ee=>{q({type:"buildLog",log:Ee})})){case"updated":Xe.current.content?q({type:"sync",state:"BUILD_READY"}):(Xe.current.reload(),q({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":q({type:"sync",state:"UP_TO_DATE"});break;default:q({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(gt){q({type:"sync",state:"ERROR",syncError:gt})}finally{clearTimeout(He)}},[ae,A,le,Te,q,Xe]),{state:(0,n.useMemo)(()=>P({activeSyncState:S.activeSyncState,contentLoading:S.contentLoading,content:S.content}),[S.activeSyncState,S.content,S.contentLoading]),contentReload:et,path:S.path,content:S.content,contentErrorMessage:(O=S.contentError)===null||O===void 0?void 0:O.toString(),syncErrorMessage:(T=S.syncError)===null||T===void 0?void 0:T.toString(),buildLog:S.buildLog}}const X=(0,n.createContext)({}),M=()=>(0,n.useContext)(X),z=({children:ae})=>{const{"*":le=""}=(0,W.UO)(),{entityRef:A}=(0,$.x1)(),{kind:L,namespace:O,name:T}=A,S=Q(L,O,T,le);return(0,h.jsx)(X.Provider,{value:S,children:ae instanceof Function?ae(S):ae})},_=ae=>le=>(0,h.jsx)(z,{children:(0,h.jsx)(ae,{...le})})},95573:function(It,ze,t){"use strict";t.d(ze,{Fw:function(){return W},_Z:function(){return n},pd:function(){return $}});var h=t(25248);const n=(0,h.NT)({id:"techdocs:index-page"}),W=(0,h.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),$=(0,h.NT)({id:"techdocs:catalog-reader-view"})},17339:function(It,ze,t){"use strict";t.d(ze,{S:function(){return L}});var h=t(52322),n=t(2784),W=t(79692),$=t(49378),g=t(38402),b=t(86136),l=t(85256),P=t(93414),ne=t(25248),Q=t(65826);const X=(0,W.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),M=O=>{const{result:T,highlight:S,rank:q,lineClamp:Te=5,asListItem:et=!0,asLink:Xe=!0,title:Je,icon:He}=O,gt=X(),Ee=(0,ne.z$)(),Ke=()=>{Ee.captureEvent("discover",T.title,{attributes:{to:T.location},value:q})},st=({children:ot})=>Xe?(0,h.jsx)(P.rU,{noTrack:!0,to:T.location,onClick:Ke,children:ot}):(0,h.jsx)(h.Fragment,{children:ot}),mt=()=>{const ot=S!=null&&S.fields.title?(0,h.jsx)(Q.FA,{text:S.fields.title,preTag:S.preTag,postTag:S.postTag}):T.title,ut=S!=null&&S.fields.entityTitle?(0,h.jsx)(Q.FA,{text:S.fields.entityTitle,preTag:S.preTag,postTag:S.postTag}):T.entityTitle,xt=S!=null&&S.fields.name?(0,h.jsx)(Q.FA,{text:S.fields.name,preTag:S.preTag,postTag:S.postTag}):T.name;return(0,h.jsx)($.Z,{className:gt.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,h.jsx)(st,{children:Je||(0,h.jsxs)(h.Fragment,{children:[ot," | ",ut!=null?ut:xt," docs"]})}),secondary:(0,h.jsx)("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Te,overflow:"hidden"},children:S!=null&&S.fields.text?(0,h.jsx)(Q.FA,{text:S.fields.text,preTag:S.preTag,postTag:S.postTag}):T.text})})},rt=({children:ot})=>et?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(g.Z,{alignItems:"flex-start",children:[He&&(0,h.jsx)(b.Z,{children:He}),(0,h.jsx)("div",{className:gt.flexContainer,children:ot})]}),(0,h.jsx)(l.Z,{component:"li"})]}):(0,h.jsx)(h.Fragment,{children:ot});return(0,h.jsx)(rt,{children:(0,h.jsx)(mt,{})})};var z=t(27556),_=t(73557);const ae=(0,W.Z)(O=>({root:{width:"100%"},bar:{padding:O.spacing(1)}})),le=O=>O==null?void 0:O.document,A=O=>{const{entityId:T,entityTitle:S,debounceTime:q=150}=O,[Te,et]=(0,n.useState)(!1),Xe=(0,_.s0)(),{setFilters:Je,result:{loading:He,value:gt}}=(0,Q.Rx)(),Ee=ae(),[Ke,st]=(0,n.useState)([]);(0,n.useEffect)(()=>{let xt=!0;if(xt&&gt){const Rt=gt.results.slice(0,10);st(Rt)}return()=>{xt=!1}},[He,gt]);const{kind:mt,name:rt,namespace:ot}=T;(0,n.useEffect)(()=>{Je(xt=>({...xt,kind:mt,namespace:ot,name:rt}))},[mt,ot,rt,Je]);const ut=(xt,Rt)=>{if(le(Rt)){const{location:We}=Rt.document;Xe(We)}};return(0,h.jsx)(z.Z,{className:Ee.bar,variant:"outlined",children:(0,h.jsx)(Q.qO,{classes:{root:Ee.root},"data-testid":"techdocs-search-bar",size:"small",open:Te,getOptionLabel:()=>"",filterOptions:xt=>xt,onClose:()=>{et(!1)},onFocus:()=>{et(!0)},onChange:ut,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Ke,renderOption:({document:xt,highlight:Rt})=>(0,h.jsx)(M,{result:xt,lineClamp:3,asListItem:!1,asLink:!1,title:xt.title,highlight:Rt}),loading:He,inputDebounceTime:q,inputPlaceholder:`Search ${S||T.name} docs`,freeSolo:!1})})},L=O=>{const T={term:"",types:["techdocs"],pageCursor:"",filters:O.entityId};return(0,h.jsx)(Q.Nd,{initialState:T,children:(0,h.jsx)(A,{...O})})}},53260:function(){}},function(It){var ze=function(h){return It(It.s=h)};It.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,5924,4736],function(){return ze(89925)});var t=It.O()}]);})();
493
-
494
- //# sourceMappingURL=main.11a8d7f1.js.map