@techdocs/cli 1.4.3-next.1 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/cjs/{migrate-0697fdb4.cjs.js → migrate-32510d4d.cjs.js} +2 -2
  3. package/dist/cjs/migrate-32510d4d.cjs.js.map +1 -0
  4. package/dist/cjs/{publish-ac098b56.cjs.js → publish-2c1fe164.cjs.js} +2 -2
  5. package/dist/cjs/publish-2c1fe164.cjs.js.map +1 -0
  6. package/dist/embedded-app/.config-schema.json +50 -0
  7. package/dist/embedded-app/index.html +1 -1
  8. package/dist/embedded-app/static/{1032.7ce0a1c1.chunk.js → 1032.be408b83.chunk.js} +2 -2
  9. package/dist/embedded-app/static/1032.be408b83.chunk.js.map +1 -0
  10. package/dist/embedded-app/static/1049.fc74e20d.chunk.js.map +1 -1
  11. package/dist/embedded-app/static/{1105.4188674a.chunk.js → 1105.c65d4e64.chunk.js} +2 -2
  12. package/dist/embedded-app/static/1105.c65d4e64.chunk.js.map +1 -0
  13. package/dist/embedded-app/static/{184.0dc35b3d.chunk.js → 184.a8ac59c2.chunk.js} +2 -2
  14. package/dist/embedded-app/static/184.a8ac59c2.chunk.js.map +1 -0
  15. package/dist/embedded-app/static/{2440.31c0e92f.chunk.js → 2440.b8e50edb.chunk.js} +2 -2
  16. package/dist/embedded-app/static/2440.b8e50edb.chunk.js.map +1 -0
  17. package/dist/embedded-app/static/{5458.93917a3c.chunk.js → 5458.38a11fde.chunk.js} +2 -2
  18. package/dist/embedded-app/static/5458.38a11fde.chunk.js.map +1 -0
  19. package/dist/embedded-app/static/6051.098a0af9.chunk.js.map +1 -1
  20. package/dist/embedded-app/static/{732.68398828.chunk.js → 732.bb820d6a.chunk.js} +2 -2
  21. package/dist/embedded-app/static/732.bb820d6a.chunk.js.map +1 -0
  22. package/dist/embedded-app/static/{7560.83ca9e57.chunk.js → 7560.f715d7bd.chunk.js} +2 -2
  23. package/dist/embedded-app/static/{7560.83ca9e57.chunk.js.map → 7560.f715d7bd.chunk.js.map} +1 -1
  24. package/dist/embedded-app/static/{7750.b4122abf.chunk.js → 7750.5d194dad.chunk.js} +2 -2
  25. package/dist/embedded-app/static/{7750.b4122abf.chunk.js.map → 7750.5d194dad.chunk.js.map} +1 -1
  26. package/dist/embedded-app/static/{8951.180aa2e1.chunk.js → 8951.36f657ca.chunk.js} +2 -2
  27. package/dist/embedded-app/static/{8951.180aa2e1.chunk.js.map → 8951.36f657ca.chunk.js.map} +1 -1
  28. package/dist/embedded-app/static/9323.9cac24aa.chunk.js +3 -0
  29. package/dist/embedded-app/static/9323.9cac24aa.chunk.js.map +1 -0
  30. package/dist/embedded-app/static/{9545.0bb9bc30.chunk.js → 9545.3dc1ecf9.chunk.js} +2 -2
  31. package/dist/embedded-app/static/9545.3dc1ecf9.chunk.js.map +1 -0
  32. package/dist/embedded-app/static/{9770.3576f25a.chunk.js → 9770.c98e9dad.chunk.js} +2 -2
  33. package/dist/embedded-app/static/9770.c98e9dad.chunk.js.map +1 -0
  34. package/dist/embedded-app/static/main.6328c68d.js +522 -0
  35. package/dist/embedded-app/static/main.6328c68d.js.map +1 -0
  36. package/dist/embedded-app/static/module-luxon.a1854eb9.js.map +1 -1
  37. package/dist/embedded-app/static/module-material-ui.09dab505.js.map +1 -1
  38. package/dist/embedded-app/static/{module-octokit.cbbb7401.js → module-octokit.a126d1a6.js} +3 -3
  39. package/dist/embedded-app/static/module-octokit.a126d1a6.js.map +1 -0
  40. package/dist/embedded-app/static/module-react-router.a589137b.js.map +1 -1
  41. package/dist/embedded-app/static/module-yaml.af9b4f42.js.map +1 -1
  42. package/dist/embedded-app/static/{runtime.935a0154.js → runtime.6328c68d.js} +2 -2
  43. package/dist/embedded-app/static/{runtime.935a0154.js.map → runtime.6328c68d.js.map} +1 -1
  44. package/dist/embedded-app/static/{vendor.935a0154.js → vendor.6328c68d.js} +2 -2
  45. package/dist/embedded-app/static/vendor.6328c68d.js.map +1 -0
  46. package/dist/index.cjs.js +3 -3
  47. package/package.json +6 -6
  48. package/dist/cjs/migrate-0697fdb4.cjs.js.map +0 -1
  49. package/dist/cjs/publish-ac098b56.cjs.js.map +0 -1
  50. package/dist/embedded-app/static/1032.7ce0a1c1.chunk.js.map +0 -1
  51. package/dist/embedded-app/static/1105.4188674a.chunk.js.map +0 -1
  52. package/dist/embedded-app/static/184.0dc35b3d.chunk.js.map +0 -1
  53. package/dist/embedded-app/static/2440.31c0e92f.chunk.js.map +0 -1
  54. package/dist/embedded-app/static/5458.93917a3c.chunk.js.map +0 -1
  55. package/dist/embedded-app/static/732.68398828.chunk.js.map +0 -1
  56. package/dist/embedded-app/static/9323.8831e792.chunk.js +0 -3
  57. package/dist/embedded-app/static/9323.8831e792.chunk.js.map +0 -1
  58. package/dist/embedded-app/static/9545.0bb9bc30.chunk.js.map +0 -1
  59. package/dist/embedded-app/static/9770.3576f25a.chunk.js.map +0 -1
  60. package/dist/embedded-app/static/main.935a0154.js +0 -508
  61. package/dist/embedded-app/static/main.935a0154.js.map +0 -1
  62. package/dist/embedded-app/static/module-octokit.cbbb7401.js.map +0 -1
  63. package/dist/embedded-app/static/vendor.935a0154.js.map +0 -1
@@ -1,508 +0,0 @@
1
- (()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{4791:function(vt,ke,r){"use strict";r.d(ke,{n3:function(){return g},MS:function(){return ye}});var n=r(87612),p=r(25271),G=r(23054),f=r(96279),V=r.n(f);const g=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");function u(le){return!le.cursor}function $(le){return!u(le)}class ye{async getEntityAncestors(H,ee){const{kind:I,namespace:E,name:ie}=(0,p.of)(H.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(I)}/${encodeURIComponent(E)}/${encodeURIComponent(ie)}/ancestry`,ee)}async getLocationById(H,ee){return await this.requestOptional("GET",`/locations/${encodeURIComponent(H)}`,ee)}async getEntities(H,ee){const{filter:I=[],fields:E=[],order:ie,offset:ne,limit:re,after:D}=H!=null?H:{},N=this.getParams(I);if(E.length&&N.push(`fields=${E.map(encodeURIComponent).join(",")}`),ie)for(const te of[ie].flat())te&&N.push(`order=${encodeURIComponent(te.order)}:${encodeURIComponent(te.field)}`);ne!==void 0&&N.push(`offset=${ne}`),re!==void 0&&N.push(`limit=${re}`),D!==void 0&&N.push(`after=${encodeURIComponent(D)}`);const P=N.length?`?${N.join("&")}`:"",T=await this.requestRequired("GET",`/entities${P}`,ee),k=(te,Te)=>{var Ne,Z;if(((Ne=te.metadata)===null||Ne===void 0?void 0:Ne.name)===void 0||te.kind===void 0||((Z=Te.metadata)===null||Z===void 0?void 0:Z.name)===void 0||Te.kind===void 0)return 0;const Xe=(0,p.eE)(te),rt=(0,p.eE)(Te);return Xe<rt?-1:Xe>rt?1:0};return{items:T.sort(k)}}async getEntitiesByRefs(H,ee){var I;const E={entityRefs:H.entityRefs};!((I=H.fields)===null||I===void 0)&&I.length&&(E.fields=H.fields);const ne=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,re=await this.fetchApi.fetch(ne,{headers:{"Content-Type":"application/json",...(ee==null?void 0:ee.token)&&{Authorization:`Bearer ${ee==null?void 0:ee.token}`}},method:"POST",body:JSON.stringify(E)});if(!re.ok)throw await G.VL.fromResponse(re);const{items:D}=await re.json();return{items:D.map(N=>N!=null?N:void 0)}}async queryEntities(H={},ee){const I=[];if(u(H)){var E,ie;const{fields:re=[],filter:D,limit:N,orderFields:P,fullTextFilter:T}=H;I.push(...this.getParams(D)),N!==void 0&&I.push(`limit=${N}`),P!==void 0&&(Array.isArray(P)?P:[P]).forEach(({field:te,order:Te})=>I.push(`orderField=${te},${Te}`)),re.length&&I.push(`fields=${re.map(encodeURIComponent).join(",")}`);const k=T==null||(E=T.term)===null||E===void 0?void 0:E.trim();k&&I.push(`fullTextFilterTerm=${k}`),!(T==null||(ie=T.fields)===null||ie===void 0)&&ie.length&&I.push(`fullTextFilterFields=${T.fields.join(",")}`)}else{const{fields:re=[],limit:D,cursor:N}=H;I.push(`cursor=${N}`),D!==void 0&&I.push(`limit=${D}`),re.length&&I.push(`fields=${re.map(encodeURIComponent).join(",")}`)}const ne=I.length?`?${I.join("&")}`:"";return this.requestRequired("GET",`/entities/by-query${ne}`,ee)}async getEntityByRef(H,ee){const{kind:I,namespace:E,name:ie}=(0,p.of)(H);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(I)}/${encodeURIComponent(E)}/${encodeURIComponent(ie)}`,ee)}async getEntityByName(H,ee){const{kind:I,namespace:E="default",name:ie}=H;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(I)}/${encodeURIComponent(E)}/${encodeURIComponent(ie)}`,ee)}async refreshEntity(H,ee){const I=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(ee==null?void 0:ee.token)&&{Authorization:`Bearer ${ee==null?void 0:ee.token}`}},method:"POST",body:JSON.stringify({entityRef:H})});if(I.status!==200)throw new Error(await I.text())}async getEntityFacets(H,ee){const{filter:I=[],facets:E}=H,ie=this.getParams(I);for(const re of E)ie.push(`facet=${encodeURIComponent(re)}`);const ne=ie.length?`?${ie.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${ne}`,ee)}async addLocation(H,ee){const{type:I="url",target:E,dryRun:ie}=H,ne=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${ie?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(ee==null?void 0:ee.token)&&{Authorization:`Bearer ${ee==null?void 0:ee.token}`}},method:"POST",body:JSON.stringify({type:I,target:E})});if(ne.status!==201)throw new Error(await ne.text());const{location:re,entities:D,exists:N}=await ne.json();if(!re)throw new Error(`Location wasn't added: ${E}`);return{location:re,entities:D,exists:N}}async getLocationByRef(H,ee){return(await this.requestRequired("GET","/locations",ee)).map(E=>E.data).find(E=>H===(0,p.NZ)(E))}async removeLocationById(H,ee){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(H)}`,ee)}async removeEntityByUid(H,ee){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(H)}`,ee)}async validateEntity(H,ee,I){const E=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(I==null?void 0:I.token)&&{Authorization:`Bearer ${I==null?void 0:I.token}`}},method:"POST",body:JSON.stringify({entity:H,location:ee})});if(E.ok)return{valid:!0};if(E.status!==400)throw await G.VL.fromResponse(E);const{errors:ie=[]}=await E.json();return{valid:!1,errors:ie}}async requestIgnored(H,ee,I){const E=`${await this.discoveryApi.getBaseUrl("catalog")}${ee}`,ie=I!=null&&I.token?{Authorization:`Bearer ${I.token}`}:{},ne=await this.fetchApi.fetch(E,{method:H,headers:ie});if(!ne.ok)throw await G.VL.fromResponse(ne)}async requestRequired(H,ee,I){const E=`${await this.discoveryApi.getBaseUrl("catalog")}${ee}`,ie=I!=null&&I.token?{Authorization:`Bearer ${I.token}`}:{},ne=await this.fetchApi.fetch(E,{method:H,headers:ie});if(!ne.ok)throw await G.VL.fromResponse(ne);return ne.json()}async requestOptional(H,ee,I){const E=`${await this.discoveryApi.getBaseUrl("catalog")}${ee}`,ie=I!=null&&I.token?{Authorization:`Bearer ${I.token}`}:{},ne=await this.fetchApi.fetch(E,{method:H,headers:ie});if(!ne.ok){if(ne.status===404)return;throw await G.VL.fromResponse(ne)}return await ne.json()}getParams(H=[]){const ee=[];for(const I of[H].flat()){const E=[];for(const[ie,ne]of Object.entries(I))for(const re of[ne].flat())re===g?E.push(encodeURIComponent(ie)):typeof re=="string"&&E.push(`${encodeURIComponent(ie)}=${encodeURIComponent(re)}`);E.length&&ee.push(`filter=${E.join(",")}`)}return ee}constructor(H){(0,n._)(this,"discoveryApi",void 0),(0,n._)(this,"fetchApi",void 0),this.discoveryApi=H.discoveryApi,this.fetchApi=H.fetchApi||{fetch:V()}}}},25271:function(vt,ke,r){"use strict";r.d(ke,{Tf:function(){return G},P1:function(){return Sn},q1:function(){return Nn},M6:function(){return Se},l2:function(){return p},zG:function(){return n},w$:function(){return nn},nP:function(){return Yt},aS:function(){return rr},S4:function(){return $t},cz:function(){return tt},wI:function(){return Te},iB:function(){return Ft},CV:function(){return Ge},of:function(){return Zt},Ou:function(){return Le},eE:function(){return et},NZ:function(){return Me}});const n="default",p="backstage.io/view-url",G="backstage.io/edit-url",f="kubernetes.io/api-server",V="kubernetes.io/api-server-certificate-authority",g="kubernetes.io/auth-provider";var u=r(76635),$=r.n(u);class ye{async enforce(M){return M.metadata.namespace?M:lodash.merge({metadata:{namespace:this.namespace}},M)}constructor(M=DEFAULT_NAMESPACE){_define_property(this,"namespace",void 0),this.namespace=M}}class le{static isValidPrefixAndOrSuffix(M,me,Be,Ye){if(typeof M!="string")return!1;const Je=M.split(me);return Je.length===1?Ye(Je[0]):Je.length===2?Be(Je[0])&&Ye(Je[1]):!1}static isJsonSafe(M){try{return $().isEqual(M,JSON.parse(JSON.stringify(M)))}catch{return!1}}static isValidDnsSubdomain(M){return typeof M=="string"&&M.length>=1&&M.length<=253&&M.split(".").every(le.isValidDnsLabel)}static isValidDnsLabel(M){return typeof M=="string"&&M.length>=1&&M.length<=63&&/^[a-z0-9]+(?:\-+[a-z0-9]+)*$/.test(M)}static isValidTag(M){return typeof M=="string"&&M.length>=1&&M.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(M)}static isValidUrl(M){if(typeof M!="string")return!1;try{return new URL(M),!0}catch{return!1}}static isValidString(M){var me;return typeof M=="string"&&((me=M==null?void 0:M.trim())===null||me===void 0?void 0:me.length)>=1}static isNonEmptyString(M){var me;return typeof M=="string"&&((me=M==null?void 0:M.trim())===null||me===void 0?void 0:me.length)>=1}}var H=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}}}}}'),ee=r(27991),I=r.n(ee),E=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"Entity","description":"The parts of the format that's common to all versions/kinds of entity.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":false,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"$ref":"EntityMeta"},"spec":{"type":"object","description":"The specification data describing the entity itself."},"relations":{"type":"array","description":"The relations that this entity has with other entities.","items":{"$ref":"common#relation"}},"status":{"$ref":"common#status"}}}`),ie=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}}}}}}'),ne=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"common","type":"object","description":"Common definitions to import from other schemas","definitions":{"reference":{"$id":"#reference","type":"object","description":"A reference by name to another entity.","required":["kind","namespace","name"],"additionalProperties":false,"properties":{"kind":{"type":"string","description":"The kind field of the entity.","minLength":1},"namespace":{"type":"string","description":"The metadata.namespace field of the entity.","minLength":1},"name":{"type":"string","description":"The metadata.name field of the entity.","minLength":1}}},"relation":{"$id":"#relation","type":"object","description":"A directed relation from one entity to another.","required":["type","target","targetRef"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference","deprecated":true},"targetRef":{"type":"string","minLength":1,"description":"The entity ref of the target of this relation."}}},"status":{"$id":"#status","type":"object","description":"The current status of the entity, as claimed by various sources.","required":[],"additionalProperties":true,"properties":{"items":{"type":"array","items":{"$ref":"#statusItem"}}}},"statusItem":{"$id":"#statusItem","type":"object","description":"A specific status item on a well known format.","required":["type","level","message"],"additionalProperties":true,"properties":{"type":{"type":"string","minLength":1},"level":{"$ref":"#statusLevel","description":"The status level / severity of the status item."},"message":{"type":"string","description":"A brief message describing the status, intended for human consumption."},"error":{"$ref":"#error","description":"An optional serialized error object related to the status."}}},"statusLevel":{"$id":"#statusLevel","type":"string","description":"A status level / severity.","enum":["info","warning","error"]},"error":{"$id":"#error","type":"object","description":"A serialized error object.","required":["name","message"],"additionalProperties":true,"properties":{"name":{"type":"string","examples":["Error","InputError"],"description":"The type name of the error","minLength":1},"message":{"type":"string","description":"The message of the error"},"code":{"type":"string","description":"An error code associated with the error"},"stack":{"type":"string","description":"An error stack trace"}}}}}');const re=new Map,D=[H,E,ie,ne];function N(se){if(!(se!=null&&se.length))throw new TypeError("Unknown error");const M=se[0];throw new TypeError(`${M.instancePath||"<root>"} ${M.message}${M.params?` - ${Object.entries(M.params).map(([me,Be])=>`${me}: ${Be}`).join(", ")}`:""}`)}function P(se,M={}){var me;const Be=(me=M==null?void 0:M.disableCache)!==null&&me!==void 0?me:!1,Ye=Be?"":JSON.stringify(se);if(!Be){const tn=re.get(Ye);if(tn)return tn}const Je=T(se),Dt=new(I())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});Je.length&&Dt.addSchema(Je,void 0,void 0,!0);const Kt=Dt.compile(se);return Be||re.set(Ye,Kt),Kt}function T(se){if(typeof se!="object")return[];const M=new Set;se.$id&&M.add(se.$id);const me=new Array,Be=[se];for(;Be.length;){const Ye=Be.pop();for(const Je of k(Ye))if(!M.has(Je)){M.add(Je);const Dt=D.find(Kt=>Kt.$id===Je);Dt&&(me.push(Dt),Be.push(Dt))}}return me}function*k(se){const M=[se];for(;M.length;){const me=M.pop();if(typeof me=="object"&&me)for(const[Be,Ye]of Object.entries(me))Be==="$ref"&&typeof Ye=="string"?yield Ye.split("#")[0]:M.push(Ye)}}function te(se){const M=compileAjvSchema(se||entityEnvelopeSchema);return me=>{if(M(me)===!0)return me;throw throwAjvError(M.errors)}}function Te(se){const M=P(se);return me=>{var Be;if(M(me)===!0)return me;const Je=(Be=M.errors)===null||Be===void 0?void 0:Be.filter(Dt=>["/kind","/apiVersion"].includes(Dt.instancePath));if(Je!=null&&Je.length&&Je.every(Dt=>Dt.keyword==="enum"))return!1;throw N(M.errors)}}function Ne(se){const M=compileAjvSchema(se||entitySchema);return me=>{if(M(me)===!0)return me;throw throwAjvError(M.errors)}}class Z{static isValidApiVersion(M){return le.isValidPrefixAndOrSuffix(M,"/",le.isValidDnsSubdomain,me=>me.length>=1&&me.length<=63&&/^[a-z0-9A-Z]+$/.test(me))}static isValidKind(M){return typeof M=="string"&&M.length>=1&&M.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(M)}static isValidObjectName(M){return typeof M=="string"&&M.length>=1&&M.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(M)}static isValidNamespace(M){return le.isValidDnsLabel(M)}static isValidLabelKey(M){return le.isValidPrefixAndOrSuffix(M,"/",le.isValidDnsSubdomain,Z.isValidObjectName)}static isValidLabelValue(M){return M===""||Z.isValidObjectName(M)}static isValidAnnotationKey(M){return le.isValidPrefixAndOrSuffix(M,"/",le.isValidDnsSubdomain,Z.isValidObjectName)}static isValidAnnotationValue(M){return typeof M=="string"}}const Xe={isValidApiVersion:Z.isValidApiVersion,isValidKind:Z.isValidKind,isValidEntityName:Z.isValidObjectName,isValidNamespace:Z.isValidNamespace,isValidLabelKey:Z.isValidLabelKey,isValidLabelValue:Z.isValidLabelValue,isValidAnnotationKey:Z.isValidAnnotationKey,isValidAnnotationValue:Z.isValidAnnotationValue,isValidTag:se=>typeof se=="string"&&se.length>=1&&se.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(se)};function rt(se={}){return{...Xe,...se}}class Et{async enforce(M){function me(_,v,L){if(v==null)throw new Error(`${_} must have a value`);let Q;try{Q=L(v)}catch(W){throw new Error(`${_} could not be validated, ${W}`)}if(!Q){let W;switch(L.name){case"isValidLabelValue":case"isValidObjectName":W="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":W="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":W="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":W="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":W="a string";break;case"isValidKind":W="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":W="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":W="a non empty string";break;default:W=void 0;break}const ue=W?` expected ${W} but found "${v}".`:"";throw new Error(`"${_}" is not valid;${ue} To learn more about catalog file format, visit: https://github.com/backstage/backstage/blob/master/docs/architecture-decisions/adr002-default-catalog-file-format.md`)}}function Be(_,v,L){return v===void 0||me(_,v,L)}me("apiVersion",M.apiVersion,this.validators.isValidApiVersion),me("kind",M.kind,this.validators.isValidKind),me("metadata.name",M.metadata.name,this.validators.isValidEntityName),Be("metadata.namespace",M.metadata.namespace,this.validators.isValidNamespace);var Ye;for(const[_,v]of Object.entries((Ye=M.metadata.labels)!==null&&Ye!==void 0?Ye:[]))me(`labels.${_}`,_,this.validators.isValidLabelKey),me(`labels.${_}`,v,this.validators.isValidLabelValue);var Je;for(const[_,v]of Object.entries((Je=M.metadata.annotations)!==null&&Je!==void 0?Je:[]))me(`annotations.${_}`,_,this.validators.isValidAnnotationKey),me(`annotations.${_}`,v,this.validators.isValidAnnotationValue);var Dt;const Kt=(Dt=M.metadata.tags)!==null&&Dt!==void 0?Dt:[];for(let _=0;_<Kt.length;++_)me(`tags.${_}`,Kt[_],this.validators.isValidTag);var tn;const Qt=(tn=M.metadata.links)!==null&&tn!==void 0?tn:[];for(let _=0;_<Qt.length;++_){var gn,X,q;me(`links.${_}.url`,(gn=Qt[_])===null||gn===void 0?void 0:gn.url,CommonValidatorFunctions.isValidUrl),Be(`links.${_}.title`,(X=Qt[_])===null||X===void 0?void 0:X.title,CommonValidatorFunctions.isNonEmptyString),Be(`links.${_}.icon`,(q=Qt[_])===null||q===void 0?void 0:q.icon,KubernetesValidatorFunctions.isValidObjectName)}return M}constructor(M=makeValidator()){_define_property(this,"validators",void 0),this.validators=M}}class Lt{async enforce(M){if(!this.validate){const Ye=new Ajv({allowUnionTypes:!0});this.validate=Ye.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(M)===!0)return M;const[Be]=this.validate.errors||[];throw Be?new Error(`Malformed envelope, ${Be.instancePath||"<root>"} ${Be.message}`):new Error("Malformed envelope, Unknown error")}constructor(){_define_property(this,"validate",void 0)}}function lt(se){let M=se.indexOf(":");const me=se.indexOf("/");me!==-1&&me<M&&(M=-1);const Be=M===-1?void 0:se.slice(0,M),Ye=me===-1?void 0:se.slice(M+1,me),Je=se.slice(Math.max(M+1,me+1));if(Be===""||Ye===""||Je==="")throw new TypeError(`Entity reference "${se}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Be,namespace:Ye,name:Je}}function Ft(se){return{kind:se.kind,namespace:se.metadata.namespace||n,name:se.metadata.name}}function Zt(se,M){if(!se)throw new Error("Entity reference must not be empty");const me=M==null?void 0:M.defaultKind,Be=(M==null?void 0:M.defaultNamespace)||n;let Ye,Je,Dt;if(typeof se=="string"){const X=lt(se);var Kt;Ye=(Kt=X.kind)!==null&&Kt!==void 0?Kt:me;var tn;Je=(tn=X.namespace)!==null&&tn!==void 0?tn:Be,Dt=X.name}else{var Qt;Ye=(Qt=se.kind)!==null&&Qt!==void 0?Qt:me;var gn;Je=(gn=se.namespace)!==null&&gn!==void 0?gn:Be,Dt=se.name}if(Ye)if(Je){if(!Dt){const X=JSON.stringify(se);throw new Error(`Entity reference ${X} had missing or empty name`)}}else{const X=JSON.stringify(se);throw new Error(`Entity reference ${X} had missing or empty namespace`)}else{const X=JSON.stringify(se);throw new Error(`Entity reference ${X} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:Ye,namespace:Je,name:Dt}}function et(se){let M,me,Be;if("metadata"in se){M=se.kind;var Ye;me=(Ye=se.metadata.namespace)!==null&&Ye!==void 0?Ye:n,Be=se.metadata.name}else{M=se.kind;var Je;me=(Je=se.namespace)!==null&&Je!==void 0?Je:n,Be=se.name}return`${M.toLocaleLowerCase("en-US")}:${me.toLocaleLowerCase("en-US")}/${Be.toLocaleLowerCase("en-US")}`}var pt=r(87612);class ft{async enforce(M){let me=M;for(const Be of this.policies){const Ye=await Be.enforce(me);if(!Ye)throw new Error(`Policy ${Be.constructor.name} did not return a result`);me=Ye}return me}constructor(M){(0,pt._)(this,"policies",void 0),this.policies=M}}class jt{async enforce(M){for(const me of this.policies){const Be=await me.enforce(M);if(Be)return Be}throw new Error("The entity did not match any known policy")}constructor(M){(0,pt._)(this,"policies",void 0),this.policies=M}}const kt={allOf(se){return new ft(se)},oneOf(se){return new jt(se)}};var qt=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ApiV1alpha1","description":"An API describes an interface that can be exposed by a component. The API can be defined in different formats, like OpenAPI, AsyncAPI, GraphQL, gRPC, or other formats.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"API","metadata":{"name":"artist-api","description":"Retrieve artist details","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"openapi","lifecycle":"production","owner":"artist-relations-team","system":"artist-engagement-portal","definition":"openapi: \\"3.0.0\\"\\ninfo:..."}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["API"]},"spec":{"type":"object","required":["type","lifecycle","owner","definition"],"properties":{"type":{"type":"string","description":"The type of the API definition.","examples":["openapi","asyncapi","graphql","grpc","trpc"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the API.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the API.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the API belongs to.","minLength":1},"definition":{"type":"string","description":"The definition of the API, based on the format defined by the type.","minLength":1}}}}}]}');function de(se){let M;return{async check(me){return M||(M=Te(se)),M(me)===me}}}const ve=de(qt);var ze=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 Ee=de(ze);var at=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 bt=de(at);var dt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"GroupV1alpha1","description":"A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Group","metadata":{"name":"infrastructure","description":"The infra business unit"},"spec":{"type":"business-unit","profile":{"displayName":"Infrastructure","email":"infrastructure@example.com","picture":"https://example.com/groups/bu-infrastructure.jpeg"},"parent":"ops","children":["backstage","other"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Group"]},"spec":{"type":"object","required":["type","children"],"properties":{"type":{"type":"string","description":"The type of group. There is currently no enforced set of values for this field, so it is left up to the adopting organization to choose a nomenclature that matches their org hierarchy.","examples":["team","business-unit","product-area","root"],"minLength":1},"profile":{"type":"object","description":"Optional profile information about the group, mainly for display purposes. All fields of this structure are also optional. The email would be a group email of some form, that the group may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the group, and that a browser could fetch and render on a group page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Infrastructure"],"minLength":1},"email":{"type":"string","description":"An email where this entity can be reached.","examples":["infrastructure@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this entity.","examples":["https://example.com/groups/bu-infrastructure.jpeg"],"minLength":1}}},"parent":{"type":"string","description":"The immediate parent group in the hierarchy, if any. Not all groups must have a parent; the catalog supports multi-root hierarchies. Groups may however not have more than one parent. This field is an entity reference.","examples":["ops"],"minLength":1},"children":{"type":"array","description":"The immediate child groups of this group in the hierarchy (whose parent field points to this group). The list must be present, but may be empty if there are no child groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["backstage","other"],"minLength":1}},"members":{"type":"array","description":"The users that are members of this group. The entries of this array are entity references.","items":{"type":"string","examples":["jdoe"],"minLength":1}}}}}}]}`);const Bt=de(dt);var St=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 Gt=de(St),$t="ownedBy",pn="ownerOf",an="consumesApi",dn="apiConsumedBy",_t="providesApi",fn="apiProvidedBy",Yt="dependsOn",nn="dependencyOf",jn="parentOf",en="childOf",bn="memberOf",$n="hasMember",tt="partOf",rr="hasPart";var Ct=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 nt=de(Ct);var Tn=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 Jt=de(Tn);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 Dn=de(Rn),Sn="backstage.io/managed-by-location",Nn="backstage.io/managed-by-origin-location",Se="backstage.io/source-location",ae=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;function Le(se){if(typeof se!="string")throw new TypeError(`Unable to parse location ref '${se}', unexpected argument ${typeof se}`);const M=se.indexOf(":");if(M<0)throw new TypeError(`Unable to parse location ref '${se}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const me=se.substring(0,M).trim(),Be=se.substring(M+1).trim();if(!me||!Be)throw new TypeError(`Unable to parse location ref '${se}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(me==="http"||me==="https")throw new TypeError(`Invalid location ref '${se}', please prefix it with 'url:', e.g. 'url:${se}'`);if(ae.test(Be))throw new TypeError(`Invalid location ref '${se}', target is a javascript: URL`);return{type:me,target:Be}}function Me(se){const{type:M,target:me}=se;if(M){if(!me)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");if(ae.test(me))throw new TypeError(`Invalid location ref '${M}:${me}', target is a javascript: URL`);return`${M}:${me}`}function Ge(se){var M,me,Be,Ye,Je;const Dt=(Je=(M=se.metadata)===null||M===void 0||(me=M.annotations)===null||me===void 0?void 0:me[Se])!==null&&Je!==void 0?Je:(Be=se.metadata)===null||Be===void 0||(Ye=Be.annotations)===null||Ye===void 0?void 0:Ye[Sn];if(!Dt)throw new Error(`Entity '${et(se)}' is missing location`);return Le(Dt)}},15332:function(vt,ke,r){"use strict";r.d(ke,{r:function(){return T}});var n=r(52322),p=r(60871),G=r(86689),f=r(79692),V=r(90436),g=r(72779),u=r.n(g),$=r(76635),ye=r(2784),le=r(73557),H=r(71597);function ee(){const[k]=(0,le.is)((0,n.jsx)(le.AW,{index:!0,element:(0,n.jsx)("div",{})}));return!k.index}const I=(0,f.Z)({visuallyHidden:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",height:1,width:1},externalLink:{position:"relative"}},{name:"Link"}),E=k=>/^([a-z+.-]+):/.test(k),ie=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i,ne=window.open;if(ne&&!ne.__backstage){const k=function(...Te){const Ne=String(Te[0]);if(ie.test(Ne))throw new Error("Rejected window.open() with a javascript: URL as a security precaution");return ne.apply(this,Te)};k.__backstage=!0,window.open=k}const re=()=>{try{return(0,p.h_)(p.Ds).getOptionalString("app.baseUrl")}catch{return}},D=()=>{const k="http://sample.dev";var te;const Te=(te=re())!==null&&te!==void 0?te:"/",{pathname:Ne}=new URL(Te,k);return(0,$.trimEnd)(Ne,"/")},N=k=>{let te=String(k);const Te=D(),Ne=E(te),Z=te.startsWith(Te);return!Ne&&!Z&&(te=Te.concat(te)),te},P=k=>{if(k instanceof Array)return k.map(P).join(" ").trim();if(typeof k=="object"&&k){var te;return P(k==null||(te=k.props)===null||te===void 0?void 0:te.children)}return["string","number"].includes(typeof k)?String(k):""},T=ye.forwardRef(({onClick:k,noTrack:te,...Te},Ne)=>{const Z=I(),Xe=(0,p.z$)(),rt=ee()?N(Te.to):Te.to,Et=P(Te.children)||rt,Lt=E(rt),lt=Lt&&!!/^https?:/.exec(rt);if(ie.test(rt))throw new Error("Link component rejected javascript: URL as a security precaution");const Ft=Zt=>{k==null||k(Zt),te||Xe.captureEvent("click",Et,{attributes:{to:rt}})};return Lt?(0,n.jsxs)(G.Z,{...lt?{target:"_blank",rel:"noopener"}:{},...Te,...Te["aria-label"]?{"aria-label":`${Te["aria-label"]}, Opens in a new window`}:{},ref:Ne,href:rt,onClick:Ft,className:u()(Z.externalLink,Te.className),children:[Te.children,(0,n.jsx)(V.Z,{component:"span",className:Z.visuallyHidden,children:", Opens in a new window"})]}):(0,n.jsx)(G.Z,{...Te,ref:Ne,component:H.rU,to:rt,onClick:Ft})})},53974:function(vt,ke,r){"use strict";r.d(ke,{Oi:function(){return Te},VY:function(){return Ks},yW:function(){return Gi},XF:function(){return rt},mn:function(){return nn},NX:function(){return ft},ub:function(){return ae},mf:function(){return Ja},yu:function(){return ot},h4:function(){return Pa},M6:function(){return Lr},i9:function(){return il},aR:function(){return Ys},rJ:function(){return jr},Oh:function(){return hl},hu:function(){return cl},rU:function(){return le.r},Qj:function(){return ee},nU:function(){return qe},SA:function(){return lo},sk:function(){return Je},Or:function(){return Kr},T3:function(){return La},g9:function(){return gl},Ex:function(){return kr},Gk:function(){return rn},tn:function(){return Js},Ph:function(){return Yo},YE:function(){return no},v7:function(){return Hs},R6:function(){return Pi},tR:function(){return ji},uw:function(){return Ui},qt:function(){return gi},iA:function(){return tr},GB:function(){return Qe},po:function(){return Rr},mZ:function(){return ns},Pf:function(){return Eo}});var n=r(52322),p=r(60871),G=r(19928),f=r(2784);function V(e){const[o,l]=useState([]),d=useApi(alertApiRef),{anchorOrigin:m={vertical:"top",horizontal:"center"},transientTimeoutMs:y}=e,A=y!=null?y:5e3;useEffect(()=>{const z=d.alert$().subscribe(ge=>l(pe=>pe.concat(ge)));return()=>{z.unsubscribe()}},[d]);const[U]=o;if(useEffect(()=>{if(U&&U.display==="transient"){const z=setTimeout(()=>{l(ge=>{const pe=ge.filter(Pe=>Pe!==U);return pe.length===ge.length?ge:pe})},A);return()=>clearTimeout(z)}},[U,A]),o.length===0)return null;const Y=()=>{l(z=>z.filter(ge=>ge!==U))};return _jsx(Snackbar,{open:!0,anchorOrigin:m,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:Y,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:U.severity,children:_jsxs(Typography,{component:"span",children:[String(U.message),o.length>1&&_jsx("em",{children:` (${o.length-1} older ${pluralize("message",o.length-1)})`})]})})})}var g=r(79692);const u=(0,g.Z)(e=>({avatar:{width:"4rem",height:"4rem",color:e.palette.common.white},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function $(e){const{displayName:o,picture:l,customStyles:d}=e,m=u();let y={...d};const A={fontFamily:y.fontFamily,fontSize:y.fontSize,fontWeight:y.fontWeight};return l||(y={backgroundColor:stringToColor(o||""),...d}),_jsx(MaterialAvatar,{alt:o,src:l,className:m.avatar,style:y,children:o&&_jsx(Typography,{variant:"h6",component:"span",className:m.avatarText,style:A,children:extractInitials(o)})})}var ye=r(77277),le=r(15332);const H=f.forwardRef((e,o)=>(0,n.jsx)(le.r,{ref:o,...e,color:"initial"})),ee=f.forwardRef((e,o)=>(0,n.jsx)(ye.Z,{ref:o,component:H,...e})),I=null;var E=r(95544),ie=r(60364),ne=r(83229),re=r(26639),D=r(39595),N=r(61837),P=r(80030),T=r(19353),k=r(95074);function te(e){const{text:o,tooltipDelay:l=1e3,tooltipText:d="Text copied to clipboard","aria-label":m="Copy text"}=e,y=(0,p.h_)(p.VE),[A,U]=(0,f.useState)(!1),[{error:Y},z]=(0,k.Z)();(0,f.useEffect)(()=>{Y&&y.post(Y)},[Y,y]);const ge=pe=>{pe.stopPropagation(),U(!0),z(o)};return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(P.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:l,onClose:()=>U(!1),open:A,children:(0,n.jsx)(N.Z,{onClick:ge,"aria-label":m,children:(0,n.jsx)(T.Z,{})})})})}function Te(e){const{text:o,language:l,showLineNumbers:d=!1,highlightedNumbers:m,customStyle:y,showCopyCodeButton:A=!1}=e,U=(0,ie.Z)(),Y=U.palette.type==="dark"?re.Z:D.Z,z=U.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,n.jsxs)(E.Z,{position:"relative",children:[(0,n.jsx)(ne.Z,{customStyle:y,language:l,style:Y,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:U.palette.textVerySubtle},lineProps:ge=>m!=null&&m.includes(ge)?{style:{backgroundColor:z}}:{},children:o}),A&&(0,n.jsx)(E.Z,{position:"absolute",top:0,right:0,children:(0,n.jsx)(te,{text:o})})]})}var Ne=r(41156),Z=r(71597),Xe=r(88188);function rt(e){const{title:o,to:l}=e,d=(0,Ne.Z)(m=>m.breakpoints.down("xs"));return l?d?(0,n.jsx)(N.Z,{component:Z.rU,color:"primary",title:o,size:"small",to:l,children:(0,n.jsx)(Xe.Z,{})}):(0,n.jsx)(ye.Z,{component:Z.rU,variant:"contained",color:"primary",to:l,children:o}):null}var Et=r(27397),Lt=r(11105),lt=r(97963),Ft=r(46506),Zt=r.n(Ft),et=r(54073),pt=r.n(et),ft;(function(e){let o;(function(y){y.TOP_BOTTOM="TB",y.BOTTOM_TOP="BT",y.LEFT_RIGHT="LR",y.RIGHT_LEFT="RL"})(o=e.Direction||(e.Direction={}));let l;(function(y){y.UP_LEFT="UL",y.UP_RIGHT="UR",y.DOWN_LEFT="DL",y.DOWN_RIGHT="DR"})(l=e.Alignment||(e.Alignment={}));let d;(function(y){y.NETWORK_SIMPLEX="network-simplex",y.TIGHT_TREE="tight-tree",y.LONGEST_PATH="longest-path"})(d=e.Ranker||(e.Ranker={}));let m;(function(y){y.LEFT="l",y.RIGHT="r",y.CENTER="c"})(m=e.LabelPosition||(e.LabelPosition={}))})(ft||(ft={}));var jt=r(10368);const kt=(0,g.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function qt({node:{id:e}}){const o=kt(),[l,d]=f.useState(0),[m,y]=f.useState(0),A=f.useRef(null);f.useLayoutEffect(()=>{if(A.current){let{height:ge,width:pe}=A.current.getBBox();ge=Math.round(ge),pe=Math.round(pe),(ge!==m||pe!==l)&&(d(pe),y(ge))}},[l,m]);const U=10,Y=l+U*2,z=m+U*2;return(0,n.jsxs)("g",{children:[(0,n.jsx)("rect",{className:o.node,width:Y,height:z,rx:10}),(0,n.jsx)("text",{ref:A,className:o.text,y:z/2,x:Y/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const de="arrow-marker",ve="node",ze="edge",Ee="label",at=(0,jt.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),bt=e=>(0,n.jsx)(qt,{...e});function dt({render:e=bt,setNode:o,node:l}){const{width:d,height:m,x:y=0,y:A=0}=l,U=l,Y=at(),z=f.useRef(null);return f.useLayoutEffect(()=>{if(z.current){let{height:ge,width:pe}=z.current.getBBox();ge=Math.round(ge),pe=Math.round(pe),(ge!==m||pe!==d)&&o(l.id,{...l,height:ge,width:pe})}},[l,d,m,o]),(0,n.jsx)("g",{ref:z,"data-testid":ve,className:Y.node,transform:`translate(${y-d/2},${A-m/2})`,children:e({node:U})})}var Bt=r(76985),St=r(39829),Gt=r(19574),$t=r.n(Gt);const pn=(0,jt.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function an({edge:{label:e}}){const o=pn();return(0,n.jsx)("text",{className:o.text,textAnchor:"middle",children:e})}const dn=(0,jt.Z)(e=>({path:{strokeWidth:1,stroke:e.palette.textSubtle,fill:"none",transition:`${e.transitions.duration.shortest}ms`},label:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphEdge"}),_t=e=>(0,n.jsx)(an,{...e});function fn({render:e=_t,setEdge:o,id:l,edge:d,curve:m}){const{x:y=0,y:A=0,width:U,height:Y,points:z}=d,ge=d,pe=dn(),Pe=f.useRef(null);f.useLayoutEffect(()=>{if(Pe.current){let{height:Ke,width:Vt}=Pe.current.getBBox();Ke=Math.round(Ke),Vt=Math.round(Vt),(Ke!==Y||Vt!==U)&&o(l,{...d,height:Ke,width:Vt})}},[d,Y,U,o,l]);let Ae="";const Ue=f.useMemo(()=>Bt.Z().x(Ke=>Ke.x).y(Ke=>Ke.y).curve(St[m]),[m]);if(z){const Ke=z.filter(Vt=>$t()(Vt.x)&&$t()(Vt.y));Ae=Ue(Ke)||""}return(0,n.jsxs)(n.Fragment,{children:[Ae&&(0,n.jsx)("path",{"data-testid":ze,className:pe.path,d:Ae}),ge.label?(0,n.jsx)("g",{ref:Pe,"data-testid":Ee,className:pe.label,transform:`translate(${y},${A})`,children:e({edge:ge})}):null]})}const Yt="workspace";function nn(e){var o,l;const{edges:d,nodes:m,renderNode:y,direction:A=ft.Direction.TOP_BOTTOM,align:U,nodeMargin:Y=50,edgeMargin:z=10,rankMargin:ge=50,paddingX:pe=0,paddingY:Pe=0,acyclicer:Ae,ranker:Ue=ft.Ranker.NETWORK_SIMPLEX,labelPosition:Ke=ft.LabelPosition.RIGHT,labelOffset:Vt=10,edgeRanks:yn=1,edgeWeight:zn=1,renderLabel:nr,defs:Pt,zoom:ln="enabled",curve:cn="curveMonotoneX",fit:dr="grow",...fr}=e,gr=(0,lt.Z)(),[mr,ds]=f.useState(100),[Vr,Xi]=f.useState(100),sn=f.useRef(new(Zt()).graphlib.Graph),[Oo,ti]=f.useState(((o=sn.current.graph())===null||o===void 0?void 0:o.width)||0),[Hr,qi]=f.useState(((l=sn.current.graph())===null||l===void 0?void 0:l.height)||0),[Wn,Pr]=f.useState([]),[so,io]=f.useState([]),Cn=Math.max(Oo,mr),In=Math.max(Hr,Vr),ko=Math.min(Hr,Vr),ao=dr==="grow"?In:ko,us=f.useMemo(()=>pt()(An=>{if(!An)return;const Vn=Lt.Z(An),wn=Lt.Z(An.getElementById(Yt));function vr(){Vn.call(Et.sP().scaleExtent([1,10]).on("zoom",Dr=>{Dr.transform.x=Math.min(0,Math.max(Dr.transform.x,Cn-Cn*Dr.transform.k)),Dr.transform.y=Math.min(0,Math.max(Dr.transform.y,In-In*Dr.transform.k)),wn.attr("transform",Dr.transform)}))}ln==="enabled"?vr():ln==="enable-on-click"&&Vn.on("click",()=>vr());const{width:yr,height:ni}=An.getBoundingClientRect();mr!==yr&&ds(yr),Vr!==ni&&Xi(ni)},100),[Vr,mr,Cn,In,ln]),Fa=f.useCallback(()=>{const An=sn.current.nodes(),Vn=sn.current.edges();An.forEach(wn=>{m.some(yr=>yr.id===wn)||sn.current.removeNode(wn)}),Vn.forEach(wn=>{d.some(yr=>yr.from===wn.v&&yr.to===wn.w)||sn.current.removeEdge(wn.v,wn.w)}),m.forEach(wn=>{const vr=sn.current.nodes().find(yr=>wn.id===yr);if(vr&&sn.current.node(vr)){const{width:yr,height:ni,x:Dr,y:Bl}=sn.current.node(vr);sn.current.setNode(vr,{...wn,width:yr,height:ni,x:Dr,y:Bl})}else sn.current.setNode(wn.id,{...wn,width:0,height:0})}),d.forEach(wn=>{sn.current.setEdge(wn.from,wn.to,{...wn,label:wn.label,width:0,height:0,labelpos:Ke,labeloffset:Vt,weight:zn,minlen:yn})})},[d,m,Ke,Vt,zn,yn]),hs=f.useMemo(()=>pt()(()=>{Zt().layout(sn.current);const{height:An,width:Vn}=sn.current.graph(),wn=Math.max(0,An||0),vr=Math.max(0,Vn||0);ti(vr),qi(wn),Pr(sn.current.nodes()),io(sn.current.edges())},250,{leading:!0}),[]);f.useEffect(()=>(sn.current.setGraph({rankdir:A,align:U,nodesep:Y,edgesep:z,ranksep:ge,marginx:pe,marginy:Pe,acyclicer:Ae,ranker:Ue}),Fa(),hs(),hs.cancel),[Ae,U,A,z,pe,Pe,Y,ge,Ue,Fa,hs]);function Ol(An,Vn){return sn.current.setNode(An,Vn),hs(),sn.current}function kl(An,Vn){return sn.current.setEdge(An,Vn),hs(),sn.current}return(0,n.jsxs)("svg",{ref:us,...fr,width:"100%",height:ao,viewBox:`0 0 ${Cn} ${In}`,children:[(0,n.jsxs)("defs",{children:[(0,n.jsx)("marker",{id:de,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,n.jsx)("path",{fill:gr.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:Yt,children:(0,n.jsxs)("svg",{width:Oo,height:Hr,y:In/2-Hr/2,x:Cn/2-Oo/2,viewBox:`0 0 ${Oo} ${Hr}`,children:[so.map(An=>{const Vn=sn.current.edge(An);return Vn?(0,n.jsx)(fn,{id:An,setEdge:kl,render:nr,edge:Vn,curve:cn},`${An.v}-${An.w}`):null}),Wn.map(An=>{const Vn=sn.current.node(An);return Vn?(0,n.jsx)(dt,{setNode:Ol,render:y,node:Vn},An):null})]})})]})}var jn=r(72779),en=r.n(jn),bn,$n;const tt=(0,g.Z)(e=>({root:{padding:e.spacing(0),marginBottom:e.spacing(0),marginTop:e.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:e.spacing(6),marginTop:-e.spacing(3),zIndex:"unset"},icon:{fontSize:e.typography.h6.fontSize},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap",color:e.palette.banner.text},message:{display:"flex",alignItems:"center","& a":{color:e.palette.banner.link}},button:{color:(bn=e.palette.banner.closeButtonColor)!==null&&bn!==void 0?bn:"inherit"},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:($n=e.palette.banner.warning)!==null&&$n!==void 0?$n:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),rr=e=>{const{variant:o,message:l,id:d,fixed:m=!1}=e,y=tt(),U=useApi(storageApiRef).forBucket("notifications");var Y;const z=(Y=U.snapshot("dismissedBanners").value)!==null&&Y!==void 0?Y:[],[ge,pe]=useState(new Set(z)),Pe=useObservable(U.observe$("dismissedBanners"));useEffect(()=>{if(Pe!=null&&Pe.value){var Ue;const Ke=(Ue=Pe==null?void 0:Pe.value)!==null&&Ue!==void 0?Ue:[];pe(new Set(Ke))}},[Pe==null?void 0:Pe.value]);const Ae=()=>{U.set("dismissedBanners",[...ge,d])};return _jsx(Snackbar,{anchorOrigin:m?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!ge.has(d),classes:{root:classNames(y.root,!m&&y.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(y.content,y[o]),message:y.message},message:l,action:[_jsx(IconButton,{title:"Permanently dismiss this message",className:y.button,onClick:Ae,children:_jsx(Close,{className:y.icon})},"dismiss")]})})};var Ct=r(60905),nt=r(90436),Tn=r.p+"static/missingAnnotation.67f79e98..svg",Jt=r.p+"static/noInformation.4b426325..svg",Rn=r.p+"static/createComponent.975d1e1e..svg",Dn=r.p+"static/noBuild.1715fa71..svg";const Sn=(0,g.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),Nn=({missing:e})=>{const o=Sn();switch(e){case"field":return(0,n.jsx)("img",{src:Tn,className:o.generalImg,alt:"annotation is missing"});case"info":return(0,n.jsx)("img",{src:Jt,alt:"no Information",className:o.generalImg});case"content":return(0,n.jsx)("img",{src:Rn,alt:"create Component",className:o.generalImg});case"data":return(0,n.jsx)("img",{src:Dn,alt:"no Build",className:o.generalImg});default:return null}},Se=(0,g.Z)(e=>({root:{backgroundColor:e.palette.background.default,padding:e.spacing(2,0,0,0)},action:{marginTop:e.spacing(2)},imageContainer:{position:"relative"}}),{name:"BackstageEmptyState"});function ae(e){const{title:o,description:l,missing:d,action:m}=e,y=Se();return(0,n.jsxs)(Ct.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:y.root,spacing:2,children:[(0,n.jsx)(Ct.Z,{item:!0,xs:12,md:6,children:(0,n.jsxs)(Ct.Z,{container:!0,direction:"column",children:[(0,n.jsx)(Ct.Z,{item:!0,xs:!0,children:(0,n.jsx)(nt.Z,{variant:"h5",children:o})}),(0,n.jsx)(Ct.Z,{item:!0,xs:!0,children:(0,n.jsx)(nt.Z,{variant:"body1",children:l})}),(0,n.jsx)(Ct.Z,{item:!0,xs:!0,className:y.action,children:m})]})}),(0,n.jsx)(Ct.Z,{item:!0,xs:12,md:6,className:y.imageContainer,children:typeof d=="string"?(0,n.jsx)(Nn,{missing:d}):d.customImage})]})}const Le=`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`,Me=/^.*ANNOTATION.*$/m,Ge=Le.match(Me)[0],se=Le.split(`
12
- `).findIndex(e=>Me.test(e)),M=(0,g.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":e.palette.common.white}}),{name:"BackstageMissingAnnotationEmptyState"});function me(e){return Array.from(Array(e+1).keys(),o=>o+se)}function Be(e){const o=e.map(l=>Ge.replace("ANNOTATION",l)).join(`
13
- `);return Le.replace(Ge,o)}function Ye(e){const o=e.length<=1;return(0,n.jsxs)(n.Fragment,{children:["The ",o?"annotation":"annotations"," ",e.map(l=>(0,n.jsx)("code",{children:l})).reduce((l,d)=>(0,n.jsxs)(n.Fragment,{children:[l,", ",d]}))," ",o?"is":"are"," missing. You need to add the"," ",o?"annotation":"annotations"," to your component if you want to enable this tool."]})}function Je(e){const{annotation:o,readMoreUrl:l}=e,d=Array.isArray(o)?o:[o],m=l||"https://backstage.io/docs/features/software-catalog/well-known-annotations",y=M();return(0,n.jsx)(ae,{missing:"field",title:"Missing Annotation",description:Ye(d),action:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(nt.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,n.jsx)(E.Z,{className:y.code,children:(0,n.jsx)(Te,{text:Be(d),language:"yaml",showLineNumbers:!0,highlightedNumbers:me(d.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(ye.Z,{color:"primary",component:le.r,to:m,children:"Read more"})]})})}var Dt=r(11776),Kt=r(38402),tn=r(49378),Qt=r(41128),gn=r(27616),X=r(8284),q=r(70660),_=r(91750),v=r(38016);const L=(e,o)=>(o.palette.type==="light"?Qt._j:Qt.$n)(o.palette[e].light,.6),Q=(e,o)=>(o.palette.type==="light"?Qt.$n:Qt._j)(o.palette[e].light,.9),W=(0,g.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:o})=>L(o,e)}})),ue=({severity:e})=>{const o=W({severity:e});return(0,n.jsx)(_.Z,{classes:o})},xe=({severity:e})=>{const o=W({severity:e});return(0,n.jsx)(v.Z,{classes:o})},Ve=(0,g.Z)(e=>({panel:{backgroundColor:({severity:o})=>Q(o,e),color:({severity:o})=>L(o,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:o})=>L(o,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:o})=>L(o,e),backgroundColor:({severity:o})=>Q(o,e)},details:{width:"100%",display:"block",color:e.palette.textContrast,backgroundColor:e.palette.background.default,border:`1px solid ${e.palette.border}`,padding:e.spacing(2),fontFamily:"sans-serif"}}),{name:"BackstageWarningPanel"}),_e=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function Qe(e){const{severity:o="warning",title:l,message:d,children:m,defaultExpanded:y}=e,A=Ve({severity:o}),U=_e(o)+(l?`: ${l}`:"");return(0,n.jsxs)(gn.Z,{defaultExpanded:y!=null?y:!1,className:A.panel,role:"alert",children:[(0,n.jsxs)(X.Z,{expandIcon:(0,n.jsx)(xe,{severity:o}),className:A.summary,children:[(0,n.jsx)(ue,{severity:o}),(0,n.jsx)(nt.Z,{className:A.summaryText,variant:"subtitle1",children:U})]}),(d||m)&&(0,n.jsx)(q.Z,{children:(0,n.jsxs)(Ct.Z,{container:!0,children:[d&&(0,n.jsx)(Ct.Z,{item:!0,xs:12,children:(0,n.jsx)(nt.Z,{className:A.message,variant:"body1",children:d})}),m&&(0,n.jsx)(Ct.Z,{item:!0,xs:12,className:A.details,children:m})]})})]})}const At=(0,g.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),yt=({error:e,message:o,stack:l,children:d})=>{const m=At();return(0,n.jsxs)(Dt.Z,{dense:!0,children:[(0,n.jsxs)(Kt.Z,{alignItems:"flex-start",children:[(0,n.jsx)(tn.Z,{classes:{secondary:m.text},primary:"Error",secondary:e}),(0,n.jsx)(te,{text:e})]}),(0,n.jsxs)(Kt.Z,{alignItems:"flex-start",children:[(0,n.jsx)(tn.Z,{classes:{secondary:m.text},primary:"Message",secondary:o}),(0,n.jsx)(te,{text:o})]}),l&&(0,n.jsxs)(Kt.Z,{alignItems:"flex-start",children:[(0,n.jsx)(tn.Z,{classes:{secondary:m.text},primary:"Stack Trace",secondary:l}),(0,n.jsx)(te,{text:l})]}),d]})};function ot(e){const{title:o,error:l,defaultExpanded:d,children:m}=e;return(0,n.jsx)(Qe,{severity:"error",title:o!=null?o:l.message,defaultExpanded:d,children:(0,n.jsx)(yt,{error:l.name,message:l.message,stack:l.stack,children:m})})}var Fe=r(85256);const Ut=(0,g.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function rn(e){var o;const{title:l,error:d,defaultExpanded:m}=e,y=Ut();if(d.name!=="ResponseError")return(0,n.jsx)(ot,{title:l!=null?l:d.message,defaultExpanded:m,error:d});const{body:A,cause:U}=d,{request:Y,response:z}=A,ge=`${z.statusCode}: ${U.name}`,pe=Y&&`${Y.method} ${Y.url}`,Pe=U.message.replace(/\\n/g,`
14
- `),Ae=(o=U.stack)===null||o===void 0?void 0:o.replace(/\\n/g,`
15
- `),Ue=JSON.stringify(A,void 0,2);return(0,n.jsxs)(ot,{title:l!=null?l:d.message,defaultExpanded:m,error:{name:ge,message:Pe,stack:Ae},children:[pe&&(0,n.jsxs)(Kt.Z,{alignItems:"flex-start",children:[(0,n.jsx)(tn.Z,{classes:{secondary:y.text},primary:"Request",secondary:Y?`${pe}`:void 0}),(0,n.jsx)(te,{text:pe})]}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Fe.Z,{component:"li",className:y.divider}),(0,n.jsx)(Kt.Z,{alignItems:"flex-start",children:(0,n.jsx)(tn.Z,{classes:{secondary:y.text},primary:"Full Error as JSON"})}),(0,n.jsx)(Te,{language:"json",text:Ue,showCopyCodeButton:!0})]})]})}var It=r(28316);function Ot(e){const o=document.createElement("div");return o.setAttribute("id",e),o}function mn(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function un(e){const o=useRef(null);useEffect(function(){const m=document.querySelector(`#${e}`),y=m||Ot(e);return m||mn(y),y.appendChild(o.current),function(){o.current.remove(),y.childNodes.length===-1&&y.remove()}},[e]);function l(){return o.current||(o.current=document.createElement("div")),o.current}return l()}var ut=null;const We="core.calloutSeen";function Tt(){const[e,o]=useState(()=>{const d=localStorage.getItem(We);return d?JSON.parse(d):{}}),l=useCallback((d,m)=>{const y=localStorage.getItem(We),U={...y?JSON.parse(y):{},[d]:m};o(U),localStorage.setItem(We,JSON.stringify(U))},[]);return{states:e,setState:l}}function hn(e){const{states:o,setState:l}=Tt(),d=useCallback(()=>{l(e,!0)},[l,e]);return{seen:o[e]===!0,markSeen:d}}function on(e){const{seen:o,markSeen:l}=hn(e);return{show:o===!1,hide:l}}const Fn=(0,g.Z)(e=>({"@keyframes pulsateSlightly":{"0%":{transform:"scale(1.0)"},"100%":{transform:"scale(1.1)"}},"@keyframes pulsateAndFade":{"0%":{transform:"scale(1.0)",opacity:.9},"100%":{transform:"scale(1.5)",opacity:0}},featureWrapper:{position:"relative"},backdrop:{zIndex:2e3,position:"fixed",overflow:"hidden",left:0,right:0,top:0,bottom:0},dot:{position:"absolute",backgroundColor:"transparent",borderRadius:"100%",border:"1px solid rgba(103, 146, 180, 0.98)",boxShadow:"0px 0px 0px 20000px rgba(0, 0, 0, 0.5)",zIndex:2001,transformOrigin:"center center",animation:"$pulsateSlightly 1744ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) alternate infinite"},pulseCircle:{width:"100%",height:"100%",backgroundColor:"transparent",borderRadius:"100%",border:`2px solid ${e.palette.common.white}`,zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:e.palette.common.white,zIndex:2003}}),{name:"BackstageFeatureCalloutCircular"});function ur(e){const{featureId:o,title:l,description:d,children:m}=e,{show:y,hide:A}=useShowCallout(o),U=usePortal("core.callout"),Y=useRef(null),[z,ge]=useState(),pe=Fn(),Pe=useCallback(()=>{if(Y.current){const Ae=Y.current.getBoundingClientRect(),Ue=Math.max(Ae.width,Ae.height),Ke=800,Vt=Ae.x-(Ue-Ae.width)/2-Ke,yn=Ae.y-(Ue-Ae.height)/2-Ke,zn=Ue+2*Ke,nr=450,Pt=Ae.x+Ae.width/2-nr,ln=Ae.y-(Ue-Ae.height)/2+Ue+20;ge({dotLeft:Vt,dotTop:yn,dotSize:zn,borderWidth:Ke,textTop:ln,textLeft:Pt,textWidth:nr})}},[]);return useEffect(()=>(window.addEventListener("resize",Pe),window.addEventListener("scroll",Pe),()=>{window.removeEventListener("resize",Pe),window.removeEventListener("scroll",Pe)}),[Pe]),useLayoutEffect(Pe,[Y.current,Pe]),y?_jsxs(_Fragment,{children:[_jsx(Box,{className:pe.featureWrapper,ref:Y,children:m}),createPortal(_jsx(Box,{className:pe.backdrop,children:_jsx(ClickAwayListener,{onClickAway:A,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:pe.dot,"data-testid":"dot",style:{left:z==null?void 0:z.dotLeft,top:z==null?void 0:z.dotTop,width:z==null?void 0:z.dotSize,height:z==null?void 0:z.dotSize,borderWidth:z==null?void 0:z.borderWidth},onClick:A,onKeyDown:A,role:"button",tabIndex:0,children:_jsx(Box,{className:pe.pulseCircle})}),_jsxs(Box,{className:pe.text,"data-testid":"text",style:{left:z==null?void 0:z.textLeft,top:z==null?void 0:z.textTop,width:z==null?void 0:z.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:l}),_jsx(Typography,{children:d})]})]})})}),U)]}):_jsx(_Fragment,{children:m})}var Zn=r(35292);const Un=(0,g.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function or({color:e="primary",disabled:o=!1,href:l="#",icon:d=(0,n.jsx)(Zn.Z,{}),label:m,onClick:y,title:A}){const U=Un();return o?(0,n.jsxs)(E.Z,{title:A,className:en()(U.link,U.disabled),children:[d,(0,n.jsx)(nt.Z,{variant:"caption",component:"span",className:U.label,children:m})]}):(0,n.jsxs)(le.r,{title:A,className:en()(U.link,U[e]),to:l,onClick:y,children:[d,(0,n.jsx)(nt.Z,{variant:"caption",component:"span",className:U.label,children:m})]})}const Nr=(0,g.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function Lr(e){const{links:o}=e,l=Nr();return(0,n.jsx)("nav",{className:l.links,children:o.map((d,m)=>(0,n.jsx)(or,{...d},m+1))})}const sr=e=>{const o=e==="dark"?"16%":"97%";return`
16
- hsl(0, 0%, ${o}) 0%,
17
- hsla(0, 0%, ${o}, 0.987) 8.1%,
18
- hsla(0, 0%, ${o}, 0.951) 15.5%,
19
- hsla(0, 0%, ${o}, 0.896) 22.5%,
20
- hsla(0, 0%, ${o}, 0.825) 29%,
21
- hsla(0, 0%, ${o}, 0.741) 35.3%,
22
- hsla(0, 0%, ${o}, 0.648) 41.2%,
23
- hsla(0, 0%, ${o}, 0.55) 47.1%,
24
- hsla(0, 0%, ${o}, 0.45) 52.9%,
25
- hsla(0, 0%, ${o}, 0.352) 58.8%,
26
- hsla(0, 0%, ${o}, 0.259) 64.7%,
27
- hsla(0, 0%, ${o}, 0.175) 71%,
28
- hsla(0, 0%, ${o}, 0.104) 77.5%,
29
- hsla(0, 0%, ${o}, 0.049) 84.5%,
30
- hsla(0, 0%, ${o}, 0.013) 91.9%,
31
- hsla(0, 0%, ${o}, 0) 100%
32
- `},xr=100,S=10,c=(0,g.Z)(e=>({root:{position:"relative",display:"flex",flexFlow:"row nowrap",alignItems:"center"},container:{overflow:"auto",scrollbarWidth:0,"&::-webkit-scrollbar":{display:"none"}},fade:{position:"absolute",width:xr,height:`calc(100% + ${S}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-S,background:`linear-gradient(90deg, ${sr(e.palette.type)})`},fadeRight:{right:-S,background:`linear-gradient(270deg, ${sr(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function x(e){const[[o,l],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const m=e.current;if(!m){d([0,0]);return}const y=()=>{const A=m.scrollLeft,U=m.scrollWidth-m.offsetWidth-m.scrollLeft;d([A,U])};return y(),m.addEventListener("scroll",y),window.addEventListener("resize",y),()=>{m.removeEventListener("scroll",y),window.removeEventListener("resize",y)}},[e]),[o,l]}function w(e,o,l){const[d,m]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const y=window.performance.now(),A=requestAnimationFrame(U=>{if(!e.current)return;const Y=U-y,z=Math.abs(d)*Y/o,pe=Math.max(l,z)*Math.sign(d);e.current.scrollBy({left:pe});const Pe=d-pe;Math.sign(d)!==Math.sign(Pe)?m(0):m(Pe)});return()=>cancelAnimationFrame(A)},[e,d,o,l]),m}function J(e){const{scrollStep:o=100,scrollSpeed:l=50,minScrollDistance:d=5,children:m,...y}=e,A=c(e),U=React.useRef(),[Y,z]=x(U),ge=w(U,l,d),pe=Pe=>{U.current&&ge(Pe?o:-o)};return _jsxs(Box,{...y,className:A.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:A.container,ref:U,children:m}),_jsx(Box,{className:classNames(A.fade,A.fadeLeft,{[A.fadeHidden]:Y===0})}),_jsx(Box,{className:classNames(A.fade,A.fadeRight,{[A.fadeHidden]:z===0})}),Y>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>pe(!1),className:classNames(A.button,A.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),z>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>pe(!0),className:classNames(A.button,A.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const fe=(0,g.Z)(e=>({alpha:{color:e.palette.common.white,fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}}),{name:"BackstageLifecycle"});function we(e){const o=fe(e),{shorthand:l,alpha:d}=e;return l?_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],style:{fontSize:"120%"},children:d?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],children:d?"Alpha":"Beta"})}const je=(0,f.lazy)(()=>Promise.all([r.e(1049),r.e(6051)]).then(r.bind(r,76051)).then(e=>({default:e.RealLogViewer})));function qe(e){const{Progress:o}=(0,p.qD)().getComponents();return(0,n.jsx)(f.Suspense,{fallback:(0,n.jsx)(o,{}),children:(0,n.jsx)(je,{...e})})}var Mt=r(28865),xn=r(60251);const Jn=(0,g.Z)(e=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${e.palette.border}`},"& th, & td":{border:`1px solid ${e.palette.border}`,padding:e.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:e.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:e.palette.background.paper},"& tr":{backgroundColor:e.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:e.palette.background.default},"& a":{color:e.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),br=(e,o)=>o?typeof o=="string"?e+o:f.Children.toArray(o.props.children).reduce(br,e):e,Sr=({level:e,children:o})=>{const m=f.Children.toArray(o).reduce(br,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return f.createElement(`h${e}`,{id:m},o)},Or={code:({inline:e,className:o,children:l,...d})=>{const m=String(l).replace(/\n+$/,""),y=/language-(\w+)/.exec(o||"");return!e&&y?(0,n.jsx)(Te,{language:y[1],text:m}):(0,n.jsx)("code",{className:o,...d,children:l})},h1:Sr,h2:Sr,h3:Sr,h4:Sr,h5:Sr,h6:Sr};function lo(e){const{content:o,dialect:l="gfm",linkTarget:d,transformLinkUri:m,transformImageUri:y,className:A}=e,U=Jn();return(0,n.jsx)(Mt.D,{remarkPlugins:l==="gfm"?[xn.Z]:[],className:`${U.markdown} ${A}`,children:o,components:Or,linkTarget:d,transformLinkUri:m,transformImageUri:y})}var co=r(23054);const hr=(0,g.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),Hn=({request:e,busy:o,setBusy:l})=>{const d=hr(),[m,y]=useState(),A=async()=>{l(!0);try{await e.trigger()}catch(Y){y(isError(Y)?Y.message:"An unspecified error occurred")}finally{l(!1)}},U=e.provider.icon;return _jsxs(ListItem,{disabled:o,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx(U,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:m&&_jsx(Typography,{color:"error",children:m})}),_jsx(Button,{color:"primary",variant:"contained",onClick:A,children:"Log in"})]})};var Fr=null;const Zr=(0,g.Z)(e=>({dialog:{paddingTop:e.spacing(1)},title:{minWidth:0},titleHeading:{fontSize:e.typography.h6.fontSize},contentList:{padding:0},actionButtons:{padding:e.spacing(2,0)}}),{name:"OAuthRequestDialog"});function Bo(e){const o=Zr(),[l,d]=useState(!1),m=useApi(oauthRequestApiRef),y=useApi(configApiRef);var A;const U=(A=y.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&A!==void 0?A:!1,Y=useObservable(useMemo(()=>m.authRequest$(),[m]),[]),z=()=>{Y.forEach(ge=>ge.reject())};return _jsxs(Dialog,{open:Boolean(Y.length),fullWidth:!0,maxWidth:"xs",classes:{paper:o.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsxs(DialogTitle,{classes:{root:o.title},id:"oauth-req-dialog-title",children:[_jsx(Typography,{className:o.titleHeading,variant:"h1",variantMapping:{h1:"span"},children:"Login Required"}),U?_jsx(Typography,{children:"This will trigger a http redirect to OAuth Login."}):null]}),_jsx(DialogContent,{dividers:!0,classes:{root:o.contentList},children:_jsx(List,{children:Y.map(ge=>_jsx(LoginRequestListItem,{request:ge,busy:l,setBusy:d},ge.provider.title))})})]}),_jsx(DialogActions,{classes:{root:o.actionButtons},children:_jsx(Button,{onClick:z,children:"Reject All"})})]})}var $o=r(15277),Gr=r.n($o),Do=r(29862);const No=(0,g.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Kr(e){const[o,l]=(0,f.useState)(!1),d=(0,Do.t)(),m=No(),y=U=>{d()&&l(U)};var A;return(0,n.jsx)(P.ZP,{title:(A=e.title)!==null&&A!==void 0?A:e.text||"",placement:e.placement,disableHoverListener:!o,children:(0,n.jsx)(Gr(),{text:e.text,line:e.line,onToggled:y,containerClassName:m.container})})}var qn=r(67358);function kr(e){const o=(0,ie.Z)(),[l,d]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{const m=setTimeout(()=>d(!0),o.transitions.duration.short);return()=>clearTimeout(m)},[o.transitions.duration.short]),l?(0,n.jsx)(qn.Z,{...e,"data-testid":"progress"}):(0,n.jsx)(E.Z,{display:"none"})}var Cr=r(94339),uo=r(14503),Yr=r(24579),Jr=r(32552),On=r(15459),ho=r(27597);const Ur=(0,g.Z)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function Fo(e){const{link:o,title:l,onClick:d}=e,m=Ur();return(0,n.jsxs)(E.Z,{children:[(0,n.jsx)(Fe.Z,{}),(0,n.jsx)(le.r,{to:o,onClick:d,underline:"none",children:(0,n.jsxs)(E.Z,{display:"flex",alignItems:"center",className:m.root,children:[(0,n.jsx)(E.Z,{className:m.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,n.jsx)(nt.Z,{children:(0,n.jsx)("strong",{children:l})})}),(0,n.jsx)(ho.Z,{className:m.arrow})]})})]})}const wr=e=>{const{slackChannel:o}=e;if(o){if(typeof o=="string")return(0,n.jsxs)(nt.Z,{children:["Please contact ",o," for help."]});if(!o.href)return(0,n.jsxs)(nt.Z,{children:["Please contact ",o.name," for help."]})}else return null;return(0,n.jsx)(ee,{to:o.href,variant:"contained",children:o.name})},po=class extends f.Component{componentDidCatch(o,l){console.error(`ErrorBoundary, error: ${o}, info: ${l}`),this.setState({error:o,errorInfo:l})}render(){const{slackChannel:o,children:l}=this.props,{error:d}=this.state;return d?(0,n.jsx)(ot,{title:"Something Went Wrong",error:d,children:(0,n.jsx)(wr,{slackChannel:o})}):l}constructor(o){super(o),this.state={error:void 0,errorInfo:void 0}}},fo=(0,g.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),Zo=(0,On.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(uo.Z),go={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 jr(e){const{title:o,subheader:l,divider:d=!0,deepLink:m,slackChannel:y,errorBoundaryProps:A,variant:U,children:Y,headerStyle:z,headerProps:ge,icon:pe,action:Pe,actionsClassName:Ae,actions:Ue,cardClassName:Ke,actionsTopRight:Vt,className:yn,noPadding:zn,titleTypographyProps:nr}=e,Pt=fo();let ln={},cn={};U&&U.split(/[\s]+/g).forEach(mr=>{ln={...ln,...go.card[mr]},cn={...cn,...go.cardContent[mr]}});const dr=()=>!l&&!pe?null:(0,n.jsxs)("div",{className:Pt.headerSubheader,"data-testid":"info-card-subheader",children:[l&&(0,n.jsx)("div",{className:Pt.subheader,children:l}),pe]}),fr=A||(y?{slackChannel:y}:{});return(0,n.jsx)(Cr.Z,{style:ln,className:yn,children:(0,n.jsxs)(po,{...fr,children:[o&&(0,n.jsx)(Jr.Z,{classes:{root:Pt.header,title:Pt.headerTitle,subheader:Pt.headerSubheader,avatar:Pt.headerAvatar,action:Pt.headerAction,content:Pt.headerContent},title:o,subheader:dr(),action:Pe,style:{...z},titleTypographyProps:nr,...ge}),Vt&&(0,n.jsx)(Zo,{children:Vt}),d&&(0,n.jsx)(Fe.Z,{}),(0,n.jsx)(Yr.Z,{className:en()(Ke,{[Pt.noPadding]:zn}),style:cn,children:Y}),Ue&&(0,n.jsx)(uo.Z,{className:Ae,children:Ue}),m&&(0,n.jsx)(Fo,{...m})]})})}var ps=r(39307);const Uo=(0,g.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:e.typography.pxToRem(45),fontWeight:e.typography.fontWeightBold,color:e.palette.textContrast},description:{fontSize:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)",position:"absolute",wordBreak:"break-all",display:"inline-block"},circle:{width:"80%",transform:"translate(10%, 0)"},colorUnknown:{}}),{name:"BackstageGauge"}),Qr={fractional:!0,inverse:!1,unit:"%",max:100},mo=({palette:e,value:o,inverse:l,max:d})=>{if(isNaN(o))return"#ddd";const m=d||Qr.max,y=l?m-o:o;return y<m/3?e.status.error:y<m*(2/3)?e.status.warning:e.status.ok};function Br(e){const[o,l]=useState(null),{getColor:d=mo}=e,m=Uo(e),{palette:y}=useTheme(),{value:A,fractional:U,inverse:Y,unit:z,max:ge,description:pe}={...Qr,...e},Pe=U?Math.round(A*ge):A,Ae=ge!==100?Math.round(A):Pe,[Ue,Ke]=useState(!1);return useEffect(()=>{const Vt=o,yn=()=>Ke(!0),zn=()=>Ke(!1);return Vt&&pe?(Vt.addEventListener("mouseenter",yn),Vt.addEventListener("mouseleave",zn),()=>{Vt.removeEventListener("mouseenter",yn),Vt.removeEventListener("mouseleave",zn)}):()=>{Ke(!1)}},[pe,o]),_jsxs(Box,{ref:l,className:m.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:Pe,strokeWidth:12,trailWidth:12,strokeColor:d({palette:y,value:Ae,inverse:Y,max:ge}),className:m.circle}),pe&&Ue?_jsx(Box,{className:m.description,children:pe}):_jsx(Box,{className:m.overlay,children:isNaN(A)?"N/A":`${Ae}${z}`})]})}const Pn=(0,g.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function ri(e){const o=Pn(e),{title:l,subheader:d,progress:m,inverse:y,deepLink:A,description:U,icon:Y,variant:z,getColor:ge}=e,pe={inverse:y,description:U,getColor:ge,value:m};return _jsx(Box,{className:o.root,children:_jsx(InfoCard,{title:l,subheader:d,deepLink:A,variant:z,icon:Y,children:_jsx(Gauge,{...pe})})})}function fs(e){const{value:o,getColor:l=getProgressColor}=e,{palette:d}=useTheme();if(isNaN(o))return null;let m=Math.round(o*100*100)/100;m>100&&(m=100);const y=l({palette:d,value:m,inverse:!1,max:100});return _jsx(Tooltip,{title:`${m}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:m,strokeWidth:4,trailWidth:4,strokeColor:y})})})}var gs=r(21324),Mo=r(7089),vo=r(42494),ms=r(74603),vs=r(56939),ir=r(12231),zo=r(73698),Gn=r(12420),yo=r(72379);const Wo=(0,g.Z)(e=>(0,Gn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var Vo=()=>{const e=Wo();return(0,n.jsx)(yo.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 Ho=(0,g.Z)(e=>(0,Gn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Go=()=>{const e=Ho();return(0,n.jsx)(yo.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 qr=(0,On.Z)(e=>(0,Gn.Z)({root:{"label + &":{marginTop:e.spacing(3)}},input:{borderRadius:e.shape.borderRadius,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:e.typography.body1.fontSize,padding:e.spacing(1.25,3.25,1.25,1.5),transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:e.shape.borderRadius}}}),{name:"BackstageSelectInputBase"})(ms.Z),Ko=(0,g.Z)(e=>(0,Gn.Z)({formControl:{margin:`${e.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:2},checkbox:{},root:{display:"flex",flexDirection:"column"}}),{name:"BackstageSelect"});function Yo(e){const{multiple:o,items:l,label:d,placeholder:m,selected:y,onChange:A,triggerReset:U,native:Y=!1,disabled:z=!1,margin:ge}=e,pe=Ko(),[Pe,Ae]=(0,f.useState)(y||(o?[]:"")),[Ue,Ke]=(0,f.useState)(!1);(0,f.useEffect)(()=>{Ae(o?[]:"")},[U,o]),(0,f.useEffect)(()=>{Ae(y||(o?[]:""))},[y,o]);const Vt=Pt=>{Ae(Pt.target.value),A(Pt.target.value)},yn=Pt=>{if(z){Pt.preventDefault();return}Ke(ln=>o&&!(Pt.target instanceof HTMLElement)?!0:!ln)},zn=()=>{Ke(!1)},nr=Pt=>()=>{const ln=Pe.filter(cn=>cn!==Pt);Ae(ln),A(ln)};return(0,n.jsx)(E.Z,{className:pe.root,children:(0,n.jsxs)(vo.Z,{className:pe.formControl,children:[(0,n.jsx)(vs.Z,{className:pe.formLabel,children:d}),(0,n.jsxs)(zo.Z,{"aria-label":d,value:Pe,native:Y,disabled:z,"data-testid":"select",displayEmpty:!0,multiple:o,margin:ge,onChange:Vt,open:Ue,onOpen:yn,onClose:zn,input:(0,n.jsx)(qr,{}),label:d,tabIndex:0,renderValue:Pt=>{var ln;return o&&Pe.length!==0?(0,n.jsx)(E.Z,{className:pe.chips,children:Pt.map(cn=>{var dr,fr;return(0,n.jsx)(Mo.Z,{label:(dr=l.find(gr=>gr.value===cn))===null||dr===void 0?void 0:dr.label,clickable:!0,onDelete:nr(cn),className:pe.chip},(fr=l.find(gr=>gr.value===cn))===null||fr===void 0?void 0:fr.value)})}):(0,n.jsx)(nt.Z,{children:Pe.length===0?m||"":(ln=l.find(cn=>cn.value===Pt))===null||ln===void 0?void 0:ln.label})},IconComponent:()=>Ue?(0,n.jsx)(Go,{}):(0,n.jsx)(Vo,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[m&&!o&&(0,n.jsx)(ir.Z,{value:[],children:m}),Y?l&&l.map(Pt=>(0,n.jsx)("option",{value:Pt.value,children:Pt.label},Pt.value)):l&&l.map(Pt=>(0,n.jsxs)(ir.Z,{value:Pt.value,children:[o&&(0,n.jsx)(gs.Z,{color:"primary",checked:Pe.includes(Pt.value)||!1,className:pe.checkbox}),Pt.label]},Pt.value))]})]})})}const b=()=>{},j=f.createContext({stepperLength:0,stepIndex:0,setStepIndex:b,stepHistory:[],setStepHistory:b,onStepChange:b});function R(e){const{children:o,elevated:l,onStepChange:d,activeStep:m=0}=e,[y,A]=useState(m),[U,Y]=useState([0]);useEffect(()=>{A(m)},[m]);const z=[];let ge;return Children.forEach(o,pe=>{isValidElement(pe)&&(pe.props.end?ge=pe:z.push(pe))}),_jsxs(_Fragment,{children:[_jsx(j.Provider,{value:{stepIndex:y,setStepIndex:A,stepHistory:U,setStepHistory:Y,onStepChange:d,stepperLength:Children.count(o)},children:_jsx(MuiStepper,{activeStep:y,orientation:"vertical",elevation:l?2:0,children:z})}),y>=Children.count(o)-1&&ge]})}const B=(0,g.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),K=({text:e,handleClick:o})=>_jsx(Button,{onClick:o,children:e||"Reset"}),he=({text:e,handleClick:o,disabled:l,last:d,stepIndex:m})=>_jsx(Button,{variant:"contained",color:"primary",disabled:l,"data-testid":`nextButton-${m}`,onClick:o,children:e||(d?"Finish":"Next")}),ce=({text:e,handleClick:o,disabled:l,stepIndex:d})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:l,"data-testid":`skipButton-${d}`,onClick:o,children:e||"Skip"}),Ce=({text:e,handleClick:o,disabled:l,stepIndex:d})=>_jsx(Button,{onClick:o,"data-testid":`backButton-${d}`,disabled:l,children:e||"Back"}),Oe=({actions:e={},children:o})=>{const l=B(),{stepperLength:d,stepIndex:m,setStepIndex:y,stepHistory:A,setStepHistory:U,onStepChange:Y}=useContext(VerticalStepperContext),z=(Ae,Ue)=>{Ue&&Ue(),Y&&Y(m,Ae),y(Ae)},ge=()=>{const Ae=e.nextStep?e.nextStep(m,d-1):m+1;z(Ae,e.onNext),U([...A,Ae])},pe=()=>{A.pop(),z(A[A.length-1],e.onBack),U([...A])},Pe=()=>{z(0,e.onRestart),U([0])};return _jsxs(Box,{className:l.root,children:[[void 0,!0].includes(e.showBack)&&m!==0&&_jsx(Ce,{text:e.backText,handleClick:pe,disabled:m===0,stepIndex:m}),e.showSkip&&_jsx(ce,{text:e.skipText,handleClick:ge,disabled:!!d&&m>=d||!!e.canSkip&&!e.canSkip(),stepIndex:m}),[void 0,!0].includes(e.showNext)&&_jsx(he,{text:e.nextText,handleClick:ge,disabled:!!d&&m>=d||!!e.canNext&&!e.canNext(),stepIndex:m}),e.showRestart&&m!==0&&_jsx(K,{text:e.restartText,handleClick:Pe,stepIndex:m}),o]})},Re=(0,g.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function Ze(e){const{title:o,children:l,end:d,actions:m,...y}=e,A=Re();return d?_jsxs(Box,{className:A.end,children:[_jsx(Typography,{variant:"h6",children:o}),l,_jsx(SimpleStepperFooter,{actions:{...m||{},showNext:!1}})]}):_jsxs(MuiStep,{...y,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:o})}),_jsxs(StepContent,{children:[l,_jsx(SimpleStepperFooter,{actions:m})]})]})}const De=(0,g.Z)(e=>({status:{fontWeight:e.typography.fontWeightMedium,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:e.spacing(1),borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:e.palette.status.ok}},warning:{"&::before":{backgroundColor:e.palette.status.warning}},error:{"&::before":{backgroundColor:e.palette.status.error}},pending:{"&::before":{backgroundColor:e.palette.status.pending}},running:{"&::before":{backgroundColor:e.palette.status.running}},aborted:{"&::before":{backgroundColor:e.palette.status.aborted}}}),{name:"BackstageStatus"});function gt(e){const o=De(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function ht(e){const o=De(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function st(e){const o=De(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.error),"aria-label":"Status error","aria-hidden":"true",...e})}function $e(e){const o=De(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function it(e){const o=De(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.running),"aria-label":"Status running","aria-hidden":"true",...e})}function Nt(e){const o=De(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var vn=r(74600),mt=r(15584);const zt=e=>(0,Gn.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),Rt={root:{border:"0",verticalAlign:"top"}},Xt=e=>(0,Gn.Z)({root:{margin:e.spacing(0,0,-1,0)}}),En=e=>(0,Gn.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),Er=(0,On.Z)(zt,{name:"BackstageMetadataTableTitleCell"})(mt.Z),Ar=(0,On.Z)(Rt,{name:"BackstageMetadataTableCell"})(mt.Z),xo=({dense:e,children:o})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:o})}),kn=({title:e,children:o,...l})=>_jsxs(TableRow,{children:[e&&_jsx(Er,{children:e}),_jsx(Ar,{colSpan:e?1:2,...l,children:o})]}),Ln=(0,On.Z)(Xt,{name:"BackstageMetadataTableList"})(({classes:e,children:o})=>(0,n.jsx)(Dt.Z,{disablePadding:!0,className:e.root,children:o})),Mr=(0,On.Z)(En,{name:"BackstageMetadataTableListItem"})(({classes:e,children:o})=>(0,n.jsx)(Kt.Z,{className:e.root,children:o})),xs=(0,Gn.Z)({root:{margin:"0 0",listStyleType:"none"}}),oi=e=>(0,Gn.Z)({root:{...xs.root,paddingLeft:e.spacing(1)}}),Jo=(0,On.Z)(xs,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:o})=>(0,n.jsx)(Ln,{classes:e,children:o})),bs=(0,On.Z)(oi,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:o})=>(0,n.jsx)(Ln,{classes:e,children:o}));function si(e,o){const l=e.map((d,m)=>_jsx(MetadataListItem,{children:Qo(d)},m));return o?_jsx(bs,{children:l}):_jsx(Jo,{children:l})}function ii(e,o,l){const d=Object.keys(e).map(m=>{const y=Qo(e[m],!0),A=l&&l.titleFormat?l.titleFormat(m):startCase(m);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${A}: `}),y]},m)});return o?_jsx(bs,{children:d}):_jsx(Jo,{children:d})}function Qo(e,o,l){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?ii(e,o,l):Array.isArray(e)?si(e,l):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const ai=({value:e,options:o})=>_jsx(Fragment,{children:Qo(e,o)}),Ss=({title:e,value:o,options:l})=>_jsx(MetadataTableItem,{title:l&&l.titleFormat?l.titleFormat(e):startCase(e),children:_jsx(ai,{value:o,options:l})});function Cs(e,o){return Object.keys(e).map(l=>_jsx(Ss,{title:l,value:e[l],options:o},l))}function $r(e){const{metadata:o,dense:l=!0,options:d}=e,m=Cs(o,d||{});return _jsx(MetadataTable,{dense:l,children:m})}var ar=r(49429),lr=r(86136),_n=r(79784),_r=r(76635),li=r(19126),ws=r.n(li);function ci(e){return qs.stringify(e,{strictNullHandling:!0})}function Xo(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function zr(e,o){return Xo(e)[o]}function js(e,o,l){const d={...Xo(e),[o]:l};return ci(d)}function di(e,o=250){const[l,d]=useSearchParams(),m=l.toString(),[y,A]=useState(zr(m,e));return useEffect(()=>{const U=zr(m,e);A(Y=>isEqual(U,Y)?Y:U)},[m,A,e]),useDebouncedEffect(()=>{const U=js(m,e,y);m!==U&&d(U,{replace:!0})},[d,y,m,e],o),[y,A]}const _i={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 eo(){const o=(0,p.I_)().get(p.Ds),l=o==null?void 0:o.getOptionalConfig("app.support");if(!l)return _i;var d;return{url:l.getString("url"),items:l.getConfigArray("items").flatMap(m=>({title:m.getString("title"),icon:m.getOptionalString("icon"),links:((d=m.getOptionalConfigArray("links"))!==null&&d!==void 0?d:[]).flatMap(y=>({url:y.getString("url"),title:y.getString("title")}))}))}}var Es=r(80079);function er(e,o){const d=(0,p.qD)().getSystemIcon(e);return d?(0,n.jsx)(d,{...o}):(0,n.jsx)(Es.Z,{...o})}function ea(e){return er("brokenImage",e)}function ta(e){return er("catalog",e)}function na(e){return er("chat",e)}function ra(e){return er("dashboard",e)}function ui(e){return er("docs",e)}function oa(e){return er("email",e)}function sa(e){return er("github",e)}function hi(e){return er("group",e)}function qo(e){return er("help",e)}function Za(e){return er("user",e)}function ia(e){return er("warning",e)}const pi=(0,g.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),fi=({icon:e})=>{const o=(0,p.qD)();var l;const d=e&&(l=o.getSystemIcon(e))!==null&&l!==void 0?l:qo;return(0,n.jsx)(d,{})};var _o;const bo=({link:e})=>(0,n.jsx)(le.r,{to:e.url,children:(_o=e.title)!==null&&_o!==void 0?_o:e.url}),As=({item:e})=>{var o;return(0,n.jsxs)(Kt.Z,{children:[(0,n.jsx)(lr.Z,{children:(0,n.jsx)(fi,{icon:e.icon})}),(0,n.jsx)(tn.Z,{primary:e.title,secondary:(o=e.links)===null||o===void 0?void 0:o.reduce((l,d,m)=>[...l,m>0&&(0,n.jsx)("br",{},m),(0,n.jsx)(bo,{link:d},d.url)],[])})]})};function gi(e){const{title:o,items:l,children:d}=e,{items:m}=eo(),[y,A]=(0,f.useState)(!1),[U,Y]=(0,f.useState)(null),z=pi(),ge=(0,Ne.Z)(Ae=>Ae.breakpoints.down("sm")),pe=Ae=>{Y(Ae.currentTarget),A(!0)},Pe=()=>{A(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(E.Z,{display:"flex",ml:1,children:ge?(0,n.jsx)(N.Z,{color:"primary",size:"small",onClick:pe,"data-testid":"support-button","aria-label":"Support",children:(0,n.jsx)(qo,{})}):(0,n.jsx)(ye.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:pe,startIcon:(0,n.jsx)(qo,{}),children:"Support"})}),(0,n.jsxs)(_n.ZP,{"data-testid":"support-button-popover",open:y,anchorEl:U,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:Pe,children:[(0,n.jsxs)(Dt.Z,{className:z.popoverList,children:[o&&(0,n.jsx)(Kt.Z,{alignItems:"flex-start",children:(0,n.jsx)(nt.Z,{variant:"subtitle1",children:o})}),f.Children.map(d,(Ae,Ue)=>(0,n.jsx)(Kt.Z,{alignItems:"flex-start",children:Ae},`child-${Ue}`)),(l!=null?l:m).map((Ae,Ue)=>(0,n.jsx)(As,{item:Ae},`item-${Ue}`))]}),(0,n.jsx)(ar.Z,{children:(0,n.jsx)(ye.Z,{color:"primary",onClick:Pe,"aria-label":"Close",children:"Close"})})]})]})}var es=r(18671),pr=r(73557),Tr=r(84800);const So=72,Bn=24,mi=18,Rr={drawerWidthClosed:So,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:So,iconSize:So-Bn*2,iconPadding:Bn,selectedIndicatorWidth:3,userBadgePadding:mi,userBadgeDiameter:So-mi*2,mobileSidebarHeight:56},aa=e=>({...Rr,...e,iconContainerWidth:Rr.drawerWidthClosed,iconSize:Rr.drawerWidthClosed-Rr.iconPadding*2,userBadgeDiameter:Rr.drawerWidthClosed-Rr.userBadgePadding*2}),Ts={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:Rr.defaultOpenDelayMs+200},la=e=>({...Ts,...e}),Ua="@backstage/core/sidebar-intro-dismissed",Qn=(0,f.createContext)({sidebarConfig:Rr,submenuConfig:Ts}),Rs=(0,f.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var Co=r(50023),wo=r(4190),jo=r(87685),vi=r(44882),to=r(51837);const ts={isOpen:!1,setOpen:()=>{}},Is=(0,f.createContext)(ts),Ps=(0,to.CT)("sidebar-open-state-context");function Ls(e){const{children:o,value:l}=e;return(0,n.jsx)(Is.Provider,{value:l,children:(0,n.jsx)(Ps.Provider,{value:(0,to.EI)({1:l}),children:o})})}const ns=()=>{const e=(0,f.useContext)(Ps),o=(0,f.useContext)(Is);if(e===void 0)return o||ts;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l};var yi=r(57998);const xi={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},Os=(0,f.createContext)(xi),ks=(0,to.CT)("sidebar-pin-state-context");function rs(e){const{children:o,value:l}=e;return(0,n.jsx)(Os.Provider,{value:l,children:(0,n.jsx)(ks.Provider,{value:(0,to.EI)({1:l}),children:o})})}const Eo=()=>{const e=(0,f.useContext)(ks),o=(0,f.useContext)(Os);if(e===void 0)return o||xi;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l},bi=(0,g.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:o=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${o.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),Bs=e=>{const{to:o,label:l,icon:d,value:m}=e,{sidebarConfig:y}=(0,f.useContext)(Qn),A=bi({sidebarConfig:y}),U=(0,pr.TH)(),{selectedMenuItemIndex:Y,setSelectedMenuItemIndex:z}=(0,f.useContext)(Ns),ge=(Pe,Ae)=>{z(Ae===Y?-1:Ae)},pe=m===Y&&Y>=0||m!==Y&&!(Y>=0)&&o===U.pathname;return(0,n.jsx)(yi.Z,{"aria-label":l,label:l,icon:d,component:le.r,to:o||U.pathname,onChange:ge,value:m,selected:pe,classes:A})},$s=e=>{const{children:o,to:l,label:d,icon:m,value:y}=e,{isMobile:A}=Eo();return A?(0,n.jsx)(Bs,{to:l,label:d,icon:m,value:y}):(0,n.jsx)(n.Fragment,{children:o})},Ds=(0,g.Z)(e=>({root:{position:"fixed",backgroundColor:e.palette.navigation.background,color:e.palette.navigation.color,bottom:0,left:0,right:0,zIndex:e.zIndex.snackbar,borderTop:"1px solid #383838"},overlay:o=>({background:e.palette.navigation.background,width:"100%",bottom:`${o.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${o.sidebarConfig.mobileSidebarHeight}px)`,flex:"0 1 auto",overflow:"auto"}),overlayHeader:{display:"flex",color:e.palette.text.primary,alignItems:"center",justifyContent:"space-between",padding:e.spacing(2,3)},overlayHeaderClose:{color:e.palette.text.primary},marginMobileSidebar:o=>({marginBottom:`${o.sidebarConfig.mobileSidebarHeight}px`})})),Si=e=>(0,_r.orderBy)(e,({props:{priority:o}})=>Number.isInteger(o)?o:-1,"desc"),Ci=f.createElement($s).type,ca=({children:e,label:o="Menu",open:l,onClose:d})=>{const{sidebarConfig:m}=(0,f.useContext)(Qn),y=Ds({sidebarConfig:m});return(0,n.jsxs)(wo.ZP,{anchor:"bottom",open:l,onClose:d,ModalProps:{BackdropProps:{classes:{root:y.marginMobileSidebar}}},classes:{root:y.marginMobileSidebar,paperAnchorBottom:y.overlay},children:[(0,n.jsxs)(E.Z,{className:y.overlayHeader,children:[(0,n.jsx)(nt.Z,{variant:"h3",children:o}),(0,n.jsx)(N.Z,{onClick:d,classes:{root:y.overlayHeaderClose},children:(0,n.jsx)(jo.Z,{})})]}),(0,n.jsx)(E.Z,{component:"nav",children:e})]})},Ns=(0,f.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),wi=e=>{const{sidebarConfig:o}=(0,f.useContext)(Qn),{children:l}=e,d=Ds({sidebarConfig:o}),m=(0,pr.TH)(),[y,A]=(0,f.useState)(-1);(0,f.useEffect)(()=>{A(-1)},[m.pathname]);let U=(0,p.vJ)(l,z=>z.getElements().filter(ge=>ge.type===Ci));if(l)U.length?U=Si(U):U.push((0,n.jsx)($s,{icon:(0,n.jsx)(vi.Z,{}),children:l},"default_menu"));else return null;const Y=y>=0&&!U[y].props.to;return(0,n.jsx)(Ls,{value:{isOpen:!0,setOpen:()=>{}},children:(0,n.jsxs)(Ns.Provider,{value:{selectedMenuItemIndex:y,setSelectedMenuItemIndex:A},children:[(0,n.jsx)(ca,{label:U[y]&&U[y].props.label,open:Y,onClose:()=>A(-1),children:U[y]&&U[y].props.children}),(0,n.jsx)(Co.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:U})]})})};var Ao;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(Ao||(Ao={}));const Fs={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(Ao.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(Ao.SIDEBAR_PIN_STATE,JSON.stringify(e))}},Zs=(0,g.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:o=>o.isPinned?o.sidebarConfig.drawerWidthOpen:o.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:o=>o.sidebarConfig.mobileSidebarHeight}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),To=(0,f.createContext)({content:{contentRef:void 0}});function ji(e){const[o,l]=(0,f.useState)(()=>Fs.getSidebarPinState()),{sidebarConfig:d}=(0,f.useContext)(Qn),m=(0,f.useRef)(null),y=(0,f.useMemo)(()=>({content:{contentRef:m}}),[m]);(0,f.useEffect)(()=>{Fs.setSidebarPinState(o)},[o]);const A=(0,Ne.Z)(z=>z.breakpoints.down("xs"),{noSsr:!0}),U=()=>l(!o),Y=Zs({isPinned:o,sidebarConfig:d});return(0,n.jsx)(rs,{value:{isPinned:o,toggleSidebarPinState:U,isMobile:A},children:(0,n.jsx)(To.Provider,{value:y,children:(0,n.jsx)(E.Z,{className:Y.root,children:e.children})})})}function Us(){const{content:e}=(0,f.useContext)(To);return{focusContent:(0,f.useCallback)(()=>{var l,d;e==null||(l=e.contentRef)===null||l===void 0||(d=l.current)===null||d===void 0||d.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const Ms=(0,g.Z)(e=>({drawer:{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:e.zIndex.appBar,background:e.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}},drawerWidth:o=>({width:o.sidebarConfig.drawerWidthClosed}),drawerOpen:o=>({width:o.sidebarConfig.drawerWidthOpen,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shorter})}),visuallyHidden:{top:0,position:"absolute",zIndex:1e3,transform:"translateY(-200%)","&:focus":{transform:"translateY(5px)"}}}),{name:"BackstageSidebar"});var Kn;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Kn||(Kn={}));const da=e=>{const{sidebarConfig:o}=(0,f.useContext)(Qn),{openDelayMs:l=o.defaultOpenDelayMs,closeDelayMs:d=o.defaultCloseDelayMs,disableExpandOnHover:m,children:y}=e,A=Ms({sidebarConfig:o}),U=(0,Ne.Z)(yn=>yn.breakpoints.down("md"),{noSsr:!0}),[Y,z]=(0,f.useState)(Kn.Closed),ge=(0,f.useRef)(),{isPinned:pe,toggleSidebarPinState:Pe}=Eo(),Ae=()=>{pe||m||(ge.current&&(clearTimeout(ge.current),ge.current=void 0),Y!==Kn.Open&&!U&&(ge.current=window.setTimeout(()=>{ge.current=void 0,z(Kn.Open)},l),z(Kn.Idle)))},Ue=()=>{pe||m||(ge.current&&(clearTimeout(ge.current),ge.current=void 0),Y===Kn.Idle?z(Kn.Closed):Y===Kn.Open&&(ge.current=window.setTimeout(()=>{ge.current=void 0,z(Kn.Closed)},d)))},Ke=Y===Kn.Open&&!U||pe,Vt=yn=>{yn?(z(Kn.Open),Pe()):(z(Kn.Closed),Pe())};return(0,n.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,n.jsx)(ua,{}),(0,n.jsx)(Ls,{value:{isOpen:Ke,setOpen:Vt},children:(0,n.jsx)(E.Z,{className:A.root,"data-testid":"sidebar-root",onMouseEnter:m?()=>{}:Ae,onFocus:m?()=>{}:Ae,onMouseLeave:m?()=>{}:Ue,onBlur:m?()=>{}:Ue,children:(0,n.jsx)(E.Z,{className:en()(A.drawer,A.drawerWidth,{[A.drawerOpen]:Ke}),children:y})})})]})},no=e=>{var o;const l=aa((o=e.sidebarOptions)!==null&&o!==void 0?o:{});var d;const m=la((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:y,disableExpandOnHover:A,openDelayMs:U,closeDelayMs:Y}=e,{isMobile:z}=Eo();return z?(0,n.jsx)(wi,{children:y}):(0,n.jsx)(Qn.Provider,{value:{sidebarConfig:l,submenuConfig:m},children:(0,n.jsx)(da,{openDelayMs:U,closeDelayMs:Y,disableExpandOnHover:A,children:y})})};function ua(){const{sidebarConfig:e}=(0,f.useContext)(Qn),{focusContent:o,contentRef:l}=Us(),d=Ms({sidebarConfig:e});return l!=null&&l.current?(0,n.jsx)(ye.Z,{onClick:o,variant:"contained",className:en()(d.visuallyHidden),children:"Skip to content"}):null}function Ei(e,o){const l=new URLSearchParams(o.search).toString(),d=ws().parse(l),m=new URLSearchParams(e.search).toString(),y=ws().parse(m);return(0,_r.isEqual)(o.pathname,e.pathname)&&(0,_r.isMatch)(y,d)}const Ai=(0,g.Z)(e=>{var o,l;return{item:{height:48,width:"100%","&:hover":{background:((o=e.palette.navigation.navItem)===null||o===void 0?void 0:o.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:e.spacing(2.5),cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:e.palette.common.white},label:{margin:e.spacing(1.75),marginLeft:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:((l=e.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}},{name:"BackstageSidebarSubmenuItem"}),ha=e=>{const{title:o,subtitle:l,to:d,icon:m,dropdownItems:y}=e,A=Ai(),{setIsHoveredOn:U}=useContext(SidebarItemWithSubmenuContext),Y=()=>{U(!1)},z=useResolvedPath(d!=null?d:""),ge=useLocation();let pe=isLocationMatch(ge,z);const[Pe,Ae]=useState(!1),Ue=()=>{Ae(!Pe)};return y!==void 0?(y.some(Ke=>{const Vt=resolvePath(Ke.to);return pe=isLocationMatch(ge,Vt),pe}),_jsxs(Box,{className:A.itemContainer,children:[_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:Ue,onTouchStart:Ke=>Ke.stopPropagation(),className:classnames(A.item,pe?A.selected:void 0),children:[m&&_jsx(m,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:A.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",className:A.subtitle,children:l})]}),Pe?_jsx(ArrowDropUpIcon,{className:A.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:A.dropdownArrow})]})}),y&&Pe&&_jsx(Box,{className:A.dropdown,children:y.map((Ke,Vt)=>_jsx(Tooltip,{title:Ke.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:Ke.to,underline:"none",className:A.dropdownItem,onClick:Y,onTouchStart:yn=>yn.stopPropagation(),children:_jsx(Typography,{className:A.textContent,children:Ke.title})})},Vt))})]})):_jsx(Box,{className:A.itemContainer,children:_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames(A.item,pe?A.selected:void 0),onClick:Y,onTouchStart:Ke=>Ke.stopPropagation(),children:[m&&_jsx(m,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:A.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",className:A.subtitle,children:l})]})]})})})};var Ro;const pa=(0,g.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:o=>{var l;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:o.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(Ro=(l=e.palette.navigation.submenu)===null||l===void 0?void 0:l.background)!==null&&Ro!==void 0?Ro:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:o.submenuConfig.drawerWidthClosed,transitionDelay:`${o.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:o=>({width:o.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium,color:e.palette.common.white,padding:e.spacing(2.5),[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),fa=e=>{const{isOpen:o}=ns(),{sidebarConfig:l,submenuConfig:d}=(0,f.useContext)(Qn),m=o?l.drawerWidthOpen:l.drawerWidthClosed,y=pa({left:m,submenuConfig:d}),{isHoveredOn:A}=(0,f.useContext)(Rs),[U,Y]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{Y(A)},[A]),(0,n.jsxs)(E.Z,{className:en()(y.drawer,{[y.drawerOpen]:U}),children:[(0,n.jsx)(nt.Z,{variant:"h5",className:y.title,children:e.title}),e.children]})};var zs=r(26739),ro=r(76600),Ti=r(83543),Ri=r(59797),oo=r(98989);const ga=(0,g.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Ma=()=>{const e=ga();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 za=null;const ma=(0,g.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),va=()=>{const e=ma();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 Yn=null,Ws,os;const ya=e=>(0,g.Z)(o=>{var l,d;return{root:{color:o.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit",textTransform:"none"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[o.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(Ws=(l=o.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)!==null&&Ws!==void 0?Ws:"#404040"}},highlighted:{background:(os=(d=o.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&os!==void 0?os:"#404040"},label:{fontWeight:"bold",whiteSpace:"nowrap",lineHeight:"auto",flex:"3 1 auto",width:"110px",overflow:"hidden","text-overflow":"ellipsis"},iconContainer:{boxSizing:"border-box",height:"100%",width:e.iconContainerWidth,marginRight:-o.spacing(2),display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"0"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:o.typography.fontWeightBold,fontSize:o.typography.fontSize},searchFieldHTMLInput:{padding:o.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:o.spacing(6),textAlign:"center",marginRight:o.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:o.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${o.palette.navigation.indicator}`,color:o.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function ss(e){return(0,f.useMemo)(()=>ya(e),[e])()}const xa=(e,o)=>(0,p.vJ)(e.props.children,l=>{let d=!1;return l.getElements().forEach(({props:{to:m,dropdownItems:y}})=>{if(!d){if(y!=null&&y.length){y.forEach(({to:A})=>d=d||Ei(o,(0,Tr.i3)(A)));return}m&&(d=Ei(o,(0,Tr.i3)(m)))}}),d},[o.pathname]);function Vs(e){return e.to===void 0}const ba=f.createElement(fa).type,Sa=f.forwardRef(function({to:o,end:l,style:d,className:m,activeStyle:y,caseSensitive:A,activeClassName:U="active","aria-current":Y="page",...z},ge){let{pathname:pe}=(0,pr.TH)(),{pathname:Pe}=(0,pr.WU)(o);A||(pe=pe.toLocaleLowerCase("en-US"),Pe=Pe.toLocaleLowerCase("en-US"));let Ae=pe===Pe;!Ae&&!l&&(Ae=pe.startsWith(`${Pe}/`));const Ue=Ae?Y:void 0;return(0,n.jsx)(Z.rU,{...z,to:o,ref:ge,"aria-current":Ue,style:{...d,...Ae?y:void 0},className:en()([m,Ae?U:void 0])})}),Ii=(0,f.forwardRef)((e,o)=>{const{icon:l,text:d,hasNotifications:m=!1,hasSubmenu:y=!1,disableHighlight:A=!1,onClick:U,noTrack:Y,children:z,className:ge,...pe}=e,{sidebarConfig:Pe}=(0,f.useContext)(Qn),Ae=ss(Pe),{isOpen:Ue}=ns(),Ke=!Ue&&y?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},Vt=(0,n.jsxs)(E.Z,{style:Ke,children:[(0,n.jsx)(l,{fontSize:"small"}),!Ue&&y?(0,n.jsx)(oo.Z,{fontSize:"small"}):(0,n.jsx)(n.Fragment,{})]}),yn=(0,n.jsx)(zs.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!m,className:en()({[Ae.closedItemIcon]:!Ue}),children:Vt}),zn=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(E.Z,{"data-testid":"login-button",className:Ae.iconContainer,children:yn}),d&&(0,n.jsx)(nt.Z,{variant:"subtitle2",className:Ae.label,children:d}),(0,n.jsx)("div",{className:Ae.secondaryAction,children:z})]}),nr=Ue?zn:yn,Pt={onClick:U,className:en()(ge,Ae.root,Ue?Ae.open:Ae.closed,Vs(e)&&Ae.buttonItem,{[Ae.highlightable]:!A})},ln=(0,p.z$)(),{pathname:cn}=(0,pr.WU)(!Vs(e)&&e.to?e.to:""),dr=(0,f.useCallback)(fr=>{if(!Y){const gr="click",mr=d!=null?d:"Sidebar Item",ds=cn?{attributes:{to:cn}}:void 0;ln.captureEvent(gr,mr,ds)}U==null||U(fr)},[ln,d,cn,Y,U]);return Vs(e)?(0,n.jsx)(ye.Z,{role:"button","aria-label":d,...Pt,ref:o,onClick:dr,children:nr}):(0,n.jsx)(Sa,{...Pt,activeClassName:Ae.selected,to:e.to?e.to:"",ref:o,"aria-label":d||e.to,...pe,onClick:dr,children:nr})}),Ca=({children:e,...o})=>{const{sidebarConfig:l}=(0,f.useContext)(Qn),d=ss(l),[m,y]=(0,f.useState)(!1),A=(0,pr.TH)(),U=xa(e,A),Y=(0,Ne.Z)(Pe=>Pe.breakpoints.down("sm")),z=()=>{y(!0)},ge=()=>{y(!1)},pe=()=>Y?m?(0,n.jsx)(Ri.Z,{fontSize:"small",className:d.submenuArrow}):(0,n.jsx)(Ti.Z,{fontSize:"small",className:d.submenuArrow}):!m&&(0,n.jsx)(oo.Z,{fontSize:"small",className:d.submenuArrow});return(0,n.jsx)(Rs.Provider,{value:{isHoveredOn:m,setIsHoveredOn:y},children:(0,n.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:ge,onTouchStart:m?ge:z,onMouseEnter:z,className:en()(m&&d.highlighted),children:[(0,n.jsx)(Ii,{hasSubmenu:!0,className:U?d.selected:"",...o,children:pe()}),m&&e]})})},Pi=(0,f.forwardRef)((e,o)=>{const[l]=(0,p.vJ)(e.children,d=>d.getElements().filter(m=>m.type===ba));return l?(0,n.jsx)(Ca,{...e,children:l}):(0,n.jsx)(Ii,{...e,ref:o})});function Wa(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),[l,d]=useState(""),m=ss(o),y=e.icon?e.icon:SearchIcon,A=()=>{e.onSearch(l),d("")},U=pe=>{pe.key==="Enter"&&(pe.preventDefault(),A())},Y=pe=>{d(pe.target.value)},z=pe=>{pe.preventDefault(),pe.stopPropagation()},ge=pe=>{A(),pe.preventDefault()};return _jsx(Box,{className:m.searchRoot,children:_jsx(Pi,{icon:y,to:e.to,onClick:ge,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:l,onClick:z,onChange:Y,onKeyDown:U,className:m.searchContainer,InputProps:{disableUnderline:!0,className:m.searchField},inputProps:{className:m.searchFieldHTMLInput}})})})}const Va=(0,ro.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),Ha=(0,ro.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),Hs=(0,ro.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),Li=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.secondary,borderRadius:"5px"}}),wa=(0,ro.Z)("div")(({theme:e})=>{const o=Li(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":o,"&:hover":o}}),ja=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),o=ss(e),{isOpen:l,setOpen:d}=useSidebarOpenState();if(useMediaQuery(A=>A.breakpoints.down("md"),{noSsr:!0}))return null;const y=()=>{d(!l)};return _jsx(Button,{role:"button",onClick:y,className:o.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:o.arrows,children:l?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},Oi=(0,g.Z)(e=>({introCard:o=>({color:"#b5b5b5",fontSize:12,width:o.sidebarConfig.drawerWidthOpen,marginTop:e.spacing(2.25),marginBottom:e.spacing(1.5),paddingLeft:o.sidebarConfig.iconPadding,paddingRight:o.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:e.spacing(1.5)},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:e.spacing(.5),"&:hover":{color:e.palette.linkHover,transition:e.transitions.create("color",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:e.spacing(1.5)}}),{name:"BackstageSidebarIntro"});function ki(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),l=Oi({sidebarConfig:o}),{text:d,onClose:m}=e,y=()=>m();return _jsxs(Box,{className:l.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:d}),_jsx(Box,{className:l.introDismiss,children:_jsxs(IconButton,{onClick:y,className:l.introDismissLink,children:[_jsx(CloseIcon,{className:l.introDismissIcon}),_jsx(Typography,{component:"span",className:l.introDismissText,children:"Dismiss"})]})})]})}const Gs=e=>{const{text:o,onDismiss:l}=e,[d,m]=useState(!1),y=()=>{m(!0)};return _jsx(Collapse,{in:!d,onExited:l,children:_jsx(ki,{text:o,onClose:y})})},Bi=null,$i="And your recently viewed plugins will pop up here!";function Ea(e){const{isOpen:o}=useSidebarOpenState(),l={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:d,set:m}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:y,recentlyViewedItemsDismissed:A}=d!=null?d:{},U=()=>{m(z=>({...l,...z,starredItemsDismissed:!0}))},Y=()=>{m(z=>({...l,...z,recentlyViewedItemsDismissed:!0}))};return o?_jsxs(_Fragment,{children:[!y&&_jsxs(_Fragment,{children:[_jsx(Gs,{text:Bi,onDismiss:U}),_jsx(SidebarDivider,{})]}),!A&&_jsx(Gs,{text:$i,onDismiss:Y})]}):null}const Aa=(0,g.Z)(e=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:e.spacing(3),paddingBottom:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function Ks(e){const{className:o,stretch:l,noPadding:d,children:m,...y}=e,{contentRef:A}=Us(),U=Aa();return(0,n.jsx)("article",{ref:A,tabIndex:-1,...y,className:en()(U.root,o,{[U.stretch]:l,[U.noPadding]:d}),children:m})}var Di=r(6487),Ta=r(99152);const Ni=(0,g.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{...e.typography.caption,padding:e.spacing(3,3),textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,color:e.palette.text.secondary},selected:{color:e.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:e.palette.background.default,color:e.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function Ys(e){const{tabs:o,onChange:l,selectedIndex:d}=e,[m,y]=(0,f.useState)(d!=null?d:0),A=Ni(),U=(0,f.useCallback)((Y,z)=>{d===void 0&&y(z),l&&d!==z&&l(z)},[d,l]);return(0,f.useEffect)(()=>{d!==void 0&&y(d)},[d]),(0,n.jsx)(E.Z,{className:A.tabsWrapper,children:(0,n.jsx)(Ta.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:U,value:m,children:o.map((Y,z)=>(0,f.createElement)(Di.Z,{...Y.tabProps,"data-testid":`header-tab-${z}`,label:Y.label,key:Y.id,value:z,className:A.defaultTab,classes:{selected:A.selected,root:A.tabRoot}}))})})}function Fi(e){const o=(0,pr.UO)(),d=e.map(({path:Pe,children:Ae})=>({caseSensitive:!1,path:`${Pe}/*`,element:Ae})).sort((Pe,Ae)=>Ae.path.replace(/\/\*$/,"").localeCompare(Pe.path.replace(/\/\*$/,"")));var m;const y=(m=(0,pr.V$)(d))!==null&&m!==void 0?m:e[0].children;var A;let U=(A=o["*"])!==null&&A!==void 0?A:"";U.startsWith("/")||(U=`/${U}`);var Y;const[z]=(Y=(0,Tr.fp)(d,U))!==null&&Y!==void 0?Y:[],ge=z?e.findIndex(Pe=>`${Pe.path}/*`===z.route.path):0;var pe;return{index:ge===-1?0:ge,element:y,route:(pe=e[ge])!==null&&pe!==void 0?pe:e[0]}}function Js(e){const{routes:o}=e,l=(0,pr.s0)(),{index:d,route:m,element:y}=Fi(o),A=(0,f.useMemo)(()=>o.map(Y=>({id:Y.path,label:Y.title,tabProps:Y.tabProps})),[o]),U=Y=>{let{path:z}=o[Y];z=z.replace(/\/\*$/,""),z=z.replace(/^\//,""),l(z)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ys,{tabs:A,selectedIndex:d,onChange:U}),(0,n.jsxs)(Ks,{children:[(0,n.jsx)(es.q,{title:m.title}),y]})]})}const is=()=>null;(0,p.R5)(is,"core.gatherMountPoints",!0);function Qs(e){const o=(0,n.jsx)(is,{path:"",title:"",children:(0,n.jsx)("div",{})}).type;return f.Children.toArray(e).flatMap(l=>{if(!(0,f.isValidElement)(l))return[];if(l.type===f.Fragment)return Qs(l.props.children);if(l.type!==o)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:m,children:y,tabProps:A}=l.props;return[{path:d,title:m,children:y,tabProps:A}]})}function Zi(e){const o=Qs(e.children);return(0,n.jsx)(Js,{routes:o})}Zi.Route=is;const cr=(0,g.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function Ui(e){const{value:o,subvalue:l}=e,d=cr();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(E.Z,{className:d.value,children:o}),(0,n.jsx)(E.Z,{className:d.subvalue,children:l})]})}var Io=r(67222),Mi=r(21070),Xs=r(90324),zi=r(98281),Wi=r(48049),_s=r(51209),ei=r(33375),Ra=r(44233),Vi=r(27604),i=r(36444),t=r(37971),s=r(59709),a=r(17373),h=r(3702),C=r(93111);const O=(0,g.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:e.spacing(7.5),justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),F=e=>{var o;const l=O(),{onChangeFilters:d}=e,[m,y]=(0,f.useState)({...e.selectedFilters}),[A,U]=(0,f.useState)(!1),Y=()=>{y({}),U(z=>!z)};return(0,f.useEffect)(()=>{d(m)},[m,d]),(0,n.jsxs)(E.Z,{className:l.root,children:[(0,n.jsxs)(E.Z,{className:l.header,children:[(0,n.jsx)(E.Z,{className:l.value,children:"Filters"}),(0,n.jsx)(ye.Z,{color:"primary",onClick:Y,children:"Clear all"})]}),(0,n.jsx)(E.Z,{className:l.filters,children:((o=e.filters)===null||o===void 0?void 0:o.length)&&e.filters.map(z=>(0,n.jsx)(Yo,{triggerReset:A,...z.element,selected:m[z.element.label],onChange:ge=>y({...m,[z.element.label]:ge})},z.element.label))})]})},oe={Add:(0,f.forwardRef)((e,o)=>(0,n.jsx)(Mi.Z,{...e,ref:o})),Check:(0,f.forwardRef)((e,o)=>(0,n.jsx)(zi.Z,{...e,ref:o})),Clear:(0,f.forwardRef)((e,o)=>(0,n.jsx)(ei.Z,{...e,ref:o})),Delete:(0,f.forwardRef)((e,o)=>(0,n.jsx)(Ra.Z,{...e,ref:o})),DetailPanel:(0,f.forwardRef)((e,o)=>(0,n.jsx)(_s.Z,{...e,ref:o})),Edit:(0,f.forwardRef)((e,o)=>(0,n.jsx)(Vi.Z,{...e,ref:o})),Export:(0,f.forwardRef)((e,o)=>(0,n.jsx)(h.Z,{...e,ref:o})),Filter:(0,f.forwardRef)((e,o)=>(0,n.jsx)(i.Z,{...e,ref:o})),FirstPage:(0,f.forwardRef)((e,o)=>(0,n.jsx)(t.Z,{...e,ref:o})),LastPage:(0,f.forwardRef)((e,o)=>(0,n.jsx)(s.Z,{...e,ref:o})),NextPage:(0,f.forwardRef)((e,o)=>(0,n.jsx)(_s.Z,{...e,ref:o})),PreviousPage:(0,f.forwardRef)((e,o)=>(0,n.jsx)(Wi.Z,{...e,ref:o})),ResetSearch:(0,f.forwardRef)((e,o)=>(0,n.jsx)(ei.Z,{...e,ref:o})),Search:(0,f.forwardRef)((e,o)=>(0,n.jsx)(i.Z,{...e,ref:o})),SortArrow:(0,f.forwardRef)((e,o)=>(0,n.jsx)(Xs.Z,{...e,ref:o})),ThirdStateCheck:(0,f.forwardRef)((e,o)=>(0,n.jsx)(a.Z,{...e,ref:o})),ViewColumn:(0,f.forwardRef)((e,o)=>(0,n.jsx)(C.Z,{...e,ref:o}))};function be(e,o){const l=o.split(".");let d=e[l[0]];for(let m=1;m<l.length;++m){if(d===void 0)return d;const y=l[m];d=d[y]}return d}const Ie=(0,On.Z)(e=>({header:{padding:e.spacing(1,2,1,2.5),borderTop:`1px solid ${e.palette.grey.A100}`,borderBottom:`1px solid ${e.palette.grey.A100}`,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(Io.W$),He=(0,On.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:e.typography.fontWeightBold}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(Io.UW),ct=(0,g.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),xt=(0,g.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function wt(e,o){return e.map(l=>{var d;const m=(d=l.headerStyle)!==null&&d!==void 0?d:{};let y=l.cellStyle||{};if(l.highlight)if(m.color=o.palette.textContrast,typeof y=="object")y.fontWeight=o.typography.fontWeightBold;else{const A=y;y=(U,Y,z)=>({...A(U,Y,z),fontWeight:o.typography.fontWeightBold})}return{...l,headerStyle:m,cellStyle:y}})}function Ht(e,o){return(0,_r.transform)(e,(l,d,m)=>{(0,_r.isEqual)(d,o[m])||(l[m]=d)})}const Wt={search:"",filtersOpen:!1,filters:{}};function Mn(e){const{toolbarRef:o,setSearch:l,hasFilters:d,selectedFiltersLength:m,toggleFilters:y}=e,A=ct(),U=(0,f.useCallback)(Y=>{e.onSearchChanged(Y),l(Y)},[e,l]);return d?(0,n.jsxs)(E.Z,{className:A.root,children:[(0,n.jsxs)(E.Z,{className:A.root,children:[(0,n.jsx)(N.Z,{onClick:y,"aria-label":"filter list",children:(0,n.jsx)(i.Z,{})}),(0,n.jsxs)(nt.Z,{className:A.title,children:["Filters (",m,")"]})]}),(0,n.jsx)(He,{...e,ref:o,onSearchChanged:U})]}):(0,n.jsx)(He,{...e,ref:o,onSearchChanged:U})}function tr(e){const{data:o,columns:l,options:d,title:m,subtitle:y,filters:A,initialState:U,emptyContent:Y,onStateChange:z,components:ge,...pe}=e,Pe=xt(),Ae=(0,ie.Z)(),Ue={...Wt,...U},[Ke,Vt]=(0,f.useState)(Ue.filtersOpen),yn=(0,f.useCallback)(()=>Vt(Wn=>!Wn),[Vt]),[zn,nr]=(0,f.useState)(0),[Pt,ln]=(0,f.useState)(o),[cn,dr]=(0,f.useState)(Ue.filters),fr=wt(l,Ae),[gr,mr]=(0,f.useState)(Ue.search);(0,f.useEffect)(()=>{if(z){const Wn=Ht({search:gr,filtersOpen:Ke,filters:cn},Wt);z(Wn)}},[gr,Ke,cn,z]);const ds={headerStyle:{textTransform:"uppercase"}},Vr=(0,f.useCallback)(Wn=>{var Pr;return(Pr=l.find(so=>so.title===Wn))===null||Pr===void 0?void 0:Pr.field},[l]);(0,f.useEffect)(()=>{if(typeof o=="function")return;if(!cn){ln(o);return}const Wn=Object.values(cn);if(o&&Wn.flat().length){const Pr=o.filter(so=>!!Object.entries(cn).filter(([,io])=>!!io.length).every(([io,Cn])=>{const In=be(so,Vr(io));return Array.isArray(In)&&Array.isArray(Cn)?In.some(ko=>Cn.includes(ko)):Array.isArray(In)?In.includes(Cn):Array.isArray(Cn)?Cn.includes(In):In===Cn}));ln(Pr)}else ln(o);nr(Wn.flat().length)},[o,cn,Vr]);const Xi=(Wn,Pr)=>{const so=Cn=>{const In=new Set,ko=ao=>{ao!=null&&In.add(ao)};return Pr&&Pr.forEach(ao=>{const us=be(ao,Vr(Cn));Array.isArray(us)?us.forEach(ko):ko(us)}),In},io=Cn=>({placeholder:"All results",label:Cn.column,multiple:Cn.type==="multiple-select",items:[...so(Cn.column)].sort().map(In=>({label:In,value:In}))});return Wn.map(Cn=>({type:Cn.type,element:io(Cn)}))},sn=!!(A!=null&&A.length),Oo=(0,f.useCallback)(Wn=>(0,n.jsx)(Mn,{setSearch:mr,hasFilters:sn,selectedFiltersLength:zn,toggleFilters:yn,...Wn}),[yn,sn,zn,mr]),ti=typeof o!="function"&&o.length===0,Hr=l.length,qi=(0,f.useCallback)(Wn=>Y&&ti?(0,n.jsx)("tbody",{children:(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:Hr,children:Y})})}):(0,n.jsx)(Io.os,{...Wn}),[ti,Y,Hr]);return(0,n.jsxs)(E.Z,{className:Pe.root,children:[Ke&&o&&typeof o!="function"&&(A==null?void 0:A.length)&&(0,n.jsx)(F,{filters:Xi(A,o),selectedFilters:cn,onChangeFilters:dr}),(0,n.jsx)(Io.ZP,{components:{Header:Ie,Toolbar:Oo,Body:qi,...ge},options:{...ds,...d},columns:fr,icons:oe,title:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(nt.Z,{variant:"h5",component:"h2",children:m}),y&&(0,n.jsx)(nt.Z,{color:"textSecondary",variant:"body1",children:y})]}),data:typeof o=="function"?o:Pt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...pe})]})}tr.icons=Object.freeze(oe);var Ir=r(44311);function Po(e,o){const l=e[e.length-1];if(l)return l>=.9?o.palette.status.ok:l>=.5?o.palette.status.warning:o.palette.status.error}function Ia(e){const o=useTheme();if(!e.data)return null;var l;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(l=e.color)!==null&&l!==void 0?l:Po(e.data,o)})]})}const Hi=e=>(0,g.Z)(o=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:o.spacing(2),textAlign:e.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:o.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),as=({title:e="Unknown page",className:o})=>(0,n.jsx)(nt.Z,{variant:"h4",component:"h2",className:o,"data-testid":"header-title",children:e});function Gi(e){const{description:o,title:l,titleComponent:d=void 0,children:m,textAlign:y="left"}=e,A=Hi({textAlign:y})(),U=d||(0,n.jsx)(as,{title:l,className:A.title});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(es.q,{title:l}),(0,n.jsxs)(E.Z,{className:A.container,children:[(0,n.jsxs)(E.Z,{className:A.leftItemsBox,children:[U,o&&(0,n.jsx)(nt.Z,{className:A.description,variant:"body2",children:o})]}),(0,n.jsx)(E.Z,{className:A.rightItemsBox,children:m})]})]})}var Wr=r.p+"static/mic-drop.fe3ef4d0..svg";const Ga=(0,g.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),Ka=()=>{const e=Ga();return(0,n.jsx)("img",{src:Wr,className:e.micDrop,alt:"Girl dropping mic from her hands"})},Ya=(0,g.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:e.typography.h3.fontSize}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function Ja(e){const{status:o,statusMessage:l,additionalInfo:d,supportUrl:m}=e,y=Ya(),A=(0,pr.s0)(),U=eo();return(0,n.jsxs)(Ct.Z,{container:!0,spacing:0,className:y.container,children:[(0,n.jsxs)(Ct.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,n.jsxs)(nt.Z,{"data-testid":"error",variant:"body1",className:y.subtitle,children:["ERROR ",o,": ",l]}),(0,n.jsx)(nt.Z,{variant:"body1",className:y.subtitle,children:d}),(0,n.jsx)(nt.Z,{variant:"h2",className:y.title,children:"Looks like someone dropped the mic!"}),(0,n.jsxs)(nt.Z,{variant:"h6",children:[(0,n.jsx)(le.r,{to:"#","data-testid":"go-back-link",onClick:()=>A(-1),children:"Go back"}),"... or please"," ",(0,n.jsx)(le.r,{to:m||U.url,children:"contact support"})," if you think this is a bug."]})]}),(0,n.jsx)(Ka,{})]})}var Qa=r(16173);const Xa=(0,On.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(nt.Z),Ki=(0,On.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(E.Z);function qa(e){const{children:o,...l}=e,[d,m]=f.useState(null),y=f.Children.toArray(o),[A,U,...Y]=y,z=Y.length?Y.pop():y[y.length-1],ge=y.length>3,pe=Ue=>{m(Ue.currentTarget)},Pe=()=>{m(null)},Ae=Boolean(d);return(0,n.jsxs)(f.Fragment,{children:[(0,n.jsxs)(Qa.Z,{"aria-label":"breadcrumb",...l,children:[y.length>1&&(0,n.jsx)(Ki,{clone:!0,children:A}),y.length>2&&(0,n.jsx)(Ki,{clone:!0,children:U}),ge&&(0,n.jsx)(Xa,{onClick:pe,children:"..."}),(0,n.jsx)(E.Z,{style:{fontStyle:"italic"},children:z})]}),(0,n.jsx)(_n.ZP,{open:Ae,anchorEl:d,onClose:Pe,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,n.jsx)(Dt.Z,{children:Y.map((Ue,Ke)=>(0,n.jsx)(Kt.Z,{button:!0,children:(0,n.jsx)(Ki,{clone:!0,children:Ue})},Ke))})})]})}const _a=(0,g.Z)(e=>({header:{gridArea:"pageHeader",padding:e.spacing(3),width:"100%",boxShadow:e.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:e.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[e.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto",alignItems:"center"},title:{color:e.page.fontColor,wordBreak:"break-word",fontSize:e.typography.h3.fontSize,marginBottom:0},subtitle:{color:e.page.fontColor,opacity:.8,display:"inline-block",marginTop:e.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:e.spacing(1),color:e.page.fontColor},breadcrumb:{color:e.page.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-e.spacing(.3),marginBottom:e.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-e.spacing(.3),marginBottom:e.spacing(.3)}}),{name:"BackstageHeader"}),el=({type:e,typeLink:o,classes:l,pageTitle:d})=>e?o?(0,n.jsxs)(qa,{className:l.breadcrumb,children:[(0,n.jsx)(le.r,{to:o,children:e}),(0,n.jsx)(nt.Z,{children:d})]}):(0,n.jsx)(nt.Z,{className:l.type,children:e}):null,tl=({pageTitle:e,classes:o,tooltip:l})=>{const d=(0,n.jsx)(nt.Z,{className:o.title,variant:"h1",children:e});return l?(0,n.jsx)(P.ZP,{title:l,placement:"top-start",children:d}):d},nl=({classes:e,subtitle:o})=>o?typeof o!="string"?(0,n.jsx)(n.Fragment,{children:o}):(0,n.jsx)(nt.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:o}):null;function Pa(e){const{children:o,pageTitleOverride:l,style:d,subtitle:m,title:y,tooltip:A,type:U,typeLink:Y}=e,z=_a(),pe=(0,p.h_)(p.Ds).getOptionalString("app.title")||"Backstage",Pe=l||y,Ae=y||l,Ue=`${Pe} | %s | ${pe}`,Ke=`${Pe} | ${pe}`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(es.q,{titleTemplate:Ue,defaultTitle:Ke}),(0,n.jsxs)("header",{style:d,className:z.header,children:[(0,n.jsxs)(E.Z,{className:z.leftItemsBox,children:[(0,n.jsx)(el,{classes:z,type:U,typeLink:Y,pageTitle:Ae}),(0,n.jsx)(tl,{classes:z,pageTitle:Ae,tooltip:A}),(0,n.jsx)(nl,{classes:z,subtitle:m})]}),(0,n.jsx)(Ct.Z,{container:!0,className:z.rightItemsBox,spacing:4,children:o})]})]})}const rl=({label:e,secondaryLabel:o,icon:l,disabled:d=!1,onClick:m})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:d,button:!0,onClick:y=>{m&&m(y)},children:[l&&_jsx(ListItemIcon,{children:l}),_jsx(ListItemText,{primary:e,secondary:o})]})});function $l(e){const{palette:{common:{white:o}}}=useTheme(),{actionItems:l}=e,[d,m]=React.useState(!1),y=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>m(!0),"data-testid":"header-action-menu",ref:y,style:{color:o,height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:d,anchorEl:y.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>m(!1),children:_jsx(List,{children:l.map((A,U)=>_jsx(rl,{...A},`header-action-menu-${U}`))})})]})}const ol=(0,g.Z)(e=>({root:{textAlign:"left"},label:{color:e.page.fontColor,fontWeight:e.typography.fontWeightBold,letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:(0,Qt.Fq)(e.page.fontColor,.8),fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),sl=({value:e,className:o})=>(0,n.jsx)(nt.Z,{component:typeof e=="string"?"p":"span",className:o,children:e});function il(e){const{label:o,value:l,url:d}=e,m=ol(),y=(0,n.jsx)(sl,{className:m.value,value:l||"<Unknown>"});return(0,n.jsx)(Ct.Z,{item:!0,children:(0,n.jsxs)(nt.Z,{component:"span",className:m.root,children:[(0,n.jsx)(nt.Z,{className:m.label,children:o}),d?(0,n.jsx)(le.r,{to:d,children:y}):y]})})}const al=e=>(0,Gn.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),ll=(0,g.Z)(al,{name:"BackstageItemCardHeader"});function cl(e){const{title:o,subtitle:l,children:d}=e,m=ll(e);return(0,n.jsxs)(E.Z,{className:m.root,children:[l&&(0,n.jsx)(nt.Z,{variant:"subtitle2",component:"h3",children:l}),o&&(0,n.jsx)(nt.Z,{variant:"h6",component:"h4",children:o}),d]})}function Dl(e){const{description:o,tags:l,title:d,type:m,subtitle:y,label:A,onClick:U,href:Y}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:d,subtitle:y||m})}),_jsxs(CardContent,{children:[l!=null&&l.length?_jsx(Box,{children:l.map((z,ge)=>_jsx(Chip,{size:"small",label:z},ge))}):null,o]}),_jsxs(CardActions,{children:[!Y&&_jsx(LinkButton,{to:"#",onClick:U,color:"primary",children:A}),Y&&_jsx(LinkButton,{to:Y,color:"primary",children:A})]})]})}const dl=e=>(0,Gn.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),ul=(0,g.Z)(dl,{name:"BackstageItemCardGrid"});function hl(e){const{children:o,...l}=e,d=ul(l);return(0,n.jsx)(E.Z,{className:d.root,...l,children:o})}var pl=r(41547);const fl=(0,g.Z)(e=>({root:{display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",overflowY:"auto",height:"100vh",[e.breakpoints.down("xs")]:{height:"100%"}}}),{name:"BackstagePage"});function La(e){const{themeId:o,children:l}=e,d=fl();return(0,n.jsx)(pl.Z,{theme:m=>({...m,page:m.getPageTheme({themeId:o})}),children:(0,n.jsx)("main",{className:d.root,children:l})})}function gl(e){const{themeId:o,children:l,...d}=e;return(0,n.jsxs)(La,{themeId:o,children:[(0,n.jsx)(Pa,{...d}),l]})}var Xn=r(30195);const Nl=Xn.z.object({providerInfo:Xn.z.object({}).catchall(Xn.z.unknown()).optional(),profile:Xn.z.object({email:Xn.z.string().optional(),displayName:Xn.z.string().optional(),picture:Xn.z.string().optional()}),backstageIdentity:Xn.z.object({token:Xn.z.string(),identity:Xn.z.object({type:Xn.z.literal("user"),userEntityRef:Xn.z.string(),ownershipEntityRefs:Xn.z.array(Xn.z.string())})})}),Oa={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function ml(e){const o=new Date(Date.now()+Oa.defaultTokenExpiryMillis);if(!e)return o;const[l,d,m]=e.split("."),y=JSON.parse(window.atob(d));return typeof y.exp!="number"?o:new Date(y.exp*1e3-Oa.tokenExpiryMarginMillis)}class Fl{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:o}=this.getSessionSync(),l=o.identity.userEntityRef,d=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(l);if(!d)throw new TypeError(`Invalid user entity reference "${l}"`);return d[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const o=this.state.type==="active"?this.state.session:void 0,l=this.fetchSession().then(d=>(this.state={type:"active",session:d,expiresAt:ml(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:l,previous:o},l}async fetchSession(){const o=await this.options.discoveryApi.getBaseUrl("auth"),l=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,d=new Headers(l);d.set("X-Requested-With","XMLHttpRequest");const m=await fetch(`${o}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:d,credentials:"include"});if(!m.ok)throw await ResponseError.fromResponse(m);return proxiedSessionSchema.parse(await m.json())}constructor(o){_define_property(this,"options",void 0),_define_property(this,"abortController",void 0),_define_property(this,"state",void 0),this.options=o,this.abortController=new AbortController,this.state={type:"empty"}}}const Zl=e=>{const o=useApi(discoveryApiRef),[{status:l,error:d},{execute:m}]=useAsync(async()=>{const y=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:o,headers:e.headers});await y.start(),e.onSignInSuccess(y)});return useMountEffect(m),l==="loading"?_jsx(Progress,{}):d?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},vl=(0,g.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),Yi=({children:e})=>{const o=vl();return(0,n.jsx)(Ct.Z,{component:"li",item:!0,classes:o,children:e})};var ls=r(87612);class Ji{getUserId(){return"guest"}async getIdToken(){}getProfile(){return{email:"guest@example.com",displayName:"Guest"}}async getProfileInfo(){return{email:"guest@example.com",displayName:"Guest"}}async getBackstageIdentity(){const o="user:default/guest";return{type:"user",userEntityRef:o,ownershipEntityRefs:[o]}}async getCredentials(){return{}}async signOut(){}}function yl(e){const[o,l,d]=e.split(".");return JSON.parse(window.atob(l))}class Qi{getUserId(){return this.result.userId}static fromResult(o){return new Qi(o)}async getIdToken(){var o,l;return(l=(o=this.result).getIdToken)===null||l===void 0?void 0:l.call(o)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const o=await this.getIdToken();if(!o){const m=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:m,ownershipEntityRefs:[m]}}const{sub:l,ent:d}=yl(o);return{type:"user",userEntityRef:l,ownershipEntityRefs:d!=null?d:[]}}async getCredentials(){var o,l;return{token:await((l=(o=this.result).getIdToken)===null||l===void 0?void 0:l.call(o))}}async signOut(){var o,l;return(l=(o=this.result).signOut)===null||l===void 0?void 0:l.call(o)}constructor(o){(0,ls._)(this,"result",void 0),this.result=o}}class cs{static createGuest(){return new Ji}static fromLegacy(o){return Qi.fromResult(o)}static create(o){return new cs(o.identity,o.authApi,o.profile)}getUserId(){const o=this.identity.userEntityRef,l=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(o);if(!l)throw new TypeError(`Invalid user entity reference "${o}"`);return l[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(o){throw this.profilePromise=void 0,o}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(o,l,d){(0,ls._)(this,"identity",void 0),(0,ls._)(this,"authApi",void 0),(0,ls._)(this,"profile",void 0),(0,ls._)(this,"profilePromise",void 0),this.identity=o,this.authApi=l,this.profile=d}}const xl={Component:({config:e,onSignInStarted:o,onSignInSuccess:l,onSignInFailure:d})=>{const{apiRef:m,title:y,message:A}=e,U=(0,p.h_)(m),Y=(0,p.h_)(p.VE),z=async()=>{try{o();const ge=await U.getBackstageIdentity({instantPopup:!0});if(!ge)throw d(),new Error(`The ${y} provider is not configured to support sign-in`);const pe=await U.getProfile();l(cs.create({identity:ge.identity,profile:pe,authApi:U}))}catch(ge){d(),Y.post(new co.SP("Login failed",ge))}};return(0,n.jsx)(Yi,{children:(0,n.jsx)(jr,{variant:"fullHeight",title:y,actions:(0,n.jsx)(ye.Z,{color:"primary",variant:"outlined",onClick:z,children:"Sign In"}),children:(0,n.jsx)(nt.Z,{variant:"body1",children:A})})})},loader:async(e,o)=>{const l=e.get(o),d=await l.getBackstageIdentity({optional:!0});if(!d)return;const m=await l.getProfile();return cs.create({identity:d.identity,profile:m,authApi:l})}},bl={Component:({onSignInStarted:e,onSignInSuccess:o})=>(0,n.jsx)(Yi,{children:(0,n.jsx)(jr,{title:"Guest",variant:"fullHeight",actions:(0,n.jsx)(ye.Z,{color:"primary",variant:"outlined",onClick:()=>{e(),o(new Ji)},children:"Enter"}),children:(0,n.jsxs)(nt.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 Ji};var Sl=r(63955),ka=r(86619),Ba=r(74828),Cl=r(45455),wl=r.n(Cl);const jl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,El=(0,g.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),$a=e=>{const{ref:o,...l}=e;return{inputRef:o,...l}},Al={Component:({onSignInStarted:e,onSignInSuccess:o})=>{const l=El(),{register:d,handleSubmit:m,formState:y}=(0,Sl.cI)({mode:"onChange"}),{errors:A}=y,U=({userId:Y,idToken:z})=>{e(),o(cs.fromLegacy({userId:Y,getIdToken:z!==void 0?async()=>z:void 0,profile:{email:`${Y}@example.com`}}))};return(0,n.jsx)(Yi,{children:(0,n.jsxs)(jr,{title:"Custom User",variant:"fullHeight",children:[(0,n.jsxs)(nt.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:l.form,onSubmit:m(U),children:[(0,n.jsxs)(vo.Z,{children:[(0,n.jsx)(ka.Z,{...$a(d("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(A.userId)}),A.userId&&(0,n.jsx)(Ba.Z,{error:!0,children:A.userId.message})]}),(0,n.jsxs)(vo.Z,{children:[(0,n.jsx)(ka.Z,{...$a(d("idToken",{required:!1,validate:Y=>!Y||jl.test(Y)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(A.idToken)}),A.idToken&&(0,n.jsx)(Ba.Z,{error:!0,children:A.idToken.message})]}),(0,n.jsx)(ye.Z,{type:"submit",color:"primary",variant:"outlined",className:l.button,disabled:!(y!=null&&y.isDirty)||!wl()(A),children:"Continue"})]})]})})},loader:async()=>{}},Lo="@backstage/core:SignInPage:provider",Da={guest:bl,custom:Al,common:xl};function Na(e,o){if(e in o)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function Gl(e){return e.reduce((l,d)=>{if(typeof d=="string")return Na(d,l),l[d]={components:Da[d],id:d},l;const{id:m}=d;return Na(m,l),l[m]={components:Da.common,id:m,config:d},l},{})}const Kl=(e,o)=>{const l=useApi(errorApiRef),d=useApiHolder(),[m,y]=useState(!0),A=useCallback(Y=>{o(IdentityApiSignOutProxy.from({identityApi:Y,signOut:async()=>{var z;localStorage.removeItem(Lo),await((z=Y.signOut)===null||z===void 0?void 0:z.call(Y))}}))},[o]);useLayoutEffect(()=>{var Y;if(!m)return;const z=localStorage.getItem(Lo);if(z===null){y(!1);return}const ge=e[z];if(!ge){y(!1);return}let pe=!1;return ge.components.loader(d,(Y=ge.config)===null||Y===void 0?void 0:Y.apiRef).then(Pe=>{if(pe){localStorage.removeItem(Lo);return}Pe?A(Pe):y(!1)}).catch(Pe=>{localStorage.removeItem(Lo),!pe&&(l.post(Pe),y(!1))}),()=>{pe=!0}},[m,l,o,d,e,A]);const U=useMemo(()=>Object.keys(e).map(Y=>{const z=e[Y],{Component:ge}=z.components,pe=Ue=>{A(Ue)},Pe=()=>{var Ue;localStorage.setItem(Lo,(z==null||(Ue=z.config)===null||Ue===void 0?void 0:Ue.id)||z.id)},Ae=()=>{localStorage.removeItem(Lo)};return _jsx(ge,{config:z.config,onSignInStarted:Pe,onSignInSuccess:pe,onSignInFailure:Ae},z.id)}),[e,A]);return[m,U]},Tl=({onSignInSuccess:e,providers:o=[],title:l,align:d="left"})=>{const m=useApi(configApiRef),y=useStyles(),A=getSignInProviders(o),[U,Y]=useSignInProviders(A,e);return U?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:m.getString("app.title")}),_jsxs(Content,{children:[l&&_jsx(ContentHeader,{title:l,textAlign:d}),_jsx(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:y,children:Y})]})]})},Rl=({provider:e,auto:o,onSignInSuccess:l})=>{const d=useStyles(),m=useApi(e.apiRef),y=useApi(configApiRef),[A,U]=useState(),[Y,z]=useState(!1),ge=async({checkExisting:pe,showPopup:Pe})=>{try{let Ae;if(pe&&(Ae=await m.getBackstageIdentity({optional:!0})),!Ae&&(Pe||o)&&(z(!0),Ae=await m.getBackstageIdentity({instantPopup:!0}),!Ae))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Ae){z(!0);return}const Ue=await m.getProfile();l(UserIdentity.create({identity:Ae.identity,authApi:m,profile:Ue}))}catch(Ae){U(Ae),z(!0)}};return useMountEffect(()=>ge({checkExisting:!0})),Y?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:y.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:d,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{ge({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),A&&A.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:A.message})]})})})})]}):_jsx(Progress,{})};function Yl(e){return"provider"in e?_jsx(Rl,{...e}):_jsx(Tl,{...e})}const Il=(0,g.Z)(e=>({root:{padding:e.spacing(0,2,0,2.5),minHeight:e.spacing(3)},indicator:{backgroundColor:e.palette.info.main,height:e.spacing(.3)}}),{name:"BackstageTabbedCard"}),Pl=(0,On.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(Jr.Z);function Jl(e){const{slackChannel:o,errorBoundaryProps:l,children:d,title:m,deepLink:y,value:A,onChange:U}=e,Y=Il(),[z,ge]=useState(0),pe=U||((Ue,Ke)=>ge(Ke));let Pe;A?React.Children.map(d,Ue=>{if(React.isValidElement(Ue)&&(Ue==null?void 0:Ue.props.value)===A){var Ke;Pe=Ue==null||(Ke=Ue.props)===null||Ke===void 0?void 0:Ke.children}}):React.Children.map(d,(Ue,Ke)=>{React.isValidElement(Ue)&&Ke===z&&(Pe=Ue==null?void 0:Ue.props.children)});const Ae=l||(o?{slackChannel:o}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Ae,children:[m&&_jsx(Pl,{title:m}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:Y,value:A||z,onChange:pe,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:Pe}),y&&_jsx(BottomLink,{...y})]})})}const Ll=(0,g.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:e.typography.fontWeightBold}}),{name:"BackstageCardTab"});function Ql(e){const{children:o,...l}=e,d=Ll();return _jsx(Tab,{disableRipple:!0,classes:d,...l})}},60871:function(vt,ke,r){"use strict";r.d(ke,{fC:function(){return g},CL:function(){return lt},sM:function(){return ie},$v:function(){return Ne},v_:function(){return Z},hg:function(){return Xe},uB:function(){return Te},R5:function(){return Ee},bq:function(){return k},Km:function(){return te},Ds:function(){return rt},ni:function(){return E},T0:function(){return I},CO:function(){return nt},x8:function(){return jn},rx:function(){return Nn},YO:function(){return Tn},P4:function(){return Ct},NT:function(){return Gt},NW:function(){return Et},VE:function(){return Lt},W0:function(){return Ft},gP:function(){return Zt},IY:function(){return at},F4:function(){return re},ux:function(){return N},Kp:function(){return ne},$4:function(){return et},p_:function(){return P},ZM:function(){return pt},D:function(){return D},gW:function(){return T},E6:function(){return ft},z$:function(){return qt},h_:function(){return ye},I_:function(){return $},qD:function(){return de},vJ:function(){return Dn},tg:function(){return bn},Oi:function(){return $n}});var n=r(52322),p=r(51837),G=r(2784);const f=(0,p.CT)("analytics-context"),V=()=>{const Se=(0,G.useContext)(f);if(Se===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const ae=Se.atVersion(1);if(ae===void 0)throw new Error("No context found for version 1.");return ae},g=Se=>{const{attributes:ae,children:Le}=Se,Ge={...V(),...ae},se=(0,p.EI)({1:Ge});return(0,n.jsx)(f.Provider,{value:se,children:Le})};function u(Se,ae){const Le=Me=>_jsx(g,{attributes:ae,children:_jsx(Se,{...Me})});return Le.displayName=`WithAnalyticsContext(${Se.displayName||Se.name||"Component"})`,Le}function $(){const Se=(0,p.Vt)("api-context");if(!Se)throw new Error("API context is not available");const ae=Se.atVersion(1);if(!ae)throw new Error("ApiContext v1 not available");return ae}function ye(Se){const Le=$().get(Se);if(!Le)throw new Error(`No implementation available for ${Se}`);return Le}function le(Se){return function(Le){const Me=se=>{const M=$(),me={};for(const Be in Se)if(Se.hasOwnProperty(Be)){const Ye=Se[Be],Je=M.get(Ye);if(!Je)throw new Error(`No implementation available for ${Ye}`);me[Be]=Je}return _jsx(Le,{...se,...me})},Ge=Le.displayName||Le.name||"Component";return Me.displayName=`withApis(${Ge})`,Me}}var H=r(87612);class ee{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(ae){if((0,H._)(this,"config",void 0),this.config=ae,!ae.id.split(".").flatMap(Me=>Me.split("-")).every(Me=>Me.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${ae.id}'`)}}function I(Se){return new ee(Se)}function E(Se,ae){return"id"in Se?{api:Se,deps:{},factory:()=>ae}:Se}var ie;(function(Se){Se.SignedIn="SignedIn",Se.SignedOut="SignedOut"})(ie||(ie={}));const ne=I({id:"core.auth.google"}),re=I({id:"core.auth.github"}),D=I({id:"core.auth.okta"}),N=I({id:"core.auth.gitlab"}),P=I({id:"core.auth.microsoft"}),T=I({id:"core.auth.onelogin"}),k=I({id:"core.auth.bitbucket"}),te=I({id:"core.auth.bitbucket-server"}),Te=I({id:"core.auth.atlassian"}),Ne=I({id:"core.alert"}),Z=I({id:"core.analytics"}),Xe=I({id:"core.apptheme"}),rt=I({id:"core.config"}),Et=I({id:"core.discovery"}),Lt=I({id:"core.error"});var lt;(function(Se){Se[Se.None=0]="None",Se[Se.Active=1]="Active"})(lt||(lt={}));const Ft=I({id:"core.featureflags"}),Zt=I({id:"core.fetch"}),et=I({id:"core.identity"}),pt=I({id:"core.oauthrequest"}),ft=I({id:"core.storage"});class jt{setContext(ae){this.context=ae}captureEvent(ae,Le,{value:Me,attributes:Ge}={}){try{this.analyticsApi.captureEvent({action:ae,subject:Le,value:Me,attributes:Ge,context:this.context})}catch(se){console.warn("Error during analytics event capture. %o",se)}}constructor(ae,Le={routeRef:"unknown",pluginId:"root",extension:"App"}){(0,H._)(this,"analyticsApi",void 0),(0,H._)(this,"context",void 0),this.analyticsApi=ae,this.context=Le}}function kt(){try{return ye(Z)}catch{return{captureEvent:()=>{}}}}function qt(){const Se=(0,G.useRef)(null),ae=V(),Le=kt();function Me(){return Se.current===null&&(Se.current=new jt(Le)),Se.current}const Ge=Me();return Ge.setContext(ae),Ge}const de=()=>{const Se=(0,p.Vt)("app-context");if(!Se)throw new Error("App context is not available");const ae=Se.atVersion(1);if(!ae)throw new Error("AppContext v1 not available");return ae},ve=(0,p.uW)("component-data-store",()=>new WeakMap),ze="__backstage_data";function Ee(Se,ae,Le){const Me=Se;var Ge;let se=(Ge=Me[ze])!==null&&Ge!==void 0?Ge:ve.get(Se);if(se||(se={map:new Map},Object.defineProperty(Me,ze,{enumerable:!1,configurable:!0,writable:!1,value:se}),ve.set(Se,se)),se.map.has(ae)){const M=Se.displayName||Se.name;throw new Error(`Attempted to attach duplicate data "${ae}" to component "${M}"`)}se.map.set(ae,Le)}function at(Se,ae){if(!Se)return;const Le=Se.type;if(!Le)return;var Me;const Ge=(Me=Le[ze])!==null&&Me!==void 0?Me:ve.get(Le);if(Ge)return Ge.map.get(ae)}const bt=(0,p.uW)("route-ref-type",()=>Symbol("route-ref-type"));let dt=bt,Bt=dt;class St{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(ae,Le){(0,H._)(this,"id",void 0),(0,H._)(this,"params",void 0),(0,H._)(this,Bt,void 0),this.id=ae,this.params=Le,this[dt]="absolute"}}function Gt(Se){var ae;return new St(Se.id,(ae=Se.params)!==null&&ae!==void 0?ae:[])}const $t=/^\w+$/;let pn=null,an=null;class dn{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(ae,Le,Me,Ge){_define_property(this,"id",void 0),_define_property(this,"path",void 0),_define_property(this,"parent",void 0),_define_property(this,"params",void 0),_define_property(this,an,void 0),this.id=ae,this.path=Le,this.parent=Me,this.params=Ge,this[pn]="sub"}}function _t(Se){const{id:ae,path:Le,parent:Me}=Se,Ge=Le.split("/").filter(me=>me.startsWith(":")).map(me=>me.substring(1)),se=[...Me.params,...Ge];if(Me.params.some(me=>Ge.includes(me)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Le.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Le}'`);if(Le.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Le}'`);for(const me of Ge)if(!$t.test(me))throw new Error(`SubRouteRef path has invalid param, got '${me}'`);return new dn(ae,Le,Me,se)}let fn=bt,Yt=fn;class nn{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(ae,Le,Me){(0,H._)(this,"id",void 0),(0,H._)(this,"params",void 0),(0,H._)(this,"optional",void 0),(0,H._)(this,Yt,void 0),this.id=ae,this.params=Le,this.optional=Me,this[fn]="external"}}function jn(Se){var ae;return new nn(Se.id,(ae=Se.params)!==null&&ae!==void 0?ae:[],Boolean(Se.optional))}var en=r(73557);function bn(Se){const{pathname:ae}=(0,en.TH)(),Le=(0,p.Vt)("routing-context");if(!Le)throw new Error("Routing context is not available");const Me=Le.atVersion(1),Ge=(0,G.useMemo)(()=>Me&&Me.resolve(Se,{pathname:ae}),[Me,Se,ae]);if(!Le)throw new Error("useRouteRef used outside of routing context");if(!Me)throw new Error("RoutingContext v1 not available");const se="optional"in Se&&Se.optional;if(!Ge&&!se)throw new Error(`No path for ${Se}`);return Ge}function $n(Se){return(0,en.UO)()}class tt extends G.Component{static getDerivedStateFromError(ae){return{error:ae}}render(){const{error:ae}=this.state,{app:Le,plugin:Me}=this.props,{ErrorBoundaryFallback:Ge}=Le.getComponents();return ae?(0,n.jsx)(Ge,{error:ae,resetError:this.handleErrorReset,plugin:Me}):this.props.children}constructor(...ae){super(...ae),(0,H._)(this,"state",{error:void 0}),(0,H._)(this,"handleErrorReset",()=>{this.setState({error:void 0})})}}var rr=r(64355);function Ct(Se){const{component:ae,mountPoint:Le,name:Me}=Se;return Tn({component:{lazy:()=>ae().then(Ge=>{const se=me=>{try{bn(Le)}catch(Be){if(typeof Be=="object"&&Be!==null){const{message:Ye}=Be;if(typeof Ye=="string"&&Ye.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Le} 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 Be}return(0,n.jsx)(Ge,{...me})},M=Me||Ge.displayName||Ge.name||"LazyComponent";return se.displayName=`RoutableExtension(${M})`,se},Ge=>M=>{const me=de(),{BootErrorPage:Be}=me.getComponents();return(0,n.jsx)(Be,{step:"load-chunk",error:Ge})})},data:{"core.mountPoint":Le},name:Me})}function nt(Se){const{component:ae,name:Le}=Se;return Tn({component:ae,name:Le})}function Tn(Se){const{data:ae={},name:Le}=Se;Le||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Me;if("lazy"in Se.component){const se=Se.component.lazy;Me=(0,G.lazy)(()=>se().then(M=>({default:M})))}else Me=Se.component.sync;const Ge=Le||Me.displayName||Me.name||"Component";return{expose(se){const M=me=>{const Be=de(),{Progress:Ye}=Be.getComponents(),Je=ae==null?void 0:ae["core.mountPoint"];return(0,n.jsx)(G.Suspense,{fallback:(0,n.jsx)(Ye,{}),children:(0,n.jsx)(tt,{app:Be,plugin:se,children:(0,n.jsx)(g,{attributes:{pluginId:se.getId(),...Le&&{extension:Le},...Je&&{routeRef:Je.id}},children:(0,n.jsx)(rr.o,{plugin:se,children:(0,n.jsx)(Me,{...me})})})})})};Ee(M,"core.plugin",se),Ee(M,"core.extensionName",Le);for(const[me,Be]of Object.entries(ae))Ee(M,me,Be);return M.displayName=`Extension(${Ge})`,M}}}function Jt(Se,ae,Le,Me){return G.Children.toArray(Se).flatMap(Ge=>{if(!(0,G.isValidElement)(Ge))return[];if(Ge.type===G.Fragment)return Jt(Ge.props.children,ae,Le,Me);if(at(Ge,"core.featureFlagged")){const se=Ge.props;return("with"in se?ae.isActive(se.with):!ae.isActive(se.without))?Jt(Ge.props.children,ae,Le,Me):[]}if(Le===void 0||Le(Ge))return[Ge];if(Me)throw new Error(Me);return Jt(Ge.props.children,ae,Le,Me)})}class Rn{selectByComponentData(ae){const Le=Jt(this.node,this.featureFlagsApi,Me=>at(Me,ae.key)!==void 0,ae.withStrictError);return new Rn(Le,this.featureFlagsApi)}findComponentData(ae){return Jt(this.node,this.featureFlagsApi,Me=>at(Me,ae.key)!==void 0).map(Me=>at(Me,ae.key)).filter(Me=>Me!==void 0)}getElements(){return Jt(this.node,this.featureFlagsApi)}constructor(ae,Le){(0,H._)(this,"node",void 0),(0,H._)(this,"featureFlagsApi",void 0),this.node=ae,this.featureFlagsApi=Le}}function Dn(Se,ae,Le=[]){const Me=ye(Ft),Ge=new Rn(Se,Me);return(0,G.useMemo)(()=>ae(Ge),[Se,...Le])}class Sn{getId(){return this.config.id}getApis(){var ae;return(ae=this.config.apis)!==null&&ae!==void 0?ae:[]}getFeatureFlags(){var ae,Le;return(Le=(ae=this.config.featureFlags)===null||ae===void 0?void 0:ae.slice())!==null&&Le!==void 0?Le:[]}get routes(){var ae;return(ae=this.config.routes)!==null&&ae!==void 0?ae:{}}get externalRoutes(){var ae;return(ae=this.config.externalRoutes)!==null&&ae!==void 0?ae:{}}provide(ae){return ae.expose(this)}__experimentalReconfigure(ae){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(ae))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var ae;return(ae=this.options)!==null&&ae!==void 0?ae:{}}toString(){return`plugin{${this.config.id}}`}constructor(ae){(0,H._)(this,"config",void 0),(0,H._)(this,"options",void 0),this.config=ae,this.options=void 0}}function Nn(Se){return new Sn(Se)}},64355:function(vt,ke,r){"use strict";r.d(ke,{o:function(){return V},y:function(){return g}});var n=r(52322),p=r(51837),G=r(2784);const f="plugin-context",V=u=>{const{children:$,plugin:ye}=u,{Provider:le}=(0,p.CT)(f);return(0,n.jsx)(le,{value:(0,p.EI)({1:{plugin:ye}}),children:$})};function g(){const u=(0,p.Vt)(f);if(!u)throw new Error("Plugin Options context is not available");const $=u.atVersion(1);if(!$)throw new Error("Plugin Options v1 is not available");return $.plugin.getPluginOptions()}},23054:function(vt,ke,r){"use strict";r.d(ke,{SP:function(){return re},dR:function(){return ee},VL:function(){return N},BD:function(){return p}});function n(P){if(typeof P!="object"||P===null||Array.isArray(P))return!1;const T=P;return!(typeof T.name!="string"||T.name===""||typeof T.message!="string")}function p(P){if(typeof P!="object"||P===null||Array.isArray(P))throw new Error(`Encountered invalid error, not an object, got '${P}'`);const T=P;if(typeof T.name!="string"||T.name==="")throw new Error(`Encountered error object without a name, got '${P}'`);if(typeof T.message!="string")throw new Error(`Encountered error object without a message, got '${P}'`)}var G=r(87612),f=r(24852);function V(P,T){const te={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(P)};return T!=null&&T.includeStack||delete te.stack,te}function g(P){const T=(0,f.deserializeError)(P);return P.stack||(T.stack=void 0),T}function u(P){if(n(P)){const T=String(P);return T!=="[object Object]"?T:`${P.name}: ${P.message}`}return`unknown error '${P}'`}class $ extends Error{constructor(T,k){var te;let Te=T;if(k!==void 0){const Ne=u(k);Te?Te+=`; caused by ${Ne}`:Te=`caused by ${Ne}`}super(Te),(0,G._)(this,"cause",void 0),(te=Error.captureStackTrace)===null||te===void 0||te.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=n(k)?k:void 0}}class ye extends null{}class le extends null{}class H extends null{}class ee extends ${}class I extends null{}class E extends null{}class ie extends null{}class ne extends null{}class re extends ${constructor(T,k){super(T,k),this.name=n(k)?k.name:"Error"}}async function D(P){try{const k=await P.text();if(k){var T;if(!((T=P.headers.get("content-type"))===null||T===void 0)&&T.startsWith("application/json"))try{const te=JSON.parse(k);if(te.error&&te.response)return te}catch{}return{error:{name:"Error",message:`Request failed with status ${P.status} ${P.statusText}, ${k}`},response:{statusCode:P.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${P.status} ${P.statusText}`},response:{statusCode:P.status}}}class N extends Error{static async fromResponse(T){const k=await D(T),te=k.response.statusCode||T.status,Te=k.error.name||T.statusText,Ne=`Request failed with ${te} ${Te}`,Z=g(k.error);return new N({message:Ne,response:T,data:k,cause:Z})}constructor(T){super(T.message),(0,G._)(this,"response",void 0),(0,G._)(this,"body",void 0),(0,G._)(this,"cause",void 0),this.name="ResponseError",this.response=T.response,this.body=T.data,this.cause=T.cause}}},32838:function(vt,ke,r){"use strict";r.d(ke,{nW:function(){return ne},ae:function(){return H},q3:function(){return ee}});var n=r(60871);const p=(0,n.T0)({id:"core.scmauth"});var G=new WeakMap;class f{async getCredentials(D){const N=new URL(D.url),P=_class_private_field_get(this,G).find(T=>T.isUrlSupported(N));if(!P)throw new Error(`No auth provider available for '${D.url}', see https://backstage.io/link?scm-auth`);return P.getCredentials(D)}constructor(D){_class_private_field_init(this,G,{writable:!0,value:void 0}),_class_private_field_set(this,G,D)}}var V=new WeakMap,g=new WeakMap,u=new WeakMap,$=new WeakMap;class ye{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:D,gitlab:N,azure:P,bitbucket:T})=>ye.merge(ye.forGithub(D),ye.forGitlab(N),ye.forAzure(P),ye.forBitbucket(T))})}static forAuthApi(D,N){return new ye("generic",D,N.host,N.scopeMapping)}static forGithub(D,N){var P;const T=(P=N==null?void 0:N.host)!==null&&P!==void 0?P:"github.com";return new ye("github",D,T,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(D,N){var P;const T=(P=N==null?void 0:N.host)!==null&&P!==void 0?P:"gitlab.com";return new ye("gitlab",D,T,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(D,N){var P;const T=(P=N==null?void 0:N.host)!==null&&P!==void 0?P:"dev.azure.com";return new ye("azure",D,T,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(D,N){var P;const T=(P=N==null?void 0:N.host)!==null&&P!==void 0?P:"bitbucket.org";return new ye("bitbucket",D,T,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...D){return new f(D)}isUrlSupported(D){return D.host===_class_private_field_get(this,g)}getAdditionalScopesForProvider(D){var N;if(!(D!=null&&D.customScopes)||_class_private_field_get(this,$)==="generic")return[];var P;return(P=(N=D.customScopes)===null||N===void 0?void 0:N[_class_private_field_get(this,$)])!==null&&P!==void 0?P:[]}async getCredentials(D){const{url:N,additionalScope:P,...T}=D,k=_class_private_field_get(this,u).default.slice();P!=null&&P.repoWrite&&k.push(..._class_private_field_get(this,u).repoWrite);const te=this.getAdditionalScopesForProvider(P);te.length&&k.push(...te);const Te=[...new Set(k)],Ne=await _class_private_field_get(this,V).getAccessToken(Te,T);return{token:Ne,headers:{Authorization:`Bearer ${Ne}`}}}constructor(D,N,P,T){_class_private_field_init(this,V,{writable:!0,value:void 0}),_class_private_field_init(this,g,{writable:!0,value:void 0}),_class_private_field_init(this,u,{writable:!0,value:void 0}),_class_private_field_init(this,$,{writable:!0,value:void 0}),_class_private_field_set(this,V,N),_class_private_field_set(this,g,P),_class_private_field_set(this,u,T),_class_private_field_set(this,$,D)}}var le=r(40556);class H{static fromConfig(D){return le.Lx.fromConfig(D)}}const ee=(0,n.T0)({id:"integration.scmintegrations"});var I=r(52322),E=r(73250),ie=r(2784);const ne=re=>{const{type:D}=re,N=(0,n.qD)(),P=E.Z;var T;const k=D&&(T=N.getSystemIcon(D))!==null&&T!==void 0?T:P;return(0,I.jsx)(k,{})}},40556:function(vt,ke,r){"use strict";r.d(ke,{Lx:function(){return xr},BT:function(){return Ut}});var n=r(87612),p=r(82717),G=r.n(p),f=r(76635);function V(S){const c=new URL("http://example.com");return c.host=S,c.host===S}function g(S){try{return new URL(S),!0}catch{return!1}}function u(S,c){return{list(){return S},byUrl(x){try{const w=typeof x=="string"?new URL(x):x;return S.find(J=>c(J)===w.host)}catch{return}},byHost(x){return S.find(w=>c(w)===x)}}}function $(S){const{url:c,base:x,lineNumber:w}=S;try{return new URL(c),c}catch{}let J;if(c.startsWith("/")){const{filepath:fe}=G()(x);J=new URL(x);const we=(0,f.trimEnd)(J.pathname.substring(0,J.pathname.length-fe.length),"/");J.pathname=`${we}${c}`}else J=new URL(c,x);return J.search=new URL(x).search,w&&(J.hash=`L${w}`),J.toString()}function ye(S){beforeAll(()=>S.listen({onUnhandledRequest:"error"})),afterAll(()=>S.close()),afterEach(()=>S.resetHandlers())}const le="amazonaws.com";function H(S){const c=S.getOptionalString("endpoint");var x;const w=(x=S.getOptionalBoolean("s3ForcePathStyle"))!==null&&x!==void 0?x:!1;let J,fe;if(c){try{const xn=new URL(c);J=xn.host,fe=xn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${c}' is not a valid URL`)}if(fe!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${c}'`)}else J=le;const we=S.getOptionalString("accessKeyId"),je=S.getOptionalString("secretAccessKey"),qe=S.getOptionalString("roleArn"),Mt=S.getOptionalString("externalId");return{host:J,endpoint:c,s3ForcePathStyle:w,accessKeyId:we,secretAccessKey:je,roleArn:qe,externalId:Mt}}function ee(S){const c=S.map(H);return c.some(x=>x.host===le)||c.push({host:le}),c}class I{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return $(c)}resolveEditUrl(c){return c}constructor(c){(0,n._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,n._)(I,"factory",({config:S})=>{var c;const x=ee((c=S.getOptionalConfigArray("integrations.awsS3"))!==null&&c!==void 0?c:[]);return u(x.map(w=>new I(w)),w=>w.config.host)});var E=r(88412),ie=r(50629),ne=r(80956);const re="GB";var D=new WeakMap,N=new WeakMap,P=new WeakMap,T=new WeakMap,k=new WeakMap,te=new WeakMap,Te=new WeakMap;class Ne{static fromRepoUrl(c){const x=new URL(c);let w,J,fe;const we=x.pathname.split("/").map(Jn=>decodeURIComponent(Jn));if(we[2]==="_git"?(w=we[1],J=fe=we[3]):we[3]==="_git"?(w=we[1],J=we[2],fe=we[4]):we[4]==="_git"&&(w=`${we[1]}/${we[2]}`,J=we[3],fe=we[5]),!w||!J||!fe)throw new Error("Azure URL must point to a git repository");var je;const qe=(je=x.searchParams.get("path"))!==null&&je!==void 0?je:void 0;let Mt;const xn=x.searchParams.get("version");if(xn){if(xn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Mt=xn.slice(2)}return new Ne(x.origin,w,J,fe,qe,Mt)}toRepoUrl(){let c;return(0,E._)(this,P)===(0,E._)(this,T)?c=(0,E._)(this,Te).call(this,(0,E._)(this,N),"_git",(0,E._)(this,T)):c=(0,E._)(this,Te).call(this,(0,E._)(this,N),(0,E._)(this,P),"_git",(0,E._)(this,T)),(0,E._)(this,k)&&c.searchParams.set("path",(0,E._)(this,k)),(0,E._)(this,te)&&c.searchParams.set("version",re+(0,E._)(this,te)),c.toString()}toFileUrl(){if(!(0,E._)(this,k))throw new Error("Azure URL must point to a specific path to be able to download a file");const c=(0,E._)(this,Te).call(this,(0,E._)(this,N),(0,E._)(this,P),"_apis","git","repositories",(0,E._)(this,T),"items");return c.searchParams.set("api-version","6.0"),c.searchParams.set("path",(0,E._)(this,k)),(0,E._)(this,te)&&c.searchParams.set("version",(0,E._)(this,te)),c.toString()}toArchiveUrl(){const c=(0,E._)(this,Te).call(this,(0,E._)(this,N),(0,E._)(this,P),"_apis","git","repositories",(0,E._)(this,T),"items");return c.searchParams.set("recursionLevel","full"),c.searchParams.set("download","true"),c.searchParams.set("api-version","6.0"),(0,E._)(this,k)&&c.searchParams.set("scopePath",(0,E._)(this,k)),(0,E._)(this,te)&&c.searchParams.set("version",(0,E._)(this,te)),c.toString()}toCommitsUrl(){const c=(0,E._)(this,Te).call(this,(0,E._)(this,N),(0,E._)(this,P),"_apis","git","repositories",(0,E._)(this,T),"commits");return c.searchParams.set("api-version","6.0"),(0,E._)(this,te)&&c.searchParams.set("searchCriteria.itemVersion.version",(0,E._)(this,te)),c.toString()}getOwner(){return(0,E._)(this,N)}getProject(){return(0,E._)(this,P)}getRepo(){return(0,E._)(this,T)}getPath(){return(0,E._)(this,k)}getRef(){return(0,E._)(this,te)}constructor(c,x,w,J,fe,we){(0,ie._)(this,D,{writable:!0,value:void 0}),(0,ie._)(this,N,{writable:!0,value:void 0}),(0,ie._)(this,P,{writable:!0,value:void 0}),(0,ie._)(this,T,{writable:!0,value:void 0}),(0,ie._)(this,k,{writable:!0,value:void 0}),(0,ie._)(this,te,{writable:!0,value:void 0}),(0,ie._)(this,Te,{writable:!0,value:(...je)=>{const qe=new URL((0,E._)(this,D));return qe.pathname=je.map(Mt=>encodeURIComponent(Mt)).join("/"),qe}}),(0,ne._)(this,D,c),(0,ne._)(this,N,x),(0,ne._)(this,P,w),(0,ne._)(this,T,J),(0,ne._)(this,k,fe),(0,ne._)(this,te,we)}}const Z="dev.azure.com",Xe=S=>{const c=S;return Object.keys(S).length===3&&c.clientId!==void 0&&c.clientSecret!==void 0&&c.tenantId!==void 0},rt=S=>Object.keys(S).length===1&&S.clientId!==void 0;function Et(S){var c;const x=(c=S.getOptionalString("host"))!==null&&c!==void 0?c:Z,w=S.getOptionalString("token"),J=S.getOptional("credential")?{tenantId:S.getOptionalString("credential.tenantId"),clientId:S.getOptionalString("credential.clientId"),clientSecret:S.getOptionalString("credential.clientSecret")}:void 0;if(!V(x))throw new Error(`Invalid Azure integration config, '${x}' is not a valid host`);if(J&&!Xe(J)&&!rt(J))throw new Error("Invalid Azure integration config, credential is not valid");if(J&&x!==Z)throw new Error(`Invalid Azure integration config, credential can only be used with ${Z}`);if(J&&w)throw new Error("Invalid Azure integration config, specify either a token or a credential but not both");return{host:x,token:w,credential:J}}function Lt(S){const c=S.map(Et);return c.some(x=>x.host===Z)||c.push({host:Z}),c}class lt{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:x,base:w}=c;if(g(x))return x;try{const fe=Ne.fromRepoUrl(w),we=new URL(w);var J;const je=new URL(`https://a.com${(J=fe.getPath())!==null&&J!==void 0?J:""}`),qe=new URL(x,je).pathname;return we.searchParams.set("path",qe),c.lineNumber&&(we.searchParams.set("line",String(c.lineNumber)),we.searchParams.set("lineEnd",String(c.lineNumber+1)),we.searchParams.set("lineStartColumn","1"),we.searchParams.set("lineEndColumn","1")),we.toString()}catch{return new URL(x,w).toString()}}resolveEditUrl(c){return c}constructor(c){(0,n._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,n._)(lt,"factory",({config:S})=>{var c;const x=Lt((c=S.getOptionalConfigArray("integrations.azure"))!==null&&c!==void 0?c:[]);return u(x.map(w=>new lt(w)),w=>w.config.host)});var Ft=r(48834).lW;function Zt(S){return AzureUrl.fromRepoUrl(S).toFileUrl()}function et(S){return AzureUrl.fromRepoUrl(S).toArchiveUrl()}function pt(S){return AzureUrl.fromRepoUrl(S).toCommitsUrl()}async function ft(S,c){const x="499b84ac-1321-427f-aa17-267ca6975798/.default",w=c?{...c}:{},{token:J,credential:fe}=S;if(fe){if(isServicePrincipal(fe)){const je=await new ClientSecretCredential(fe.tenantId,fe.clientId,fe.clientSecret).getToken(x);w.Authorization=`Bearer ${je.token}`}else if(isManagedIdentity(fe)){const je=await new ManagedIdentityCredential(fe.clientId).getToken(x);w.Authorization=`Bearer ${je.token}`}}else if(J){const we=Ft.from(`:${S.token}`,"utf8");w.Authorization=`Basic ${we.toString("base64")}`}return{headers:w}}const jt="bitbucket.org",kt="https://api.bitbucket.org/2.0";function qt(S){var c;const x=(c=S.getOptionalString("host"))!==null&&c!==void 0?c:jt;let w=S.getOptionalString("apiBaseUrl");const J=S.getOptionalString("token"),fe=S.getOptionalString("username"),we=S.getOptionalString("appPassword");if(!V(x))throw new Error(`Invalid Bitbucket integration config, '${x}' is not a valid host`);return w?w=(0,f.trimEnd)(w,"/"):x===jt?w=kt:w=`https://${x}/rest/api/1.0`,{host:x,apiBaseUrl:w,token:J,username:fe,appPassword:we}}function de(S){const c=S.map(qt);return c.some(x=>x.host===jt)||c.push({host:jt,apiBaseUrl:kt}),c}class ve{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const x=$(c);if(!c.lineNumber)return x;const w=new URL(x);return this.integrationConfig.host==="bitbucket.org"?w.hash=`lines-${c.lineNumber}`:w.hash=`${c.lineNumber}`,w.toString()}resolveEditUrl(c){const x=G()(c),w=new URL(c);return w.searchParams.set("mode","edit"),w.searchParams.set("spa","0"),w.searchParams.set("at",x.ref),w.toString()}constructor(c){(0,n._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,n._)(ve,"factory",({config:S})=>{var c,x,w;const J=de((w=S.getOptionalConfigArray("integrations.bitbucket"))!==null&&w!==void 0?w:[...(c=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[],...(x=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&x!==void 0?x:[]]);return u(J.map(fe=>new ve(fe)),fe=>fe.config.host)});var ze=r(96279),Ee=r(48834).lW;async function at(S,c){const{name:x,owner:w,resource:J}=parseGitUrl(S),fe=J==="bitbucket.org";let we=fe?`${c.apiBaseUrl}/repositories/${w}/${x}`:`${c.apiBaseUrl}/projects/${w}/repos/${x}/default-branch`,je=await fetch(we,Bt(c));if(je.status===404&&!fe&&(we=`${c.apiBaseUrl}/projects/${w}/repos/${x}/branches/default`,je=await fetch(we,Bt(c))),!je.ok){const Mt=`Failed to retrieve default branch from ${we}, ${je.status} ${je.statusText}`;throw new Error(Mt)}let qe;if(fe)qe=(await je.json()).mainbranch.name;else{const{displayId:Mt}=await je.json();qe=Mt}if(!qe)throw new Error(`Failed to read default branch from ${we}. Response ${je.status} ${je.json()}`);return qe}async function bt(S,c){const{name:x,owner:w,ref:J,protocol:fe,resource:we,filepath:je}=parseGitUrl(S),qe=we==="bitbucket.org";let Mt=J;Mt||(Mt=await at(S,c));const xn=je?`&path=${encodeURIComponent(decodeURIComponent(je))}`:"";return qe?`${fe}://${we}/${w}/${x}/get/${Mt}.tar.gz`:`${c.apiBaseUrl}/projects/${w}/repos/${x}/archive?format=tgz&at=${Mt}&prefix=${w}-${x}${xn}`}function dt(S,c){try{const{owner:x,name:w,ref:J,filepathtype:fe,filepath:we}=parseGitUrl(S);if(!x||!w||fe!=="browse"&&fe!=="raw"&&fe!=="src")throw new Error("Invalid Bitbucket URL or file path");const je=we.replace(/^\//,"");if(c.host==="bitbucket.org"){if(!J)throw new Error("Invalid Bitbucket URL or file path");return`${c.apiBaseUrl}/repositories/${x}/${w}/src/${J}/${je}`}return`${c.apiBaseUrl}/projects/${x}/repos/${w}/raw/${je}?at=${J}`}catch(x){throw new Error(`Incorrect URL: ${S}, ${x}`)}}function Bt(S){const c={};if(S.token)c.Authorization=`Bearer ${S.token}`;else if(S.username&&S.appPassword){const x=Ee.from(`${S.username}:${S.appPassword}`,"utf8");c.Authorization=`Basic ${x.toString("base64")}`}return{headers:c}}const St="bitbucket.org",Gt="https://api.bitbucket.org/2.0";function $t(S){const c=St,x=Gt,w=S.getString("username"),J=S.getString("appPassword");return{host:c,apiBaseUrl:x,username:w,appPassword:J}}function pn(S){const c=S.map($t);return c.length===0&&c.push({host:St,apiBaseUrl:Gt}),c}class an{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const x=$(c);if(c.lineNumber){const w=new URL(x);return w.hash=`lines-${c.lineNumber}`,w.toString()}return x}resolveEditUrl(c){const x=G()(c),w=new URL(c);return w.searchParams.set("mode","edit"),w.searchParams.set("at",x.ref),w.toString()}constructor(c){(0,n._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,n._)(an,"factory",({config:S})=>{var c;const x=pn((c=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[]);return u(x.map(w=>new an(w)),w=>w.config.host)});var dn=r(48834).lW;async function _t(S,c){const{name:x,owner:w}=parseGitUrl(S),J=`${c.apiBaseUrl}/repositories/${w}/${x}`,fe=await fetch(J,nn(c));if(!fe.ok){const qe=`Failed to retrieve default branch from ${J}, ${fe.status} ${fe.statusText}`;throw new Error(qe)}const je=(await fe.json()).mainbranch.name;if(!je)throw new Error(`Failed to read default branch from ${J}. Response ${fe.status} ${fe.json()}`);return je}async function fn(S,c){const{name:x,owner:w,ref:J,protocol:fe,resource:we}=parseGitUrl(S);let je=J;return je||(je=await _t(S,c)),`${fe}://${we}/${w}/${x}/get/${je}.tar.gz`}function Yt(S,c){try{const{owner:x,name:w,ref:J,filepathtype:fe,filepath:we}=parseGitUrl(S);if(!x||!w||fe!=="src"&&fe!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const je=we.replace(/^\//,"");if(!J)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${c.apiBaseUrl}/repositories/${x}/${w}/src/${J}/${je}`}catch(x){throw new Error(`Incorrect URL: ${S}, ${x}`)}}function nn(S){const c={};if(S.username&&S.appPassword){const x=dn.from(`${S.username}:${S.appPassword}`,"utf8");c.Authorization=`Basic ${x.toString("base64")}`}return{headers:c}}function jn(S){const c=S.getString("host");let x=S.getOptionalString("apiBaseUrl");const w=S.getOptionalString("token"),J=S.getOptionalString("username"),fe=S.getOptionalString("password");if(!V(c))throw new Error(`Invalid Bitbucket Server integration config, '${c}' is not a valid host`);return x?x=(0,f.trimEnd)(x,"/"):x=`https://${c}/rest/api/1.0`,{host:c,apiBaseUrl:x,token:w,username:J,password:fe}}function en(S){return S.map(jn)}class bn{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const x=$(c);if(c.lineNumber){const w=new URL(x);return w.hash=c.lineNumber.toString(),w.toString()}return x}resolveEditUrl(c){return c.includes("?")?c.substring(0,c.indexOf("?")):c}constructor(c){(0,n._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,n._)(bn,"factory",({config:S})=>{var c;const x=en((c=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&c!==void 0?c:[]);return u(x.map(w=>new bn(w)),w=>w.config.host)});var $n=r(48834).lW;async function tt(S,c){const{name:x,owner:w}=parseGitUrl(S);let J=`${c.apiBaseUrl}/projects/${w}/repos/${x}/default-branch`,fe=await fetch(J,nt(c));if(fe.status===404&&(J=`${c.apiBaseUrl}/projects/${w}/repos/${x}/branches/default`,fe=await fetch(J,nt(c))),!fe.ok){const qe=`Failed to retrieve default branch from ${J}, ${fe.status} ${fe.statusText}`;throw new Error(qe)}const{displayId:we}=await fe.json(),je=we;if(!je)throw new Error(`Failed to read default branch from ${J}. Response ${fe.status} ${fe.json()}`);return je}async function rr(S,c){const{name:x,owner:w,ref:J,filepath:fe}=parseGitUrl(S);let we=J;we||(we=await tt(S,c));const je=fe?`&path=${encodeURIComponent(decodeURIComponent(fe))}`:"";return`${c.apiBaseUrl}/projects/${w}/repos/${x}/archive?format=tgz&at=${we}&prefix=${w}-${x}${je}`}function Ct(S,c){try{const{owner:x,name:w,ref:J,filepathtype:fe,filepath:we}=parseGitUrl(S);if(!x||!w||fe!=="browse"&&fe!=="raw"&&fe!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const je=we.replace(/^\//,"");return`${c.apiBaseUrl}/projects/${x}/repos/${w}/raw/${je}?at=${J}`}catch(x){throw new Error(`Incorrect URL: ${S}, ${x}`)}}function nt(S){const c={};if(S.token)c.Authorization=`Bearer ${S.token}`;else if(S.username&&S.password){const x=$n.from(`${S.username}:${S.password}`,"utf8");c.Authorization=`Basic ${x.toString("base64")}`}return{headers:c}}function Tn(S){const c=S.getString("host");let x=S.getOptionalString("baseUrl"),w=S.getOptionalString("cloneUrl"),J=S.getOptionalString("gitilesBaseUrl");const fe=S.getOptionalString("username"),we=S.getOptionalString("password");if(V(c)){if(x&&!g(x))throw new Error(`Invalid Gerrit integration config, '${x}' is not a valid baseUrl`);if(w&&!g(w))throw new Error(`Invalid Gerrit integration config, '${w}' is not a valid cloneUrl`);if(J&&!g(J))throw new Error(`Invalid Gerrit integration config, '${J}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${c}' is not a valid host`);return x?x=(0,f.trimEnd)(x,"/"):x=`https://${c}`,J?J=(0,f.trimEnd)(J,"/"):J=`https://${c}`,w?w=(0,f.trimEnd)(w,"/"):w=x,{host:c,baseUrl:x,cloneUrl:w,gitilesBaseUrl:J,username:fe,password:we}}function Jt(S){return S.map(Tn)}var Rn=r(48834).lW;const Dn=")]}'";function Sn(S,c){const w=c.replace(S.gitilesBaseUrl,"").split("/").filter(Mt=>!!Mt),J=w.indexOf("+");if(J<=0)throw new Error(`Unable to parse project from url: ${c}`);const fe=(0,f.trimStart)(w.slice(0,J).join("/"),"/"),we=w.indexOf("heads");if(we<=0)throw new Error(`Unable to parse branch from url: ${c}`);const je=w[we+1],qe=w.slice(we+2).join("/");return{branch:je,filePath:qe===""?"/":qe,project:fe}}function Nn(S,c,x,w){return`${S.gitilesBaseUrl}/${c}/+/refs/heads/${x}/${(0,f.trimStart)(w,"/")}`}function Se(S){return S.password?"/a/":"/"}function ae(S,c){const{branch:x,project:w}=Sn(S,c);return`${S.baseUrl}${Se(S)}projects/${encodeURIComponent(w)}/branches/${x}`}function Le(S,c){const{project:x}=Sn(S,c);return`${S.cloneUrl}${Se(S)}${x}`}function Me(S,c){const{branch:x,filePath:w,project:J}=Sn(S,c);return`${S.baseUrl}${Se(S)}projects/${encodeURIComponent(J)}/branches/${x}/files/${encodeURIComponent(w)}/content`}function Ge(S){return`${S.baseUrl}${Se(S)}projects/`}function se(S){const c={};if(!S.password)return c;const x=Rn.from(`${S.username}:${S.password}`,"utf8");return c.Authorization=`Basic ${x.toString("base64")}`,{headers:c}}async function M(S){const c=await S.text();if(c.startsWith(Dn))try{return JSON.parse(c.slice(Dn.length))}catch(x){throw new Error(`Invalid response from Gerrit: ${c.slice(0,10)} - ${x}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${c.slice(0,10)}`)}class me{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:x,base:w,lineNumber:J}=c;let fe;if(x.startsWith("/")){const{branch:we,project:je}=Sn(this.config,w);return Nn(this.config,je,we,x)}return x?fe=new URL(x,w):fe=new URL(w),J&&(fe.hash=J.toString()),fe.toString()}resolveEditUrl(c){return c}constructor(c){(0,n._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,n._)(me,"factory",({config:S})=>{var c;const x=Jt((c=S.getOptionalConfigArray("integrations.gerrit"))!==null&&c!==void 0?c:[]);return u(x.map(w=>new me(w)),w=>w.config.host)});function Be(S){const c=S.getString("host");let x=S.getOptionalString("baseUrl");const w=S.getOptionalString("username"),J=S.getOptionalString("password");if(!V(c))throw new Error(`Invalid Gitea integration config, '${c}' is not a valid host`);return x?x=(0,f.trimEnd)(x,"/"):x=`https://${c}`,{host:c,baseUrl:x,username:w,password:J}}var Ye=r(48834).lW;function Je(S,c){try{var x;const w=(x=S.baseUrl)!==null&&x!==void 0?x:`https://${S.host}`,[J,fe,we,je,qe,Mt,...xn]=c.replace(w,"").split("/"),Jn=xn.join("/").replace(/^\//,"");return`${w}/${fe}/${we}/_edit/${Mt}/${Jn}`}catch(w){throw new Error(`Incorrect URL: ${c}, ${w}`)}}function Dt(S,c){try{var x;const w=(x=S.baseUrl)!==null&&x!==void 0?x:`https://${S.host}`,[J,fe,we,je,qe,Mt,...xn]=c.replace(w,"").split("/"),Jn=xn.join("/").replace(/^\//,"");return`${w}/api/v1/repos/${fe}/${we}/contents/${Jn}?ref=${Mt}`}catch(w){throw new Error(`Incorrect URL: ${c}, ${w}`)}}function Kt(S){const c={},{username:x,password:w}=S;return w?(x?c.Authorization=`basic ${Ye.from(`${x}:${w}`).toString("base64")}`:c.Authorization=`token ${w}`,{headers:c}):c}class tn{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(c){return $(c)}resolveEditUrl(c){return Je(this.config,c)}constructor(c){(0,n._)(this,"config",void 0),this.config=c}}(0,n._)(tn,"factory",({config:S})=>{var c;const w=((c=S.getOptionalConfigArray("integrations.gitea"))!==null&&c!==void 0?c:[]).map(J=>Be(J));return u(w.map(J=>new tn(J)),J=>J.config.host)});const Qt="github.com",gn="https://api.github.com",X="https://raw.githubusercontent.com";function q(S){var c,x;const w=(x=S.getOptionalString("host"))!==null&&x!==void 0?x:Qt;let J=S.getOptionalString("apiBaseUrl"),fe=S.getOptionalString("rawBaseUrl");const we=S.getOptionalString("token"),je=(c=S.getOptionalConfigArray("apps"))===null||c===void 0?void 0:c.map(qe=>({appId:qe.getNumber("appId"),clientId:qe.getString("clientId"),clientSecret:qe.getString("clientSecret"),webhookSecret:qe.getString("webhookSecret"),privateKey:qe.getString("privateKey"),allowedInstallationOwners:qe.getOptionalStringArray("allowedInstallationOwners")}));if(!V(w))throw new Error(`Invalid GitHub integration config, '${w}' is not a valid host`);return J?J=(0,f.trimEnd)(J,"/"):w===Qt&&(J=gn),fe?fe=(0,f.trimEnd)(fe,"/"):w===Qt&&(fe=X),{host:w,apiBaseUrl:J,rawBaseUrl:fe,token:we,apps:je}}function _(S){const c=S.map(q);return c.some(x=>x.host===Qt)||c.push({host:Qt,apiBaseUrl:gn,rawBaseUrl:X}),c}function v(S,c,x){try{const{owner:w,name:J,ref:fe,filepathtype:we,filepath:je}=parseGitUrl(S);if(!w||!J||!fe||we!=="blob"&&we!=="raw"&&we!=="tree")throw new Error("Invalid GitHub URL or file path");const qe=je.replace(/^\//,"");return Q(c,x)==="api"?`${c.apiBaseUrl}/repos/${w}/${J}/contents/${qe}?ref=${fe}`:`${c.rawBaseUrl}/${w}/${J}/${fe}/${qe}`}catch(w){throw new Error(`Incorrect URL: ${S}, ${w}`)}}function L(S,c){const x={};return Q(S,c)==="api"&&(x.Accept="application/vnd.github.v3.raw"),c.token&&(x.Authorization=`token ${c.token}`),{headers:x}}function Q(S,c){return S.apiBaseUrl&&(c.token||!S.rawBaseUrl)?"api":"raw"}var W=r(35355),ue=r(89393),xe=r(26228);class Ve{async getOrCreateToken(c,x,w){let J=this.tokenCache.get(c);if((!J||this.isExpired(J.expiresAt))&&(J=await w(),J.expiresAt=J.expiresAt.minus({minutes:10}),this.tokenCache.set(c,J)),!this.appliesToRepo(J,x))throw new Error(`The Backstage GitHub application used in the ${c} organization does not have access to a repository with the name ${x}`);return{accessToken:J.token}}appliesToRepo(c,x){return x===void 0?!0:c.repositories!==void 0?c.repositories.includes(x):!0}constructor(){(0,n._)(this,"tokenCache",new Map),(0,n._)(this,"isExpired",c=>xe.ou.local()>c)}}const _e={Accept:"application/vnd.github.machine-man-preview+json"};class Qe{async getInstallationCredentials(c,x){if(this.allowedInstallationOwners){var w;if(!(!((w=this.allowedInstallationOwners)===null||w===void 0)&&w.includes(c)))return{accessToken:void 0}}return this.cache.getOrCreateToken(c,x,async()=>{const{installationId:J,suspended:fe}=await this.getInstallationData(c);if(fe)throw new Error(`The GitHub application for ${c} is suspended`);const we=await this.appClient.apps.createInstallationAccessToken({installation_id:J,headers:_e});let je;if(we.data.repository_selection==="selected"){const Mt=new ue.v({baseUrl:this.baseUrl,auth:we.data.token}),xn=await Mt.paginate(Mt.apps.listReposAccessibleToInstallation);var qe;je=((qe=xn.repositories)!==null&&qe!==void 0?qe:xn).map(br=>br.name)}return{token:we.data.token,expiresAt:xe.ou.fromISO(we.data.expires_at),repositories:je}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(c){const w=(await this.getInstallations()).find(fe=>{var we;return fe.account&&"login"in fe.account&&((we=fe.account.login)===null||we===void 0?void 0:we.toLocaleLowerCase("en-US"))===c.toLocaleLowerCase("en-US")});if(w)return{installationId:w.id,suspended:Boolean(w.suspended_by)};const J=new Error(`No app installation found for ${c} in ${this.baseAuthConfig.appId}`);throw J.name="NotFoundError",J}constructor(c,x){(0,n._)(this,"appClient",void 0),(0,n._)(this,"baseUrl",void 0),(0,n._)(this,"baseAuthConfig",void 0),(0,n._)(this,"cache",new Ve),(0,n._)(this,"allowedInstallationOwners",void 0),this.allowedInstallationOwners=c.allowedInstallationOwners,this.baseUrl=x,this.baseAuthConfig={appId:c.appId,privateKey:c.privateKey.replace(/\\n/gm,`
33
- `)},this.appClient=new ue.v({baseUrl:x,headers:_e,authStrategy:W.i,auth:this.baseAuthConfig})}}class At{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(x=>x.getInstallations()))).flat():[]}async getAppToken(c,x){if(this.apps.length===0)return;const w=await Promise.all(this.apps.map(je=>je.getInstallationCredentials(c,x).then(qe=>({credentials:qe,error:void 0}),qe=>({credentials:void 0,error:qe})))),J=w.find(je=>{var qe;return(qe=je.credentials)===null||qe===void 0?void 0:qe.accessToken});if(J)return J.credentials.accessToken;const we=w.map(je=>je.error).find(je=>(je==null?void 0:je.name)!=="NotFoundError");if(we)throw we}constructor(c){var x;(0,n._)(this,"apps",void 0);var w;this.apps=(w=(x=c.apps)===null||x===void 0?void 0:x.map(J=>new Qe(J,c.apiBaseUrl)))!==null&&w!==void 0?w:[]}}class yt{async getCredentials(c){const x=G()(c.url),w=x.owner||x.name,J=x.owner?x.name:void 0;let fe="app",we=await this.githubAppCredentialsMux.getAppToken(w,J);return we||(fe="token",we=this.token),{headers:we?{Authorization:`Bearer ${we}`}:void 0,token:we,type:fe}}constructor(c,x){(0,n._)(this,"githubAppCredentialsMux",void 0),(0,n._)(this,"token",void 0),this.githubAppCredentialsMux=c,this.token=x}}(0,n._)(yt,"create",S=>new yt(new At(S),S.token));class ot{static fromIntegrations(c){const x=new Map;return c.github.list().forEach(w=>{const J=SingleInstanceGithubCredentialsProvider.create(w.config);x.set(w.config.host,J)}),new ot(x)}async getCredentials(c){const x=new URL(c.url),w=this.providers.get(x.host);if(!w)throw new Error(`There is no GitHub integration that matches ${c.url}. Please add a configuration for an integration.`);return w.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class Fe{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return Ut($(c),"tree")}resolveEditUrl(c){return Ut(c,"edit")}constructor(c){(0,n._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,n._)(Fe,"factory",({config:S})=>{var c;const x=_((c=S.getOptionalConfigArray("integrations.github"))!==null&&c!==void 0?c:[]);return u(x.map(w=>new Fe(w)),w=>w.config.host)});function Ut(S,c){return S.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(x,w,J,fe)=>`//${w}/${J}/${fe}/${c}/`)}const rn=null;class It extends Fe{get config(){return super.config}constructor(c){super(c)}}(0,n._)(It,"factory",Fe.factory);const Ot=null,mn=null,un=null,ut="gitlab.com",We="https://gitlab.com/api/v4";function Tt(S){const c=S.getString("host");let x=S.getOptionalString("apiBaseUrl");const w=S.getOptionalString("token");let J=S.getOptionalString("baseUrl");if(x?x=(0,f.trimEnd)(x,"/"):c===ut&&(x=We),J?J=(0,f.trimEnd)(J,"/"):J=`https://${c}`,V(c)){if(!x||!g(x))throw new Error(`Invalid GitLab integration config, '${x}' is not a valid apiBaseUrl`);if(!g(J))throw new Error(`Invalid GitLab integration config, '${J}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${c}' is not a valid host`);return{host:c,token:w,apiBaseUrl:x,baseUrl:J}}function hn(S){const c=S.map(Tt);return c.some(x=>x.host===ut)||c.push({host:ut,apiBaseUrl:We,baseUrl:`https://${ut}`}),c}function on(S){let c="";return S.host!==ut&&(c=new URL(S.baseUrl).pathname),trimEnd(c,"/")}async function Fn(S,c){const x=await Un(S,c);return Zn(S,x,c).toString()}function ur(S){const{token:c=""}=S;return{headers:{"PRIVATE-TOKEN":c}}}function Zn(S,c,x){try{const w=new URL(S),J=w.pathname.split("/blob/").slice(1).join("/blob/"),[fe,...we]=J.split("/"),je=getGitLabIntegrationRelativePath(x);return w.pathname=[...je?[je]:[],"api/v4/projects",c,"repository/files",encodeURIComponent(decodeURIComponent(we.join("/"))),"raw"].join("/"),w.search=`?ref=${fe}`,w}catch(w){throw new Error(`Incorrect url: ${S}, ${w}`)}}async function Un(S,c){const x=new URL(S);if(!x.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let w=x.pathname.split("/-/blob/")[0].split("/blob/")[0];const J=getGitLabIntegrationRelativePath(c);J&&(w=w.replace(J,""));const fe=new URL(`${x.origin}${J}/api/v4/projects/${encodeURIComponent(w.replace(/^\//,""))}`),we=await fetch(fe.toString(),ur(c)),je=await we.json();if(!we.ok)throw new Error(`GitLab Error '${je.error}', ${je.error_description}`);return Number(je.id)}catch(w){throw new Error(`Could not get GitLab project ID for: ${S}, ${w}`)}}class or{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return $(c)}resolveEditUrl(c){return Nr(c,"edit")}constructor(c){(0,n._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,n._)(or,"factory",({config:S})=>{var c;const x=hn((c=S.getOptionalConfigArray("integrations.gitlab"))!==null&&c!==void 0?c:[]);return u(x.map(w=>new or(w)),w=>w.config.host)});function Nr(S,c){return S.replace(/\/\-\/(blob|tree|edit)\//,`/-/${c}/`)}class Lr{async getCredentials(c){return this.token?{headers:{Authorization:`Bearer ${this.token}`},token:this.token}:{}}constructor(c){(0,n._)(this,"token",void 0),this.token=c}}(0,n._)(Lr,"create",S=>new Lr(S.token));class sr{static fromIntegrations(c){const x=new Map;return c.gitlab.list().forEach(w=>{const J=SingleInstanceGitlabCredentialsProvider.create(w.config);x.set(w.config.host,J)}),new sr(x)}async getCredentials(c){const x=new URL(c.url),w=this.providers.get(x.host);if(!w)throw new Error(`There is no GitLab integration that matches ${c.url}. Please add a configuration for an integration.`);return w.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class xr{static fromConfig(c){return new xr({awsS3:I.factory({config:c}),azure:lt.factory({config:c}),bitbucket:ve.factory({config:c}),bitbucketCloud:an.factory({config:c}),bitbucketServer:bn.factory({config:c}),gerrit:me.factory({config:c}),github:Fe.factory({config:c}),gitlab:or.factory({config:c}),gitea:tn.factory({config:c})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(c=>c.list())}byUrl(c){let x=Object.values(this.byType).map(w=>w.byUrl(c)).filter(Boolean);if(x.length>1){const w=x.filter(J=>!(J instanceof ve));w.length!==0&&(x=w)}return x[0]}byHost(c){return Object.values(this.byType).map(x=>x.byHost(c)).find(Boolean)}resolveUrl(c){const x=this.byUrl(c.base);return x?x.resolveUrl(c):$(c)}resolveEditUrl(c){const x=this.byUrl(c);return x?x.resolveEditUrl(c):c}constructor(c){(0,n._)(this,"byType",void 0),this.byType=c}}},30966:function(vt,ke,r){"use strict";var n={};r.r(n),r.d(n,{TechDocsPlugin:function(){return T.s4}});var p=r(52322),G=r(2784),f=r(28316),V=r(73557),g=r(60871);const u=(0,g.T0)({id:"plugin.techdocs.storageservice"}),$=(0,g.T0)({id:"plugin.techdocs.service"});var ye=r(92077),le=r(95481),H=r(7476),ee=r(93225),I=r(86317),E=r(65124),ie=r(22478),ne=r(85478),re=r(68435),D=r(3482),N=r(42081),P=r(48431),T=r(89258),k=r(52943),te=r(61886),Te=r(13980),Ne=r.n(Te),Z=r(87612);class Xe{get(t){for(const s of this.holders){const a=s.get(t);if(a)return a}}constructor(...t){(0,Z._)(this,"holders",void 0),this.holders=t}}var rt=r(51837);const Et=(0,rt.CT)("api-context"),Lt=i=>{var t;const{apis:s,children:a}=i,h=(t=(0,G.useContext)(Et))===null||t===void 0?void 0:t.atVersion(1),C=h?new Xe(s,h):s;return(0,p.jsx)(Et.Provider,{value:(0,rt.EI)({1:C}),children:a})};Lt.propTypes={apis:Ne().shape({get:Ne().func.isRequired}).isRequired,children:Ne().node};class lt{static validateFactories(t,s){for(const a of s){const h=[a],C=new Set;for(;h.length;){const O=h.shift(),F=t.get(O);if(F)for(const oe of Object.values(F.deps)){if(oe.id===a.id)throw new Error(`Circular dependency of api factory for ${a}`);C.has(oe)||(C.add(oe),h.push(oe))}}}}get(t){return this.load(t)}load(t,s=[]){const a=this.apis.get(t.id);if(a)return a;const h=this.factories.get(t);if(!h)return;if(s.includes(h.api))throw new Error(`Circular dependency of api factory for ${h.api}`);const C=this.loadDeps(t,h.deps,[...s,h.api]),O=h.factory(C);return this.apis.set(t.id,O),O}loadDeps(t,s,a){const h={};for(const C in s)if(s.hasOwnProperty(C)){const O=s[C],F=this.load(O,a);if(!F)throw new Error(`No API factory available for dependency ${O} of dependent ${t}`);h[C]=F}return h}constructor(t){(0,Z._)(this,"factories",void 0),(0,Z._)(this,"apis",void 0),this.factories=t,this.apis=new Map}}var Ft;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(Ft||(Ft={}));class Zt{register(t,s){const a=Ft[t],h=this.factories.get(s.api.id);return h&&h.priority>=a?!1:(this.factories.set(s.api.id,{priority:a,factory:s}),!0)}get(t){const s=this.factories.get(t.id);if(s)return s.factory}getAllApis(){const t=new Set;for(const{factory:s}of this.factories.values())t.add(s.api);return t}constructor(){(0,Z._)(this,"factories",new Map)}}function et(i){return new Promise((t,s)=>{const a=i.width||500,h=i.height||700,C=window.screen.width/2-a/2,O=window.screen.height/2-h/2,F=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${a},height=${h},top=${O},left=${C}`);let oe="";if(!F||typeof F.closed=="undefined"||F.closed){const ct=new Error("Failed to open auth popup.");ct.name="PopupRejectedError",s(ct);return}const be=ct=>{if(ct.source!==F||ct.origin!==i.origin)return;const{data:xt}=ct;if(xt.type==="config_info"){oe=xt.targetOrigin;return}if(xt.type!=="authorization_response")return;const wt=xt;if("error"in wt){const Ht=new Error(wt.error.message);Ht.name=wt.error.name,s(Ht)}else t(wt.response);He()},Ie=setInterval(()=>{if(F.closed){const ct=`Login failed, ${oe&&oe!==window.location.origin?`Incorrect app origin, expected ${oe}`:"popup was closed"}`,xt=new Error(ct);xt.name="PopupClosedError",s(xt),He()}},100);function He(){window.removeEventListener("message",be),clearInterval(Ie)}window.addEventListener("message",be)})}let pt=!1;function ft(i){return[...i].join(" ")}class jt{async createSession(t){return t.instantPopup?this.enableExperimentalRedirectFlow?this.executeRedirect(t.scopes):this.showPopup(t.scopes):this.authRequester(t.scopes)}async refreshSession(t){const s=await fetch(await this.buildUrl("/refresh",{optional:!0,...t&&{scope:this.joinScopesFunc(t)}}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(h=>{throw new Error(`Auth refresh request failed, ${h}`)});if(!s.ok){const h=new Error(`Auth refresh request failed, ${s.statusText}`);throw h.status=s.status,h}const a=await s.json();if(a.error){const h=new Error(a.error.message);throw a.error.name&&(h.name=a.error.name),h}return await this.sessionTransform(a)}async removeSession(){const t=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(s=>{throw new Error(`Logout request failed, ${s}`)});if(!t.ok){const s=new Error(`Logout request failed, ${t.statusText}`);throw s.status=t.status,s}}async showPopup(t){const s=this.joinScopesFunc(t),a=await this.buildUrl("/start",{scope:s,origin:window.location.origin,flow:"popup"}),h=await et({url:a,name:`${this.provider.title} Login`,origin:new URL(a).origin,width:450,height:730});return await this.sessionTransform(h)}async executeRedirect(t){const s=this.joinScopesFunc(t);return window.location.href=await this.buildUrl("/start",{scope:s,origin:window.location.origin,redirectUrl:window.location.href,flow:"redirect"}),new Promise(()=>{})}async buildUrl(t,s){const a=await this.discoveryApi.getBaseUrl("auth"),h=this.buildQueryString({...s,env:this.environment});return`${a}/${this.provider.id}${t}${h}`}buildQueryString(t){if(!t)return"";const s=Object.entries(t).map(([a,h])=>{if(typeof h=="string")return`${encodeURIComponent(a)}=${encodeURIComponent(h)}`;if(h)return encodeURIComponent(a)}).filter(Boolean).join("&");return s?`?${s}`:""}constructor(t){(0,Z._)(this,"discoveryApi",void 0),(0,Z._)(this,"environment",void 0),(0,Z._)(this,"provider",void 0),(0,Z._)(this,"joinScopesFunc",void 0),(0,Z._)(this,"authRequester",void 0),(0,Z._)(this,"sessionTransform",void 0),(0,Z._)(this,"enableExperimentalRedirectFlow",void 0);const{configApi:s,discoveryApi:a,environment:h,provider:C,joinScopes:O=ft,oauthRequestApi:F,sessionTransform:oe=Ie=>Ie}=t;!pt&&!s&&(console.warn("DEPRECATION WARNING: Authentication providers require a configApi instance to configure the authentication flow. Please provide one to the authentication provider constructor."),pt=!0);var be;this.enableExperimentalRedirectFlow=s&&(be=s.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&be!==void 0?be:!1,this.authRequester=F.createAuthRequester({provider:C,onAuthRequest:async Ie=>this.enableExperimentalRedirectFlow?this.executeRedirect(Ie):this.showPopup(Ie)}),this.discoveryApi=a,this.environment=h,this.provider=C,this.joinScopesFunc=O,this.sessionTransform=oe}}function kt(i,t){for(const s of t)if(!i.has(s))return!1;return!0}class qt{sessionExistsAndHasScope(t,s){if(!t)return!1;if(!s||this.options.sessionScopes===void 0)return!0;const a=this.options.sessionScopes(t);return kt(a,s)}getExtendedScope(t,s){const a=new Set(this.options.defaultScopes);if(t&&this.options.sessionScopes!==void 0){const h=this.options.sessionScopes(t);for(const C of h)a.add(C)}if(s)for(const h of s)a.add(h);return a}constructor(t){(0,Z._)(this,"options",void 0),this.options=t}}var de=r(82394),ve=r.n(de);let ze=Symbol.observable;class Ee{[ze](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(s=>s.next(t))}error(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(s=>s.error(t))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,s,a){const h=typeof t=="function"?{next:t,error:s,complete:a}:t;return this.observable.subscribe(h)}constructor(){(0,Z._)(this,"isClosed",!1),(0,Z._)(this,"terminatingError",void 0),(0,Z._)(this,"observable",new(ve())(t=>this.isClosed?(this.terminatingError?t.error(this.terminatingError):t.complete(),()=>{}):(this.subscribers.add(t),()=>{this.subscribers.delete(t)}))),(0,Z._)(this,"subscribers",new Set)}}let at=Symbol.observable;class bt{[at](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=t,this.subscribers.forEach(s=>s.next(t))}error(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(s=>s.error(t))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,s,a){const h=typeof t=="function"?{next:t,error:s,complete:a}:t;return this.observable.subscribe(h)}constructor(t){(0,Z._)(this,"isClosed",void 0),(0,Z._)(this,"currentValue",void 0),(0,Z._)(this,"terminatingError",void 0),(0,Z._)(this,"observable",void 0),(0,Z._)(this,"subscribers",new Set),this.isClosed=!1,this.currentValue=t,this.terminatingError=void 0,this.observable=new(ve())(s=>this.isClosed?(this.terminatingError?s.error(this.terminatingError):s.complete(),()=>{}):(s.next(this.currentValue),this.subscribers.add(s),()=>{this.subscribers.delete(s)}))}}class dt{setIsSignedIn(t){this.signedIn!==t&&(this.signedIn=t,this.subject.next(this.signedIn?g.sM.SignedIn:g.sM.SignedOut))}sessionState$(){return this.subject}constructor(){(0,Z._)(this,"subject",new bt(g.sM.SignedOut)),(0,Z._)(this,"signedIn",!1)}}class Bt{async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const a=await this.collapsedSessionRefresh(t.scopes),h=this.sessionScopesFunc(this.currentSession),C=this.sessionScopesFunc(a);return kt(C,h)&&(this.currentSession=a),a}catch(a){if(t.optional)return;throw a}}if(!this.currentSession&&!t.instantPopup)try{const s=await this.collapsedSessionRefresh(t.scopes);return this.currentSession=s,this.getSession(t)}catch{}if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(t){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession(t);try{const s=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),s}finally{delete this.refreshPromise}}constructor(t){(0,Z._)(this,"connector",void 0),(0,Z._)(this,"helper",void 0),(0,Z._)(this,"sessionScopesFunc",void 0),(0,Z._)(this,"sessionShouldRefreshFunc",void 0),(0,Z._)(this,"stateTracker",new dt),(0,Z._)(this,"refreshPromise",void 0),(0,Z._)(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:h,sessionShouldRefresh:C}=t;this.connector=s,this.sessionScopesFunc=h,this.sessionShouldRefreshFunc=C,this.helper=new qt({sessionScopes:h,defaultScopes:a})}}class St{setSession(t){this.currentSession=t,this.stateTracker.setIsSignedIn(Boolean(t))}async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes))return this.currentSession;if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(t){_define_property(this,"connector",void 0),_define_property(this,"helper",void 0),_define_property(this,"stateTracker",new SessionStateTracker),_define_property(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:h}=t;this.connector=s,this.helper=new SessionScopeHelper({sessionScopes:h,defaultScopes:a})}}const Gt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class $t{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:C=Gt,oauthRequestApi:O,defaultScopes:F=[],scopeTransform:oe=He=>He}=t,be=new jt({configApi:s,discoveryApi:a,environment:h,provider:C,oauthRequestApi:O,sessionTransform(He){return{...He,providerInfo:{idToken:He.providerInfo.idToken,accessToken:He.providerInfo.accessToken,scopes:$t.normalizeScopes(oe,He.providerInfo.scope),expiresAt:new Date(Date.now()+He.providerInfo.expiresInSeconds*1e3)}}}}),Ie=new Bt({connector:be,defaultScopes:new Set(F),sessionScopes:He=>He.providerInfo.scopes,sessionShouldRefresh:He=>(He.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new $t({sessionManager:Ie,scopeTransform:oe})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(t,s){const a=$t.normalizeScopes(this.scopeTransform,t),h=await this.sessionManager.getSession({...s,scopes:a});var C;return(C=h==null?void 0:h.providerInfo.accessToken)!==null&&C!==void 0?C:""}async getIdToken(t={}){const s=await this.sessionManager.getSession({...t,scopes:new Set(["openid"])});var a;return(a=s==null?void 0:s.providerInfo.idToken)!==null&&a!==void 0?a:""}async getBackstageIdentity(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.backstageIdentity}async getProfile(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.profile}static normalizeScopes(t,s){if(!s)return new Set;const a=Array.isArray(s)?s:s.split(/[\s|,]/).filter(Boolean);return new Set(t(a))}constructor(t){(0,Z._)(this,"sessionManager",void 0),(0,Z._)(this,"scopeTransform",void 0),this.sessionManager=t.sessionManager,this.scopeTransform=t.scopeTransform}}const pn={id:"github",title:"GitHub",icon:()=>null};class an{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:C=pn,oauthRequestApi:O,defaultScopes:F=["read:user"]}=t;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:O,provider:C,environment:h,defaultScopes:F})}}const dn={id:"gitlab",title:"GitLab",icon:()=>null};class _t{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:C=dn,oauthRequestApi:O,defaultScopes:F=["read_user"]}=t;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:O,provider:C,environment:h,defaultScopes:F})}}const fn={id:"google",title:"Google",icon:()=>null},Yt="https://www.googleapis.com/auth/";class nn{static create(t){const{configApi:s,discoveryApi:a,oauthRequestApi:h,environment:C="development",provider:O=fn,defaultScopes:F=["openid",`${Yt}userinfo.email`,`${Yt}userinfo.profile`]}=t;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:h,provider:O,environment:C,defaultScopes:F,scopeTransform(oe){return oe.map(be=>be==="openid"?be:be==="profile"||be==="email"?`${Yt}userinfo.${be}`:be.startsWith(Yt)?be:`${Yt}${be}`)}})}}const jn={id:"okta",title:"Okta",icon:()=>null},en=new Set(["openid","profile","email","phone","address","groups","offline_access"]),bn="okta.";class $n{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:C=jn,oauthRequestApi:O,defaultScopes:F=["openid","email","profile","offline_access"]}=t;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:O,provider:C,environment:h,defaultScopes:F,scopeTransform(oe){return oe.map(be=>en.has(be)||be.startsWith(bn)?be:`${bn}${be}`)}})}}var tt=r(30195);const rr=tt.z.object({profile:tt.z.object({email:tt.z.string().optional(),displayName:tt.z.string().optional(),picture:tt.z.string().optional()}),backstageIdentity:tt.z.object({token:tt.z.string(),identity:tt.z.object({type:tt.z.literal("user"),userEntityRef:tt.z.string(),ownershipEntityRefs:tt.z.array(tt.z.string())})})}),Ct={id:"saml",title:"SAML",icon:()=>null};class nt{static create(t){const{discoveryApi:s,environment:a="development",provider:h=Ct}=t,C=new DirectAuthConnector({discoveryApi:s,environment:a,provider:h}),O=new StaticAuthSessionManager({connector:C}),F=new AuthSessionStore({manager:O,storageKey:`${h.id}Session`,schema:samlSessionSchema});return new nt(F)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.backstageIdentity}async getProfile(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.profile}constructor(t){_define_property(this,"sessionManager",void 0),this.sessionManager=t}}const Tn={id:"microsoft",title:"Microsoft",icon:()=>null};class Jt{static create(t){return new Jt(t)}microsoftGraph(){return this.oauth2[Jt.MicrosoftGraphID]}static resourceForScopes(t){const s=[...new Set(t.split(" ").map(Jt.resourceForScope).filter(C=>C!=="openid"))];if(s.length>1)return Promise.reject(new Error(`Requested access token with scopes from multiple Azure resources: ${s.join(", ")}. Access tokens can only have a single audience.`));var a;const h=(a=s[0])!==null&&a!==void 0?a:Jt.MicrosoftGraphID;return Promise.resolve(h)}static resourceForScope(t){var s;const a=(s=t.match(RegExp("^(?<resourceURI>.*)\\/(?<scp>[^\\/]*)$")))===null||s===void 0?void 0:s.groups;if(a){const{resourceURI:h}=a;return h.replace(/^api:\/\//,"")}switch(t){case"email":case"openid":case"offline_access":case"profile":return"openid";default:return Jt.MicrosoftGraphID}}async getAccessToken(t,s){const a=t===void 0?Jt.MicrosoftGraphID:await Jt.resourceForScopes(Array.isArray(t)?t.join(" "):t);return a in this.oauth2||(this.oauth2[a]=$t.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform})),this.oauth2[a].getAccessToken(t,s)}getIdToken(t){return this.microsoftGraph().getIdToken(t)}getProfile(t){return this.microsoftGraph().getProfile(t)}getBackstageIdentity(t){return this.microsoftGraph().getBackstageIdentity(t)}signIn(){return this.microsoftGraph().signIn()}signOut(){return this.microsoftGraph().signOut()}sessionState$(){return this.microsoftGraph().sessionState$()}constructor(t){(0,Z._)(this,"oauth2",void 0),(0,Z._)(this,"configApi",void 0),(0,Z._)(this,"environment",void 0),(0,Z._)(this,"provider",void 0),(0,Z._)(this,"oauthRequestApi",void 0),(0,Z._)(this,"discoveryApi",void 0),(0,Z._)(this,"scopeTransform",void 0);const{configApi:s,environment:a="development",provider:h=Tn,oauthRequestApi:C,discoveryApi:O,defaultScopes:F=["openid","offline_access","profile","email","User.Read"],scopeTransform:oe=be=>be.concat("offline_access")}=t;this.configApi=s,this.environment=a,this.provider=h,this.oauthRequestApi=C,this.discoveryApi=O,this.scopeTransform=oe,this.oauth2={[Jt.MicrosoftGraphID]:$t.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform,defaultScopes:F})}}}(0,Z._)(Jt,"MicrosoftGraphID","00000003-0000-0000-c000-000000000000");const Rn={id:"onelogin",title:"onelogin",icon:()=>null},Dn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),Sn="onelogin.";class Nn{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:C=Rn,oauthRequestApi:O}=t;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:O,provider:C,environment:h,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(F){return F.map(oe=>Dn.has(oe)||oe.startsWith(Sn)?oe:`${Sn}${oe}`)}})}}const Se={id:"bitbucket",title:"Bitbucket",icon:()=>null};class ae{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:C=Se,oauthRequestApi:O,defaultScopes:F=["team"]}=t;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:O,provider:C,environment:h,defaultScopes:F})}}const Le={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class Me{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:C=Le,oauthRequestApi:O,defaultScopes:F=["PROJECT_ADMIN"]}=t;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:O,provider:C,environment:h,defaultScopes:F})}}const Ge={id:"atlassian",title:"Atlassian",icon:()=>null};class se{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:C=Ge,oauthRequestApi:O}=t;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:O,provider:C,environment:h})}}class M{post(t){this.subject.next(t)}alert$(){return this.subject}constructor(){(0,Z._)(this,"subject",new Ee)}}class me{captureEvent(t){}}const Be="theme";class Ye{static createWithStorage(t){const s=new Ye(t);if(!window.localStorage)return s;var a;const h=(a=window.localStorage.getItem(Be))!==null&&a!==void 0?a:void 0;return s.setActiveThemeId(h),s.activeThemeId$().subscribe(C=>{C?window.localStorage.setItem(Be,C):window.localStorage.removeItem(Be)}),window.addEventListener("storage",C=>{if(C.key===Be){var O;const F=(O=localStorage.getItem(Be))!==null&&O!==void 0?O:void 0;s.setActiveThemeId(F)}}),s}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(t){this.activeThemeId=t,this.subject.next(t)}constructor(t){(0,Z._)(this,"themes",void 0),(0,Z._)(this,"activeThemeId",void 0),(0,Z._)(this,"subject",void 0),this.themes=t,this.subject=new bt(void 0)}}var Je=r(9850),Dt=r.n(Je),Kt=r(12782),tn=r.n(Kt);const Qt=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function gn(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function X(i){if(i===null)return"null";if(Array.isArray(i))return"array";const t=typeof i;return t==="number"&&isNaN(i)?"nan":t==="string"&&i===""?"empty-string":t}const q={type(i,t,s,a){return`Invalid type in config for key '${i}' in '${t}', got ${s}, wanted ${a}`},missing(i){return`Missing required config value at '${i}'`},convert(i,t,s){return`Unable to convert config value for key '${i}' in '${t}' to a ${s}`}};class _{static fromConfigs(t){return t.length===0?new _(void 0):t.reduce((s,{data:a,context:h,filteredKeys:C,deprecatedKeys:O})=>{const F=new _(a,h,s);if(F.filteredKeys=C,O)for(const{key:oe,description:be}of O)console.warn(`The configuration key '${oe}' of ${h} is deprecated and may be removed soon. ${be||""}`);return F},void 0)}has(t){var s;if(this.readValue(t)!==void 0)return!0;var h;return(h=(s=this.fallback)===null||s===void 0?void 0:s.has(t))!==null&&h!==void 0?h:!1}keys(){var t;const s=this.data?Object.keys(this.data):[];var a;const h=(a=(t=this.fallback)===null||t===void 0?void 0:t.keys())!==null&&a!==void 0?a:[];return[...new Set([...s,...h])]}get(t){const s=this.getOptional(t);if(s===void 0)throw new Error(q.missing(this.fullKey(t!=null?t:"")));return s}getOptional(t){var s;const a=Dt()(this.readValue(t)),h=(s=this.fallback)===null||s===void 0?void 0:s.getOptional(t);if(a===void 0){if(!1)var C;return h}else if(h===void 0)return a;return tn()({},{value:h},{value:a},(O,F)=>!gn(F)||!gn(O)?F:void 0).value}getConfig(t){const s=this.getOptionalConfig(t);if(s===void 0)throw new Error(q.missing(this.fullKey(t)));return s}getOptionalConfig(t){var s;const a=this.readValue(t),h=(s=this.fallback)===null||s===void 0?void 0:s.getOptionalConfig(t);if(gn(a))return this.copy(a,t,h);if(a!==void 0)throw new TypeError(q.type(this.fullKey(t),this.context,X(a),"object"));return h}getConfigArray(t){const s=this.getOptionalConfigArray(t);if(s===void 0)throw new Error(q.missing(this.fullKey(t)));return s}getOptionalConfigArray(t){const s=this.readConfigValue(t,h=>{if(!Array.isArray(h))return{expected:"object-array"};for(const[C,O]of h.entries())if(!gn(O))return{expected:"object-array",value:O,key:`${t}[${C}]`};return!0});if(!s){if(!1)var a;return}return s.map((h,C)=>this.copy(h,`${t}[${C}]`))}getNumber(t){const s=this.getOptionalNumber(t);if(s===void 0)throw new Error(q.missing(this.fullKey(t)));return s}getOptionalNumber(t){const s=this.readConfigValue(t,h=>typeof h=="number"||typeof h=="string"||{expected:"number"});if(typeof s=="number"||s===void 0)return s;const a=Number(s);if(!Number.isFinite(a))throw new Error(q.convert(this.fullKey(t),this.context,"number"));return a}getBoolean(t){const s=this.getOptionalBoolean(t);if(s===void 0)throw new Error(q.missing(this.fullKey(t)));return s}getOptionalBoolean(t){const s=this.readConfigValue(t,h=>typeof h=="boolean"||typeof h=="number"||typeof h=="string"||{expected:"boolean"});if(typeof s=="boolean"||s===void 0)return s;const a=String(s).trim();if(/^(?:y|yes|true|1|on)$/i.test(a))return!0;if(/^(?:n|no|false|0|off)$/i.test(a))return!1;throw new Error(q.convert(this.fullKey(t),this.context,"boolean"))}getString(t){const s=this.getOptionalString(t);if(s===void 0)throw new Error(q.missing(this.fullKey(t)));return s}getOptionalString(t){return this.readConfigValue(t,s=>typeof s=="string"&&s!==""||{expected:"string"})}getStringArray(t){const s=this.getOptionalStringArray(t);if(s===void 0)throw new Error(q.missing(this.fullKey(t)));return s}getOptionalStringArray(t){return this.readConfigValue(t,s=>{if(!Array.isArray(s))return{expected:"string-array"};for(const[a,h]of s.entries())if(typeof h!="string"||h==="")return{expected:"string-array",value:h,key:`${t}[${a}]`};return!0})}fullKey(t){return`${this.prefix}${this.prefix?".":""}${t}`}copy(t,s,a){const h=new _(t,this.context,a,this.fullKey(s));return h.filteredKeys=this.filteredKeys,h}readConfigValue(t,s){const a=this.readValue(t);if(a===void 0){var h;if(!1)var C;return(h=this.fallback)===null||h===void 0?void 0:h.readConfigValue(t,s)}const O=s(a);if(O!==!0){const{key:F=t,value:oe=a,expected:be}=O;throw new TypeError(q.type(this.fullKey(F),this.context,X(oe),be))}return a}readValue(t){const s=t?t.split("."):[];for(const h of s)if(!Qt.test(h))throw new TypeError(`Invalid config key '${t}'`);if(this.data===void 0)return;let a=this.data;for(const[h,C]of s.entries())if(gn(a))a=a[C];else if(a!==void 0){const O=this.fullKey(s.slice(0,h).join("."));throw new TypeError(q.type(O,this.context,X(a),"object"))}return a}constructor(t,s="mock-config",a,h=""){(0,Z._)(this,"data",void 0),(0,Z._)(this,"context",void 0),(0,Z._)(this,"fallback",void 0),(0,Z._)(this,"prefix",void 0),(0,Z._)(this,"filteredKeys",void 0),(0,Z._)(this,"notifiedFilteredKeys",void 0),this.data=t,this.context=s,this.fallback=a,this.prefix=h,this.notifiedFilteredKeys=new Set}}const v="Invalid discovery URL pattern,";class L{static compile(t){const s=t.split(/\{\{\s*pluginId\s*\}\}/),a=s.join("pluginId");let h;try{h=new URL(a)}catch{throw new Error(`${v} URL '${a}' is invalid`)}if(h.hash)throw new Error(`${v} URL must not have a hash`);if(h.search)throw new Error(`${v} URL must not have a query`);if(a.endsWith("/"))throw new Error(`${v} URL must not end with a slash`);return new L(s)}async getBaseUrl(t){return this.parts.join(encodeURIComponent(t))}constructor(t){(0,Z._)(this,"parts",void 0),this.parts=t}}class Q{post(t,s){return s!=null&&s.hidden||this.alertApi.post({message:t.message,severity:"error"}),this.errorApi.post(t,s)}error$(){return this.errorApi.error$()}constructor(t,s){(0,Z._)(this,"alertApi",void 0),(0,Z._)(this,"errorApi",void 0),this.alertApi=t,this.errorApi=s}}class W{post(t,s){this.subject.next({error:t,context:s})}error$(){return this.subject}constructor(){(0,Z._)(this,"subject",new Ee)}}class ue{static forward(t,s){window.addEventListener("unhandledrejection",a=>{t.post(a.reason,s)})}}function xe(i){if(i.length<3)throw new Error(`The '${i}' feature flag must have a minimum length of three characters.`);if(i.length>150)throw new Error(`The '${i}' feature flag must not exceed 150 characters.`);if(!i.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${i}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class Ve{registerFlag(t){xe(t.name),this.registeredFeatureFlags.push(t)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(t){return this.flags||(this.flags=this.load()),this.flags.get(t)===g.CL.Active}save(t){this.flags||(this.flags=this.load()),t.merge||this.flags.clear();for(const[a,h]of Object.entries(t.states))this.flags.set(a,h);const s=Array.from(this.flags.entries()).filter(([,a])=>a===g.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(s)))}load(){try{const t=window.localStorage.getItem("featureFlags");if(!t)return new Map;const s=JSON.parse(t);if(typeof s!="object"||s===null||Array.isArray(s))return new Map;const a=Object.entries(s).filter(([h,C])=>(xe(h),C===g.CL.Active));return new Map(a)}catch{return new Map}}constructor(){(0,Z._)(this,"registeredFeatureFlags",[]),(0,Z._)(this,"flags",void 0)}}function _e(i){let t=i.baseImplementation||r.g.fetch;var s;const a=[(s=i.middleware)!==null&&s!==void 0?s:[]].flat().reverse();for(const h of a)t=h.apply(t);return{fetch:t}}class Qe{static create(t){var s,a;const h=At(t),C=((s=t.header)===null||s===void 0?void 0:s.name)||"authorization",O=((a=t.header)===null||a===void 0?void 0:a.value)||(F=>`Bearer ${F}`);return new Qe(t.identityApi,h,C,O)}apply(t){return async(s,a)=>{const h=new Request(s,a),{token:C}=await this.identityApi.getCredentials();return h.headers.get(this.headerName)||typeof C!="string"||!C||!this.allowUrl(h.url)?t(s,a):(h.headers.set(this.headerName,this.headerValue(C)),t(h))}}constructor(t,s,a,h){(0,Z._)(this,"identityApi",void 0),(0,Z._)(this,"allowUrl",void 0),(0,Z._)(this,"headerName",void 0),(0,Z._)(this,"headerValue",void 0),this.identityApi=t,this.allowUrl=s,this.headerName=a,this.headerValue=h}}function At(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?yt(i.urlPrefixAllowlist):i.config?yt([i.config.getString("backend.baseUrl")]):()=>!1}function yt(i){const t=i.map(s=>s.replace(/\/$/,""));return s=>t.some(a=>s===a||s.startsWith(`${a}/`))}function ot(i,t){return!t||t==="/"?i:`${i.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}class Fe{apply(t){return async(s,a)=>{const h=new Request(s,a),C="plugin://";if(!h.url.startsWith(C))return t(s,a);const{hostname:O,pathname:F,search:oe,hash:be,username:Ie,password:He}=new URL(`http://${h.url.substring(C.length)}`);let ct=await this.discoveryApi.getBaseUrl(O);if(Ie||He){const wt=new URL(ct),Ht=`${Ie}${He?`:${He}`:""}@`;ct=`${wt.protocol}//${Ht}${wt.host}${wt.pathname}`}const xt=`${ot(ct,F)}${oe}${be}`;return t(xt,typeof s=="string"||Ut(s)?a:s)}}constructor(t){(0,Z._)(this,"discoveryApi",void 0),this.discoveryApi=t}}function Ut(i){return typeof i=="object"&&(i==null?void 0:i.constructor)===URL}class rn{static resolvePluginProtocol(t){return new Fe(t.discoveryApi)}static injectIdentityAuth(t){return Qe.create(t)}constructor(){}}function It(i,t){for(const s of t)if(!i.has(s))return!1;return!0}function Ot(i,...t){const s=new Set(i);for(const a of t)for(const h of a)s.add(h);return s}class mn{request(t){return new Promise((s,a)=>{this.requests.push({scopes:t,resolve:s,reject:a}),this.subject.next(this.getCurrentPending())})}resolve(t,s){this.requests=this.requests.filter(a=>It(t,a.scopes)?(a.resolve(s),!1):!0),this.subject.next(this.getCurrentPending())}reject(t){this.requests.forEach(s=>s.reject(t)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const t=this.requests.length===0?void 0:this.requests.slice(1).reduce((s,a)=>Ot(s,a.scopes),this.requests[0].scopes);return{scopes:t,resolve:s=>{t&&this.resolve(t,s)},reject:s=>{t&&this.reject(s)}}}constructor(){(0,Z._)(this,"requests",[]),(0,Z._)(this,"subject",new bt(this.getCurrentPending()))}}class un{createAuthRequester(t){const s=new mn,a=this.handlerCount;return this.handlerCount++,s.pending().subscribe({next:h=>{const C=this.currentRequests.slice(),O=this.makeAuthRequest(h,t);O?C[a]=O:delete C[a],this.currentRequests=C,this.subject.next(C.filter(Boolean))}}),h=>s.request(h)}makeAuthRequest(t,s){const{scopes:a}=t;if(a)return{provider:s.provider,trigger:async()=>{const h=await s.onAuthRequest(a);t.resolve(h)},reject:()=>{const h=new Error("Login failed, rejected by user");h.name="RejectedError",t.reject(h)}}}authRequest$(){return this.subject}constructor(){(0,Z._)(this,"subject",new bt([])),(0,Z._)(this,"currentRequests",[]),(0,Z._)(this,"handlerCount",0)}}const ut=new Map;class We{static create(t){var s;return new We((s=t.namespace)!==null&&s!==void 0?s:"",t.errorApi)}static addStorageEventListener(){window.addEventListener("storage",t=>{for(const[a,h]of ut.entries()){var s;!((s=t.key)===null||s===void 0)&&s.startsWith(a)&&h.handleStorageChange(t.key)}})}get(t){return this.snapshot(t).value}snapshot(t){let s,a="absent";try{const h=localStorage.getItem(this.getKeyName(t));h&&(s=JSON.parse(h,(C,O)=>(typeof O=="object"&&O!==null&&Object.freeze(O),O)),a="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${t}`))}return{key:t,value:s,presence:a}}forBucket(t){const s=`${this.namespace}/${t}`;return ut.has(s)||ut.set(s,new We(s,this.errorApi)),ut.get(s)}async set(t,s){localStorage.setItem(this.getKeyName(t),JSON.stringify(s)),this.notifyChanges(t)}async remove(t){localStorage.removeItem(this.getKeyName(t)),this.notifyChanges(t)}observe$(t){return We.hasSubscribed||(We.addStorageEventListener(),We.hasSubscribed=!0),this.observable.filter(({key:s})=>s===t)}handleStorageChange(t){if(!(t!=null&&t.startsWith(this.namespace)))return;const s=t==null?void 0:t.slice(`${this.namespace}/`.length);s.includes("/")||this.notifyChanges(decodeURIComponent(s))}getKeyName(t){return`${this.namespace}/${encodeURIComponent(t)}`}notifyChanges(t){const s=this.snapshot(t);for(const a of this.subscribers)a.next(s)}constructor(t,s){(0,Z._)(this,"namespace",void 0),(0,Z._)(this,"errorApi",void 0),(0,Z._)(this,"subscribers",void 0),(0,Z._)(this,"observable",void 0),this.namespace=t,this.errorApi=s,this.subscribers=new Set,this.observable=new(ve())(a=>(this.subscribers.add(a),()=>{this.subscribers.delete(a)}))}}(0,Z._)(We,"hasSubscribed",!1);const Tt=(0,G.createContext)(void 0);function hn(){const[i]=(0,V.is)((0,p.jsx)(V.AW,{index:!0,element:(0,p.jsx)("div",{})}));return!i.index}var on=r(84800);const Fn=(i,t)=>{try{var s;const a=(0,on.fp)(t,{pathname:i}),h=a==null?void 0:a.filter(oe=>{var be;return((be=oe==null?void 0:oe.route.routeRefs)===null||be===void 0?void 0:be.size)>0}).pop(),C=h==null?void 0:h.route;if(!C)return;let O;C.routeRefs.size===1&&(O=C.routeRefs.values().next().value);const F=Object.entries((h==null?void 0:h.params)||{}).reduce((oe,[be,Ie])=>(Ie!==void 0&&(oe[be]=Ie),oe),{});return{extension:"App",pluginId:((s=C.plugin)===null||s===void 0?void 0:s.getId())||"root",...O?{routeRef:O.id}:{},params:F}}catch{return}},ur=({pathname:i,search:t,hash:s,attributes:a})=>{const h=(0,g.z$)();return(0,G.useEffect)(()=>{h.captureEvent("navigate",`${i}${t}${s}`,{attributes:a})},[h,i,t,s,a]),null},Zn=({routeObjects:i})=>{const{pathname:t,search:s,hash:a}=(0,V.TH)(),{params:h,...C}=Fn(t,i)||{params:{}};return(0,p.jsx)(g.fC,{attributes:C,children:(0,p.jsx)(ur,{pathname:t,search:s,hash:a,attributes:h})})};function Un(i){return hn()?or(i):""}function or(i){var t;let{pathname:s}=new URL((t=i.getOptionalString("app.baseUrl"))!==null&&t!==void 0?t:"/","http://sample.dev");return s=s.replace(/\/*$/,""),s}function Nr({component:i,appIdentityProxy:t,children:s}){const[a,h]=(0,G.useState)(),C=(0,g.h_)(g.Ds),O=Un(C);return a?(t.setTarget(a,{signOutTargetUrl:O||"/"}),(0,p.jsx)(p.Fragment,{children:s})):(0,p.jsx)(i,{onSignInSuccess:h})}function Lr(i){const{Router:t,SignInPage:s}=(0,g.qD)().getComponents(),a=(0,g.h_)(g.Ds),h=or(a),C=`${h}/*`,O=(0,G.useContext)(Tt);if(!O)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:F,appIdentityProxy:oe}=O;return s?hn()?(0,p.jsxs)(t,{children:[(0,p.jsx)(Zn,{routeObjects:F}),(0,p.jsx)(Nr,{component:s,appIdentityProxy:oe,children:(0,p.jsx)(V.Z5,{children:(0,p.jsx)(V.AW,{path:C,element:(0,p.jsx)(p.Fragment,{children:i.children})})})})]}):(0,p.jsxs)(t,{basename:h,children:[(0,p.jsx)(Zn,{routeObjects:F}),(0,p.jsx)(Nr,{component:s,appIdentityProxy:oe,children:i.children})]}):(oe.setTarget({getUserId:()=>"guest",getIdToken:async()=>{},getProfile:()=>({email:"guest@example.com",displayName:"Guest"}),getProfileInfo:async()=>({email:"guest@example.com",displayName:"Guest"}),getBackstageIdentity:async()=>({type:"user",userEntityRef:"user:default/guest",ownershipEntityRefs:["user:default/guest"]}),getCredentials:async()=>({}),signOut:async()=>{}},{signOutTargetUrl:h||"/"}),hn()?(0,p.jsxs)(t,{children:[(0,p.jsx)(Zn,{routeObjects:F}),(0,p.jsx)(V.Z5,{children:(0,p.jsx)(V.AW,{path:C,element:(0,p.jsx)(p.Fragment,{children:i.children})})})]}):(0,p.jsxs)(t,{basename:h,children:[(0,p.jsx)(Zn,{routeObjects:F}),i.children]}))}var sr=r(88412),xr=r(50629),S=r(80956),c=r(64279);function x(i){const t={};for(const a in i.collectors)i.collectors.hasOwnProperty(a)&&(t[a]=i.collectors[a]());const s=[{node:G.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;s.length!==0;){const{node:a,parent:h,contexts:C}=s.shift();G.Children.forEach(a,O=>{if(!(0,G.isValidElement)(O))return;const F={};for(const oe in t)if(t.hasOwnProperty(oe)){const be=t[oe];F[oe]=be.visit(be.accumulator,O,h,C[oe])}for(const oe of i.discoverers){const be=oe(O);be&&s.push({node:be,parent:O,contexts:F})}})}return Object.fromEntries(Object.entries(t).map(([a,h])=>[a,h.accumulator]))}function w(i,t){return()=>({accumulator:i(),visit:t})}function J(i){var t;return(t=i.props)===null||t===void 0?void 0:t.children}function fe(i){var t,s;if(!((t=i.props)===null||t===void 0)&&t.path&&(!((s=i.props)===null||s===void 0)&&s.element)){var a;return(a=i.props)===null||a===void 0?void 0:a.element}}const we=w(()=>new Set,(i,t)=>{const s=(0,g.IY)(t,"core.plugin");s&&i.add(s)}),je=i=>{const{children:t}=i,s=(0,g.h_)(g.W0),a="with"in i?s.isActive(i.with):!s.isActive(i.without);return(0,p.jsx)(p.Fragment,{children:a?t:null})};(0,g.R5)(je,"core.featureFlagged",!0);const qe={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function Mt(i){const t=i;if(t!=null&&t.type){var s,a;return(a=(s=t.type.displayName)!==null&&s!==void 0?s:t.type.name)!==null&&a!==void 0?a:String(t.type)}return String(t)}function xn(i,t=new Array){return G.Children.forEach(i,s=>{if(!(0,G.isValidElement)(s))return;const a=(0,g.IY)(s,"core.mountPoint");if(a){const h=(0,g.IY)(s,"core.plugin");t.push({routeRef:a,plugin:h})}xn(s.props.children,t)}),t}const Jn=w(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,s,a)=>{var h,C;if(a!=null&&a.isElementAncestor)return a;if((s==null?void 0:s.props.element)===t)return{...a,isElementAncestor:!0};const O=(h=t.props)===null||h===void 0?void 0:h.path,F=(0,g.IY)(t,"core.mountPoint");if(F&&O)throw new Error(`Path property may not be set directly on a routable extension "${Mt(t)}"`);var oe;const be=(oe=a==null||(C=a.obj)===null||C===void 0?void 0:C.children)!==null&&oe!==void 0?oe:i.objects;if(O!==void 0){if(typeof O!="string")throw new Error(`Element path must be a string at "${Mt(t)}"`);const xt=O.startsWith("/")?O.slice(1):O,wt=t.props.element;if((0,g.IY)(t,"core.gatherMountPoints")){var Ie;if(wt)throw new Error(`Mount point gatherers may not have an element prop "${Mt(t)}"`);const Ht={path:xt,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Ie=t.props)===null||Ie===void 0?void 0:Ie.caseSensitive),children:[qe],plugin:void 0};return be.push(Ht),{obj:Ht,gatherPath:xt,routeRef:a==null?void 0:a.routeRef,gatherRouteRef:a==null?void 0:a.routeRef}}if(wt){var He;const[Ht,...Wt]=xn(wt);if(Wt.length>0)throw new Error(`Route element with path "${O}" may not contain multiple routable extensions`);if(!Ht)return a;const{routeRef:Mn,plugin:tr}=Ht,Ir={path:xt,element:"mounted",routeRefs:new Set([Mn]),caseSensitive:Boolean((He=t.props)===null||He===void 0?void 0:He.caseSensitive),children:[qe],plugin:tr};return be.push(Ir),i.paths.set(Mn,xt),i.parents.set(Mn,a==null?void 0:a.routeRef),{obj:Ir,routeRef:Mn!=null?Mn:a==null?void 0:a.routeRef,gatherPath:xt,gatherRouteRef:a==null?void 0:a.gatherRouteRef}}}if(F){var ct;if((a==null?void 0:a.gatherPath)===void 0)throw new Error(`Routable extension "${Mt(t)}" with mount point "${F}" must be assigned a path`);return a==null||(ct=a.obj)===null||ct===void 0||ct.routeRefs.add(F),i.paths.set(F,a.gatherPath),i.parents.set(F,a==null?void 0:a.gatherRouteRef),{...a,routeRef:F}}return a}),br=w(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,s,a)=>{var h,C,O;if((s==null?void 0:s.props.element)===t)return a;let F=a==null?void 0:a.obj,oe=a==null?void 0:a.routeRef,be=a==null?void 0:a.sticky;const Ie=(h=t.props)===null||h===void 0?void 0:h.path;var He;const ct=(He=F==null?void 0:F.children)!==null&&He!==void 0?He:i.objects,xt=Boolean((C=t.props)===null||C===void 0?void 0:C.caseSensitive);let wt=a==null?void 0:a.path;if((0,g.IY)(t,"core.gatherMountPoints")){if(!Ie)throw new Error("Mount point gatherer must have a path");wt=Ie}const Ht=(O=t.props)===null||O===void 0?void 0:O.element;let Wt=(0,g.IY)(t,"core.mountPoint");if(!Wt&&(0,G.isValidElement)(Ht)&&(Wt=(0,g.IY)(Ht,"core.mountPoint")),Wt){let Ir=Ie;if(wt&&(Ir?wt=void 0:Ir=wt),!Ir)throw new Error("Mounted routable extension must have a path");i.paths.set(Wt,Ir),oe&&be?(i.parents.set(Wt,oe),Ie&&(oe=Wt,be=!1)):(i.parents.set(Wt,oe),oe=Wt),Ie?(F={caseSensitive:xt,path:Ie,element:"mounted",routeRefs:new Set([Wt]),children:[qe],plugin:(0,g.IY)(t.props.element,"core.plugin")},ct.push(F)):F==null||F.routeRefs.add(Wt)}if((0,g.IY)(t,"core.gatherMountPoints")&&(be=!0),(0,g.IY)(t,"core.gatherMountPoints")){if(!Ie)throw new Error("Mount point gatherer must have a path");if(!Wt){var tr;F={caseSensitive:xt,path:Ie,element:"gathered",routeRefs:new Set,children:[qe],plugin:a==null||(tr=a.obj)===null||tr===void 0?void 0:tr.plugin},ct.push(F)}}return{obj:F,path:wt,routeRef:oe,sticky:be}}),Sr=w(()=>new Set,(i,t)=>{if(t.type===je){const s=t.props;i.add("with"in s?s.with:s.without)}}),Or=(0,rt.uW)("route-ref-type",()=>Symbol("route-ref-type"));function lo(i){return i[Or]==="absolute"}function co(i){return i[Or]==="sub"}function hr(i){return i[Or]==="external"}function Hn(...i){const t=i.join("/").replace(/\/\/+/g,"/");return t!=="/"&&t.endsWith("/")?t.slice(0,-1):t}function Fr(i,t,s){let a,h="";if(lo(i))a=i;else if(co(i))a=i.parent,h=i.path;else if(hr(i)){const F=s.get(i);if(!F)return[void 0,""];if(lo(F))a=F;else if(co(F))a=F.parent,h=F.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${F}`)}else throw i[Or]?new Error(`Unknown or invalid route ref type, ${i[Or]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!a)return[void 0,""];const C=t.get(a);if(C===void 0)return[void 0,""];const O=Hn(C,h);return[a,O]}function Zr(i,t,s,a,h){var C;const O=(C=(0,on.fp)(h,t))!==null&&C!==void 0?C:[],F=Array();let oe=-1;for(let He=i;He&&(oe=O.findIndex(ct=>ct.route.routeRefs.has(He)),oe===-1);He=a.get(He))F.unshift(He);F.length===0&&(oe-=1);const be=oe===-1?"":O[oe].pathname,Ie=F.slice(0,-1).map(He=>{const ct=s.get(He);if(ct===void 0)throw new Error(`No path for ${He}`);if(ct.includes(":"))throw new Error(`Cannot route to ${i} with parent ${He} as it has parameters`);return ct});return`${Hn(be,...Ie)}/`}class Bo{resolve(t,s){const[a,h]=Fr(t,this.routePaths,this.routeBindings);if(!a)return;let C;typeof s=="string"?C=this.trimPath(s):s.pathname?C={...s,pathname:this.trimPath(s.pathname)}:C=s;const O=this.appBasePath+Zr(a,C,this.routePaths,this.routeParents,this.routeObjects);return(...[oe])=>Hn(O,(0,on.Gn)(h,oe))}trimPath(t){return t&&(t.startsWith(this.appBasePath)?t.slice(this.appBasePath.length):t)}constructor(t,s,a,h,C){(0,Z._)(this,"routePaths",void 0),(0,Z._)(this,"routeParents",void 0),(0,Z._)(this,"routeObjects",void 0),(0,Z._)(this,"routeBindings",void 0),(0,Z._)(this,"appBasePath",void 0),this.routePaths=t,this.routeParents=s,this.routeObjects=a,this.routeBindings=h,this.appBasePath=C}}const $o=(0,rt.CT)("routing-context"),Gr=({routePaths:i,routeParents:t,routeObjects:s,routeBindings:a,basePath:h="",children:C})=>{const O=new Bo(i,t,s,a,h),F=(0,rt.EI)({1:O});return(0,p.jsx)($o.Provider,{value:F,children:C})};function Do(i,t){const s=new Set(t.values());s.delete(void 0);for(const a of t.keys()){if(s.has(a))continue;let h=a,C="";for(;h;){const F=i.get(h);if(F===void 0)throw new Error(`No path for ${h}`);C=Hn(F,C),h=t.get(h)}const O=C.match(/:(\w+)/g);if(O){for(let F=0;F<O.length;F++)for(let oe=F+1;oe<O.length;oe++)if(O[oe]===O[F])throw new Error(`Parameter ${O[oe]} is duplicated in path ${C}`)}}}function No(i,t){for(const s of t)if(s.externalRoutes){for(const[a,h]of Object.entries(s.externalRoutes))if(!h.optional&&!i.has(h))throw new Error(`External route '${a}' of the '${s.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const Kr=(0,rt.CT)("app-context"),qn=({appContext:i,children:t})=>{const s=(0,rt.EI)({1:i});return(0,p.jsx)(Kr.Provider,{value:s,children:t})};function kr(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function Cr(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class uo{setTarget(t,s){this.target=t,this.signOutTargetUrl=s.signOutTargetUrl,this.resolveTarget(t)}getUserId(){if(!this.target)throw kr("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Cr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw kr("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Cr("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(t=>t.getProfileInfo())}async getBackstageIdentity(){const t=await this.waitForTarget.then(s=>s.getBackstageIdentity());return t.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${t.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),t}async getCredentials(){return this.waitForTarget.then(t=>t.getCredentials())}async getIdToken(){return this.waitForTarget.then(t=>{if(!t.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return Cr("getIdToken"),t.getIdToken()})}async signOut(){await this.waitForTarget.then(t=>t.signOut()),window.location.href=this.signOutTargetUrl}constructor(){(0,Z._)(this,"target",void 0),(0,Z._)(this,"waitForTarget",void 0),(0,Z._)(this,"resolveTarget",()=>{}),(0,Z._)(this,"signOutTargetUrl","/"),this.waitForTarget=new Promise(t=>{this.resolveTarget=t})}}var Yr=r(72164);function Jr(i,t,s){if(i!==void 0){const h=s.find(C=>C.id===i);if(h)return h}if(t){const h=s.find(C=>C.variant==="dark");if(h)return h}const a=s.find(h=>h.variant==="light");return a||s[0]}const On=()=>{const i=(0,G.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[t,s]=(0,G.useState)(i.matches);return(0,G.useEffect)(()=>{const a=h=>{s(h.matches)};return i.addListener(a),()=>{i.removeListener(a)}},[i]),t};function ho({children:i}){const t=(0,g.h_)(g.hg),s=(0,Yr.Z)(t.activeThemeId$(),t.getActiveThemeId()),a=Boolean(window.matchMedia)?On():!1,h=Jr(s,a,t.getInstalledThemes());if(!h)throw new Error("App has no themes");return(0,p.jsx)(h.Provider,{children:i})}const Ur=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const t=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!t)throw new Error("No static configuration provided");if(!Array.isArray(t))throw new Error("Static configuration has invalid format");const s=t.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const h=JSON.parse(i);Array.isArray(h)?s.push(...h):s.push({data:h,context:"env"})}catch(h){throw new Error(`Failed to load runtime configuration, ${h}`)}const a=window.__APP_CONFIG__;return a&&s.push({context:"window",data:a}),s};class Fo{add(t,s){return this.apis.push([t.id,s]),s}build(){return new wr(new Map(this.apis))}constructor(){(0,Z._)(this,"apis",[])}}class wr{static builder(){return new Fo}static from(t){return new wr(new Map(t.map(([s,a])=>[s.id,a])))}static with(t,s){return new wr(new Map([[t.id,s]]))}with(t,s){return new wr(new Map([...this.apis,[t.id,s]]))}get(t){return this.apis.get(t.id)}constructor(t){(0,Z._)(this,"apis",void 0),this.apis=t}}function po(i){const t=new Map;return i&&i({bind:(a,h)=>{for(const[C,O]of Object.entries(h)){const F=a[C];if(!F)throw new Error(`Key ${C} is not an existing external route`);if(!O&&!F.optional)throw new Error(`External route ${C} is required but was undefined`);O&&t.set(F,O)}}}),t}function fo(i){const t=new URL(i);return t.protocol=document.location.protocol,t.hostname=document.location.hostname,t.port=document.location.port,t.toString().replace(/\/$/,"")}function Zo(i,t,s){var a;const h=Boolean(i),C=(0,c.default)(i||(()=>Promise.resolve([])));let O;if(h&&C.loading){const{Progress:be}=t;O=(0,p.jsx)(be,{})}else if(C.error){const{BootErrorPage:be}=t;O=(0,p.jsx)(be,{step:"load-config",error:C.error})}const{ThemeProvider:F=ho}=t;if(O)return{node:(0,p.jsx)(Lt,{apis:wr.with(g.hg,s),children:(0,p.jsx)(F,{children:O})})};let oe;if(!((a=C.value)===null||a===void 0)&&a.length){const be=_.fromConfigs(C.value),Ie=be.getOptionalString("app.baseUrl"),He=be.getOptionalString("backend.baseUrl");let ct=C.value;const xt={data:{},context:"relative-resolver"};if(Ie&&He){const wt=new URL(Ie).origin,Ht=new URL(He).origin;if(wt===Ht){const Wt=fo(He);He!==Wt&&(xt.data.backend={baseUrl:Wt})}}if(Ie){const wt=fo(Ie);Ie!==wt&&(xt.data.app={baseUrl:wt})}Object.keys(xt.data).length&&(ct=ct.concat([xt])),oe=_.fromConfigs(ct)}else oe=_.fromConfigs([]);return{api:oe}}class go{getPlugins(){return this.app.getPlugins()}getSystemIcon(t){return this.app.getSystemIcon(t)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(t){(0,Z._)(this,"app",void 0),this.app=t}}var jr=new WeakMap;class ps{getPlugins(){return Array.from(this.plugins)}getSystemIcon(t){return this.icons[t]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(t){const s=this.getProvider();return()=>(0,p.jsx)(s,{children:t})}getProvider(){if((0,sr._)(this,jr))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,S._)(this,jr,!0);const t=new go(this);let s=!1;return({children:h})=>{const C=(0,G.useRef)(!0),O=(0,G.useMemo)(()=>Ye.createWithStorage(this.themes),[]),{routing:F,featureFlags:oe,routeBindings:be}=(0,G.useMemo)(()=>{const xt=x({root:h,discoverers:[J,fe],collectors:{routing:hn()?br:Jn,collectedPlugins:we,featureFlags:Sr}});return xt.collectedPlugins.forEach(wt=>this.plugins.add(wt)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...xt,routeBindings:po(this.bindRoutes)}},[h]);s||(s=!0,Do(F.paths,F.parents),No(be,this.plugins));const Ie=Zo(this.configLoader,this.components,O),He="api"in Ie;if(He){const{api:xt}=Ie;this.configApi=xt}if("node"in Ie)return Ie.node;if(He&&C.current){C.current=!1;const xt=this.getApiHolder().get(g.W0);if(xt){for(const Wt of this.featureFlags)xt.registerFlag({...Wt,pluginId:""});for(const Wt of this.plugins.values())if("getFeatureFlags"in Wt)for(const Mn of Wt.getFeatureFlags())xt.registerFlag({name:Mn.name,pluginId:Wt.getId()});else for(const Mn of Wt.output())Mn.type==="feature-flag"&&xt.registerFlag({name:Mn.name,pluginId:Wt.getId()});const wt=xt.getRegisteredFlags(),Ht=new Set(wt.map(Wt=>Wt.name));for(const Wt of oe)Ht.has(Wt)||xt.registerFlag({name:Wt,pluginId:""})}}const{ThemeProvider:ct=ho}=this.components;return(0,p.jsx)(Lt,{apis:this.getApiHolder(),children:(0,p.jsx)(qn,{appContext:t,children:(0,p.jsx)(ct,{children:(0,p.jsx)(Gr,{routePaths:F.paths,routeParents:F.parents,routeObjects:F.objects,routeBindings:be,basePath:Un(Ie.api),children:(0,p.jsx)(Tt.Provider,{value:{routeObjects:F.objects,appIdentityProxy:this.appIdentityProxy},children:h})})})})})}}getRouter(){return Lr}getApiHolder(){if(this.apiHolder){for(const t of this.plugins)for(const s of t.getApis())this.apiFactoryRegistry.get(s.api)||this.apiFactoryRegistry.register("default",s);return lt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:g.hg,deps:{},factory:()=>Ye.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:g.Ds,deps:{},factory:()=>{if(!this.configApi)throw new Error("Tried to access config API before config was loaded");return this.configApi}}),this.apiFactoryRegistry.register("static",{api:g.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:g.W0,deps:{},factory:()=>new Ve});for(const t of this.defaultApis)this.apiFactoryRegistry.register("default",t);for(const t of this.plugins)for(const s of t.getApis())if(!this.apiFactoryRegistry.register("default",s))throw new Error(`Plugin ${t.getId()} tried to register duplicate or forbidden API factory for ${s.api}`);for(const t of this.apis)if(!this.apiFactoryRegistry.register("app",t))throw new Error(`Duplicate or forbidden API factory for ${t.api} in app`);return lt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new lt(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(t){const s=new Set;for(const a of t){const h=a.getId();if(s.has(h))throw new Error(`Duplicate plugin found '${h}'`);s.add(h)}}constructor(t){(0,Z._)(this,"apiHolder",void 0),(0,Z._)(this,"configApi",void 0),(0,Z._)(this,"apis",void 0),(0,Z._)(this,"icons",void 0),(0,Z._)(this,"plugins",void 0),(0,Z._)(this,"featureFlags",void 0),(0,Z._)(this,"components",void 0),(0,Z._)(this,"themes",void 0),(0,Z._)(this,"configLoader",void 0),(0,Z._)(this,"defaultApis",void 0),(0,Z._)(this,"bindRoutes",void 0),(0,Z._)(this,"appIdentityProxy",new uo),(0,Z._)(this,"apiFactoryRegistry",void 0),(0,xr._)(this,jr,{writable:!0,value:!1});var s;this.apis=(s=t.apis)!==null&&s!==void 0?s:[],this.icons=t.icons;var a;this.plugins=new Set((a=t.plugins)!==null&&a!==void 0?a:[]);var h;this.featureFlags=(h=t.featureFlags)!==null&&h!==void 0?h:[],this.components=t.components,this.themes=t.themes;var C;this.configLoader=(C=t.configLoader)!==null&&C!==void 0?C:Ur;var O;this.defaultApis=(O=t.defaultApis)!==null&&O!==void 0?O:[],this.bindRoutes=t.bindRoutes,this.apiFactoryRegistry=new Zt}}function Uo(i){return new ps(i)}let Qr=!1;const mo=i=>{const t=(0,g.qD)(),{NotFoundErrorPage:s}=t.getComponents(),a=(0,G.useMemo)(()=>hn(),[]),C=[...(0,g.vJ)(i.children,O=>O.getElements().flatMap(F=>{let oe=F.props.path;if(oe==="")return[];var be;oe=(be=oe==null?void 0:oe.replace(/\/\*$/,""))!==null&&be!==void 0?be:"/";let Ie=a?F:F.props.element;return!a&&!Ie&&(Ie=F,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:oe,element:Ie,children:F.props.children?[{path:oe==="/"?"/":"*",element:F.props.children}]:void 0}]}).sort((F,oe)=>oe.path.localeCompare(F.path)).map(F=>({...F,path:F.path==="/"?"/":`${F.path}/*`}))),{path:"*",element:(0,p.jsx)(s,{})}];return(0,V.V$)(C)},Br=(0,g.T0)({id:"plugin.permission.api"});var Pn;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(Pn||(Pn={}));function ri(i,t){return i.name===t.name}function fs(i,t){return"resourceType"in i?!t||i.resourceType===t:!1}function gs(i){return i.attributes.action==="create"}function Mo(i){return i.attributes.action==="read"}function vo(i){return i.attributes.action==="update"}function ms(i){return i.attributes.action==="delete"}function vs(i){return{authorize:async(t,s)=>await i.authorize(t,s),authorizeConditional(t,s){const a=t;return i.authorize(a,s)}}}function ir({name:i,attributes:t,resourceType:s}){return s?{type:"resource",name:i,attributes:t,resourceType:s}:{type:"basic",name:i,attributes:t}}var zo=r(23054),Gn=r(96279),yo=r.n(Gn),Wo=r(9571);const Xr=tt.z.lazy(()=>tt.z.object({rule:tt.z.string(),resourceType:tt.z.string(),params:tt.z.record(tt.z.any()).optional()}).or(tt.z.object({anyOf:tt.z.array(Xr).nonempty()})).or(tt.z.object({allOf:tt.z.array(Xr).nonempty()})).or(tt.z.object({not:Xr}))),Vo=tt.z.object({result:tt.z.literal(Pn.ALLOW).or(tt.z.literal(Pn.DENY))}),Ho=tt.z.union([tt.z.object({result:tt.z.literal(Pn.ALLOW).or(tt.z.literal(Pn.DENY))}),tt.z.object({result:tt.z.literal(Pn.CONDITIONAL),pluginId:tt.z.string(),resourceType:tt.z.string(),conditions:Xr})]),ys=(i,t)=>tt.z.object({items:tt.z.array(tt.z.intersection(tt.z.object({id:tt.z.string()}),i)).refine(s=>s.length===t.size&&s.every(({id:a})=>t.has(a)),{message:"Items in response do not match request"})});class Go{async authorize(t,s){return this.makeRequest(t,Vo,s)}async authorizeConditional(t,s){return this.makeRequest(t,Ho,s)}async makeRequest(t,s,a){if(!this.enabled)return t.map(Ie=>({result:Pn.ALLOW}));const h={items:t.map(Ie=>({id:Wo.Z(),...Ie}))},C=await this.discovery.getBaseUrl("permission"),O=await yo()(`${C}/authorize`,{method:"POST",body:JSON.stringify(h),headers:{...this.getAuthorizationHeader(a==null?void 0:a.token),"content-type":"application/json"}});if(!O.ok)throw await zo.VL.fromResponse(O);const F=await O.json(),be=ys(s,new Set(h.items.map(({id:Ie})=>Ie))).parse(F).items.reduce((Ie,He)=>(Ie[He.id]=He,Ie),{});return h.items.map(Ie=>be[Ie.id])}getAuthorizationHeader(t){return t?{Authorization:`Bearer ${t}`}:{}}constructor(t){(0,Z._)(this,"enabled",void 0),(0,Z._)(this,"discovery",void 0),this.discovery=t.discovery;var s;this.enabled=(s=t.config.getOptionalBoolean("permission.enabled"))!==null&&s!==void 0?s:!1}}class qr{static create(t){const{config:s,discovery:a,identity:h}=t,C=new Go({discovery:a,config:s});return new qr(C,h)}async authorize(t){return(await this.permissionClient.authorize([t],await this.identityApi.getCredentials()))[0]}constructor(t,s){(0,Z._)(this,"permissionClient",void 0),(0,Z._)(this,"identityApi",void 0),this.permissionClient=t,this.identityApi=s}}var Ko=r(69984);function Yo(i){const t=(0,g.h_)(Br),{data:s,error:a}=(0,Ko.ZP)(i,async h=>{if(fs(h.permission)&&!h.resourceRef)return Pn.DENY;const{result:C}=await t.authorize(h);return C});return a?{error:a,loading:!1,allowed:!1}:s===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:s===Pn.ALLOW}}const b=i=>{const{permission:t,resourceRef:s,errorComponent:a,...h}=i,C=usePermission(isResourcePermission(t)?{permission:t,resourceRef:s}:{permission:t}),O=useApp(),{NotFoundErrorPage:F}=O.getComponents();let oe=a===void 0?_jsx(F,{}):a;return C.loading?oe=null:C.allowed&&(oe=i.element),_jsx(Route,{...h,element:oe})};function j(i){const{permission:t,resourceRef:s}=i,a=usePermission(isResourcePermission(t)?{permission:t,resourceRef:s}:{permission:t}),h=useApp();if(a.loading)return null;if(a.allowed)return _jsx(_Fragment,{children:i.children});if(i.errorPage)return _jsx(_Fragment,{children:i.errorPage});const{NotFoundErrorPage:C}=h.getComponents();return _jsx(C,{})}const R=[(0,g.ni)({api:g.NW,deps:{configApi:g.Ds},factory:({configApi:i})=>L.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,g.ni)({api:g.$v,deps:{},factory:()=>new M}),(0,g.ni)({api:g.v_,deps:{},factory:()=>new me}),(0,g.ni)({api:g.VE,deps:{alertApi:g.$v},factory:({alertApi:i})=>{const t=new Q(i,new W);return ue.forward(t,{hidden:!1}),t}}),(0,g.ni)({api:g.E6,deps:{errorApi:g.VE},factory:({errorApi:i})=>We.create({errorApi:i})}),(0,g.ni)({api:g.gP,deps:{configApi:g.Ds,identityApi:g.$4,discoveryApi:g.NW},factory:({configApi:i,identityApi:t,discoveryApi:s})=>_e({middleware:[rn.resolvePluginProtocol({discoveryApi:s}),rn.injectIdentityAuth({identityApi:t,config:i})]})}),(0,g.ni)({api:g.ZM,deps:{},factory:()=>new un}),(0,g.ni)({api:g.Kp,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>nn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.p_,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Jt.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.F4,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>an.create({configApi:s,discoveryApi:i,oauthRequestApi:t,defaultScopes:["read:user"],environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.D,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>$n.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.ux,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>_t.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.gW,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Nn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.bq,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>ae.create({configApi:s,discoveryApi:i,oauthRequestApi:t,defaultScopes:["team"],environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.Km,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Me.create({configApi:s,discoveryApi:i,oauthRequestApi:t,defaultScopes:["REPO_READ"]})}),(0,g.ni)({api:g.uB,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>se.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:Br,deps:{discovery:g.NW,identity:g.$4,config:g.Ds},factory:({config:i,discovery:t,identity:s})=>qr.create({config:i,discovery:t,identity:s})})];var B=r(77277),K=r(53974),he=r(71597);function ce({children:i}){return(0,V.GV)()?(0,p.jsx)(p.Fragment,{children:i}):(0,p.jsx)(V.VA,{children:i})}const Ce=()=>(0,p.jsx)(K.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),Oe=({step:i,error:t})=>{let s="";return i==="load-config"?s=`The configuration failed to load, someone should have a look at this error: ${t.message}`:i==="load-chunk"&&(s=`Lazy loaded chunk failed to load, try to reload the page: ${t.message}`),(0,p.jsx)(ce,{children:(0,p.jsx)(K.mf,{status:"501",statusMessage:s})})},Re=({error:i,resetError:t,plugin:s})=>(0,p.jsx)(K.yu,{title:`Error in ${s==null?void 0:s.getId()}`,defaultExpanded:!0,error:i,children:(0,p.jsx)(B.Z,{variant:"outlined",onClick:t,children:"Retry"})}),Ze={Progress:K.Ex,Router:he.VK,NotFoundErrorPage:Ce,BootErrorPage:Oe,ErrorBoundaryFallback:Re};var De=r(43642),gt=r(80079),ht=r(90941),st=r(32915),$e=r(40562),it=r(21853),Nt=r(60744),vn=r(66569),mt=r(30254),zt=r(13384),Rt=r(15933),Xt=r(58838),En=r(86737),Er=r(4989),Ar=r(44407),xo=r(18628),kn=r(84219),Ln=r(98685),Mr=r(39781),xs=r(39412);const oi={brokenImage:gt.Z,catalog:xo.Z,scaffolder:st.Z,techdocs:$e.Z,search:it.Z,chat:Nt.Z,dashboard:vn.Z,docs:mt.Z,email:zt.Z,github:Xt.Z,group:kn.Z,help:En.Z,"kind:api":Rt.Z,"kind:component":Ar.Z,"kind:domain":De.Z,"kind:group":kn.Z,"kind:location":Er.Z,"kind:system":ht.Z,"kind:user":Ln.Z,"kind:resource":xs.Z,user:Ln.Z,warning:Mr.Z};var Jo=r(73689),bs=r(4707);function si(i,t){if(!t||typeof t=="string")return;const s=typeof t=="function"?t(i):t;if(s)return{"@global":s}}function ii(i,t){if(!(!t||typeof t=="string"))return typeof t=="object"?Object.fromEntries(Object.entries(t).map(([s,a])=>typeof a=="function"?[s,a({theme:i})]:[s,a])):t}const Qo=/^&.Mui-([\w-]+)$/;function ai(i){let t=i;if(!i||typeof i!="object")return t;for(const s of Object.keys(i)){const a=i[s];if(!(!a||typeof a!="object"))for(const h of Object.keys(a)){const C=h,O=C.match(Qo);if(O){const[,F]=O,{[C]:oe,...be}=a;oe&&(t={...t,[s]:be,[F]:oe})}}}return t}function Ss(i,t={}){const s={},a={};for(const h of Object.keys(t)){const C=t[h];C&&("styleOverrides"in C&&(h==="MuiCssBaseline"?s[h]=si(i,C.styleOverrides):s[h]=ai(ii(i,C.styleOverrides))),"defaultProps"in C&&(a[h]=C.defaultProps))}return{overrides:s,props:a}}var Cs=r(47591);const $r={MuiCssBaseline:{styleOverrides:i=>({html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,overscrollBehaviorY:"none",fontSize:"0.875rem",lineHeight:1.43},a:{color:"inherit",textDecoration:"none"}})},MuiGrid:{defaultProps:{spacing:2}},MuiSwitch:{defaultProps:{color:"primary"}},MuiTableRow:{styleOverrides:{root:({theme:i})=>({"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}}),hover:{"&:hover":{cursor:"pointer"}},head:({theme:i})=>({"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}})}},MuiTableCell:{styleOverrides:{root:({theme:i})=>({wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0}),sizeSmall:({theme:i})=>({padding:i.spacing(1.5,2,1.5,2.5)}),head:({theme:i})=>({wordBreak:"break-word",overflow:"hidden",color:i.palette.textSubtle,fontWeight:"normal",lineHeight:"1"})}},MuiTabs:{styleOverrides:{root:{minHeight:24}}},MuiTab:{styleOverrides:{root:({theme:i})=>({color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,Cs._j)(i.palette.link,.3),background:(0,Cs.$n)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}}),textColorPrimary:({theme:i})=>({color:i.palette.link})}},MuiTableSortLabel:{styleOverrides:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"},"&.Mui-active":{fontWeight:"bold",color:"inherit"}}}},MuiListItemText:{styleOverrides:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}},MuiButton:{styleOverrides:{text:{padding:void 0}}},MuiChip:{styleOverrides:{root:({theme:i})=>({backgroundColor:"#D9D9D9",marginRight:i.spacing(1),marginBottom:i.spacing(1),color:i.palette.grey[900]}),outlined:({theme:i})=>({color:i.palette.text.primary}),label:({theme:i})=>({lineHeight:i.spacing(2.5),fontWeight:i.typography.fontWeightMedium,fontSize:i.spacing(1.75)}),labelSmall:({theme:i})=>({fontSize:i.spacing(1.5)}),deleteIcon:({theme:i})=>({color:i.palette.grey[500],width:i.spacing(3),height:i.spacing(3),margin:`0 ${i.spacing(.75)} 0 -${i.spacing(.75)}`}),deleteIconSmall:({theme:i})=>({width:i.spacing(2),height:i.spacing(2),margin:`0 ${i.spacing(.5)} 0 -${i.spacing(.5)}`})}},MuiCard:{styleOverrides:{root:{display:"flex",flexDirection:"column"}}},MuiCardHeader:{styleOverrides:{root:{paddingBottom:0}}},MuiCardContent:{styleOverrides:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}}},MuiCardActions:{styleOverrides:{root:{justifyContent:"flex-end"}}}},ar={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")`},lr={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 _n(i){const{colors:t,shape:s,options:a}=i,C=`linear-gradient(90deg, ${(t.length===1?[t[0],t[0]]:t).join(", ")})`,O=`${s}, ${C}`;var F;const oe=(F=a==null?void 0:a.fontColor)!==null&&F!==void 0?F:"#FFFFFF";return{colors:t,shape:s,backgroundImage:O,fontColor:oe}}const _r={home:_n({colors:lr.teal,shape:ar.wave}),documentation:_n({colors:lr.pinkSea,shape:ar.wave2}),tool:_n({colors:lr.purpleSky,shape:ar.round}),service:_n({colors:lr.marineBlue,shape:ar.wave}),website:_n({colors:lr.veryBlue,shape:ar.wave}),library:_n({colors:lr.rubyRed,shape:ar.wave}),other:_n({colors:lr.darkGrey,shape:ar.wave}),app:_n({colors:lr.toastyOrange,shape:ar.wave}),apis:_n({colors:lr.teal,shape:ar.wave2}),card:_n({colors:lr.greens,shape:ar.wave})},li=16,ws='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif',ci="home";function Xo(i){const{palette:t,htmlFontSize:s=li,fontFamily:a=ws,defaultPageTheme:h=ci,pageTheme:C=_r}=i;if(!C[h])throw new Error(`${h} is not defined in pageTheme.`);var O;return{palette:t,typography:{htmlFontSize:s,fontFamily:a,h1:{fontSize:54,fontWeight:700,marginBottom:10},h2:{fontSize:40,fontWeight:700,marginBottom:8},h3:{fontSize:32,fontWeight:700,marginBottom:6},h4:{fontWeight:700,fontSize:28,marginBottom:6},h5:{fontWeight:700,fontSize:24,marginBottom:4},h6:{fontWeight:700,fontSize:20,marginBottom:2}},page:C[h],getPageTheme:({themeId:F})=>(O=C[F])!==null&&O!==void 0?O:C[h]}}var zr=new WeakMap;class js{getTheme(t){return(0,sr._)(this,zr).get(t)}constructor(t,s){(0,xr._)(this,zr,{writable:!0,value:new Map}),(0,S._)(this,zr,new Map),t&&(0,sr._)(this,zr).set("v4",t),s&&(0,sr._)(this,zr).set("v5",s)}}function di(i){const t=Xo(i),s={...$r,...i.components},a=(0,bs.Z)({...t,components:s}),h=Ss(a,s),C={...(0,Jo.Z)(t),...h};return new js(C,a)}function _i(i){const t=adaptV4Theme(i),s=createTheme(i);return new js(s,t)}const eo={light:{type:"light",mode:"light",background:{default:"#F8F8F8",paper:"#FFFFFF"},status:{ok:"#1DB954",warning:"#FF9800",error:"#E22134",running:"#1F5493",pending:"#FFED51",aborted:"#757575"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#1F5493"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#000000",textVerySubtle:"#DDD",textSubtle:"#6E6E6E",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#2196F3",link:"#0A6EBE",gold:"#FFD600",navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},dark:{type:"dark",mode:"dark",background:{default:"#333333",paper:"#424242"},status:{ok:"#71CF88",warning:"#FFB84D",error:"#F84C55",running:"#3488E3",pending:"#FEF071",aborted:"#9E9E9E"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#9CC9FF",dark:"#82BAFD"},secondary:{main:"#FF88B2"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#FFFFFF",textVerySubtle:"#727272",textSubtle:"#CCCCCC",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#82BAFD",link:"#9CC9FF",gold:"#FFD600",navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}}},Es={light:di({palette:eo.light}),dark:di({palette:eo.dark})};var er=r(68542);er.Z.configure(i=>`v5-${i}`);var ea=r(41547),ta=r(3493),na=r(76919),ra=r(91994);function ui(i){const{children:t,theme:s,noCssBaseline:a=!1}=i,h=s.getTheme("v4"),C=s.getTheme("v5");let O;a||(O=(0,p.jsx)(ra.ZP,{}));let F=(0,p.jsxs)(p.Fragment,{children:[O,t]});return h&&(F=(0,p.jsx)(ea.Z,{theme:h,children:F})),C&&(F=(0,p.jsx)(ta.Z,{injectFirst:!0,children:(0,p.jsx)(na.Z,{theme:C,children:F})})),F}function oa(i){var t,s;return{props:{MuiGrid:$r==null||(t=$r.MuiGrid)===null||t===void 0?void 0:t.defaultProps,MuiSwitch:$r==null||(s=$r.MuiSwitch)===null||s===void 0?void 0:s.defaultProps},...Xo(i)}}function sa(i){return Ss(i,$r).overrides}function hi(i){const t=oa(i),s=(0,Jo.Z)(t),a=sa(s);return{...s,overrides:a}}const qo=hi({palette:eo.light}),Za=hi({palette:eo.dark});var ia=r(98192),pi=r(15222);const fi=[{id:"light",title:"Light Theme",variant:"light",icon:(0,p.jsx)(pi.Z,{}),Provider:({children:i})=>(0,p.jsx)(ui,{theme:Es.light,children:i})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,p.jsx)(ia.Z,{}),Provider:({children:i})=>(0,p.jsx)(ui,{theme:Es.dark,children:i})}];function _o(i){var t,s,a,h;return Uo({...i,apis:(t=i==null?void 0:i.apis)!==null&&t!==void 0?t:[],bindRoutes:i==null?void 0:i.bindRoutes,components:{...Ze,...i==null?void 0:i.components},configLoader:i==null?void 0:i.configLoader,defaultApis:R,icons:{...oi,...i==null?void 0:i.icons},plugins:(s=i==null?void 0:i.plugins)!==null&&s!==void 0?s:[],featureFlags:(a=i==null?void 0:i.featureFlags)!==null&&a!==void 0?a:[],themes:(h=i==null?void 0:i.themes)!==null&&h!==void 0?h:fi})}var bo=r(25271),As=r(76635);async function gi({storageApi:i}){const t=i.forBucket("settings"),s=i.forBucket("starredEntities"),a=t.snapshot("starredEntities").value;if(!(0,As.isArray)(a))return;var h;const C=new Set((h=s.snapshot("entityRefs").value)!==null&&h!==void 0?h:[]);a.filter(As.isString).map(O=>O.split(":")).filter(O=>O.length===4&&O[0]==="entity").map(([O,F,oe,be])=>(0,bo.eE)({kind:F,namespace:oe,name:be})).forEach(O=>C.add(O)),await s.set("entityRefs",Array.from(C)),await t.remove("starredEntities")}class es{async toggleStarred(t){this.starredEntities.has(t)?this.starredEntities.delete(t):this.starredEntities.add(t),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const t of this.subscribers)t.next(new Set(this.starredEntities))}constructor(t){(0,Z._)(this,"settingsStore",void 0),(0,Z._)(this,"starredEntities",void 0),(0,Z._)(this,"subscribers",new Set),(0,Z._)(this,"observable",new(ve())(a=>(a.next(new Set(this.starredEntities)),this.subscribers.add(a),()=>{this.subscribers.delete(a)}))),gi(t).then(),this.settingsStore=t.storageApi.forBucket("starredEntities");var s;this.starredEntities=new Set((s=this.settingsStore.snapshot("entityRefs").value)!==null&&s!==void 0?s:[]),this.settingsStore.observe$("entityRefs").subscribe({next:a=>{var h;this.starredEntities=new Set((h=a.value)!==null&&h!==void 0?h:[]),this.notifyChanges()}})}}var pr=r(8799),Tr=r(79692),So=r(12420),Bn=r(43514),mi=r(19928);function Rr(){const i=useApi(catalogApiRef),{error:t,loading:s,value:a}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(C=>{var O;return((O=C.facets.kind)===null||O===void 0?void 0:O.map(F=>F.value).sort())||[]}),[i]);return{loading:s,error:t,allKinds:a!=null?a:[]}}function aa(i,t,s){let a=i;return t&&(a=a.filter(C=>t.some(O=>O.toLocaleLowerCase("en-US")===C.toLocaleLowerCase("en-US")))),s&&!i.some(C=>C.toLocaleLowerCase("en-US")===s.toLocaleLowerCase("en-US"))&&(a=a.concat([s])),a.sort().reduce((C,O)=>(C[O.toLocaleLowerCase("en-US")]=O,C),{})}const Ts=(0,Tr.Z)(i=>(0,So.Z)({root:{...i.typography.h4}}));function la(i){var t;const{initialFilter:s="component",allowedKinds:a}=i,h=Ts(),{allKinds:C}=useAllKinds(),{filters:O,updateFilters:F,queryParameters:{kind:oe}}=useEntityList(),be=useMemo(()=>[oe].flat()[0],[oe]);var Ie;const[He,ct]=useState((Ie=be!=null?be:(t=O.kind)===null||t===void 0?void 0:t.value)!==null&&Ie!==void 0?Ie:s);useEffect(()=>{be&&ct(be)},[be]),useEffect(()=>{var wt;if(!((wt=O.kind)===null||wt===void 0)&&wt.value){var Ht;ct((Ht=O.kind)===null||Ht===void 0?void 0:Ht.value)}},[O.kind]),useEffect(()=>{F({kind:He?new EntityKindFilter(He):void 0})},[He,F]);const xt=filterKinds(C,a,He);return _jsx(Select,{input:_jsx(InputBase,{}),value:He.toLocaleLowerCase("en-US"),onChange:wt=>ct(wt.target.value),classes:h,children:Object.keys(xt).map(wt=>_jsx(MenuItem,{value:wt,children:`${pluralize(xt[wt])}`},wt))})}var Ua=r(86359),Qn=r(95544),Rs=r(99688),Co=r(12231),wo=r(86136),jo=r(49378),vi=r(85256),to=r(80030),ts=r(61837),Is=r(79784),Ps=r(50758),Ls=r(31654),ns=r(43054),yi=r(65759),xi=r(49280),Os=r(96641);function ks(i){const{entity:t,loading:s,error:a}=(0,Os.ce)(),{allowed:h,loading:C,error:O}=Yo({permission:i,resourceRef:t?(0,bo.eE)(t):void 0});return s||C?{loading:!0,allowed:!1}:a?{loading:!1,allowed:!1,error:a}:{loading:!1,allowed:h,error:O}}const rs="catalog-entity",Eo=ir({name:"catalog.entity.read",attributes:{action:"read"},resourceType:rs}),bi=ir({name:"catalog.entity.create",attributes:{action:"create"}}),Bs=ir({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:rs}),$s=ir({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:rs}),Ds=ir({name:"catalog.location.read",attributes:{action:"read"}}),Si=ir({name:"catalog.location.create",attributes:{action:"create"}}),Ci=ir({name:"catalog.location.delete",attributes:{action:"delete"}}),ca=[Eo,bi,Bs,$s,Ds,Si,Ci];var Ns=r(49166);function wi(i){const{unregisterEntityOptions:t,isUnregisterAllowed:s,onUnregisterEntity:a,onClose:h}=i,C=typeof(t==null?void 0:t.disableUnregister)=="boolean";var O;const F=(O=!s||(C?!!(t!=null&&t.disableUnregister):(t==null?void 0:t.disableUnregister)==="disable"))!==null&&O!==void 0?O:!1;let oe=(0,p.jsx)(p.Fragment,{});return(t==null?void 0:t.disableUnregister)!=="hidden"&&(oe=(0,p.jsxs)(Co.Z,{onClick:()=>{h(),a()},disabled:F,children:[(0,p.jsx)(wo.Z,{children:(0,p.jsx)(Ns.Z,{fontSize:"small"})}),(0,p.jsx)(jo.Z,{primary:"Unregister entity"})]})),(0,p.jsx)(p.Fragment,{children:oe})}const Ao=(0,Tr.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Fs(i){const{UNSTABLE_extraContextMenuItems:t,UNSTABLE_contextMenuOptions:s,onUnregisterEntity:a,onInspectEntity:h}=i,[C,O]=(0,G.useState)(),F=Ao(),be=ks(Bs).allowed,Ie=Ht=>{O(Ht.currentTarget)},He=()=>{O(void 0)},ct=(0,g.h_)(g.$v),xt=(0,G.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>ct.post({message:"Copied!",severity:"info",display:"transient"}))},[ct]),wt=t&&[...t.map(Ht=>(0,p.jsxs)(Co.Z,{onClick:()=>{He(),Ht.onClick()},children:[(0,p.jsx)(wo.Z,{children:(0,p.jsx)(Ht.Icon,{fontSize:"small"})}),(0,p.jsx)(jo.Z,{primary:Ht.title})]},Ht.title)),(0,p.jsx)(vi.Z,{},"the divider is here!")];return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(to.ZP,{title:"More",arrow:!0,children:(0,p.jsx)(ts.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!C,role:"button",onClick:Ie,"data-testid":"menu-button",className:F.button,id:"long-menu",children:(0,p.jsx)(ns.Z,{})})}),(0,p.jsx)(Is.ZP,{open:Boolean(C),onClose:He,anchorEl:C,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,p.jsxs)(Ps.Z,{children:[wt,(0,p.jsx)(wi,{unregisterEntityOptions:s,isUnregisterAllowed:be,onUnregisterEntity:a,onClose:He}),(0,p.jsxs)(Co.Z,{onClick:()=>{He(),h()},children:[(0,p.jsx)(wo.Z,{children:(0,p.jsx)(Ls.Z,{fontSize:"small"})}),(0,p.jsx)(jo.Z,{primary:"Inspect entity"})]}),(0,p.jsxs)(Co.Z,{onClick:()=>{He(),xt()},children:[(0,p.jsx)(wo.Z,{children:(0,p.jsx)(yi.Z,{fontSize:"small"})}),(0,p.jsx)(jo.Z,{primary:"Copy entity URL"})]})]})})]})}const Zs="plugin.catalog.entityLayoutRoute",To=()=>null;(0,g.R5)(To,Zs,!0),(0,g.R5)(To,"core.gatherMountPoints",!0);function ji(i){const{entity:t,title:s}=i;return(0,p.jsxs)(Qn.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,p.jsx)(Qn.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:s}),t&&(0,p.jsx)(Bn.LH,{entity:t})]})}function Us(i,t,s,a){var h;const C=(h=i!=null?i:a==null?void 0:a.kind)!==null&&h!==void 0?h:"";var O;const F=(O=t!=null?t:a==null?void 0:a.metadata.namespace)!==null&&O!==void 0?O:"";var oe,be,Ie;return{headerTitle:`${(Ie=(be=(oe=a==null?void 0:a.metadata.title)!==null&&oe!==void 0?oe:s)!==null&&be!==void 0?be:a==null?void 0:a.metadata.name)!==null&&Ie!==void 0?Ie:""}${F&&F!==bo.zG?` in ${F}`:""}`,headerType:(()=>{let ct=C.toLocaleLowerCase("en-US");return a&&a.spec&&"type"in a.spec&&(ct+=" \u2014 ",ct+=a.spec.type.toLocaleLowerCase("en-US")),ct})()}}function Ms(i){var t;const{entity:s}=i,a=(0,Bn.hF)(s,bo.S4);return(0,p.jsxs)(p.Fragment,{children:[a.length>0&&(0,p.jsx)(K.i9,{label:"Owner",value:(0,p.jsx)(Bn.rI,{entityRefs:a,defaultKind:"Group",color:"inherit"})}),((t=s.spec)===null||t===void 0?void 0:t.lifecycle)&&(0,p.jsx)(K.i9,{label:"Lifecycle",value:s.spec.lifecycle})]})}const Kn=i=>{var t,s;const{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:h,children:C,NotFoundComponent:O}=i,{kind:F,namespace:oe,name:be}=(0,g.Oi)(Bn.wi),{entity:Ie,loading:He,error:ct}=(0,Bn.ce)(),xt=(0,V.TH)(),wt=(0,g.vJ)(C,Gi=>Gi.selectByComponentData({key:Zs,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Wr})=>{if(Ie){if(Wr.if&&!Wr.if(Ie))return[]}else return[];return[{path:Wr.path,title:Wr.title,children:Wr.children,tabProps:Wr.tabProps}]}),[Ie]),{headerTitle:Ht,headerType:Wt}=Us(F,oe,be,Ie),[Mn,tr]=(0,G.useState)(!1),[Ir,Po]=(0,G.useState)(!1),Ia=(0,V.s0)(),Hi=async()=>{tr(!1),Po(!1),Ia("/")};(0,G.useEffect)(()=>{tr(!1),Po(!1)},[xt.pathname]);var as;return(0,p.jsxs)(K.T3,{themeId:(as=Ie==null||(t=Ie.spec)===null||t===void 0||(s=t.type)===null||s===void 0?void 0:s.toString())!==null&&as!==void 0?as:"home",children:[(0,p.jsx)(K.h4,{title:(0,p.jsx)(ji,{title:Ht,entity:Ie}),pageTitleOverride:Ht,type:Wt,children:Ie&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Ms,{entity:Ie}),(0,p.jsx)(Fs,{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:h,onUnregisterEntity:()=>tr(!0),onInspectEntity:()=>Po(!0)})]})}),He&&(0,p.jsx)(K.Ex,{}),Ie&&(0,p.jsx)(K.tn,{routes:wt}),ct&&(0,p.jsx)(K.VY,{children:(0,p.jsx)(Rs.Z,{severity:"error",children:ct.toString()})}),!He&&!ct&&!Ie&&(0,p.jsx)(K.VY,{children:O||(0,p.jsxs)(K.GB,{title:"Entity not found",children:["There is no ",F," with the requested"," ",(0,p.jsx)(K.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,p.jsx)(Bn.pp,{open:Mn,entity:Ie,onConfirm:Hi,onClose:()=>tr(!1)}),(0,p.jsx)(Bn.U_,{open:Ir,entity:Ie,onClose:()=>Po(!1)})]})};Kn.Route=To;function da(i){const{open:t,onClose:s,onConfirm:a,entity:h}=i,[C,O]=useState(!1),F=useApi(catalogApiRef),oe=useApi(alertApiRef),be=async()=>{O(!0);try{const Ie=h.metadata.uid;await F.removeEntityByUid(Ie),a()}catch(Ie){assertError(Ie),oe.post({message:Ie.message})}finally{O(!1)}};return _jsxs(Dialog,{open:t,onClose:s,children:[_jsx(DialogTitle,{id:"responsive-dialog-title",children:"Are you sure you want to delete this entity?"}),_jsxs(DialogActions,{children:[_jsx(Button,{variant:"contained",color:"secondary",disabled:C,onClick:be,children:"Delete"}),_jsx(Button,{onClick:s,color:"primary",children:"Cancel"})]})]})}var no=r(19625);function ua(i){var t,s;return(i==null||(t=i.metadata)===null||t===void 0||(s=t.annotations)===null||s===void 0?void 0:s["backstage.io/orphan"])==="true"}function Ei(){const i=useNavigate(),t=useRouteRef(rootRouteRef),[s,a]=useState(!1),{entity:h}=useEntity(),C=async()=>{a(!1),i(t())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>a(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:s,entity:h,onConfirm:C,onClose:()=>a(!1)})]})}var Ai=r(4791);const ha=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function Ro(i,t){return{items:(await t.getEntityAncestors({entityRef:i})).items.map(h=>{var C,O;return{errors:((O=(C=h.entity.status)===null||C===void 0?void 0:C.items)!==null&&O!==void 0?O:[]).filter(ha).map(be=>be.error).filter(be=>Boolean(be)),entity:h.entity}}).filter(h=>h.errors.length>0)}}async function pa(i,t){const s=t.apis.get(catalogApiRef);if(!s)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Ro(stringifyEntityRef(i),s)).items.length>0}function fa(){const{entity:i}=useEntity(),t=stringifyEntityRef(i),s=useApi(catalogApiRef),{loading:a,error:h,value:C}=useAsync(async()=>Ro(t,s),[t,s]);return h?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:h})}):a||!C?null:_jsx(_Fragment,{children:C.items.map((O,F)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(O.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:O.entity})]}),O.errors.map((oe,be)=>_jsx(ResponseErrorPanel,{error:oe},be))]},F))})}const zs="core.backstage.entitySwitch",ro=i=>null;(0,g.R5)(ro,zs,!0);const Ti=i=>{var t;const{entity:s,loading:a}=(0,Bn.ce)(),h=(0,g.I_)(),C=(0,g.vJ)(i.children,oe=>oe.selectByComponentData({key:zs,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(be=>{if(a)return[];const{if:Ie,children:He}=be.props;return s?[{if:Ie==null?void 0:Ie(s,{apis:h}),children:He}]:[{if:Ie===void 0,children:He}]}),[h,s,a]);if(C.some(oe=>typeof oe.if=="object"&&"then"in oe.if))return(0,p.jsx)(Ri,{results:C,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const oe=C.filter(be=>be.if).map(be=>be.children);return oe.length===0?oo(C):(0,p.jsx)(p.Fragment,{children:oe})}var F;return(F=(t=C.find(oe=>oe.if))===null||t===void 0?void 0:t.children)!==null&&F!==void 0?F:oo(C)};function Ri({results:i,renderMultipleMatches:t}){const{loading:s,value:a}=(0,c.default)(async()=>{const h=i.map(async({if:O,children:F})=>{try{if(await O)return F}catch{}return null});if(t==="all"){const O=(await Promise.all(h)).filter(Boolean);return O.length===0?oo(i):(0,p.jsx)(p.Fragment,{children:O})}var C;return(C=(await Promise.all(h)).find(Boolean))!==null&&C!==void 0?C:oo(i)},[i]);return s||!a?null:a}function oo(i){var t,s;return(s=(t=i.filter(a=>a.if===void 0)[0])===null||t===void 0?void 0:t.children)!==null&&s!==void 0?s:null}Ti.Case=ro;const ga=null,Ma=Bn._i.Filters,za=Bn._i.Content;var ma=r(85877),va=r(15096);const Yn=(0,g.rx)({id:"catalog",apis:[(0,g.ni)({api:Bn.Ah,deps:{discoveryApi:g.NW,fetchApi:g.gP},factory:({discoveryApi:i,fetchApi:t})=>new Ai.MS({discoveryApi:i,fetchApi:t})}),(0,g.ni)({api:Bn.p3,deps:{storageApi:g.E6},factory:({storageApi:i})=>new es({storageApi:i})})],routes:{catalogIndex:no._Z,catalogEntity:Bn.wi},externalRoutes:{createComponent:no.yw,viewTechDoc:no.jU,createFromTemplate:no.ql},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),Ws=Yn.provide((0,g.P4)({name:"CatalogIndexPage",component:()=>r.e(9323).then(r.bind(r,89323)).then(i=>i.CatalogPage),mountPoint:no._Z})),os=Yn.provide((0,g.P4)({name:"CatalogEntityPage",component:()=>r.e(8951).then(r.bind(r,78951)).then(i=>i.CatalogEntityPage),mountPoint:Bn.wi})),ya=Yn.provide((0,g.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(r.bind(r,8799)).then(i=>i.AboutCard)}})),ss=Yn.provide((0,g.CO)({name:"EntityLinksCard",component:{lazy:()=>r.e(7750).then(r.bind(r,17750)).then(i=>i.EntityLinksCard)}})),xa=Yn.provide((0,g.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(r.bind(r,85877)).then(i=>i.EntityLabelsCard)}})),Vs=Yn.provide((0,g.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>r.e(5458).then(r.bind(r,5458)).then(i=>i.HasSystemsCard)}})),ba=Yn.provide((0,g.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>r.e(1105).then(r.bind(r,1105)).then(i=>i.HasComponentsCard)}})),Sa=Yn.provide((0,g.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>r.e(2440).then(r.bind(r,82440)).then(i=>i.HasSubcomponentsCard)}})),Ii=Yn.provide((0,g.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>r.e(9770).then(r.bind(r,79770)).then(i=>i.HasResourcesCard)}})),Ca=Yn.provide((0,g.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>r.e(9545).then(r.bind(r,19545)).then(i=>i.DependsOnComponentsCard)}})),Pi=Yn.provide((0,g.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>r.e(184).then(r.bind(r,40184)).then(i=>i.DependencyOfComponentsCard)}})),Wa=Yn.provide((0,g.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>r.e(1032).then(r.bind(r,81032)).then(i=>i.DependsOnResourcesCard)}})),Va=Yn.provide((0,g.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>r.e(732).then(r.bind(r,732)).then(i=>i.RelatedEntitiesCard)}})),Ha=Yn.provide((0,va.E5)({name:"CatalogSearchResultListItem",component:()=>r.e(7670).then(r.bind(r,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var Hs=r(32838);class Li{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(t,s){const h=`${await this.getApiOrigin()}/${s}`,C=await fetch(`${h.endsWith("/")?h:`${h}/`}index.html`);if(C.status===404)throw new Error("Page not found");return C.text()}async syncEntityDocs(t){return"cached"}async getBaseUrl(t,s,a){const h=await this.getApiOrigin();return new URL(t,`${h}/${a}`).toString()}constructor({configApi:t,discoveryApi:s,identityApi:a}){(0,Z._)(this,"configApi",void 0),(0,Z._)(this,"discoveryApi",void 0),(0,Z._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=s,this.identityApi=a}}class wa{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(t){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(t){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:t,discoveryApi:s,identityApi:a}){(0,Z._)(this,"configApi",void 0),(0,Z._)(this,"discoveryApi",void 0),(0,Z._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=s,this.identityApi=a}}const ja=[(0,g.ni)({api:te.Dl,deps:{configApi:g.Ds,discoveryApi:g.NW,identityApi:g.$4},factory:({configApi:i,discoveryApi:t,identityApi:s})=>new Li({configApi:i,discoveryApi:t,identityApi:s})}),(0,g.ni)({api:te.gT,deps:{configApi:g.Ds,discoveryApi:g.NW,identityApi:g.$4},factory:({configApi:i,discoveryApi:t,identityApi:s})=>new wa({configApi:i,discoveryApi:t,identityApi:s})}),(0,g.ni)({api:Hs.q3,deps:{configApi:g.Ds},factory:({configApi:i})=>Hs.ae.fromConfig(i)})],Oi={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},ki={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function Gs(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function Bi(){const i=await Ur(),t=await Gs();return[...i,{context:"detected",data:t?Oi:ki}]}var $i=r(58845);const Ea=(0,Tr.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var Ks=()=>{const i=Ea();return(0,p.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,p.jsx)("path",{className:i.path,d:"M302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Zm241-88.84q7.94,0,17.09.17t18.12,1a139.3,139.3,0,0,1,16.74,2.57,42.78,42.78,0,0,1,13.3,5.14,64.27,64.27,0,0,1,20.54,19.89Q662,168,662,186.54q0,19.54-9.49,33.78t-27.1,21.09v.68q22.78,4.82,34.87,20.58t12.08,38.4a72.62,72.62,0,0,1-4.83,26.06,65.29,65.29,0,0,1-14.33,22.46,71.57,71.57,0,0,1-23.47,15.78q-14,6-32.28,6H478.38V126.54Zm9,105.27q28,0,40.21-9.78t12.26-29.31q0-13-4.14-20.58a29.47,29.47,0,0,0-11.4-11.66A45,45,0,0,0,597,155.17a161.2,161.2,0,0,0-20.19-1.2h-65.6v77.84Zm16.57,112.13q21.74,0,34-11.66T639.59,300q0-12-4.48-19.88a34.85,34.85,0,0,0-11.91-12.52,50.14,50.14,0,0,0-17.09-6.52,105,105,0,0,0-20-1.88H511.17v84.7Zm274.79,26.74q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58A41.19,41.19,0,0,1,705,348.56q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.08-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7T736.6,249.29H707.26q.69-16.46,6.9-27.77a52.21,52.21,0,0,1,16.57-18.35,70,70,0,0,1,23.65-10.11A125.51,125.51,0,0,1,782.86,190a168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7A41.23,41.23,0,0,1,844,213.59q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-18,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.5,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14ZM1002.07,225q-11.05-9.25-29.69-9.26-15.89,0-26.58,5.83A47.29,47.29,0,0,0,928.71,237a64.66,64.66,0,0,0-9.15,22.12A119.83,119.83,0,0,0,916.8,285a98.22,98.22,0,0,0,2.93,24,64.18,64.18,0,0,0,9.15,20.74,46.2,46.2,0,0,0,16.23,14.58q10,5.49,23.82,5.48,21.75,0,34-11.31t15-31.89h30q-4.83,32.91-24.68,50.75t-54,17.83q-20.37,0-36.07-6.52A69.86,69.86,0,0,1,907,350.11a79.92,79.92,0,0,1-15.88-28.63A118.64,118.64,0,0,1,885.73,285a129.41,129.41,0,0,1,5.18-37.21,85.63,85.63,0,0,1,15.71-30.17A73.46,73.46,0,0,1,933,197.35Q948.91,190,970,190a108.54,108.54,0,0,1,28.48,3.6,69.59,69.59,0,0,1,23.48,11.15,61,61,0,0,1,16.74,19q6.55,11.49,8.29,27.26h-30.38Q1013.11,234.21,1002.07,225Zm109.77-98.41v145l81.47-77.49h39.36l-70.77,64.46,75.95,112.82h-37.29l-61.1-92.59-27.62,25.38v67.21H1082.5V126.54Zm170.54,205.22a31.07,31.07,0,0,0,10.87,10.63,49,49,0,0,0,15.19,5.66,87.06,87.06,0,0,0,17.44,1.71,109.18,109.18,0,0,0,14.5-1,53.22,53.22,0,0,0,14-3.78,26.27,26.27,0,0,0,10.53-8q4.14-5.32,4.14-13.55,0-11.31-8.63-17.14a73.69,73.69,0,0,0-21.58-9.43q-12.94-3.6-28.13-6.52a146,146,0,0,1-28.14-8.23A58.16,58.16,0,0,1,1261,267.13q-8.64-9.6-8.63-26.75,0-13.38,6-23a49.26,49.26,0,0,1,15.53-15.61,71.76,71.76,0,0,1,21.4-8.91A99.41,99.41,0,0,1,1319,190a141.31,141.31,0,0,1,28,2.58,64.85,64.85,0,0,1,22.62,8.91,46.16,46.16,0,0,1,15.7,17.15q5.87,10.8,6.91,26.91h-29.35q-.69-8.57-4.48-14.23a29.36,29.36,0,0,0-9.67-9.08,44.16,44.16,0,0,0-12.94-5,67.68,67.68,0,0,0-14.33-1.54,87.29,87.29,0,0,0-13.29,1,45.28,45.28,0,0,0-12.26,3.6,24.49,24.49,0,0,0-9,6.86q-3.46,4.29-3.46,11.14a16.32,16.32,0,0,0,5.36,12.52,42.75,42.75,0,0,0,13.63,8.23,120,120,0,0,0,18.64,5.48q10.37,2.24,20.72,4.63,11,2.4,21.57,5.83A70.74,70.74,0,0,1,1382,284.1a44.55,44.55,0,0,1,13.12,14.23q5,8.58,5,21.26,0,16.13-6.73,26.75a52.5,52.5,0,0,1-17.61,17.14,73.89,73.89,0,0,1-24.51,9.09,146.3,146.3,0,0,1-27.1,2.57,126.24,126.24,0,0,1-28.31-3.09A69.56,69.56,0,0,1,1272,361.94a51.74,51.74,0,0,1-16.57-18.52q-6.21-11.49-6.9-27.95h29.34A32.65,32.65,0,0,0,1282.38,331.76Zm226.46-137.67v25.72h-35.56V329.88a31.37,31.37,0,0,0,.87,8.23,8.42,8.42,0,0,0,3.28,4.8,14.61,14.61,0,0,0,6.73,2.23,99.19,99.19,0,0,0,11.22.51h13.46v25.72H1486.4a105.8,105.8,0,0,1-19.5-1.55,28.65,28.65,0,0,1-13.12-5.65,24.09,24.09,0,0,1-7.42-11.66q-2.43-7.54-2.42-19.89V219.81h-30.38V194.09h30.38V140.94h29.34v53.15ZM1699.4,370.68q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58,41.19,41.19,0,0,1-12.6-15.26q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.07-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7t-13.46,26.57h-29.34q.67-16.46,6.9-27.77A52.21,52.21,0,0,1,1562,203.17a70,70,0,0,1,23.65-10.11,125.51,125.51,0,0,1,28.48-3.09,168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7,41.23,41.23,0,0,1,15.53,14.89q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-17.95,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.51,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14Zm208.85,141.62q-20,21.6-62.83,21.6a122.11,122.11,0,0,1-25.37-2.74,78,78,0,0,1-23.48-8.92,54.41,54.41,0,0,1-17.43-16.11q-6.91-10-7.6-24.35h29.35a21.47,21.47,0,0,0,5,13.38,36.67,36.67,0,0,0,11.4,8.91,55.52,55.52,0,0,0,14.67,5,79.51,79.51,0,0,0,15.19,1.55q14.49,0,24.51-5A46,46,0,0,0,1840.59,401a56.53,56.53,0,0,0,9.49-21.09,117.46,117.46,0,0,0,2.94-27.09V341.19h-.7q-7.59,16.46-23,24.18a71.8,71.8,0,0,1-32.63,7.71q-20,0-34.86-7.2A72.88,72.88,0,0,1,1737,346.51a82.13,82.13,0,0,1-15-28.46,116.62,116.62,0,0,1-5-34.47,133.92,133.92,0,0,1,4.14-32.4A88.17,88.17,0,0,1,1735,221a75.49,75.49,0,0,1,25.55-22.29q15.87-8.75,39-8.75a66.21,66.21,0,0,1,31.07,7.38,52.13,52.13,0,0,1,22.09,22.11h.35V194.09h27.61V356.28Q1880.63,399.83,1860.61,421.43Zm-37.46-79.72a47.94,47.94,0,0,0,16.4-15.78,71.89,71.89,0,0,0,9.15-22.11,106.77,106.77,0,0,0,2.93-24.69,96.71,96.71,0,0,0-2.76-23,64,64,0,0,0-8.8-20.4,45.76,45.76,0,0,0-15.71-14.57q-9.66-5.49-23.47-5.49-14.16,0-24.17,5.32a46.77,46.77,0,0,0-16.4,14.23,60.14,60.14,0,0,0-9.32,20.57,99.69,99.69,0,0,0-2.93,24.35,120.63,120.63,0,0,0,2.42,24,67.5,67.5,0,0,0,8.28,21.77,46.37,46.37,0,0,0,15.54,15.78q9.66,6,24.16,6T1823.15,341.71Zm228,18.34q-20,15.09-50.41,15.09-21.4,0-37.11-6.86a73.16,73.16,0,0,1-26.41-19.2,81.52,81.52,0,0,1-16-29.49,141.12,141.12,0,0,1-6-37.38,106.1,106.1,0,0,1,6.21-37A88.56,88.56,0,0,1,1938.8,216a79.09,79.09,0,0,1,26.58-19.2A81.66,81.66,0,0,1,1999,190q23.82,0,39.53,9.78a78,78,0,0,1,25.2,24.86,98.18,98.18,0,0,1,13.12,32.91,140.6,140.6,0,0,1,2.93,34h-133.6a70,70,0,0,0,2.76,22.12,49.9,49.9,0,0,0,10,18.51A49.1,49.1,0,0,0,1976.6,345q10.7,4.82,25.2,4.8,18.65,0,30.55-8.57t15.71-26.06h29Q2071.18,345,2051.17,360.05Zm-7.08-113.84a50,50,0,0,0-10.7-16,53.1,53.1,0,0,0-56.62-10.63,47.48,47.48,0,0,0-15.71,10.81,51.69,51.69,0,0,0-10.35,15.94,60.18,60.18,0,0,0-4.49,19.37h102.53A59.47,59.47,0,0,0,2044.09,246.21ZM302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Z"})})};const Di=(0,Tr.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Ni=()=>{const i=Di();return(0,p.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,p.jsx)("path",{className:i.path,d:"M303,166.05a80.69,80.69,0,0,0,13.45-10.37c.79-.77,1.55-1.53,2.3-2.3a83.12,83.12,0,0,0,7.93-9.38A63.69,63.69,0,0,0,333,133.23a48.58,48.58,0,0,0,4.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56,0,78.3,115.23,0,190.25l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.22,49.22,0,0,0-6.8-8.87A89.17,89.17,0,0,0,259,178.29h.15a85.08,85.08,0,0,0,31-5.79A80.88,80.88,0,0,0,303,166.05ZM202.45,225.86c-19.32,18.51-50.4,21.23-75.7,5.9L51.61,186.15l67.45-64.64,76.41,46.38C223,184.58,221.49,207.61,202.45,225.86Zm8.93-82.22-70.65-42.89L205.14,39,274.51,81.1c25.94,15.72,29.31,37,10.55,55A60.69,60.69,0,0,1,211.38,143.64Zm29.86,190c-19.57,18.75-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,282.52v24.67L108.6,373.1a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.27,87.27,0,0,1,241.24,333.68Zm0-39c-19.57,18.75-46.17,29.08-74.88,29.08a123.81,123.81,0,0,1-64.1-18.19L0,243.53v24.68l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.5v-1.78A87.27,87.27,0,0,1,241.24,294.7Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.81,123.81,0,0,1-64.1-18.19L0,204.55v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.82A86.09,86.09,0,0,1,241.24,255.71Zm83.7,25.74a94.15,94.15,0,0,1-60.2,25.86h0V334a81.6,81.6,0,0,0,51.74-22.37c14-13.38,21.14-28.11,21-42.64v-2.19A94.92,94.92,0,0,1,324.94,281.45Zm-83.7,91.21c-19.57,18.76-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,321.5v24.68l108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A86.29,86.29,0,0,1,241.24,372.66ZM327,162.45c-.68.69-1.35,1.38-2.05,2.06a94.37,94.37,0,0,1-10.64,8.65,91.35,91.35,0,0,1-11.6,7,94.53,94.53,0,0,1-26.24,8.71,97.69,97.69,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a53.27,53.27,0,0,1,1.14,12V217h.05a84.41,84.41,0,0,0,25.35-5.55,81,81,0,0,0,26.39-16.82c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,172.17a48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08,1.54-2.25,3.09A96.73,96.73,0,0,1,327,162.45Zm0,77.92c-.69.7-1.31,1.41-2,2.1a94.2,94.2,0,0,1-60.2,25.86h0l0,26.67h0a81.6,81.6,0,0,0,51.74-22.37A73.51,73.51,0,0,0,333,250.13a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74,1.07-1.46,2.15-2.27,3.21A95.68,95.68,0,0,1,327,240.37Zm0-39c-.69.7-1.31,1.41-2,2.1a93.18,93.18,0,0,1-10.63,8.65,91.63,91.63,0,0,1-11.63,7,95.47,95.47,0,0,1-37.94,10.18h0V256h0a81.65,81.65,0,0,0,51.74-22.37c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,211.15a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.46,2.16-2.27,3.22A95.68,95.68,0,0,1,327,201.39Z"})})};const Ys=(0,Tr.Z)({root:{width:K.po.drawerWidthClosed,height:3*K.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:K.po.drawerWidthClosed,marginLeft:24}}),Fi=()=>{const i=Ys(),{isOpen:t}=(0,K.mZ)();return(0,p.jsx)("div",{className:i.root,children:(0,p.jsx)(K.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:t?(0,p.jsx)(Ks,{}):(0,p.jsx)(Ni,{})})})},Js=({children:i})=>(0,p.jsxs)(K.tR,{children:[(0,p.jsxs)(K.YE,{children:[(0,p.jsx)(Fi,{}),(0,p.jsx)(K.v7,{}),(0,p.jsx)(K.R6,{icon:$i.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var is=r(32388),Qs=r(4142);const Zi=(0,Tr.Z)(i=>({headerIcon:{color:i.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:i.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var cr;(function(i){i.LIGHT="light",i.DARK="dark"})(cr||(cr={}));const Ui=()=>{const i=(0,g.h_)(g.hg),t=Zi(),[s,a]=(0,G.useState)(i.getActiveThemeId()===cr.DARK?cr.DARK:cr.LIGHT),h={[cr.LIGHT]:{icon:Qs.Z,title:"Dark theme"},[cr.DARK]:{icon:is.Z,title:"Light theme"}},{title:C,icon:O}=h[s],F=()=>{a(oe=>{const be=oe===cr.LIGHT?cr.DARK:cr.LIGHT;return i.setActiveThemeId(be),be})};return(0,p.jsx)(Qn.Z,{display:"flex",alignItems:"center",mr:2,children:(0,p.jsx)(to.ZP,{title:C,arrow:!0,children:(0,p.jsx)(ts.Z,{size:"small",onClick:F,children:(0,p.jsx)(O,{className:t.headerIcon})})})})},Io=()=>(0,p.jsxs)(T.I6,{children:[(0,p.jsx)(ee.S,{}),(0,p.jsx)(I.F,{withSearch:!1})]}),Mi=(0,p.jsx)(Io,{}),Xs=_o({apis:ja,configLoader:Bi,plugins:Object.values(n)}),zi=Xs.getProvider(),Wi=Xs.getRouter(),_s=T.s4.provide((0,te.KY)({name:"ThemeToggleAddon",component:Ui,location:te.oZ.Header})),ei=(0,p.jsxs)(mo,{children:[(0,p.jsx)(V.Fg,{to:"/docs/default/component/local/"},"/"),(0,p.jsx)(V.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,p.jsx)(os,{})}),(0,p.jsx)(V.AW,{path:"/docs",element:(0,p.jsx)(T.Jl,{}),children:(0,p.jsx)(D.u,{})}),(0,p.jsxs)(V.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,p.jsx)(T.I6,{}),children:[Mi,(0,p.jsx)(te.DR,{children:(0,p.jsx)(_s,{})})]})]});var Vi=()=>(0,p.jsx)(zi,{children:(0,p.jsx)(Wi,{children:(0,p.jsx)(Js,{children:ei})})});f.render((0,p.jsx)(Vi,{}),document.getElementById("root"))},51837:function(vt,ke,r){"use strict";r.d(ke,{CT:function(){return g},EI:function(){return ye},uW:function(){return f},Vt:function(){return u}});function n(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const p=n(),G=le=>`__@backstage/${le}__`;function f(le,H){const ee=G(le);let I=p[ee];return I||(I=H(),p[ee]=I,I)}var V=r(2784);function g(le){return f(le,()=>(0,V.createContext)(void 0))}function u(le){return(0,V.useContext)(g(le))}function $(le){return{set(H){globalThis[`__@backstage/${le}__`]=createContext(createVersionedValueMap(H))},reset(){delete globalThis[`__@backstage/${le}__`]}}}function ye(le){Object.freeze(le);const H={atVersion(ee){return le[ee]}};return Object.defineProperty(H,"$map",{configurable:!0,enumerable:!0,get(){return le}}),H}},96641:function(vt,ke,r){"use strict";r.d(ke,{X2:function(){return ye},ce:function(){return le},h$:function(){return u}});var n=r(52322),p=r(25271),G=r(60871),f=r(51837),V=r(2784);const g=(0,f.CT)("entity-context"),u=H=>{const{children:ee,entity:I,loading:E,error:ie,refresh:ne}=H,re={entity:I,loading:E,error:ie,refresh:ne};return(0,n.jsx)(g.Provider,{value:(0,f.EI)({1:re}),children:(0,n.jsx)(G.fC,{attributes:{...I?{entityRef:(0,p.eE)(I)}:void 0},children:ee})})},$=H=>_jsx(u,{entity:H.entity,loading:!Boolean(H.entity),error:void 0,refresh:void 0,children:H.children});function ye(){const H=(0,f.Vt)("entity-context");if(!H)throw new Error("Entity context is not available");const ee=H.atVersion(1);if(!ee)throw new Error("EntityContext v1 not available");if(!ee.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:ee.entity}}function le(){const H=(0,f.Vt)("entity-context");if(!H)throw new Error("Entity context is not available");const ee=H.atVersion(1);if(!ee)throw new Error("EntityContext v1 not available");const{entity:I,loading:E,error:ie,refresh:ne}=ee;return{entity:I,loading:E,error:ie,refresh:ne}}},43514:function(vt,ke,r){"use strict";r.d(ke,{h$:function(){return et.h$},n3:function(){return n.n3},_i:function(){return N},tW:function(){return rr},df:function(){return Je},UO:function(){return Ee},ph:function(){return Ko},dq:function(){return Q},nl:function(){return Go},dx:function(){return Qe},rI:function(){return yt},u3:function(){return Fn},xE:function(){return Zn},sL:function(){return Un},LH:function(){return S},U_:function(){return ri},pp:function(){return vs},EW:function(){return Xr},Ah:function(){return G},wi:function(){return xe},hF:function(){return te.hF},CV:function(){return te.CV},$3:function(){return X},p3:function(){return f},ce:function(){return et.ce},X2:function(){return et.X2},wp:function(){return at},ZW:function(){return en},eK:function(){return an},CR:function(){return fn}});var n=r(4791),p=r(60871);const G=(0,p.T0)({id:"plugin.catalog.service"}),f=(0,p.T0)({id:"catalog-react.starred-entities"});var V=r(82394);class g{async toggleStarred(j){this.starredEntities.delete(j)||this.starredEntities.add(j);for(const R of this.subscribers)R.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){_define_property(this,"starredEntities",new Set),_define_property(this,"subscribers",new Set),_define_property(this,"observable",new ObservableImpl(j=>(j.next(new Set(this.starredEntities)),this.subscribers.add(j),()=>{this.subscribers.delete(j)})))}}var u=r(52322),$=r(2784),ye=r(41156),le=r(60364),H=r(77277),ee=r(4190),I=r(95544),E=r(90436),ie=r(60905),ne=r(36444);const re=b=>{const j=(0,ye.Z)(he=>he.breakpoints.down("md")),R=(0,le.Z)(),[B,K]=(0,$.useState)(!1);return j?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(H.Z,{style:{marginTop:R.spacing(1),marginLeft:R.spacing(1)},onClick:()=>K(!0),startIcon:(0,u.jsx)(ne.Z,{}),children:"Filters"}),(0,u.jsx)(ee.ZP,{open:B,onClose:()=>K(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,u.jsxs)(I.Z,{m:2,children:[(0,u.jsx)(E.Z,{variant:"h6",component:"h2",style:{marginBottom:R.spacing(1)},children:"Filters"}),b.children]})})]}):(0,u.jsx)(ie.Z,{item:!0,lg:2,children:b.children})},D=b=>(0,u.jsx)(ie.Z,{item:!0,xs:12,lg:10,children:b.children}),N=b=>(0,u.jsx)(ie.Z,{container:!0,style:{position:"relative"},children:b.children});N.Filters=re,N.Content=D;var P=r(53974),T=r(87612),k=r(25271),te=r(49280);class Te{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(j){(0,T._)(this,"value",void 0),this.value=j}}class Ne{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(j){(0,T._)(this,"value",void 0),this.value=j}}class Z{filterEntity(j){var R;return this.values.every(B=>((R=j.metadata.tags)!==null&&R!==void 0?R:[]).includes(B))}toQueryValue(){return this.values}constructor(j){(0,T._)(this,"values",void 0),this.values=j}}class Xe{filterEntity(j){const R=this.toUpperArray(this.value.split(/\s/)),B=this.toUpperArray([j.metadata.tags]),K=this.toUpperArray([j.metadata.name,j.metadata.title]);for(const he of R)if(B.every(ce=>ce!==he)&&K.every(ce=>!ce.includes(he)))return!1;return!0}toUpperArray(j){return j.flat().filter(R=>Boolean(R)).map(R=>R.toLocaleUpperCase("en-US"))}constructor(j){_define_property(this,"value",void 0),this.value=j}}class rt{filterEntity(j){return this.values.some(R=>(0,te.hF)(j,k.S4).some(B=>(0,k.eE)(B)===R))}toQueryValue(){return this.values}constructor(j){(0,T._)(this,"values",void 0),this.values=j.reduce((R,B)=>{try{return R.push((0,k.eE)((0,k.of)(B,{defaultKind:"Group"}))),R}catch{return R}},[])}}class Et{filterEntity(j){return this.values.some(R=>{var B;return((B=j.spec)===null||B===void 0?void 0:B.lifecycle)===R})}toQueryValue(){return this.values}constructor(j){(0,T._)(this,"values",void 0),this.values=j}}class Lt{filterEntity(j){return this.values.some(R=>j.metadata.namespace===R)}toQueryValue(){return this.values}constructor(j){(0,T._)(this,"values",void 0),this.values=j}}class lt{filterEntity(j){switch(this.value){case"owned":return this.isOwnedEntity(j);case"starred":return this.isStarredEntity(j);default:return!0}}toQueryValue(){return this.value}constructor(j,R,B){(0,T._)(this,"value",void 0),(0,T._)(this,"isOwnedEntity",void 0),(0,T._)(this,"isStarredEntity",void 0),this.value=j,this.isOwnedEntity=R,this.isStarredEntity=B}}class Ft{filterEntity(j){var R;const B=(R=j.metadata.annotations)===null||R===void 0?void 0:R["backstage.io/orphan"];return B!==void 0&&this.value.toString()===B}constructor(j){(0,T._)(this,"value",void 0),this.value=j}}class Zt{filterEntity(j){var R,B;const K=(j==null||(R=j.status)===null||R===void 0||(B=R.items)===null||B===void 0?void 0:B.length)>0;return K!==void 0&&this.value===K}constructor(j){(0,T._)(this,"value",void 0),this.value=j}}var et=r(96641),pt=r(76635),ft=r(19126),jt=r.n(ft),kt=r(73557),qt=r(69294),de=r(48760),ve=r(90736);const ze=(0,$.createContext)(void 0),Ee=b=>{const j=(0,ve.default)(),R=(0,p.h_)(G),[B,K]=(0,$.useState)({}),he=(0,kt.TH)();var ce;const Ce=(0,$.useMemo)(()=>(ce=jt().parse(he.search,{ignoreQueryPrefix:!0}).filters)!==null&&ce!==void 0?ce:{},[he]),[Oe,Re]=(0,$.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:Ze,error:De},gt]=(0,qt.default)(async()=>{const $e=(0,pt.compact)(Object.values(B)),it=(0,te.Gz)($e),Nt=(0,te.wq)($e),vn=(0,te.wq)((0,pt.compact)(Object.values(Oe.appliedFilters))),mt=Object.keys(B).reduce((Rt,Xt)=>{const En=B[Xt];return En!=null&&En.toQueryValue&&(Rt[Xt]=En.toQueryValue()),Rt},{});if((0,pt.isEqual)(vn,Nt))Re({appliedFilters:B,backendEntities:Oe.backendEntities,entities:Oe.backendEntities.filter(it)});else{const Rt=await R.getEntities({filter:Nt});Re({appliedFilters:B,backendEntities:Rt.items,entities:Rt.items.filter(it)})}if(j()){var zt;const Rt=jt().parse(he.search,{ignoreQueryPrefix:!0}),Xt=jt().stringify({...Rt,filters:mt},{addQueryPrefix:!0,arrayFormat:"repeat"}),En=`${window.location.pathname}${Xt}`;(zt=window.history)===null||zt===void 0||zt.replaceState(null,document.title,En)}},[R,Ce,B,Oe],{loading:!0});(0,de.Z)(gt,10,[B]);const ht=(0,$.useCallback)($e=>{K(it=>{const Nt=typeof $e=="function"?$e(it):$e;return{...it,...Nt}})},[]),st=(0,$.useMemo)(()=>({filters:Oe.appliedFilters,entities:Oe.entities,backendEntities:Oe.backendEntities,updateFilters:ht,queryParameters:Ce,loading:Ze,error:De}),[Oe,ht,Ce,Ze,De]);return(0,u.jsx)(ze.Provider,{value:st,children:b.children})};function at(){const b=(0,$.useContext)(ze);if(!b)throw new Error("useEntityList must be used within EntityListProvider");return b}var bt=r(64279),dt=r(18149),Bt=r.n(dt),St=r(829),Gt=r.n(St);function $t(){const b=(0,p.h_)(G),{filters:{kind:j,type:R},queryParameters:{type:B},updateFilters:K}=at(),he=(0,$.useMemo)(()=>[B].flat().filter(Boolean),[B]);var ce;const[Ce,Oe]=(0,$.useState)(he.length?he:(ce=R==null?void 0:R.getTypes())!==null&&ce!==void 0?ce:[]);(0,$.useEffect)(()=>{he.length&&Oe(he)},[he]);const[Re,Ze]=(0,$.useState)([]),De=(0,$.useMemo)(()=>j==null?void 0:j.value,[j]),{error:gt,loading:ht,value:st}=(0,bt.default)(async()=>De?await b.getEntityFacets({filter:{kind:De},facets:["spec.type"]}).then(Nt=>Nt.facets["spec.type"]||[]):[],[De,b]),$e=(0,$.useRef)(st);return(0,$.useEffect)(()=>{const it=$e.current;if($e.current=st,ht||!De||it===st||!st)return;const Nt=[...new Set(Gt()(st,mt=>-mt.count).map(mt=>mt.value.toLocaleLowerCase("en-US")))];Ze(Nt);const vn=Ce.filter(mt=>Nt.includes(mt));Bt()(Ce,vn)||Oe(vn)},[ht,De,Ce,Oe,st]),(0,$.useEffect)(()=>{K({type:Ce.length?new Ne(Ce):void 0})},[Ce,K]),{loading:ht,error:gt,availableTypes:Re,selectedTypes:Ce,setSelectedTypes:Oe}}const pn=20;function an(b,j){var R,B;const K=j==null||(R=j.type)===null||R===void 0?void 0:R.toLocaleLowerCase("en-US"),he=j==null||(B=j.kind)===null||B===void 0?void 0:B.toLocaleLowerCase("en-US"),ce=(0,p.h_)(G),{loading:Ce,value:Oe,error:Re}=(0,bt.default)(async()=>{var Ze;const De=(Ze=b.relations)===null||Ze===void 0?void 0:Ze.map($e=>({type:$e.type,target:(0,k.of)($e.targetRef)})).filter($e=>(!K||$e.type.toLocaleLowerCase("en-US")===K)&&(!he||$e.target.kind===he));if(!De)return[];const gt=Object.values((0,pt.groupBy)(De,({target:$e})=>`${$e.kind}:${$e.namespace}`.toLocaleLowerCase("en-US"))),ht=[];for(const $e of gt)ht.push({kind:$e[0].target.kind,namespace:$e[0].target.namespace,nameBatches:(0,pt.chunk)($e.map(it=>it.target.name),pn)});return(await Promise.all(ht.flatMap($e=>$e.nameBatches.map(it=>ce.getEntities({filter:{kind:$e.kind,"metadata.namespace":$e.namespace,"metadata.name":it}}))))).flatMap($e=>$e.items)},[b,K,he]);return{entities:Oe,loading:Ce,error:Re}}var dn=r(72164);function _t(b){return typeof b=="string"?b:(0,k.eE)(b)}function fn(){const b=(0,p.h_)(f),j=(0,dn.Z)(b.starredEntitie$(),new Set),R=(0,$.useCallback)(K=>j.has(_t(K)),[j]),B=(0,$.useCallback)(K=>b.toggleStarred(_t(K)).then(),[b]);return{starredEntities:j,toggleStarredEntity:B,isStarredEntity:R}}function Yt(b){return typeof b=="string"?b:(0,k.eE)(b)}function nn(b){const j=(0,p.h_)(f),[R,B]=(0,$.useState)(!1);return(0,$.useEffect)(()=>{const he=j.starredEntitie$().subscribe({next(ce){B(ce.has(Yt(b)))}});return()=>{he.unsubscribe()}},[b,j]),{toggleStarredEntity:(0,$.useCallback)(()=>j.toggleStarred(Yt(b)).then(),[b,j]),isStarredEntity:R}}var jn=r(75435);function en(){const b=(0,p.h_)(p.$4),{loading:j,value:R}=(0,bt.default)(async()=>{const{ownershipEntityRefs:K}=await b.getBackstageIdentity();return K},[]),B=(0,$.useMemo)(()=>{const K=new Set(R!=null?R:[]);return he=>{const ce=(0,jn.h)(he,k.S4).map(k.eE);for(const Ce of ce)if(K.has(Ce))return!0;return!1}},[R]);return(0,$.useMemo)(()=>({loading:j,isOwnedEntity:B}),[j,B])}function bn(){const b=(0,p.h_)(G),{error:j,loading:R,value:B}=(0,bt.default)(async()=>await b.getEntityFacets({facets:["kind"]}).then(he=>{var ce;return((ce=he.facets.kind)===null||ce===void 0?void 0:ce.map(Ce=>Ce.value).sort())||[]}),[b]);return{loading:R,error:j,allKinds:B!=null?B:[]}}function $n(b,j,R){let B=b;return j&&(B=B.filter(he=>j.some(ce=>ce.toLocaleLowerCase("en-US")===he.toLocaleLowerCase("en-US")))),R&&!b.some(he=>he.toLocaleLowerCase("en-US")===R.toLocaleLowerCase("en-US"))&&(B=B.concat([R])),B.sort().reduce((he,ce)=>(he[ce.toLocaleLowerCase("en-US")]=ce,he),{})}function tt(b){var j;const{filters:R,queryParameters:{kind:B},updateFilters:K}=at(),he=(0,$.useMemo)(()=>[B].flat()[0],[B]);var ce;const[Ce,Oe]=(0,$.useState)((ce=he!=null?he:(j=R.kind)===null||j===void 0?void 0:j.value)!==null&&ce!==void 0?ce:b.initialFilter);(0,$.useEffect)(()=>{he&&Oe(he)},[he]),(0,$.useEffect)(()=>{var gt;if(!((gt=R.kind)===null||gt===void 0)&&gt.value){var ht;Oe((ht=R.kind)===null||ht===void 0?void 0:ht.value)}},[R.kind]),(0,$.useEffect)(()=>{K({kind:Ce?new Te(Ce):void 0})},[Ce,K]);const{allKinds:Re,loading:Ze,error:De}=bn();return{loading:Ze,error:De,allKinds:Re!=null?Re:[],selectedKind:Ce,setSelectedKind:Oe}}const rr=b=>{const{allowedKinds:j,hidden:R,initialFilter:B="component"}=b,K=(0,p.h_)(p.$v),{error:he,allKinds:ce,selectedKind:Ce,setSelectedKind:Oe}=tt({initialFilter:B});if((0,$.useEffect)(()=>{he&&K.post({message:"Failed to load entity kinds",severity:"error"})},[he,K]),he)return null;const Re=$n(ce,j,Ce),Ze=Object.keys(Re).map(De=>({value:De,label:Re[De]}));return R?null:(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsx)(P.Ph,{label:"Kind",items:Ze,selected:Ce.toLocaleLowerCase("en-US"),onChange:De=>Oe(String(De))})})};var Ct=r(79692),nt=r(38016),Tn=r(88013),Jt=r(21324),Rn=r(5806),Dn=r(19996),Sn=r(25505);const Nn=(0,u.jsx)(Sn.Z,{fontSize:"small"}),Se=(0,u.jsx)(Dn.Z,{fontSize:"small"});function ae({selected:b}){return(0,u.jsx)(Jt.Z,{icon:Nn,checkedIcon:Se,checked:b})}const Le=(0,$.memo)(b=>{const{selected:j,value:R,availableOptions:B,showCounts:K}=b,he=K?`${R} (${B==null?void 0:B[R]})`:R;return(0,u.jsx)(Rn.Z,{control:(0,u.jsx)(ae,{selected:j}),label:he,onClick:ce=>ce.preventDefault()})});var Me=r(86619),Ge=r(72779),se=r.n(Ge);const M=(0,Ct.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function me(b){const j=M();return(0,u.jsx)(Me.Z,{variant:"outlined",...b,className:se()(j.input,b.className)})}function Be(b){var j;const{label:R,name:B,path:K,showCounts:he,Filter:ce,InputProps:Ce,initialSelectedOptions:Oe=[]}=b,{updateFilters:Re,filters:Ze,queryParameters:{[B]:De}}=at(),gt=(0,p.h_)(G),{value:ht}=(0,bt.default)(async()=>{var Rt;const Xt=K,{facets:En}=await gt.getEntityFacets({facets:[Xt],filter:(Rt=Ze.kind)===null||Rt===void 0?void 0:Rt.getCatalogFilters()});return Object.fromEntries(En[Xt].map(({value:Er,count:Ar})=>[Er,Ar]))},[Ze.kind]),st=(0,$.useMemo)(()=>[De].flat().filter(Boolean),[De]);var $e;const[it,Nt]=(0,$.useState)(st.length?st:($e=(j=Ze[B])===null||j===void 0?void 0:j.values)!==null&&$e!==void 0?$e:Oe);(0,$.useEffect)(()=>{st.length&&Nt(st)},[st]);const vn=Object.keys(ht!=null?ht:{}),mt=it.length&&vn.length;(0,$.useEffect)(()=>{Re({[B]:mt?new ce(it):void 0})},[B,mt,it,ce,Re]);const zt=Ze[B];return zt&&typeof zt=="object"&&!("values"in zt)||!vn.length||vn.length<=1?null:(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsxs)(E.Z,{variant:"button",component:"label",children:[R,(0,u.jsx)(Tn.ZP,{multiple:!0,disableCloseOnSelect:!0,options:vn,value:it,onChange:(Rt,Xt)=>Nt(Xt),renderOption:(Rt,{selected:Xt})=>(0,u.jsx)(Le,{selected:Xt,value:Rt,availableOptions:ht,showCounts:!!he}),size:"small",popupIcon:(0,u.jsx)(nt.Z,{"data-testid":`${String(B)}-picker-expand`}),renderInput:Rt=>(0,u.jsx)(me,{...Rt,...Ce})})]})})}const Ye=(0,Ct.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),Je=b=>{const{initialFilter:j=[]}=b,R=Ye();return(0,u.jsx)(Be,{label:"Lifecycle",name:"lifecycles",path:"spec.lifecycle",Filter:Et,InputProps:{className:R.input},initialSelectedOptions:j})};var Dt=r(6232),Kt=r(98685),tn=r(62367),Qt=r(72579),gn=r.n(Qt);function X(b,j){const R=j==null?void 0:j.defaultKind;let B,K,he;return"metadata"in b?(B=b.kind,K=b.metadata.namespace,he=b.metadata.name):(B=b.kind,K=b.namespace,he=b.name),(K===void 0||K==="")&&(K=k.zG),(j==null?void 0:j.defaultNamespace)!==void 0?(j==null?void 0:j.defaultNamespace)===K&&(K=void 0):K===k.zG&&(K=void 0),B=B.toLocaleLowerCase("en-US"),B=R&&R.toLocaleLowerCase("en-US")===B?void 0:B,`${B?`${B}:`:""}${K?`${K}/`:""}${he}`}function q(b,j){for(const R of["spec.profile.displayName","metadata.title"]){const B=gn()(b,R);if(B&&typeof B=="string")return B}return j}const _=(0,Ct.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),v=(0,u.jsx)(Sn.Z,{fontSize:"small"}),L=(0,u.jsx)(Dn.Z,{fontSize:"small"}),Q=()=>{var b,j;const R=_(),{updateFilters:B,filters:K,queryParameters:{owners:he}}=at(),ce=(0,p.h_)(G),[Ce,Oe]=(0,$.useState)(""),[{value:Re,loading:Ze},De]=(0,qt.default)(async mt=>{const zt=mt,Rt=mt,Xt=20;if(Rt.cursor){const En=await ce.queryEntities({cursor:Rt.cursor,limit:Xt});return{...En,items:[...Rt.prev,...En.items]}}return ce.queryEntities({fullTextFilter:{term:zt.text||"",fields:["metadata.name","kind","spec.profile.displayname","metadata.title"]},filter:{kind:["User","Group"]},orderFields:[{field:"metadata.name",order:"asc"}],limit:Xt})},[Ce]);(0,Dt.b)(()=>De({text:Ce}),[Ce],250);const gt=(Re==null?void 0:Re.items)||[],ht=(0,$.useMemo)(()=>[he].flat().filter(Boolean),[he]);var st;const[$e,it]=(0,$.useState)(ht.length?ht:(st=(b=K.owners)===null||b===void 0?void 0:b.values)!==null&&st!==void 0?st:[]),{getEntity:Nt,setEntity:vn}=W($e);return(0,$.useEffect)(()=>{if(ht.length){const mt=new rt(ht);it(mt.values)}},[ht]),(0,$.useEffect)(()=>{B({owners:$e.length?new rt($e):void 0})},[$e,B]),["user","group"].includes(((j=K.kind)===null||j===void 0?void 0:j.value.toLocaleLowerCase("en-US"))||"")?null:(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsxs)(E.Z,{variant:"button",component:"label",children:["Owner",(0,u.jsx)(Tn.ZP,{multiple:!0,disableCloseOnSelect:!0,loading:Ze,options:gt,value:$e,getOptionSelected:(mt,zt)=>typeof zt=="string"?(0,k.eE)(mt)===zt:mt===zt,getOptionLabel:mt=>{const zt=typeof mt=="string"&&Nt(mt)||mt;return typeof zt=="string"?zt:q(zt,zt.metadata.name)},onChange:(mt,zt)=>{Oe(""),it(zt.map(Rt=>{const Xt=typeof Rt=="string"?Rt:(0,k.eE)(Rt);return typeof Rt!="string"&&vn(Rt),Xt}))},filterOptions:mt=>mt,renderOption:(mt,{selected:zt})=>{const Rt=mt.kind==="Group";return(0,u.jsx)(Rn.Z,{control:(0,u.jsx)(Jt.Z,{icon:v,checkedIcon:L,checked:zt}),onClick:Xt=>Xt.preventDefault(),label:(0,u.jsxs)(I.Z,{display:"flex",flexWrap:"wrap",alignItems:"center",children:[Rt?(0,u.jsx)(tn.Z,{fontSize:"small"}):(0,u.jsx)(Kt.Z,{fontSize:"small"}),"\xA0",q(mt,mt.metadata.name)]})})},size:"small",popupIcon:(0,u.jsx)(nt.Z,{"data-testid":"owner-picker-expand"}),renderInput:mt=>(0,u.jsx)(Me.Z,{...mt,className:R.input,onChange:zt=>{Oe(zt.currentTarget.value)},variant:"outlined"}),ListboxProps:{onScroll:mt=>{const zt=mt.currentTarget;Math.abs(zt.scrollHeight-zt.clientHeight-zt.scrollTop)<1&&(Re!=null&&Re.pageInfo.nextCursor)&&De({cursor:Re.pageInfo.nextCursor,prev:Re.items})},"data-testid":"owner-picker-listbox"}})]})})};function W(b){const j=(0,$.useRef)({}),R=(0,p.h_)(G);return(0,bt.default)(async()=>{if(b.length===0)return;(await R.getEntitiesByRefs({entityRefs:b})).items.forEach(K=>{K&&(j.current[(0,k.eE)(K)]=K)})},[]),{getEntity:B=>j.current[B],setEntity:B=>{j.current[(0,k.eE)(B)]=B}}}var ue=r(51837);const xe=(0,ue.uW)("catalog:entity-route-ref",()=>(0,p.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function Ve(b){var j,R;return{kind:b.kind.toLocaleLowerCase("en-US"),namespace:(R=(j=b.metadata.namespace)===null||j===void 0?void 0:j.toLocaleLowerCase("en-US"))!==null&&R!==void 0?R:DEFAULT_NAMESPACE,name:b.metadata.name}}var _e=r(80030);const Qe=(0,$.forwardRef)((b,j)=>{const{entityRef:R,defaultKind:B,title:K,children:he,...ce}=b,Ce=(0,p.tg)(xe);let Oe,Re,Ze;if(typeof R=="string"){const $e=(0,k.of)(R);Oe=$e.kind,Re=$e.namespace,Ze=$e.name}else"metadata"in R?(Oe=R.kind,Re=R.metadata.namespace,Ze=R.metadata.name):(Oe=R.kind,Re=R.namespace,Ze=R.name);Oe=Oe.toLocaleLowerCase("en-US");var De;Re=(De=Re==null?void 0:Re.toLocaleLowerCase("en-US"))!==null&&De!==void 0?De:k.zG;const gt={kind:Oe,namespace:Re,name:Ze},ht=X({kind:Oe,namespace:Re,name:Ze},{defaultKind:B}),st=(0,u.jsxs)(P.rU,{...ce,ref:j,to:Ce(gt),children:[he,!he&&(K!=null?K:ht)]});return K?(0,u.jsx)(_e.ZP,{title:ht,children:st}):st});function At(b){const{entityRefs:j,defaultKind:R,getTitle:B,...K}=b,he=(0,p.h_)(G),{value:ce=new Array,loading:Ce,error:Oe}=(0,bt.default)(async()=>{const Re=j.reduce((De,gt)=>typeof gt=="object"&&"metadata"in gt?De:[...De,(0,k.of)(gt)],new Array),Ze=j.filter(De=>typeof De=="object"&&"metadata"in De);return Re.length>0?[...(await he.getEntities({filter:Re.map(De=>({kind:De.kind,"metadata.namespace":De.namespace,"metadata.name":De.name}))})).items,...Ze]:Ze},[j]);return Ce?(0,u.jsx)(P.Ex,{}):Oe?(0,u.jsx)(P.yu,{error:Oe}):(0,u.jsx)(u.Fragment,{children:ce.map((Re,Ze)=>(0,u.jsxs)($.Fragment,{children:[Ze>0&&", ",(0,u.jsx)(Qe,{...K,defaultKind:R,entityRef:Re,title:B(Re)})]},Ze))})}function yt(b){const{entityRefs:j,defaultKind:R,fetchEntities:B,getTitle:K,...he}=b;return B?(0,u.jsx)(At,{...he,defaultKind:R,entityRefs:j,getTitle:K}):(0,u.jsx)(u.Fragment,{children:j.map((ce,Ce)=>(0,u.jsxs)($.Fragment,{children:[Ce>0&&", ",(0,u.jsx)(Qe,{...he,defaultKind:R,entityRef:ce,title:K?K(ce):void 0})]},Ce))})}const ot=b=>{const j=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:j(getCompoundEntityRef(b.entity)),children:_jsx(InfoIcon,{})})},Fe=b=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${b.email}`,to:`mailto:${b.email}`,children:_jsx(EmailIcon,{})}),Ut=b=>{var j;const R=(j=b.entity.spec.profile)===null||j===void 0?void 0:j.email;return R?_jsx(EmailCardAction,{email:R}):null},rn=b=>{var j;const R=(j=b.entity.spec.profile)===null||j===void 0?void 0:j.email;return R?_jsx(EmailCardAction,{email:R}):null},It=(0,Ct.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),Ot=4,mn=b=>{var j,R,B;const{entityRef:K,children:he,delayTime:ce=500}=b,Ce=It(),Oe=useApiHolder(),Re=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[Ze,De]=useState(!1),gt=useMemo(()=>debounce(()=>De(!0),ce),[ce]),[{loading:ht,error:st,value:$e},it]=useAsyncFn(async()=>{const vn=Oe.get(catalogApiRef);if(vn){const mt=await vn.getEntityByRef(K);if(!mt)throw new Error(`${K} not found`);return mt}},[Oe,K]),Nt=()=>{De(!1),gt.cancel()};return useEffect(()=>{Re.isOpen&&!$e&&!st&&!ht&&it()},[Re.isOpen,it,$e,st,ht]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:gt,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Re),children:he})}),Ze&&_jsx(HoverPopover,{PaperProps:{className:Ce.popoverPaper},...bindPopover(Re),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:Nt,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[st&&_jsx(ResponseErrorPanel,{error:st}),ht&&_jsx(Progress,{}),$e&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:$e.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:$e.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:$e.kind}),$e.metadata.description&&_jsx(Typography,{className:Ce.descriptionTypography,paragraph:!0,children:$e.metadata.description}),_jsx(Typography,{children:(j=$e.spec)===null||j===void 0?void 0:j.type}),_jsxs(Box,{marginTop:"0.5em",children:[($e.metadata.tags||[]).slice(0,Ot).map(vn=>_jsx(Chip,{size:"small",label:vn},vn)),((R=$e.metadata.tags)===null||R===void 0?void 0:R.length)&&((B=$e.metadata.tags)===null||B===void 0?void 0:B.length)>Ot&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!st&&$e&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity($e)&&_jsx(UserCardActions,{entity:$e}),isGroupEntity($e)&&_jsx(GroupCardActions,{entity:$e}),_jsx(EntityCardActions,{entity:$e})]})})]})})]})},un=(0,Ct.Z)(b=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),ut=()=>{var b;const j=un(),{filters:R,updateFilters:B}=useEntityList();var K;const[he,ce]=useState((K=(b=R.text)===null||b===void 0?void 0:b.value)!==null&&K!==void 0?K:"");return useDebounce(()=>{B({text:he.length?new EntityTextFilter(he):void 0})},250,[he,B]),_jsx(Toolbar,{className:j.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:j.input,placeholder:"Search",autoComplete:"off",onChange:Ce=>ce(Ce.target.value),value:he,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>ce(""),edge:"end",disabled:he.length===0,children:_jsx(Clear,{})})})})})})},We=Object.freeze({createEntityRefColumn(b){const{defaultKind:j}=b;function R(B){var K;return((K=B.metadata)===null||K===void 0?void 0:K.title)||X(B,{defaultKind:j})}return{title:"Name",highlight:!0,customFilterAndSearch(B,K){return R(K).includes(B)},customSort(B,K){return R(B).localeCompare(R(K))},render:B=>{var K;return(0,u.jsx)(Qe,{entityRef:B,defaultKind:j,title:(K=B.metadata)===null||K===void 0?void 0:K.title})}}},createEntityRelationColumn(b){const{title:j,relation:R,defaultKind:B,filter:K}=b;function he(Ce){return(0,te.hF)(Ce,R,K)}function ce(Ce){return he(Ce).map(Oe=>X(Oe,{defaultKind:B})).join(", ")}return{title:j,customFilterAndSearch(Ce,Oe){return ce(Oe).includes(Ce)},customSort(Ce,Oe){return ce(Ce).localeCompare(ce(Oe))},render:Ce=>(0,u.jsx)(yt,{entityRefs:he(Ce),defaultKind:B})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:k.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:k.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:k.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:b=>(0,u.jsx)(P.Or,{text:b.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),Tt=[We.createEntityRefColumn({defaultKind:"system"}),We.createDomainColumn(),We.createOwnerColumn(),We.createMetadataDescriptionColumn()],hn=[We.createEntityRefColumn({defaultKind:"component"}),We.createSystemColumn(),We.createOwnerColumn(),We.createSpecTypeColumn(),We.createSpecLifecycleColumn(),We.createMetadataDescriptionColumn()],on=(0,Ct.Z)(b=>({empty:{padding:b.spacing(2),display:"flex",justifyContent:"center"}})),Fn=b=>{const{entities:j,title:R,emptyContent:B,variant:K="gridItem",columns:he}=b,ce=on(),Ce={minWidth:"0",width:"100%"};return K==="gridItem"&&(Ce.height="calc(100% - 10px)"),(0,u.jsx)(P.iA,{columns:he,title:R,style:Ce,emptyContent:B&&(0,u.jsx)("div",{className:ce.empty,children:B}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:j})};Fn.columns=We,Fn.systemEntityColumns=Tt,Fn.componentEntityColumns=hn;const ur=(0,Ct.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),Zn=b=>{const j=ur();return(0,u.jsx)(Be,{label:"Tags",name:"tags",path:"metadata.tags",Filter:Z,showCounts:b.showCounts,InputProps:{className:j.input}})},Un=b=>{const{hidden:j,initialFilter:R}=b,B=(0,p.h_)(p.$v),{error:K,availableTypes:he,selectedTypes:ce,setSelectedTypes:Ce}=$t();if((0,$.useEffect)(()=>{K&&B.post({message:"Failed to load entity types",severity:"error"}),R&&Ce([R])},[K,B,R,Ce]),he.length===0||K)return null;const Oe=[{value:"all",label:"all"},...he.map(Ze=>({value:Ze,label:Ze}))];var Re;return j?null:(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsx)(P.Ph,{label:"Type",items:Oe,selected:(Re=Oe.length>1?ce[0]:void 0)!==null&&Re!==void 0?Re:"all",onChange:Ze=>Ce(Ze==="all"?[]:[String(Ze)])})})};var or=r(15459),Nr=r(61837),Lr=r(11640),sr=r(28347);const xr=(0,or.Z)({root:{color:"#f3ba37"}})(Lr.Z),S=b=>{const{toggleStarredEntity:j,isStarredEntity:R}=nn(b.entity);return(0,u.jsx)(Nr.Z,{"aria-label":"favorite",color:"inherit",...b,onClick:()=>j(),children:(0,u.jsx)(_e.ZP,{title:R?"Remove from favorites":"Add to favorites",children:R?(0,u.jsx)(xr,{}):(0,u.jsx)(sr.Z,{})})})};var c=r(8629),x=r(79249),w=r(38724),J=r(99152),fe=r(6487),we=r(49429),je=r(55999),qe=r(39412);const Mt=qe.Z;function xn(b,j){if(b)return b.toLocaleLowerCase("en-US");if(j)try{return(0,k.of)(j).kind.toLocaleLowerCase("en-US")}catch{return}}function Jn(b,j){const R=(0,p.qD)(),B=xn(b,j);return B&&R.getSystemIcon(`kind:${B}`)||Mt}function br(b){const{kind:j,entityRef:R,...B}=b,K=Jn(j,R);return(0,u.jsx)(K,{...B})}const Sr=(0,Ct.Z)(b=>({node:{fill:b.palette.grey[300],stroke:b.palette.grey[300],"&.primary":{fill:b.palette.primary.light,stroke:b.palette.primary.light},"&.secondary":{fill:b.palette.secondary.light,stroke:b.palette.secondary.light}},text:{fill:b.palette.getContrastText(b.palette.grey[300]),"&.primary":{fill:b.palette.primary.contrastText},"&.secondary":{fill:b.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function Or(b){const j=(0,p.h_)(G),R=(0,k.eE)(b),{loading:B,error:K,value:he}=(0,bt.default)(async()=>{const ce=await j.getEntityAncestors({entityRef:R}),Ce=new Array,Oe=new Array;for(const Re of ce.items){const Ze=(0,k.eE)(Re.entity),De=Ze===ce.rootEntityRef;Ce.push({id:Ze,root:De,...Re.entity});for(const gt of Re.parentEntityRefs)Oe.push({from:Ze,to:gt})}return{nodes:Ce,edges:Oe}},[R]);return{loading:B,error:K,nodes:(he==null?void 0:he.nodes)||[],edges:(he==null?void 0:he.edges)||[]}}function lo({node:b}){const j=Sr(),R=(0,kt.s0)(),B=(0,p.tg)(xe),[K,he]=(0,$.useState)(0),[ce,Ce]=(0,$.useState)(0),Oe=(0,$.useRef)(null);(0,$.useLayoutEffect)(()=>{if(Oe.current){let{height:it,width:Nt}=Oe.current.getBBox();it=Math.round(it),Nt=Math.round(Nt),(it!==ce||Nt!==K)&&(he(Nt),Ce(it))}},[K,ce]);const Re=10,Ze=ce,De=Ze+Re,gt=De+K+Re*2,ht=ce+Re*2,st=b.metadata.title||(b.kind&&b.metadata.name&&b.metadata.namespace?X({kind:b.kind,name:b.metadata.name,namespace:b.metadata.namespace||""}):b.id),$e=()=>{R(B({kind:b.kind,namespace:b.metadata.namespace||k.zG,name:b.metadata.name}))};return(0,u.jsxs)("g",{onClick:$e,className:j.clickable,children:[(0,u.jsx)("rect",{className:se()(j.node,b.root?"secondary":"primary"),width:gt,height:ht,rx:10}),(0,u.jsx)(br,{kind:b.kind,y:Re,x:Re,width:Ze,height:Ze,className:se()(j.text,b.root?"secondary":"primary")}),(0,u.jsx)("text",{ref:Oe,className:se()(j.text,b.root?"secondary":"primary"),y:ht/2,x:De+(K+Re*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:st})]})}function co(b){const{loading:j,error:R,nodes:B,edges:K}=Or(b.entity);return j?(0,u.jsx)(P.Ex,{}):R?(0,u.jsx)(P.Gk,{error:R}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(je.Z,{variant:"h2",children:"Ancestry"}),(0,u.jsxs)(je.Z,{gutterBottom:!0,children:["This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where"," ",(0,u.jsx)(P.rU,{to:"https://backstage.io/docs/features/software-catalog/life-of-an-entity",children:"processors emitted"})," ","child entities that ultimately led to the current one existing. Note that this is a completely different mechanism from relations."]}),(0,u.jsx)(I.Z,{mt:4,children:(0,u.jsx)(P.mn,{nodes:B,edges:K,renderNode:lo,direction:P.NX.Direction.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var hr=r(11776),Hn=r(38402),Fr=r(86136),Zr=r(99688),Bo=r(49378),$o=r(54506),Gr=r(94339),Do=r(24579),No=r(27685);const Kr=(0,Ct.Z)(b=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:b.spacing(2)},helpIcon:{marginLeft:b.spacing(1),color:b.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function qn(b){const j=Kr();return(0,u.jsx)(Bo.Z,{...b,primaryTypographyProps:{className:j.monospace},secondaryTypographyProps:{className:j.monospace}})}function kr(b){const j=Kr();return(0,u.jsx)($o.Z,{className:j.monospace,children:b.children})}function Cr(b){return(0,u.jsx)(I.Z,{mt:2,children:(0,u.jsx)(Gr.Z,{variant:"outlined",children:(0,u.jsxs)(Do.Z,{children:[(0,u.jsxs)(E.Z,{variant:"h6",gutterBottom:!0,children:[b.title,b.helpLink&&(0,u.jsx)(Jr,{to:b.helpLink})]}),b.children]})})})}function uo(b){if(b.match(/^url:https?:\/\//))return b.slice(4);if(b.match(/^https?:\/\//))return b}function Yr(b){const[j,R]=b.entry,B=uo(R);return(0,u.jsxs)(Hn.Z,{children:[b.indent&&(0,u.jsx)(Fr.Z,{}),(0,u.jsx)(qn,{primary:j,secondary:B?(0,u.jsx)(P.rU,{to:B,children:R}):R})]})}function Jr(b){const j=Kr();return(0,u.jsx)(P.rU,{to:b.to,className:j.helpIcon,children:(0,u.jsx)(No.Z,{fontSize:"inherit"})})}const On=(0,Ct.Z)({root:{display:"flex",flexDirection:"column"}});function ho(b){var j,R;const B=(0,p.h_)(G),K=(0,k.eE)(b),he=(j=b.metadata.annotations)===null||j===void 0?void 0:j[k.P1],ce=(R=b.metadata.annotations)===null||R===void 0?void 0:R[k.q1],{loading:Ce,error:Oe,value:Re}=(0,bt.default)(async()=>!he&&!ce?[]:(await B.getEntities({filter:[...he?[{[`metadata.annotations.${k.P1}`]:he}]:[],...ce?[{[`metadata.annotations.${k.q1}`]:ce}]:[]]})).items,[he,ce]);return{loading:Ce,error:Oe,location:he,originLocation:ce,colocatedEntities:Re==null?void 0:Re.filter(Ze=>(0,k.eE)(Ze)!==K)}}function Ur(b){return(0,u.jsxs)(hr.Z,{dense:!0,children:[b.header&&(0,u.jsx)(Yr,{entry:b.header},"header"),b.entities.map(j=>(0,u.jsxs)(Hn.Z,{children:[(0,u.jsx)(Fr.Z,{children:(0,u.jsx)(br,{kind:j.kind})}),(0,u.jsx)(qn,{primary:(0,u.jsx)(Qe,{entityRef:j})})]},(0,k.eE)(j)))]})}function Fo(b){const{entity:j}=b,{loading:R,error:B,location:K,originLocation:he,colocatedEntities:ce}=ho(j);if(R)return(0,u.jsx)(P.Ex,{});if(B)return(0,u.jsx)(P.Gk,{error:B});if(!K&&!he)return(0,u.jsx)(Zr.Z,{severity:"warning",children:"Entity had no location information."});if(!(ce!=null&&ce.length))return(0,u.jsx)(Zr.Z,{severity:"info",children:"There were no other entities on this location."});if(K===he)return(0,u.jsx)(Ur,{entities:ce});const Ce=ce.filter(Re=>{var Ze;return((Ze=Re.metadata.annotations)===null||Ze===void 0?void 0:Ze[k.P1])===K}),Oe=ce.filter(Re=>{var Ze;return((Ze=Re.metadata.annotations)===null||Ze===void 0?void 0:Ze[k.q1])===he});return(0,u.jsxs)(u.Fragment,{children:[Ce.length>0&&(0,u.jsx)(Ur,{entities:Ce,header:["At the same location",K]}),Oe.length>0&&(0,u.jsx)(Ur,{entities:Oe,header:["At the same origin",he]})]})}function wr(b){const j=On();return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(je.Z,{variant:"h2",children:"Colocated"}),(0,u.jsx)(je.Z,{children:"These are the entities that are colocated with this entity - as in, they originated from the same data source (e.g. came from the same YAML file), or from the same origin (e.g. the originally registered URL)."}),(0,u.jsx)("div",{className:j.root,children:(0,u.jsx)(Fo,{entity:b.entity})})]})}function po(b){return Object.fromEntries([...Object.entries(b)].sort((j,R)=>j[0]<R[0]?-1:1))}function fo(b){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(je.Z,{variant:"h2",children:"Entity as JSON"}),(0,u.jsx)(je.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,u.jsx)(je.Z,{children:(0,u.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,u.jsx)(P.Oi,{text:JSON.stringify(po(b.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var Zo=r(3440),go=r.n(Zo);const jr=(0,Ct.Z)({root:{display:"flex",flexDirection:"column"}});function ps(b){var j,R;const B=jr(),{apiVersion:K,kind:he,metadata:ce,spec:Ce,relations:Oe=[],status:Re={}}=b.entity,Ze=go()(Gt()(Oe,De=>De.targetRef),"type");return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(je.Z,{variant:"h2",children:"Overview"}),(0,u.jsxs)("div",{className:B.root,children:[(0,u.jsx)(Cr,{title:"Identity",children:(0,u.jsxs)(hr.Z,{dense:!0,children:[(0,u.jsx)(Hn.Z,{children:(0,u.jsx)(qn,{primary:"apiVersion",secondary:K})}),(0,u.jsx)(Hn.Z,{children:(0,u.jsx)(qn,{primary:"kind",secondary:he})}),(Ce==null?void 0:Ce.type)&&(0,u.jsx)(Hn.Z,{children:(0,u.jsx)(qn,{primary:"spec.type",secondary:Ce.type})}),ce.uid&&(0,u.jsx)(Hn.Z,{children:(0,u.jsx)(qn,{primary:"uid",secondary:ce.uid})}),ce.etag&&(0,u.jsx)(Hn.Z,{children:(0,u.jsx)(qn,{primary:"etag",secondary:ce.etag})})]})}),(0,u.jsxs)(Cr,{title:"Metadata",children:[!!Object.keys(ce.annotations||{}).length&&(0,u.jsx)(hr.Z,{dense:!0,subheader:(0,u.jsxs)(kr,{children:["Annotations",(0,u.jsx)(Jr,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(ce.annotations).map(De=>(0,u.jsx)(Yr,{indent:!0,entry:De},De[0]))}),!!Object.keys(ce.labels||{}).length&&(0,u.jsx)(hr.Z,{dense:!0,subheader:(0,u.jsx)(kr,{children:"Labels"}),children:Object.entries(ce.labels).map(De=>(0,u.jsx)(Yr,{indent:!0,entry:De},De[0]))}),!!(!((j=ce.tags)===null||j===void 0)&&j.length)&&(0,u.jsx)(hr.Z,{dense:!0,subheader:(0,u.jsx)(kr,{children:"Tags"}),children:ce.tags.map((De,gt)=>(0,u.jsxs)(Hn.Z,{children:[(0,u.jsx)(Fr.Z,{}),(0,u.jsx)(qn,{primary:De})]},`${De}-${gt}`))})]}),!!Oe.length&&(0,u.jsx)(Cr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Ze).map(([De,gt],ht)=>(0,u.jsx)("div",{children:(0,u.jsx)(hr.Z,{dense:!0,subheader:(0,u.jsx)(kr,{children:De}),children:gt.map(st=>(0,u.jsxs)(Hn.Z,{children:[(0,u.jsx)(Fr.Z,{children:(0,u.jsx)(br,{entityRef:st.targetRef})}),(0,u.jsx)(qn,{primary:(0,u.jsx)(Qe,{entityRef:st.targetRef})})]},st.targetRef))})},ht))}),!!(!((R=Re.items)===null||R===void 0)&&R.length)&&(0,u.jsx)(Cr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Re.items.map((De,gt)=>(0,u.jsxs)("div",{children:[(0,u.jsxs)(E.Z,{children:[De.level,": ",De.type]}),(0,u.jsx)(I.Z,{ml:2,children:De.message})]},gt))})]})]})}var Uo=r(72847);function Qr(b){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(je.Z,{variant:"h2",children:"Entity as YAML"}),(0,u.jsx)(je.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,u.jsx)(je.Z,{children:(0,u.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,u.jsx)(P.Oi,{text:Uo.ZP.stringify(po(b.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const mo=(0,Ct.Z)(b=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:b.palette.background.paper},tabs:{borderRight:`1px solid ${b.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function Br(b){const{children:j,value:R,index:B,...K}=b,he=mo();return(0,u.jsx)("div",{role:"tabpanel",hidden:R!==B,id:`vertical-tabpanel-${B}`,"aria-labelledby":`vertical-tab-${B}`,className:he.tabContents,...K,children:R===B&&(0,u.jsx)(I.Z,{pl:3,pr:3,children:j})})}function Pn(b){return{id:`vertical-tab-${b}`,"aria-controls":`vertical-tabpanel-${b}`}}function ri(b){const j=mo(),[R,B]=$.useState(0);return(0,$.useEffect)(()=>{B(0)},[b.open]),b.entity?(0,u.jsxs)(c.Z,{fullWidth:!0,maxWidth:"xl",open:b.open,onClose:b.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:j.fullHeightDialog},children:[(0,u.jsx)(x.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,u.jsx)(w.Z,{dividers:!0,children:(0,u.jsxs)("div",{className:j.root,children:[(0,u.jsxs)(J.Z,{orientation:"vertical",variant:"scrollable",value:R,onChange:(K,he)=>B(he),"aria-label":"Inspector options",className:j.tabs,children:[(0,u.jsx)(fe.Z,{label:"Overview",...Pn(0)}),(0,u.jsx)(fe.Z,{label:"Ancestry",...Pn(1)}),(0,u.jsx)(fe.Z,{label:"Colocated",...Pn(2)}),(0,u.jsx)(fe.Z,{label:"Raw JSON",...Pn(3)}),(0,u.jsx)(fe.Z,{label:"Raw YAML",...Pn(4)})]}),(0,u.jsx)(Br,{value:R,index:0,children:(0,u.jsx)(ps,{entity:b.entity})}),(0,u.jsx)(Br,{value:R,index:1,children:(0,u.jsx)(co,{entity:b.entity})}),(0,u.jsx)(Br,{value:R,index:2,children:(0,u.jsx)(wr,{entity:b.entity})}),(0,u.jsx)(Br,{value:R,index:3,children:(0,u.jsx)(fo,{entity:b.entity})}),(0,u.jsx)(Br,{value:R,index:4,children:(0,u.jsx)(Qr,{entity:b.entity})})]})}),(0,u.jsx)(we.Z,{children:(0,u.jsx)(H.Z,{onClick:b.onClose,color:"primary",children:"Close"})})]}):null}var fs=r(85256);function gs(b){var j;const R=(0,p.h_)(G),B=(j=b.metadata.annotations)===null||j===void 0?void 0:j[k.q1],K=b.metadata.uid,he=B==="bootstrap:bootstrap",ce=(0,bt.default)(async()=>{const st=R.getLocationByRef(B);let $e;if(!B)$e=Promise.resolve([]);else{const it=`metadata.annotations.${k.q1}`;$e=R.getEntities({filter:{[it]:B},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Nt=>Nt.items)}return Promise.all([st,$e]).then(([it,Nt])=>({location:it,colocatedEntities:Nt}))},[R,b]),Ce=(0,$.useCallback)(async function(){const{location:$e}=ce.value;await R.removeLocationById($e.id)},[R,ce]),Oe=(0,$.useCallback)(async function(){await R.removeEntityByUid(K)},[R,K]);if(he)return{type:"bootstrap",location:B,deleteEntity:Oe};const{loading:Re,error:Ze,value:De}=ce;if(Re)return{type:"loading"};if(Ze)return{type:"error",error:Ze};const{location:gt,colocatedEntities:ht}=De;return gt?{type:"unregister",location:B,colocatedEntities:ht.map(k.iB),unregisterLocation:Ce,deleteEntity:Oe}:{type:"only-delete",deleteEntity:Oe}}var Mo=r(23054);const vo=(0,Ct.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),ms=({entity:b,onConfirm:j,onClose:R})=>{const B=(0,p.h_)(p.$v),K=(0,p.h_)(p.Ds),he=vo(),ce=gs(b),[Ce,Oe]=(0,$.useState)(!1),[Re,Ze]=(0,$.useState)(!1);var De;const gt=(De=K.getOptionalString("app.title"))!==null&&De!==void 0?De:"Backstage",ht=(0,$.useCallback)(async function(){if("unregisterLocation"in ce){Ze(!0);try{await ce.unregisterLocation(),j()}catch(Nt){(0,Mo.BD)(Nt),B.post({message:Nt.message})}finally{Ze(!1)}}},[B,j,ce]),st=(0,$.useCallback)(async function(){if("deleteEntity"in ce){Ze(!0);try{await ce.deleteEntity(),j()}catch(Nt){(0,Mo.BD)(Nt),B.post({message:Nt.message})}finally{Ze(!1)}}},[B,j,ce]),$e=()=>(0,u.jsx)(we.Z,{className:he.dialogActions,children:(0,u.jsx)(H.Z,{onClick:R,color:"primary",children:"Cancel"})});return ce.type==="loading"?(0,u.jsx)(P.Ex,{}):ce.type==="error"?(0,u.jsx)(P.Gk,{error:ce.error}):ce.type==="bootstrap"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(Zr.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',ce.location,'"). If you believe this is in error, please contact the ',gt," ","integrator."]}),(0,u.jsxs)(I.Z,{marginTop:2,children:[!Ce&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(H.Z,{variant:"text",size:"small",color:"primary",className:he.advancedButton,onClick:()=>Oe(!0),children:"Advanced Options"}),(0,u.jsx)($e,{})]}),Ce&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(je.Z,{children:"You have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,u.jsx)(H.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:st,children:"Delete Entity"}),(0,u.jsx)($e,{})]})]})]}):ce.type==="only-delete"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(je.Z,{children:"This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog."}),(0,u.jsx)(H.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:st,children:"Delete Entity"}),(0,u.jsx)($e,{})]}):ce.type==="unregister"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(je.Z,{children:"This action will unregister the following entities:"}),(0,u.jsx)(je.Z,{component:"ul",children:ce.colocatedEntities.map(it=>(0,u.jsx)("li",{children:(0,u.jsx)(Qe,{entityRef:it})},`${it.kind}:${it.namespace}/${it.name}`))}),(0,u.jsx)(je.Z,{children:"Located at the following location:"}),(0,u.jsx)(je.Z,{component:"ul",children:(0,u.jsx)("li",{children:ce.location})}),(0,u.jsxs)(je.Z,{children:["To undo, just re-register the entity in ",gt,"."]}),(0,u.jsxs)(I.Z,{marginTop:2,children:[(0,u.jsx)(H.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:ht,children:"Unregister Location"}),!Ce&&(0,u.jsx)(I.Z,{component:"span",marginLeft:2,children:(0,u.jsx)(H.Z,{variant:"text",size:"small",color:"primary",className:he.advancedButton,onClick:()=>Oe(!0),children:"Advanced Options"})})]}),Ce&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(I.Z,{paddingTop:4,paddingBottom:4,children:(0,u.jsx)(fs.Z,{})}),(0,u.jsx)(je.Z,{children:"You also have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,u.jsx)(H.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:st,children:"Delete Entity"})]})]}):(0,u.jsx)(Zr.Z,{severity:"error",children:"Internal error: Unknown state"})},vs=b=>{const{open:j,onConfirm:R,onClose:B,entity:K}=b;return(0,u.jsxs)(c.Z,{open:j,onClose:B,children:[(0,u.jsx)(x.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,u.jsx)(w.Z,{children:(0,u.jsx)(ms,{entity:K,onConfirm:R,onClose:B})})]})};var ir=r(12231),zo=r(9520),Gn=r(47603);const yo=(0,Ct.Z)(b=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:b.spacing(1,0,1,0)},title:{margin:b.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:b.palette.text.primary},menuItem:{minHeight:b.spacing(6)},groupWrapper:{margin:b.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function Wo(b){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:Gn.Z},{id:"starred",label:"Starred",icon:Lr.Z}]},{name:b!=null?b:"Company",items:[{id:"all",label:"All"}]}]}const Xr=b=>{const{initialFilter:j,availableFilters:R}=b,B=yo(),K=(0,p.h_)(p.Ds);var he;const ce=(he=K.getOptionalString("organization.name"))!==null&&he!==void 0?he:"Company",{filters:Ce,updateFilters:Oe,backendEntities:Re,queryParameters:{kind:Ze,user:De},loading:gt}=at(),ht=["starred","all"],st=Wo(ce).map(kn=>({...kn,items:kn.items.filter(({id:Ln})=>["group","user"].some(Mr=>Mr===Ze)?ht.includes(Ln):!R||R.includes(Ln))})).filter(({items:kn})=>!!kn.length),{isStarredEntity:$e}=fn(),{isOwnedEntity:it,loading:Nt}=en(),vn=gt||Nt,mt=(0,$.useMemo)(()=>new lt("owned",it,$e),[it,$e]),zt=(0,$.useMemo)(()=>new lt("starred",it,$e),[it,$e]),Rt=(0,$.useMemo)(()=>[De].flat()[0],[De]),[Xt,En]=(0,$.useState)(Rt!=null?Rt:j),Er=(0,$.useMemo)(()=>Re.filter((0,te.Gz)((0,pt.compact)(Object.values({...Ce,user:void 0})))),[Ce,Re]),Ar=(0,$.useMemo)(()=>({all:Er.length,starred:Er.filter(kn=>zt.filterEntity(kn)).length,owned:Er.filter(kn=>mt.filterEntity(kn)).length}),[Er,zt,mt]);(0,$.useEffect)(()=>{Rt&&En(Rt)},[Rt]),(0,$.useEffect)(()=>{!vn&&Xt&&Xt!=="all"&&Ar[Xt]===0&&En("all")},[vn,Ar,Xt,En]),(0,$.useEffect)(()=>{Oe({user:Xt?new lt(Xt,it,$e):void 0})},[Xt,it,$e,Oe]);var xo;return(0,u.jsx)(Gr.Z,{className:B.root,children:st.map(kn=>(0,u.jsxs)($.Fragment,{children:[(0,u.jsx)(E.Z,{variant:"subtitle2",component:"span",className:B.title,children:kn.name}),(0,u.jsx)(Gr.Z,{className:B.groupWrapper,children:(0,u.jsx)(hr.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":kn.name,children:kn.items.map(Ln=>{var Mr;return(0,u.jsxs)(ir.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>En(Ln.id),selected:Ln.id===((Mr=Ce.user)===null||Mr===void 0?void 0:Mr.value),className:B.menuItem,disabled:Ar[Ln.id]===0,"data-testid":`user-picker-${Ln.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Ln.icon&&(0,u.jsx)(Fr.Z,{className:B.listIcon,children:(0,u.jsx)(Ln.icon,{fontSize:"small"})}),(0,u.jsx)(Bo.Z,{children:(0,u.jsxs)(E.Z,{variant:"body1",children:[Ln.label," "]})}),(0,u.jsx)(zo.Z,{children:(xo=Ar[Ln.id])!==null&&xo!==void 0?xo:"-"})]},Ln.id)})})})]},kn.name))})},Vo=(0,Ct.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Ho=(0,u.jsx)(Sn.Z,{fontSize:"small"}),ys=(0,u.jsx)(Dn.Z,{fontSize:"small"}),Go=()=>{const b=Vo(),{updateFilters:j}=at(),[R,B]=(0,$.useState)([]);function K(Ce){j({orphan:Ce?new Ft(Ce):void 0})}function he(Ce){j({error:Ce?new Zt(Ce):void 0})}const ce=["Is Orphan","Has Error"];return(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsxs)(E.Z,{variant:"button",component:"label",children:["Processing Status",(0,u.jsx)(Tn.ZP,{multiple:!0,disableCloseOnSelect:!0,options:ce,value:R,onChange:(Ce,Oe)=>{B(Oe),K(Oe.includes("Is Orphan")),he(Oe.includes("Has Error"))},renderOption:(Ce,{selected:Oe})=>(0,u.jsx)(Rn.Z,{control:(0,u.jsx)(Jt.Z,{icon:Ho,checkedIcon:ys,checked:Oe}),onClick:Re=>Re.preventDefault(),label:Ce}),size:"small",popupIcon:(0,u.jsx)(nt.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:Ce=>(0,u.jsx)(Me.Z,{...Ce,className:b.input,variant:"outlined"})})]})})},qr=(0,Ct.Z)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),Ko=()=>{const b=qr();return(0,u.jsx)(Be,{label:"Namespace",name:"namespace",path:"metadata.namespace",Filter:Lt,InputProps:{className:b.input}})};function Yo(b){const{children:j,value:R}=b;var B;const[K,he]=useState((B=R==null?void 0:R.filters)!==null&&B!==void 0?B:{}),ce=useCallback(st=>{he($e=>{const it=typeof st=="function"?st($e):st;return{...$e,...it}})},[]),Ce=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Oe,Re,Ze,De,gt;const ht=useMemo(()=>({entities:(Oe=R==null?void 0:R.entities)!==null&&Oe!==void 0?Oe:Ce.entities,backendEntities:(Re=R==null?void 0:R.backendEntities)!==null&&Re!==void 0?Re:Ce.backendEntities,updateFilters:(Ze=R==null?void 0:R.updateFilters)!==null&&Ze!==void 0?Ze:ce,filters:K,loading:(De=R==null?void 0:R.loading)!==null&&De!==void 0?De:!1,queryParameters:(gt=R==null?void 0:R.queryParameters)!==null&&gt!==void 0?gt:Ce.queryParameters,error:R==null?void 0:R.error}),[R,Ce,K,ce]);return _jsx(EntityListContext.Provider,{value:ht,children:j})}},75435:function(vt,ke,r){"use strict";r.d(ke,{h:function(){return p}});var n=r(25271);function p(G,f,V){var g;let u=(G==null||(g=G.relations)===null||g===void 0?void 0:g.filter($=>$.type===f).map($=>(0,n.of)($.targetRef)))||[];return V!=null&&V.kind&&(u=u.filter($=>$.kind.toLocaleLowerCase("en-US")===V.kind.toLocaleLowerCase("en-US"))),u}},49280:function(vt,ke,r){"use strict";r.d(ke,{hF:function(){return G.h},CV:function(){return V},wq:function(){return n},Gz:function(){return p}});function n(u){return u.reduce(($,ye)=>({...$,...ye.getCatalogFilters?ye.getCatalogFilters():{}}),{})}function p(u){return $=>u.every(ye=>!ye.filterEntity||ye.filterEntity($))}var G=r(75435),f=r(25271);function V(u,$){var ye;const le=(ye=u.metadata.annotations)===null||ye===void 0?void 0:ye[f.M6];if(le)try{const H=(0,f.Ou)(le),ee=$.byUrl(H.target);return{locationTargetUrl:H.target,integrationType:ee==null?void 0:ee.type}}catch{return}}function g(u,$){const ye=new Set([...getEntityRelations(u,RELATION_MEMBER_OF,{kind:"group"}),...u?[getCompoundEntityRef(u)]:[]].map(stringifyEntityRef)),le=getEntityRelations($,RELATION_OWNED_BY).map(stringifyEntityRef);for(const H of le)if(ye.has(H))return!0;return!1}},8799:function(vt,ke,r){"use strict";r.r(ke),r.d(ke,{AboutCard:function(){return Zt},AboutContent:function(){return lt},AboutField:function(){return Xe}});var n=r(52322),p=r(25271),G=r(53974),f=r(60871),V=r(32838),g=r(43514),u=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"TemplateV1beta3","description":"A Template describes a scaffolding task for use with the Scaffolder. It describes the required parameters as well as a series of steps that will be taken to execute the scaffolding task.","examples":[{"apiVersion":"scaffolder.backstage.io/v1beta3","kind":"Template","metadata":{"name":"react-ssr-template","title":"React SSR Template","description":"Next.js application skeleton for creating isomorphic web applications.","tags":["recommended","react"]},"spec":{"owner":"artist-relations-team","parameters":{"required":["name","description","repoUrl"],"backstage:permissions":{"tags":["one","two"]},"properties":{"name":{"title":"Name","type":"string","description":"Unique name of the component"},"description":{"title":"Description","type":"string","description":"Description of the component"},"repoUrl":{"title":"Pick a repository","type":"string","ui:field":"RepoUrlPicker"}}},"steps":[{"id":"fetch","name":"Fetch","action":"fetch:plain","parameters":{"url":"./template"},"backstage:permissions":{"tags":["one","two"]}},{"id":"publish","name":"Publish to GitHub","action":"publish:github","parameters":{"repoUrl":"${{ parameters.repoUrl }}"},"if":"${{ parameters.repoUrl }}"}],"output":{"catalogInfoUrl":"${{ steps.publish.output.catalogInfoUrl }}"}}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["scaffolder.backstage.io/v1beta3"]},"kind":{"enum":["Template"]},"spec":{"type":"object","required":["type","steps"],"properties":{"type":{"type":"string","description":"The type of component created by the template. The software catalog accepts any type value, but an organization should take great care to establish a proper taxonomy for these. Tools including Backstage itself may read this field and behave differently depending on its value. For example, a website type component may present tooling in the Backstage interface that is specific to just websites.","examples":["service","website","library"],"minLength":1},"owner":{"type":"string","description":"The user (or group) owner of the template","minLength":1},"parameters":{"oneOf":[{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}},{"type":"array","description":"A list of separate forms to collect parameters.","items":{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}}]},"steps":{"type":"array","description":"A list of steps to execute.","items":{"type":"object","description":"A description of the step to execute.","required":["action"],"properties":{"id":{"type":"string","description":"The ID of the step, which can be used to refer to its outputs."},"name":{"type":"string","description":"The name of the step, which will be displayed in the UI during the scaffolding process."},"action":{"type":"string","description":"The name of the action to execute."},"input":{"type":"object","description":"A templated object describing the inputs to the action."},"if":{"type":["string","boolean"],"description":"A templated condition that skips the step when evaluated to false. If the condition is true or not defined, the step is executed. The condition is true, if the input is not `false`, `undefined`, `null`, `\\"\\"`, `0`, or `[]`."},"backstage:permissions":{"type":"object","description":"Object used for authorizing the step","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}},"output":{"type":"object","description":"A templated object describing the outputs of the scaffolding task.","properties":{"links":{"type":"array","description":"A list of external hyperlinks, typically pointing to resources created or updated by the template","items":{"type":"object","required":[],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://github.com/my-org/my-new-repo"],"minLength":1},"entityRef":{"type":"string","description":"An entity reference to an entity in the catalog.","examples":["Component:default/my-app"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["View new repo"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1}}}},"text":{"type":"array","description":"A list of Markdown text blobs, like output data from the template.","items":{"type":"object","required":[],"properties":{"title":{"type":"string","description":"A user friendly display name for the text.","examples":["Output Content"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"content":{"type":"string","description":"The text blob to display in the UI, rendered as Markdown.","examples":["**hey** _I\'m_ Markdown"]}}}}},"additionalProperties":{"type":"string"}}}}}}]}');const $=(0,p.wI)(u),ye={async check(et){return $(et)===et}},le=et=>et.apiVersion==="scaffolder.backstage.io/v1beta3"&&et.kind==="Template";var H=r(79692),ee=r(94339),I=r(32552),E=r(61837),ie=r(85256),ne=r(24579),re=r(88188),D=r(52866),N=r(30254),P=r(27604),T=r(2784),k=r(19625),te=r(60905),Te=r(7089),Ne=r(90436);const Z=(0,H.Z)(et=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:et.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function Xe(et){const{label:pt,value:ft,gridSizes:jt,children:kt}=et,qt=Z(),de=(0,f.vJ)(kt,ze=>ze.getElements()),ve=de.length>0?de:(0,n.jsx)(Ne.Z,{variant:"body2",className:qt.value,children:ft||"unknown"});return(0,n.jsxs)(te.Z,{item:!0,...jt,children:[(0,n.jsx)(Ne.Z,{variant:"h2",className:qt.label,children:pt}),ve]})}var rt=r(24851);const Et=(0,H.Z)({description:{wordBreak:"break-word"}});function Lt(et,pt,ft){if(pt==="url"||et.includes("://"))return et;const jt=ft.type==="file"?`file://${ft.target}`:ft.target;return pt==="file"||ft.type==="file"?new URL(et,jt).href:jt}function lt(et){var pt,ft,jt,kt,qt,de,ve,ze;const{entity:Ee}=et,at=Et(),bt=Ee.kind.toLocaleLowerCase("en-US")==="system",dt=Ee.kind.toLocaleLowerCase("en-US")==="resource",Bt=Ee.kind.toLocaleLowerCase("en-US")==="component",St=Ee.kind.toLocaleLowerCase("en-US")==="api",Gt=Ee.kind.toLocaleLowerCase("en-US")==="template",$t=Ee.kind.toLocaleLowerCase("en-US")==="location",pn=Ee.kind.toLocaleLowerCase("en-US")==="group",an=(0,g.hF)(Ee,p.cz,{kind:"system"}),dn=(0,g.hF)(Ee,p.cz,{kind:"component"}),_t=(0,g.hF)(Ee,p.cz,{kind:"domain"}),fn=(0,g.hF)(Ee,p.S4);let Yt;try{Yt=(0,p.CV)(Ee)}catch{Yt=void 0}return(0,n.jsxs)(te.Z,{container:!0,children:[(0,n.jsx)(Xe,{label:"Description",gridSizes:{xs:12},children:(0,n.jsx)(G.SA,{className:at.description,content:(Ee==null||(pt=Ee.metadata)===null||pt===void 0?void 0:pt.description)||"No description"})}),(0,n.jsx)(Xe,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:fn.length>0&&(0,n.jsx)(g.rI,{entityRefs:fn,defaultKind:"group"})}),(bt||_t.length>0)&&(0,n.jsx)(Xe,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:_t.length>0&&(0,n.jsx)(g.rI,{entityRefs:_t,defaultKind:"domain"})}),(St||Bt||dt||an.length>0)&&(0,n.jsx)(Xe,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:an.length>0&&(0,n.jsx)(g.rI,{entityRefs:an,defaultKind:"system"})}),Bt&&dn.length>0&&(0,n.jsx)(Xe,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,n.jsx)(g.rI,{entityRefs:dn,defaultKind:"component"})}),(St||Bt||dt||Gt||pn||$t||typeof(Ee==null||(ft=Ee.spec)===null||ft===void 0?void 0:ft.type)=="string")&&(0,n.jsx)(Xe,{label:"Type",value:Ee==null||(jt=Ee.spec)===null||jt===void 0?void 0:jt.type,gridSizes:{xs:12,sm:6,lg:4}}),(St||Bt||typeof(Ee==null||(kt=Ee.spec)===null||kt===void 0?void 0:kt.lifecycle)=="string")&&(0,n.jsx)(Xe,{label:"Lifecycle",value:Ee==null||(qt=Ee.spec)===null||qt===void 0?void 0:qt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,n.jsx)(Xe,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((Ee==null||(de=Ee.metadata)===null||de===void 0?void 0:de.tags)||[]).map(nn=>(0,n.jsx)(Te.Z,{size:"small",label:nn},nn))}),$t&&((Ee==null||(ve=Ee.spec)===null||ve===void 0?void 0:ve.targets)||(Ee==null||(ze=Ee.spec)===null||ze===void 0?void 0:ze.target))&&(0,n.jsx)(Xe,{label:"Targets",gridSizes:{xs:12},children:(0,n.jsx)(rt.s,{cols:1,items:(Ee.spec.targets||[Ee.spec.target]).map(nn=>nn).map(nn=>{var jn;return{text:nn,href:Lt(nn,(Ee==null||(jn=Ee.spec)===null||jn===void 0?void 0:jn.type)||"unknown",Yt)}})})})]})}const Ft=(0,H.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 Zt(et){var pt,ft,jt;const{variant:kt}=et,qt=(0,f.qD)(),de=Ft(),{entity:ve}=(0,g.X2)(),ze=(0,f.h_)(V.q3),Ee=(0,f.h_)(g.Ah),at=(0,f.h_)(f.$v),bt=(0,f.h_)(f.VE),dt=(0,f.tg)(k.jU),Bt=(0,f.tg)(k.ql),St=(0,g.CV)(ve,ze),Gt=(pt=ve.metadata.annotations)===null||pt===void 0?void 0:pt[p.Tf],$t={label:"View Source",disabled:!St,icon:(0,n.jsx)(V.nW,{type:St==null?void 0:St.integrationType}),href:St==null?void 0:St.locationTargetUrl},pn={label:"View TechDocs",disabled:!(!((ft=ve.metadata.annotations)===null||ft===void 0)&&ft["backstage.io/techdocs-ref"])||!dt,icon:(0,n.jsx)(N.Z,{}),href:dt&&dt({namespace:ve.metadata.namespace||p.zG,kind:ve.kind,name:ve.metadata.name})},an=[$t,pn];if(le(ve)){var dn;const en=(dn=qt.getSystemIcon("scaffolder"))!==null&&dn!==void 0?dn:re.Z,bn={label:"Launch Template",icon:(0,n.jsx)(en,{}),disabled:!Bt,href:Bt&&Bt({templateName:ve.metadata.name,namespace:ve.metadata.namespace||p.zG})};an.push(bn)}let _t="";kt==="gridItem"?_t=de.gridItemCard:kt==="fullHeight"&&(_t=de.fullHeightCard);let fn="";kt==="gridItem"?fn=de.gridItemCardContent:kt==="fullHeight"&&(fn=de.fullHeightCardContent);const Yt=(jt=ve.metadata.annotations)===null||jt===void 0?void 0:jt[p.P1],nn=(Yt==null?void 0:Yt.startsWith("url:"))||(Yt==null?void 0:Yt.startsWith("file:")),jn=(0,T.useCallback)(async()=>{try{await Ee.refreshEntity((0,p.eE)(ve)),at.post({message:"Refresh scheduled",severity:"info"})}catch(en){bt.post(en)}},[Ee,at,bt,ve]);return(0,n.jsxs)(ee.Z,{className:_t,children:[(0,n.jsx)(I.Z,{title:"About",action:(0,n.jsxs)(n.Fragment,{children:[nn&&(0,n.jsx)(E.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:jn,children:(0,n.jsx)(D.Z,{})}),(0,n.jsx)(E.Z,{component:G.rU,"aria-label":"Edit",disabled:!Gt,title:"Edit Metadata",to:Gt!=null?Gt:"#",children:(0,n.jsx)(P.Z,{})})]}),subheader:(0,n.jsx)(G.M6,{links:an})}),(0,n.jsx)(ie.Z,{}),(0,n.jsx)(ne.Z,{className:fn,children:(0,n.jsx)(lt,{entity:ve})})]})}},86359:function(vt,ke,r){"use strict";r.d(ke,{E:function(){return re}});var n=r(52322),p=r(25271),G=r(53974),f=r(43514),V=r(90436),g=r(15459),u=r(27604),$=r(2997),ye=r(11640),le=r(28347),H=r(76635),ee=r(2784),I=r(7089);const E=Object.freeze({createNameColumn(D){function N(P){var T;return((T=P.metadata)===null||T===void 0?void 0:T.title)||(0,f.$3)(P,{defaultKind:D==null?void 0:D.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:P},{entity:T}){return N(P).localeCompare(N(T))},render:({entity:P})=>{var T;return(0,n.jsx)(f.dx,{entityRef:P,defaultKind:(D==null?void 0:D.defaultKind)||"Component",title:(T=P.metadata)===null||T===void 0?void 0:T.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:D})=>(0,n.jsx)(f.rI,{entityRefs:D.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:D})=>(0,n.jsx)(f.rI,{entityRefs:D.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:D})=>{var N,P;return(0,n.jsx)(n.Fragment,{children:((D==null||(N=D.spec)===null||N===void 0?void 0:N.targets)||(D==null||(P=D.spec)===null||P===void 0?void 0:P.target))&&(0,n.jsx)(G.Or,{text:(D.spec.targets||[D.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:D})=>(0,n.jsx)(G.Or,{text:D.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:D})=>(0,n.jsx)(n.Fragment,{children:D.metadata.tags&&D.metadata.tags.map(N=>(0,n.jsx)(I.Z,{label:N,size:"small",variant:"outlined",style:{marginBottom:"0px"}},N))}),width:"auto"}},createTitleColumn(D){return{title:"Title",field:"entity.metadata.title",hidden:D==null?void 0:D.hidden,searchable:!0}},createLabelColumn(D,N){return{title:(N==null?void 0:N.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:P})=>{var T;const k=(T=P.metadata)===null||T===void 0?void 0:T.labels,te=k&&k[D]||(N==null?void 0:N.defaultValue);return(0,n.jsx)(n.Fragment,{children:te&&(0,n.jsx)(I.Z,{label:te,size:"small",variant:"outlined"},te)})},width:"auto"}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",width:"auto"}}}),ie=(0,g.Z)({root:{color:"#f3ba37"}})(ye.Z),ne=(D,N)=>{const P=T=>T.metadata.title||(0,f.$3)(T,{defaultKind:"Component"});return P(D).localeCompare(P(N))},re=D=>{var N,P;const{columns:T,actions:k,tableOptions:te,subtitle:Te,emptyContent:Ne}=D,{isStarredEntity:Z,toggleStarredEntity:Xe}=(0,f.CR)(),{loading:rt,error:Et,entities:Lt,filters:lt}=(0,f.wp)(),Ft=(0,ee.useMemo)(()=>{var de;return[E.createTitleColumn({hidden:!0}),E.createNameColumn({defaultKind:(de=lt.kind)===null||de===void 0?void 0:de.value}),...ve(),E.createMetadataDescriptionColumn(),E.createTagsColumn()];function ve(){var ze;const Ee=[E.createSystemColumn(),E.createOwnerColumn(),E.createSpecTypeColumn(),E.createSpecLifecycleColumn()];switch((ze=lt.kind)===null||ze===void 0?void 0:ze.value){case"user":return[];case"domain":case"system":return[E.createOwnerColumn()];case"group":case"template":return[E.createSpecTypeColumn()];case"location":return[E.createSpecTypeColumn(),E.createSpecTargetsColumn()];default:return Lt.every(at=>at.metadata.namespace==="default")?Ee:[...Ee,E.createNamespaceColumn()]}}},[(N=lt.kind)===null||N===void 0?void 0:N.value,Lt]),Zt=lt.type===void 0;var et;const pt=(0,H.capitalize)((et=(P=lt.user)===null||P===void 0?void 0:P.value)!==null&&et!==void 0?et:"all");if(Et)return(0,n.jsx)("div",{children:(0,n.jsx)(G.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,n.jsx)(G.Oi,{language:"text",text:Et.toString()})})});const ft=[({entity:de})=>{var ve;const ze=(ve=de.metadata.annotations)===null||ve===void 0?void 0:ve[p.l2],Ee="View";return{icon:()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(V.Z,{variant:"srOnly",children:Ee}),(0,n.jsx)($.Z,{fontSize:"small"})]}),tooltip:Ee,disabled:!ze,onClick:()=>{ze&&window.open(ze,"_blank")}}},({entity:de})=>{var ve;const ze=(ve=de.metadata.annotations)===null||ve===void 0?void 0:ve[p.Tf],Ee="Edit";return{icon:()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(V.Z,{variant:"srOnly",children:Ee}),(0,n.jsx)(u.Z,{fontSize:"small"})]}),tooltip:Ee,disabled:!ze,onClick:()=>{ze&&window.open(ze,"_blank")}}},({entity:de})=>{const ve=Z(de),ze=ve?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(V.Z,{variant:"srOnly",children:ze}),ve?(0,n.jsx)(ie,{}):(0,n.jsx)(le.Z,{})]}),tooltip:ze,onClick:()=>Xe(de)}}],jt=Lt.sort(ne).map(de=>{const ve=(0,f.hF)(de,p.cz,{kind:"system"}),ze=(0,f.hF)(de,p.S4);return{entity:de,resolved:{name:(0,f.$3)(de,{defaultKind:"Component"}),ownedByRelationsTitle:ze.map(Ee=>(0,f.$3)(Ee,{defaultKind:"group"})).join(", "),ownedByRelations:ze,partOfSystemRelationTitle:ve.map(Ee=>(0,f.$3)(Ee,{defaultKind:"system"})).join(", "),partOfSystemRelations:ve}}}),kt=(T||Ft).find(de=>de.title==="Type");kt&&(kt.hidden=!Zt);const qt=jt.length>20;return(0,n.jsx)(G.iA,{isLoading:rt,columns:T||Ft,options:{paging:qt,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!rt,padding:"dense",pageSizeOptions:[20,50,100],...te},title:`${pt} (${Lt.length})`,data:jt,actions:k||ft,subtitle:Te,emptyContent:Ne})};re.columns=E},85877:function(vt,ke,r){"use strict";r.r(ke),r.d(ke,{EntityLabelsCard:function(){return ee},hasLabels:function(){return I}});var n=r(52322),p=r(43514),G=r(2784),f=r(53974),V=r(79692),g=r(90436),u=r(77277);const $=`metadata:
34
- name: example
35
- labels:
36
- javaVersion: 1.2.3`,ye=(0,V.Z)(E=>({code:{borderRadius:6,margin:`${E.spacing(2)}px 0px`,background:E.palette.type==="dark"?"#444":E.palette.common.white}}),{name:"PluginCatalogEntityLabelsEmptyState"});function le(){const E=ye();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(g.Z,{variant:"body1",children:"No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:"}),(0,n.jsx)("div",{className:E.code,children:(0,n.jsx)(f.Oi,{text:$,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(u.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:"Read more"})]})}const H=(0,V.Z)(E=>({key:{fontWeight:"bold"}})),ee=E=>{var ie;const{variant:ne,title:re}=E,{entity:D}=(0,p.X2)(),N=H(),P=[{render:k=>(0,n.jsx)(g.Z,{className:N.key,variant:"body2",children:k.key})},{field:"value"}],T=D==null||(ie=D.metadata)===null||ie===void 0?void 0:ie.labels;return(0,n.jsx)(f.rJ,{title:re||"Labels",variant:ne,children:!T||Object.keys(T).length===0?(0,n.jsx)(le,{}):(0,n.jsx)(f.iA,{columns:P,data:Object.keys(T).map(k=>({key:k,value:T[k]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(T).length>5}})})};function I(E){var ie,ne;return!(E==null||(ie=E.metadata)===null||ie===void 0)&&ie.labels?Object.keys(E==null||(ne=E.metadata)===null||ne===void 0?void 0:ne.labels).some(Boolean):!1}},24851:function(vt,ke,r){"use strict";r.d(ke,{s:function(){return ie}});var n=r(52322),p=r(90348),G=r(11861),f=r(2784),V=r(79692),g=r(95544),u=r(90436),$=r(52160),ye=r(53974);const le=(0,V.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function H(ne){const{href:re,text:D,Icon:N}=ne,P=le();return(0,n.jsxs)(g.Z,{display:"flex",children:[(0,n.jsx)(g.Z,{mr:1,className:P.svgIcon,children:(0,n.jsx)(u.Z,{component:"div",children:N?(0,n.jsx)(N,{}):(0,n.jsx)($.Z,{})})}),(0,n.jsx)(g.Z,{flexGrow:"1",children:(0,n.jsx)(ye.rU,{to:re,target:"_blank",rel:"noopener",children:D||re})})]})}var ee=r(41156);const I={xs:1,sm:1,md:1,lg:2,xl:3};function E(ne){const re=[(0,ee.Z)(T=>T.breakpoints.up("xl"))?"xl":null,(0,ee.Z)(T=>T.breakpoints.up("lg"))?"lg":null,(0,ee.Z)(T=>T.breakpoints.up("md"))?"md":null,(0,ee.Z)(T=>T.breakpoints.up("sm"))?"sm":null,(0,ee.Z)(T=>T.breakpoints.up("xs"))?"xs":null];let D=1;if(typeof ne=="number")D=ne;else{var N;const T=(N=re.find(k=>k!==null))!==null&&N!==void 0?N:"xs";var P;D=(P=ne==null?void 0:ne[T])!==null&&P!==void 0?P:I[T]}return D}function ie(ne){const{items:re,cols:D=void 0}=ne,N=E(D);return(0,n.jsx)(p.Z,{rowHeight:"auto",cols:N,children:re.map(({text:P,href:T,Icon:k},te)=>(0,n.jsx)(G.Z,{children:(0,n.jsx)(H,{href:T,text:P!=null?P:T,Icon:k})},te))})}},19625:function(vt,ke,r){"use strict";r.d(ke,{_Z:function(){return V},jU:function(){return G},ql:function(){return f},yw:function(){return p}});var n=r(60871);const p=(0,n.x8)({id:"create-component",optional:!0}),G=(0,n.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),f=(0,n.x8)({id:"create-from-template",optional:!0,params:["namespace","templateName"]}),V=(0,n.NT)({id:"catalog"})},15096:function(vt,ke,r){"use strict";r.d(ke,{FA:function(){return ye},qO:function(){return ft},Nd:function(){return Z},E5:function(){return tn},Rx:function(){return T}});var n=r(60871);const p=(0,n.T0)({id:"plugin.search.queryservice"});class G{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(q){_define_property(this,"mockedResults",void 0),this.mockedResults=q}}var f=r(52322),V=r(2784),g=r(38402),u=r(79692);const $=(0,u.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),ye=X=>{const{text:q,preTag:_,postTag:v}=X,L=$(),Q=(0,V.useMemo)(()=>q.split(new RegExp(`(${_}.+?${v})`)),[v,_,q]);return(0,f.jsx)(f.Fragment,{children:Q.map((W,ue)=>W.includes(_)?(0,f.jsx)("mark",{className:L.highlight,children:W.replace(new RegExp(`${_}|${v}`,"g"),"")},ue):W)})};var le=r(50581),H=r(61837),ee=r(86619),I=r(77277),E=r(21853),ie=r(48760),ne=r(76635),re=r(64279),D=r(1849),N=r(51837);const P=(0,N.CT)("search-context"),T=()=>{const X=(0,V.useContext)(P);if(!X)throw new Error("useSearch must be used within a SearchContextProvider");const q=X.atVersion(1);if(!q)throw new Error("No SearchContext v1 found");return q},k=()=>(0,V.useContext)(P)!==void 0,te={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},Te=(X=te)=>{var q,_,v,L;const Q=(0,n.h_)(p),[W,ue]=(0,V.useState)(X.term),[xe,Ve]=(0,V.useState)(X.types),[_e,Qe]=(0,V.useState)(X.filters),[At,yt]=(0,V.useState)(X.pageLimit),[ot,Fe]=(0,V.useState)(X.pageCursor),Ut=(0,D.Z)(W),rn=(0,D.Z)(_e),It=(0,re.default)(()=>Q.query({term:W,types:xe,filters:_e,pageLimit:At,pageCursor:ot}),[W,xe,_e,At,ot]),Ot=!It.loading&&!It.error&&((q=It.value)===null||q===void 0?void 0:q.nextPageCursor),mn=!It.loading&&!It.error&&((_=It.value)===null||_===void 0?void 0:_.previousPageCursor),un=(0,V.useCallback)(()=>{var Tt;Fe((Tt=It.value)===null||Tt===void 0?void 0:Tt.nextPageCursor)},[(v=It.value)===null||v===void 0?void 0:v.nextPageCursor]),ut=(0,V.useCallback)(()=>{var Tt;Fe((Tt=It.value)===null||Tt===void 0?void 0:Tt.previousPageCursor)},[(L=It.value)===null||L===void 0?void 0:L.previousPageCursor]);return(0,V.useEffect)(()=>{Ut!==void 0&&W!==Ut&&Fe(void 0)},[W,Ut,Fe]),(0,V.useEffect)(()=>{rn!==void 0&&!(0,ne.isEqual)(_e,rn)&&Fe(void 0)},[_e,rn,Fe]),{result:It,term:W,setTerm:ue,types:xe,setTypes:Ve,filters:_e,setFilters:Qe,pageLimit:At,setPageLimit:yt,pageCursor:ot,setPageCursor:Fe,fetchNextPage:Ot?un:void 0,fetchPreviousPage:mn?ut:void 0}},Ne=X=>{const{initialState:q,children:_}=X,v=Te(q);return(0,f.jsx)(n.fC,{attributes:{searchTypes:v.types.sort().join(",")},children:(0,f.jsx)(P.Provider,{value:(0,N.EI)({1:v}),children:_})})},Z=X=>{const{initialState:q,inheritParentContextIfAvailable:_,children:v}=X;return k()&&_?(0,f.jsx)(f.Fragment,{children:v}):(0,f.jsx)(Ne,{initialState:q,children:v})},Xe=({children:X})=>{var q;const _=_e=>(0,D.Z)(_e)!==_e,v=(0,n.z$)(),{term:L,result:Q}=T();var W;const ue=(W=(q=Q.value)===null||q===void 0?void 0:q.numberOfResults)!==null&&W!==void 0?W:void 0,Ve=_(Q.loading)&&!Q.loading;return(0,V.useEffect)(()=>{L&&Ve&&v.captureEvent("search",L,{value:ue})},[v,L,ue,Ve]),(0,f.jsx)(f.Fragment,{children:X})};function rt(X){return(0,V.forwardRef)((q,_)=>(0,f.jsx)(Z,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(X,{...q,ref:_})}))}const Et=rt((0,V.forwardRef)((X,q)=>{const{onChange:_,onKeyDown:v=()=>{},onClear:L=()=>{},onSubmit:Q=()=>{},debounceTime:W=200,clearButton:ue=!0,fullWidth:xe=!0,value:Ve,label:_e,placeholder:Qe,inputProps:At={},InputProps:yt={},endAdornment:ot,...Fe}=X,Ut=(0,n.h_)(n.Ds),[rn,It]=(0,V.useState)("");(0,V.useEffect)(()=>{It(on=>on!==Ve?String(Ve):on)},[Ve]),(0,ie.Z)(()=>_(rn),W,[rn]);const Ot=(0,V.useCallback)(on=>{It(on.target.value)},[It]),mn=(0,V.useCallback)(on=>{v&&v(on),Q&&on.key==="Enter"&&Q()},[v,Q]),un=(0,V.useCallback)(()=>{_(""),L&&L()},[_,L]),ut=_e?void 0:"Search",We=Qe!=null?Qe:`Search in ${Ut.getOptionalString("app.title")||"Backstage"}`,Tt=(0,f.jsx)(le.Z,{position:"start",children:(0,f.jsx)(H.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,f.jsx)(E.Z,{})})}),hn=(0,f.jsx)(le.Z,{position:"end",children:(0,f.jsx)(I.Z,{"aria-label":"Clear",size:"small",onClick:un,onKeyDown:on=>{on.key==="Enter"&&on.stopPropagation()},children:"Clear"})});return(0,f.jsx)(Xe,{children:(0,f.jsx)(ee.Z,{id:"search-bar-text-field","data-testid":"search-bar-next",variant:"outlined",margin:"normal",inputRef:q,value:rn,label:_e,placeholder:We,InputProps:{startAdornment:Tt,endAdornment:ue?hn:ot,...yt},inputProps:{"aria-label":ut,...At},fullWidth:xe,onChange:Ot,onKeyDown:mn,...Fe})})})),Lt=rt((0,V.forwardRef)((X,q)=>{const{value:_="",onChange:v,...L}=X,{term:Q,setTerm:W}=T();(0,V.useEffect)(()=>{_&&W(String(_))},[_,W]);const ue=(0,V.useCallback)(xe=>{v?v(xe):W(xe)},[v,W]);return(0,f.jsx)(n.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,f.jsx)(Et,{...L,ref:q,value:Q,onChange:ue})})}));var lt=r(4614),Ft=r(88013);const Zt=(0,u.Z)(X=>({loading:{right:X.spacing(1),position:"absolute"}})),et=X=>q=>(0,f.jsx)(Z,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(X,{...q})}),pt=()=>{const X=Zt();return(0,f.jsx)(lt.Z,{className:X.loading,"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20})},ft=et(function(q){const{loading:_,value:v,onChange:L=()=>{},options:Q=[],getOptionLabel:W=Ot=>String(Ot),inputPlaceholder:ue,inputDebounceTime:xe,freeSolo:Ve=!0,fullWidth:_e=!0,clearOnBlur:Qe=!1,"data-testid":At="search-autocomplete",...yt}=q,{setTerm:ot}=T(),Fe=(0,V.useCallback)(Ot=>Ot?typeof Ot=="string"?Ot:W(Ot):"",[W]),Ut=(0,V.useMemo)(()=>Fe(v),[v,Fe]),rn=(0,V.useCallback)((Ot,mn,un,ut)=>{ot(Fe(mn)),L(Ot,mn,un,ut)},[Fe,ot,L]),It=(0,V.useCallback)(({InputProps:{ref:Ot,className:mn,endAdornment:un},InputLabelProps:ut,...We})=>(0,f.jsx)(Lt,{...We,ref:Ot,clearButton:!1,value:Ut,placeholder:ue,debounceTime:xe,endAdornment:_?(0,f.jsx)(pt,{}):un,InputProps:{className:mn}}),[_,Ut,ue,xe]);return(0,f.jsx)(Ft.ZP,{...yt,"data-testid":At,value:v,onChange:rn,options:Q,getOptionLabel:W,renderInput:It,freeSolo:Ve,fullWidth:_e,clearOnBlur:Qe})}),jt=X=>{const{icon:q,primaryText:_,primaryTextTypographyProps:v,secondaryText:L,secondaryTextTypographyProps:Q,disableTextTypography:W}=X;return _jsxs(_Fragment,{children:[q?_jsx(ListItemIcon,{children:q}):null,_jsx(ListItemText,{primary:_,primaryTypographyProps:v,secondary:L,secondaryTypographyProps:Q,disableTypography:W})]})};var kt=r(42494),qt=r(84899),de=r(5806),ve=r(21324),ze=r(56939),Ee=r(73698),at=r(12231),bt=r(90436),dt=r(7089),Bt=r(69294);const St=(X,q,_=[],v=250)=>{const L=(0,V.useRef)({}),Q=X||(()=>Promise.resolve([])),[W,ue]=(0,Bt.default)(Q,[q],{loading:!0});if((0,ie.Z)(()=>{L.current[q]===void 0&&(L.current[q]=ue(q).then(Ve=>(L.current[q]=Ve,Ve)))},v,[ue,q]),_.length)return{loading:!1,value:_};const xe=L.current[q];return Array.isArray(xe)?{loading:!1,value:xe}:W},Gt=(X,q)=>{const{setFilters:_}=T();(0,V.useEffect)(()=>{q&&[q].flat().length>0&&_(v=>({...v,[X]:q}))},[])},$t=X=>{const{className:q,defaultValue:_,name:v,values:L,valuesDebounceMs:Q,label:W,filterSelectedOptions:ue,limitTags:xe,multiple:Ve}=X,[_e,Qe]=(0,V.useState)("");Gt(v,_);const At=typeof L=="function"?L:void 0,yt=typeof L=="function"?void 0:L,{value:ot,loading:Fe}=St(At,_e,yt,Q),{filters:Ut,setFilters:rn}=T(),It=Ut[v]||(Ve?[]:null),Ot=(ut,We)=>{rn(Tt=>{const{[v]:hn,...on}=Tt;return We?{...on,[v]:We}:{...on}})},mn=ut=>(0,f.jsx)(ee.Z,{...ut,name:"search",variant:"outlined",label:W,fullWidth:!0}),un=(ut,We)=>ut.map((Tt,hn)=>(0,f.jsx)(dt.Z,{label:Tt,color:"primary",...We({index:hn})}));return(0,f.jsx)(Ft.ZP,{filterSelectedOptions:ue,limitTags:xe,multiple:Ve,className:q,id:`${Ve?"multi-":""}select-filter-${v}--select`,options:ot||[],loading:Fe,value:It,onChange:Ot,onInputChange:(ut,We)=>Qe(We),renderInput:mn,renderTags:un})},pn=(0,u.Z)({label:{textTransform:"capitalize"},checkboxWrapper:{display:"flex",alignItems:"center",width:"100%"},textWrapper:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),an=X=>{const{className:q,defaultValue:_,label:v,name:L,values:Q=[],valuesDebounceMs:W}=X,ue=pn(),{filters:xe,setFilters:Ve}=T();Gt(L,_);const _e=typeof Q=="function"?Q:void 0,Qe=typeof Q=="function"?void 0:Q,{value:At=[],loading:yt}=St(_e,"",Qe,W),ot=Ut=>{const{target:{value:rn,checked:It}}=Ut;Ve(Ot=>{const{[L]:mn,...un}=Ot,ut=(mn||[]).filter(Tt=>Tt!==rn),We=It?[...ut,rn]:ut;return We.length?{...un,[L]:We}:un})};var Fe;return(0,f.jsxs)(kt.Z,{className:q,disabled:yt,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[v?(0,f.jsx)(qt.Z,{className:ue.label,children:v}):null,At.map(Ut=>(0,f.jsx)(de.Z,{classes:{root:ue.checkboxWrapper,label:ue.textWrapper},label:Ut,control:(0,f.jsx)(ve.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":Ut},value:Ut,name:Ut,onChange:ot,checked:((Fe=xe[L])!==null&&Fe!==void 0?Fe:[]).includes(Ut)})},Ut))]})},dn=X=>{const{className:q,defaultValue:_,label:v,name:L,values:Q,valuesDebounceMs:W}=X,ue=pn();Gt(L,_);const xe=typeof Q=="function"?Q:void 0,Ve=typeof Q=="function"?void 0:Q,{value:_e=[],loading:Qe}=St(xe,"",Ve,W),{filters:At,setFilters:yt}=T(),ot=Fe=>{const{target:{value:Ut}}=Fe;yt(rn=>{const{[L]:It,...Ot}=rn;return Ut?{...Ot,[L]:Ut}:Ot})};return(0,f.jsxs)(kt.Z,{disabled:Qe,className:q,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[v?(0,f.jsx)(ze.Z,{className:ue.label,margin:"dense",children:v}):null,(0,f.jsxs)(Ee.Z,{variant:"outlined",value:At[L]||"",onChange:ot,children:[(0,f.jsx)(at.Z,{value:"",children:(0,f.jsx)("em",{children:"All"})}),_e.map(Fe=>(0,f.jsx)(at.Z,{value:Fe,children:(0,f.jsx)(bt.Z,{variant:"inherit",noWrap:!0,children:Fe})},Fe))]})]})},_t=X=>{const{component:q,..._}=X;return(0,f.jsx)(q,{..._})};_t.Checkbox=X=>(0,f.jsx)(_t,{...X,component:an}),_t.Select=X=>(0,f.jsx)(_t,{...X,component:dn}),_t.Autocomplete=X=>(0,f.jsx)(_t,{...X,component:$t});var fn=r(48834).lW;const Yt=X=>fn.from(X.toString(),"utf-8").toString("base64"),nn=X=>X?Number(fn.from(X,"base64").toString("utf-8")):0,jn=X=>{const{total:q=-1,cursor:_,hasNextPage:v,onCursorChange:L,limit:Q=25,limitLabel:W="Results per page:",limitText:ue=({from:ot,to:Fe})=>q>0?`of ${q}`:`${ot}-${Fe}`,limitOptions:xe,onLimitChange:Ve,..._e}=X,Qe=useMemo(()=>nn(_),[_]),At=useCallback((ot,Fe)=>{L==null||L(Yt(Fe))},[L]),yt=useCallback(ot=>{const Fe=ot.target.value;Ve==null||Ve(parseInt(Fe,10))},[Ve]);return _jsx(TablePagination,{..._e,component:"div",count:q,page:Qe,nextIconButtonProps:{...v!==void 0&&{disabled:!v}},onPageChange:At,rowsPerPage:Q,labelRowsPerPage:W,labelDisplayedRows:ue,rowsPerPageOptions:xe,onRowsPerPageChange:yt})},en=X=>{const{pageLimit:q,setPageLimit:_,pageCursor:v,setPageCursor:L,fetchNextPage:Q}=useSearch(),W=useCallback(ue=>{_(ue),L(void 0)},[_,L]);return _jsx(jn,{...X,hasNextPage:!!Q,limit:q,onLimitChange:W,cursor:v,onCursorChange:L})};var bn=r(53974);const $n=X=>{const{children:q}=X,_=useSearch(),{result:v,...L}=_;return q(v,L)},tt=X=>{const{query:q,children:_}=X,v=useApi(searchApiRef),L=useAsync(()=>{const{term:Q="",types:W=[],filters:ue={},...xe}=q;return v.query({...xe,term:Q,types:W,filters:ue})},[q]);return _(L,q)},rr=X=>{const{query:q,children:_}=X;return q?_jsx(tt,{query:q,children:_}):_jsx($n,{children:_})},Ct=X=>{const{query:q,children:_,noResultsComponent:v=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...L}=X;return _jsx(rr,{query:q,children:({loading:Q,error:W,value:ue})=>Q?_jsx(Progress,{}):W?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:W}):ue!=null&&ue.results.length?isFunction(_)?_(ue):_jsx(SearchResultListItemExtensions,{...L,results:ue.results,children:_}):v})},nt=X=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(Ct,{...X})}),Tn=({result:X,highlight:q,icon:_,secondaryAction:v,lineClamp:L=5})=>X?_jsxs(_Fragment,{children:[_&&_jsx(ListItemIcon,{children:_}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:X.location,children:q!=null&&q.fields.title?_jsx(HighlightedSearchResultText,{text:(q==null?void 0:q.fields.title)||"",preTag:(q==null?void 0:q.preTag)||"",postTag:(q==null?void 0:q.postTag)||""}):X.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:L,overflow:"hidden"},color:"textSecondary",variant:"body2",children:q!=null&&q.fields.text?_jsx(HighlightedSearchResultText,{text:q.fields.text,preTag:q.preTag,postTag:q.postTag}):X.text})}),v&&_jsx(Box,{alignItems:"flex-end",children:v})]}):null,Jt=X=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(Tn,{...X})}),Rn=X=>{const{error:q,loading:_,resultItems:v,renderResultItem:L=xe=>_jsx(DefaultResultListItem,{result:xe.document},xe.document.location),disableRenderingWithNoResults:Q,noResultsComponent:W=Q?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...ue}=X;return _?_jsx(Progress,{}):q?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:q}):v!=null&&v.length?_jsx(List,{...ue,children:v.map(L)}):_jsx(_Fragment,{children:W})},Dn=X=>{const{query:q,renderResultItem:_,children:v,...L}=X,Q=useSearchResultListItemExtensions(v);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:q,children:({loading:W,error:ue,value:xe})=>_jsx(Rn,{...L,error:ue,loading:W,resultItems:xe==null?void 0:xe.results,renderResultItem:_!=null?_:Q})})})};var Sn=r(19126);const Nn=(0,u.Z)(X=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:X.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:X.palette.text.secondary,margin:X.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:X.palette.text.secondary,margin:X.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:X.spacing(.5)}})),Se=X=>{const q=Nn(),{label:_,children:v,...L}=X;return _jsx(Chip,{...L,className:q.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[_,": ",v]})})},ae=()=>null,Le=(0,u.Z)(X=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:X.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:X.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),Me=X=>{const q=Le(),{label:_,value:v="None",onChange:L,onDelete:Q}=X,W=useCallback(ue=>{L(ue.target.value)},[L]);return _jsx(Se,{label:_,onDelete:Q,children:_jsx(Typography,{role:"textbox",component:"span",className:q.root,onChange:W,contentEditable:!0,suppressContentEditableWarning:!0,children:v})})},Ge=(0,u.Z)(X=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:X.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),se=X=>{const q=Ge(),{label:_,value:v="none",onChange:L,onDelete:Q,children:W}=X,ue=useCallback(xe=>{L(xe.target.value)},[L]);return _jsx(Se,{label:_,onDelete:Q,children:_jsxs(Select,{className:q.root,value:v,onChange:ue,input:_jsx(InputBase,{}),IconComponent:ae,children:[_jsx(MenuItem,{value:"none",children:"None"}),W]})})};function M(X){const q=Nn(),[_,v]=useState(null),{error:L,loading:Q,icon:W,title:ue,titleProps:xe={},link:Ve=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:q.listSubheaderLinkIcon})]}),linkProps:_e={},filterOptions:Qe,renderFilterOption:At=We=>_jsx(MenuItem,{value:String(We),children:We},String(We)),filterFields:yt,renderFilterField:ot,resultItems:Fe,renderResultItem:Ut=We=>_jsx(DefaultResultListItem,{result:We.document},We.document.location),disableRenderingWithNoResults:rn,noResultsComponent:It=rn?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Ot}=X,mn=useCallback(We=>{v(We.currentTarget)},[]),un=useCallback(()=>{v(null)},[]);if(Q)return _jsx(Progress,{});if(L)return _jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:L});if(!(Fe!=null&&Fe.length))return _jsx(_Fragment,{children:It});var ut;return _jsxs(List,{...Ot,children:[_jsxs(ListSubheader,{className:q.listSubheader,children:[W,_jsx(Typography,{className:q.listSubheaderName,component:"strong",...xe,children:ue}),Qe?_jsx(Chip,{className:q.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:mn}):null,Qe?_jsx(Menu,{id:"filters-menu",anchorEl:_,open:Boolean(_),onClose:un,onClick:un,keepMounted:!0,children:Qe.map(At)}):null,yt==null?void 0:yt.map(We=>(ut=ot==null?void 0:ot(We))!==null&&ut!==void 0?ut:null),_jsx(Link,{className:q.listSubheaderLink,to:"/search",..._e,children:Ve})]}),Fe.map(Ut)]})}function me(X){const{query:q,children:_,renderResultItem:v,linkProps:L={},...Q}=X,W=useSearchResultListItemExtensions(_);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:q,children:({loading:ue,error:xe,value:Ve},{term:_e,types:Qe,pageCursor:At,filters:yt={}})=>{const ot=`/search?${qs.stringify({term:_e,types:Qe,filters:yt,pageCursor:At,query:_e},{arrayFormat:"brackets"})}`;return _jsx(M,{...Q,error:xe,loading:ue,linkProps:{to:ot,...L},filterFields:Object.keys(yt),resultItems:Ve==null?void 0:Ve.results,renderResultItem:v!=null?v:W})}})})}const Be=(0,u.Z)(X=>({root:{display:"flex",justifyContent:"space-between",gap:X.spacing(2),margin:X.spacing(2,0)}})),Ye=()=>{const{fetchNextPage:X,fetchPreviousPage:q}=useSearch(),_=Be();return!X&&!q?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:_.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!q,onClick:q,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!X,onClick:X,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},Je="search.results.list.items.extensions.v1",Dt=(X,q)=>{for(const _ of X){if(!isValidElement(_))continue;const v=getComponentData(_,Je);if(v!=null&&v(q))return cloneElement(_,{rank:q.rank,highlight:q.highlight,result:q.document,..._.props})}return null},Kt=X=>{const{rank:q,result:_,noTrack:v,children:L,alignItems:Q="flex-start",...W}=X,ue=(0,n.z$)(),xe=(0,V.useCallback)(()=>{v||_&&ue.captureEvent("discover",_.title,{attributes:{to:_.location},value:q})},[q,_,v,ue]);return(0,f.jsx)(g.Z,{divider:!0,alignItems:Q,onClickCapture:xe,...W,children:L})},tn=X=>{const{name:q,component:_,predicate:v=()=>!0}=X;return(0,n.YO)({name:q,component:{lazy:()=>_().then(L=>Q=>(0,f.jsx)(Kt,{rank:Q.rank,result:Q.result,noTrack:Q.noTrack,children:(0,V.createElement)(L,Q)}))},data:{[Je]:v}})},Qt=X=>{const q=useElementFilter(X,_=>_.selectByComponentData({key:Je}).getElements(),[X]);return useCallback((_,v)=>{const L=Dt(q,_);return _jsx(Fragment,{children:L!=null?L:_jsx(Kt,{rank:_.rank,result:_.document,children:_jsx(DefaultResultListItem,{rank:_.rank,highlight:_.highlight,result:_.document})})},v)},[q])},gn=X=>{const{results:q,children:_,...v}=X,L=Qt(_);return _jsx(List,{...v,children:q.map(L)})}},61886:function(vt,ke,r){"use strict";r.d(ke,{Ox:function(){return lt},jM:function(){return V},Zz:function(){return g},oZ:function(){return Z},DR:function(){return u},ZS:function(){return Te},VA:function(){return et},KY:function(){return ye},gT:function(){return E},Dl:function(){return ie},ux:function(){return Zt},$L:function(){return I},x1:function(){return Ne}});var n=r(52322),p=r(2784),G=r(73557),f=r(60871);const V="techdocs.addons.addon.v1",g="techdocs.addons.wrapper.v1",u=()=>null;(0,f.R5)(u,g,!0);const $=de=>`${V}.${de.toLocaleLowerCase("en-US")}`;function ye(de){const{name:ve,component:ze}=de;return(0,f.YO)({name:ve,component:{sync:Ee=>(0,n.jsx)(ze,{...Ee})},data:{[V]:de,[$(ve)]:!0}})}const le=(de,ve)=>de.selectByComponentData({key:ve}).getElements()[0],H=de=>de.selectByComponentData({key:g}).selectByComponentData({key:V}),ee=de=>de.selectByComponentData({key:g}).findComponentData({key:V}),I=()=>{const de=(0,G.pC)(),ve=(0,f.vJ)(de,H),ze=(0,f.vJ)(de,ee),Ee=(0,p.useCallback)(dt=>{if(!ve||!dt)return null;const Bt=$(dt.name);var St;return(St=le(ve,Bt))!==null&&St!==void 0?St:null},[ve]),at=(0,p.useCallback)(dt=>{const Bt=ze.find(St=>St.name===dt);return Bt?Ee(Bt):null},[ze,Ee]),bt=(0,p.useCallback)(dt=>{const Bt=ze.filter(St=>St.location===dt);return Bt.length?Bt.map(Ee):null},[ze,Ee]);return{renderComponentByName:at,renderComponentsByLocation:bt}},E=(0,f.T0)({id:"plugin.techdocs.service"}),ie=(0,f.T0)({id:"plugin.techdocs.storageservice"});var ne=r(64279),re=r(77446),D=r(25271),N=r(51837);function P(de,ve){return ve.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(de.kind=de.kind.toLocaleLowerCase(),de.name=de.name.toLocaleLowerCase(),de.namespace=de.namespace.toLocaleLowerCase()),de}const T=(de,ve)=>(0,D.eE)(de)===(0,D.eE)(ve),k={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},te=(0,N.CT)("techdocs-reader-page-context"),Te=(0,p.memo)(de=>{const{entityRef:ve,children:ze}=de,Ee=(0,f.h_)(E),at=(0,f.h_)(f.Ds),bt=(0,ne.default)(async()=>Ee.getEntityMetadata(ve),[ve]),dt=(0,re.Z)(async()=>Ee.getTechDocsMetadata(ve),[ve]),[Bt,St]=(0,p.useState)(k.title),[Gt,$t]=(0,p.useState)(k.subtitle),[pn,an]=(0,p.useState)(k.shadowRoot);(0,p.useEffect)(()=>{pn&&!dt.value&&!dt.loading&&dt.retry()},[dt.value,dt.loading,pn,dt.retry,dt]);const dn={metadata:dt,entityRef:P(ve,at),entityMetadata:bt,shadowRoot:pn,setShadowRoot:an,title:Bt,setTitle:St,subtitle:Gt,setSubtitle:$t},_t=(0,N.EI)({1:dn});return(0,n.jsx)(f.fC,{attributes:{entityRef:(0,D.eE)(ve)},children:(0,n.jsx)(te.Provider,{value:_t,children:ze instanceof Function?ze(dn):ze})})},(de,ve)=>T(de.entityRef,ve.entityRef)),Ne=()=>{const de=(0,p.useContext)(te);if(de===void 0)return k;const ve=de.atVersion(1);if(ve===void 0)throw new Error("No context found for version 1.");return ve},Z=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var Xe=r(70882),rt=r(50236),Et=r(19219),Lt=r(53974);const lt="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",Ft=de=>{(0,p.useEffect)(()=>{if(!de)return()=>{};const ve=de.querySelectorAll('head > link[rel="stylesheet"]');var ze;let Ee=(ze=ve==null?void 0:ve.length)!==null&&ze!==void 0?ze:0;const at=new CustomEvent(lt);if(!Ee)return de.dispatchEvent(at),()=>{};const bt=()=>{--Ee===0&&de.dispatchEvent(at)};return ve==null||ve.forEach(dt=>{dt.addEventListener("load",bt)}),()=>{ve==null||ve.forEach(dt=>{dt.removeEventListener("load",bt)})}},[de])},Zt=de=>{const[ve,ze]=(0,p.useState)(!1);return(0,p.useEffect)(()=>{if(!de)return()=>{};ze(!0);const Ee=de.style;Ee.setProperty("opacity","0");const at=()=>{ze(!1),Ee.setProperty("opacity","1")};return de.addEventListener(lt,at),()=>{de.removeEventListener(lt,at)}},[de]),ve},et=de=>{const{element:ve,onAppend:ze,children:Ee}=de,[at,bt]=(0,p.useState)((0,Xe.Ue)({...(0,rt.Z)(),insertionPoint:void 0}));Ft(ve);const dt=Zt(ve),Bt=(0,p.useCallback)(St=>{if(!ve||!St)return;bt((0,Xe.Ue)({...(0,rt.Z)(),insertionPoint:ve.querySelector("head")||void 0}));let Gt=St.shadowRoot;Gt||(Gt=St.attachShadow({mode:"open"})),Gt.replaceChildren(ve),typeof ze=="function"&&ze(Gt)},[ve,ze]);return(0,n.jsxs)(n.Fragment,{children:[dt&&(0,n.jsx)(Lt.Ex,{}),(0,n.jsxs)(Et.ZP,{jss:at,sheetsManager:new Map,children:[(0,n.jsx)("div",{ref:Bt,"data-testid":"techdocs-native-shadowroot"}),Ee]})]})};var pt=r(54073);const ft=()=>{const{shadowRoot:de}=useTechDocsReaderPage();return de},jt=de=>{const ve=ft();return ve?de.map(ze=>ve==null?void 0:ve.querySelectorAll(ze)).filter(ze=>ze.length).map(ze=>Array.from(ze)).flat():[]},kt=de=>de.toString()&&de.rangeCount&&de.getRangeAt(0).getBoundingClientRect().top,qt=(de=0)=>{const ve=ft(),[ze,Ee]=useState(null),at=useMemo(()=>debounce(()=>{const bt=ve,dt=bt.getSelection?bt.getSelection():document.getSelection();dt&&kt(dt)?Ee(dt):Ee(null)},de),[ve,Ee,de]);return useEffect(()=>(window.document.addEventListener("selectionchange",at),()=>{at.cancel(),window.document.removeEventListener("selectionchange",at)}),[at]),ze}},52943:function(vt,ke,r){"use strict";r.r(ke),r.d(ke,{EmbeddedDocsRouter:function(){return ne},Router:function(){return ie},isTechDocsAvailable:function(){return E}});var n=r(52322),p=r(2784),G=r(73557),f=r(43514),V=r(53974),g=r(25271),u=r(89258),$=r(65124),ye=r(86317);const le=({entity:re})=>{const D=(0,g.iB)(re);return(0,n.jsxs)(u.I6,{entityRef:D,children:[(0,n.jsx)($.b,{}),(0,n.jsx)(ye.F,{withSearch:!1})]})};var H=r(18662),ee=r(7476);const I="backstage.io/techdocs-ref",E=re=>{var D,N;return Boolean(re==null||(D=re.metadata)===null||D===void 0||(N=D.annotations)===null||N===void 0?void 0:N[I])},ie=()=>(0,n.jsxs)(G.Z5,{children:[(0,n.jsx)(G.AW,{path:"/",element:(0,n.jsx)(H.TechDocsIndexPage,{})}),(0,n.jsx)(G.AW,{path:"/:namespace/:kind/:name/*",element:(0,n.jsx)(ee.TechDocsReaderPage,{})})]}),ne=re=>{var D;const{children:N}=re,{entity:P}=(0,f.X2)(),T=(0,G.V$)([{path:"/*",element:(0,n.jsx)(le,{entity:P}),children:[{path:"*",element:N}]}]);return((D=P.metadata.annotations)===null||D===void 0?void 0:D[I])?T:(0,n.jsx)(V.sk,{annotation:I})}},92077:function(vt,ke,r){"use strict";r.d(ke,{k:function(){return g},p:function(){return V}});var n=r(87612),p=r(23054),G=r(54847),f=r.n(G);class V{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata($){const{kind:ye,namespace:le,name:H}=$,I=`${await this.getApiOrigin()}/metadata/techdocs/${le}/${ye}/${H}`,E=await this.fetchApi.fetch(`${I}`);if(!E.ok)throw await p.VL.fromResponse(E);return await E.json()}async getEntityMetadata($){const{kind:ye,namespace:le,name:H}=$,I=`${await this.getApiOrigin()}/metadata/entity/${le}/${ye}/${H}`,E=await this.fetchApi.fetch(`${I}`);if(!E.ok)throw await p.VL.fromResponse(E);return await E.json()}constructor($){(0,n._)(this,"configApi",void 0),(0,n._)(this,"discoveryApi",void 0),(0,n._)(this,"fetchApi",void 0),this.configApi=$.configApi,this.discoveryApi=$.discoveryApi,this.fetchApi=$.fetchApi}}class g{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var $;return($=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&$!==void 0?$:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs($,ye){const{kind:le,namespace:H,name:ee}=$,E=`${await this.getStorageUrl()}/${H}/${le}/${ee}/${ye}`,ie=await this.fetchApi.fetch(`${E.endsWith("/")?E:`${E}/`}index.html`);let ne="";switch(ie.status){case 404:throw ne="Page not found. ",ye||(ne+="This could be because there is no index.md file in the root of the docs directory of this repository."),new p.dR(ne);case 500:throw ne="Could not generate documentation or an error in the TechDocs backend. ",new Error(ne);default:break}return ie.text()}async syncEntityDocs($,ye=()=>{}){const{kind:le,namespace:H,name:ee}=$,E=`${await this.getApiOrigin()}/sync/${H}/${le}/${ee}`,{token:ie}=await this.identityApi.getCredentials();return new Promise((ne,re)=>{const D=new G.EventSourcePolyfill(E,{withCredentials:!0,headers:ie?{Authorization:`Bearer ${ie}`}:{}});D.addEventListener("log",N=>{N.data&&ye(JSON.parse(N.data))}),D.addEventListener("finish",N=>{let P=!1;N.data&&({updated:P}=JSON.parse(N.data)),ne(P?"updated":"cached")}),D.onerror=N=>{switch(D.close(),N.status){case 404:re(new p.dR(N.message));return;default:re(new Error(N.data));return}}})}async getBaseUrl($,ye,le){const{kind:H,namespace:ee,name:I}=ye,ie=`${await this.getApiOrigin()}/static/docs/${ee}/${H}/${I}/${le}`;return new URL($,ie.endsWith("/")?ie:`${ie}/`).toString()}constructor($){(0,n._)(this,"configApi",void 0),(0,n._)(this,"discoveryApi",void 0),(0,n._)(this,"identityApi",void 0),(0,n._)(this,"fetchApi",void 0),this.configApi=$.configApi,this.discoveryApi=$.discoveryApi,this.identityApi=$.identityApi,this.fetchApi=$.fetchApi}}},51953:function(vt,ke,r){"use strict";r.d(ke,{D:function(){return n}});function n(p,G){return G.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?p:p.toLocaleLowerCase("en-US")}},3482:function(vt,ke,r){"use strict";r.d(ke,{u:function(){return $}});var n=r(52322),p=r(2784),G=r(53974),f=r(43514),V=r(42081),g=r(48431),u=r(68435);const $=ye=>{const{initialFilter:le="owned",columns:H,actions:ee}=ye;return(0,n.jsx)(V.j,{children:(0,n.jsxs)(G.VY,{children:[(0,n.jsx)(G.yW,{title:"",children:(0,n.jsx)(G.qt,{children:"Discover documentation in your ecosystem."})}),(0,n.jsx)(f.UO,{children:(0,n.jsxs)(f._i,{children:[(0,n.jsxs)(f._i.Filters,{children:[(0,n.jsx)(g.f,{}),(0,n.jsx)(f.EW,{initialFilter:le}),(0,n.jsx)(f.dq,{}),(0,n.jsx)(f.xE,{})]}),(0,n.jsx)(f._i.Content,{children:(0,n.jsx)(u.n,{actions:ee,columns:H})})]})})]})})}},85478:function(vt,ke,r){"use strict";r.d(ke,{f:function(){return H}});var n=r(52322),p=r(95573),G=r(51953),f=r(60871),V=r(53974),g=r(94339),u=r(16111),$=r(24579),ye=r(14503),le=r(2784);const H=ne=>{const{entities:re}=ne,D=(0,f.tg)(p.Fw),N=(0,f.h_)(f.Ds);if(!re)return null;var P,T;return(0,n.jsx)(V.Oh,{"data-testid":"docs-explore",children:re!=null&&re.length?re.map((k,te)=>(0,n.jsxs)(g.Z,{children:[(0,n.jsx)(u.Z,{children:(0,n.jsx)(V.hu,{title:(P=k.metadata.title)!==null&&P!==void 0?P:k.metadata.name})}),(0,n.jsx)($.Z,{children:k.metadata.description}),(0,n.jsx)(ye.Z,{children:(0,n.jsx)(V.Qj,{to:D({namespace:(0,G.D)((T=k.metadata.namespace)!==null&&T!==void 0?T:"default",N),kind:(0,G.D)(k.kind,N),name:(0,G.D)(k.metadata.name,N)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},te)):null})};var ee=r(43514);const I={title:"All Documentation",filterPredicate:()=>!0},E=ne=>{const{entities:re,group:D}=ne,{loading:N,isOwnedEntity:P}=useEntityOwnership(),T=re.filter(te=>D.filterPredicate==="ownedByUser"?N?!1:P(te):typeof D.filterPredicate=="function"&&D.filterPredicate(te)),k=(()=>typeof D.title=="string"?_jsx(ContentHeader,{title:D.title}):D.title)();return T.length===0?null:_jsxs(Content,{children:[k,_jsx(DocsCardGrid,{entities:T})]})},ie=ne=>{const{loading:re,error:D,entities:N}=useEntityList();if(D)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:D.toString()})});if(re)return _jsx(Progress,{});if(N.length===0)return _jsx("div",{"data-testid":"doc-not-found",children:_jsxs(Typography,{variant:"body2",children:["No documentation found that match your filter. Learn more about"," ",_jsx(Link,{to:"https://backstage.io/docs/features/techdocs/creating-and-publishing",children:"publishing documentation"}),"."]})});var P,T;return N.sort((k,te)=>((P=k.metadata.title)!==null&&P!==void 0?P:k.metadata.name).localeCompare((T=te.metadata.title)!==null&&T!==void 0?T:te.metadata.name)),_jsx(Content,{children:(ne.groups||[I]).map((k,te)=>_jsx(E,{entities:N,group:k},`${k.title}-${te}`))})}},68435:function(vt,ke,r){"use strict";r.d(ke,{H:function(){return N},n:function(){return P}});var n=r(52322),p=r(2784),G=r(95074),f=r(76635),V=r(53974),g=r(43514),u=r(60871),$=r(25271),ye=r(95573),le=r(39981),H=r(2337),ee=r(11640),I=r(28347);const E=(0,H.Z)({root:{color:"#f3ba37"}})(ee.Z),ie={createCopyDocsUrlAction(T){return k=>({icon:()=>(0,n.jsx)(le.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>T(`${window.location.origin}${k.resolved.docsUrl}`)})},createStarEntityAction(T,k){return te=>{const Te=te.entity,Ne=T(Te);return{cellStyle:{paddingLeft:"1em"},icon:()=>Ne?(0,n.jsx)(E,{}):(0,n.jsx)(I.Z,{}),tooltip:Ne?"Remove from favorites":"Add to favorites",onClick:()=>k(Te)}}}};function ne(T){return T.metadata.title||T.metadata.name}const re={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:T=>(0,n.jsx)(V.uw,{value:(0,n.jsx)(V.rU,{to:T.resolved.docsUrl,children:ne(T.entity)}),subvalue:T.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:T})=>(0,n.jsx)(g.rI,{entityRefs:T.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var D=r(51953);const N=T=>{const{entities:k,title:te,loading:Te,columns:Ne,actions:Z,options:Xe}=T,[,rt]=(0,G.Z)(),Et=(0,u.tg)(ye.Fw),Lt=(0,u.h_)(u.Ds);if(!k)return null;const lt=k.map(et=>{const pt=(0,g.hF)(et,$.S4);var ft;return{entity:et,resolved:{docsUrl:Et({namespace:(0,D.D)((ft=et.metadata.namespace)!==null&&ft!==void 0?ft:"default",Lt),kind:(0,D.D)(et.kind,Lt),name:(0,D.D)(et.metadata.name,Lt)}),ownedByRelations:pt,ownedByRelationsTitle:pt.map(jt=>(0,g.$3)(jt,{defaultKind:"group"})).join(", ")}}}),Ft=[re.createNameColumn(),re.createOwnerColumn(),re.createTypeColumn()],Zt=[ie.createCopyDocsUrlAction(rt)];return(0,n.jsx)(n.Fragment,{children:Te||lt&&lt.length>0?(0,n.jsx)(V.iA,{isLoading:Te,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1,...Xe},data:lt,columns:Ne||Ft,actions:Z||Zt,title:te?`${te} (${lt.length})`:`All (${lt.length})`}):(0,n.jsx)(V.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,n.jsx)(V.Qj,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};N.columns=re,N.actions=ie;const P=T=>{var k;const{columns:te,actions:Te,options:Ne}=T,{loading:Z,error:Xe,entities:rt,filters:Et}=(0,g.wp)(),{isStarredEntity:Lt,toggleStarredEntity:lt}=(0,g.CR)(),[,Ft]=(0,G.Z)();var Zt;const et=(0,f.capitalize)((Zt=(k=Et.user)===null||k===void 0?void 0:k.value)!==null&&Zt!==void 0?Zt:"all"),pt=[ie.createCopyDocsUrlAction(Ft),ie.createStarEntityAction(Lt,lt)];return Xe?(0,n.jsx)(V.GB,{severity:"error",title:"Could not load available documentation.",children:(0,n.jsx)(V.Oi,{language:"text",text:Xe.toString()})}):(0,n.jsx)(N,{title:et,entities:rt,loading:Z,actions:Te||pt,columns:te,options:Ne})};P.columns=re,P.actions=ie},18662:function(vt,ke,r){"use strict";r.r(ke),r.d(ke,{TechDocsIndexPage:function(){return V}});var n=r(52322),p=r(2784),G=r(73557),f=r(3482);const V=g=>(0,G.pC)()||(0,n.jsx)(f.u,{...g})},42081:function(vt,ke,r){"use strict";r.d(ke,{j:function(){return V}});var n=r(52322),p=r(2784),G=r(53974),f=r(60871);const V=g=>{const{children:u}=g,$=(0,f.h_)(f.Ds);var ye;const le=`Documentation available in ${(ye=$.getOptionalString("organization.name"))!==null&&ye!==void 0?ye:"Backstage"}`;return(0,n.jsx)(G.g9,{title:"Documentation",subtitle:le,themeId:"documentation",children:u})}},48431:function(vt,ke,r){"use strict";r.d(ke,{f:function(){return f}});var n=r(2784),p=r(43514);class G{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":p.n3}}}const f=()=>{const{updateFilters:V}=(0,p.wp)();return(0,n.useEffect)(()=>{V({techdocs:new G})},[V]),null}},89258:function(vt,ke,r){"use strict";r.d(ke,{I6:function(){return H},Jl:function(){return le},s4:function(){return g}});var n=r(61886),p=r(92077),G=r(95573),f=r(60871),V=r(15096);const g=(0,f.rx)({id:"techdocs",apis:[(0,f.ni)({api:n.Dl,deps:{configApi:f.Ds,discoveryApi:f.NW,identityApi:f.$4,fetchApi:f.gP},factory:({configApi:I,discoveryApi:E,identityApi:ie,fetchApi:ne})=>new p.k({configApi:I,discoveryApi:E,identityApi:ie,fetchApi:ne})}),(0,f.ni)({api:n.gT,deps:{configApi:f.Ds,discoveryApi:f.NW,fetchApi:f.gP},factory:({configApi:I,discoveryApi:E,fetchApi:ie})=>new p.p({configApi:I,discoveryApi:E,fetchApi:ie})})],routes:{root:G._Z,docRoot:G.Fw,entityContent:G.pd}}),u=g.provide((0,f.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(r.bind(r,52943)).then(I=>I.Router),mountPoint:G._Z})),$=g.provide((0,f.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(r.bind(r,52943)).then(I=>I.EmbeddedDocsRouter),mountPoint:G.pd})),ye=g.provide((0,f.P4)({name:"TechDocsCustomHome",component:()=>r.e(7560).then(r.bind(r,27560)).then(I=>I.TechDocsCustomHome),mountPoint:G._Z})),le=g.provide((0,f.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(r.bind(r,18662)).then(I=>I.TechDocsIndexPage),mountPoint:G._Z})),H=g.provide((0,f.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(r.bind(r,7476)).then(I=>I.TechDocsReaderPage),mountPoint:G.Fw})),ee=g.provide((0,V.E5)({name:"TechDocsSearchResultListItem",component:()=>Promise.resolve().then(r.bind(r,55511)).then(I=>I.TechDocsSearchResultListItem),predicate:I=>I.type==="techdocs"}))},7476:function(vt,ke,r){"use strict";r.r(ke),r.d(ke,{TechDocsReaderLayout:function(){return H},TechDocsReaderPage:function(){return ee}});var n=r(52322),p=r(2784),G=r(73557),f=r(53974),V=r(61886),g=r(86317),u=r(93225),$=r(65124),ye=r(95573),le=r(60871);const H=I=>{const{withSearch:E,withHeader:ie=!0}=I;return(0,n.jsxs)(f.T3,{themeId:"documentation",children:[ie&&(0,n.jsx)(u.S,{}),(0,n.jsx)($.b,{}),(0,n.jsx)(g.F,{withSearch:E})]})},ee=I=>{const{kind:E,name:ie,namespace:ne}=(0,le.Oi)(ye.Fw),{children:re,entityRef:D={kind:E,name:ie,namespace:ne}}=I,N=(0,G.pC)();if(!re){const T=N?p.Children.toArray(N.props.children):[];var P;const te=T.flatMap(Te=>{var Ne;return(P=Te==null||(Ne=Te.props)===null||Ne===void 0?void 0:Ne.children)!==null&&P!==void 0?P:[]}).find(Te=>!(0,le.IY)(Te,V.Zz)&&!(0,le.IY)(Te,V.jM));return(0,n.jsx)(V.ZS,{entityRef:D,children:te||(0,n.jsx)(H,{})})}return(0,n.jsx)(V.ZS,{entityRef:D,children:({metadata:T,entityMetadata:k,onReady:te})=>(0,n.jsx)("div",{className:"techdocs-reader-page",children:(0,n.jsx)(f.T3,{themeId:"documentation",children:re instanceof Function?re({entityRef:D,techdocsMetadataValue:T.value,entityMetadataValue:k.value,onReady:te}):re})})})}},86317:function(vt,ke,r){"use strict";r.d(ke,{F:function(){return q}});var n=r(52322),p=r(2784),G=r(79692),f=r(60905),V=r(61886),g=r(53974),u=r(22478),$=r(4614),ye=r(77277),le=r(99688),H=r(12420),ee=r(90436),I=r(61837),E=r(4190),ie=r(87685);const ne=(0,G.Z)(v=>(0,H.Z)({paper:{width:"100%",[v.breakpoints.up("sm")]:{width:"75%"},[v.breakpoints.up("md")]:{width:"50%"},padding:v.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:v.palette.background.default}})),re=({buildLog:v,onClose:L})=>{const Q=ne(),W=v.length===0?"Waiting for logs...":v.join(`
37
- `);return(0,n.jsxs)(f.Z,{container:!0,direction:"column",className:Q.root,spacing:0,wrap:"nowrap",children:[(0,n.jsxs)(f.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,n.jsx)(ee.Z,{variant:"h5",children:"Build Details"}),(0,n.jsx)(I.Z,{title:"Close the drawer",onClick:L,color:"inherit",children:(0,n.jsx)(ie.Z,{})},"dismiss")]}),(0,n.jsx)(f.Z,{item:!0,xs:!0,children:(0,n.jsx)(g.nU,{text:W,classes:{root:Q.logs}})})]})},D=({buildLog:v})=>{const L=ne(),[Q,W]=(0,p.useState)(!1);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ye.Z,{color:"inherit",onClick:()=>W(!0),children:"Show Build Logs"}),(0,n.jsx)(E.ZP,{classes:{paper:L.paper},anchor:"right",open:Q,onClose:()=>W(!1),children:(0,n.jsx)(re,{buildLog:v,onClose:()=>W(!1)})})]})};var N=r(60871);const P=({errorMessage:v})=>{const L=(0,N.h_)(N.Ds).getOptionalString("techdocs.builder");let Q="";return L!=="local"&&(Q="Note that techdocs.builder is not set to 'local' in your config, which means this Backstage app will not generate docs if they are not found. Make sure the project's docs are generated and published by some external process (e.g. CI/CD pipeline). Or change techdocs.builder to 'local' to generate docs from this Backstage instance."),(0,n.jsx)(g.mf,{status:"404",statusMessage:v||"Documentation not found",additionalInfo:Q})};var T=r(95481);const k=(0,G.Z)(v=>({root:{marginBottom:v.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),te=()=>{let v=null;const L=k(),{state:Q,contentReload:W,contentErrorMessage:ue,syncErrorMessage:xe,buildLog:Ve}=(0,T.DK)();return Q==="INITIAL_BUILD"&&(v=(0,n.jsx)(le.Z,{classes:{root:L.root},variant:"outlined",severity:"info",icon:(0,n.jsx)($.Z,{size:"24px"}),action:(0,n.jsx)(D,{buildLog:Ve}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),Q==="CONTENT_STALE_REFRESHING"&&(v=(0,n.jsx)(le.Z,{variant:"outlined",severity:"info",icon:(0,n.jsx)($.Z,{size:"24px"}),action:(0,n.jsx)(D,{buildLog:Ve}),classes:{root:L.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),Q==="CONTENT_STALE_READY"&&(v=(0,n.jsx)(le.Z,{variant:"outlined",severity:"success",action:(0,n.jsx)(ye.Z,{color:"inherit",onClick:()=>W(),children:"Refresh"}),classes:{root:L.root},children:"A newer version of this documentation is now available, please refresh to view."})),Q==="CONTENT_STALE_ERROR"&&(v=(0,n.jsxs)(le.Z,{variant:"outlined",severity:"error",action:(0,n.jsx)(D,{buildLog:Ve}),classes:{root:L.root,message:L.message},children:["Building a newer version of this documentation failed."," ",xe]})),Q==="CONTENT_NOT_FOUND"&&(v=(0,n.jsxs)(n.Fragment,{children:[xe&&(0,n.jsxs)(le.Z,{variant:"outlined",severity:"error",action:(0,n.jsx)(D,{buildLog:Ve}),classes:{root:L.root,message:L.message},children:["Building a newer version of this documentation failed."," ",xe]}),(0,n.jsx)(P,{errorMessage:ue})]})),v};var Te=r(60364),Ne=r(41156),Z=r(32838),Xe=r(35368),rt=r.n(Xe);const Et=/main\.[A-Fa-f0-9]{8}\.min\.css$/,Lt=/^https:\/\/fonts\.googleapis\.com/,lt=/^https:\/\/fonts\.gstatic\.com/,Ft=v=>v.nodeName==="LINK",Zt=v=>{const L=(v==null?void 0:v.getAttribute("href"))||"",Q=L.match(Et),W=L.match(Lt),ue=L.match(lt);return Q||W||ue},et=v=>(Ft(v)&&!Zt(v)&&v.remove(),v),pt=v=>v.nodeName==="IFRAME",ft=(v,L)=>{const Q=v.getAttribute("src")||"";try{const{host:W}=new URL(Q);return L.includes(W)}catch{return!1}},jt=v=>L=>(pt(L)&&!ft(L,v)&&L.remove(),L),kt=()=>{const v=(0,N.h_)(N.Ds);return(0,p.useMemo)(()=>v.getOptionalConfig("techdocs.sanitizer"),[v])},qt=()=>{const v=kt();return(0,p.useCallback)(async L=>{const Q=v==null?void 0:v.getOptionalStringArray("allowedIframeHosts");rt().addHook("beforeSanitizeElements",et);const W=["link"];return Q&&(W.push("iframe"),rt().addHook("beforeSanitizeElements",jt(Q))),rt().sanitize(L.outerHTML,{ADD_TAGS:W,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[v])};var de=r(41128),ve=({theme:v})=>`
38
- /*================== Variables ==================*/
39
- /*
40
- As the MkDocs output is rendered in shadow DOM, the CSS variable definitions on the root selector are not applied. Instead, they have to be applied on :host.
41
- As there is no way to transform the served main*.css yet (for example in the backend), we have to copy from main*.css and modify them.
42
- */
43
-
44
- :host {
45
- /* FONT */
46
- --md-default-fg-color: ${v.palette.text.primary};
47
- --md-default-fg-color--light: ${v.palette.text.secondary};
48
- --md-default-fg-color--lighter: ${(0,de.$n)(v.palette.text.secondary,.7)};
49
- --md-default-fg-color--lightest: ${(0,de.$n)(v.palette.text.secondary,.3)};
50
-
51
- /* BACKGROUND */
52
- --md-default-bg-color:${v.palette.background.default};
53
- --md-default-bg-color--light: ${v.palette.background.paper};
54
- --md-default-bg-color--lighter: ${(0,de.$n)(v.palette.background.paper,.7)};
55
- --md-default-bg-color--lightest: ${(0,de.$n)(v.palette.background.paper,.3)};
56
-
57
- /* PRIMARY */
58
- --md-primary-fg-color: ${v.palette.primary.main};
59
- --md-primary-fg-color--light: ${v.palette.primary.light};
60
- --md-primary-fg-color--dark: ${v.palette.primary.dark};
61
- --md-primary-bg-color: ${v.palette.primary.contrastText};
62
- --md-primary-bg-color--light: ${(0,de.$n)(v.palette.primary.contrastText,.7)};
63
-
64
- /* ACCENT */
65
- --md-accent-fg-color: var(--md-primary-fg-color);
66
-
67
- /* SHADOW */
68
- --md-shadow-z1: ${v.shadows[1]};
69
- --md-shadow-z2: ${v.shadows[2]};
70
- --md-shadow-z3: ${v.shadows[3]};
71
-
72
- /* EXTENSIONS */
73
- --md-admonition-fg-color: var(--md-default-fg-color);
74
- --md-admonition-bg-color: var(--md-default-bg-color);
75
- /* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */
76
- --md-admonition-icon--note: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>');
77
- --md-admonition-icon--abstract: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 5h16v2H4V5m0 4h16v2H4V9m0 4h16v2H4v-2m0 4h10v2H4v-2z"/></svg>');
78
- --md-admonition-icon--info: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10A10 10 0 0012 2z"/></svg>');
79
- --md-admonition-icon--tip: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.55 11.2c-.23-.3-.5-.56-.76-.82-.65-.6-1.4-1.03-2.03-1.66C13.3 7.26 13 4.85 13.91 3c-.91.23-1.75.75-2.45 1.32-2.54 2.08-3.54 5.75-2.34 8.9.04.1.08.2.08.33 0 .22-.15.42-.35.5-.22.1-.46.04-.64-.12a.83.83 0 01-.15-.17c-1.1-1.43-1.28-3.48-.53-5.12C5.89 10 5 12.3 5.14 14.47c.04.5.1 1 .27 1.5.14.6.4 1.2.72 1.73 1.04 1.73 2.87 2.97 4.84 3.22 2.1.27 4.35-.12 5.96-1.6 1.8-1.66 2.45-4.32 1.5-6.6l-.13-.26c-.2-.46-.47-.87-.8-1.25l.05-.01m-3.1 6.3c-.28.24-.73.5-1.08.6-1.1.4-2.2-.16-2.87-.82 1.19-.28 1.89-1.16 2.09-2.05.17-.8-.14-1.46-.27-2.23-.12-.74-.1-1.37.18-2.06.17.38.37.76.6 1.06.76 1 1.95 1.44 2.2 2.8.04.14.06.28.06.43.03.82-.32 1.72-.92 2.27h.01z"/></svg>');
80
- --md-admonition-icon--success: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
81
- --md-admonition-icon--question: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.07 11.25l-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 00-2-2 2 2 0 00-2 2H8a4 4 0 014-4 4 4 0 014 4 3.2 3.2 0 01-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10c0-5.53-4.5-10-10-10z"/></svg>');
82
- --md-admonition-icon--warning: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 14h-2v-4h2m0 8h-2v-2h2M1 21h22L12 2 1 21z"/></svg>');
83
- --md-admonition-icon--failure: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12 6.47 2 12 2m3.59 5L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41 15.59 7z"/></svg>');
84
- --md-admonition-icon--danger: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.5 20l4.86-9.73H13V4l-5 9.73h3.5V20M12 2c2.75 0 5.1 1 7.05 2.95C21 6.9 22 9.25 22 12s-1 5.1-2.95 7.05C17.1 21 14.75 22 12 22s-5.1-1-7.05-2.95C3 17.1 2 14.75 2 12s1-5.1 2.95-7.05C6.9 3 9.25 2 12 2z"/></svg>');
85
- --md-admonition-icon--bug: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 12h-4v-2h4m0 6h-4v-2h4m6-6h-2.81a5.985 5.985 0 00-1.82-1.96L17 4.41 15.59 3l-2.17 2.17a6.002 6.002 0 00-2.83 0L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8z"/></svg>');
86
- --md-admonition-icon--example: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 13v-2h14v2H7m0 6v-2h14v2H7M7 7V5h14v2H7M3 8V5H2V4h2v4H3m-1 9v-1h3v4H2v-1h2v-.5H3v-1h1V17H2m2.25-7a.75.75 0 01.75.75c0 .2-.08.39-.21.52L3.12 13H5v1H2v-.92L4 11H2v-1h2.25z"/></svg>');
87
- --md-admonition-icon--quote: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 17h3l2-4V7h-6v6h3M6 17h3l2-4V7H5v6h3l-2 4z"/></svg>');
88
- --md-footnotes-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.42L5.83 13H21V7h-2z"/></svg>');
89
- --md-details-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
90
- --md-tasklist-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/></svg>');
91
- --md-tasklist-icon--checked: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
92
- --md-nav-icon--prev: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>');
93
- --md-nav-icon--next: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
94
- --md-toc-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 9h14V7H3v2m0 4h14v-2H3v2m0 4h14v-2H3v2m16 0h2v-2h-2v2m0-10v2h2V7h-2m0 6h2v-2h-2v2z"/></svg>');
95
- --md-clipboard-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1z"/></svg>');
96
- --md-search-result-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h7c-.41-.25-.8-.56-1.14-.9-.33-.33-.61-.7-.86-1.1H6V4h7v5h5v1.18c.71.16 1.39.43 2 .82V8l-6-6m6.31 16.9c1.33-2.11.69-4.9-1.4-6.22-2.11-1.33-4.91-.68-6.22 1.4-1.34 2.11-.69 4.89 1.4 6.22 1.46.93 3.32.93 4.79.02L22 23.39 23.39 22l-3.08-3.1m-3.81.1a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5z"/></svg>');
97
- --md-source-forks-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 2.122a2.25 2.25 0 1 0-1.5 0v.878A2.25 2.25 0 0 0 5.75 8.5h1.5v2.128a2.251 2.251 0 1 0 1.5 0V8.5h1.5a2.25 2.25 0 0 0 2.25-2.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75h-4.5A.75.75 0 0 1 5 6.25v-.878zm3.75 7.378a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm3-8.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5z"/></svg>');
98
- --md-source-repositories-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 1 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 0 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 0 1 1-1h8zM5 12.25v3.25a.25.25 0 0 0 .4.2l1.45-1.087a.25.25 0 0 1 .3 0L8.6 15.7a.25.25 0 0 0 .4-.2v-3.25a.25.25 0 0 0-.25-.25h-3.5a.25.25 0 0 0-.25.25z"/></svg>');
99
- --md-source-stars-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694v.001z"/></svg>');
100
- --md-source-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2.5 7.775V2.75a.25.25 0 0 1 .25-.25h5.025a.25.25 0 0 1 .177.073l6.25 6.25a.25.25 0 0 1 0 .354l-5.025 5.025a.25.25 0 0 1-.354 0l-6.25-6.25a.25.25 0 0 1-.073-.177zm-1.5 0V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.75 1.75 0 0 1 1 7.775zM6 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>');
101
- --md-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="m310.6 246.6-127.1 128c-7.1 6.3-15.3 9.4-23.5 9.4s-16.38-3.125-22.63-9.375l-127.1-128C.224 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75s3.12 25.75-6.08 34.85z"/></svg>');
102
- }
103
-
104
- :host > * {
105
- /* CODE */
106
- --md-code-fg-color: ${v.palette.text.primary};
107
- --md-code-bg-color: ${v.palette.background.paper};
108
- --md-code-hl-color: ${(0,de.Fq)(v.palette.warning.main,.5)};
109
- --md-code-hl-keyword-color: ${v.palette.type==="dark"?v.palette.primary.light:v.palette.primary.dark};
110
- --md-code-hl-function-color: ${v.palette.type==="dark"?v.palette.secondary.light:v.palette.secondary.dark};
111
- --md-code-hl-string-color: ${v.palette.type==="dark"?v.palette.success.light:v.palette.success.dark};
112
- --md-code-hl-number-color: ${v.palette.type==="dark"?v.palette.error.light:v.palette.error.dark};
113
- --md-code-hl-constant-color: var(--md-code-hl-function-color);
114
- --md-code-hl-special-color: var(--md-code-hl-function-color);
115
- --md-code-hl-name-color: var(--md-code-fg-color);
116
- --md-code-hl-comment-color: var(--md-default-fg-color--light);
117
- --md-code-hl-generic-color: var(--md-default-fg-color--light);
118
- --md-code-hl-variable-color: var(--md-default-fg-color--light);
119
- --md-code-hl-operator-color: var(--md-default-fg-color--light);
120
- --md-code-hl-punctuation-color: var(--md-default-fg-color--light);
121
-
122
- /* TYPESET */
123
- --md-typeset-font-size: 1rem;
124
- --md-typeset-color: var(--md-default-fg-color);
125
- --md-typeset-a-color: ${v.palette.link};
126
- --md-typeset-table-color: ${v.palette.text.primary};
127
- --md-typeset-del-color: ${v.palette.type==="dark"?(0,de.Fq)(v.palette.error.dark,.5):(0,de.Fq)(v.palette.error.light,.5)};
128
- --md-typeset-ins-color: ${v.palette.type==="dark"?(0,de.Fq)(v.palette.success.dark,.5):(0,de.Fq)(v.palette.success.light,.5)};
129
- --md-typeset-mark-color: ${v.palette.type==="dark"?(0,de.Fq)(v.palette.warning.dark,.5):(0,de.Fq)(v.palette.warning.light,.5)};
130
- }
131
-
132
- @media screen and (max-width: 76.1875em) {
133
- :host > * {
134
- /* TYPESET */
135
- --md-typeset-font-size: .9rem;
136
- }
137
- }
138
-
139
- @media screen and (max-width: 600px) {
140
- :host > * {
141
- /* TYPESET */
142
- --md-typeset-font-size: .7rem;
143
- }
144
- }
145
- `,ze=({theme:v})=>`
146
- /*================== Reset ==================*/
147
-
148
- body {
149
- --md-text-color: var(--md-default-fg-color);
150
- --md-text-link-color: var(--md-accent-fg-color);
151
- --md-text-font-family: ${v.typography.fontFamily};
152
- font-family: var(--md-text-font-family);
153
- background-color: unset;
154
- }
155
- `;const Ee="224px";var at=({theme:v,sidebar:L})=>`
156
- /*================== Layout ==================*/
157
-
158
- /* mkdocs material v9 compat */
159
- .md-nav__title {
160
- color: var(--md-default-fg-color);
161
- }
162
-
163
- .md-grid {
164
- max-width: 100%;
165
- margin: 0;
166
- }
167
-
168
- .md-nav {
169
- font-size: calc(var(--md-typeset-font-size) * 0.9);
170
- }
171
- .md-nav__link {
172
- display: flex;
173
- align-items: center;
174
- justify-content: space-between;
175
- }
176
- .md-nav__icon {
177
- height: 20px !important;
178
- width: 20px !important;
179
- margin-left:${v.spacing(1)}px;
180
- }
181
- .md-nav__icon svg {
182
- margin: 0;
183
- width: 20px !important;
184
- height: 20px !important;
185
- }
186
- .md-nav__icon:after {
187
- width: 20px !important;
188
- height: 20px !important;
189
- }
190
-
191
- .md-nav__item--active > .md-nav__link, a.md-nav__link--active {
192
- text-decoration: underline;
193
- color: var(--md-typeset-a-color);
194
- }
195
-
196
- .md-main__inner {
197
- margin-top: 0;
198
- }
199
-
200
- .md-sidebar {
201
- bottom: 75px;
202
- position: fixed;
203
- width: 16rem;
204
- overflow-y: auto;
205
- overflow-x: hidden;
206
- scrollbar-color: rgb(193, 193, 193) #eee;
207
- scrollbar-width: thin;
208
- }
209
- .md-sidebar .md-sidebar__scrollwrap {
210
- width: calc(12.1rem);
211
- }
212
- .md-sidebar--secondary {
213
- right: ${v.spacing(3)}px;
214
- }
215
- .md-sidebar::-webkit-scrollbar {
216
- width: 5px;
217
- }
218
- .md-sidebar::-webkit-scrollbar-button {
219
- width: 5px;
220
- height: 5px;
221
- }
222
- .md-sidebar::-webkit-scrollbar-track {
223
- background: #eee;
224
- border: 1 px solid rgb(250, 250, 250);
225
- box-shadow: 0px 0px 3px #dfdfdf inset;
226
- border-radius: 3px;
227
- }
228
- .md-sidebar::-webkit-scrollbar-thumb {
229
- width: 5px;
230
- background: rgb(193, 193, 193);
231
- border: transparent;
232
- border-radius: 3px;
233
- }
234
- .md-sidebar::-webkit-scrollbar-thumb:hover {
235
- background: rgb(125, 125, 125);
236
- }
237
-
238
- .md-content {
239
- max-width: calc(100% - 16rem * 2);
240
- margin-left: 16rem;
241
- margin-bottom: 50px;
242
- }
243
-
244
- .md-footer {
245
- position: fixed;
246
- bottom: 0px;
247
- pointer-events: none;
248
- }
249
-
250
- .md-footer-nav__link, .md-footer__link {
251
- pointer-events: all;
252
- }
253
-
254
- .md-footer__title {
255
- background-color: unset;
256
- }
257
- .md-footer-nav__link {
258
- width: 16rem;
259
- }
260
-
261
- .md-dialog {
262
- background-color: unset;
263
- }
264
-
265
- @media screen and (min-width: 76.25em) {
266
- .md-sidebar {
267
- height: auto;
268
- }
269
- }
270
-
271
- @media screen and (max-width: 76.1875em) {
272
- .md-nav {
273
- transition: none !important;
274
- background-color: var(--md-default-bg-color)
275
- }
276
- .md-nav--primary .md-nav__title {
277
- cursor: auto;
278
- color: var(--md-default-fg-color);
279
- font-weight: 700;
280
- white-space: normal;
281
- line-height: 1rem;
282
- height: auto;
283
- display: flex;
284
- flex-flow: column;
285
- row-gap: 1.6rem;
286
- padding: 1.2rem .8rem .8rem;
287
- background-color: var(--md-default-bg-color);
288
- }
289
- .md-nav--primary .md-nav__title~.md-nav__list {
290
- box-shadow: none;
291
- }
292
- .md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
293
- border-top: none;
294
- }
295
- .md-nav--primary .md-nav__title .md-nav__button {
296
- display: none;
297
- }
298
- .md-nav--primary .md-nav__title .md-nav__icon {
299
- color: var(--md-default-fg-color);
300
- position: static;
301
- height: auto;
302
- margin: 0 0 0 -0.2rem;
303
- }
304
- .md-nav--primary > .md-nav__title [for="none"] {
305
- padding-top: 0;
306
- }
307
- .md-nav--primary .md-nav__item {
308
- border-top: none;
309
- }
310
- .md-nav--primary :is(.md-nav__title,.md-nav__item) {
311
- font-size : var(--md-typeset-font-size);
312
- }
313
- .md-nav .md-source {
314
- display: none;
315
- }
316
-
317
- .md-sidebar {
318
- height: 100%;
319
- }
320
- .md-sidebar--primary {
321
- width: 12.1rem !important;
322
- z-index: 200;
323
- left: ${L.isPinned?`calc(-12.1rem + ${Ee})`:"calc(-12.1rem + 72px)"} !important;
324
- }
325
- .md-sidebar--secondary:not([hidden]) {
326
- display: none;
327
- }
328
-
329
- .md-content {
330
- max-width: 100%;
331
- margin-left: 0;
332
- }
333
-
334
- .md-header__button {
335
- margin: 0.4rem 0;
336
- margin-left: 0.4rem;
337
- padding: 0;
338
- }
339
-
340
- .md-overlay {
341
- left: 0;
342
- }
343
-
344
- .md-footer {
345
- position: static;
346
- padding-left: 0;
347
- }
348
- .md-footer-nav__link {
349
- /* footer links begin to overlap at small sizes without setting width */
350
- width: 50%;
351
- }
352
- }
353
-
354
- @media screen and (max-width: 600px) {
355
- .md-sidebar--primary {
356
- left: -12.1rem !important;
357
- width: 12.1rem;
358
- }
359
- }
360
- `;const bt=["h1","h2","h3","h4","h5","h6"];var dt=({theme:v})=>`
361
- /*================== Typeset ==================*/
362
-
363
- .md-typeset {
364
- font-size: var(--md-typeset-font-size);
365
- }
366
-
367
- ${bt.reduce((L,Q)=>{var W;const ue=(W=v.typography.htmlFontSize)!==null&&W!==void 0?W:16,xe=v.typography[Q],{lineHeight:Ve,fontFamily:_e,fontWeight:Qe,fontSize:At}=xe,yt=ot=>{let Fe=1;return typeof ot=="number"&&(Fe=ot/ue*.6),typeof ot=="string"&&(Fe=ot.replace("rem","")),`calc(${Fe} * var(--md-typeset-font-size))`};return L.concat(`
368
- .md-typeset ${Q} {
369
- color: var(--md-default-fg-color);
370
- line-height: ${Ve};
371
- font-family: ${_e};
372
- font-weight: ${Qe};
373
- font-size: ${yt(At)};
374
- }
375
- `)},"")}
376
-
377
- .md-typeset .md-content__button {
378
- color: var(--md-default-fg-color);
379
- }
380
-
381
- .md-typeset hr {
382
- border-bottom: 0.05rem dotted ${v.palette.divider};
383
- }
384
-
385
- .md-typeset details {
386
- font-size: var(--md-typeset-font-size) !important;
387
- }
388
- .md-typeset details summary {
389
- padding-left: 2.5rem !important;
390
- }
391
- .md-typeset details summary:before,
392
- .md-typeset details summary:after {
393
- top: 50% !important;
394
- width: 20px !important;
395
- height: 20px !important;
396
- transform: rotate(0deg) translateY(-50%) !important;
397
- }
398
- .md-typeset details[open] > summary:after {
399
- transform: rotate(90deg) translateX(-50%) !important;
400
- }
401
-
402
- .md-typeset blockquote {
403
- color: var(--md-default-fg-color--light);
404
- border-left: 0.2rem solid var(--md-default-fg-color--light);
405
- }
406
-
407
- .md-typeset table:not([class]) {
408
- font-size: var(--md-typeset-font-size);
409
- border: 1px solid var(--md-default-fg-color);
410
- border-bottom: none;
411
- border-collapse: collapse;
412
- }
413
- .md-typeset table:not([class]) th {
414
- font-weight: bold;
415
- }
416
- .md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
417
- border-bottom: 1px solid var(--md-default-fg-color);
418
- }
419
-
420
- .md-typeset pre > code::-webkit-scrollbar-thumb {
421
- background-color: hsla(0, 0%, 0%, 0.32);
422
- }
423
- .md-typeset pre > code::-webkit-scrollbar-thumb:hover {
424
- background-color: hsla(0, 0%, 0%, 0.87);
425
- }
426
- `,Bt=()=>`
427
- /*================== Animations ==================*/
428
- /*
429
- Disable CSS animations on link colors as they lead to issues in dark mode.
430
- The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
431
- */
432
- .md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
433
- transition: none;
434
- }
435
- `,St=({theme:v})=>`
436
- /*================== Extensions ==================*/
437
-
438
- /* HIGHLIGHT */
439
- .highlight .md-clipboard:after {
440
- content: unset;
441
- }
442
-
443
- .highlight .nx {
444
- color: ${v.palette.type==="dark"?"#ff53a3":"#ec407a"};
445
- }
446
-
447
- /* CODE HILITE */
448
- .codehilite .gd {
449
- background-color: ${v.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
450
- }
451
-
452
- .codehilite .gi {
453
- background-color: ${v.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
454
- }
455
-
456
- /* TABBED */
457
- .tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
458
- .tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
459
- .tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
460
- .tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
461
- .tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
462
- .tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
463
- .tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
464
- .tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
465
- .tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
466
- .tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
467
- .tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
468
- .tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
469
- .tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
470
- .tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
471
- .tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
472
- .tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
473
- .tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
474
- .tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
475
- .tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
476
- .tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
477
- color: var(--md-accent-fg-color);
478
- border-color: var(--md-accent-fg-color);
479
- }
480
-
481
- /* TASK-LIST */
482
- .task-list-control .task-list-indicator::before {
483
- background-color: ${v.palette.action.disabledBackground};
484
- }
485
- .task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
486
- background-color: ${v.palette.success.main};
487
- }
488
-
489
- /* ADMONITION */
490
- .admonition {
491
- font-size: var(--md-typeset-font-size) !important;
492
- }
493
- .admonition .admonition-title {
494
- padding-left: 2.5rem !important;
495
- }
496
-
497
- .admonition .admonition-title:before {
498
- top: 50% !important;
499
- width: 20px !important;
500
- height: 20px !important;
501
- transform: translateY(-50%) !important;
502
- }
503
- `;const Gt=[ve,ze,at,dt,Bt,St],$t=()=>(0,g.Pf)(),pn=()=>{const v=$t(),L=(0,Te.Z)();return(0,p.useMemo)(()=>{const Q={theme:L,sidebar:v};return Gt.reduce((W,ue)=>W+ue(Q),"")},[L,v])},an=()=>{const v=pn();return(0,p.useCallback)(L=>(L.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${v}</style>`),L),[v])},dn=(v,L,Q)=>{const W=v==="src"&&L.endsWith(".svg"),ue=!L.match(/^([a-z]*:)?\/\//i),xe=L.startsWith(Q);return W&&(ue||xe)},_t=({techdocsStorageApi:v,entityId:L,path:Q})=>async W=>{const ue=await v.getApiOrigin(),xe=async(Ve,_e)=>{for(const Qe of Ve)if(Qe.hasAttribute(_e)){const At=Qe.getAttribute(_e);if(!At)return;const yt=await v.getBaseUrl(At,L,Q);if(dn(_e,At,ue))try{const Fe=await(await fetch(yt,{credentials:"include"})).text();Qe.setAttribute(_e,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(Fe)))}`)}catch{Qe.setAttribute("alt",`Error: ${At}`)}else Qe.setAttribute(_e,yt)}};return await Promise.all([xe(W.querySelectorAll("img"),"src"),xe(W.querySelectorAll("script"),"src"),xe(W.querySelectorAll("source"),"src"),xe(W.querySelectorAll("link"),"href"),xe(W.querySelectorAll("a[download]"),"href")]),W};var fn=r(40556),Yt=r(67097),nn=r(28316),jn=r(82717),en=r.n(jn);const bn=v=>L=>{var Q;const W=L.querySelector('[title="Edit this page"]');if(!W||!W.href)return L;const ue=new URL(W.href),xe=v.byUrl(ue);if((xe==null?void 0:xe.type)!=="github"&&(xe==null?void 0:xe.type)!=="gitlab")return L;const Ve=((Q=L.querySelector("article>h1"))===null||Q===void 0?void 0:Q.childNodes[0].textContent)||"",_e=encodeURIComponent(`Documentation Feedback: ${Ve}`),Qe=encodeURIComponent(`Page source:
504
- ${W.href}
505
-
506
- Feedback:`),At=(xe==null?void 0:xe.type)==="github"?(0,fn.BT)(ue.href,"blob"):ue.href,yt=en()(At),ot=`/${yt.organization}/${yt.name}`,Fe=W.cloneNode();switch(xe==null?void 0:xe.type){case"gitlab":Fe.href=`${ue.origin}${ot}/issues/new?issue[title]=${_e}&issue[description]=${Qe}`;break;case"github":Fe.href=`${ue.origin}${ot}/issues/new?title=${_e}&body=${Qe}`;break;default:return L}return nn.render(p.createElement(Yt.Z),Fe),Fe.style.paddingLeft="5px",Fe.title="Leave feedback for this page",Fe.id="git-feedback-link",W==null||W.insertAdjacentElement("beforebegin",Fe),L};var $n=r(44882);const tt=()=>v=>{const L=v.querySelector('.md-header label[for="__drawer"]'),Q=v.querySelector("article");if(!L||!Q)return v;const W=L.cloneNode();return nn.render(p.createElement($n.Z),W),W.id="toggle-sidebar",W.title="Toggle Sidebar",W.classList.add("md-content__button"),W.style.setProperty("padding","0 0 0 5px"),W.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),Q==null||Q.prepend(W),v},rr=()=>v=>(((Q,W)=>{Array.from(Q).filter(ue=>ue.hasAttribute(W)).forEach(ue=>{const xe=ue.getAttribute(W);if(xe){xe.match(/^https?:\/\//i)&&ue.setAttribute("target","_blank");try{const Ve=Ct(window.location.href);ue.setAttribute(W,new URL(xe,Ve).toString())}catch{ue.replaceWith(ue.textContent||xe)}}})})(Array.from(v.getElementsByTagName("a")),"href"),v);function Ct(v){const L=new URL(v);return!L.pathname.endsWith("/")&&!L.pathname.endsWith(".html")&&(L.pathname+="/"),L.toString()}const nt=({baseUrl:v,onClick:L})=>Q=>(Array.from(Q.getElementsByTagName("a")).forEach(W=>{W.addEventListener("click",ue=>{const Ve=W.getAttribute("href");Ve&&Ve.startsWith(v)&&!W.hasAttribute("download")&&(ue.preventDefault(),L(ue,Ve))})}),Q);var Tn=r(15459),Jt=r(80030),Rn=r(72379),Dn=r(41547),Sn=r(95074);const Nn=(0,Tn.Z)(v=>({tooltip:{fontSize:"inherit",color:v.palette.text.primary,margin:0,padding:v.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Jt.ZP),Se=()=>(0,n.jsx)(Rn.Z,{children:(0,n.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"})}),ae=({text:v})=>{const[L,Q]=(0,p.useState)(!1),[,W]=(0,Sn.Z)(),ue=(0,p.useCallback)(()=>{W(v),Q(!0)},[v,W]),xe=(0,p.useCallback)(()=>{Q(!1)},[Q]);return(0,n.jsx)(Nn,{title:"Copied to clipboard",placement:"left",open:L,onClose:xe,leaveDelay:1e3,children:(0,n.jsx)(I.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:ue,children:(0,n.jsx)(Se,{})})})},Le=v=>L=>{const Q=L.querySelectorAll("pre > code");for(const ue of Q){var W;const xe=ue.textContent||"",Ve=document.createElement("div");ue==null||(W=ue.parentElement)===null||W===void 0||W.prepend(Ve),nn.render((0,n.jsx)(Dn.Z,{theme:v,children:(0,n.jsx)(ae,{text:xe})}),Ve)}return L},Me=()=>v=>{var L;return(L=v.querySelector(".md-header"))===null||L===void 0||L.remove(),v},Ge=()=>v=>{var L,Q;return(L=v.querySelector(".md-footer .md-copyright"))===null||L===void 0||L.remove(),(Q=v.querySelector(".md-footer-copyright"))===null||Q===void 0||Q.remove(),v},se=({onLoading:v,onLoaded:L})=>Q=>(v(),Q.addEventListener(V.Ox,function W(){L(),Q.removeEventListener(V.Ox,W)}),Q),M=()=>v=>(v.addEventListener(V.Ox,function L(){if(window.location.hash){var Q;const W=window.location.hash.slice(1);(Q=v==null?void 0:v.querySelector(`[id="${W}"]`))===null||Q===void 0||Q.scrollIntoView()}v.removeEventListener(V.Ox,L)}),v),me=()=>v=>(setTimeout(()=>{const L=v==null?void 0:v.querySelectorAll("li.md-nav__item--active");L.length!==0&&(L.forEach(W=>{const ue=W==null?void 0:W.querySelector("input");ue!=null&&ue.checked||ue==null||ue.click()}),L[L.length-1].scrollIntoView())},200),v),Be=async(v,L)=>{let Q;if(typeof v=="string")Q=new DOMParser().parseFromString(v,"text/html").documentElement;else if(v instanceof Element)Q=v;else throw new Error("dom is not a recognized type");for(const W of L)Q=await W(Q);return Q};var Ye=r(73557);function Je(v,L){const Q=new URL(L),W=`${Q.origin}${Q.pathname.replace(/\/$/,"")}`,ue=v.replace(W,"").replace(/^\/+/,""),xe=new URL(`http://localhost/${ue}`);return`${xe.pathname}${xe.search}${xe.hash}`}function Dt(){const v=(0,Ye.s0)(),Q=(0,N.h_)(N.Ds).getOptionalString("app.baseUrl");return(0,p.useCallback)(ue=>{let xe=ue;if(Q)try{xe=Je(ue,Q)}catch{}v(xe)},[v,Q])}const Kt="screen and (max-width: 76.1875em)",tn=v=>{const L=Dt(),Q=(0,Te.Z)(),W=(0,Ne.Z)(Kt),ue=qt(),xe=an(),Ve=(0,N.z$)(),_e=(0,N.h_)(V.Dl),Qe=(0,N.h_)(Z.q3),{state:At,path:yt,content:ot}=(0,T.DK)(),[Fe,Ut]=(0,p.useState)(null),rn=(0,V.ux)(Fe),It=(0,p.useCallback)(()=>{if(!Fe)return;Fe.querySelectorAll(".md-sidebar").forEach(We=>{if(W)We.style.top="0px";else{const Fn=document==null?void 0:document.querySelector(".techdocs-reader-page");var Tt;const ur=(Tt=Fn==null?void 0:Fn.getBoundingClientRect().top)!==null&&Tt!==void 0?Tt:0;var hn;let Zn=(hn=Fe.getBoundingClientRect().top)!==null&&hn!==void 0?hn:0;const Un=Fe.querySelector(".md-container > .md-tabs");var on;const or=(on=Un==null?void 0:Un.getBoundingClientRect().height)!==null&&on!==void 0?on:0;Zn<ur&&(Zn=ur),We.style.top=`${Math.max(Zn,0)+or}px`}We.style.setProperty("opacity","1")})},[Fe,W]);(0,p.useEffect)(()=>(window.addEventListener("resize",It),window.addEventListener("scroll",It,!0),()=>{window.removeEventListener("resize",It),window.removeEventListener("scroll",It,!0)}),[Fe,It]);const Ot=(0,p.useCallback)(()=>{if(!Fe)return;const ut=Fe.querySelector(".md-footer");ut&&(ut.style.width=`${Fe.getBoundingClientRect().width}px`)},[Fe]);(0,p.useEffect)(()=>(window.addEventListener("resize",Ot),()=>{window.removeEventListener("resize",Ot)}),[Fe,Ot]),(0,p.useEffect)(()=>{rn||(Ot(),It())},[At,rn,Ot,It]);const mn=(0,p.useCallback)((ut,We)=>Be(ut,[ue,_t({techdocsStorageApi:_e,entityId:v,path:We}),rr(),tt(),Me(),Ge(),bn(Qe),xe]),[v,Qe,_e,ue,xe]),un=(0,p.useCallback)(async ut=>Be(ut,[M(),me(),Le(Q),nt({baseUrl:window.location.origin,onClick:(We,Tt)=>{var hn;const on=We.ctrlKey||We.metaKey,Fn=new URL(Tt),ur=((hn=We.target)===null||hn===void 0?void 0:hn.innerText)||Tt,Zn=Tt.replace(window.location.origin,"");if(Ve.captureEvent("click",ur,{attributes:{to:Zn}}),Fn.hash)if(on)window.open(Tt,"_blank");else{var Un;L(Tt),(Un=ut==null?void 0:ut.querySelector(`[id="${Fn.hash.slice(1)}"]`))===null||Un===void 0||Un.scrollIntoView()}else on?window.open(Tt,"_blank"):L(Tt)}}),se({onLoading:()=>{},onLoaded:()=>{var We;(We=ut.querySelector(".md-nav__title"))===null||We===void 0||We.removeAttribute("for")}}),se({onLoading:()=>{Array.from(ut.querySelectorAll(".md-sidebar")).forEach(Tt=>{Tt.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[Q,L,Ve]);return(0,p.useEffect)(()=>{if(!ot)return()=>{};let ut=!0;return mn(ot,yt).then(async We=>{if(!(We!=null&&We.innerHTML)||!ut)return;window.scroll({top:0});const Tt=await un(We);Ut(Tt)}),()=>{ut=!1}},[ot,yt,mn,un]),Fe};var Qt=r(8560);const gn=()=>{const v=(0,V.$L)(),{shadowRoot:L}=(0,V.x1)(),Q=L==null?void 0:L.querySelector('[data-md-component="content"]'),W=L==null?void 0:L.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let ue=W==null?void 0:W.querySelector('[data-techdocs-addons-location="primary sidebar"]');ue||(ue=document.createElement("div"),ue.setAttribute("data-techdocs-addons-location","primary sidebar"),W==null||W.prepend(ue));const xe=L==null?void 0:L.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Ve=xe==null?void 0:xe.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Ve||(Ve=document.createElement("div"),Ve.setAttribute("data-techdocs-addons-location","secondary sidebar"),xe==null||xe.prepend(Ve)),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Qt.Z,{container:ue,children:v.renderComponentsByLocation(V.oZ.PrimarySidebar)}),(0,n.jsx)(Qt.Z,{container:Q,children:v.renderComponentsByLocation(V.oZ.Content)}),(0,n.jsx)(Qt.Z,{container:Ve,children:v.renderComponentsByLocation(V.oZ.SecondarySidebar)})]})},X=(0,G.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),q=(0,T.m1)(v=>{var L;const{withSearch:Q=!0,onReady:W}=v,ue=X(),{entityMetadata:{value:xe,loading:Ve},entityRef:_e,setShadowRoot:Qe}=(0,V.x1)(),At=tn(_e),yt=(0,p.useCallback)(ot=>{Qe(ot),W instanceof Function&&W()},[Qe,W]);return Ve===!1&&!xe?(0,n.jsx)(g.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):At?(0,n.jsx)(g.VY,{children:(0,n.jsxs)(f.Z,{container:!0,children:[(0,n.jsx)(f.Z,{xs:12,item:!0,children:(0,n.jsx)(te,{})}),Q&&(0,n.jsx)(f.Z,{className:ue.search,xs:"auto",item:!0,children:(0,n.jsx)(u.S,{entityId:_e,entityTitle:xe==null||(L=xe.metadata)===null||L===void 0?void 0:L.title})}),(0,n.jsx)(f.Z,{xs:12,item:!0,children:(0,n.jsx)(V.VA,{element:At,onAppend:yt,children:(0,n.jsx)(gn,{})})})]})}):(0,n.jsx)(g.VY,{children:(0,n.jsx)(f.Z,{container:!0,children:(0,n.jsx)(f.Z,{xs:12,item:!0,children:(0,n.jsx)(te,{})})})})}),_=null},93225:function(vt,ke,r){"use strict";r.d(ke,{S:function(){return ne}});var n=r(52322),p=r(2784),G=r(18671),f=r(60905),V=r(98069),g=r(60364),u=r(73250),$=r(61886),ye=r(43514),le=r(25271),H=r(53974),ee=r(60871),I=r(76635),E=r(95573);const ie=(0,n.jsx)(V.Z,{animation:"wave",variant:"text",height:40}),ne=re=>{const{palette:{common:{white:D}}}=(0,g.Z)(),{children:N}=re,P=(0,$.$L)(),T=(0,ee.h_)(ee.Ds),{title:k,setTitle:te,subtitle:Te,setSubtitle:Ne,entityRef:Z,metadata:{value:Xe,loading:rt},entityMetadata:{value:Et,loading:Lt}}=(0,$.x1)();(0,p.useEffect)(()=>{Xe&&(te(Xe.site_name),Ne(()=>{let{site_description:ve}=Xe;return(!ve||ve==="None")&&(ve=""),ve}))},[Xe,te,Ne]);const lt=T.getOptional("app.title")||"Backstage",Ft=[k,Te,lt].filter(Boolean).join(" | "),{locationMetadata:Zt,spec:et}=Et||{},pt=et==null?void 0:et.lifecycle,ft=Et?(0,ye.hF)(Et,le.S4):[],jt=(0,ee.tg)(E._Z)(),kt=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(H.i9,{label:(0,I.capitalize)((Et==null?void 0:Et.kind)||"entity"),value:(0,n.jsx)(ye.dx,{color:"inherit",entityRef:Z,title:Et==null?void 0:Et.metadata.title,defaultKind:"Component"})}),ft.length>0&&(0,n.jsx)(H.i9,{label:"Owner",value:(0,n.jsx)(ye.rI,{color:"inherit",entityRefs:ft,defaultKind:"group"})}),pt?(0,n.jsx)(H.i9,{label:"Lifecycle",value:pt}):null,Zt&&Zt.type!=="dir"&&Zt.type!=="file"?(0,n.jsx)(H.i9,{label:"",value:(0,n.jsxs)(f.Z,{container:!0,direction:"column",alignItems:"center",style:{color:D},children:[(0,n.jsx)(f.Z,{style:{padding:0},item:!0,children:(0,n.jsx)(u.Z,{style:{marginTop:"-25px"}})}),(0,n.jsx)(f.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:Zt.target}):null]});return!Lt&&Et===void 0||!rt&&Xe===void 0?null:(0,n.jsxs)(H.h4,{type:"Documentation",typeLink:jt,title:k||ie,subtitle:Te===""?void 0:Te||ie,children:[(0,n.jsx)(G.Z,{titleTemplate:"%s",children:(0,n.jsx)("title",{children:Ft})}),kt,N,P.renderComponentsByLocation($.oZ.Header)]})}},65124:function(vt,ke,r){"use strict";r.d(ke,{b:function(){return ee}});var n=r(52322),p=r(2784),G=r(79692),f=r(15223),V=r(95544),g=r(80030),u=r(61837),$=r(48348),ye=r(47603),le=r(61886);const H=(0,G.Z)(I=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:I.spacing(3,3,0)}})),ee=I=>{const E=H(),[ie,ne]=(0,p.useState)(null),re=(0,p.useCallback)(Te=>{ne(Te.currentTarget)},[]),D=(0,p.useCallback)(()=>{ne(null)},[]),{entityMetadata:{value:N,loading:P}}=(0,le.x1)(),T=(0,le.$L)(),k=T.renderComponentsByLocation(le.oZ.Subheader),te=T.renderComponentsByLocation(le.oZ.Settings);return!k&&!te||P===!1&&!N?null:(0,n.jsx)(f.Z,{classes:E,...I.toolbarProps,children:(0,n.jsxs)(V.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[k,te?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(g.ZP,{title:"Settings",children:(0,n.jsx)(u.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:re,children:(0,n.jsx)(ye.Z,{})})}),(0,n.jsx)($.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:ie,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(ie),onClose:D,keepMounted:!0,children:(0,n.jsx)("div",{children:te})})]}):null]})})}},95481:function(vt,ke,r){"use strict";r.d(ke,{DK:function(){return ee},m1:function(){return E}});var n=r(52322),p=r(2784),G=r(73557),f=r(61886),V=r(60871),g=r(64279),u=r(77446);function $({contentLoading:ie,content:ne,activeSyncState:re}){return ie||re==="BUILD_READY_RELOAD"||!ne&&re==="CHECKING"?"CHECKING":!ne&&re==="BUILDING"?"INITIAL_BUILD":ne?re==="BUILDING"?"CONTENT_STALE_REFRESHING":re==="BUILD_READY"?"CONTENT_STALE_READY":re==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ye(ie,ne){const re={...ie};switch(ne.type){case"sync":ne.state==="CHECKING"&&(re.buildLog=[]),re.activeSyncState=ne.state,re.syncError=ne.syncError;break;case"contentLoading":re.contentLoading=!0,re.contentError=void 0;break;case"content":typeof ne.path=="string"&&(re.path=ne.path),re.contentLoading=!1,re.content=ne.content,re.contentError=ne.contentError;break;case"buildLog":re.buildLog=re.buildLog.concat(ne.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(re.activeSyncState)&&["contentLoading","content"].includes(ne.type)&&(re.activeSyncState="UP_TO_DATE",re.buildLog=[]),re}function le(ie,ne,re,D){var N,P;const[T,k]=(0,p.useReducer)(ye,{activeSyncState:"CHECKING",path:D,contentLoading:!0,buildLog:[]}),te=(0,V.h_)(f.Dl),{retry:Te}=(0,u.Z)(async()=>{k({type:"contentLoading"});try{const Xe=await te.getEntityDocs({kind:ie,namespace:ne,name:re},D);return k({type:"content",content:Xe,path:D}),Xe}catch(Xe){k({type:"content",contentError:Xe,path:D})}},[te,ie,ne,re,D]),Ne=(0,p.useRef)({content:void 0,reload:()=>{}});return Ne.current={content:T.content,reload:Te},(0,g.default)(async()=>{k({type:"sync",state:"CHECKING"});const Xe=setTimeout(()=>{k({type:"sync",state:"BUILDING"})},1e3);try{switch(await te.syncEntityDocs({kind:ie,namespace:ne,name:re},Et=>{k({type:"buildLog",log:Et})})){case"updated":Ne.current.content?k({type:"sync",state:"BUILD_READY"}):(Ne.current.reload(),k({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":k({type:"sync",state:"UP_TO_DATE"});break;default:k({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(rt){k({type:"sync",state:"ERROR",syncError:rt})}finally{clearTimeout(Xe)}},[ie,re,ne,te,k,Ne]),{state:(0,p.useMemo)(()=>$({activeSyncState:T.activeSyncState,contentLoading:T.contentLoading,content:T.content}),[T.activeSyncState,T.content,T.contentLoading]),contentReload:Te,path:T.path,content:T.content,contentErrorMessage:(N=T.contentError)===null||N===void 0?void 0:N.toString(),syncErrorMessage:(P=T.syncError)===null||P===void 0?void 0:P.toString(),buildLog:T.buildLog}}const H=(0,p.createContext)({}),ee=()=>(0,p.useContext)(H),I=ie=>{const{children:ne}=ie,{"*":re=""}=(0,G.UO)(),{entityRef:D}=(0,f.x1)(),{kind:N,namespace:P,name:T}=D,k=le(N,P,T,re);return(0,n.jsx)(H.Provider,{value:k,children:ne instanceof Function?ne(k):ne})},E=ie=>ne=>(0,n.jsx)(I,{children:(0,n.jsx)(ie,{...ne})})},95573:function(vt,ke,r){"use strict";r.d(ke,{Fw:function(){return G},_Z:function(){return p},pd:function(){return f}});var n=r(60871);const p=(0,n.NT)({id:"techdocs:index-page"}),G=(0,n.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),f=(0,n.NT)({id:"techdocs:catalog-reader-view"})},55511:function(vt,ke,r){"use strict";r.r(ke),r.d(ke,{TechDocsSearchResultListItem:function(){return le}});var n=r(52322),p=r(2784),G=r(79692),f=r(49378),V=r(86136),g=r(90436),u=r(53974),$=r(15096);const ye=(0,G.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),le=H=>{const{result:ee,highlight:I,lineClamp:E=5,asListItem:ie=!0,asLink:ne=!0,title:re,icon:D}=H,N=ye(),P=({children:te})=>ne?(0,n.jsx)(u.rU,{noTrack:!0,to:ee.location,children:te}):(0,n.jsx)(n.Fragment,{children:te}),T=()=>{const te=I!=null&&I.fields.title?(0,n.jsx)($.FA,{text:I.fields.title,preTag:I.preTag,postTag:I.postTag}):ee.title,Te=I!=null&&I.fields.entityTitle?(0,n.jsx)($.FA,{text:I.fields.entityTitle,preTag:I.preTag,postTag:I.postTag}):ee.entityTitle,Ne=I!=null&&I.fields.name?(0,n.jsx)($.FA,{text:I.fields.name,preTag:I.preTag,postTag:I.postTag}):ee.name;return ee?(0,n.jsx)(f.Z,{className:N.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,n.jsx)(P,{children:re||(0,n.jsxs)(n.Fragment,{children:[te," | ",Te!=null?Te:Ne," docs"]})}),secondary:(0,n.jsx)(g.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:E,overflow:"hidden"},color:"textSecondary",variant:"body2",children:I!=null&&I.fields.text?(0,n.jsx)($.FA,{text:I.fields.text,preTag:I.preTag,postTag:I.postTag}):ee.text})}):null},k=({children:te})=>ie?(0,n.jsxs)(n.Fragment,{children:[D&&(0,n.jsx)(V.Z,{children:typeof D=="function"?D(ee):D}),(0,n.jsx)("div",{className:N.flexContainer,children:te})]}):(0,n.jsx)(n.Fragment,{children:te});return(0,n.jsx)(k,{children:(0,n.jsx)(T,{})})}},22478:function(vt,ke,r){"use strict";r.d(ke,{S:function(){return $}});var n=r(52322),p=r(15096),G=r(2784),f=r(73557),V=r(55511);const g=ye=>ye==null?void 0:ye.document,u=ye=>{const{entityId:le,entityTitle:H,debounceTime:ee=150}=ye,[I,E]=(0,G.useState)(!1),ie=(0,f.s0)(),{setFilters:ne,result:{loading:re,value:D}}=(0,p.Rx)(),[N,P]=(0,G.useState)([]);(0,G.useEffect)(()=>{let Ne=!0;if(Ne&&D){const Z=D.results.slice(0,10);P(Z)}return()=>{Ne=!1}},[re,D]);const{kind:T,name:k,namespace:te}=le;(0,G.useEffect)(()=>{ne(Ne=>({...Ne,kind:T,namespace:te,name:k}))},[T,te,k,ne]);const Te=(Ne,Z)=>{if(g(Z)){const{location:Xe}=Z.document;ie(Xe)}};return(0,n.jsx)(p.qO,{"data-testid":"techdocs-search-bar",size:"small",open:I,getOptionLabel:()=>"",filterOptions:Ne=>Ne,onClose:()=>{E(!1)},onFocus:()=>{E(!0)},onChange:Te,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:N,renderOption:({document:Ne,highlight:Z})=>(0,n.jsx)(V.TechDocsSearchResultListItem,{result:Ne,lineClamp:3,asListItem:!1,asLink:!1,title:Ne.title,highlight:Z}),loading:re,inputDebounceTime:ee,inputPlaceholder:`Search ${H||le.name} docs`,freeSolo:!1})},$=ye=>{const le={term:"",types:["techdocs"],pageCursor:"",filters:ye.entityId};return(0,n.jsx)(p.Nd,{initialState:le,children:(0,n.jsx)(u,{...ye})})}},53260:function(){}},function(vt){var ke=function(n){return vt(vt.s=n)};vt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,242,5109,6816,5218,4736],function(){return ke(30966)});var r=vt.O()}]);})();
507
-
508
- //# sourceMappingURL=main.935a0154.js.map