@techdocs/cli 1.4.1-next.2 → 1.4.1-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{1032.90746959.chunk.js → 1032.94c986d1.chunk.js} +2 -2
- package/dist/embedded-app/static/{1032.90746959.chunk.js.map → 1032.94c986d1.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{1105.0c932be4.chunk.js → 1105.facb65a8.chunk.js} +2 -2
- package/dist/embedded-app/static/{1105.0c932be4.chunk.js.map → 1105.facb65a8.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{184.0de82ef1.chunk.js → 184.c1c44877.chunk.js} +2 -2
- package/dist/embedded-app/static/{184.0de82ef1.chunk.js.map → 184.c1c44877.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{2440.0219755d.chunk.js → 2440.e147b5dc.chunk.js} +2 -2
- package/dist/embedded-app/static/{2440.0219755d.chunk.js.map → 2440.e147b5dc.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{5458.36bd7281.chunk.js → 5458.742cd271.chunk.js} +2 -2
- package/dist/embedded-app/static/{5458.36bd7281.chunk.js.map → 5458.742cd271.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{6051.b3151928.chunk.js → 6051.bd9f4d48.chunk.js} +3 -3
- package/dist/embedded-app/static/{6051.b3151928.chunk.js.map → 6051.bd9f4d48.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{732.b3a19fae.chunk.js → 732.b2dac5c3.chunk.js} +2 -2
- package/dist/embedded-app/static/{732.b3a19fae.chunk.js.map → 732.b2dac5c3.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7560.b6001518.chunk.js → 7560.4cfb6ad7.chunk.js} +2 -2
- package/dist/embedded-app/static/{7560.b6001518.chunk.js.map → 7560.4cfb6ad7.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7670.8383e359.chunk.js → 7670.d2126c9e.chunk.js} +2 -2
- package/dist/embedded-app/static/{7670.8383e359.chunk.js.map → 7670.d2126c9e.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7750.c29731fc.chunk.js → 7750.7cd64666.chunk.js} +2 -2
- package/dist/embedded-app/static/{7750.c29731fc.chunk.js.map → 7750.7cd64666.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9323.6577088c.chunk.js → 9323.0aa3540d.chunk.js} +2 -2
- package/dist/embedded-app/static/{9323.6577088c.chunk.js.map → 9323.0aa3540d.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9545.12d478b4.chunk.js → 9545.fab4c42c.chunk.js} +2 -2
- package/dist/embedded-app/static/{9545.12d478b4.chunk.js.map → 9545.fab4c42c.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9770.94e79bff.chunk.js → 9770.b5b411d2.chunk.js} +2 -2
- package/dist/embedded-app/static/{9770.94e79bff.chunk.js.map → 9770.b5b411d2.chunk.js.map} +1 -1
- package/dist/embedded-app/static/main.0f1c16cc.js +508 -0
- package/dist/embedded-app/static/main.0f1c16cc.js.map +1 -0
- package/dist/embedded-app/static/{module-lodash.b0e3bf8c.js → module-lodash.4c9a1319.js} +1 -1
- package/dist/embedded-app/static/{module-lodash.b0e3bf8c.js.map → module-lodash.4c9a1319.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.9f408ea9.js → runtime.0f1c16cc.js} +2 -2
- package/dist/embedded-app/static/{runtime.9f408ea9.js.map → runtime.0f1c16cc.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.9f408ea9.js → vendor.0f1c16cc.js} +61 -61
- package/dist/embedded-app/static/vendor.0f1c16cc.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +4 -4
- package/dist/embedded-app/static/main.9f408ea9.js +0 -508
- package/dist/embedded-app/static/main.9f408ea9.js.map +0 -1
- package/dist/embedded-app/static/vendor.9f408ea9.js.map +0 -1
|
@@ -1,508 +0,0 @@
|
|
|
1
|
-
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{4791:function(St,$e,t){"use strict";t.d($e,{n3:function(){return y},MS:function(){return Te}});var u=t(47842),r=t(25271),W=t(23054),P=t(96279),m=t.n(P);const y=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");function c(ue){return!ue.cursor}function B(ue){return!c(ue)}class Te{async getEntityAncestors(K,$){const{kind:R,namespace:O,name:re}=(0,r.of)(K.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(R)}/${encodeURIComponent(O)}/${encodeURIComponent(re)}/ancestry`,$)}async getLocationById(K,$){return await this.requestOptional("GET",`/locations/${encodeURIComponent(K)}`,$)}async getEntities(K,$){const{filter:R=[],fields:O=[],order:re,offset:q,limit:ne,after:D}=K!=null?K:{},T=this.getParams(R);if(O.length&&T.push(`fields=${O.map(encodeURIComponent).join(",")}`),re)for(const Se of[re].flat())Se&&T.push(`order=${encodeURIComponent(Se.order)}:${encodeURIComponent(Se.field)}`);q!==void 0&&T.push(`offset=${q}`),ne!==void 0&&T.push(`limit=${ne}`),D!==void 0&&T.push(`after=${encodeURIComponent(D)}`);const k=T.length?`?${T.join("&")}`:"",L=await this.requestRequired("GET",`/entities${k}`,$),V=(Se,We)=>{var qe,H;if(((qe=Se.metadata)===null||qe===void 0?void 0:qe.name)===void 0||Se.kind===void 0||((H=We.metadata)===null||H===void 0?void 0:H.name)===void 0||We.kind===void 0)return 0;const _e=(0,r.eE)(Se),ut=(0,r.eE)(We);return _e<ut?-1:_e>ut?1:0};return{items:L.sort(V)}}async getEntitiesByRefs(K,$){var R;const O={entityRefs:K.entityRefs};!((R=K.fields)===null||R===void 0)&&R.length&&(O.fields=K.fields);const q=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,ne=await this.fetchApi.fetch(q,{headers:{"Content-Type":"application/json",...($==null?void 0:$.token)&&{Authorization:`Bearer ${$==null?void 0:$.token}`}},method:"POST",body:JSON.stringify(O)});if(!ne.ok)throw await W.VL.fromResponse(ne);const{items:D}=await ne.json();return{items:D.map(T=>T!=null?T:void 0)}}async queryEntities(K={},$){const R=[];if(c(K)){var O,re;const{fields:ne=[],filter:D,limit:T,orderFields:k,fullTextFilter:L}=K;R.push(...this.getParams(D)),T!==void 0&&R.push(`limit=${T}`),k!==void 0&&(Array.isArray(k)?k:[k]).forEach(({field:Se,order:We})=>R.push(`orderField=${Se},${We}`)),ne.length&&R.push(`fields=${ne.map(encodeURIComponent).join(",")}`);const V=L==null||(O=L.term)===null||O===void 0?void 0:O.trim();V&&R.push(`fullTextFilterTerm=${V}`),!(L==null||(re=L.fields)===null||re===void 0)&&re.length&&R.push(`fullTextFilterFields=${L.fields.join(",")}`)}else{const{fields:ne=[],limit:D,cursor:T}=K;R.push(`cursor=${T}`),D!==void 0&&R.push(`limit=${D}`),ne.length&&R.push(`fields=${ne.map(encodeURIComponent).join(",")}`)}const q=R.length?`?${R.join("&")}`:"";return this.requestRequired("GET",`/entities/by-query${q}`,$)}async getEntityByRef(K,$){const{kind:R,namespace:O,name:re}=(0,r.of)(K);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(R)}/${encodeURIComponent(O)}/${encodeURIComponent(re)}`,$)}async getEntityByName(K,$){const{kind:R,namespace:O="default",name:re}=K;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(R)}/${encodeURIComponent(O)}/${encodeURIComponent(re)}`,$)}async refreshEntity(K,$){const R=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...($==null?void 0:$.token)&&{Authorization:`Bearer ${$==null?void 0:$.token}`}},method:"POST",body:JSON.stringify({entityRef:K})});if(R.status!==200)throw new Error(await R.text())}async getEntityFacets(K,$){const{filter:R=[],facets:O}=K,re=this.getParams(R);for(const ne of O)re.push(`facet=${encodeURIComponent(ne)}`);const q=re.length?`?${re.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${q}`,$)}async addLocation(K,$){const{type:R="url",target:O,dryRun:re}=K,q=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${re?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...($==null?void 0:$.token)&&{Authorization:`Bearer ${$==null?void 0:$.token}`}},method:"POST",body:JSON.stringify({type:R,target:O})});if(q.status!==201)throw new Error(await q.text());const{location:ne,entities:D,exists:T}=await q.json();if(!ne)throw new Error(`Location wasn't added: ${O}`);return{location:ne,entities:D,exists:T}}async getLocationByRef(K,$){return(await this.requestRequired("GET","/locations",$)).map(O=>O.data).find(O=>K===(0,r.NZ)(O))}async removeLocationById(K,$){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(K)}`,$)}async removeEntityByUid(K,$){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(K)}`,$)}async validateEntity(K,$,R){const O=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(R==null?void 0:R.token)&&{Authorization:`Bearer ${R==null?void 0:R.token}`}},method:"POST",body:JSON.stringify({entity:K,location:$})});if(O.ok)return{valid:!0};if(O.status!==400)throw await W.VL.fromResponse(O);const{errors:re=[]}=await O.json();return{valid:!1,errors:re}}async requestIgnored(K,$,R){const O=`${await this.discoveryApi.getBaseUrl("catalog")}${$}`,re=R!=null&&R.token?{Authorization:`Bearer ${R.token}`}:{},q=await this.fetchApi.fetch(O,{method:K,headers:re});if(!q.ok)throw await W.VL.fromResponse(q)}async requestRequired(K,$,R){const O=`${await this.discoveryApi.getBaseUrl("catalog")}${$}`,re=R!=null&&R.token?{Authorization:`Bearer ${R.token}`}:{},q=await this.fetchApi.fetch(O,{method:K,headers:re});if(!q.ok)throw await W.VL.fromResponse(q);return q.json()}async requestOptional(K,$,R){const O=`${await this.discoveryApi.getBaseUrl("catalog")}${$}`,re=R!=null&&R.token?{Authorization:`Bearer ${R.token}`}:{},q=await this.fetchApi.fetch(O,{method:K,headers:re});if(!q.ok){if(q.status===404)return;throw await W.VL.fromResponse(q)}return await q.json()}getParams(K=[]){const $=[];for(const R of[K].flat()){const O=[];for(const[re,q]of Object.entries(R))for(const ne of[q].flat())ne===y?O.push(encodeURIComponent(re)):typeof ne=="string"&&O.push(`${encodeURIComponent(re)}=${encodeURIComponent(ne)}`);O.length&&$.push(`filter=${O.join(",")}`)}return $}constructor(K){(0,u.Z)(this,"discoveryApi",void 0),(0,u.Z)(this,"fetchApi",void 0),this.discoveryApi=K.discoveryApi,this.fetchApi=K.fetchApi||{fetch:m()}}}},25271:function(St,$e,t){"use strict";t.d($e,{Tf:function(){return W},P1:function(){return ln},q1:function(){return Vn},M6:function(){return ge},l2:function(){return r},zG:function(){return u},w$:function(){return Fn},nP:function(){return an},aS:function(){return Mn},S4:function(){return It},cz:function(){return at},iB:function(){return ct},CV:function(){return Ke},of:function(){return jt},Ou:function(){return Le},eE:function(){return vt},NZ:function(){return Fe}});const u="default",r="backstage.io/view-url",W="backstage.io/edit-url",P="kubernetes.io/api-server",m="kubernetes.io/api-server-certificate-authority",y="kubernetes.io/auth-provider";var c=t(76635),B=t.n(c);class Te{async enforce(F){return F.metadata.namespace?F:lodash.merge({metadata:{namespace:this.namespace}},F)}constructor(F=DEFAULT_NAMESPACE){_define_property(this,"namespace",void 0),this.namespace=F}}class ue{static isValidPrefixAndOrSuffix(F,fe,je,Qe){if(typeof F!="string")return!1;const et=F.split(fe);return et.length===1?Qe(et[0]):et.length===2?je(et[0])&&Qe(et[1]):!1}static isJsonSafe(F){try{return B().isEqual(F,JSON.parse(JSON.stringify(F)))}catch{return!1}}static isValidDnsSubdomain(F){return typeof F=="string"&&F.length>=1&&F.length<=253&&F.split(".").every(ue.isValidDnsLabel)}static isValidDnsLabel(F){return typeof F=="string"&&F.length>=1&&F.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(F)}static isValidTag(F){return typeof F=="string"&&F.length>=1&&F.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(F)}static isValidUrl(F){if(typeof F!="string")return!1;try{return new URL(F),!0}catch{return!1}}static isValidString(F){var fe;return typeof F=="string"&&((fe=F==null?void 0:F.trim())===null||fe===void 0?void 0:fe.length)>=1}static isNonEmptyString(F){var fe;return typeof F=="string"&&((fe=F==null?void 0:F.trim())===null||fe===void 0?void 0:fe.length)>=1}}var K=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}}}}}'),$=t(27991),R=t.n($),O=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"}}}`),re=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}}}}}}'),q=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"common","type":"object","description":"Common definitions to import from other schemas","definitions":{"reference":{"$id":"#reference","type":"object","description":"A reference by name to another entity.","required":["kind","namespace","name"],"additionalProperties":false,"properties":{"kind":{"type":"string","description":"The kind field of the entity.","minLength":1},"namespace":{"type":"string","description":"The metadata.namespace field of the entity.","minLength":1},"name":{"type":"string","description":"The metadata.name field of the entity.","minLength":1}}},"relation":{"$id":"#relation","type":"object","description":"A directed relation from one entity to another.","required":["type","target"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference"},"targetRef":{"type":"string","minLength":1,"description":"The entity ref of the target of this relation."}}},"status":{"$id":"#status","type":"object","description":"The current status of the entity, as claimed by various sources.","required":[],"additionalProperties":true,"properties":{"items":{"type":"array","items":{"$ref":"#statusItem"}}}},"statusItem":{"$id":"#statusItem","type":"object","description":"A specific status item on a well known format.","required":["type","level","message"],"additionalProperties":true,"properties":{"type":{"type":"string","minLength":1},"level":{"$ref":"#statusLevel","description":"The status level / severity of the status item."},"message":{"type":"string","description":"A brief message describing the status, intended for human consumption."},"error":{"$ref":"#error","description":"An optional serialized error object related to the status."}}},"statusLevel":{"$id":"#statusLevel","type":"string","description":"A status level / severity.","enum":["info","warning","error"]},"error":{"$id":"#error","type":"object","description":"A serialized error object.","required":["name","message"],"additionalProperties":true,"properties":{"name":{"type":"string","examples":["Error","InputError"],"description":"The type name of the error","minLength":1},"message":{"type":"string","description":"The message of the error"},"code":{"type":"string","description":"An error code associated with the error"},"stack":{"type":"string","description":"An error stack trace"}}}}}');const ne=new Map,D=[K,O,re,q];function T(_){if(!(_!=null&&_.length))throw new TypeError("Unknown error");const F=_[0];throw new TypeError(`${F.instancePath||"<root>"} ${F.message}${F.params?` - ${Object.entries(F.params).map(([fe,je])=>`${fe}: ${je}`).join(", ")}`:""}`)}function k(_,F={}){var fe;const je=(fe=F==null?void 0:F.disableCache)!==null&&fe!==void 0?fe:!1,Qe=je?"":JSON.stringify(_);if(!je){const sn=ne.get(Qe);if(sn)return sn}const et=L(_),Zt=new(R())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});et.length&&Zt.addSchema(et,void 0,void 0,!0);const Ht=Zt.compile(_);return je||ne.set(Qe,Ht),Ht}function L(_){if(typeof _!="object")return[];const F=new Set;_.$id&&F.add(_.$id);const fe=new Array,je=[_];for(;je.length;){const Qe=je.pop();for(const et of V(Qe))if(!F.has(et)){F.add(et);const Zt=D.find(Ht=>Ht.$id===et);Zt&&(fe.push(Zt),je.push(Zt))}}return fe}function*V(_){const F=[_];for(;F.length;){const fe=F.pop();if(typeof fe=="object"&&fe)for(const[je,Qe]of Object.entries(fe))je==="$ref"&&typeof Qe=="string"?yield Qe.split("#")[0]:F.push(Qe)}}function Se(_){const F=compileAjvSchema(_||entityEnvelopeSchema);return fe=>{if(F(fe)===!0)return fe;throw throwAjvError(F.errors)}}function We(_){const F=k(_);return fe=>{var je;if(F(fe)===!0)return fe;const et=(je=F.errors)===null||je===void 0?void 0:je.filter(Zt=>["/kind","/apiVersion"].includes(Zt.instancePath));if(et!=null&&et.length&&et.every(Zt=>Zt.keyword==="enum"))return!1;throw T(F.errors)}}function qe(_){const F=compileAjvSchema(_||entitySchema);return fe=>{if(F(fe)===!0)return fe;throw throwAjvError(F.errors)}}class H{static isValidApiVersion(F){return ue.isValidPrefixAndOrSuffix(F,"/",ue.isValidDnsSubdomain,fe=>fe.length>=1&&fe.length<=63&&/^[a-z0-9A-Z]+$/.test(fe))}static isValidKind(F){return typeof F=="string"&&F.length>=1&&F.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(F)}static isValidObjectName(F){return typeof F=="string"&&F.length>=1&&F.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(F)}static isValidNamespace(F){return ue.isValidDnsLabel(F)}static isValidLabelKey(F){return ue.isValidPrefixAndOrSuffix(F,"/",ue.isValidDnsSubdomain,H.isValidObjectName)}static isValidLabelValue(F){return F===""||H.isValidObjectName(F)}static isValidAnnotationKey(F){return ue.isValidPrefixAndOrSuffix(F,"/",ue.isValidDnsSubdomain,H.isValidObjectName)}static isValidAnnotationValue(F){return typeof F=="string"}}const _e={isValidApiVersion:H.isValidApiVersion,isValidKind:H.isValidKind,isValidEntityName:H.isValidObjectName,isValidNamespace:H.isValidNamespace,isValidLabelKey:H.isValidLabelKey,isValidLabelValue:H.isValidLabelValue,isValidAnnotationKey:H.isValidAnnotationKey,isValidAnnotationValue:H.isValidAnnotationValue,isValidTag:_=>typeof _=="string"&&_.length>=1&&_.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(_)};function ut(_={}){return{..._e,..._}}class ze{async enforce(F){function fe(w,Y,J){if(Y==null)throw new Error(`${w} must have a value`);let me;try{me=J(Y)}catch(ve){throw new Error(`${w} could not be validated, ${ve}`)}if(!me){let ve;switch(J.name){case"isValidLabelValue":case"isValidObjectName":ve="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":ve="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":ve="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":ve="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":ve="a string";break;case"isValidKind":ve="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":ve="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":ve="a non empty string";break;default:ve=void 0;break}const Ue=ve?` expected ${ve} but found "${Y}".`:"";throw new Error(`"${w}" 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 je(w,Y,J){return Y===void 0||fe(w,Y,J)}fe("apiVersion",F.apiVersion,this.validators.isValidApiVersion),fe("kind",F.kind,this.validators.isValidKind),fe("metadata.name",F.metadata.name,this.validators.isValidEntityName),je("metadata.namespace",F.metadata.namespace,this.validators.isValidNamespace);var Qe;for(const[w,Y]of Object.entries((Qe=F.metadata.labels)!==null&&Qe!==void 0?Qe:[]))fe(`labels.${w}`,w,this.validators.isValidLabelKey),fe(`labels.${w}`,Y,this.validators.isValidLabelValue);var et;for(const[w,Y]of Object.entries((et=F.metadata.annotations)!==null&&et!==void 0?et:[]))fe(`annotations.${w}`,w,this.validators.isValidAnnotationKey),fe(`annotations.${w}`,Y,this.validators.isValidAnnotationValue);var Zt;const Ht=(Zt=F.metadata.tags)!==null&&Zt!==void 0?Zt:[];for(let w=0;w<Ht.length;++w)fe(`tags.${w}`,Ht[w],this.validators.isValidTag);var sn;const ee=(sn=F.metadata.links)!==null&&sn!==void 0?sn:[];for(let w=0;w<ee.length;++w){var Q,se,g;fe(`links.${w}.url`,(Q=ee[w])===null||Q===void 0?void 0:Q.url,CommonValidatorFunctions.isValidUrl),je(`links.${w}.title`,(se=ee[w])===null||se===void 0?void 0:se.title,CommonValidatorFunctions.isNonEmptyString),je(`links.${w}.icon`,(g=ee[w])===null||g===void 0?void 0:g.icon,KubernetesValidatorFunctions.isValidObjectName)}return F}constructor(F=makeValidator()){_define_property(this,"validators",void 0),this.validators=F}}class ft{async enforce(F){if(!this.validate){const Qe=new Ajv({allowUnionTypes:!0});this.validate=Qe.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(F)===!0)return F;const[je]=this.validate.errors||[];throw je?new Error(`Malformed envelope, ${je.instancePath||"<root>"} ${je.message}`):new Error("Malformed envelope, Unknown error")}constructor(){_define_property(this,"validate",void 0)}}function Re(_){let F=_.indexOf(":");const fe=_.indexOf("/");fe!==-1&&fe<F&&(F=-1);const je=F===-1?void 0:_.slice(0,F),Qe=fe===-1?void 0:_.slice(F+1,fe),et=_.slice(Math.max(F+1,fe+1));if(je===""||Qe===""||et==="")throw new TypeError(`Entity reference "${_}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:je,namespace:Qe,name:et}}function ct(_){return{kind:_.kind,namespace:_.metadata.namespace||u,name:_.metadata.name}}function jt(_,F){if(!_)throw new Error("Entity reference must not be empty");const fe=F==null?void 0:F.defaultKind,je=(F==null?void 0:F.defaultNamespace)||u;let Qe,et,Zt;if(typeof _=="string"){const se=Re(_);var Ht;Qe=(Ht=se.kind)!==null&&Ht!==void 0?Ht:fe;var sn;et=(sn=se.namespace)!==null&&sn!==void 0?sn:je,Zt=se.name}else{var ee;Qe=(ee=_.kind)!==null&&ee!==void 0?ee:fe;var Q;et=(Q=_.namespace)!==null&&Q!==void 0?Q:je,Zt=_.name}if(Qe)if(et){if(!Zt){const se=JSON.stringify(_);throw new Error(`Entity reference ${se} had missing or empty name`)}}else{const se=JSON.stringify(_);throw new Error(`Entity reference ${se} had missing or empty namespace`)}else{const se=JSON.stringify(_);throw new Error(`Entity reference ${se} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:Qe,namespace:et,name:Zt}}function vt(_){let F,fe,je;if("metadata"in _){F=_.kind;var Qe;fe=(Qe=_.metadata.namespace)!==null&&Qe!==void 0?Qe:u,je=_.metadata.name}else{F=_.kind;var et;fe=(et=_.namespace)!==null&&et!==void 0?et:u,je=_.name}return`${F.toLocaleLowerCase("en-US")}:${fe.toLocaleLowerCase("en-US")}/${je.toLocaleLowerCase("en-US")}`}var gt=t(47842);class Et{async enforce(F){let fe=F;for(const je of this.policies){const Qe=await je.enforce(fe);if(!Qe)throw new Error(`Policy ${je.constructor.name} did not return a result`);fe=Qe}return fe}constructor(F){(0,gt.Z)(this,"policies",void 0),this.policies=F}}class Dt{async enforce(F){for(const fe of this.policies){const je=await fe.enforce(F);if(je)return je}throw new Error("The entity did not match any known policy")}constructor(F){(0,gt.Z)(this,"policies",void 0),this.policies=F}}const Ge={allOf(_){return new Et(_)},oneOf(_){return new Dt(_)}};var Wt=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ApiV1alpha1","description":"An API describes an interface that can be exposed by a component. The API can be defined in different formats, like OpenAPI, AsyncAPI, GraphQL, gRPC, or other formats.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"API","metadata":{"name":"artist-api","description":"Retrieve artist details","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"openapi","lifecycle":"production","owner":"artist-relations-team","system":"artist-engagement-portal","definition":"openapi: \\"3.0.0\\"\\ninfo:..."}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["API"]},"spec":{"type":"object","required":["type","lifecycle","owner","definition"],"properties":{"type":{"type":"string","description":"The type of the API definition.","examples":["openapi","asyncapi","graphql","grpc","trpc"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the API.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the API.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the API belongs to.","minLength":1},"definition":{"type":"string","description":"The definition of the API, based on the format defined by the type.","minLength":1}}}}}]}');function xe(_){let F;return{async check(fe){return F||(F=We(_)),F(fe)===fe}}}const pe=xe(Wt);var De=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ComponentV1alpha1","description":"A Component describes a software component. It is typically intimately linked to the source code that constitutes the component, and should be what a developer may regard a \\"unit of software\\", usually with a distinct deployable or linkable artifact.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Component"]},"spec":{"type":"object","required":["type","lifecycle","owner"],"properties":{"type":{"type":"string","description":"The type of component.","examples":["service","website","library"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the component.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the component belongs to.","minLength":1},"subcomponentOf":{"type":"string","description":"An entity reference to another component of which the component is a part.","minLength":1},"providesApis":{"type":"array","description":"An array of entity references to the APIs that are provided by the component.","items":{"type":"string","minLength":1}},"consumesApis":{"type":"array","description":"An array of entity references to the APIs that are consumed by the component.","items":{"type":"string","minLength":1}},"dependsOn":{"type":"array","description":"An array of references to other entities that the component depends on to function.","items":{"type":"string","minLength":1}}}}}}]}');const Je=xe(De);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 wt=xe(At);var rt=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 yt=xe(rt);var Ot=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=xe(Ot),It="ownedBy",on="ownerOf",Ut="consumesApi",Vt="apiConsumedBy",zn="providesApi",In="apiProvidedBy",an="dependsOn",Fn="dependencyOf",jn="parentOf",Un="childOf",Pn="memberOf",Jn="hasMember",at="partOf",Mn="hasPart";var Ln=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 Wn=xe(Ln);var En=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 fn=xe(En);var vn=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 kn=xe(vn),ln="backstage.io/managed-by-location",Vn="backstage.io/managed-by-origin-location",ge="backstage.io/source-location",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;function Le(_){if(typeof _!="string")throw new TypeError(`Unable to parse location ref '${_}', unexpected argument ${typeof _}`);const F=_.indexOf(":");if(F<0)throw new TypeError(`Unable to parse location ref '${_}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const fe=_.substring(0,F).trim(),je=_.substring(F+1).trim();if(!fe||!je)throw new TypeError(`Unable to parse location ref '${_}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(fe==="http"||fe==="https")throw new TypeError(`Invalid location ref '${_}', please prefix it with 'url:', e.g. 'url:${_}'`);if(ie.test(je))throw new TypeError(`Invalid location ref '${_}', target is a javascript: URL`);return{type:fe,target:je}}function Fe(_){const{type:F,target:fe}=_;if(F){if(!fe)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");if(ie.test(fe))throw new TypeError(`Invalid location ref '${F}:${fe}', target is a javascript: URL`);return`${F}:${fe}`}function Ke(_){var F,fe,je,Qe,et;const Zt=(et=(F=_.metadata)===null||F===void 0||(fe=F.annotations)===null||fe===void 0?void 0:fe[ge])!==null&&et!==void 0?et:(je=_.metadata)===null||je===void 0||(Qe=je.annotations)===null||Qe===void 0?void 0:Qe[ln];if(!Zt)throw new Error(`Entity '${vt(_)}' is missing location`);return Le(Zt)}},23196:function(St,$e,t){"use strict";t.d($e,{Oi:function(){return pe},VY:function(){return dt},yW:function(){return al},XF:function(){return At},mn:function(){return Ke},NX:function(){return u},ub:function(){return se},mf:function(){return hl},yu:function(){return cn},h4:function(){return ja},M6:function(){return ir},i9:function(){return wl},aR:function(){return Nt},rJ:function(){return Zr},Oh:function(){return Il},hu:function(){return Al},rU:function(){return _e},Qj:function(){return ze},nU:function(){return Lr},SA:function(){return zr},sk:function(){return tt},Or:function(){return oo},T3:function(){return Ea},g9:function(){return kl},Ex:function(){return Cr},Gk:function(){return S},tn:function(){return tr},Ph:function(){return bn},YE:function(){return js},v7:function(){return n},R6:function(){return Ps},tR:function(){return aa},uw:function(){return Yo},qt:function(){return oi},iA:function(){return wa},GB:function(){return wn},po:function(){return hr},mZ:function(){return vo},Pf:function(){return Wo}});var u={};t.r(u),t.d(u,{Nm:function(){return wt},ht:function(){return Ot},LJ:function(){return yt}});var r=t(52322),W=t(60871),P=t(19928),m=t(2784);function y(e){const[o,a]=useState([]),d=useApi(alertApiRef),{anchorOrigin:p={vertical:"top",horizontal:"center"},transientTimeoutMs:v}=e,C=v!=null?v:5e3;useEffect(()=>{const N=d.alert$().subscribe(de=>a(le=>le.concat(de)));return()=>{N.unsubscribe()}},[d]);const[U]=o;if(useEffect(()=>{if(U&&U.display==="transient"){const N=setTimeout(()=>{a(de=>{const le=de.filter(we=>we!==U);return le.length===de.length?de:le})},C);return()=>clearTimeout(N)}},[U,C]),o.length===0)return null;const G=()=>{a(N=>N.filter(de=>de!==U))};return _jsx(Snackbar,{open:!0,anchorOrigin:p,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:G,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity: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 c=t(79692);const B=(0,c.Z)(e=>({avatar:{width:"4rem",height:"4rem",color:e.palette.common.white},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function Te(e){const{displayName:o,picture:a,customStyles:d}=e,p=B();let v={...d};const C={fontFamily:v.fontFamily,fontSize:v.fontSize,fontWeight:v.fontWeight};return a||(v={backgroundColor:stringToColor(o||""),...d}),_jsx(MaterialAvatar,{alt:o,src:a,className:p.avatar,style:v,children:o&&_jsx(Typography,{variant:"h6",component:"span",className:p.avatarText,style:C,children:extractInitials(o)})})}var ue=t(77277),K=t(86689),$=t(90436),R=t(72779),O=t.n(R),re=t(76635),q=t(73557),ne=t(71597);function D(){const[e]=(0,q.is)((0,r.jsx)(q.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!e.index}const T=(0,c.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"}),k=e=>/^([a-z+.-]+):/.test(e),L=/^[\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,V=window.open;if(V&&!V.__backstage){const e=function(...a){const d=String(a[0]);if(L.test(d))throw new Error("Rejected window.open() with a javascript: URL as a security precaution");return V.apply(this,a)};e.__backstage=!0,window.open=e}const Se=()=>{try{return(0,W.h_)(W.Ds).getOptionalString("app.baseUrl")}catch{return}},We=()=>{const e="http://sample.dev";var o;const a=(o=Se())!==null&&o!==void 0?o:"/",{pathname:d}=new URL(a,e);return(0,re.trimEnd)(d,"/")},qe=e=>{let o=String(e);const a=We(),d=k(o),p=o.startsWith(a);return!d&&!p&&(o=a.concat(o)),o},H=e=>{if(e instanceof Array)return e.map(H).join(" ").trim();if(typeof e=="object"&&e){var o;return H(e==null||(o=e.props)===null||o===void 0?void 0:o.children)}return["string","number"].includes(typeof e)?String(e):""},_e=m.forwardRef(({onClick:e,noTrack:o,...a},d)=>{const p=T(),v=(0,W.z$)(),C=D()?qe(a.to):a.to,U=H(a.children)||C,G=k(C),N=G&&!!/^https?:/.exec(C);if(L.test(C))throw new Error("Link component rejected javascript: URL as a security precaution");const de=le=>{e==null||e(le),o||v.captureEvent("click",U,{attributes:{to:C}})};return G?(0,r.jsxs)(K.Z,{...N?{target:"_blank",rel:"noopener"}:{},...a,ref:d,href:C,onClick:de,className:O()(p.externalLink,a.className),children:[a.children,(0,r.jsx)($.Z,{component:"span",className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,r.jsx)(K.Z,{...a,ref:d,component:ne.rU,to:C,onClick:de})}),ut=m.forwardRef((e,o)=>(0,r.jsx)(_e,{ref:o,...e,color:"initial"})),ze=m.forwardRef((e,o)=>(0,r.jsx)(ue.Z,{ref:o,component:ut,...e})),ft=null;var Re=t(95544),ct=t(60364),jt=t(83229),vt=t(26639),gt=t(39595),Et=t(61837),Dt=t(80030),Ge=t(19353),Wt=t(95074);function xe(e){const{text:o,tooltipDelay:a=1e3,tooltipText:d="Text copied to clipboard","aria-label":p="Copy text"}=e,v=(0,W.h_)(W.VE),[C,U]=(0,m.useState)(!1),[{error:G},N]=(0,Wt.Z)();(0,m.useEffect)(()=>{G&&v.post(G)},[G,v]);const de=le=>{le.stopPropagation(),U(!0),N(o)};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(Dt.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:a,onClose:()=>U(!1),open:C,children:(0,r.jsx)(Et.Z,{onClick:de,"aria-label":p,children:(0,r.jsx)(Ge.Z,{})})})})}function pe(e){const{text:o,language:a,showLineNumbers:d=!1,highlightedNumbers:p,customStyle:v,showCopyCodeButton:C=!1}=e,U=(0,ct.Z)(),G=U.palette.type==="dark"?vt.Z:gt.Z,N=U.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,r.jsxs)(Re.Z,{position:"relative",children:[(0,r.jsx)(jt.Z,{customStyle:v,language:a,style:G,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:U.palette.textVerySubtle},lineProps:de=>p!=null&&p.includes(de)?{style:{backgroundColor:N}}:{},children:o}),C&&(0,r.jsx)(Re.Z,{position:"absolute",top:0,right:0,children:(0,r.jsx)(xe,{text:o})})]})}var De=t(41156),Je=t(88188);function At(e){const{title:o,to:a}=e,d=(0,De.Z)(p=>p.breakpoints.down("xs"));return a?d?(0,r.jsx)(Et.Z,{component:ne.rU,color:"primary",title:o,size:"small",to:a,children:(0,r.jsx)(Je.Z,{})}):(0,r.jsx)(ue.Z,{component:ne.rU,variant:"contained",color:"primary",to:a,children:o}):null}var wt;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(wt||(wt={}));var rt;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(rt||(rt={}));var yt;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(yt||(yt={}));var Ot;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(Ot||(Ot={}));var Gt=t(27397),It=t(11105),on=t(97963),Ut=t(46506),Vt=t.n(Ut),zn=t(54073),In=t.n(zn),an=t(10368);const Fn=(0,c.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function jn({node:{id:e}}){const o=Fn(),[a,d]=m.useState(0),[p,v]=m.useState(0),C=m.useRef(null);m.useLayoutEffect(()=>{if(C.current){let{height:de,width:le}=C.current.getBBox();de=Math.round(de),le=Math.round(le),(de!==p||le!==a)&&(d(le),v(de))}},[a,p]);const U=10,G=a+U*2,N=p+U*2;return(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{className:o.node,width:G,height:N,rx:10}),(0,r.jsx)("text",{ref:C,className:o.text,y:N/2,x:G/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const Un="arrow-marker",Pn="node",Jn="edge",at="label",Mn=(0,an.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),Ln=e=>(0,r.jsx)(jn,{...e});function Wn({render:e=Ln,setNode:o,node:a}){const{width:d,height:p,x:v=0,y:C=0}=a,U=a,G=Mn(),N=m.useRef(null);return m.useLayoutEffect(()=>{if(N.current){let{height:de,width:le}=N.current.getBBox();de=Math.round(de),le=Math.round(le),(de!==p||le!==d)&&o(a.id,{...a,height:de,width:le})}},[a,d,p,o]),(0,r.jsx)("g",{ref:N,"data-testid":Pn,className:G.node,transform:`translate(${v-d/2},${C-p/2})`,children:e({node:U})})}var En=t(76985),fn=t(39829),vn=t(19574),kn=t.n(vn);const ln=(0,an.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function Vn({edge:{label:e}}){const o=ln();return(0,r.jsx)("text",{className:o.text,textAnchor:"middle",children:e})}const ge=(0,an.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"}),ie=e=>(0,r.jsx)(Vn,{...e});function Le({render:e=ie,setEdge:o,id:a,edge:d,curve:p}){const{x:v=0,y:C=0,width:U,height:G,points:N}=d,de=d,le=ge(),we=m.useRef(null);m.useLayoutEffect(()=>{if(we.current){let{height:Ye,width:Lt}=we.current.getBBox();Ye=Math.round(Ye),Lt=Math.round(Lt),(Ye!==G||Lt!==U)&&o(a,{...d,height:Ye,width:Lt})}},[d,G,U,o,a]);let Pe="";const Me=m.useMemo(()=>En.Z().x(Ye=>Ye.x).y(Ye=>Ye.y).curve(fn[p]),[p]);if(N){const Ye=N.filter(Lt=>kn()(Lt.x)&&kn()(Lt.y));Pe=Me(Ye)||""}return(0,r.jsxs)(r.Fragment,{children:[Pe&&(0,r.jsx)("path",{"data-testid":Jn,className:le.path,d:Pe}),de.label?(0,r.jsx)("g",{ref:we,"data-testid":at,className:le.label,transform:`translate(${v},${C})`,children:e({edge:de})}):null]})}const Fe="workspace";function Ke(e){var o,a;const{edges:d,nodes:p,renderNode:v,direction:C=wt.TOP_BOTTOM,align:U,nodeMargin:G=50,edgeMargin:N=10,rankMargin:de=50,paddingX:le=0,paddingY:we=0,acyclicer:Pe,ranker:Me=yt.NETWORK_SIMPLEX,labelPosition:Ye=Ot.RIGHT,labelOffset:Lt=10,edgeRanks:Jt=1,edgeWeight:nn=1,renderLabel:rn,defs:kt,zoom:en="enabled",curve:Qt="curveMonotoneX",fit:Er="grow",...Ar}=e,Tr=(0,on.Z)(),[Rr,Li]=m.useState(100),[$r,ki]=m.useState(100),Xt=m.useRef(new(Vt()).graphlib.Graph),[Co,Ls]=m.useState(((o=Xt.current.graph())===null||o===void 0?void 0:o.width)||0),[Dr,Oi]=m.useState(((a=Xt.current.graph())===null||a===void 0?void 0:a.height)||0),[Dn,Sr]=m.useState([]),[Xr,qr]=m.useState([]),hn=Math.max(Co,Rr),Cn=Math.max(Dr,$r),wo=Math.min(Dr,$r),_r=Er==="grow"?Cn:wo,Xo=m.useMemo(()=>In()(mn=>{if(!mn)return;const Nn=It.Z(mn),pn=It.Z(mn.getElementById(Fe));function pr(){Nn.call(Gt.sP().scaleExtent([1,10]).on("zoom",Ir=>{Ir.transform.x=Math.min(0,Math.max(Ir.transform.x,hn-hn*Ir.transform.k)),Ir.transform.y=Math.min(0,Math.max(Ir.transform.y,Cn-Cn*Ir.transform.k)),pn.attr("transform",Ir.transform)}))}en==="enabled"?pr():en==="enable-on-click"&&Nn.on("click",()=>pr());const{width:fr,height:ks}=mn.getBoundingClientRect();Rr!==fr&&Li(fr),$r!==ks&&ki(ks)},100),[$r,Rr,hn,Cn,en]),ka=m.useCallback(()=>{const mn=Xt.current.nodes(),Nn=Xt.current.edges();mn.forEach(pn=>{p.some(fr=>fr.id===pn)||Xt.current.removeNode(pn)}),Nn.forEach(pn=>{d.some(fr=>fr.from===pn.v&&fr.to===pn.w)||Xt.current.removeEdge(pn.v,pn.w)}),p.forEach(pn=>{const pr=Xt.current.nodes().find(fr=>pn.id===fr);if(pr&&Xt.current.node(pr)){const{width:fr,height:ks,x:Ir,y:Xl}=Xt.current.node(pr);Xt.current.setNode(pr,{...pn,width:fr,height:ks,x:Ir,y:Xl})}else Xt.current.setNode(pn.id,{...pn,width:0,height:0})}),d.forEach(pn=>{Xt.current.setEdge(pn.from,pn.to,{...pn,label:pn.label,width:0,height:0,labelpos:Ye,labeloffset:Lt,weight:nn,minlen:Jt})})},[d,p,Ye,Lt,nn,Jt]),qo=m.useMemo(()=>In()(()=>{Vt().layout(Xt.current);const{height:mn,width:Nn}=Xt.current.graph(),pn=Math.max(0,mn||0),pr=Math.max(0,Nn||0);Ls(pr),Oi(pn),Sr(Xt.current.nodes()),qr(Xt.current.edges())},250,{leading:!0}),[]);m.useEffect(()=>(Xt.current.setGraph({rankdir:C,align:U,nodesep:G,edgesep:N,ranksep:de,marginx:le,marginy:we,acyclicer:Pe,ranker:Me}),ka(),qo(),qo.cancel),[Pe,U,C,N,le,we,G,de,Me,ka,qo]);function Jl(mn,Nn){return Xt.current.setNode(mn,Nn),qo(),Xt.current}function Ql(mn,Nn){return Xt.current.setEdge(mn,Nn),qo(),Xt.current}return(0,r.jsxs)("svg",{ref:Xo,...Ar,width:"100%",height:_r,viewBox:`0 0 ${hn} ${Cn}`,children:[(0,r.jsxs)("defs",{children:[(0,r.jsx)("marker",{id:Un,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{fill:Tr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),kt]}),(0,r.jsx)("g",{id:Fe,children:(0,r.jsxs)("svg",{width:Co,height:Dr,y:Cn/2-Dr/2,x:hn/2-Co/2,viewBox:`0 0 ${Co} ${Dr}`,children:[Xr.map(mn=>{const Nn=Xt.current.edge(mn);return Nn?(0,r.jsx)(Le,{id:mn,setEdge:Ql,render:rn,edge:Nn,curve:Qt},`${mn.v}-${mn.w}`):null}),Dn.map(mn=>{const Nn=Xt.current.node(mn);return Nn?(0,r.jsx)(Wn,{setNode:Jl,render:v,node:Nn},mn):null})]})})]})}var _;const F=(0,c.Z)(e=>({root:{padding:e.spacing(0),marginBottom:e.spacing(0),marginTop:e.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:e.spacing(6),marginTop:-e.spacing(3),zIndex:"unset"},icon:{fontSize:e.typography.h6.fontSize},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap"},message:{display:"flex",alignItems:"center",color:e.palette.banner.text,"& a":{color:e.palette.banner.link}},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(_=e.palette.banner.warning)!==null&&_!==void 0?_:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),fe=e=>{const{variant:o,message:a,id:d,fixed:p=!1}=e,v=F(),U=useApi(storageApiRef).forBucket("notifications");var G;const N=(G=U.snapshot("dismissedBanners").value)!==null&&G!==void 0?G:[],[de,le]=useState(new Set(N)),we=useObservable(U.observe$("dismissedBanners"));useEffect(()=>{if(we!=null&&we.value){var Me;const Ye=(Me=we==null?void 0:we.value)!==null&&Me!==void 0?Me:[];le(new Set(Ye))}},[we==null?void 0:we.value]);const Pe=()=>{U.set("dismissedBanners",[...de,d])};return _jsx(Snackbar,{anchorOrigin:p?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!de.has(d),classes:{root:classNames(v.root,!p&&v.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(v.content,v[o]),message:v.message},message:a,action:[_jsx(IconButton,{title:"Permanently dismiss this message",color:"inherit",onClick:Pe,children:_jsx(Close,{className:v.icon})},"dismiss")]})})};var je=t(60905),Qe=t.p+"static/missingAnnotation.67f79e98..svg",et=t.p+"static/noInformation.4b426325..svg",Zt=t.p+"static/createComponent.975d1e1e..svg",Ht=t.p+"static/noBuild.1715fa71..svg";const sn=(0,c.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),ee=({missing:e})=>{const o=sn();switch(e){case"field":return(0,r.jsx)("img",{src:Qe,className:o.generalImg,alt:"annotation is missing"});case"info":return(0,r.jsx)("img",{src:et,alt:"no Information",className:o.generalImg});case"content":return(0,r.jsx)("img",{src:Zt,alt:"create Component",className:o.generalImg});case"data":return(0,r.jsx)("img",{src:Ht,alt:"no Build",className:o.generalImg});default:return null}},Q=(0,c.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 se(e){const{title:o,description:a,missing:d,action:p}=e,v=Q();return(0,r.jsxs)(je.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2,children:[(0,r.jsx)(je.Z,{item:!0,xs:12,md:6,children:(0,r.jsxs)(je.Z,{container:!0,direction:"column",children:[(0,r.jsx)(je.Z,{item:!0,xs:!0,children:(0,r.jsx)($.Z,{variant:"h5",children:o})}),(0,r.jsx)(je.Z,{item:!0,xs:!0,children:(0,r.jsx)($.Z,{variant:"body1",children:a})}),(0,r.jsx)(je.Z,{item:!0,xs:!0,className:v.action,children:p})]})}),(0,r.jsx)(je.Z,{item:!0,xs:12,md:6,className:v.imageContainer,children:typeof d=="string"?(0,r.jsx)(ee,{missing:d}):d.customImage})]})}const g=`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`,w=/^.*ANNOTATION.*$/m,Y=g.match(w)[0],J=g.split(`
|
|
12
|
-
`).findIndex(e=>w.test(e)),me=(0,c.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":e.palette.common.white}}),{name:"BackstageMissingAnnotationEmptyState"});function ve(e){return Array.from(Array(e+1).keys(),o=>o+J)}function Ue(e){const o=e.map(a=>Y.replace("ANNOTATION",a)).join(`
|
|
13
|
-
`);return g.replace(Y,o)}function ot(e){const o=e.length<=1;return(0,r.jsxs)(r.Fragment,{children:["The ",o?"annotation":"annotations"," ",e.map(a=>(0,r.jsx)("code",{children:a})).reduce((a,d)=>(0,r.jsxs)(r.Fragment,{children:[a,", ",d]}))," ",o?"is":"are"," missing. You need to add the"," ",o?"annotation":"annotations"," to your component if you want to enable this tool."]})}function tt(e){const{annotation:o,readMoreUrl:a}=e,d=Array.isArray(o)?o:[o],p=a||"https://backstage.io/docs/features/software-catalog/well-known-annotations",v=me();return(0,r.jsx)(se,{missing:"field",title:"Missing Annotation",description:ot(d),action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)($.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,r.jsx)(Re.Z,{className:v.code,children:(0,r.jsx)(pe,{text:Ue(d),language:"yaml",showLineNumbers:!0,highlightedNumbers:ve(d.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,r.jsx)(ue.Z,{color:"primary",component:_e,to:p,children:"Read more"})]})})}var xt=t(11776),lt=t(38402),nt=t(49378),Oe=t(41128),Tt=t(27616),Kt=t(8284),Rt=t(70660),Pt=t(91750),tn=t(38016);const Mt=(e,o)=>(o.palette.type==="light"?Oe._j:Oe.$n)(o.palette[e].light,.6),ht=(e,o)=>(o.palette.type==="light"?Oe.$n:Oe._j)(o.palette[e].light,.9),Xe=(0,c.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:o})=>Mt(o,e)}})),Bt=({severity:e})=>{const o=Xe({severity:e});return(0,r.jsx)(Pt.Z,{classes:o})},qt=({severity:e})=>{const o=Xe({severity:e});return(0,r.jsx)(tn.Z,{classes:o})},An=(0,c.Z)(e=>({panel:{backgroundColor:({severity:o})=>ht(o,e),color:({severity:o})=>Mt(o,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:o})=>Mt(o,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:o})=>Mt(o,e),backgroundColor:({severity:o})=>ht(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"}),gn=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function wn(e){const{severity:o="warning",title:a,message:d,children:p,defaultExpanded:v}=e,C=An({severity:o}),U=gn(o)+(a?`: ${a}`:"");return(0,r.jsxs)(Tt.Z,{defaultExpanded:v!=null?v:!1,className:C.panel,role:"alert",children:[(0,r.jsxs)(Kt.Z,{expandIcon:(0,r.jsx)(qt,{severity:o}),className:C.summary,children:[(0,r.jsx)(Bt,{severity:o}),(0,r.jsx)($.Z,{className:C.summaryText,variant:"subtitle1",children:U})]}),(d||p)&&(0,r.jsx)(Rt.Z,{children:(0,r.jsxs)(je.Z,{container:!0,children:[d&&(0,r.jsx)(je.Z,{item:!0,xs:12,children:(0,r.jsx)($.Z,{className:C.message,variant:"body1",children:d})}),p&&(0,r.jsx)(je.Z,{item:!0,xs:12,className:C.details,children:p})]})})]})}const Qn=(0,c.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),Hn=({error:e,message:o,stack:a,children:d})=>{const p=Qn();return(0,r.jsxs)(xt.Z,{dense:!0,children:[(0,r.jsxs)(lt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(nt.Z,{classes:{secondary:p.text},primary:"Error",secondary:e}),(0,r.jsx)(xe,{text:e})]}),(0,r.jsxs)(lt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(nt.Z,{classes:{secondary:p.text},primary:"Message",secondary:o}),(0,r.jsx)(xe,{text:o})]}),a&&(0,r.jsxs)(lt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(nt.Z,{classes:{secondary:p.text},primary:"Stack Trace",secondary:a}),(0,r.jsx)(xe,{text:a})]}),d]})};function cn(e){const{title:o,error:a,defaultExpanded:d,children:p}=e;return(0,r.jsx)(wn,{severity:"error",title:o!=null?o:a.message,defaultExpanded:d,children:(0,r.jsx)(Hn,{error:a.name,message:a.message,stack:a.stack,children:p})})}var gr=t(85256);const mr=(0,c.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function S(e){var o;const{title:a,error:d,defaultExpanded:p}=e,v=mr();if(d.name!=="ResponseError")return(0,r.jsx)(cn,{title:a!=null?a:d.message,defaultExpanded:p,error:d});const{body:C,cause:U}=d,{request:G,response:N}=C,de=`${N.statusCode}: ${U.name}`,le=G&&`${G.method} ${G.url}`,we=U.message.replace(/\\n/g,`
|
|
14
|
-
`),Pe=(o=U.stack)===null||o===void 0?void 0:o.replace(/\\n/g,`
|
|
15
|
-
`),Me=JSON.stringify(C,void 0,2);return(0,r.jsxs)(cn,{title:a!=null?a:d.message,defaultExpanded:p,error:{name:de,message:we,stack:Pe},children:[le&&(0,r.jsxs)(lt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(nt.Z,{classes:{secondary:v.text},primary:"Request",secondary:G?`${le}`:void 0}),(0,r.jsx)(xe,{text:le})]}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(gr.Z,{component:"li",className:v.divider}),(0,r.jsx)(lt.Z,{alignItems:"flex-start",children:(0,r.jsx)(nt.Z,{classes:{secondary:v.text},primary:"Full Error as JSON"})}),(0,r.jsx)(pe,{language:"json",text:Me,showCopyCodeButton:!0})]})]})}var h=t(28316);function x(e){const o=document.createElement("div");return o.setAttribute("id",e),o}function j(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function X(e){const o=useRef(null);useEffect(function(){const p=document.querySelector(`#${e}`),v=p||x(e);return p||j(v),v.appendChild(o.current),function(){o.current.remove(),v.childNodes.length===-1&&v.remove()}},[e]);function a(){return o.current||(o.current=document.createElement("div")),o.current}return a()}var Ce=null;const he="core.calloutSeen";function Ne(){const[e,o]=useState(()=>{const d=localStorage.getItem(he);return d?JSON.parse(d):{}}),a=useCallback((d,p)=>{const v=localStorage.getItem(he),U={...v?JSON.parse(v):{},[d]:p};o(U),localStorage.setItem(he,JSON.stringify(U))},[]);return{states:e,setState:a}}function pt(e){const{states:o,setState:a}=Ne(),d=useCallback(()=>{a(e,!0)},[a,e]);return{seen:o[e]===!0,markSeen:d}}function zt(e){const{seen:o,markSeen:a}=pt(e);return{show:o===!1,hide:a}}const dn=(0,c.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 On(e){const{featureId:o,title:a,description:d,children:p}=e,{show:v,hide:C}=useShowCallout(o),U=usePortal("core.callout"),G=useRef(null),[N,de]=useState(),le=dn(),we=useCallback(()=>{if(G.current){const Pe=G.current.getBoundingClientRect(),Me=Math.max(Pe.width,Pe.height),Ye=800,Lt=Pe.x-(Me-Pe.width)/2-Ye,Jt=Pe.y-(Me-Pe.height)/2-Ye,nn=Me+2*Ye,rn=450,kt=Pe.x+Pe.width/2-rn,en=Pe.y-(Me-Pe.height)/2+Me+20;de({dotLeft:Lt,dotTop:Jt,dotSize:nn,borderWidth:Ye,textTop:en,textLeft:kt,textWidth:rn})}},[]);return useEffect(()=>(window.addEventListener("resize",we),window.addEventListener("scroll",we),()=>{window.removeEventListener("resize",we),window.removeEventListener("scroll",we)}),[we]),useLayoutEffect(we,[G.current,we]),v?_jsxs(_Fragment,{children:[_jsx(Box,{className:le.featureWrapper,ref:G,children:p}),createPortal(_jsx(Box,{className:le.backdrop,children:_jsx(ClickAwayListener,{onClickAway:C,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:le.dot,"data-testid":"dot",style:{left:N==null?void 0:N.dotLeft,top:N==null?void 0:N.dotTop,width:N==null?void 0:N.dotSize,height:N==null?void 0:N.dotSize,borderWidth:N==null?void 0:N.borderWidth},onClick:C,onKeyDown:C,role:"button",tabIndex:0,children:_jsx(Box,{className:le.pulseCircle})}),_jsxs(Box,{className:le.text,"data-testid":"text",style:{left:N==null?void 0:N.textLeft,top:N==null?void 0:N.textTop,width:N==null?void 0:N.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:a}),_jsx(Typography,{children:d})]})]})})}),U)]}):_jsx(_Fragment,{children:p})}var vr=t(35292);const Pr=(0,c.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 eo({color:e="primary",disabled:o=!1,href:a="#",icon:d=(0,r.jsx)(vr.Z,{}),label:p,onClick:v,title:C}){const U=Pr();return o?(0,r.jsxs)(Re.Z,{title:C,className:O()(U.link,U.disabled),children:[d,(0,r.jsx)($.Z,{variant:"caption",component:"span",className:U.label,children:p})]}):(0,r.jsxs)(_e,{title:C,className:O()(U.link,U[e]),to:a,onClick:v,children:[d,(0,r.jsx)($.Z,{variant:"caption",component:"span",className:U.label,children:p})]})}const jo=(0,c.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function ir(e){const{links:o}=e,a=jo();return(0,r.jsx)("nav",{className:a.links,children:o.map((d,p)=>(0,r.jsx)(eo,{...d},p+1))})}const Gn=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
|
-
`},Xn=100,ar=10,Nr=(0,c.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:Xn,height:`calc(100% + ${ar}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-ar,background:`linear-gradient(90deg, ${Gn(e.palette.type)})`},fadeRight:{right:-ar,background:`linear-gradient(270deg, ${Gn(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function Eo(e){const[[o,a],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const p=e.current;if(!p){d([0,0]);return}const v=()=>{const C=p.scrollLeft,U=p.scrollWidth-p.offsetWidth-p.scrollLeft;d([C,U])};return v(),p.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{p.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[e]),[o,a]}function yr(e,o,a){const[d,p]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const v=window.performance.now(),C=requestAnimationFrame(U=>{if(!e.current)return;const G=U-v,N=Math.abs(d)*G/o,le=Math.max(a,N)*Math.sign(d);e.current.scrollBy({left:le});const we=d-le;Math.sign(d)!==Math.sign(we)?p(0):p(we)});return()=>cancelAnimationFrame(C)},[e,d,o,a]),p}function _o(e){const{scrollStep:o=100,scrollSpeed:a=50,minScrollDistance:d=5,children:p,...v}=e,C=Nr(e),U=React.useRef(),[G,N]=Eo(U),de=yr(U,a,d),le=we=>{U.current&&de(we?o:-o)};return _jsxs(Box,{...v,className:C.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:C.container,ref:U,children:p}),_jsx(Box,{className:classNames(C.fade,C.fadeLeft,{[C.fadeHidden]:G===0})}),_jsx(Box,{className:classNames(C.fade,C.fadeRight,{[C.fadeHidden]:N===0})}),G>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>le(!1),className:classNames(C.button,C.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),N>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>le(!0),className:classNames(C.button,C.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const Ao=(0,c.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 to(e){const o=Ao(e),{shorthand:a,alpha:d}=e;return a?_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],style:{fontSize:"120%"},children:d?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],children:d?"Alpha":"Beta"})}const qn=(0,m.lazy)(()=>Promise.all([t.e(6174),t.e(6051)]).then(t.bind(t,76051)).then(e=>({default:e.RealLogViewer})));function Lr(e){const{Progress:o}=(0,W.qD)().getComponents();return(0,r.jsx)(m.Suspense,{fallback:(0,r.jsx)(o,{}),children:(0,r.jsx)(qn,{...e})})}var kr=t(28865),To=t(60251);const Fr=(0,c.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"}),Ur=(e,o)=>o?typeof o=="string"?e+o:m.Children.toArray(o.props.children).reduce(Ur,e):e,lr=({level:e,children:o})=>{const p=m.Children.toArray(o).reduce(Ur,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return m.createElement(`h${e}`,{id:p},o)},Mr={code:({inline:e,className:o,children:a,...d})=>{const p=String(a).replace(/\n+$/,""),v=/language-(\w+)/.exec(o||"");return!e&&v?(0,r.jsx)(pe,{language:v[1],text:p}):(0,r.jsx)("code",{className:o,...d,children:a})},h1:lr,h2:lr,h3:lr,h4:lr,h5:lr,h6:lr};function zr(e){const{content:o,dialect:a="gfm",linkTarget:d,transformLinkUri:p,transformImageUri:v,className:C}=e,U=Fr();return(0,r.jsx)(kr.D,{remarkPlugins:a==="gfm"?[To.Z]:[],className:`${U.markdown} ${C}`,children:o,components:Mr,linkTarget:d,transformLinkUri:p,transformImageUri:v})}var Ro=t(23054);const Io=(0,c.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),Po=({request:e,busy:o,setBusy:a})=>{const d=Io(),[p,v]=useState(),C=async()=>{a(!0);try{await e.trigger()}catch(G){v(isError(G)?G.message:"An unspecified error occurred")}finally{a(!1)}},U=e.provider.icon;return _jsxs(ListItem,{disabled:o,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx(U,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:p&&_jsx(Typography,{color:"error",children:p})}),_jsx(Button,{color:"primary",variant:"contained",onClick:C,children:"Log in"})]})};var Lo=null;const no=(0,c.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 es(e){const o=no(),[a,d]=useState(!1),p=useApi(oauthRequestApiRef),v=useApi(configApiRef);var C;const U=(C=v.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&C!==void 0?C:!1,G=useObservable(useMemo(()=>p.authRequest$(),[p]),[]),N=()=>{G.forEach(de=>de.reject())};return _jsxs(Dialog,{open:Boolean(G.length),fullWidth:!0,maxWidth:"xs",classes:{paper:o.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsxs(DialogTitle,{classes:{root:o.title},id:"oauth-req-dialog-title",children:[_jsx(Typography,{className:o.titleHeading,variant:"h1",children:"Login Required"}),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:G.map(de=>_jsx(LoginRequestListItem,{request:de,busy:a,setBusy:d},de.provider.title))})})]}),_jsx(DialogActions,{classes:{root:o.actionButtons},children:_jsx(Button,{onClick:N,children:"Reject All"})})]})}var xr=t(15277),ko=t.n(xr),ro=t(29862);const Oo=(0,c.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function oo(e){const[o,a]=(0,m.useState)(!1),d=(0,ro.t)(),p=Oo(),v=U=>{d()&&a(U)};var C;return(0,r.jsx)(Dt.ZP,{title:(C=e.title)!==null&&C!==void 0?C:e.text||"",placement:e.placement,disableHoverListener:!o,children:(0,r.jsx)(ko(),{text:e.text,line:e.line,onToggled:v,containerClassName:p.container})})}var cr=t(67358);function Cr(e){const o=(0,ct.Z)(),[a,d]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{const p=setTimeout(()=>d(!0),o.transitions.duration.short);return()=>clearTimeout(p)},[o.transitions.duration.short]),a?(0,r.jsx)(cr.Z,{...e,"data-testid":"progress"}):(0,r.jsx)(Re.Z,{display:"none"})}var Zo=t(94339),Wr=t(14503),Bo=t(24579),Or=t(32552),Yt=t(15459),ts=t(27597);const $o=(0,c.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 ns(e){const{link:o,title:a,onClick:d}=e,p=$o();return(0,r.jsxs)(Re.Z,{children:[(0,r.jsx)(gr.Z,{}),(0,r.jsx)(_e,{to:o,onClick:d,underline:"none",children:(0,r.jsxs)(Re.Z,{display:"flex",alignItems:"center",className:p.root,children:[(0,r.jsx)(Re.Z,{className:p.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)($.Z,{children:(0,r.jsx)("strong",{children:a})})}),(0,r.jsx)(ts.Z,{className:p.arrow})]})})]})}const rs=e=>{const{slackChannel:o}=e;if(o){if(typeof o=="string")return(0,r.jsxs)($.Z,{children:["Please contact ",o," for help."]});if(!o.href)return(0,r.jsxs)($.Z,{children:["Please contact ",o.name," for help."]})}else return null;return(0,r.jsx)(ze,{to:o.href,variant:"contained",children:o.name})},os=class extends m.Component{componentDidCatch(o,a){console.error(`ErrorBoundary, error: ${o}, info: ${a}`),this.setState({error:o,errorInfo:a})}render(){const{slackChannel:o,children:a}=this.props,{error:d}=this.state;return d?(0,r.jsx)(cn,{title:"Something Went Wrong",error:d,children:(0,r.jsx)(rs,{slackChannel:o})}):a}constructor(o){super(o),this.state={error:void 0,errorInfo:void 0}}},ss=(0,c.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"}),is=(0,Yt.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Wr.Z),rr={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 Zr(e){const{title:o,subheader:a,divider:d=!0,deepLink:p,slackChannel:v,errorBoundaryProps:C,variant:U,children:G,headerStyle:N,headerProps:de,icon:le,action:we,actionsClassName:Pe,actions:Me,cardClassName:Ye,actionsTopRight:Lt,className:Jt,noPadding:nn,titleTypographyProps:rn}=e,kt=ss();let en={},Qt={};U&&U.split(/[\s]+/g).forEach(Rr=>{en={...en,...rr.card[Rr]},Qt={...Qt,...rr.cardContent[Rr]}});const Er=()=>!a&&!le?null:(0,r.jsxs)("div",{className:kt.headerSubheader,"data-testid":"info-card-subheader",children:[a&&(0,r.jsx)("div",{className:kt.subheader,children:a}),le]}),Ar=C||(v?{slackChannel:v}:{});return(0,r.jsx)(Zo.Z,{style:en,className:Jt,children:(0,r.jsxs)(os,{...Ar,children:[o&&(0,r.jsx)(Or.Z,{classes:{root:kt.header,title:kt.headerTitle,subheader:kt.headerSubheader,avatar:kt.headerAvatar,action:kt.headerAction,content:kt.headerContent},title:o,subheader:Er(),action:we,style:{...N},titleTypographyProps:rn,...de}),Lt&&(0,r.jsx)(is,{children:Lt}),d&&(0,r.jsx)(gr.Z,{}),(0,r.jsx)(Bo.Z,{className:O()(Ye,{[kt.noPadding]:nn}),style:Qt,children:G}),Me&&(0,r.jsx)(Wr.Z,{className:Pe,children:Me}),p&&(0,r.jsx)(ns,{...p})]})})}var as=t(39307);const Do=(0,c.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"}),so={fractional:!0,inverse:!1,unit:"%",max:100},Vr=({palette:e,value:o,inverse:a,max:d})=>{if(isNaN(o))return"#ddd";const p=d||so.max,v=a?p-o:o;return v<p/3?e.status.error:v<p*(2/3)?e.status.warning:e.status.ok};function b(e){const[o,a]=useState(null),{getColor:d=Vr}=e,p=Do(e),{palette:v}=useTheme(),{value:C,fractional:U,inverse:G,unit:N,max:de,description:le}={...so,...e},we=U?Math.round(C*de):C,Pe=de!==100?Math.round(C):we,[Me,Ye]=useState(!1);return useEffect(()=>{const Lt=o,Jt=()=>Ye(!0),nn=()=>Ye(!1);return Lt&&le?(Lt.addEventListener("mouseenter",Jt),Lt.addEventListener("mouseleave",nn),()=>{Lt.removeEventListener("mouseenter",Jt),Lt.removeEventListener("mouseleave",nn)}):()=>{Ye(!1)}},[le,o]),_jsxs(Box,{ref:a,className:p.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:we,strokeWidth:12,trailWidth:12,strokeColor:d({palette:v,value:Pe,inverse:G,max:de}),className:p.circle}),le&&Me?_jsx(Box,{className:p.description,children:le}):_jsx(Box,{className:p.overlay,children:isNaN(C)?"N/A":`${Pe}${N}`})]})}const E=(0,c.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function I(e){const o=E(e),{title:a,subheader:d,progress:p,inverse:v,deepLink:C,description:U,icon:G,variant:N,getColor:de}=e,le={inverse:v,description:U,getColor:de,value:p};return _jsx(Box,{className:o.root,children:_jsx(InfoCard,{title:a,subheader:d,deepLink:C,variant:N,icon:G,children:_jsx(Gauge,{...le})})})}function M(e){const{value:o,getColor:a=getProgressColor}=e,{palette:d}=useTheme();if(isNaN(o))return null;let p=Math.round(o*100*100)/100;p>100&&(p=100);const v=a({palette:d,value:p,inverse:!1,max:100});return _jsx(Tooltip,{title:`${p}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:p,strokeWidth:4,trailWidth:4,strokeColor:v})})})}var te=t(21324),ce=t(7089),oe=t(1292),ye=t(42494),Ae=t(74603),Ie=t(56939),Ze=t(12231),be=t(73698),Ve=t(12420),st=t(72379);const it=(0,c.Z)(e=>(0,Ve.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var mt=()=>{const e=it();return(0,r.jsx)(st.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const $t=(0,c.Z)(e=>(0,Ve.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var un=()=>{const e=$t();return(0,r.jsx)(st.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const xn=(0,Yt.Z)(e=>(0,Ve.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"})(Ae.Z),_t=(0,c.Z)(e=>(0,Ve.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 bn(e){const{multiple:o,items:a,label:d,placeholder:p,selected:v,onChange:C,triggerReset:U,native:G=!1,disabled:N=!1,margin:de}=e,le=_t(),[we,Pe]=(0,m.useState)(v||(o?[]:"")),[Me,Ye]=(0,m.useState)(!1);(0,m.useEffect)(()=>{Pe(o?[]:"")},[U,o]),(0,m.useEffect)(()=>{v!==void 0&&Pe(v)},[v]);const Lt=kt=>{Pe(kt.target.value),C(kt.target.value)},Jt=kt=>{if(N){kt.preventDefault();return}Ye(en=>o&&!(kt.target instanceof HTMLElement)?!0:!en)},nn=()=>{Ye(!1)},rn=kt=>()=>{const en=we.filter(Qt=>Qt!==kt);Pe(en),C(en)};return(0,r.jsx)(Re.Z,{className:le.root,children:(0,r.jsx)(oe.Z,{onClickAway:nn,children:(0,r.jsxs)(ye.Z,{className:le.formControl,children:[(0,r.jsx)(Ie.Z,{className:le.formLabel,children:d}),(0,r.jsxs)(be.Z,{"aria-label":d,value:we,native:G,disabled:N,"data-testid":"select",displayEmpty:!0,multiple:o,margin:de,onChange:Lt,onClick:Jt,open:Me,input:(0,r.jsx)(xn,{}),label:d,tabIndex:0,renderValue:kt=>{var en;return o&&we.length!==0?(0,r.jsx)(Re.Z,{className:le.chips,children:kt.map(Qt=>{var Er,Ar;return(0,r.jsx)(ce.Z,{label:(Er=a.find(Tr=>Tr.value===Qt))===null||Er===void 0?void 0:Er.label,clickable:!0,onDelete:rn(Qt),className:le.chip},(Ar=a.find(Tr=>Tr.value===Qt))===null||Ar===void 0?void 0:Ar.value)})}):(0,r.jsx)($.Z,{children:we.length===0?p||"":(en=a.find(Qt=>Qt.value===kt))===null||en===void 0?void 0:en.label})},IconComponent:()=>Me?(0,r.jsx)(un,{}):(0,r.jsx)(mt,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[p&&!o&&(0,r.jsx)(Ze.Z,{value:[],children:p}),G?a&&a.map(kt=>(0,r.jsx)("option",{value:kt.value,children:kt.label},kt.value)):a&&a.map(kt=>(0,r.jsxs)(Ze.Z,{value:kt.value,children:[o&&(0,r.jsx)(te.Z,{color:"primary",checked:we.includes(kt.value)||!1,className:le.checkbox}),kt.label]},kt.value))]})]})})})}const Sn=()=>{},br=m.createContext({stepperLength:0,stepIndex:0,setStepIndex:Sn,stepHistory:[],setStepHistory:Sn,onStepChange:Sn});function Hr(e){const{children:o,elevated:a,onStepChange:d,activeStep:p=0}=e,[v,C]=useState(p),[U,G]=useState([0]);useEffect(()=>{C(p)},[p]);const N=[];let de;return Children.forEach(o,le=>{isValidElement(le)&&(le.props.end?de=le:N.push(le))}),_jsxs(_Fragment,{children:[_jsx(br.Provider,{value:{stepIndex:v,setStepIndex:C,stepHistory:U,setStepHistory:G,onStepChange:d,stepperLength:Children.count(o)},children:_jsx(MuiStepper,{activeStep:v,orientation:"vertical",elevation:a?2:0,children:N})}),v>=Children.count(o)-1&&de]})}const Gr=(0,c.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),Tn=({text:e,handleClick:o})=>_jsx(Button,{onClick:o,children:e||"Reset"}),Zn=({text:e,handleClick:o,disabled:a,last:d,stepIndex:p})=>_jsx(Button,{variant:"contained",color:"primary",disabled:a,"data-testid":`nextButton-${p}`,onClick:o,children:e||(d?"Finish":"Next")}),wr=({text:e,handleClick:o,disabled:a,stepIndex:d})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:a,"data-testid":`skipButton-${d}`,onClick:o,children:e||"Skip"}),Os=({text:e,handleClick:o,disabled:a,stepIndex:d})=>_jsx(Button,{onClick:o,"data-testid":`backButton-${d}`,disabled:a,children:e||"Back"}),Zi=({actions:e={},children:o})=>{const a=Gr(),{stepperLength:d,stepIndex:p,setStepIndex:v,stepHistory:C,setStepHistory:U,onStepChange:G}=useContext(VerticalStepperContext),N=(Pe,Me)=>{Me&&Me(),G&&G(p,Pe),v(Pe)},de=()=>{const Pe=e.nextStep?e.nextStep(p,d-1):p+1;N(Pe,e.onNext),U([...C,Pe])},le=()=>{C.pop(),N(C[C.length-1],e.onBack),U([...C])},we=()=>{N(0,e.onRestart),U([0])};return _jsxs(Box,{className:a.root,children:[[void 0,!0].includes(e.showBack)&&p!==0&&_jsx(Os,{text:e.backText,handleClick:le,disabled:p===0,stepIndex:p}),e.showSkip&&_jsx(wr,{text:e.skipText,handleClick:de,disabled:!!d&&p>=d||!!e.canSkip&&!e.canSkip(),stepIndex:p}),[void 0,!0].includes(e.showNext)&&_jsx(Zn,{text:e.nextText,handleClick:de,disabled:!!d&&p>=d||!!e.canNext&&!e.canNext(),stepIndex:p}),e.showRestart&&p!==0&&_jsx(Tn,{text:e.restartText,handleClick:we,stepIndex:p}),o]})},Zs=(0,c.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function Bi(e){const{title:o,children:a,end:d,actions:p,...v}=e,C=Zs();return d?_jsxs(Box,{className:C.end,children:[_jsx(Typography,{variant:"h6",children:o}),a,_jsx(SimpleStepperFooter,{actions:{...p||{},showNext:!1}})]}):_jsxs(MuiStep,{...v,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:o})}),_jsxs(StepContent,{children:[a,_jsx(SimpleStepperFooter,{actions:p})]})]})}const jr=(0,c.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 Bs(e){const o=jr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function $i(e){const o=jr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function Di(e){const o=jr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.error),"aria-label":"Status error","aria-hidden":"true",...e})}function Ni(e){const o=jr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function $s(e){const o=jr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.running),"aria-label":"Status running","aria-hidden":"true",...e})}function dr(e){const o=jr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var ur=t(74600),_n=t(15584);const No=e=>(0,Ve.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),Ds={root:{border:"0",verticalAlign:"top"}},Ns=e=>(0,Ve.Z)({root:{margin:e.spacing(0,0,-1,0)}}),Fs=e=>(0,Ve.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),Us=(0,Yt.Z)(No,{name:"BackstageMetadataTableTitleCell"})(_n.Z),ls=(0,Yt.Z)(Ds,{name:"BackstageMetadataTableCell"})(_n.Z),Ms=({dense:e,children:o})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:o})}),Fi=({title:e,children:o,...a})=>_jsxs(TableRow,{children:[e&&_jsx(Us,{children:e}),_jsx(ls,{colSpan:e?1:2,...a,children:o})]}),cs=(0,Yt.Z)(Ns,{name:"BackstageMetadataTableList"})(({classes:e,children:o})=>(0,r.jsx)(xt.Z,{disablePadding:!0,className:e.root,children:o})),Ui=(0,Yt.Z)(Fs,{name:"BackstageMetadataTableListItem"})(({classes:e,children:o})=>(0,r.jsx)(lt.Z,{className:e.root,children:o})),ds=(0,Ve.Z)({root:{margin:"0 0",listStyleType:"none"}}),us=e=>(0,Ve.Z)({root:{...ds.root,paddingLeft:e.spacing(1)}}),Fo=(0,Yt.Z)(ds,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:o})=>(0,r.jsx)(cs,{classes:e,children:o})),hs=(0,Yt.Z)(us,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:o})=>(0,r.jsx)(cs,{classes:e,children:o}));function zs(e,o){const a=e.map((d,p)=>_jsx(MetadataListItem,{children:ao(d)},p));return o?_jsx(hs,{children:a}):_jsx(Fo,{children:a})}function io(e,o,a){const d=Object.keys(e).map(p=>{const v=ao(e[p],!0),C=a&&a.titleFormat?a.titleFormat(p):startCase(p);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${C}: `}),v]},p)});return o?_jsx(hs,{children:d}):_jsx(Fo,{children:d})}function ao(e,o,a){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?io(e,o,a):Array.isArray(e)?zs(e,a):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const Ws=({value:e,options:o})=>_jsx(Fragment,{children:ao(e,o)}),Vs=({title:e,value:o,options:a})=>_jsx(MetadataTableItem,{title:a&&a.titleFormat?a.titleFormat(e):startCase(e),children:_jsx(Ws,{value:o,options:a})});function Mi(e,o){return Object.keys(e).map(a=>_jsx(Vs,{title:a,value:e[a],options:o},a))}function Kr(e){const{metadata:o,dense:a=!0,options:d}=e,p=Mi(o,d||{});return _jsx(MetadataTable,{dense:a,children:p})}var Hs=t(49429),Bn=t(86136),Gs=t(79784),zi=t(19126),Ks=t.n(zi);function Ys(e){return qs.stringify(e,{strictNullHandling:!0})}function Js(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function Qs(e,o){return Js(e)[o]}function Uo(e,o,a){const d={...Js(e),[o]:a};return Ys(d)}function Wi(e,o=250){const[a,d]=useSearchParams(),p=a.toString(),[v,C]=useState(Qs(p,e));return useEffect(()=>{const U=Qs(p,e);C(G=>isEqual(U,G)?G:U)},[p,C,e]),useDebouncedEffect(()=>{const U=Uo(p,e,v);p!==U&&d(U,{replace:!0})},[d,v,p,e],o),[v,C]}const lo={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 Yr(){const o=(0,W.I_)().get(W.Ds),a=o==null?void 0:o.getOptionalConfig("app.support");if(!a)return lo;var d;return{url:a.getString("url"),items:a.getConfigArray("items").flatMap(p=>({title:p.getString("title"),icon:p.getOptionalString("icon"),links:((d=p.getOptionalConfigArray("links"))!==null&&d!==void 0?d:[]).flatMap(v=>({url:v.getString("url"),title:v.getString("title")}))}))}}var co=t(80079);function er(e,o){const d=(0,W.qD)().getSystemIcon(e);return d?(0,r.jsx)(d,{...o}):(0,r.jsx)(co.Z,{...o})}function Xs(e){return er("brokenImage",e)}function _s(e){return er("catalog",e)}function Vi(e){return er("chat",e)}function Hi(e){return er("dashboard",e)}function Gi(e){return er("docs",e)}function Ki(e){return er("email",e)}function Yi(e){return er("github",e)}function Oa(e){return er("group",e)}function uo(e){return er("help",e)}function Ji(e){return er("user",e)}function ps(e){return er("warning",e)}const ei=(0,c.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),ti=({icon:e})=>{const o=(0,W.qD)();var a;const d=e&&(a=o.getSystemIcon(e))!==null&&a!==void 0?a:uo;return(0,r.jsx)(d,{})};var ho;const ni=({link:e})=>(0,r.jsx)(_e,{to:e.url,children:(ho=e.title)!==null&&ho!==void 0?ho:e.url}),ri=({item:e})=>{var o;return(0,r.jsxs)(lt.Z,{children:[(0,r.jsx)(Bn.Z,{children:(0,r.jsx)(ti,{icon:e.icon})}),(0,r.jsx)(nt.Z,{primary:e.title,secondary:(o=e.links)===null||o===void 0?void 0:o.reduce((a,d,p)=>[...a,p>0&&(0,r.jsx)("br",{},p),(0,r.jsx)(ni,{link:d},d.url)],[])})]})};function oi(e){const{title:o,items:a,children:d}=e,{items:p}=Yr(),[v,C]=(0,m.useState)(!1),[U,G]=(0,m.useState)(null),N=ei(),de=(0,De.Z)(Pe=>Pe.breakpoints.down("sm")),le=Pe=>{G(Pe.currentTarget),C(!0)},we=()=>{C(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Re.Z,{display:"flex",ml:1,children:de?(0,r.jsx)(Et.Z,{color:"primary",size:"small",onClick:le,"data-testid":"support-button","aria-label":"Support",children:(0,r.jsx)(uo,{})}):(0,r.jsx)(ue.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:le,startIcon:(0,r.jsx)(uo,{}),children:"Support"})}),(0,r.jsxs)(Gs.ZP,{"data-testid":"support-button-popover",open:v,anchorEl:U,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:we,children:[(0,r.jsxs)(xt.Z,{className:N.popoverList,children:[o&&(0,r.jsx)(lt.Z,{alignItems:"flex-start",children:(0,r.jsx)($.Z,{variant:"subtitle1",children:o})}),m.Children.map(d,(Pe,Me)=>(0,r.jsx)(lt.Z,{alignItems:"flex-start",children:Pe},`child-${Me}`)),(a!=null?a:p).map((Pe,Me)=>(0,r.jsx)(ri,{item:Pe},`item-${Me}`))]}),(0,r.jsx)(Hs.Z,{children:(0,r.jsx)(ue.Z,{color:"primary",onClick:we,"aria-label":"Close",children:"Close"})})]})]})}var Mo=t(18671),fs=t(84800);const po=72,gs=24,ms=18,hr={drawerWidthClosed:po,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:po,iconSize:po-gs*2,iconPadding:gs,selectedIndicatorWidth:3,userBadgePadding:ms,userBadgeDiameter:po-ms*2,mobileSidebarHeight:56},vs=e=>({...hr,...e,iconContainerWidth:hr.drawerWidthClosed,iconSize:hr.drawerWidthClosed-hr.iconPadding*2,userBadgeDiameter:hr.drawerWidthClosed-hr.userBadgePadding*2}),fo={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:hr.defaultOpenDelayMs+200},si=e=>({...fo,...e}),Qi="@backstage/core/sidebar-intro-dismissed",or=(0,m.createContext)({sidebarConfig:hr,submenuConfig:fo}),ys=(0,m.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var Xi=t(50023),go=t(4190),qi=t(87685),_i=t(44882),mo=t(51837);const xs={isOpen:!1,setOpen:()=>{}},zo=(0,m.createContext)(xs),ii=(0,mo.CT)("sidebar-open-state-context");function ai(e){const{children:o,value:a}=e;return(0,r.jsx)(zo.Provider,{value:a,children:(0,r.jsx)(ii.Provider,{value:(0,mo.EI)({1:a}),children:o})})}const vo=()=>{const e=(0,m.useContext)(ii),o=(0,m.useContext)(zo);if(e===void 0)return o||xs;const a=e.atVersion(1);if(a===void 0)throw new Error("No context found for version 1.");return a};var bs=t(57998);const Ss={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},Cs=(0,m.createContext)(Ss),Jr=(0,mo.CT)("sidebar-pin-state-context");function ea(e){const{children:o,value:a}=e;return(0,r.jsx)(Cs.Provider,{value:a,children:(0,r.jsx)(Jr.Provider,{value:(0,mo.EI)({1:a}),children:o})})}const Wo=()=>{const e=(0,m.useContext)(Jr),o=(0,m.useContext)(Cs);if(e===void 0)return o||Ss;const a=e.atVersion(1);if(a===void 0)throw new Error("No context found for version 1.");return a},ta=(0,c.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"}})),na=e=>{const{to:o,label:a,icon:d,value:p}=e,{sidebarConfig:v}=(0,m.useContext)(or),C=ta({sidebarConfig:v}),U=(0,q.TH)(),{selectedMenuItemIndex:G,setSelectedMenuItemIndex:N}=(0,m.useContext)(ci),de=(we,Pe)=>{N(Pe===G?-1:Pe)},le=p===G&&G>=0||p!==G&&!(G>=0)&&o===U.pathname;return(0,r.jsx)(bs.Z,{"aria-label":a,label:a,icon:d,component:_e,to:o||U.pathname,onChange:de,value:p,selected:le,classes:C})},ws=e=>{const{children:o,to:a,label:d,icon:p,value:v}=e,{isMobile:C}=Wo();return C?(0,r.jsx)(na,{to:a,label:d,icon:p,value:v}):(0,r.jsx)(r.Fragment,{children:o})},Rn=(0,c.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`})})),ra=e=>(0,re.orderBy)(e,({props:{priority:o}})=>Number.isInteger(o)?o:-1,"desc"),li=m.createElement(ws).type,oa=({children:e,label:o="Menu",open:a,onClose:d})=>{const{sidebarConfig:p}=(0,m.useContext)(or),v=Rn({sidebarConfig:p});return(0,r.jsxs)(go.ZP,{anchor:"bottom",open:a,onClose:d,ModalProps:{BackdropProps:{classes:{root:v.marginMobileSidebar}}},classes:{root:v.marginMobileSidebar,paperAnchorBottom:v.overlay},children:[(0,r.jsxs)(Re.Z,{className:v.overlayHeader,children:[(0,r.jsx)($.Z,{variant:"h3",children:o}),(0,r.jsx)(Et.Z,{onClick:d,classes:{root:v.overlayHeaderClose},children:(0,r.jsx)(qi.Z,{})})]}),(0,r.jsx)(Re.Z,{component:"nav",children:e})]})},ci=(0,m.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),sa=e=>{const{sidebarConfig:o}=(0,m.useContext)(or),{children:a}=e,d=Rn({sidebarConfig:o}),p=(0,q.TH)(),[v,C]=(0,m.useState)(-1);(0,m.useEffect)(()=>{C(-1)},[p.pathname]);let U=(0,W.vJ)(a,N=>N.getElements().filter(de=>de.type===li));if(a)U.length?U=ra(U):U.push((0,r.jsx)(ws,{icon:(0,r.jsx)(_i.Z,{}),children:a},"default_menu"));else return null;const G=v>=0&&!U[v].props.to;return(0,r.jsx)(ai,{value:{isOpen:!0,setOpen:()=>{}},children:(0,r.jsxs)(ci.Provider,{value:{selectedMenuItemIndex:v,setSelectedMenuItemIndex:C},children:[(0,r.jsx)(oa,{label:U[v]&&U[v].props.label,open:G,onClose:()=>C(-1),children:U[v]&&U[v].props.children}),(0,r.jsx)(Xi.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:U})]})})};var Vo;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(Vo||(Vo={}));const di={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(Vo.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(Vo.SIDEBAR_PIN_STATE,JSON.stringify(e))}},ia=(0,c.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:o=>o.isPinned?o.sidebarConfig.drawerWidthOpen:o.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:o=>o.sidebarConfig.mobileSidebarHeight}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),ui=(0,m.createContext)({content:{contentRef:void 0}});function aa(e){const[o,a]=(0,m.useState)(()=>di.getSidebarPinState()),{sidebarConfig:d}=(0,m.useContext)(or),p=(0,m.useRef)(null),v=(0,m.useMemo)(()=>({content:{contentRef:p}}),[p]);(0,m.useEffect)(()=>{di.setSidebarPinState(o)},[o]);const C=(0,De.Z)(N=>N.breakpoints.down("xs"),{noSsr:!0}),U=()=>a(!o),G=ia({isPinned:o,sidebarConfig:d});return(0,r.jsx)(ea,{value:{isPinned:o,toggleSidebarPinState:U,isMobile:C},children:(0,r.jsx)(ui.Provider,{value:v,children:(0,r.jsx)(Re.Z,{className:G.root,children:e.children})})})}function hi(){const{content:e}=(0,m.useContext)(ui);return{focusContent:(0,m.useCallback)(()=>{var a,d;e==null||(a=e.contentRef)===null||a===void 0||(d=a.current)===null||d===void 0||d.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const pi=(0,c.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 la=e=>{const{sidebarConfig:o}=(0,m.useContext)(or),{openDelayMs:a=o.defaultOpenDelayMs,closeDelayMs:d=o.defaultCloseDelayMs,disableExpandOnHover:p,children:v}=e,C=pi({sidebarConfig:o}),U=(0,De.Z)(Jt=>Jt.breakpoints.down("md"),{noSsr:!0}),[G,N]=(0,m.useState)(Kn.Closed),de=(0,m.useRef)(),{isPinned:le,toggleSidebarPinState:we}=Wo(),Pe=()=>{le||p||(de.current&&(clearTimeout(de.current),de.current=void 0),G!==Kn.Open&&!U&&(de.current=window.setTimeout(()=>{de.current=void 0,N(Kn.Open)},a),N(Kn.Idle)))},Me=()=>{le||p||(de.current&&(clearTimeout(de.current),de.current=void 0),G===Kn.Idle?N(Kn.Closed):G===Kn.Open&&(de.current=window.setTimeout(()=>{de.current=void 0,N(Kn.Closed)},d)))},Ye=G===Kn.Open&&!U||le,Lt=Jt=>{Jt?(N(Kn.Open),we()):(N(Kn.Closed),we())};return(0,r.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,r.jsx)(fi,{}),(0,r.jsx)(ai,{value:{isOpen:Ye,setOpen:Lt},children:(0,r.jsx)(Re.Z,{className:C.root,"data-testid":"sidebar-root",onMouseEnter:p?()=>{}:Pe,onFocus:p?()=>{}:Pe,onMouseLeave:p?()=>{}:Me,onBlur:p?()=>{}:Me,children:(0,r.jsx)(Re.Z,{className:O()(C.drawer,C.drawerWidth,{[C.drawerOpen]:Ye}),children:v})})})]})},js=e=>{var o;const a=vs((o=e.sidebarOptions)!==null&&o!==void 0?o:{});var d;const p=si((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:v,disableExpandOnHover:C,openDelayMs:U,closeDelayMs:G}=e,{isMobile:N}=Wo();return N?(0,r.jsx)(sa,{children:v}):(0,r.jsx)(or.Provider,{value:{sidebarConfig:a,submenuConfig:p},children:(0,r.jsx)(la,{openDelayMs:U,closeDelayMs:G,disableExpandOnHover:C,children:v})})};function fi(){const{sidebarConfig:e}=(0,m.useContext)(or),{focusContent:o,contentRef:a}=hi(),d=pi({sidebarConfig:e});return a!=null&&a.current?(0,r.jsx)(ue.Z,{onClick:o,variant:"contained",className:O()(d.visuallyHidden),children:"Skip to content"}):null}function Es(e,o){const a=new URLSearchParams(o.search).toString(),d=Ks().parse(a),p=new URLSearchParams(e.search).toString(),v=Ks().parse(p);return(0,re.isEqual)(o.pathname,e.pathname)&&(0,re.isMatch)(v,d)}const gi=(0,c.Z)(e=>{var o,a;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:((a=e.palette.navigation.navItem)===null||a===void 0?void 0:a.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"}),ca=e=>{const{title:o,subtitle:a,to:d,icon:p,dropdownItems:v}=e,C=gi(),{setIsHoveredOn:U}=useContext(SidebarItemWithSubmenuContext),G=()=>{U(!1)},N=useResolvedPath(d!=null?d:""),de=useLocation();let le=isLocationMatch(de,N);const[we,Pe]=useState(!1),Me=()=>{Pe(!we)};return v!==void 0?(v.some(Ye=>{const Lt=resolvePath(Ye.to);return le=isLocationMatch(de,Lt),le}),_jsxs(Box,{className:C.itemContainer,children:[_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:Me,onTouchStart:Ye=>Ye.stopPropagation(),className:classnames(C.item,le?C.selected:void 0),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:C.label,children:[o,_jsx("br",{}),a&&_jsx(Typography,{variant:"caption",className:C.subtitle,children:a})]}),we?_jsx(ArrowDropUpIcon,{className:C.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:C.dropdownArrow})]})}),v&&we&&_jsx(Box,{className:C.dropdown,children:v.map((Ye,Lt)=>_jsx(Tooltip,{title:Ye.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:Ye.to,underline:"none",className:C.dropdownItem,onClick:G,onTouchStart:Jt=>Jt.stopPropagation(),children:_jsx(Typography,{className:C.textContent,children:Ye.title})})},Lt))})]})):_jsx(Box,{className:C.itemContainer,children:_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames(C.item,le?C.selected:void 0),onClick:G,onTouchStart:Ye=>Ye.stopPropagation(),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:C.label,children:[o,_jsx("br",{}),a&&_jsx(Typography,{variant:"caption",className:C.subtitle,children:a})]})]})})})};var Ho;const mi=(0,c.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:o=>{var a;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:o.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(Ho=(a=e.palette.navigation.submenu)===null||a===void 0?void 0:a.background)!==null&&Ho!==void 0?Ho:"#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"}),vi=e=>{const{isOpen:o}=vo(),{sidebarConfig:a,submenuConfig:d}=(0,m.useContext)(or),p=o?a.drawerWidthOpen:a.drawerWidthClosed,v=mi({left:p,submenuConfig:d}),{isHoveredOn:C}=(0,m.useContext)(ys),[U,G]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{G(C)},[C]),(0,r.jsxs)(Re.Z,{className:O()(v.drawer,{[v.drawerOpen]:U}),children:[(0,r.jsx)($.Z,{variant:"h5",className:v.title,children:e.title}),e.children]})};var yi=t(26739),yo=t(76600),da=t(83543),xi=t(59797),As=t(98989);const ua=(0,c.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),ha=()=>{const e=ua();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 pa=null;const bi=(0,c.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),fa=()=>{const e=bi();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 ga=null,Go,Ko;const sr=e=>(0,c.Z)(o=>{var a,d;return{root:{color:o.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit",textTransform:"none"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[o.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(Go=(a=o.palette.navigation.navItem)===null||a===void 0?void 0:a.hoverBackground)!==null&&Go!==void 0?Go:"#404040"}},highlighted:{background:(Ko=(d=o.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&Ko!==void 0?Ko:"#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 xo(e){return(0,m.useMemo)(()=>sr(e),[e])()}const Si=(e,o)=>(0,W.vJ)(e.props.children,a=>{let d=!1;return a.getElements().forEach(({props:{to:p,dropdownItems:v}})=>{if(!d){if(v!=null&&v.length){v.forEach(({to:C})=>d=d||Es(o,(0,fs.i3)(C)));return}p&&(d=Es(o,(0,fs.i3)(p)))}}),d},[o.pathname]);function Ts(e){return e.to===void 0}const Rs=m.createElement(vi).type,Ci=m.forwardRef(function({to:o,end:a,style:d,className:p,activeStyle:v,caseSensitive:C,activeClassName:U="active","aria-current":G="page",...N},de){let{pathname:le}=(0,q.TH)(),{pathname:we}=(0,q.WU)(o);C||(le=le.toLocaleLowerCase("en-US"),we=we.toLocaleLowerCase("en-US"));let Pe=le===we;!Pe&&!a&&(Pe=le.startsWith(`${we}/`));const Me=Pe?G:void 0;return(0,r.jsx)(ne.rU,{...N,to:o,ref:de,"aria-current":Me,style:{...d,...Pe?v:void 0},className:O()([p,Pe?U:void 0])})}),Is=(0,m.forwardRef)((e,o)=>{const{icon:a,text:d,hasNotifications:p=!1,hasSubmenu:v=!1,disableHighlight:C=!1,onClick:U,children:G,className:N,...de}=e,{sidebarConfig:le}=(0,m.useContext)(or),we=xo(le),{isOpen:Pe}=vo(),Me=!Pe&&v?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},Ye=(0,r.jsxs)(Re.Z,{style:Me,children:[(0,r.jsx)(a,{fontSize:"small"}),!Pe&&v?(0,r.jsx)(As.Z,{fontSize:"small"}):(0,r.jsx)(r.Fragment,{})]}),Lt=(0,r.jsx)(yi.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!p,className:O()({[we.closedItemIcon]:!Pe}),children:Ye}),Jt=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Re.Z,{"data-testid":"login-button",className:we.iconContainer,children:Lt}),d&&(0,r.jsx)($.Z,{variant:"subtitle2",className:we.label,children:d}),(0,r.jsx)("div",{className:we.secondaryAction,children:G})]}),nn=Pe?Jt:Lt,rn={onClick:U,className:O()(N,we.root,Pe?we.open:we.closed,Ts(e)&&we.buttonItem,{[we.highlightable]:!C})};return Ts(e)?(0,r.jsx)(ue.Z,{role:"button","aria-label":d,...rn,ref:o,children:nn}):(0,r.jsx)(Ci,{...rn,activeClassName:we.selected,to:e.to?e.to:"",ref:o,"aria-label":d||e.to,...de,children:nn})}),wi=({children:e,...o})=>{const{sidebarConfig:a}=(0,m.useContext)(or),d=xo(a),[p,v]=(0,m.useState)(!1),C=(0,q.TH)(),U=Si(e,C),G=(0,De.Z)(we=>we.breakpoints.down("sm")),N=()=>{v(!0)},de=()=>{v(!1)},le=()=>G?p?(0,r.jsx)(xi.Z,{fontSize:"small",className:d.submenuArrow}):(0,r.jsx)(da.Z,{fontSize:"small",className:d.submenuArrow}):!p&&(0,r.jsx)(As.Z,{fontSize:"small",className:d.submenuArrow});return(0,r.jsx)(ys.Provider,{value:{isHoveredOn:p,setIsHoveredOn:v},children:(0,r.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:de,onTouchStart:p?de:N,onMouseEnter:N,className:O()(p&&d.highlighted),children:[(0,r.jsx)(Is,{hasSubmenu:!0,className:U?d.selected:"",...o,children:le()}),p&&e]})})},Ps=(0,m.forwardRef)((e,o)=>{const[a]=(0,W.vJ)(e.children,d=>d.getElements().filter(p=>p.type===Rs));return a?(0,r.jsx)(wi,{...e,children:a}):(0,r.jsx)(Is,{...e,ref:o})});function Za(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),[a,d]=useState(""),p=xo(o),v=e.icon?e.icon:SearchIcon,C=()=>{e.onSearch(a),d("")},U=le=>{le.key==="Enter"&&(le.preventDefault(),C())},G=le=>{d(le.target.value)},N=le=>{le.preventDefault(),le.stopPropagation()},de=le=>{C(),le.preventDefault()};return _jsx(Box,{className:p.searchRoot,children:_jsx(Ps,{icon:v,to:e.to,onClick:de,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:a,onClick:N,onChange:G,onKeyDown:U,className:p.searchContainer,InputProps:{disableUnderline:!0,className:p.searchField},inputProps:{className:p.searchFieldHTMLInput}})})})}const ma=(0,yo.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),i=(0,yo.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),n=(0,yo.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),s=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),l=(0,yo.Z)("div")(({theme:e})=>{const o=s(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":o,"&:hover":o}}),f=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),o=xo(e),{isOpen:a,setOpen:d}=useSidebarOpenState();if(useMediaQuery(C=>C.breakpoints.down("md"),{noSsr:!0}))return null;const v=()=>{d(!a)};return _jsx(Button,{role:"button",onClick:v,className:o.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:o.arrows,children:a?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},A=(0,c.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 Z(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),a=A({sidebarConfig:o}),{text:d,onClose:p}=e,v=()=>p();return _jsxs(Box,{className:a.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:d}),_jsx(Box,{className:a.introDismiss,children:_jsxs(IconButton,{onClick:v,className:a.introDismissLink,children:[_jsx(CloseIcon,{className:a.introDismissIcon}),_jsx(Typography,{component:"span",className:a.introDismissText,children:"Dismiss"})]})})]})}const z=e=>{const{text:o,onDismiss:a}=e,[d,p]=useState(!1),v=()=>{p(!0)};return _jsx(Collapse,{in:!d,onExited:a,children:_jsx(Z,{text:o,onClose:v})})},ae=null,Ee="And your recently viewed plugins will pop up here!";function ke(e){const{isOpen:o}=useSidebarOpenState(),a={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:d,set:p}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:v,recentlyViewedItemsDismissed:C}=d!=null?d:{},U=()=>{p(N=>({...a,...N,starredItemsDismissed:!0}))},G=()=>{p(N=>({...a,...N,recentlyViewedItemsDismissed:!0}))};return o?_jsxs(_Fragment,{children:[!v&&_jsxs(_Fragment,{children:[_jsx(z,{text:ae,onDismiss:U}),_jsx(SidebarDivider,{})]}),!C&&_jsx(z,{text:Ee,onDismiss:G})]}):null}const He=(0,c.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 dt(e){const{className:o,stretch:a,noPadding:d,children:p,...v}=e,{contentRef:C}=hi(),U=He();return(0,r.jsx)("article",{ref:C,tabIndex:-1,...v,className:O()(U.root,o,{[U.stretch]:a,[U.noPadding]:d}),children:p})}var bt=t(6487),Ct=t(99152);const Ft=(0,c.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 Nt(e){const{tabs:o,onChange:a,selectedIndex:d}=e,[p,v]=(0,m.useState)(d!=null?d:0),C=Ft(),U=(0,m.useCallback)((G,N)=>{d===void 0&&v(N),a&&d!==N&&a(N)},[d,a]);return(0,m.useEffect)(()=>{d!==void 0&&v(d)},[d]),(0,r.jsx)(Re.Z,{className:C.tabsWrapper,children:(0,r.jsx)(Ct.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:U,value:p,children:o.map((G,N)=>(0,m.createElement)(bt.Z,{...G.tabProps,"data-testid":`header-tab-${N}`,label:G.label,key:G.id,value:N,className:C.defaultTab,classes:{selected:C.selected,root:C.tabRoot}}))})})}function $n(e){const o=(0,q.UO)(),d=e.map(({path:we,children:Pe})=>({caseSensitive:!1,path:`${we}/*`,element:Pe})).sort((we,Pe)=>Pe.path.replace(/\/\*$/,"").localeCompare(we.path.replace(/\/\*$/,"")));var p;const v=(p=(0,q.V$)(d))!==null&&p!==void 0?p:e[0].children;var C;let U=(C=o["*"])!==null&&C!==void 0?C:"";U.startsWith("/")||(U=`/${U}`);var G;const[N]=(G=(0,fs.fp)(d,U))!==null&&G!==void 0?G:[],de=N?e.findIndex(we=>`${we.path}/*`===N.route.path):0;var le;return{index:de===-1?0:de,element:v,route:(le=e[de])!==null&&le!==void 0?le:e[0]}}function tr(e){const{routes:o}=e,a=(0,q.s0)(),{index:d,route:p,element:v}=$n(o),C=(0,m.useMemo)(()=>o.map(G=>({id:G.path,label:G.title,tabProps:G.tabProps})),[o]),U=G=>{let{path:N}=o[G];N=N.replace(/\/\*$/,""),N=N.replace(/^\//,""),a(N)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Nt,{tabs:C,selectedIndex:d,onChange:U}),(0,r.jsxs)(dt,{children:[(0,r.jsx)(Mo.q,{title:p.title}),v]})]})}const nr=()=>null;(0,W.R5)(nr,"core.gatherMountPoints",!0);function Qr(e){const o=(0,r.jsx)(nr,{path:"",title:"",children:(0,r.jsx)("div",{})}).type;return m.Children.toArray(e).flatMap(a=>{if(!(0,m.isValidElement)(a))return[];if(a.type===m.Fragment)return Qr(a.props.children);if(a.type!==o)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:p,children:v,tabProps:C}=a.props;return[{path:d,title:p,children:v,tabProps:C}]})}function ji(e){const o=Qr(e.children);return(0,r.jsx)(tr,{routes:o})}ji.Route=nr;const Ei=(0,c.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function Yo(e){const{value:o,subvalue:a}=e,d=Ei();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Re.Z,{className:d.value,children:o}),(0,r.jsx)(Re.Z,{className:d.subvalue,children:a})]})}var bo=t(67222),Br=t(21070),Ba=t(90324),$a=t(98281),Da=t(48049),va=t(51209),ya=t(33375),Na=t(44233),Fa=t(27604),Ai=t(36444),Ua=t(37971),Ma=t(59709),za=t(17373),Wa=t(3702),Va=t(93111);const Ha=(0,c.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"}),Ga=e=>{var o;const a=Ha(),{onChangeFilters:d}=e,[p,v]=(0,m.useState)({...e.selectedFilters}),[C,U]=(0,m.useState)(!1),G=()=>{v({}),U(N=>!N)};return(0,m.useEffect)(()=>{d(p)},[p,d]),(0,r.jsxs)(Re.Z,{className:a.root,children:[(0,r.jsxs)(Re.Z,{className:a.header,children:[(0,r.jsx)(Re.Z,{className:a.value,children:"Filters"}),(0,r.jsx)(ue.Z,{color:"primary",onClick:G,children:"Clear all"})]}),(0,r.jsx)(Re.Z,{className:a.filters,children:((o=e.filters)===null||o===void 0?void 0:o.length)&&e.filters.map(N=>(0,r.jsx)(bn,{triggerReset:C,...N.element,selected:p[N.element.label],onChange:de=>v({...p,[N.element.label]:de})},N.element.label))})]})},xa={Add:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Br.Z,{...e,ref:o})),Check:(0,m.forwardRef)((e,o)=>(0,r.jsx)($a.Z,{...e,ref:o})),Clear:(0,m.forwardRef)((e,o)=>(0,r.jsx)(ya.Z,{...e,ref:o})),Delete:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Na.Z,{...e,ref:o})),DetailPanel:(0,m.forwardRef)((e,o)=>(0,r.jsx)(va.Z,{...e,ref:o})),Edit:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Fa.Z,{...e,ref:o})),Export:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Wa.Z,{...e,ref:o})),Filter:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Ai.Z,{...e,ref:o})),FirstPage:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Ua.Z,{...e,ref:o})),LastPage:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Ma.Z,{...e,ref:o})),NextPage:(0,m.forwardRef)((e,o)=>(0,r.jsx)(va.Z,{...e,ref:o})),PreviousPage:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Da.Z,{...e,ref:o})),ResetSearch:(0,m.forwardRef)((e,o)=>(0,r.jsx)(ya.Z,{...e,ref:o})),Search:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Ai.Z,{...e,ref:o})),SortArrow:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Ba.Z,{...e,ref:o})),ThirdStateCheck:(0,m.forwardRef)((e,o)=>(0,r.jsx)(za.Z,{...e,ref:o})),ViewColumn:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Va.Z,{...e,ref:o}))};function ba(e,o){const a=o.split(".");let d=e[a[0]];for(let p=1;p<a.length;++p){if(d===void 0)return d;const v=a[p];d=d[v]}return d}const Ka=(0,Yt.Z)(e=>({header:{padding:e.spacing(1,2,1,2.5),borderTop:`1px solid ${e.palette.grey.A100}`,borderBottom:`1px solid ${e.palette.grey.A100}`,color:e.palette.textSubtle,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(bo.W$),Sa=(0,Yt.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"})(bo.UW),Ya=(0,c.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Ja=(0,c.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Qa(e,o){return e.map(a=>{var d;const p=(d=a.headerStyle)!==null&&d!==void 0?d:{};let v=a.cellStyle||{};if(a.highlight)if(p.color=o.palette.textContrast,typeof v=="object")v.fontWeight=o.typography.fontWeightBold;else{const C=v;v=(U,G,N)=>({...C(U,G,N),fontWeight:o.typography.fontWeightBold})}return{...a,headerStyle:p,cellStyle:v}})}function Xa(e,o){return(0,re.transform)(e,(a,d,p)=>{(0,re.isEqual)(d,o[p])||(a[p]=d)})}const Ca={search:"",filtersOpen:!1,filters:{}};function qa(e){const{toolbarRef:o,setSearch:a,hasFilters:d,selectedFiltersLength:p,toggleFilters:v}=e,C=Ya(),U=(0,m.useCallback)(G=>{e.onSearchChanged(G),a(G)},[e,a]);return d?(0,r.jsxs)(Re.Z,{className:C.root,children:[(0,r.jsxs)(Re.Z,{className:C.root,children:[(0,r.jsx)(Et.Z,{onClick:v,"aria-label":"filter list",children:(0,r.jsx)(Ai.Z,{})}),(0,r.jsxs)($.Z,{className:C.title,children:["Filters (",p,")"]})]}),(0,r.jsx)(Sa,{...e,ref:o,onSearchChanged:U})]}):(0,r.jsx)(Sa,{...e,ref:o,onSearchChanged:U})}function wa(e){const{data:o,columns:a,options:d,title:p,subtitle:v,filters:C,initialState:U,emptyContent:G,onStateChange:N,components:de,...le}=e,we=Ja(),Pe=(0,ct.Z)(),Me={...Ca,...U},[Ye,Lt]=(0,m.useState)(Me.filtersOpen),Jt=(0,m.useCallback)(()=>Lt(Dn=>!Dn),[Lt]),[nn,rn]=(0,m.useState)(0),[kt,en]=(0,m.useState)(o),[Qt,Er]=(0,m.useState)(Me.filters),Ar=Qa(a,Pe),[Tr,Rr]=(0,m.useState)(Me.search);(0,m.useEffect)(()=>{if(N){const Dn=Xa({search:Tr,filtersOpen:Ye,filters:Qt},Ca);N(Dn)}},[Tr,Ye,Qt,N]);const Li={headerStyle:{textTransform:"uppercase"}},$r=(0,m.useCallback)(Dn=>{var Sr;return(Sr=a.find(Xr=>Xr.title===Dn))===null||Sr===void 0?void 0:Sr.field},[a]);(0,m.useEffect)(()=>{if(typeof o=="function")return;if(!Qt){en(o);return}const Dn=Object.values(Qt);if(o&&Dn.flat().length){const Sr=o.filter(Xr=>!!Object.entries(Qt).filter(([,qr])=>!!qr.length).every(([qr,hn])=>{const Cn=ba(Xr,$r(qr));return Array.isArray(Cn)&&Array.isArray(hn)?Cn.some(wo=>hn.includes(wo)):Array.isArray(Cn)?Cn.includes(hn):Array.isArray(hn)?hn.includes(Cn):Cn===hn}));en(Sr)}else en(o);rn(Dn.flat().length)},[o,Qt,$r]);const ki=(Dn,Sr)=>{const Xr=hn=>{const Cn=new Set,wo=_r=>{_r!=null&&Cn.add(_r)};return Sr&&Sr.forEach(_r=>{const Xo=ba(_r,$r(hn));Array.isArray(Xo)?Xo.forEach(wo):wo(Xo)}),Cn},qr=hn=>({placeholder:"All results",label:hn.column,multiple:hn.type==="multiple-select",items:[...Xr(hn.column)].sort().map(Cn=>({label:Cn,value:Cn}))});return Dn.map(hn=>({type:hn.type,element:qr(hn)}))},Xt=!!(C!=null&&C.length),Co=(0,m.useCallback)(Dn=>(0,r.jsx)(qa,{setSearch:Rr,hasFilters:Xt,selectedFiltersLength:nn,toggleFilters:Jt,...Dn}),[Jt,Xt,nn,Rr]),Ls=typeof o!="function"&&o.length===0,Dr=a.length,Oi=(0,m.useCallback)(Dn=>G&&Ls?(0,r.jsx)("tbody",{children:(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:Dr,children:G})})}):(0,r.jsx)(bo.os,{...Dn}),[Ls,G,Dr]);return(0,r.jsxs)(Re.Z,{className:we.root,children:[Ye&&o&&typeof o!="function"&&(C==null?void 0:C.length)&&(0,r.jsx)(Ga,{filters:ki(C,o),selectedFilters:Qt,onChangeFilters:Er}),(0,r.jsx)(bo.ZP,{components:{Header:Ka,Toolbar:Co,Body:Oi,...de},options:{...Li,...d},columns:Ar,icons:xa,title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)($.Z,{variant:"h5",component:"h2",children:p}),v&&(0,r.jsx)($.Z,{color:"textSecondary",variant:"body1",children:v})]}),data:typeof o=="function"?o:kt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...le})]})}wa.icons=Object.freeze(xa);const ql=e=>{const{children:o,value:a,index:d,...p}=e;return _jsx(Box,{role:"tabpanel",hidden:a!==d,"aria-labelledby":`scrollable-auto-tab-${d}`,...p,children:a===d&&_jsx(Box,{p:3,children:o})})},_a=(0,c.Z)(e=>({root:{color:"#6E6E6E",overflow:"visible",fontSize:e.typography.h5.fontSize,textAlign:"center",borderRadius:"50%",backgroundColor:"#E6E6E6",marginLeft:o=>o.isNext?"auto":"0",marginRight:o=>o.isNext?"0":e.spacing(1.25),"&:hover":{backgroundColor:"#E6E6E6",opacity:"1"}}}),{name:"BackstageTabIcon"}),_l=e=>{const o=_a(e),{ariaLabel:a,onClick:d}=e;return _jsx(IconButton,{onClick:d,className:o.root,size:"small",disableRipple:!0,disableFocusRipple:!0,"aria-label":a,children:e.children})},el=(e,o)=>o?e?"20px":"0":"40px",tl=(0,c.Z)(e=>({root:{textTransform:"none",height:"64px",fontWeight:e.typography.fontWeightBold,fontSize:e.typography.pxToRem(13),color:e.palette.textSubtle,marginLeft:o=>el(o.isFirstNav,o.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:e.palette.textSubtle}}}),{name:"BackstageTab"}),ec=e=>{const o=tl(e),{isFirstNav:a,isFirstIndex:d,...p}=e;return _jsx(Tab,{classes:o,disableRipple:!0,...p})},nl=(0,c.Z)(e=>({indicator:{display:"flex",justifyContent:"center",backgroundColor:e.palette.tabbar.indicator,height:e.spacing(.5)},flexContainer:{alignItems:"center"},root:{"&:last-child":{marginLeft:"auto"}}}),{name:"BackstageTabBar"}),tc=e=>{const o=nl(e);return _jsx(Tabs,{classes:o,...e,TabIndicatorProps:{children:_jsx(Typography,{component:"span"})}})},rl=(0,c.Z)(e=>({root:{flexGrow:1,width:"100%"},styledTabs:{backgroundColor:e.palette.background.paper},appbar:{boxShadow:"none",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(1.25),paddingRight:e.spacing(1.25)}}),{name:"BackstageTabs"});function nc(e){const{tabs:o}=e,a=rl(),[d,p]=useState([0,0]),[v,C]=useState(0),[U,G]=useState(0),[N,de]=useState([[]]),le=useRef(),{width:we}=useWindowSize(),Pe=(nn,rn)=>{p([v,rn])},Me=()=>{C(v-1)},Ye=()=>{C(v+1)},Lt=()=>v+1<N.length;useEffect(()=>{const rn=v===0?1:2,kt=le.current.offsetWidth-20-rn*30,en=d[0]*U+d[1],Qt=Math.floor(kt/170);G(Qt),de(chunkArray(o,Qt)),p([Math.floor(en/Qt),en%Qt])},[we,o]);const Jt=v===d[0]?d[1]:!1;return _jsxs(Box,{className:a.root,children:[_jsx(AppBar,{ref:le,className:a.appbar,position:"static",children:_jsx(Box,{children:_jsxs(StyledTabs,{value:Jt,onChange:Pe,selectionFollowsFocus:!0,children:[v!==0&&_jsx(StyledIcon,{onClick:Me,ariaLabel:"navigate-before",children:_jsx(NavigateBeforeIcon,{})}),N[v].map((nn,rn)=>_jsx(StyledTab,{value:rn,isFirstIndex:rn===0,isFirstNav:v===0,icon:nn.icon||void 0,label:nn.label||void 0},rn)),Lt()&&_jsx(StyledIcon,{isNext:!0,onClick:Ye,ariaLabel:"navigate-next",children:_jsx(NavigateNextIcon,{})})]})})}),Jt!==!1?N[v].map((nn,rn)=>_jsx(TabPanel,{value:rn,index:Jt,children:nn.content},rn)):_jsx(TabPanel,{value:d[1],index:d[1],children:N[d[0]][d[1]].content},"panel_outside_chunked_array")]})}var rc=t(44311);function ol(e,o){const a=e[e.length-1];if(a)return a>=.9?o.palette.status.ok:a>=.5?o.palette.status.warning:o.palette.status.error}function oc(e){const o=useTheme();if(!e.data)return null;var a;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(a=e.color)!==null&&a!==void 0?a:ol(e.data,o)})]})}const sl=e=>(0,c.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"}),il=({title:e="Unknown page",className:o})=>(0,r.jsx)($.Z,{variant:"h4",component:"h2",className:o,"data-testid":"header-title",children:e});function al(e){const{description:o,title:a,titleComponent:d=void 0,children:p,textAlign:v="left"}=e,C=sl({textAlign:v})(),U=d||(0,r.jsx)(il,{title:a,className:C.title});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Mo.q,{title:a}),(0,r.jsxs)(Re.Z,{className:C.container,children:[(0,r.jsxs)(Re.Z,{className:C.leftItemsBox,children:[U,o&&(0,r.jsx)($.Z,{className:C.description,variant:"body2",children:o})]}),(0,r.jsx)(Re.Z,{className:C.rightItemsBox,children:p})]})]})}var ll=t.p+"static/mic-drop.fe3ef4d0..svg";const cl=(0,c.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"}),dl=()=>{const e=cl();return(0,r.jsx)("img",{src:ll,className:e.micDrop,alt:"Girl dropping mic from her hands"})},ul=(0,c.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 hl(e){const{status:o,statusMessage:a,additionalInfo:d,supportUrl:p}=e,v=ul(),C=(0,q.s0)(),U=Yr();return(0,r.jsxs)(je.Z,{container:!0,spacing:0,className:v.container,children:[(0,r.jsxs)(je.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,r.jsxs)($.Z,{"data-testid":"error",variant:"body1",className:v.subtitle,children:["ERROR ",o,": ",a]}),(0,r.jsx)($.Z,{variant:"body1",className:v.subtitle,children:d}),(0,r.jsx)($.Z,{variant:"h2",className:v.title,children:"Looks like someone dropped the mic!"}),(0,r.jsxs)($.Z,{variant:"h6",children:[(0,r.jsx)(_e,{to:"#","data-testid":"go-back-link",onClick:()=>C(-1),children:"Go back"}),"... or please"," ",(0,r.jsx)(_e,{to:p||U.url,children:"contact support"})," if you think this is a bug."]})]}),(0,r.jsx)(dl,{})]})}var pl=t(16173);const fl=(0,Yt.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})($.Z),Ti=(0,Yt.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(Re.Z);function gl(e){const{children:o,...a}=e,[d,p]=m.useState(null),v=m.Children.toArray(o),[C,U,...G]=v,N=G.length?G.pop():v[v.length-1],de=v.length>3,le=Me=>{p(Me.currentTarget)},we=()=>{p(null)},Pe=Boolean(d);return(0,r.jsxs)(m.Fragment,{children:[(0,r.jsxs)(pl.Z,{"aria-label":"breadcrumb",...a,children:[v.length>1&&(0,r.jsx)(Ti,{clone:!0,children:C}),v.length>2&&(0,r.jsx)(Ti,{clone:!0,children:U}),de&&(0,r.jsx)(fl,{onClick:le,children:"..."}),(0,r.jsx)(Re.Z,{style:{fontStyle:"italic"},children:N})]}),(0,r.jsx)(Gs.ZP,{open:Pe,anchorEl:d,onClose:we,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,r.jsx)(xt.Z,{children:G.map((Me,Ye)=>(0,r.jsx)(lt.Z,{button:!0,children:(0,r.jsx)(Ti,{clone:!0,children:Me})},Ye))})})]})}const ml=(0,c.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"}),vl=({type:e,typeLink:o,classes:a,pageTitle:d})=>e?o?(0,r.jsxs)(gl,{className:a.breadcrumb,children:[(0,r.jsx)(_e,{to:o,children:e}),(0,r.jsx)($.Z,{children:d})]}):(0,r.jsx)($.Z,{className:a.type,children:e}):null,yl=({pageTitle:e,classes:o,tooltip:a})=>{const d=(0,r.jsx)($.Z,{className:o.title,variant:"h1",children:e});return a?(0,r.jsx)(Dt.ZP,{title:a,placement:"top-start",children:d}):d},xl=({classes:e,subtitle:o})=>o?typeof o!="string"?(0,r.jsx)(r.Fragment,{children:o}):(0,r.jsx)($.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:o}):null;function ja(e){const{children:o,pageTitleOverride:a,style:d,subtitle:p,title:v,tooltip:C,type:U,typeLink:G}=e,N=ml(),le=(0,W.h_)(W.Ds).getOptionalString("app.title")||"Backstage",we=a||v,Pe=v||a,Me=`${we} | %s | ${le}`,Ye=`${we} | ${le}`;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Mo.q,{titleTemplate:Me,defaultTitle:Ye}),(0,r.jsxs)("header",{style:d,className:N.header,children:[(0,r.jsxs)(Re.Z,{className:N.leftItemsBox,children:[(0,r.jsx)(vl,{classes:N,type:U,typeLink:G,pageTitle:Pe}),(0,r.jsx)(yl,{classes:N,pageTitle:Pe,tooltip:C}),(0,r.jsx)(xl,{classes:N,subtitle:p})]}),(0,r.jsx)(je.Z,{container:!0,className:N.rightItemsBox,spacing:4,children:o})]})]})}const bl=({label:e,secondaryLabel:o,icon:a,disabled:d=!1,onClick:p})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:d,button:!0,onClick:v=>{p&&p(v)},children:[a&&_jsx(ListItemIcon,{children:a}),_jsx(ListItemText,{primary:e,secondary:o})]})});function sc(e){const{palette:{common:{white:o}}}=useTheme(),{actionItems:a}=e,[d,p]=React.useState(!1),v=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>p(!0),"data-testid":"header-action-menu",ref:v,style:{color:o,height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:d,anchorEl:v.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>p(!1),children:_jsx(List,{children:a.map((C,U)=>_jsx(bl,{...C},`header-action-menu-${U}`))})})]})}const Sl=(0,c.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,Oe.Fq)(e.page.fontColor,.8),fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),Cl=({value:e,className:o})=>(0,r.jsx)($.Z,{component:typeof e=="string"?"p":"span",className:o,children:e});function wl(e){const{label:o,value:a,url:d}=e,p=Sl(),v=(0,r.jsx)(Cl,{className:p.value,value:a||"<Unknown>"});return(0,r.jsx)(je.Z,{item:!0,children:(0,r.jsxs)($.Z,{component:"span",className:p.root,children:[(0,r.jsx)($.Z,{className:p.label,children:o}),d?(0,r.jsx)(_e,{to:d,children:v}):v]})})}const jl=e=>(0,Ve.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),El=(0,c.Z)(jl,{name:"BackstageItemCardHeader"});function Al(e){const{title:o,subtitle:a,children:d}=e,p=El(e);return(0,r.jsxs)(Re.Z,{className:p.root,children:[a&&(0,r.jsx)($.Z,{variant:"subtitle2",component:"h3",children:a}),o&&(0,r.jsx)($.Z,{variant:"h6",component:"h4",children:o}),d]})}function ic(e){const{description:o,tags:a,title:d,type:p,subtitle:v,label:C,onClick:U,href:G}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:d,subtitle:v||p})}),_jsxs(CardContent,{children:[a!=null&&a.length?_jsx(Box,{children:a.map((N,de)=>_jsx(Chip,{size:"small",label:N},de))}):null,o]}),_jsxs(CardActions,{children:[!G&&_jsx(LinkButton,{to:"#",onClick:U,color:"primary",children:C}),G&&_jsx(LinkButton,{to:G,color:"primary",children:C})]})]})}const Tl=e=>(0,Ve.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),Rl=(0,c.Z)(Tl,{name:"BackstageItemCardGrid"});function Il(e){const{children:o,...a}=e,d=Rl(a);return(0,r.jsx)(Re.Z,{className:d.root,...a,children:o})}var Pl=t(41547);const Ll=(0,c.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 Ea(e){const{themeId:o,children:a}=e,d=Ll();return(0,r.jsx)(Pl.Z,{theme:p=>({...p,page:p.getPageTheme({themeId:o})}),children:(0,r.jsx)("main",{className:d.root,children:a})})}function kl(e){const{themeId:o,children:a,...d}=e;return(0,r.jsxs)(Ea,{themeId:o,children:[(0,r.jsx)(ja,{...d}),a]})}var Yn=t(30195);const ac=Yn.z.object({providerInfo:Yn.z.object({}).catchall(Yn.z.unknown()).optional(),profile:Yn.z.object({email:Yn.z.string().optional(),displayName:Yn.z.string().optional(),picture:Yn.z.string().optional()}),backstageIdentity:Yn.z.object({token:Yn.z.string(),identity:Yn.z.object({type:Yn.z.literal("user"),userEntityRef:Yn.z.string(),ownershipEntityRefs:Yn.z.array(Yn.z.string())})})}),Aa={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function Ol(e){const o=new Date(Date.now()+Aa.defaultTokenExpiryMillis);if(!e)return o;const[a,d,p]=e.split("."),v=JSON.parse(window.atob(d));return typeof v.exp!="number"?o:new Date(v.exp*1e3-Aa.tokenExpiryMarginMillis)}class lc{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:o}=this.getSessionSync(),a=o.identity.userEntityRef,d=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(a);if(!d)throw new TypeError(`Invalid user entity reference "${a}"`);return d[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const o=this.state.type==="active"?this.state.session:void 0,a=this.fetchSession().then(d=>(this.state={type:"active",session:d,expiresAt:Ol(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:a,previous:o},a}async fetchSession(){const o=await this.options.discoveryApi.getBaseUrl("auth"),a=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,d=new Headers(a);d.set("X-Requested-With","XMLHttpRequest");const p=await fetch(`${o}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:d,credentials:"include"});if(!p.ok)throw await ResponseError.fromResponse(p);return proxiedSessionSchema.parse(await p.json())}constructor(o){_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 cc=e=>{const o=useApi(discoveryApiRef),[{status:a,error:d},{execute:p}]=useAsync(async()=>{const v=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:o,headers:e.headers});await v.start(),e.onSignInSuccess(v)});return useMountEffect(p),a==="loading"?_jsx(Progress,{}):d?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},Zl=(0,c.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),Ri=({children:e})=>{const o=Zl();return(0,r.jsx)(je.Z,{component:"li",item:!0,classes:o,children:e})};var Jo=t(47842);class Ii{getUserId(){return"guest"}async getIdToken(){}getProfile(){return{email:"guest@example.com",displayName:"Guest"}}async getProfileInfo(){return{email:"guest@example.com",displayName:"Guest"}}async getBackstageIdentity(){const o="user:default/guest";return{type:"user",userEntityRef:o,ownershipEntityRefs:[o]}}async getCredentials(){return{}}async signOut(){}}function Bl(e){const[o,a,d]=e.split(".");return JSON.parse(window.atob(a))}class Pi{getUserId(){return this.result.userId}static fromResult(o){return new Pi(o)}async getIdToken(){var o,a;return(a=(o=this.result).getIdToken)===null||a===void 0?void 0:a.call(o)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const o=await this.getIdToken();if(!o){const p=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:p,ownershipEntityRefs:[p]}}const{sub:a,ent:d}=Bl(o);return{type:"user",userEntityRef:a,ownershipEntityRefs:d!=null?d:[]}}async getCredentials(){var o,a;return{token:await((a=(o=this.result).getIdToken)===null||a===void 0?void 0:a.call(o))}}async signOut(){var o,a;return(a=(o=this.result).signOut)===null||a===void 0?void 0:a.call(o)}constructor(o){(0,Jo.Z)(this,"result",void 0),this.result=o}}class Qo{static createGuest(){return new Ii}static fromLegacy(o){return Pi.fromResult(o)}static create(o){return new Qo(o.identity,o.authApi,o.profile)}getUserId(){const o=this.identity.userEntityRef,a=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(o);if(!a)throw new TypeError(`Invalid user entity reference "${o}"`);return a[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(o){throw this.profilePromise=void 0,o}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(o,a,d){(0,Jo.Z)(this,"identity",void 0),(0,Jo.Z)(this,"authApi",void 0),(0,Jo.Z)(this,"profile",void 0),(0,Jo.Z)(this,"profilePromise",void 0),this.identity=o,this.authApi=a,this.profile=d}}const $l={Component:({config:e,onSignInStarted:o,onSignInSuccess:a,onSignInFailure:d})=>{const{apiRef:p,title:v,message:C}=e,U=(0,W.h_)(p),G=(0,W.h_)(W.VE),N=async()=>{try{o();const de=await U.getBackstageIdentity({instantPopup:!0});if(!de)throw d(),new Error(`The ${v} provider is not configured to support sign-in`);const le=await U.getProfile();a(Qo.create({identity:de.identity,profile:le,authApi:U}))}catch(de){d(),G.post(new Ro.SP("Login failed",de))}};return(0,r.jsx)(Ri,{children:(0,r.jsx)(Zr,{variant:"fullHeight",title:v,actions:(0,r.jsx)(ue.Z,{color:"primary",variant:"outlined",onClick:N,children:"Sign In"}),children:(0,r.jsx)($.Z,{variant:"body1",children:C})})})},loader:async(e,o)=>{const a=e.get(o),d=await a.getBackstageIdentity({optional:!0});if(!d)return;const p=await a.getProfile();return Qo.create({identity:d.identity,profile:p,authApi:a})}},Dl={Component:({onSignInStarted:e,onSignInSuccess:o})=>(0,r.jsx)(Ri,{children:(0,r.jsx)(Zr,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(ue.Z,{color:"primary",variant:"outlined",onClick:()=>{e(),o(new Ii)},children:"Enter"}),children:(0,r.jsxs)($.Z,{variant:"body1",children:["Enter as a Guest User.",(0,r.jsx)("br",{}),"You will not have a verified identity,",(0,r.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new Ii};var Nl=t(63955),Ta=t(86619),Ra=t(74828),Fl=t(45455),Ul=t.n(Fl);const Ml=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,zl=(0,c.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Ia=e=>{const{ref:o,...a}=e;return{inputRef:o,...a}},Wl={Component:({onSignInStarted:e,onSignInSuccess:o})=>{const a=zl(),{register:d,handleSubmit:p,formState:v}=(0,Nl.cI)({mode:"onChange"}),{errors:C}=v,U=({userId:G,idToken:N})=>{e(),o(Qo.fromLegacy({userId:G,getIdToken:N!==void 0?async()=>N:void 0,profile:{email:`${G}@example.com`}}))};return(0,r.jsx)(Ri,{children:(0,r.jsxs)(Zr,{title:"Custom User",variant:"fullHeight",children:[(0,r.jsxs)($.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,r.jsx)("br",{}),"This selection will not be stored."]}),(0,r.jsxs)("form",{className:a.form,onSubmit:p(U),children:[(0,r.jsxs)(ye.Z,{children:[(0,r.jsx)(Ta.Z,{...Ia(d("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(C.userId)}),C.userId&&(0,r.jsx)(Ra.Z,{error:!0,children:C.userId.message})]}),(0,r.jsxs)(ye.Z,{children:[(0,r.jsx)(Ta.Z,{...Ia(d("idToken",{required:!1,validate:G=>!G||Ml.test(G)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(C.idToken)}),C.idToken&&(0,r.jsx)(Ra.Z,{error:!0,children:C.idToken.message})]}),(0,r.jsx)(ue.Z,{type:"submit",color:"primary",variant:"outlined",className:a.button,disabled:!(v!=null&&v.isDirty)||!Ul()(C),children:"Continue"})]})]})})},loader:async()=>{}},So="@backstage/core:SignInPage:provider",Pa={guest:Dl,custom:Wl,common:$l};function La(e,o){if(e in o)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function mc(e){return e.reduce((a,d)=>{if(typeof d=="string")return La(d,a),a[d]={components:Pa[d],id:d},a;const{id:p}=d;return La(p,a),a[p]={components:Pa.common,id:p,config:d},a},{})}const vc=(e,o)=>{const a=useApi(errorApiRef),d=useApiHolder(),[p,v]=useState(!0),C=useCallback(G=>{o(IdentityApiSignOutProxy.from({identityApi:G,signOut:async()=>{var N;localStorage.removeItem(So),await((N=G.signOut)===null||N===void 0?void 0:N.call(G))}}))},[o]);useLayoutEffect(()=>{var G;if(!p)return;const N=localStorage.getItem(So);if(N===null){v(!1);return}const de=e[N];if(!de){v(!1);return}let le=!1;return de.components.loader(d,(G=de.config)===null||G===void 0?void 0:G.apiRef).then(we=>{if(le){localStorage.removeItem(So);return}we?C(we):v(!1)}).catch(we=>{localStorage.removeItem(So),!le&&(a.post(we),v(!1))}),()=>{le=!0}},[p,a,o,d,e,C]);const U=useMemo(()=>Object.keys(e).map(G=>{const N=e[G],{Component:de}=N.components,le=Me=>{C(Me)},we=()=>{var Me;localStorage.setItem(So,(N==null||(Me=N.config)===null||Me===void 0?void 0:Me.id)||N.id)},Pe=()=>{localStorage.removeItem(So)};return _jsx(de,{config:N.config,onSignInStarted:we,onSignInSuccess:le,onSignInFailure:Pe},N.id)}),[e,C]);return[p,U]},Vl=({onSignInSuccess:e,providers:o=[],title:a,align:d="left"})=>{const p=useApi(configApiRef),v=useStyles(),C=getSignInProviders(o),[U,G]=useSignInProviders(C,e);return U?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:p.getString("app.title")}),_jsxs(Content,{children:[a&&_jsx(ContentHeader,{title:a,textAlign:d}),_jsx(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:v,children:G})]})]})},Hl=({provider:e,auto:o,onSignInSuccess:a})=>{const d=useStyles(),p=useApi(e.apiRef),v=useApi(configApiRef),[C,U]=useState(),[G,N]=useState(!1),de=async({checkExisting:le,showPopup:we})=>{try{let Pe;if(le&&(Pe=await p.getBackstageIdentity({optional:!0})),!Pe&&(we||o)&&(N(!0),Pe=await p.getBackstageIdentity({instantPopup:!0}),!Pe))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Pe){N(!0);return}const Me=await p.getProfile();a(UserIdentity.create({identity:Pe.identity,authApi:p,profile:Me}))}catch(Pe){U(Pe),N(!0)}};return useMountEffect(()=>de({checkExisting:!0})),G?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:v.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:d,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{de({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),C&&C.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:C.message})]})})})})]}):_jsx(Progress,{})};function yc(e){return"provider"in e?_jsx(Hl,{...e}):_jsx(Vl,{...e})}const Gl=(0,c.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"}),Kl=(0,Yt.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(Or.Z);function xc(e){const{slackChannel:o,errorBoundaryProps:a,children:d,title:p,deepLink:v,value:C,onChange:U}=e,G=Gl(),[N,de]=useState(0),le=U||((Me,Ye)=>de(Ye));let we;C?React.Children.map(d,Me=>{if(React.isValidElement(Me)&&(Me==null?void 0:Me.props.value)===C){var Ye;we=Me==null||(Ye=Me.props)===null||Ye===void 0?void 0:Ye.children}}):React.Children.map(d,(Me,Ye)=>{React.isValidElement(Me)&&Ye===N&&(we=Me==null?void 0:Me.props.children)});const Pe=a||(o?{slackChannel:o}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Pe,children:[p&&_jsx(Kl,{title:p}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:G,value:C||N,onChange:le,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:we}),v&&_jsx(BottomLink,{...v})]})})}const Yl=(0,c.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 bc(e){const{children:o,...a}=e,d=Yl();return _jsx(Tab,{disableRipple:!0,classes:d,...a})}},60871:function(St,$e,t){"use strict";t.d($e,{fC:function(){return y},CL:function(){return Re},sM:function(){return re},$v:function(){return qe},v_:function(){return H},hg:function(){return _e},uB:function(){return We},R5:function(){return Je},bq:function(){return V},Km:function(){return Se},Ds:function(){return ut},ni:function(){return O},T0:function(){return R},CO:function(){return Wn},x8:function(){return jn},rx:function(){return Vn},YO:function(){return En},P4:function(){return Ln},NT:function(){return Gt},NW:function(){return ze},VE:function(){return ft},W0:function(){return ct},gP:function(){return jt},IY:function(){return At},F4:function(){return ne},ux:function(){return T},Kp:function(){return q},$4:function(){return vt},p_:function(){return k},ZM:function(){return gt},D:function(){return D},gW:function(){return L},E6:function(){return Et},z$:function(){return Wt},h_:function(){return Te},I_:function(){return B},qD:function(){return xe},vJ:function(){return kn},tg:function(){return Pn},Oi:function(){return Jn}});var u=t(52322),r=t(51837),W=t(2784);const P=(0,r.CT)("analytics-context"),m=()=>{const ge=(0,W.useContext)(P);if(ge===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const ie=ge.atVersion(1);if(ie===void 0)throw new Error("No context found for version 1.");return ie},y=ge=>{const{attributes:ie,children:Le}=ge,Ke={...m(),...ie},_=(0,r.EI)({1:Ke});return(0,u.jsx)(P.Provider,{value:_,children:Le})};function c(ge,ie){const Le=Fe=>_jsx(y,{attributes:ie,children:_jsx(ge,{...Fe})});return Le.displayName=`WithAnalyticsContext(${ge.displayName||ge.name||"Component"})`,Le}function B(){const ge=(0,r.Vt)("api-context");if(!ge)throw new Error("API context is not available");const ie=ge.atVersion(1);if(!ie)throw new Error("ApiContext v1 not available");return ie}function Te(ge){const Le=B().get(ge);if(!Le)throw new Error(`No implementation available for ${ge}`);return Le}function ue(ge){return function(Le){const Fe=_=>{const F=B(),fe={};for(const je in ge)if(ge.hasOwnProperty(je)){const Qe=ge[je],et=F.get(Qe);if(!et)throw new Error(`No implementation available for ${Qe}`);fe[je]=et}return _jsx(Le,{..._,...fe})},Ke=Le.displayName||Le.name||"Component";return Fe.displayName=`withApis(${Ke})`,Fe}}var K=t(47842);class ${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(ie){if((0,K.Z)(this,"config",void 0),this.config=ie,!ie.id.split(".").flatMap(Fe=>Fe.split("-")).every(Fe=>Fe.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${ie.id}'`)}}function R(ge){return new $(ge)}function O(ge,ie){return"id"in ge?{api:ge,deps:{},factory:()=>ie}:ge}var re;(function(ge){ge.SignedIn="SignedIn",ge.SignedOut="SignedOut"})(re||(re={}));const q=R({id:"core.auth.google"}),ne=R({id:"core.auth.github"}),D=R({id:"core.auth.okta"}),T=R({id:"core.auth.gitlab"}),k=R({id:"core.auth.microsoft"}),L=R({id:"core.auth.onelogin"}),V=R({id:"core.auth.bitbucket"}),Se=R({id:"core.auth.bitbucket-server"}),We=R({id:"core.auth.atlassian"}),qe=R({id:"core.alert"}),H=R({id:"core.analytics"}),_e=R({id:"core.apptheme"}),ut=R({id:"core.config"}),ze=R({id:"core.discovery"}),ft=R({id:"core.error"});var Re;(function(ge){ge[ge.None=0]="None",ge[ge.Active=1]="Active"})(Re||(Re={}));const ct=R({id:"core.featureflags"}),jt=R({id:"core.fetch"}),vt=R({id:"core.identity"}),gt=R({id:"core.oauthrequest"}),Et=R({id:"core.storage"});class Dt{setContext(ie){this.context=ie}captureEvent(ie,Le,{value:Fe,attributes:Ke}={}){try{this.analyticsApi.captureEvent({action:ie,subject:Le,value:Fe,attributes:Ke,context:this.context})}catch(_){console.warn("Error during analytics event capture. %o",_)}}constructor(ie,Le={routeRef:"unknown",pluginId:"root",extension:"App"}){(0,K.Z)(this,"analyticsApi",void 0),(0,K.Z)(this,"context",void 0),this.analyticsApi=ie,this.context=Le}}function Ge(){try{return Te(H)}catch{return{captureEvent:()=>{}}}}function Wt(){const ge=(0,W.useRef)(null),ie=m(),Le=Ge();function Fe(){return ge.current===null&&(ge.current=new Dt(Le)),ge.current}const Ke=Fe();return Ke.setContext(ie),Ke}const xe=()=>{const ge=(0,r.Vt)("app-context");if(!ge)throw new Error("App context is not available");const ie=ge.atVersion(1);if(!ie)throw new Error("AppContext v1 not available");return ie},pe=(0,r.uW)("component-data-store",()=>new WeakMap),De="__backstage_data";function Je(ge,ie,Le){const Fe=ge;var Ke;let _=(Ke=Fe[De])!==null&&Ke!==void 0?Ke:pe.get(ge);if(_||(_={map:new Map},Object.defineProperty(Fe,De,{enumerable:!1,configurable:!0,writable:!1,value:_}),pe.set(ge,_)),_.map.has(ie)){const F=ge.displayName||ge.name;throw new Error(`Attempted to attach duplicate data "${ie}" to component "${F}"`)}_.map.set(ie,Le)}function At(ge,ie){if(!ge)return;const Le=ge.type;if(!Le)return;var Fe;const Ke=(Fe=Le[De])!==null&&Fe!==void 0?Fe:pe.get(Le);if(Ke)return Ke.map.get(ie)}const wt=(0,r.uW)("route-ref-type",()=>Symbol("route-ref-type"));let rt=wt,yt=rt;class Ot{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(ie,Le){(0,K.Z)(this,"id",void 0),(0,K.Z)(this,"params",void 0),(0,K.Z)(this,yt,void 0),this.id=ie,this.params=Le,this[rt]="absolute"}}function Gt(ge){var ie;return new Ot(ge.id,(ie=ge.params)!==null&&ie!==void 0?ie:[])}const It=/^\w+$/;let on=null,Ut=null;class Vt{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(ie,Le,Fe,Ke){_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,Ut,void 0),this.id=ie,this.path=Le,this.parent=Fe,this.params=Ke,this[on]="sub"}}function zn(ge){const{id:ie,path:Le,parent:Fe}=ge,Ke=Le.split("/").filter(fe=>fe.startsWith(":")).map(fe=>fe.substring(1)),_=[...Fe.params,...Ke];if(Fe.params.some(fe=>Ke.includes(fe)))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 fe of Ke)if(!It.test(fe))throw new Error(`SubRouteRef path has invalid param, got '${fe}'`);return new Vt(ie,Le,Fe,_)}let In=wt,an=In;class Fn{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(ie,Le,Fe){(0,K.Z)(this,"id",void 0),(0,K.Z)(this,"params",void 0),(0,K.Z)(this,"optional",void 0),(0,K.Z)(this,an,void 0),this.id=ie,this.params=Le,this.optional=Fe,this[In]="external"}}function jn(ge){var ie;return new Fn(ge.id,(ie=ge.params)!==null&&ie!==void 0?ie:[],Boolean(ge.optional))}var Un=t(73557);function Pn(ge){const{pathname:ie}=(0,Un.TH)(),Le=(0,r.Vt)("routing-context");if(!Le)throw new Error("Routing context is not available");const Fe=Le.atVersion(1),Ke=(0,W.useMemo)(()=>Fe&&Fe.resolve(ge,{pathname:ie}),[Fe,ge,ie]);if(!Le)throw new Error("useRouteRef used outside of routing context");if(!Fe)throw new Error("RoutingContext v1 not available");const _="optional"in ge&&ge.optional;if(!Ke&&!_)throw new Error(`No path for ${ge}`);return Ke}function Jn(ge){return(0,Un.UO)()}class at extends W.Component{static getDerivedStateFromError(ie){return{error:ie}}render(){const{error:ie}=this.state,{app:Le,plugin:Fe}=this.props,{ErrorBoundaryFallback:Ke}=Le.getComponents();return ie?(0,u.jsx)(Ke,{error:ie,resetError:this.handleErrorReset,plugin:Fe}):this.props.children}constructor(...ie){super(...ie),(0,K.Z)(this,"state",{error:void 0}),(0,K.Z)(this,"handleErrorReset",()=>{this.setState({error:void 0})})}}var Mn=t(64355);function Ln(ge){const{component:ie,mountPoint:Le,name:Fe}=ge;return En({component:{lazy:()=>ie().then(Ke=>{const _=fe=>{try{Pn(Le)}catch(je){if(typeof je=="object"&&je!==null){const{message:Qe}=je;if(typeof Qe=="string"&&Qe.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 je}return(0,u.jsx)(Ke,{...fe})},F=Fe||Ke.displayName||Ke.name||"LazyComponent";return _.displayName=`RoutableExtension(${F})`,_},Ke=>F=>{const fe=xe(),{BootErrorPage:je}=fe.getComponents();return(0,u.jsx)(je,{step:"load-chunk",error:Ke})})},data:{"core.mountPoint":Le},name:Fe})}function Wn(ge){const{component:ie,name:Le}=ge;return En({component:ie,name:Le})}function En(ge){const{data:ie={},name:Le}=ge;Le||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Fe;if("lazy"in ge.component){const _=ge.component.lazy;Fe=(0,W.lazy)(()=>_().then(F=>({default:F})))}else Fe=ge.component.sync;const Ke=Le||Fe.displayName||Fe.name||"Component";return{expose(_){const F=fe=>{const je=xe(),{Progress:Qe}=je.getComponents(),et=ie==null?void 0:ie["core.mountPoint"];return(0,u.jsx)(W.Suspense,{fallback:(0,u.jsx)(Qe,{}),children:(0,u.jsx)(at,{app:je,plugin:_,children:(0,u.jsx)(y,{attributes:{pluginId:_.getId(),...Le&&{extension:Le},...et&&{routeRef:et.id}},children:(0,u.jsx)(Mn.o,{plugin:_,children:(0,u.jsx)(Fe,{...fe})})})})})};Je(F,"core.plugin",_);for(const[fe,je]of Object.entries(ie))Je(F,fe,je);return F.displayName=`Extension(${Ke})`,F}}}function fn(ge,ie,Le,Fe){return W.Children.toArray(ge).flatMap(Ke=>{if(!(0,W.isValidElement)(Ke))return[];if(Ke.type===W.Fragment)return fn(Ke.props.children,ie,Le,Fe);if(At(Ke,"core.featureFlagged")){const _=Ke.props;return("with"in _?ie.isActive(_.with):!ie.isActive(_.without))?fn(Ke.props.children,ie,Le,Fe):[]}if(Le===void 0||Le(Ke))return[Ke];if(Fe)throw new Error(Fe);return fn(Ke.props.children,ie,Le,Fe)})}class vn{selectByComponentData(ie){const Le=fn(this.node,this.featureFlagsApi,Fe=>At(Fe,ie.key)!==void 0,ie.withStrictError);return new vn(Le,this.featureFlagsApi)}findComponentData(ie){return fn(this.node,this.featureFlagsApi,Fe=>At(Fe,ie.key)!==void 0).map(Fe=>At(Fe,ie.key)).filter(Fe=>Fe!==void 0)}getElements(){return fn(this.node,this.featureFlagsApi)}constructor(ie,Le){(0,K.Z)(this,"node",void 0),(0,K.Z)(this,"featureFlagsApi",void 0),this.node=ie,this.featureFlagsApi=Le}}function kn(ge,ie,Le=[]){const Fe=Te(ct),Ke=new vn(ge,Fe);return(0,W.useMemo)(()=>ie(Ke),[ge,...Le])}class ln{getId(){return this.config.id}getApis(){var ie;return(ie=this.config.apis)!==null&&ie!==void 0?ie:[]}getFeatureFlags(){var ie,Le;return(Le=(ie=this.config.featureFlags)===null||ie===void 0?void 0:ie.slice())!==null&&Le!==void 0?Le:[]}get routes(){var ie;return(ie=this.config.routes)!==null&&ie!==void 0?ie:{}}get externalRoutes(){var ie;return(ie=this.config.externalRoutes)!==null&&ie!==void 0?ie:{}}provide(ie){return ie.expose(this)}__experimentalReconfigure(ie){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(ie))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var ie;return(ie=this.options)!==null&&ie!==void 0?ie:{}}toString(){return`plugin{${this.config.id}}`}constructor(ie){(0,K.Z)(this,"config",void 0),(0,K.Z)(this,"options",void 0),this.config=ie,this.options=void 0}}function Vn(ge){return new ln(ge)}},64355:function(St,$e,t){"use strict";t.d($e,{o:function(){return m},y:function(){return y}});var u=t(52322),r=t(51837),W=t(2784);const P="plugin-context",m=c=>{const{children:B,plugin:Te}=c,{Provider:ue}=(0,r.CT)(P);return(0,u.jsx)(ue,{value:(0,r.EI)({1:{plugin:Te}}),children:B})};function y(){const c=(0,r.Vt)(P);if(!c)throw new Error("Plugin Options context is not available");const B=c.atVersion(1);if(!B)throw new Error("Plugin Options v1 is not available");return B.plugin.getPluginOptions()}},23054:function(St,$e,t){"use strict";t.d($e,{SP:function(){return q},dR:function(){return $},VL:function(){return D},BD:function(){return r}});function u(T){if(typeof T!="object"||T===null||Array.isArray(T))return!1;const k=T;return!(typeof k.name!="string"||k.name===""||typeof k.message!="string")}function r(T){if(typeof T!="object"||T===null||Array.isArray(T))throw new Error(`Encountered invalid error, not an object, got '${T}'`);const k=T;if(typeof k.name!="string"||k.name==="")throw new Error(`Encountered error object without a name, got '${T}'`);if(typeof k.message!="string")throw new Error(`Encountered error object without a message, got '${T}'`)}var W=t(47842),P=t(24852);function m(T,k){const V={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(T)};return k!=null&&k.includeStack||delete V.stack,V}function y(T){const k=(0,P.deserializeError)(T);return T.stack||(k.stack=void 0),k}function c(T){if(u(T)){const k=String(T);return k!=="[object Object]"?k:`${T.name}: ${T.message}`}return`unknown error '${T}'`}class B extends Error{constructor(k,L){var V;let Se=k;if(L!==void 0){const We=c(L);Se?Se+=`; caused by ${We}`:Se=`caused by ${We}`}super(Se),(0,W.Z)(this,"cause",void 0),(V=Error.captureStackTrace)===null||V===void 0||V.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=u(L)?L:void 0}}class Te extends null{}class ue extends null{}class K extends null{}class $ extends B{}class R extends null{}class O extends null{}class re extends null{}class q extends B{constructor(k,L){super(k,L),this.name=u(L)?L.name:"Error"}}async function ne(T){try{const L=await T.text();if(L){var k;if(!((k=T.headers.get("content-type"))===null||k===void 0)&&k.startsWith("application/json"))try{const V=JSON.parse(L);if(V.error&&V.response)return V}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}, ${L}`},response:{statusCode:T.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}`},response:{statusCode:T.status}}}class D extends Error{static async fromResponse(k){const L=await ne(k),V=L.response.statusCode||k.status,Se=L.error.name||k.statusText,We=`Request failed with ${V} ${Se}`,qe=y(L.error);return new D({message:We,response:k,data:L,cause:qe})}constructor(k){super(k.message),(0,W.Z)(this,"response",void 0),(0,W.Z)(this,"body",void 0),(0,W.Z)(this,"cause",void 0),this.name="ResponseError",this.response=k.response,this.body=k.data,this.cause=k.cause}}},32838:function(St,$e,t){"use strict";t.d($e,{nW:function(){return q},ae:function(){return K},q3:function(){return $}});var u=t(60871);const r=(0,u.T0)({id:"core.scmauth"});var W=new WeakMap;class P{async getCredentials(D){const T=new URL(D.url),k=_class_private_field_get(this,W).find(L=>L.isUrlSupported(T));if(!k)throw new Error(`No auth provider available for '${D.url}', see https://backstage.io/link?scm-auth`);return k.getCredentials(D)}constructor(D){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_set(this,W,D)}}var m=new WeakMap,y=new WeakMap,c=new WeakMap,B=new WeakMap;class Te{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:D,gitlab:T,azure:k,bitbucket:L})=>Te.merge(Te.forGithub(D),Te.forGitlab(T),Te.forAzure(k),Te.forBitbucket(L))})}static forAuthApi(D,T){return new Te("generic",D,T.host,T.scopeMapping)}static forGithub(D,T){var k;const L=(k=T==null?void 0:T.host)!==null&&k!==void 0?k:"github.com";return new Te("github",D,L,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(D,T){var k;const L=(k=T==null?void 0:T.host)!==null&&k!==void 0?k:"gitlab.com";return new Te("gitlab",D,L,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(D,T){var k;const L=(k=T==null?void 0:T.host)!==null&&k!==void 0?k:"dev.azure.com";return new Te("azure",D,L,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(D,T){var k;const L=(k=T==null?void 0:T.host)!==null&&k!==void 0?k:"bitbucket.org";return new Te("bitbucket",D,L,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...D){return new P(D)}isUrlSupported(D){return D.host===_class_private_field_get(this,y)}getAdditionalScopesForProvider(D){var T;if(!(D!=null&&D.customScopes)||_class_private_field_get(this,B)==="generic")return[];var k;return(k=(T=D.customScopes)===null||T===void 0?void 0:T[_class_private_field_get(this,B)])!==null&&k!==void 0?k:[]}async getCredentials(D){const{url:T,additionalScope:k,...L}=D,V=_class_private_field_get(this,c).default.slice();k!=null&&k.repoWrite&&V.push(..._class_private_field_get(this,c).repoWrite);const Se=this.getAdditionalScopesForProvider(k);Se.length&&V.push(...Se);const We=[...new Set(V)],qe=await _class_private_field_get(this,m).getAccessToken(We,L);return{token:qe,headers:{Authorization:`Bearer ${qe}`}}}constructor(D,T,k,L){_class_private_field_init(this,m,{writable:!0,value:void 0}),_class_private_field_init(this,y,{writable:!0,value:void 0}),_class_private_field_init(this,c,{writable:!0,value:void 0}),_class_private_field_init(this,B,{writable:!0,value:void 0}),_class_private_field_set(this,m,T),_class_private_field_set(this,y,k),_class_private_field_set(this,c,L),_class_private_field_set(this,B,D)}}var ue=t(79158);class K{static fromConfig(D){return ue.Lx.fromConfig(D)}}const $=(0,u.T0)({id:"integration.scmintegrations"});var R=t(52322),O=t(73250),re=t(2784);const q=ne=>{const{type:D}=ne,T=(0,u.qD)(),k=O.Z;var L;const V=D&&(L=T.getSystemIcon(D))!==null&&L!==void 0?L:k;return(0,R.jsx)(V,{})}},79158:function(St,$e,t){"use strict";t.d($e,{Lx:function(){return mr},BT:function(){return Tt}});var u=t(47842),r=t(82717),W=t.n(r),P=t(76635);function m(S){const h=new URL("http://example.com");return h.host=S,h.host===S}function y(S){try{return new URL(S),!0}catch{return!1}}function c(S,h){return{list(){return S},byUrl(x){try{const j=typeof x=="string"?new URL(x):x;return S.find(X=>h(X)===j.host)}catch{return}},byHost(x){return S.find(j=>h(j)===x)}}}function B(S){const{url:h,base:x,lineNumber:j}=S;try{return new URL(h),h}catch{}let X;if(h.startsWith("/")){const{filepath:Ce}=W()(x);X=new URL(x);const he=(0,P.trimEnd)(X.pathname.substring(0,X.pathname.length-Ce.length),"/");X.pathname=`${he}${h}`}else X=new URL(h,x);return X.search=new URL(x).search,j&&(X.hash=`L${j}`),X.toString()}function Te(S){beforeAll(()=>S.listen({onUnhandledRequest:"error"})),afterAll(()=>S.close()),afterEach(()=>S.resetHandlers())}const ue="amazonaws.com";function K(S){const h=S.getOptionalString("endpoint");var x;const j=(x=S.getOptionalBoolean("s3ForcePathStyle"))!==null&&x!==void 0?x:!1;let X,Ce;if(h){try{const dn=new URL(h);X=dn.host,Ce=dn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${h}' is not a valid URL`)}if(Ce!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${h}'`)}else X=ue;const he=S.getOptionalString("accessKeyId"),Ne=S.getOptionalString("secretAccessKey"),pt=S.getOptionalString("roleArn"),zt=S.getOptionalString("externalId");return{host:X,endpoint:h,s3ForcePathStyle:j,accessKeyId:he,secretAccessKey:Ne,roleArn:pt,externalId:zt}}function $(S){const h=S.map(K);return h.some(x=>x.host===ue)||h.push({host:ue}),h}class R{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){return B(h)}resolveEditUrl(h){return h}constructor(h){(0,u.Z)(this,"integrationConfig",void 0),this.integrationConfig=h}}(0,u.Z)(R,"factory",({config:S})=>{var h;const x=$((h=S.getOptionalConfigArray("integrations.awsS3"))!==null&&h!==void 0?h:[]);return c(x.map(j=>new R(j)),j=>j.config.host)});var O=t(90383),re=t(22504),q=t(69866);const ne="GB";var D=new WeakMap,T=new WeakMap,k=new WeakMap,L=new WeakMap,V=new WeakMap,Se=new WeakMap,We=new WeakMap;class qe{static fromRepoUrl(h){const x=new URL(h);let j,X,Ce;const he=x.pathname.split("/").map(On=>decodeURIComponent(On));if(he[2]==="_git"?(j=he[1],X=Ce=he[3]):he[3]==="_git"?(j=he[1],X=he[2],Ce=he[4]):he[4]==="_git"&&(j=`${he[1]}/${he[2]}`,X=he[3],Ce=he[5]),!j||!X||!Ce)throw new Error("Azure URL must point to a git repository");var Ne;const pt=(Ne=x.searchParams.get("path"))!==null&&Ne!==void 0?Ne:void 0;let zt;const dn=x.searchParams.get("version");if(dn){if(dn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");zt=dn.slice(2)}return new qe(x.origin,j,X,Ce,pt,zt)}toRepoUrl(){let h;return(0,O.Z)(this,k)===(0,O.Z)(this,L)?h=(0,O.Z)(this,We).call(this,(0,O.Z)(this,T),"_git",(0,O.Z)(this,L)):h=(0,O.Z)(this,We).call(this,(0,O.Z)(this,T),(0,O.Z)(this,k),"_git",(0,O.Z)(this,L)),(0,O.Z)(this,V)&&h.searchParams.set("path",(0,O.Z)(this,V)),(0,O.Z)(this,Se)&&h.searchParams.set("version",ne+(0,O.Z)(this,Se)),h.toString()}toFileUrl(){if(!(0,O.Z)(this,V))throw new Error("Azure URL must point to a specific path to be able to download a file");const h=(0,O.Z)(this,We).call(this,(0,O.Z)(this,T),(0,O.Z)(this,k),"_apis","git","repositories",(0,O.Z)(this,L),"items");return h.searchParams.set("api-version","6.0"),h.searchParams.set("path",(0,O.Z)(this,V)),(0,O.Z)(this,Se)&&h.searchParams.set("version",(0,O.Z)(this,Se)),h.toString()}toArchiveUrl(){const h=(0,O.Z)(this,We).call(this,(0,O.Z)(this,T),(0,O.Z)(this,k),"_apis","git","repositories",(0,O.Z)(this,L),"items");return h.searchParams.set("recursionLevel","full"),h.searchParams.set("download","true"),h.searchParams.set("api-version","6.0"),(0,O.Z)(this,V)&&h.searchParams.set("scopePath",(0,O.Z)(this,V)),(0,O.Z)(this,Se)&&h.searchParams.set("version",(0,O.Z)(this,Se)),h.toString()}toCommitsUrl(){const h=(0,O.Z)(this,We).call(this,(0,O.Z)(this,T),(0,O.Z)(this,k),"_apis","git","repositories",(0,O.Z)(this,L),"commits");return h.searchParams.set("api-version","6.0"),(0,O.Z)(this,Se)&&h.searchParams.set("searchCriteria.itemVersion.version",(0,O.Z)(this,Se)),h.toString()}getOwner(){return(0,O.Z)(this,T)}getProject(){return(0,O.Z)(this,k)}getRepo(){return(0,O.Z)(this,L)}getPath(){return(0,O.Z)(this,V)}getRef(){return(0,O.Z)(this,Se)}constructor(h,x,j,X,Ce,he){(0,re.Z)(this,D,{writable:!0,value:void 0}),(0,re.Z)(this,T,{writable:!0,value:void 0}),(0,re.Z)(this,k,{writable:!0,value:void 0}),(0,re.Z)(this,L,{writable:!0,value:void 0}),(0,re.Z)(this,V,{writable:!0,value:void 0}),(0,re.Z)(this,Se,{writable:!0,value:void 0}),(0,re.Z)(this,We,{writable:!0,value:(...Ne)=>{const pt=new URL((0,O.Z)(this,D));return pt.pathname=Ne.map(zt=>encodeURIComponent(zt)).join("/"),pt}}),(0,q.Z)(this,D,h),(0,q.Z)(this,T,x),(0,q.Z)(this,k,j),(0,q.Z)(this,L,X),(0,q.Z)(this,V,Ce),(0,q.Z)(this,Se,he)}}const H="dev.azure.com";function _e(S){var h;const x=(h=S.getOptionalString("host"))!==null&&h!==void 0?h:H,j=S.getOptionalString("token");if(!m(x))throw new Error(`Invalid Azure integration config, '${x}' is not a valid host`);return{host:x,token:j}}function ut(S){const h=S.map(_e);return h.some(x=>x.host===H)||h.push({host:H}),h}class ze{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){const{url:x,base:j}=h;if(y(x))return x;try{const Ce=qe.fromRepoUrl(j),he=new URL(j);var X;const Ne=new URL(`https://a.com${(X=Ce.getPath())!==null&&X!==void 0?X:""}`),pt=new URL(x,Ne).pathname;return he.searchParams.set("path",pt),h.lineNumber&&(he.searchParams.set("line",String(h.lineNumber)),he.searchParams.set("lineEnd",String(h.lineNumber+1)),he.searchParams.set("lineStartColumn","1"),he.searchParams.set("lineEndColumn","1")),he.toString()}catch{return new URL(x,j).toString()}}resolveEditUrl(h){return h}constructor(h){(0,u.Z)(this,"integrationConfig",void 0),this.integrationConfig=h}}(0,u.Z)(ze,"factory",({config:S})=>{var h;const x=ut((h=S.getOptionalConfigArray("integrations.azure"))!==null&&h!==void 0?h:[]);return c(x.map(j=>new ze(j)),j=>j.config.host)});var ft=t(48834).lW;function Re(S){return AzureUrl.fromRepoUrl(S).toFileUrl()}function ct(S){return AzureUrl.fromRepoUrl(S).toArchiveUrl()}function jt(S){return AzureUrl.fromRepoUrl(S).toCommitsUrl()}function vt(S,h){const x=h?{...h}:{};if(S.token){const j=ft.from(`:${S.token}`,"utf8");x.Authorization=`Basic ${j.toString("base64")}`}return{headers:x}}const gt="bitbucket.org",Et="https://api.bitbucket.org/2.0";function Dt(S){var h;const x=(h=S.getOptionalString("host"))!==null&&h!==void 0?h:gt;let j=S.getOptionalString("apiBaseUrl");const X=S.getOptionalString("token"),Ce=S.getOptionalString("username"),he=S.getOptionalString("appPassword");if(!m(x))throw new Error(`Invalid Bitbucket integration config, '${x}' is not a valid host`);return j?j=(0,P.trimEnd)(j,"/"):x===gt?j=Et:j=`https://${x}/rest/api/1.0`,{host:x,apiBaseUrl:j,token:X,username:Ce,appPassword:he}}function Ge(S){const h=S.map(Dt);return h.some(x=>x.host===gt)||h.push({host:gt,apiBaseUrl:Et}),h}class Wt{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){const x=B(h);if(!h.lineNumber)return x;const j=new URL(x);return this.integrationConfig.host==="bitbucket.org"?j.hash=`lines-${h.lineNumber}`:j.hash=`${h.lineNumber}`,j.toString()}resolveEditUrl(h){const x=W()(h),j=new URL(h);return j.searchParams.set("mode","edit"),j.searchParams.set("spa","0"),j.searchParams.set("at",x.ref),j.toString()}constructor(h){(0,u.Z)(this,"integrationConfig",void 0),this.integrationConfig=h}}(0,u.Z)(Wt,"factory",({config:S})=>{var h,x,j;const X=Ge((j=S.getOptionalConfigArray("integrations.bitbucket"))!==null&&j!==void 0?j:[...(h=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&h!==void 0?h:[],...(x=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&x!==void 0?x:[]]);return c(X.map(Ce=>new Wt(Ce)),Ce=>Ce.config.host)});var xe=t(96279),pe=t(48834).lW;async function De(S,h){const{name:x,owner:j,resource:X}=parseGitUrl(S),Ce=X==="bitbucket.org";let he=Ce?`${h.apiBaseUrl}/repositories/${j}/${x}`:`${h.apiBaseUrl}/projects/${j}/repos/${x}/default-branch`,Ne=await fetch(he,wt(h));if(Ne.status===404&&!Ce&&(he=`${h.apiBaseUrl}/projects/${j}/repos/${x}/branches/default`,Ne=await fetch(he,wt(h))),!Ne.ok){const zt=`Failed to retrieve default branch from ${he}, ${Ne.status} ${Ne.statusText}`;throw new Error(zt)}let pt;if(Ce)pt=(await Ne.json()).mainbranch.name;else{const{displayId:zt}=await Ne.json();pt=zt}if(!pt)throw new Error(`Failed to read default branch from ${he}. Response ${Ne.status} ${Ne.json()}`);return pt}async function Je(S,h){const{name:x,owner:j,ref:X,protocol:Ce,resource:he,filepath:Ne}=parseGitUrl(S),pt=he==="bitbucket.org";let zt=X;zt||(zt=await De(S,h));const dn=Ne?`&path=${encodeURIComponent(decodeURIComponent(Ne))}`:"";return pt?`${Ce}://${he}/${j}/${x}/get/${zt}.tar.gz`:`${h.apiBaseUrl}/projects/${j}/repos/${x}/archive?format=tgz&at=${zt}&prefix=${j}-${x}${dn}`}function At(S,h){try{const{owner:x,name:j,ref:X,filepathtype:Ce,filepath:he}=parseGitUrl(S);if(!x||!j||Ce!=="browse"&&Ce!=="raw"&&Ce!=="src")throw new Error("Invalid Bitbucket URL or file path");const Ne=he.replace(/^\//,"");if(h.host==="bitbucket.org"){if(!X)throw new Error("Invalid Bitbucket URL or file path");return`${h.apiBaseUrl}/repositories/${x}/${j}/src/${X}/${Ne}`}return`${h.apiBaseUrl}/projects/${x}/repos/${j}/raw/${Ne}?at=${X}`}catch(x){throw new Error(`Incorrect URL: ${S}, ${x}`)}}function wt(S){const h={};if(S.token)h.Authorization=`Bearer ${S.token}`;else if(S.username&&S.appPassword){const x=pe.from(`${S.username}:${S.appPassword}`,"utf8");h.Authorization=`Basic ${x.toString("base64")}`}return{headers:h}}const rt="bitbucket.org",yt="https://api.bitbucket.org/2.0";function Ot(S){const h=rt,x=yt,j=S.getString("username"),X=S.getString("appPassword");return{host:h,apiBaseUrl:x,username:j,appPassword:X}}function Gt(S){const h=S.map(Ot);return h.length===0&&h.push({host:rt,apiBaseUrl:yt}),h}class It{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){const x=B(h);if(h.lineNumber){const j=new URL(x);return j.hash=`lines-${h.lineNumber}`,j.toString()}return x}resolveEditUrl(h){const x=W()(h),j=new URL(h);return j.searchParams.set("mode","edit"),j.searchParams.set("at",x.ref),j.toString()}constructor(h){(0,u.Z)(this,"integrationConfig",void 0),this.integrationConfig=h}}(0,u.Z)(It,"factory",({config:S})=>{var h;const x=Gt((h=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&h!==void 0?h:[]);return c(x.map(j=>new It(j)),j=>j.config.host)});var on=t(48834).lW;async function Ut(S,h){const{name:x,owner:j}=parseGitUrl(S),X=`${h.apiBaseUrl}/repositories/${j}/${x}`,Ce=await fetch(X,In(h));if(!Ce.ok){const pt=`Failed to retrieve default branch from ${X}, ${Ce.status} ${Ce.statusText}`;throw new Error(pt)}const Ne=(await Ce.json()).mainbranch.name;if(!Ne)throw new Error(`Failed to read default branch from ${X}. Response ${Ce.status} ${Ce.json()}`);return Ne}async function Vt(S,h){const{name:x,owner:j,ref:X,protocol:Ce,resource:he}=parseGitUrl(S);let Ne=X;return Ne||(Ne=await Ut(S,h)),`${Ce}://${he}/${j}/${x}/get/${Ne}.tar.gz`}function zn(S,h){try{const{owner:x,name:j,ref:X,filepathtype:Ce,filepath:he}=parseGitUrl(S);if(!x||!j||Ce!=="src"&&Ce!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Ne=he.replace(/^\//,"");if(!X)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${h.apiBaseUrl}/repositories/${x}/${j}/src/${X}/${Ne}`}catch(x){throw new Error(`Incorrect URL: ${S}, ${x}`)}}function In(S){const h={};if(S.username&&S.appPassword){const x=on.from(`${S.username}:${S.appPassword}`,"utf8");h.Authorization=`Basic ${x.toString("base64")}`}return{headers:h}}function an(S){const h=S.getString("host");let x=S.getOptionalString("apiBaseUrl");const j=S.getOptionalString("token"),X=S.getOptionalString("username"),Ce=S.getOptionalString("password");if(!m(h))throw new Error(`Invalid Bitbucket Server integration config, '${h}' is not a valid host`);return x?x=(0,P.trimEnd)(x,"/"):x=`https://${h}/rest/api/1.0`,{host:h,apiBaseUrl:x,token:j,username:X,password:Ce}}function Fn(S){return S.map(an)}class jn{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){const x=B(h);if(h.lineNumber){const j=new URL(x);return j.hash=h.lineNumber.toString(),j.toString()}return x}resolveEditUrl(h){return h.includes("?")?h.substring(0,h.indexOf("?")):h}constructor(h){(0,u.Z)(this,"integrationConfig",void 0),this.integrationConfig=h}}(0,u.Z)(jn,"factory",({config:S})=>{var h;const x=Fn((h=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&h!==void 0?h:[]);return c(x.map(j=>new jn(j)),j=>j.config.host)});var Un=t(48834).lW;async function Pn(S,h){const{name:x,owner:j}=parseGitUrl(S);let X=`${h.apiBaseUrl}/projects/${j}/repos/${x}/default-branch`,Ce=await fetch(X,Mn(h));if(Ce.status===404&&(X=`${h.apiBaseUrl}/projects/${j}/repos/${x}/branches/default`,Ce=await fetch(X,Mn(h))),!Ce.ok){const pt=`Failed to retrieve default branch from ${X}, ${Ce.status} ${Ce.statusText}`;throw new Error(pt)}const{displayId:he}=await Ce.json(),Ne=he;if(!Ne)throw new Error(`Failed to read default branch from ${X}. Response ${Ce.status} ${Ce.json()}`);return Ne}async function Jn(S,h){const{name:x,owner:j,ref:X,filepath:Ce}=parseGitUrl(S);let he=X;he||(he=await Pn(S,h));const Ne=Ce?`&path=${encodeURIComponent(decodeURIComponent(Ce))}`:"";return`${h.apiBaseUrl}/projects/${j}/repos/${x}/archive?format=tgz&at=${he}&prefix=${j}-${x}${Ne}`}function at(S,h){try{const{owner:x,name:j,ref:X,filepathtype:Ce,filepath:he}=parseGitUrl(S);if(!x||!j||Ce!=="browse"&&Ce!=="raw"&&Ce!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Ne=he.replace(/^\//,"");return`${h.apiBaseUrl}/projects/${x}/repos/${j}/raw/${Ne}?at=${X}`}catch(x){throw new Error(`Incorrect URL: ${S}, ${x}`)}}function Mn(S){const h={};if(S.token)h.Authorization=`Bearer ${S.token}`;else if(S.username&&S.password){const x=Un.from(`${S.username}:${S.password}`,"utf8");h.Authorization=`Basic ${x.toString("base64")}`}return{headers:h}}function Ln(S){const h=S.getString("host");let x=S.getOptionalString("baseUrl"),j=S.getOptionalString("cloneUrl"),X=S.getOptionalString("gitilesBaseUrl");const Ce=S.getOptionalString("username"),he=S.getOptionalString("password");if(m(h)){if(x&&!y(x))throw new Error(`Invalid Gerrit integration config, '${x}' is not a valid baseUrl`);if(j&&!y(j))throw new Error(`Invalid Gerrit integration config, '${j}' is not a valid cloneUrl`);if(X&&!y(X))throw new Error(`Invalid Gerrit integration config, '${X}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${h}' is not a valid host`);return x?x=(0,P.trimEnd)(x,"/"):x=`https://${h}`,X?X=(0,P.trimEnd)(X,"/"):X=`https://${h}`,j?j=(0,P.trimEnd)(j,"/"):j=x,{host:h,baseUrl:x,cloneUrl:j,gitilesBaseUrl:X,username:Ce,password:he}}function Wn(S){return S.map(Ln)}var En=t(48834).lW;const fn=")]}'";function vn(S,h){const j=h.replace(S.gitilesBaseUrl,"").split("/").filter(zt=>!!zt),X=j.indexOf("+");if(X<=0)throw new Error(`Unable to parse project from url: ${h}`);const Ce=(0,P.trimStart)(j.slice(0,X).join("/"),"/"),he=j.indexOf("heads");if(he<=0)throw new Error(`Unable to parse branch from url: ${h}`);const Ne=j[he+1],pt=j.slice(he+2).join("/");return{branch:Ne,filePath:pt===""?"/":pt,project:Ce}}function kn(S,h,x,j){return`${S.gitilesBaseUrl}/${h}/+/refs/heads/${x}/${(0,P.trimStart)(j,"/")}`}function ln(S){return S.password?"/a/":"/"}function Vn(S,h){const{branch:x,project:j}=vn(S,h);return`${S.baseUrl}${ln(S)}projects/${encodeURIComponent(j)}/branches/${x}`}function ge(S,h){const{project:x}=vn(S,h);return`${S.cloneUrl}${ln(S)}${x}`}function ie(S,h){const{branch:x,filePath:j,project:X}=vn(S,h);return`${S.baseUrl}${ln(S)}projects/${encodeURIComponent(X)}/branches/${x}/files/${encodeURIComponent(j)}/content`}function Le(S){return`${S.baseUrl}${ln(S)}projects/`}function Fe(S){const h={};if(!S.password)return h;const x=En.from(`${S.username}:${S.password}`,"utf8");return h.Authorization=`Basic ${x.toString("base64")}`,{headers:h}}async function Ke(S){const h=await S.text();if(h.startsWith(fn))try{return JSON.parse(h.slice(fn.length))}catch(x){throw new Error(`Invalid response from Gerrit: ${h.slice(0,10)} - ${x}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${h.slice(0,10)}`)}class _{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){const{url:x,base:j,lineNumber:X}=h;let Ce;if(x.startsWith("/")){const{branch:he,project:Ne}=vn(this.config,j);return kn(this.config,Ne,he,x)}return x?Ce=new URL(x,j):Ce=new URL(j),X&&(Ce.hash=X.toString()),Ce.toString()}resolveEditUrl(h){return h}constructor(h){(0,u.Z)(this,"integrationConfig",void 0),this.integrationConfig=h}}(0,u.Z)(_,"factory",({config:S})=>{var h;const x=Wn((h=S.getOptionalConfigArray("integrations.gerrit"))!==null&&h!==void 0?h:[]);return c(x.map(j=>new _(j)),j=>j.config.host)});function F(S){const h=S.getString("host");let x=S.getOptionalString("baseUrl");const j=S.getOptionalString("username"),X=S.getOptionalString("password");if(!m(h))throw new Error(`Invalid Gitea integration config, '${h}' is not a valid host`);return x?x=(0,P.trimEnd)(x,"/"):x=`https://${h}`,{host:h,baseUrl:x,username:j,password:X}}var fe=t(48834).lW;function je(S,h){try{var x;const j=(x=S.baseUrl)!==null&&x!==void 0?x:`https://${S.host}`,[X,Ce,he,Ne,pt,zt,...dn]=h.replace(j,"").split("/"),On=dn.join("/").replace(/^\//,"");return`${j}/${Ce}/${he}/_edit/${zt}/${On}`}catch(j){throw new Error(`Incorrect URL: ${h}, ${j}`)}}function Qe(S,h){try{var x;const j=(x=S.baseUrl)!==null&&x!==void 0?x:`https://${S.host}`,[X,Ce,he,Ne,pt,zt,...dn]=h.replace(j,"").split("/"),On=dn.join("/").replace(/^\//,"");return`${j}/api/v1/repos/${Ce}/${he}/contents/${On}?ref=${zt}`}catch(j){throw new Error(`Incorrect URL: ${h}, ${j}`)}}function et(S){const h={},{username:x,password:j}=S;return j?(x?h.Authorization=`basic ${fe.from(`${x}:${j}`).toString("base64")}`:h.Authorization=`token ${j}`,{headers:h}):h}class Zt{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(h){return B(h)}resolveEditUrl(h){return je(this.config,h)}constructor(h){(0,u.Z)(this,"config",void 0),this.config=h}}(0,u.Z)(Zt,"factory",({config:S})=>{var h;const j=((h=S.getOptionalConfigArray("integrations.gitea"))!==null&&h!==void 0?h:[]).map(X=>F(X));return c(j.map(X=>new Zt(X)),X=>X.config.host)});const Ht="github.com",sn="https://api.github.com",ee="https://raw.githubusercontent.com";function Q(S){var h,x;const j=(x=S.getOptionalString("host"))!==null&&x!==void 0?x:Ht;let X=S.getOptionalString("apiBaseUrl"),Ce=S.getOptionalString("rawBaseUrl");const he=S.getOptionalString("token"),Ne=(h=S.getOptionalConfigArray("apps"))===null||h===void 0?void 0:h.map(pt=>({appId:pt.getNumber("appId"),clientId:pt.getString("clientId"),clientSecret:pt.getString("clientSecret"),webhookSecret:pt.getString("webhookSecret"),privateKey:pt.getString("privateKey"),allowedInstallationOwners:pt.getOptionalStringArray("allowedInstallationOwners")}));if(!m(j))throw new Error(`Invalid GitHub integration config, '${j}' is not a valid host`);return X?X=(0,P.trimEnd)(X,"/"):j===Ht&&(X=sn),Ce?Ce=(0,P.trimEnd)(Ce,"/"):j===Ht&&(Ce=ee),{host:j,apiBaseUrl:X,rawBaseUrl:Ce,token:he,apps:Ne}}function se(S){const h=S.map(Q);return h.some(x=>x.host===Ht)||h.push({host:Ht,apiBaseUrl:sn,rawBaseUrl:ee}),h}function g(S,h,x){try{const{owner:j,name:X,ref:Ce,filepathtype:he,filepath:Ne}=parseGitUrl(S);if(!j||!X||!Ce||he!=="blob"&&he!=="raw"&&he!=="tree")throw new Error("Invalid GitHub URL or file path");const pt=Ne.replace(/^\//,"");return Y(h,x)==="api"?`${h.apiBaseUrl}/repos/${j}/${X}/contents/${pt}?ref=${Ce}`:`${h.rawBaseUrl}/${j}/${X}/${Ce}/${pt}`}catch(j){throw new Error(`Incorrect URL: ${S}, ${j}`)}}function w(S,h){const x={};return Y(S,h)==="api"&&(x.Accept="application/vnd.github.v3.raw"),h.token&&(x.Authorization=`token ${h.token}`),{headers:x}}function Y(S,h){return S.apiBaseUrl&&(h.token||!S.rawBaseUrl)?"api":"raw"}var J=t(42822),me=t(89393),ve=t(26228);class Ue{async getOrCreateToken(h,x,j){let X=this.tokenCache.get(h);if((!X||this.isExpired(X.expiresAt))&&(X=await j(),X.expiresAt=X.expiresAt.minus({minutes:10}),this.tokenCache.set(h,X)),!this.appliesToRepo(X,x))throw new Error(`The Backstage GitHub application used in the ${h} organization does not have access to a repository with the name ${x}`);return{accessToken:X.token}}appliesToRepo(h,x){return x===void 0?!0:h.repositories!==void 0?h.repositories.includes(x):!0}constructor(){(0,u.Z)(this,"tokenCache",new Map),(0,u.Z)(this,"isExpired",h=>ve.ou.local()>h)}}const ot={Accept:"application/vnd.github.machine-man-preview+json"};class tt{async getInstallationCredentials(h,x){if(this.allowedInstallationOwners){var j;if(!(!((j=this.allowedInstallationOwners)===null||j===void 0)&&j.includes(h)))return{accessToken:void 0}}return this.cache.getOrCreateToken(h,x,async()=>{const{installationId:X,suspended:Ce}=await this.getInstallationData(h);if(Ce)throw new Error(`The GitHub application for ${h} is suspended`);const he=await this.appClient.apps.createInstallationAccessToken({installation_id:X,headers:ot});let Ne;if(he.data.repository_selection==="selected"){const zt=new me.v({baseUrl:this.baseUrl,auth:he.data.token}),dn=await zt.paginate(zt.apps.listReposAccessibleToInstallation);var pt;Ne=((pt=dn.repositories)!==null&&pt!==void 0?pt:dn).map(vr=>vr.name)}return{token:he.data.token,expiresAt:ve.ou.fromISO(he.data.expires_at),repositories:Ne}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(h){const j=(await this.getInstallations()).find(Ce=>{var he,Ne;return((he=Ce.account)===null||he===void 0||(Ne=he.login)===null||Ne===void 0?void 0:Ne.toLocaleLowerCase("en-US"))===h.toLocaleLowerCase("en-US")});if(j)return{installationId:j.id,suspended:Boolean(j.suspended_by)};const X=new Error(`No app installation found for ${h} in ${this.baseAuthConfig.appId}`);throw X.name="NotFoundError",X}constructor(h,x){(0,u.Z)(this,"appClient",void 0),(0,u.Z)(this,"baseUrl",void 0),(0,u.Z)(this,"baseAuthConfig",void 0),(0,u.Z)(this,"cache",new Ue),(0,u.Z)(this,"allowedInstallationOwners",void 0),this.allowedInstallationOwners=h.allowedInstallationOwners,this.baseUrl=x,this.baseAuthConfig={appId:h.appId,privateKey:h.privateKey.replace(/\\n/gm,`
|
|
33
|
-
`)},this.appClient=new me.v({baseUrl:x,headers:ot,authStrategy:J.i,auth:this.baseAuthConfig})}}class xt{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(x=>x.getInstallations()))).flat():[]}async getAppToken(h,x){if(this.apps.length===0)return;const j=await Promise.all(this.apps.map(Ne=>Ne.getInstallationCredentials(h,x).then(pt=>({credentials:pt,error:void 0}),pt=>({credentials:void 0,error:pt})))),X=j.find(Ne=>Ne.credentials);if(X)return X.credentials.accessToken;const he=j.map(Ne=>Ne.error).find(Ne=>Ne.name!=="NotFoundError");if(he)throw he}constructor(h){var x;(0,u.Z)(this,"apps",void 0);var j;this.apps=(j=(x=h.apps)===null||x===void 0?void 0:x.map(X=>new tt(X,h.apiBaseUrl)))!==null&&j!==void 0?j:[]}}class lt{async getCredentials(h){const x=W()(h.url),j=x.owner||x.name,X=x.owner?x.name:void 0;let Ce="app",he=await this.githubAppCredentialsMux.getAppToken(j,X);return he||(Ce="token",he=this.token),{headers:he?{Authorization:`Bearer ${he}`}:void 0,token:he,type:Ce}}constructor(h,x){(0,u.Z)(this,"githubAppCredentialsMux",void 0),(0,u.Z)(this,"token",void 0),this.githubAppCredentialsMux=h,this.token=x}}(0,u.Z)(lt,"create",S=>new lt(new xt(S),S.token));class nt{static fromIntegrations(h){const x=new Map;return h.github.list().forEach(j=>{const X=SingleInstanceGithubCredentialsProvider.create(j.config);x.set(j.config.host,X)}),new nt(x)}async getCredentials(h){const x=new URL(h.url),j=this.providers.get(x.host);if(!j)throw new Error(`There is no GitHub integration that matches ${h.url}. Please add a configuration for an integration.`);return j.getCredentials(h)}constructor(h){_define_property(this,"providers",void 0),this.providers=h}}class Oe{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){return Tt(B(h),"tree")}resolveEditUrl(h){return Tt(h,"edit")}constructor(h){(0,u.Z)(this,"integrationConfig",void 0),this.integrationConfig=h}}(0,u.Z)(Oe,"factory",({config:S})=>{var h;const x=se((h=S.getOptionalConfigArray("integrations.github"))!==null&&h!==void 0?h:[]);return c(x.map(j=>new Oe(j)),j=>j.config.host)});function Tt(S,h){return S.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(x,j,X,Ce)=>`//${j}/${X}/${Ce}/${h}/`)}const Kt=null;class Rt extends Oe{get config(){return super.config}constructor(h){super(h)}}(0,u.Z)(Rt,"factory",Oe.factory);const Pt=null,tn=null,Mt=null,ht="gitlab.com",Xe="https://gitlab.com/api/v4";function Bt(S){const h=S.getString("host");let x=S.getOptionalString("apiBaseUrl");const j=S.getOptionalString("token");let X=S.getOptionalString("baseUrl");if(x?x=(0,P.trimEnd)(x,"/"):h===ht&&(x=Xe),X?X=(0,P.trimEnd)(X,"/"):X=`https://${h}`,m(h)){if(!x||!y(x))throw new Error(`Invalid GitLab integration config, '${x}' is not a valid apiBaseUrl`);if(!y(X))throw new Error(`Invalid GitLab integration config, '${X}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${h}' is not a valid host`);return{host:h,token:j,apiBaseUrl:x,baseUrl:X}}function qt(S){const h=S.map(Bt);return h.some(x=>x.host===ht)||h.push({host:ht,apiBaseUrl:Xe,baseUrl:`https://${ht}`}),h}function An(S){let h="";return S.host!==ht&&(h=new URL(S.baseUrl).pathname),trimEnd(h,"/")}async function gn(S,h){const x=await Hn(S,h);return Qn(S,x,h).toString()}function wn(S){const{token:h=""}=S;return{headers:{"PRIVATE-TOKEN":h}}}function Qn(S,h,x){try{const j=new URL(S),X=j.pathname.split("/blob/").slice(1).join("/blob/"),[Ce,...he]=X.split("/"),Ne=getGitLabIntegrationRelativePath(x);return j.pathname=[...Ne?[Ne]:[],"api/v4/projects",h,"repository/files",encodeURIComponent(decodeURIComponent(he.join("/"))),"raw"].join("/"),j.search=`?ref=${Ce}`,j}catch(j){throw new Error(`Incorrect url: ${S}, ${j}`)}}async function Hn(S,h){const x=new URL(S);if(!x.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let j=x.pathname.split("/-/blob/")[0].split("/blob/")[0];const X=getGitLabIntegrationRelativePath(h);X&&(j=j.replace(X,""));const Ce=new URL(`${x.origin}${X}/api/v4/projects/${encodeURIComponent(j.replace(/^\//,""))}`),he=await fetch(Ce.toString(),wn(h)),Ne=await he.json();if(!he.ok)throw new Error(`GitLab Error '${Ne.error}', ${Ne.error_description}`);return Number(Ne.id)}catch(j){throw new Error(`Could not get GitLab project ID for: ${S}, ${j}`)}}class cn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){return B(h)}resolveEditUrl(h){return gr(h,"edit")}constructor(h){(0,u.Z)(this,"integrationConfig",void 0),this.integrationConfig=h}}(0,u.Z)(cn,"factory",({config:S})=>{var h;const x=qt((h=S.getOptionalConfigArray("integrations.gitlab"))!==null&&h!==void 0?h:[]);return c(x.map(j=>new cn(j)),j=>j.config.host)});function gr(S,h){return S.replace(/\/\-\/(blob|tree|edit)\//,`/-/${h}/`)}class mr{static fromConfig(h){return new mr({awsS3:R.factory({config:h}),azure:ze.factory({config:h}),bitbucket:Wt.factory({config:h}),bitbucketCloud:It.factory({config:h}),bitbucketServer:jn.factory({config:h}),gerrit:_.factory({config:h}),github:Oe.factory({config:h}),gitlab:cn.factory({config:h}),gitea:Zt.factory({config:h})})}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(h=>h.list())}byUrl(h){let x=Object.values(this.byType).map(j=>j.byUrl(h)).filter(Boolean);if(x.length>1){const j=x.filter(X=>!(X instanceof Wt));j.length!==0&&(x=j)}return x[0]}byHost(h){return Object.values(this.byType).map(x=>x.byHost(h)).find(Boolean)}resolveUrl(h){const x=this.byUrl(h.base);return x?x.resolveUrl(h):B(h)}resolveEditUrl(h){const x=this.byUrl(h);return x?x.resolveEditUrl(h):h}constructor(h){(0,u.Z)(this,"byType",void 0),this.byType=h}}},6290:function(St,$e,t){"use strict";var u={};t.r(u),t.d(u,{TechDocsPlugin:function(){return L.s4}});var r=t(52322),W=t(2784),P=t(28316),m=t(73557),y=t(60871);const c=(0,y.T0)({id:"plugin.techdocs.storageservice"}),B=(0,y.T0)({id:"plugin.techdocs.service"});var Te=t(92077),ue=t(95481),K=t(7476),$=t(93225),R=t(67896),O=t(65124),re=t(22478),q=t(85478),ne=t(68435),D=t(3482),T=t(42081),k=t(48431),L=t(89258),V=t(52943),Se=t(61886),We=t(13980),qe=t.n(We),H=t(47842);class _e{get(n){for(const s of this.holders){const l=s.get(n);if(l)return l}}constructor(...n){(0,H.Z)(this,"holders",void 0),this.holders=n}}var ut=t(51837);const ze=(0,ut.CT)("api-context"),ft=i=>{var n;const{apis:s,children:l}=i,f=(n=(0,W.useContext)(ze))===null||n===void 0?void 0:n.atVersion(1),A=f?new _e(s,f):s;return(0,r.jsx)(ze.Provider,{value:(0,ut.EI)({1:A}),children:l})};ft.propTypes={apis:qe().shape({get:qe().func.isRequired}).isRequired,children:qe().node};class Re{static validateFactories(n,s){for(const l of s){const f=[l],A=new Set;for(;f.length;){const Z=f.shift(),z=n.get(Z);if(z)for(const ae of Object.values(z.deps)){if(ae.id===l.id)throw new Error(`Circular dependency of api factory for ${l}`);A.has(ae)||(A.add(ae),f.push(ae))}}}}get(n){return this.load(n)}load(n,s=[]){const l=this.apis.get(n.id);if(l)return l;const f=this.factories.get(n);if(!f)return;if(s.includes(f.api))throw new Error(`Circular dependency of api factory for ${f.api}`);const A=this.loadDeps(n,f.deps,[...s,f.api]),Z=f.factory(A);return this.apis.set(n.id,Z),Z}loadDeps(n,s,l){const f={};for(const A in s)if(s.hasOwnProperty(A)){const Z=s[A],z=this.load(Z,l);if(!z)throw new Error(`No API factory available for dependency ${Z} of dependent ${n}`);f[A]=z}return f}constructor(n){(0,H.Z)(this,"factories",void 0),(0,H.Z)(this,"apis",void 0),this.factories=n,this.apis=new Map}}var ct;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(ct||(ct={}));class jt{register(n,s){const l=ct[n],f=this.factories.get(s.api.id);return f&&f.priority>=l?!1:(this.factories.set(s.api.id,{priority:l,factory:s}),!0)}get(n){const s=this.factories.get(n.id);if(s)return s.factory}getAllApis(){const n=new Set;for(const{factory:s}of this.factories.values())n.add(s.api);return n}constructor(){(0,H.Z)(this,"factories",new Map)}}function vt(i){return new Promise((n,s)=>{const l=i.width||500,f=i.height||700,A=window.screen.width/2-l/2,Z=window.screen.height/2-f/2,z=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${l},height=${f},top=${Z},left=${A}`);let ae="";if(!z||typeof z.closed=="undefined"||z.closed){const dt=new Error("Failed to open auth popup.");dt.name="PopupRejectedError",s(dt);return}const Ee=dt=>{if(dt.source!==z||dt.origin!==i.origin)return;const{data:bt}=dt;if(bt.type==="config_info"){ae=bt.targetOrigin;return}if(bt.type!=="authorization_response")return;const Ct=bt;if("error"in Ct){const Ft=new Error(Ct.error.message);Ft.name=Ct.error.name,s(Ft)}else n(Ct.response);He()},ke=setInterval(()=>{if(z.closed){const dt=`Login failed, ${ae&&ae!==window.location.origin?`Incorrect app origin, expected ${ae}`:"popup was closed"}`,bt=new Error(dt);bt.name="PopupClosedError",s(bt),He()}},100);function He(){window.removeEventListener("message",Ee),clearInterval(ke)}window.addEventListener("message",Ee)})}let gt=!1;function Et(i){return[...i].join(" ")}class Dt{async createSession(n){return n.instantPopup?this.enableExperimentalRedirectFlow?this.executeRedirect(n.scopes):this.showPopup(n.scopes):this.authRequester(n.scopes)}async refreshSession(){const n=await fetch(await this.buildUrl("/refresh",{optional:!0}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(l=>{throw new Error(`Auth refresh request failed, ${l}`)});if(!n.ok){const l=new Error(`Auth refresh request failed, ${n.statusText}`);throw l.status=n.status,l}const s=await n.json();if(s.error){const l=new Error(s.error.message);throw s.error.name&&(l.name=s.error.name),l}return await this.sessionTransform(s)}async removeSession(){const n=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(s=>{throw new Error(`Logout request failed, ${s}`)});if(!n.ok){const s=new Error(`Logout request failed, ${n.statusText}`);throw s.status=n.status,s}}async showPopup(n){const s=this.joinScopesFunc(n),l=await this.buildUrl("/start",{scope:s,origin:window.location.origin,flow:"popup"}),f=await vt({url:l,name:`${this.provider.title} Login`,origin:new URL(l).origin,width:450,height:730});return await this.sessionTransform(f)}async executeRedirect(n){const s=this.joinScopesFunc(n);return window.location.href=await this.buildUrl("/start",{scope:s,origin:window.location.origin,redirectUrl:window.location.href,flow:"redirect"}),new Promise(()=>{})}async buildUrl(n,s){const l=await this.discoveryApi.getBaseUrl("auth"),f=this.buildQueryString({...s,env:this.environment});return`${l}/${this.provider.id}${n}${f}`}buildQueryString(n){if(!n)return"";const s=Object.entries(n).map(([l,f])=>{if(typeof f=="string")return`${encodeURIComponent(l)}=${encodeURIComponent(f)}`;if(f)return encodeURIComponent(l)}).filter(Boolean).join("&");return s?`?${s}`:""}constructor(n){(0,H.Z)(this,"discoveryApi",void 0),(0,H.Z)(this,"environment",void 0),(0,H.Z)(this,"provider",void 0),(0,H.Z)(this,"joinScopesFunc",void 0),(0,H.Z)(this,"authRequester",void 0),(0,H.Z)(this,"sessionTransform",void 0),(0,H.Z)(this,"enableExperimentalRedirectFlow",void 0);const{configApi:s,discoveryApi:l,environment:f,provider:A,joinScopes:Z=Et,oauthRequestApi:z,sessionTransform:ae=ke=>ke}=n;!gt&&!s&&(console.warn("DEPRECATION WARNING: Authentication providers require a configApi instance to configure the authentication flow. Please provide one to the authentication provider constructor."),gt=!0);var Ee;this.enableExperimentalRedirectFlow=s&&(Ee=s.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&Ee!==void 0?Ee:!1,this.authRequester=z.createAuthRequester({provider:A,onAuthRequest:async ke=>this.enableExperimentalRedirectFlow?this.executeRedirect(ke):this.showPopup(ke)}),this.discoveryApi=l,this.environment=f,this.provider=A,this.joinScopesFunc=Z,this.sessionTransform=ae}}function Ge(i,n){for(const s of n)if(!i.has(s))return!1;return!0}class Wt{sessionExistsAndHasScope(n,s){if(!n)return!1;if(!s||this.options.sessionScopes===void 0)return!0;const l=this.options.sessionScopes(n);return Ge(l,s)}getExtendedScope(n,s){const l=new Set(this.options.defaultScopes);if(n&&this.options.sessionScopes!==void 0){const f=this.options.sessionScopes(n);for(const A of f)l.add(A)}if(s)for(const f of s)l.add(f);return l}constructor(n){(0,H.Z)(this,"options",void 0),this.options=n}}var xe=t(82394),pe=t.n(xe);let De=Symbol.observable;class Je{[De](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(s=>s.next(n))}error(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(s=>s.error(n))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,s,l){const f=typeof n=="function"?{next:n,error:s,complete:l}:n;return this.observable.subscribe(f)}constructor(){(0,H.Z)(this,"isClosed",!1),(0,H.Z)(this,"terminatingError",void 0),(0,H.Z)(this,"observable",new(pe())(n=>this.isClosed?(this.terminatingError?n.error(this.terminatingError):n.complete(),()=>{}):(this.subscribers.add(n),()=>{this.subscribers.delete(n)}))),(0,H.Z)(this,"subscribers",new Set)}}let At=Symbol.observable;class wt{[At](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=n,this.subscribers.forEach(s=>s.next(n))}error(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(s=>s.error(n))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,s,l){const f=typeof n=="function"?{next:n,error:s,complete:l}:n;return this.observable.subscribe(f)}constructor(n){(0,H.Z)(this,"isClosed",void 0),(0,H.Z)(this,"currentValue",void 0),(0,H.Z)(this,"terminatingError",void 0),(0,H.Z)(this,"observable",void 0),(0,H.Z)(this,"subscribers",new Set),this.isClosed=!1,this.currentValue=n,this.terminatingError=void 0,this.observable=new(pe())(s=>this.isClosed?(this.terminatingError?s.error(this.terminatingError):s.complete(),()=>{}):(s.next(this.currentValue),this.subscribers.add(s),()=>{this.subscribers.delete(s)}))}}class rt{setIsSignedIn(n){this.signedIn!==n&&(this.signedIn=n,this.subject.next(this.signedIn?y.sM.SignedIn:y.sM.SignedOut))}sessionState$(){return this.subject}constructor(){(0,H.Z)(this,"subject",new wt(y.sM.SignedOut)),(0,H.Z)(this,"signedIn",!1)}}class yt{async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const l=await this.collapsedSessionRefresh(),f=this.sessionScopesFunc(this.currentSession),A=this.sessionScopesFunc(l);return Ge(A,f)&&(this.currentSession=l),l}catch(l){if(n.optional)return;throw l}}if(!this.currentSession&&!n.instantPopup)try{const s=await this.collapsedSessionRefresh();return this.currentSession=s,this.getSession(n)}catch{}if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession();try{const n=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),n}finally{delete this.refreshPromise}}constructor(n){(0,H.Z)(this,"connector",void 0),(0,H.Z)(this,"helper",void 0),(0,H.Z)(this,"sessionScopesFunc",void 0),(0,H.Z)(this,"sessionShouldRefreshFunc",void 0),(0,H.Z)(this,"stateTracker",new rt),(0,H.Z)(this,"refreshPromise",void 0),(0,H.Z)(this,"currentSession",void 0);const{connector:s,defaultScopes:l=new Set,sessionScopes:f,sessionShouldRefresh:A}=n;this.connector=s,this.sessionScopesFunc=f,this.sessionShouldRefreshFunc=A,this.helper=new Wt({sessionScopes:f,defaultScopes:l})}}class Ot{setSession(n){this.currentSession=n,this.stateTracker.setIsSignedIn(Boolean(n))}async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes))return this.currentSession;if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(n){_define_property(this,"connector",void 0),_define_property(this,"helper",void 0),_define_property(this,"stateTracker",new SessionStateTracker),_define_property(this,"currentSession",void 0);const{connector:s,defaultScopes:l=new Set,sessionScopes:f}=n;this.connector=s,this.helper=new SessionScopeHelper({sessionScopes:f,defaultScopes:l})}}const Gt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class It{static create(n){const{configApi:s,discoveryApi:l,environment:f="development",provider:A=Gt,oauthRequestApi:Z,defaultScopes:z=[],scopeTransform:ae=He=>He}=n,Ee=new Dt({configApi:s,discoveryApi:l,environment:f,provider:A,oauthRequestApi:Z,sessionTransform(He){return{...He,providerInfo:{idToken:He.providerInfo.idToken,accessToken:He.providerInfo.accessToken,scopes:It.normalizeScopes(ae,He.providerInfo.scope),expiresAt:new Date(Date.now()+He.providerInfo.expiresInSeconds*1e3)}}}}),ke=new yt({connector:Ee,defaultScopes:new Set(z),sessionScopes:He=>He.providerInfo.scopes,sessionShouldRefresh:He=>(He.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new It({sessionManager:ke,scopeTransform:ae})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(n,s){const l=It.normalizeScopes(this.scopeTransform,n),f=await this.sessionManager.getSession({...s,scopes:l});var A;return(A=f==null?void 0:f.providerInfo.accessToken)!==null&&A!==void 0?A:""}async getIdToken(n={}){const s=await this.sessionManager.getSession({...n,scopes:new Set(["openid"])});var l;return(l=s==null?void 0:s.providerInfo.idToken)!==null&&l!==void 0?l:""}async getBackstageIdentity(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.backstageIdentity}async getProfile(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.profile}static normalizeScopes(n,s){if(!s)return new Set;const l=Array.isArray(s)?s:s.split(/[\s|,]/).filter(Boolean);return new Set(n(l))}constructor(n){(0,H.Z)(this,"sessionManager",void 0),(0,H.Z)(this,"scopeTransform",void 0),this.sessionManager=n.sessionManager,this.scopeTransform=n.scopeTransform}}const on={id:"github",title:"GitHub",icon:()=>null};class Ut{static create(n){const{configApi:s,discoveryApi:l,environment:f="development",provider:A=on,oauthRequestApi:Z,defaultScopes:z=["read:user"]}=n;return It.create({configApi:s,discoveryApi:l,oauthRequestApi:Z,provider:A,environment:f,defaultScopes:z})}}const Vt={id:"gitlab",title:"GitLab",icon:()=>null};class zn{static create(n){const{configApi:s,discoveryApi:l,environment:f="development",provider:A=Vt,oauthRequestApi:Z,defaultScopes:z=["read_user"]}=n;return It.create({configApi:s,discoveryApi:l,oauthRequestApi:Z,provider:A,environment:f,defaultScopes:z})}}const In={id:"google",title:"Google",icon:()=>null},an="https://www.googleapis.com/auth/";class Fn{static create(n){const{configApi:s,discoveryApi:l,oauthRequestApi:f,environment:A="development",provider:Z=In,defaultScopes:z=["openid",`${an}userinfo.email`,`${an}userinfo.profile`]}=n;return It.create({configApi:s,discoveryApi:l,oauthRequestApi:f,provider:Z,environment:A,defaultScopes:z,scopeTransform(ae){return ae.map(Ee=>Ee==="openid"?Ee:Ee==="profile"||Ee==="email"?`${an}userinfo.${Ee}`:Ee.startsWith(an)?Ee:`${an}${Ee}`)}})}}const jn={id:"okta",title:"Okta",icon:()=>null},Un=new Set(["openid","profile","email","phone","address","groups","offline_access"]),Pn="okta.";class Jn{static create(n){const{configApi:s,discoveryApi:l,environment:f="development",provider:A=jn,oauthRequestApi:Z,defaultScopes:z=["openid","email","profile","offline_access"]}=n;return It.create({configApi:s,discoveryApi:l,oauthRequestApi:Z,provider:A,environment:f,defaultScopes:z,scopeTransform(ae){return ae.map(Ee=>Un.has(Ee)||Ee.startsWith(Pn)?Ee:`${Pn}${Ee}`)}})}}var at=t(30195);const Mn=at.z.object({profile:at.z.object({email:at.z.string().optional(),displayName:at.z.string().optional(),picture:at.z.string().optional()}),backstageIdentity:at.z.object({token:at.z.string(),identity:at.z.object({type:at.z.literal("user"),userEntityRef:at.z.string(),ownershipEntityRefs:at.z.array(at.z.string())})})}),Ln={id:"saml",title:"SAML",icon:()=>null};class Wn{static create(n){const{discoveryApi:s,environment:l="development",provider:f=Ln}=n,A=new DirectAuthConnector({discoveryApi:s,environment:l,provider:f}),Z=new StaticAuthSessionManager({connector:A}),z=new AuthSessionStore({manager:Z,storageKey:`${f.id}Session`,schema:samlSessionSchema});return new Wn(z)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.backstageIdentity}async getProfile(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.profile}constructor(n){_define_property(this,"sessionManager",void 0),this.sessionManager=n}}const En={id:"microsoft",title:"Microsoft",icon:()=>null};class fn{static create(n){const{configApi:s,environment:l="development",provider:f=En,oauthRequestApi:A,discoveryApi:Z,defaultScopes:z=["openid","offline_access","profile","email","User.Read"]}=n;return It.create({configApi:s,discoveryApi:Z,oauthRequestApi:A,provider:f,environment:l,defaultScopes:z})}}const vn={id:"onelogin",title:"onelogin",icon:()=>null},kn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),ln="onelogin.";class Vn{static create(n){const{configApi:s,discoveryApi:l,environment:f="development",provider:A=vn,oauthRequestApi:Z}=n;return It.create({configApi:s,discoveryApi:l,oauthRequestApi:Z,provider:A,environment:f,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(z){return z.map(ae=>kn.has(ae)||ae.startsWith(ln)?ae:`${ln}${ae}`)}})}}const ge={id:"bitbucket",title:"Bitbucket",icon:()=>null};class ie{static create(n){const{configApi:s,discoveryApi:l,environment:f="development",provider:A=ge,oauthRequestApi:Z,defaultScopes:z=["team"]}=n;return It.create({configApi:s,discoveryApi:l,oauthRequestApi:Z,provider:A,environment:f,defaultScopes:z})}}const Le={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class Fe{static create(n){const{configApi:s,discoveryApi:l,environment:f="development",provider:A=Le,oauthRequestApi:Z,defaultScopes:z=["PROJECT_ADMIN"]}=n;return It.create({configApi:s,discoveryApi:l,oauthRequestApi:Z,provider:A,environment:f,defaultScopes:z})}}const Ke={id:"atlassian",title:"Atlassian",icon:()=>null};class _{static create(n){const{configApi:s,discoveryApi:l,environment:f="development",provider:A=Ke,oauthRequestApi:Z}=n;return It.create({configApi:s,discoveryApi:l,oauthRequestApi:Z,provider:A,environment:f})}}class F{post(n){this.subject.next(n)}alert$(){return this.subject}constructor(){(0,H.Z)(this,"subject",new Je)}}class fe{captureEvent(n){}}const je="theme";class Qe{static createWithStorage(n){const s=new Qe(n);if(!window.localStorage)return s;var l;const f=(l=window.localStorage.getItem(je))!==null&&l!==void 0?l:void 0;return s.setActiveThemeId(f),s.activeThemeId$().subscribe(A=>{A?window.localStorage.setItem(je,A):window.localStorage.removeItem(je)}),window.addEventListener("storage",A=>{if(A.key===je){var Z;const z=(Z=localStorage.getItem(je))!==null&&Z!==void 0?Z:void 0;s.setActiveThemeId(z)}}),s}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(n){this.activeThemeId=n,this.subject.next(n)}constructor(n){(0,H.Z)(this,"themes",void 0),(0,H.Z)(this,"activeThemeId",void 0),(0,H.Z)(this,"subject",void 0),this.themes=n,this.subject=new wt(void 0)}}var et=t(9850),Zt=t.n(et),Ht=t(12782),sn=t.n(Ht);const ee=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function Q(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function se(i){if(i===null)return"null";if(Array.isArray(i))return"array";const n=typeof i;return n==="number"&&isNaN(i)?"nan":n==="string"&&i===""?"empty-string":n}const g={type(i,n,s,l){return`Invalid type in config for key '${i}' in '${n}', got ${s}, wanted ${l}`},missing(i){return`Missing required config value at '${i}'`},convert(i,n,s){return`Unable to convert config value for key '${i}' in '${n}' to a ${s}`}};class w{static fromConfigs(n){return n.length===0?new w(void 0):n.reduce((s,{data:l,context:f,filteredKeys:A,deprecatedKeys:Z})=>{const z=new w(l,f,s);if(z.filteredKeys=A,Z)for(const{key:ae,description:Ee}of Z)console.warn(`The configuration key '${ae}' of ${f} is deprecated and may be removed soon. ${Ee||""}`);return z},void 0)}has(n){var s;if(this.readValue(n)!==void 0)return!0;var f;return(f=(s=this.fallback)===null||s===void 0?void 0:s.has(n))!==null&&f!==void 0?f:!1}keys(){var n;const s=this.data?Object.keys(this.data):[];var l;const f=(l=(n=this.fallback)===null||n===void 0?void 0:n.keys())!==null&&l!==void 0?l:[];return[...new Set([...s,...f])]}get(n){const s=this.getOptional(n);if(s===void 0)throw new Error(g.missing(this.fullKey(n!=null?n:"")));return s}getOptional(n){var s;const l=Zt()(this.readValue(n)),f=(s=this.fallback)===null||s===void 0?void 0:s.getOptional(n);if(l===void 0){if(!1)var A;return f}else if(f===void 0)return l;return sn()({},{value:f},{value:l},(Z,z)=>!Q(z)||!Q(Z)?z:void 0).value}getConfig(n){const s=this.getOptionalConfig(n);if(s===void 0)throw new Error(g.missing(this.fullKey(n)));return s}getOptionalConfig(n){var s;const l=this.readValue(n),f=(s=this.fallback)===null||s===void 0?void 0:s.getOptionalConfig(n);if(Q(l))return this.copy(l,n,f);if(l!==void 0)throw new TypeError(g.type(this.fullKey(n),this.context,se(l),"object"));return f}getConfigArray(n){const s=this.getOptionalConfigArray(n);if(s===void 0)throw new Error(g.missing(this.fullKey(n)));return s}getOptionalConfigArray(n){const s=this.readConfigValue(n,f=>{if(!Array.isArray(f))return{expected:"object-array"};for(const[A,Z]of f.entries())if(!Q(Z))return{expected:"object-array",value:Z,key:`${n}[${A}]`};return!0});if(!s){if(!1)var l;return}return s.map((f,A)=>this.copy(f,`${n}[${A}]`))}getNumber(n){const s=this.getOptionalNumber(n);if(s===void 0)throw new Error(g.missing(this.fullKey(n)));return s}getOptionalNumber(n){const s=this.readConfigValue(n,f=>typeof f=="number"||typeof f=="string"||{expected:"number"});if(typeof s=="number"||s===void 0)return s;const l=Number(s);if(!Number.isFinite(l))throw new Error(g.convert(this.fullKey(n),this.context,"number"));return l}getBoolean(n){const s=this.getOptionalBoolean(n);if(s===void 0)throw new Error(g.missing(this.fullKey(n)));return s}getOptionalBoolean(n){const s=this.readConfigValue(n,f=>typeof f=="boolean"||typeof f=="number"||typeof f=="string"||{expected:"boolean"});if(typeof s=="boolean"||s===void 0)return s;const l=String(s).trim();if(/^(?:y|yes|true|1|on)$/i.test(l))return!0;if(/^(?:n|no|false|0|off)$/i.test(l))return!1;throw new Error(g.convert(this.fullKey(n),this.context,"boolean"))}getString(n){const s=this.getOptionalString(n);if(s===void 0)throw new Error(g.missing(this.fullKey(n)));return s}getOptionalString(n){return this.readConfigValue(n,s=>typeof s=="string"&&s!==""||{expected:"string"})}getStringArray(n){const s=this.getOptionalStringArray(n);if(s===void 0)throw new Error(g.missing(this.fullKey(n)));return s}getOptionalStringArray(n){return this.readConfigValue(n,s=>{if(!Array.isArray(s))return{expected:"string-array"};for(const[l,f]of s.entries())if(typeof f!="string"||f==="")return{expected:"string-array",value:f,key:`${n}[${l}]`};return!0})}fullKey(n){return`${this.prefix}${this.prefix?".":""}${n}`}copy(n,s,l){const f=new w(n,this.context,l,this.fullKey(s));return f.filteredKeys=this.filteredKeys,f}readConfigValue(n,s){const l=this.readValue(n);if(l===void 0){var f;if(!1)var A;return(f=this.fallback)===null||f===void 0?void 0:f.readConfigValue(n,s)}const Z=s(l);if(Z!==!0){const{key:z=n,value:ae=l,expected:Ee}=Z;throw new TypeError(g.type(this.fullKey(z),this.context,se(ae),Ee))}return l}readValue(n){const s=n?n.split("."):[];for(const f of s)if(!ee.test(f))throw new TypeError(`Invalid config key '${n}'`);if(this.data===void 0)return;let l=this.data;for(const[f,A]of s.entries())if(Q(l))l=l[A];else if(l!==void 0){const Z=this.fullKey(s.slice(0,f).join("."));throw new TypeError(g.type(Z,this.context,se(l),"object"))}return l}constructor(n,s="mock-config",l,f=""){(0,H.Z)(this,"data",void 0),(0,H.Z)(this,"context",void 0),(0,H.Z)(this,"fallback",void 0),(0,H.Z)(this,"prefix",void 0),(0,H.Z)(this,"filteredKeys",void 0),(0,H.Z)(this,"notifiedFilteredKeys",void 0),this.data=n,this.context=s,this.fallback=l,this.prefix=f,this.notifiedFilteredKeys=new Set}}const Y="Invalid discovery URL pattern,";class J{static compile(n){const s=n.split(/\{\{\s*pluginId\s*\}\}/),l=s.join("pluginId");let f;try{f=new URL(l)}catch{throw new Error(`${Y} URL '${l}' is invalid`)}if(f.hash)throw new Error(`${Y} URL must not have a hash`);if(f.search)throw new Error(`${Y} URL must not have a query`);if(l.endsWith("/"))throw new Error(`${Y} URL must not end with a slash`);return new J(s)}async getBaseUrl(n){return this.parts.join(n)}constructor(n){(0,H.Z)(this,"parts",void 0),this.parts=n}}class me{post(n,s){return s!=null&&s.hidden||this.alertApi.post({message:n.message,severity:"error"}),this.errorApi.post(n,s)}error$(){return this.errorApi.error$()}constructor(n,s){(0,H.Z)(this,"alertApi",void 0),(0,H.Z)(this,"errorApi",void 0),this.alertApi=n,this.errorApi=s}}class ve{post(n,s){this.subject.next({error:n,context:s})}error$(){return this.subject}constructor(){(0,H.Z)(this,"subject",new Je)}}class Ue{static forward(n,s){window.addEventListener("unhandledrejection",l=>{n.post(l.reason,s)})}}function ot(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 tt{registerFlag(n){ot(n.name),this.registeredFeatureFlags.push(n)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(n){return this.flags||(this.flags=this.load()),this.flags.get(n)===y.CL.Active}save(n){this.flags||(this.flags=this.load()),n.merge||this.flags.clear();for(const[l,f]of Object.entries(n.states))this.flags.set(l,f);const s=Array.from(this.flags.entries()).filter(([,l])=>l===y.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(s)))}load(){try{const n=window.localStorage.getItem("featureFlags");if(!n)return new Map;const s=JSON.parse(n);if(typeof s!="object"||s===null||Array.isArray(s))return new Map;const l=Object.entries(s).filter(([f,A])=>(ot(f),A===y.CL.Active));return new Map(l)}catch{return new Map}}constructor(){(0,H.Z)(this,"registeredFeatureFlags",[]),(0,H.Z)(this,"flags",void 0)}}function xt(i){let n=i.baseImplementation||t.g.fetch;var s;const l=[(s=i.middleware)!==null&&s!==void 0?s:[]].flat().reverse();for(const f of l)n=f.apply(n);return{fetch:n}}class lt{static create(n){var s,l;const f=nt(n),A=((s=n.header)===null||s===void 0?void 0:s.name)||"authorization",Z=((l=n.header)===null||l===void 0?void 0:l.value)||(z=>`Bearer ${z}`);return new lt(n.identityApi,f,A,Z)}apply(n){return async(s,l)=>{const f=new Request(s,l),{token:A}=await this.identityApi.getCredentials();return f.headers.get(this.headerName)||typeof A!="string"||!A||!this.allowUrl(f.url)?n(s,l):(f.headers.set(this.headerName,this.headerValue(A)),n(f))}}constructor(n,s,l,f){(0,H.Z)(this,"identityApi",void 0),(0,H.Z)(this,"allowUrl",void 0),(0,H.Z)(this,"headerName",void 0),(0,H.Z)(this,"headerValue",void 0),this.identityApi=n,this.allowUrl=s,this.headerName=l,this.headerValue=f}}function nt(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?Oe(i.urlPrefixAllowlist):i.config?Oe([i.config.getString("backend.baseUrl")]):()=>!1}function Oe(i){const n=i.map(s=>s.replace(/\/$/,""));return s=>n.some(l=>s===l||s.startsWith(`${l}/`))}function Tt(i,n){return!n||n==="/"?i:`${i.replace(/\/$/,"")}/${n.replace(/^\//,"")}`}class Kt{apply(n){return async(s,l)=>{const f=new Request(s,l),A="plugin://";if(!f.url.startsWith(A))return n(s,l);const{hostname:Z,pathname:z,search:ae,hash:Ee,username:ke,password:He}=new URL(`http://${f.url.substring(A.length)}`);let dt=await this.discoveryApi.getBaseUrl(Z);if(ke||He){const Ct=new URL(dt),Ft=`${ke}${He?`:${He}`:""}@`;dt=`${Ct.protocol}//${Ft}${Ct.host}${Ct.pathname}`}const bt=`${Tt(dt,z)}${ae}${Ee}`;return n(bt,typeof s=="string"||Rt(s)?l:s)}}constructor(n){(0,H.Z)(this,"discoveryApi",void 0),this.discoveryApi=n}}function Rt(i){return typeof i=="object"&&(i==null?void 0:i.constructor)===URL}class Pt{static resolvePluginProtocol(n){return new Kt(n.discoveryApi)}static injectIdentityAuth(n){return lt.create(n)}constructor(){}}function tn(i,n){for(const s of n)if(!i.has(s))return!1;return!0}function Mt(i,...n){const s=new Set(i);for(const l of n)for(const f of l)s.add(f);return s}class ht{request(n){return new Promise((s,l)=>{this.requests.push({scopes:n,resolve:s,reject:l}),this.subject.next(this.getCurrentPending())})}resolve(n,s){this.requests=this.requests.filter(l=>tn(n,l.scopes)?(l.resolve(s),!1):!0),this.subject.next(this.getCurrentPending())}reject(n){this.requests.forEach(s=>s.reject(n)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const n=this.requests.length===0?void 0:this.requests.slice(1).reduce((s,l)=>Mt(s,l.scopes),this.requests[0].scopes);return{scopes:n,resolve:s=>{n&&this.resolve(n,s)},reject:s=>{n&&this.reject(s)}}}constructor(){(0,H.Z)(this,"requests",[]),(0,H.Z)(this,"subject",new wt(this.getCurrentPending()))}}class Xe{createAuthRequester(n){const s=new ht,l=this.handlerCount;return this.handlerCount++,s.pending().subscribe({next:f=>{const A=this.currentRequests.slice(),Z=this.makeAuthRequest(f,n);Z?A[l]=Z:delete A[l],this.currentRequests=A,this.subject.next(A.filter(Boolean))}}),f=>s.request(f)}makeAuthRequest(n,s){const{scopes:l}=n;if(l)return{provider:s.provider,trigger:async()=>{const f=await s.onAuthRequest(l);n.resolve(f)},reject:()=>{const f=new Error("Login failed, rejected by user");f.name="RejectedError",n.reject(f)}}}authRequest$(){return this.subject}constructor(){(0,H.Z)(this,"subject",new wt([])),(0,H.Z)(this,"currentRequests",[]),(0,H.Z)(this,"handlerCount",0)}}const Bt=new Map;class qt{static create(n){var s;return new qt((s=n.namespace)!==null&&s!==void 0?s:"",n.errorApi)}static addStorageEventListener(){window.addEventListener("storage",n=>{for(const[l,f]of Bt.entries()){var s;!((s=n.key)===null||s===void 0)&&s.startsWith(l)&&f.handleStorageChange(n.key)}})}get(n){return this.snapshot(n).value}snapshot(n){let s,l="absent";try{const f=localStorage.getItem(this.getKeyName(n));f&&(s=JSON.parse(f,(A,Z)=>(typeof Z=="object"&&Z!==null&&Object.freeze(Z),Z)),l="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${n}`))}return{key:n,value:s,presence:l}}forBucket(n){const s=`${this.namespace}/${n}`;return Bt.has(s)||Bt.set(s,new qt(s,this.errorApi)),Bt.get(s)}async set(n,s){localStorage.setItem(this.getKeyName(n),JSON.stringify(s)),this.notifyChanges(n)}async remove(n){localStorage.removeItem(this.getKeyName(n)),this.notifyChanges(n)}observe$(n){return qt.hasSubscribed||(qt.addStorageEventListener(),qt.hasSubscribed=!0),this.observable.filter(({key:s})=>s===n)}handleStorageChange(n){if(!(n!=null&&n.startsWith(this.namespace)))return;const s=n==null?void 0:n.slice(`${this.namespace}/`.length);s.includes("/")||this.notifyChanges(decodeURIComponent(s))}getKeyName(n){return`${this.namespace}/${encodeURIComponent(n)}`}notifyChanges(n){const s=this.snapshot(n);for(const l of this.subscribers)l.next(s)}constructor(n,s){(0,H.Z)(this,"namespace",void 0),(0,H.Z)(this,"errorApi",void 0),(0,H.Z)(this,"subscribers",void 0),(0,H.Z)(this,"observable",void 0),this.namespace=n,this.errorApi=s,this.subscribers=new Set,this.observable=new(pe())(l=>(this.subscribers.add(l),()=>{this.subscribers.delete(l)}))}}(0,H.Z)(qt,"hasSubscribed",!1);const An=(0,W.createContext)(void 0);function gn(){const[i]=(0,m.is)((0,r.jsx)(m.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!i.index}var wn=t(84800);const Qn=(i,n)=>{try{var s,l;const f=(0,wn.fp)(n,{pathname:i}),A=(s=f==null?void 0:f.filter(z=>{var ae;return((ae=z==null?void 0:z.route.routeRefs)===null||ae===void 0?void 0:ae.size)>0}).pop())===null||s===void 0?void 0:s.route;if(!A)return{};let Z;return A.routeRefs.size===1&&(Z=A.routeRefs.values().next().value),{extension:"App",pluginId:((l=A.plugin)===null||l===void 0?void 0:l.getId())||"root",...Z?{routeRef:Z.id}:{}}}catch{return{}}},Hn=({pathname:i,search:n,hash:s})=>{const l=(0,y.z$)();return(0,W.useEffect)(()=>{l.captureEvent("navigate",`${i}${n}${s}`)},[l,i,n,s]),null},cn=({routeObjects:i})=>{const{pathname:n,search:s,hash:l}=(0,m.TH)();return(0,r.jsx)(y.fC,{attributes:Qn(n,i),children:(0,r.jsx)(Hn,{pathname:n,search:s,hash:l})})};function gr(i){return gn()?mr(i):""}function mr(i){var n;let{pathname:s}=new URL((n=i.getOptionalString("app.baseUrl"))!==null&&n!==void 0?n:"/","http://sample.dev");return s=s.replace(/\/*$/,""),s}function S({component:i,appIdentityProxy:n,children:s}){const[l,f]=(0,W.useState)(),A=(0,y.h_)(y.Ds),Z=gr(A);return l?(n.setTarget(l,{signOutTargetUrl:Z||"/"}),(0,r.jsx)(r.Fragment,{children:s})):(0,r.jsx)(i,{onSignInSuccess:f})}function h(i){const{Router:n,SignInPage:s}=(0,y.qD)().getComponents(),l=(0,y.h_)(y.Ds),f=mr(l),A=`${f}/*`,Z=(0,W.useContext)(An);if(!Z)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:z,appIdentityProxy:ae}=Z;return s?gn()?(0,r.jsxs)(n,{children:[(0,r.jsx)(cn,{routeObjects:z}),(0,r.jsx)(S,{component:s,appIdentityProxy:ae,children:(0,r.jsx)(m.Z5,{children:(0,r.jsx)(m.AW,{path:A,element:(0,r.jsx)(r.Fragment,{children:i.children})})})})]}):(0,r.jsxs)(n,{basename:f,children:[(0,r.jsx)(cn,{routeObjects:z}),(0,r.jsx)(S,{component:s,appIdentityProxy:ae,children:i.children})]}):(ae.setTarget({getUserId:()=>"guest",getIdToken:async()=>{},getProfile:()=>({email:"guest@example.com",displayName:"Guest"}),getProfileInfo:async()=>({email:"guest@example.com",displayName:"Guest"}),getBackstageIdentity:async()=>({type:"user",userEntityRef:"user:default/guest",ownershipEntityRefs:["user:default/guest"]}),getCredentials:async()=>({}),signOut:async()=>{}},{signOutTargetUrl:f||"/"}),gn()?(0,r.jsxs)(n,{children:[(0,r.jsx)(cn,{routeObjects:z}),(0,r.jsx)(m.Z5,{children:(0,r.jsx)(m.AW,{path:A,element:(0,r.jsx)(r.Fragment,{children:i.children})})})]}):(0,r.jsxs)(n,{basename:f,children:[(0,r.jsx)(cn,{routeObjects:z}),i.children]}))}var x=t(90383),j=t(22504),X=t(69866),Ce=t(64279);function he(i){const n={};for(const l in i.collectors)i.collectors.hasOwnProperty(l)&&(n[l]=i.collectors[l]());const s=[{node:W.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;s.length!==0;){const{node:l,parent:f,contexts:A}=s.shift();W.Children.forEach(l,Z=>{if(!(0,W.isValidElement)(Z))return;const z={};for(const ae in n)if(n.hasOwnProperty(ae)){const Ee=n[ae];z[ae]=Ee.visit(Ee.accumulator,Z,f,A[ae])}for(const ae of i.discoverers){const Ee=ae(Z);Ee&&s.push({node:Ee,parent:Z,contexts:z})}})}return Object.fromEntries(Object.entries(n).map(([l,f])=>[l,f.accumulator]))}function Ne(i,n){return()=>({accumulator:i(),visit:n})}function pt(i){var n;return(n=i.props)===null||n===void 0?void 0:n.children}function zt(i){var n,s;if(!((n=i.props)===null||n===void 0)&&n.path&&(!((s=i.props)===null||s===void 0)&&s.element)){var l;return(l=i.props)===null||l===void 0?void 0:l.element}}const dn=Ne(()=>new Set,(i,n)=>{const s=(0,y.IY)(n,"core.plugin");s&&i.add(s)}),On=i=>{const{children:n}=i,s=(0,y.h_)(y.W0),l="with"in i?s.isActive(i.with):!s.isActive(i.without);return(0,r.jsx)(r.Fragment,{children:l?n:null})};(0,y.R5)(On,"core.featureFlagged",!0);const vr={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function Pr(i){const n=i;if(n!=null&&n.type){var s,l;return(l=(s=n.type.displayName)!==null&&s!==void 0?s:n.type.name)!==null&&l!==void 0?l:String(n.type)}return String(n)}function eo(i,n=new Array){return W.Children.forEach(i,s=>{if(!(0,W.isValidElement)(s))return;const l=(0,y.IY)(s,"core.mountPoint");if(l){const f=(0,y.IY)(s,"core.plugin");n.push({routeRef:l,plugin:f})}eo(s.props.children,n)}),n}const jo=Ne(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,s,l)=>{var f,A;if(l!=null&&l.isElementAncestor)return l;if((s==null?void 0:s.props.element)===n)return{...l,isElementAncestor:!0};const Z=(f=n.props)===null||f===void 0?void 0:f.path,z=(0,y.IY)(n,"core.mountPoint");if(z&&Z)throw new Error(`Path property may not be set directly on a routable extension "${Pr(n)}"`);var ae;const Ee=(ae=l==null||(A=l.obj)===null||A===void 0?void 0:A.children)!==null&&ae!==void 0?ae:i.objects;if(Z!==void 0){if(typeof Z!="string")throw new Error(`Element path must be a string at "${Pr(n)}"`);const bt=Z.startsWith("/")?Z.slice(1):Z,Ct=n.props.element;if((0,y.IY)(n,"core.gatherMountPoints")){var ke;if(Ct)throw new Error(`Mount point gatherers may not have an element prop "${Pr(n)}"`);const Ft={path:bt,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((ke=n.props)===null||ke===void 0?void 0:ke.caseSensitive),children:[vr],plugin:void 0};return Ee.push(Ft),{obj:Ft,gatherPath:bt,routeRef:l==null?void 0:l.routeRef,gatherRouteRef:l==null?void 0:l.routeRef}}if(Ct){var He;const[Ft,...Nt]=eo(Ct);if(Nt.length>0)throw new Error(`Route element with path "${Z}" may not contain multiple routable extensions`);if(!Ft)return l;const{routeRef:$n,plugin:tr}=Ft,nr={path:bt,element:"mounted",routeRefs:new Set([$n]),caseSensitive:Boolean((He=n.props)===null||He===void 0?void 0:He.caseSensitive),children:[vr],plugin:tr};return Ee.push(nr),i.paths.set($n,bt),i.parents.set($n,l==null?void 0:l.routeRef),{obj:nr,routeRef:$n!=null?$n:l==null?void 0:l.routeRef,gatherPath:bt,gatherRouteRef:l==null?void 0:l.gatherRouteRef}}}if(z){var dt;if((l==null?void 0:l.gatherPath)===void 0)throw new Error(`Routable extension "${Pr(n)}" with mount point "${z}" must be assigned a path`);return l==null||(dt=l.obj)===null||dt===void 0||dt.routeRefs.add(z),i.paths.set(z,l.gatherPath),i.parents.set(z,l==null?void 0:l.gatherRouteRef),{...l,routeRef:z}}return l}),ir=Ne(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,s,l)=>{var f,A,Z;if((s==null?void 0:s.props.element)===n)return l;let z=l==null?void 0:l.obj,ae=l==null?void 0:l.routeRef,Ee=l==null?void 0:l.sticky;const ke=(f=n.props)===null||f===void 0?void 0:f.path;var He;const dt=(He=z==null?void 0:z.children)!==null&&He!==void 0?He:i.objects,bt=Boolean((A=n.props)===null||A===void 0?void 0:A.caseSensitive);let Ct=l==null?void 0:l.path;if((0,y.IY)(n,"core.gatherMountPoints")){if(!ke)throw new Error("Mount point gatherer must have a path");Ct=ke}const Ft=(Z=n.props)===null||Z===void 0?void 0:Z.element;let Nt=(0,y.IY)(n,"core.mountPoint");if(!Nt&&(0,W.isValidElement)(Ft)&&(Nt=(0,y.IY)(Ft,"core.mountPoint")),Nt){let nr=ke;if(Ct&&(nr?Ct=void 0:nr=Ct),!nr)throw new Error("Mounted routable extension must have a path");i.paths.set(Nt,nr),ae&&Ee?(i.parents.set(Nt,ae),ke&&(ae=Nt,Ee=!1)):(i.parents.set(Nt,ae),ae=Nt),ke?(z={caseSensitive:bt,path:ke,element:"mounted",routeRefs:new Set([Nt]),children:[vr],plugin:(0,y.IY)(n.props.element,"core.plugin")},dt.push(z)):z==null||z.routeRefs.add(Nt)}if((0,y.IY)(n,"core.gatherMountPoints")&&(Ee=!0),(0,y.IY)(n,"core.gatherMountPoints")){if(!ke)throw new Error("Mount point gatherer must have a path");if(!Nt){var tr;z={caseSensitive:bt,path:ke,element:"gathered",routeRefs:new Set,children:[vr],plugin:l==null||(tr=l.obj)===null||tr===void 0?void 0:tr.plugin},dt.push(z)}}return{obj:z,path:Ct,routeRef:ae,sticky:Ee}}),Gn=Ne(()=>new Set,(i,n)=>{if(n.type===On){const s=n.props;i.add("with"in s?s.with:s.without)}}),Xn=(0,ut.uW)("route-ref-type",()=>Symbol("route-ref-type"));function ar(i){return i[Xn]==="absolute"}function Nr(i){return i[Xn]==="sub"}function Eo(i){return i[Xn]==="external"}function yr(...i){const n=i.join("/").replace(/\/\/+/g,"/");return n!=="/"&&n.endsWith("/")?n.slice(0,-1):n}function _o(i,n,s){let l,f="";if(ar(i))l=i;else if(Nr(i))l=i.parent,f=i.path;else if(Eo(i)){const z=s.get(i);if(!z)return[void 0,""];if(ar(z))l=z;else if(Nr(z))l=z.parent,f=z.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${z}`)}else throw i[Xn]?new Error(`Unknown or invalid route ref type, ${i[Xn]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!l)return[void 0,""];const A=n.get(l);if(A===void 0)return[void 0,""];const Z=yr(A,f);return[l,Z]}function Ao(i,n,s,l,f){var A;const Z=(A=(0,wn.fp)(f,n))!==null&&A!==void 0?A:[],z=Array();let ae=-1;for(let He=i;He&&(ae=Z.findIndex(dt=>dt.route.routeRefs.has(He)),ae===-1);He=l.get(He))z.unshift(He);z.length===0&&(ae-=1);const Ee=ae===-1?"":Z[ae].pathname,ke=z.slice(0,-1).map(He=>{const dt=s.get(He);if(dt===void 0)throw new Error(`No path for ${He}`);if(dt.includes(":"))throw new Error(`Cannot route to ${i} with parent ${He} as it has parameters`);return dt});return`${yr(Ee,...ke)}/`}class to{resolve(n,s){const[l,f]=_o(n,this.routePaths,this.routeBindings);if(!l)return;let A;typeof s=="string"?A=this.trimPath(s):s.pathname?A={...s,pathname:this.trimPath(s.pathname)}:A=s;const Z=this.appBasePath+Ao(l,A,this.routePaths,this.routeParents,this.routeObjects);return(...[ae])=>yr(Z,(0,wn.Gn)(f,ae))}trimPath(n){return n&&(n.startsWith(this.appBasePath)?n.slice(this.appBasePath.length):n)}constructor(n,s,l,f,A){(0,H.Z)(this,"routePaths",void 0),(0,H.Z)(this,"routeParents",void 0),(0,H.Z)(this,"routeObjects",void 0),(0,H.Z)(this,"routeBindings",void 0),(0,H.Z)(this,"appBasePath",void 0),this.routePaths=n,this.routeParents=s,this.routeObjects=l,this.routeBindings=f,this.appBasePath=A}}const qn=(0,ut.CT)("routing-context"),Lr=({routePaths:i,routeParents:n,routeObjects:s,routeBindings:l,basePath:f="",children:A})=>{const Z=new to(i,n,s,l,f),z=(0,ut.EI)({1:Z});return(0,r.jsx)(qn.Provider,{value:z,children:A})};function kr(i,n){const s=new Set(n.values());s.delete(void 0);for(const l of n.keys()){if(s.has(l))continue;let f=l,A="";for(;f;){const z=i.get(f);if(z===void 0)throw new Error(`No path for ${f}`);A=yr(z,A),f=n.get(f)}const Z=A.match(/:(\w+)/g);if(Z){for(let z=0;z<Z.length;z++)for(let ae=z+1;ae<Z.length;ae++)if(Z[ae]===Z[z])throw new Error(`Parameter ${Z[ae]} is duplicated in path ${A}`)}}}function To(i,n){for(const s of n)if(s.externalRoutes){for(const[l,f]of Object.entries(s.externalRoutes))if(!f.optional&&!i.has(f))throw new Error(`External route '${l}' of the '${s.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const Fr=(0,ut.CT)("app-context"),Ur=({appContext:i,children:n})=>{const s=(0,ut.EI)({1:i});return(0,r.jsx)(Fr.Provider,{value:s,children:n})};function lr(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function Mr(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class zr{setTarget(n,s){this.target=n,this.signOutTargetUrl=s.signOutTargetUrl,this.resolveTarget(n)}getUserId(){if(!this.target)throw lr("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Mr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw lr("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Mr("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(n=>n.getProfileInfo())}async getBackstageIdentity(){const n=await this.waitForTarget.then(s=>s.getBackstageIdentity());return n.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${n.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),n}async getCredentials(){return this.waitForTarget.then(n=>n.getCredentials())}async getIdToken(){return this.waitForTarget.then(n=>{if(!n.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return Mr("getIdToken"),n.getIdToken()})}async signOut(){await this.waitForTarget.then(n=>n.signOut()),window.location.href=this.signOutTargetUrl}constructor(){(0,H.Z)(this,"target",void 0),(0,H.Z)(this,"waitForTarget",void 0),(0,H.Z)(this,"resolveTarget",()=>{}),(0,H.Z)(this,"signOutTargetUrl","/"),this.waitForTarget=new Promise(n=>{this.resolveTarget=n})}}var Ro=t(72164);function Io(i,n,s){if(i!==void 0){const f=s.find(A=>A.id===i);if(f)return f}if(n){const f=s.find(A=>A.variant==="dark");if(f)return f}const l=s.find(f=>f.variant==="light");return l||s[0]}const Po=()=>{const i=(0,W.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[n,s]=(0,W.useState)(i.matches);return(0,W.useEffect)(()=>{const l=f=>{s(f.matches)};return i.addListener(l),()=>{i.removeListener(l)}},[i]),n};function Lo({children:i}){const n=(0,y.h_)(y.hg),s=(0,Ro.Z)(n.activeThemeId$(),n.getActiveThemeId()),l=Boolean(window.matchMedia)?Po():!1,f=Io(s,l,n.getInstalledThemes());if(!f)throw new Error("App has no themes");return(0,r.jsx)(f.Provider,{children:i})}const no=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const n=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!n)throw new Error("No static configuration provided");if(!Array.isArray(n))throw new Error("Static configuration has invalid format");const s=n.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const f=JSON.parse(i);Array.isArray(f)?s.push(...f):s.push({data:f,context:"env"})}catch(f){throw new Error(`Failed to load runtime configuration, ${f}`)}const l=window.__APP_CONFIG__;return l&&s.push({context:"window",data:l}),s};class es{add(n,s){return this.apis.push([n.id,s]),s}build(){return new xr(new Map(this.apis))}constructor(){(0,H.Z)(this,"apis",[])}}class xr{static builder(){return new es}static from(n){return new xr(new Map(n.map(([s,l])=>[s.id,l])))}static with(n,s){return new xr(new Map([[n.id,s]]))}with(n,s){return new xr(new Map([...this.apis,[n.id,s]]))}get(n){return this.apis.get(n.id)}constructor(n){(0,H.Z)(this,"apis",void 0),this.apis=n}}function ko(i){const n=new Map;return i&&i({bind:(l,f)=>{for(const[A,Z]of Object.entries(f)){const z=l[A];if(!z)throw new Error(`Key ${A} is not an existing external route`);if(!Z&&!z.optional)throw new Error(`External route ${A} is required but was undefined`);Z&&n.set(z,Z)}}}),n}function ro(i){const n=new URL(i);return n.protocol=document.location.protocol,n.hostname=document.location.hostname,n.port=document.location.port,n.toString().replace(/\/$/,"")}function Oo(i,n,s){var l;const f=Boolean(i),A=(0,Ce.default)(i||(()=>Promise.resolve([])));let Z;if(f&&A.loading){const{Progress:Ee}=n;Z=(0,r.jsx)(Ee,{})}else if(A.error){const{BootErrorPage:Ee}=n;Z=(0,r.jsx)(Ee,{step:"load-config",error:A.error})}const{ThemeProvider:z=Lo}=n;if(Z)return{node:(0,r.jsx)(ft,{apis:xr.with(y.hg,s),children:(0,r.jsx)(z,{children:Z})})};let ae;if(!((l=A.value)===null||l===void 0)&&l.length){const Ee=w.fromConfigs(A.value),ke=Ee.getOptionalString("app.baseUrl"),He=Ee.getOptionalString("backend.baseUrl");let dt=A.value;const bt={data:{},context:"relative-resolver"};if(ke&&He){const Ct=new URL(ke).origin,Ft=new URL(He).origin;if(Ct===Ft){const Nt=ro(He);He!==Nt&&(bt.data.backend={baseUrl:Nt})}}if(ke){const Ct=ro(ke);ke!==Ct&&(bt.data.app={baseUrl:Ct})}Object.keys(bt.data).length&&(dt=dt.concat([bt])),ae=w.fromConfigs(dt)}else ae=w.fromConfigs([]);return{api:ae}}class oo{getPlugins(){return this.app.getPlugins()}getSystemIcon(n){return this.app.getSystemIcon(n)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(n){(0,H.Z)(this,"app",void 0),this.app=n}}var cr=new WeakMap;class Cr{getPlugins(){return Array.from(this.plugins)}getSystemIcon(n){return this.icons[n]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(n){const s=this.getProvider();return()=>(0,r.jsx)(s,{children:n})}getProvider(){if((0,x.Z)(this,cr))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,X.Z)(this,cr,!0);const n=new oo(this);let s=!1;return({children:f})=>{const A=(0,W.useRef)(!0),Z=(0,W.useMemo)(()=>Qe.createWithStorage(this.themes),[]),{routing:z,featureFlags:ae,routeBindings:Ee}=(0,W.useMemo)(()=>{const bt=he({root:f,discoverers:[pt,zt],collectors:{routing:gn()?ir:jo,collectedPlugins:dn,featureFlags:Gn}});return bt.collectedPlugins.forEach(Ct=>this.plugins.add(Ct)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...bt,routeBindings:ko(this.bindRoutes)}},[f]);s||(s=!0,kr(z.paths,z.parents),To(Ee,this.plugins));const ke=Oo(this.configLoader,this.components,Z),He="api"in ke;if(He){const{api:bt}=ke;this.configApi=bt}if("node"in ke)return ke.node;if(He&&A.current){A.current=!1;const bt=this.getApiHolder().get(y.W0);if(bt){for(const Nt of this.featureFlags)bt.registerFlag({...Nt,pluginId:""});for(const Nt of this.plugins.values())if("getFeatureFlags"in Nt)for(const $n of Nt.getFeatureFlags())bt.registerFlag({name:$n.name,pluginId:Nt.getId()});else for(const $n of Nt.output())$n.type==="feature-flag"&&bt.registerFlag({name:$n.name,pluginId:Nt.getId()});const Ct=bt.getRegisteredFlags(),Ft=new Set(Ct.map(Nt=>Nt.name));for(const Nt of ae)Ft.has(Nt)||bt.registerFlag({name:Nt,pluginId:""})}}const{ThemeProvider:dt=Lo}=this.components;return(0,r.jsx)(ft,{apis:this.getApiHolder(),children:(0,r.jsx)(Ur,{appContext:n,children:(0,r.jsx)(dt,{children:(0,r.jsx)(Lr,{routePaths:z.paths,routeParents:z.parents,routeObjects:z.objects,routeBindings:Ee,basePath:gr(ke.api),children:(0,r.jsx)(An.Provider,{value:{routeObjects:z.objects,appIdentityProxy:this.appIdentityProxy},children:f})})})})})}}getRouter(){return h}getApiHolder(){if(this.apiHolder){for(const n of this.plugins)for(const s of n.getApis())this.apiFactoryRegistry.get(s.api)||this.apiFactoryRegistry.register("default",s);return Re.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:y.hg,deps:{},factory:()=>Qe.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:y.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:y.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:y.W0,deps:{},factory:()=>new tt});for(const n of this.defaultApis)this.apiFactoryRegistry.register("default",n);for(const n of this.plugins)for(const s of n.getApis())if(!this.apiFactoryRegistry.register("default",s))throw new Error(`Plugin ${n.getId()} tried to register duplicate or forbidden API factory for ${s.api}`);for(const n of this.apis)if(!this.apiFactoryRegistry.register("app",n))throw new Error(`Duplicate or forbidden API factory for ${n.api} in app`);return Re.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Re(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(n){const s=new Set;for(const l of n){const f=l.getId();if(s.has(f))throw new Error(`Duplicate plugin found '${f}'`);s.add(f)}}constructor(n){(0,H.Z)(this,"apiHolder",void 0),(0,H.Z)(this,"configApi",void 0),(0,H.Z)(this,"apis",void 0),(0,H.Z)(this,"icons",void 0),(0,H.Z)(this,"plugins",void 0),(0,H.Z)(this,"featureFlags",void 0),(0,H.Z)(this,"components",void 0),(0,H.Z)(this,"themes",void 0),(0,H.Z)(this,"configLoader",void 0),(0,H.Z)(this,"defaultApis",void 0),(0,H.Z)(this,"bindRoutes",void 0),(0,H.Z)(this,"appIdentityProxy",new zr),(0,H.Z)(this,"apiFactoryRegistry",void 0),(0,j.Z)(this,cr,{writable:!0,value:!1});var s;this.apis=(s=n.apis)!==null&&s!==void 0?s:[],this.icons=n.icons;var l;this.plugins=new Set((l=n.plugins)!==null&&l!==void 0?l:[]);var f;this.featureFlags=(f=n.featureFlags)!==null&&f!==void 0?f:[],this.components=n.components,this.themes=n.themes;var A;this.configLoader=(A=n.configLoader)!==null&&A!==void 0?A:no;var Z;this.defaultApis=(Z=n.defaultApis)!==null&&Z!==void 0?Z:[],this.bindRoutes=n.bindRoutes,this.apiFactoryRegistry=new jt}}function Zo(i){return new Cr(i)}let Wr=!1;const Bo=i=>{const n=(0,y.qD)(),{NotFoundErrorPage:s}=n.getComponents(),l=(0,W.useMemo)(()=>gn(),[]),A=[...(0,y.vJ)(i.children,Z=>Z.getElements().flatMap(z=>{let ae=z.props.path;if(ae==="")return[];var Ee;ae=(Ee=ae==null?void 0:ae.replace(/\/\*$/,""))!==null&&Ee!==void 0?Ee:"/";let ke=l?z:z.props.element;return!l&&!ke&&(ke=z,Wr||(console.warn("DEPRECATION WARNING: All elements within <FlatRoutes> must be of type <Route> with an element prop. Existing usages of <Navigate key=[path] to=[to] /> should be replaced with <Route path=[path] element={<Navigate to=[to] />} />."),Wr=!0)),[{path:ae,element:ke,children:z.props.children?[{path:ae==="/"?"/":"*",element:z.props.children}]:void 0}]}).sort((z,ae)=>ae.path.localeCompare(z.path)).map(z=>({...z,path:z.path==="/"?"/":`${z.path}/*`}))),{path:"*",element:(0,r.jsx)(s,{})}];return(0,m.V$)(A)},Or=(0,y.T0)({id:"plugin.permission.api"});var Yt;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(Yt||(Yt={}));function ts(i,n){return i.name===n.name}function $o(i,n){return"resourceType"in i?!n||i.resourceType===n:!1}function ns(i){return i.attributes.action==="create"}function rs(i){return i.attributes.action==="read"}function os(i){return i.attributes.action==="update"}function ss(i){return i.attributes.action==="delete"}function is(i){return{authorize:async(n,s)=>await i.authorize(n,s),authorizeConditional(n,s){const l=n;return i.authorize(l,s)}}}function rr({name:i,attributes:n,resourceType:s}){return s?{type:"resource",name:i,attributes:n,resourceType:s}:{type:"basic",name:i,attributes:n}}var Zr=t(23054),as=t(96279),Do=t.n(as),so=t(9571);const Vr=at.z.lazy(()=>at.z.object({rule:at.z.string(),resourceType:at.z.string(),params:at.z.record(at.z.any()).optional()}).or(at.z.object({anyOf:at.z.array(Vr).nonempty()})).or(at.z.object({allOf:at.z.array(Vr).nonempty()})).or(at.z.object({not:Vr}))),b=at.z.object({result:at.z.literal(Yt.ALLOW).or(at.z.literal(Yt.DENY))}),E=at.z.union([at.z.object({result:at.z.literal(Yt.ALLOW).or(at.z.literal(Yt.DENY))}),at.z.object({result:at.z.literal(Yt.CONDITIONAL),pluginId:at.z.string(),resourceType:at.z.string(),conditions:Vr})]),I=(i,n)=>at.z.object({items:at.z.array(at.z.intersection(at.z.object({id:at.z.string()}),i)).refine(s=>s.length===n.size&&s.every(({id:l})=>n.has(l)),{message:"Items in response do not match request"})});class M{async authorize(n,s){return this.makeRequest(n,b,s)}async authorizeConditional(n,s){return this.makeRequest(n,E,s)}async makeRequest(n,s,l){if(!this.enabled)return n.map(ke=>({result:Yt.ALLOW}));const f={items:n.map(ke=>({id:so.Z(),...ke}))},A=await this.discovery.getBaseUrl("permission"),Z=await Do()(`${A}/authorize`,{method:"POST",body:JSON.stringify(f),headers:{...this.getAuthorizationHeader(l==null?void 0:l.token),"content-type":"application/json"}});if(!Z.ok)throw await Zr.VL.fromResponse(Z);const z=await Z.json(),Ee=I(s,new Set(f.items.map(({id:ke})=>ke))).parse(z).items.reduce((ke,He)=>(ke[He.id]=He,ke),{});return f.items.map(ke=>Ee[ke.id])}getAuthorizationHeader(n){return n?{Authorization:`Bearer ${n}`}:{}}constructor(n){(0,H.Z)(this,"enabled",void 0),(0,H.Z)(this,"discovery",void 0),this.discovery=n.discovery;var s;this.enabled=(s=n.config.getOptionalBoolean("permission.enabled"))!==null&&s!==void 0?s:!1}}class te{static create(n){const{config:s,discovery:l,identity:f}=n,A=new M({discovery:l,config:s});return new te(A,f)}async authorize(n){return(await this.permissionClient.authorize([n],await this.identityApi.getCredentials()))[0]}constructor(n,s){(0,H.Z)(this,"permissionClient",void 0),(0,H.Z)(this,"identityApi",void 0),this.permissionClient=n,this.identityApi=s}}var ce=t(69984);function oe(i){const n=(0,y.h_)(Or),{data:s,error:l}=(0,ce.ZP)(i,async f=>{if($o(f.permission)&&!f.resourceRef)return Yt.DENY;const{result:A}=await n.authorize(f);return A});return l?{error:l,loading:!1,allowed:!1}:s===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:s===Yt.ALLOW}}const ye=i=>{const{permission:n,resourceRef:s,errorComponent:l,...f}=i,A=usePermission(isResourcePermission(n)?{permission:n,resourceRef:s}:{permission:n}),Z=useApp(),{NotFoundErrorPage:z}=Z.getComponents();let ae=l===void 0?_jsx(z,{}):l;return A.loading?ae=null:A.allowed&&(ae=i.element),_jsx(Route,{...f,element:ae})};function Ae(i){const{permission:n,resourceRef:s}=i,l=usePermission(isResourcePermission(n)?{permission:n,resourceRef:s}:{permission:n}),f=useApp();if(l.loading)return null;if(l.allowed)return _jsx(_Fragment,{children:i.children});if(i.errorPage)return _jsx(_Fragment,{children:i.errorPage});const{NotFoundErrorPage:A}=f.getComponents();return _jsx(A,{})}const Ie=[(0,y.ni)({api:y.NW,deps:{configApi:y.Ds},factory:({configApi:i})=>J.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,y.ni)({api:y.$v,deps:{},factory:()=>new F}),(0,y.ni)({api:y.v_,deps:{},factory:()=>new fe}),(0,y.ni)({api:y.VE,deps:{alertApi:y.$v},factory:({alertApi:i})=>{const n=new me(i,new ve);return Ue.forward(n,{hidden:!1}),n}}),(0,y.ni)({api:y.E6,deps:{errorApi:y.VE},factory:({errorApi:i})=>qt.create({errorApi:i})}),(0,y.ni)({api:y.gP,deps:{configApi:y.Ds,identityApi:y.$4,discoveryApi:y.NW},factory:({configApi:i,identityApi:n,discoveryApi:s})=>xt({middleware:[Pt.resolvePluginProtocol({discoveryApi:s}),Pt.injectIdentityAuth({identityApi:n,config:i})]})}),(0,y.ni)({api:y.ZM,deps:{},factory:()=>new Xe}),(0,y.ni)({api:y.Kp,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Fn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.p_,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>fn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.F4,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Ut.create({configApi:s,discoveryApi:i,oauthRequestApi:n,defaultScopes:["read:user"],environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.D,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Jn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.ux,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>zn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.gW,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Vn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.bq,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>ie.create({configApi:s,discoveryApi:i,oauthRequestApi:n,defaultScopes:["team"],environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.Km,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Fe.create({configApi:s,discoveryApi:i,oauthRequestApi:n,defaultScopes:["REPO_READ"]})}),(0,y.ni)({api:y.uB,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>_.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:Or,deps:{discovery:y.NW,identity:y.$4,config:y.Ds},factory:({config:i,discovery:n,identity:s})=>te.create({config:i,discovery:n,identity:s})})];var Ze=t(77277),be=t(23196),Ve=t(71597);function st({children:i}){return(0,m.GV)()?(0,r.jsx)(r.Fragment,{children:i}):(0,r.jsx)(m.VA,{children:i})}const it=()=>(0,r.jsx)(be.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),Be=({step:i,error:n})=>{let s="";return i==="load-config"?s=`The configuration failed to load, someone should have a look at this error: ${n.message}`:i==="load-chunk"&&(s=`Lazy loaded chunk failed to load, try to reload the page: ${n.message}`),(0,r.jsx)(st,{children:(0,r.jsx)(be.mf,{status:"501",statusMessage:s})})},mt=({error:i,resetError:n,plugin:s})=>(0,r.jsx)(be.yu,{title:`Error in ${s==null?void 0:s.getId()}`,defaultExpanded:!0,error:i,children:(0,r.jsx)(Ze.Z,{variant:"outlined",onClick:n,children:"Retry"})}),$t={Progress:be.Ex,Router:Ve.VK,NotFoundErrorPage:it,BootErrorPage:Be,ErrorBoundaryFallback:mt};var yn=t(43642),un=t(80079),xn=t(90941),_t=t(32915),bn=t(40562),Sn=t(21853),br=t(60744),Hr=t(66569),Gr=t(30254),Tn=t(13384),Zn=t(15933),wr=t(58838),Os=t(86737),Zi=t(4989),Zs=t(44407),Bi=t(18628),jr=t(84219),Bs=t(98685),$i=t(39781);const Di={brokenImage:un.Z,catalog:Bi.Z,scaffolder:_t.Z,techdocs:bn.Z,search:Sn.Z,chat:br.Z,dashboard:Hr.Z,docs:Gr.Z,email:Tn.Z,github:wr.Z,group:jr.Z,help:Os.Z,"kind:api":Zn.Z,"kind:component":Zs.Z,"kind:domain":yn.Z,"kind:group":jr.Z,"kind:location":Zi.Z,"kind:system":xn.Z,"kind:user":Bs.Z,user:Bs.Z,warning:$i.Z};var Ni=t(73689),$s=t(48032);const dr={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")`},ur={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:n,shape:s,options:l}=i,A=`linear-gradient(90deg, ${(n.length===1?[n[0],n[0]]:n).join(", ")})`,Z=`${s}, ${A}`;var z;const ae=(z=l==null?void 0:l.fontColor)!==null&&z!==void 0?z:"#FFFFFF";return{colors:n,shape:s,backgroundImage:Z,fontColor:ae}}const No={home:_n({colors:ur.teal,shape:dr.wave}),documentation:_n({colors:ur.pinkSea,shape:dr.wave2}),tool:_n({colors:ur.purpleSky,shape:dr.round}),service:_n({colors:ur.marineBlue,shape:dr.wave}),website:_n({colors:ur.veryBlue,shape:dr.wave}),library:_n({colors:ur.rubyRed,shape:dr.wave}),other:_n({colors:ur.darkGrey,shape:dr.wave}),app:_n({colors:ur.toastyOrange,shape:dr.wave}),apis:_n({colors:ur.teal,shape:dr.wave2}),card:_n({colors:ur.greens,shape:dr.wave})},Ds=16,Ns='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function Fs(i){const{palette:n,htmlFontSize:s=Ds,fontFamily:l=Ns,defaultPageTheme:f,pageTheme:A=No}=i;if(!A[f])throw new Error(`${f} is not defined in pageTheme.`);var Z;return{palette:n,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:s,fontFamily:l,h6:{fontWeight:700,fontSize:20,marginBottom:2},h5:{fontWeight:700,fontSize:24,marginBottom:4},h4:{fontWeight:700,fontSize:28,marginBottom:6},h3:{fontSize:32,fontWeight:700,marginBottom:6},h2:{fontSize:40,fontWeight:700,marginBottom:8},h1:{fontSize:54,fontWeight:700,marginBottom:10}},page:A[f],getPageTheme:({themeId:z})=>(Z=A[z])!==null&&Z!==void 0?Z:A[f]}}function Us(i){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:i.spacing(1.5,2,1.5,2.5)},head:{wordBreak:"break-word",overflow:"hidden",color:i.palette.textSubtle,fontWeight:"normal",lineHeight:"1"}},MuiTabs:{root:{minHeight:24}},MuiTab:{root:{color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,$s.darken)(i.palette.link,.3),background:(0,$s.lighten)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:i.palette.link}},MuiTableSortLabel:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"}},active:{fontWeight:"bold",color:"inherit"}},MuiListItemText:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},MuiButton:{text:{padding:void 0}},MuiChip:{root:{backgroundColor:"#D9D9D9",marginRight:i.spacing(1),marginBottom:i.spacing(1),color:i.palette.grey[900]},outlined:{color:i.palette.text.primary},label:{lineHeight:`${i.spacing(2.5)}px`,fontWeight:i.typography.fontWeightMedium,fontSize:`${i.spacing(1.75)}px`},labelSmall:{fontSize:`${i.spacing(1.5)}px`},deleteIcon:{color:i.palette.grey[500],width:`${i.spacing(3)}px`,height:`${i.spacing(3)}px`,margin:`0 ${i.spacing(.75)}px 0 -${i.spacing(.75)}px`},deleteIconSmall:{width:`${i.spacing(2)}px`,height:`${i.spacing(2)}px`,margin:`0 ${i.spacing(.5)}px 0 -${i.spacing(.5)}px`}},MuiCard:{root:{display:"flex",flexDirection:"column"}},MuiCardHeader:{root:{paddingBottom:0}},MuiCardContent:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}},MuiCardActions:{root:{justifyContent:"flex-end"}}}}function ls(i){const n=Fs(i),s=(0,Ni.Z)(n),l=Us(s);return{...s,overrides:l}}var Ms=t(34505);const Fi=ls({palette:{type:"light",background:{default:"#F8F8F8"},status:{ok:"#1DB954",warning:"#FF9800",error:"#E22134",running:"#2E77D0",pending:"#FFED51",aborted:"#757575"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#2E77D0"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#000000",textVerySubtle:"#DDD",textSubtle:"#6E6E6E",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#2196F3",link:"#0A6EBE",gold:Ms.Z.A700,navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:No}),cs=ls({palette:{type:"dark",background:{default:"#333333"},status:{ok:"#71CF88",warning:"#FFB84D",error:"#F84C55",running:"#3488E3",pending:"#FEF071",aborted:"#9E9E9E"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#9CC9FF",dark:"#82BAFD"},secondary:{main:"#FF88B2"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#FFFFFF",textVerySubtle:"#727272",textSubtle:"#CCCCCC",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#82BAFD",link:"#9CC9FF",gold:Ms.Z.A700,navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:No});var Ui=t(98192),ds=t(15222),us=t(41547),Fo=t(87561);const hs=[{id:"light",title:"Light Theme",variant:"light",icon:(0,r.jsx)(ds.Z,{}),Provider:({children:i})=>(0,r.jsx)(us.Z,{theme:Fi,children:(0,r.jsx)(Fo.ZP,{children:i})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,r.jsx)(Ui.Z,{}),Provider:({children:i})=>(0,r.jsx)(us.Z,{theme:cs,children:(0,r.jsx)(Fo.ZP,{children:i})})}];function zs(i){var n,s,l,f;return Zo({...i,apis:(n=i==null?void 0:i.apis)!==null&&n!==void 0?n:[],bindRoutes:i==null?void 0:i.bindRoutes,components:{...$t,...i==null?void 0:i.components},configLoader:i==null?void 0:i.configLoader,defaultApis:Ie,icons:{...Di,...i==null?void 0:i.icons},plugins:(s=i==null?void 0:i.plugins)!==null&&s!==void 0?s:[],featureFlags:(l=i==null?void 0:i.featureFlags)!==null&&l!==void 0?l:[],themes:(f=i==null?void 0:i.themes)!==null&&f!==void 0?f:hs})}var io=t(25271),ao=t(76635);async function Ws({storageApi:i}){const n=i.forBucket("settings"),s=i.forBucket("starredEntities"),l=n.snapshot("starredEntities").value;if(!(0,ao.isArray)(l))return;var f;const A=new Set((f=s.snapshot("entityRefs").value)!==null&&f!==void 0?f:[]);l.filter(ao.isString).map(Z=>Z.split(":")).filter(Z=>Z.length===4&&Z[0]==="entity").map(([Z,z,ae,Ee])=>(0,io.eE)({kind:z,namespace:ae,name:Ee})).forEach(Z=>A.add(Z)),await s.set("entityRefs",Array.from(A)),await n.remove("starredEntities")}class Vs{async toggleStarred(n){this.starredEntities.has(n)?this.starredEntities.delete(n):this.starredEntities.add(n),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const n of this.subscribers)n.next(new Set(this.starredEntities))}constructor(n){(0,H.Z)(this,"settingsStore",void 0),(0,H.Z)(this,"starredEntities",void 0),(0,H.Z)(this,"subscribers",new Set),(0,H.Z)(this,"observable",new(pe())(l=>(l.next(new Set(this.starredEntities)),this.subscribers.add(l),()=>{this.subscribers.delete(l)}))),Ws(n).then(),this.settingsStore=n.storageApi.forBucket("starredEntities");var s;this.starredEntities=new Set((s=this.settingsStore.snapshot("entityRefs").value)!==null&&s!==void 0?s:[]),this.settingsStore.observe$("entityRefs").subscribe({next:l=>{var f;this.starredEntities=new Set((f=l.value)!==null&&f!==void 0?f:[]),this.notifyChanges()}})}}var Mi=t(33414),Kr=t(79692),Hs=t(12420),Bn=t(40303),Gs=t(19928);function zi(){const i=useApi(catalogApiRef),{error:n,loading:s,value:l}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(A=>{var Z;return((Z=A.facets.kind)===null||Z===void 0?void 0:Z.map(z=>z.value).sort())||[]}),[i]);return{loading:s,error:n,allKinds:l!=null?l:[]}}function Ks(i,n,s){let l=i;return n&&(l=l.filter(A=>n.some(Z=>Z.toLocaleLowerCase("en-US")===A.toLocaleLowerCase("en-US")))),s&&!i.some(A=>A.toLocaleLowerCase("en-US")===s.toLocaleLowerCase("en-US"))&&(l=l.concat([s])),l.sort().reduce((A,Z)=>(A[Z.toLocaleLowerCase("en-US")]=Z,A),{})}const Ys=(0,Kr.Z)(i=>(0,Hs.Z)({root:{...i.typography.h4}}));function Js(i){var n;const{initialFilter:s="component",allowedKinds:l}=i,f=Ys(),{allKinds:A}=useAllKinds(),{filters:Z,updateFilters:z,queryParameters:{kind:ae}}=useEntityList(),Ee=useMemo(()=>[ae].flat()[0],[ae]);var ke;const[He,dt]=useState((ke=Ee!=null?Ee:(n=Z.kind)===null||n===void 0?void 0:n.value)!==null&&ke!==void 0?ke:s);useEffect(()=>{Ee&&dt(Ee)},[Ee]),useEffect(()=>{var Ct;if(!((Ct=Z.kind)===null||Ct===void 0)&&Ct.value){var Ft;dt((Ft=Z.kind)===null||Ft===void 0?void 0:Ft.value)}},[Z.kind]),useEffect(()=>{z({kind:He?new EntityKindFilter(He):void 0})},[He,z]);const bt=filterKinds(A,l,He);return _jsx(Select,{input:_jsx(InputBase,{}),value:He.toLocaleLowerCase("en-US"),onChange:Ct=>dt(Ct.target.value),classes:f,children:Object.keys(bt).map(Ct=>_jsx(MenuItem,{value:Ct,children:`${pluralize(bt[Ct])}`},Ct))})}var Qs=t(86359),Uo=t(95544),Wi=t(99688),lo=t(12231),Yr=t(86136),co=t(49378),er=t(85256),Xs=t(80030),_s=t(61837),Vi=t(79784),Hi=t(50758),Gi=t(31654),Ki=t(43054),Yi=t(65759),Oa=t(49280),uo=t(96641);function Ji(i){const{entity:n,loading:s,error:l}=(0,uo.ce)(),{allowed:f,loading:A,error:Z}=oe({permission:i,resourceRef:n?(0,io.eE)(n):void 0});return s||A?{loading:!0,allowed:!1}:l?{loading:!1,allowed:!1,error:l}:{loading:!1,allowed:f,error:Z}}const ps="catalog-entity",ei=rr({name:"catalog.entity.read",attributes:{action:"read"},resourceType:ps}),ti=rr({name:"catalog.entity.create",attributes:{action:"create"}}),ho=rr({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:ps}),ni=rr({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:ps}),ri=rr({name:"catalog.location.read",attributes:{action:"read"}}),oi=rr({name:"catalog.location.create",attributes:{action:"create"}}),Mo=rr({name:"catalog.location.delete",attributes:{action:"delete"}}),fs=[ei,ti,ho,ni,ri,oi,Mo];var po=t(49166);function gs(i){const{unregisterEntityOptions:n,isUnregisterAllowed:s,onUnregisterEntity:l,onClose:f}=i,A=typeof(n==null?void 0:n.disableUnregister)=="boolean";var Z;const z=(Z=!s||(A?!!(n!=null&&n.disableUnregister):(n==null?void 0:n.disableUnregister)==="disable"))!==null&&Z!==void 0?Z:!1;let ae=(0,r.jsx)(r.Fragment,{});return(n==null?void 0:n.disableUnregister)!=="hidden"&&(ae=(0,r.jsxs)(lo.Z,{onClick:()=>{f(),l()},disabled:z,children:[(0,r.jsx)(Yr.Z,{children:(0,r.jsx)(po.Z,{fontSize:"small"})}),(0,r.jsx)(co.Z,{primary:"Unregister entity"})]})),(0,r.jsx)(r.Fragment,{children:ae})}const ms=(0,Kr.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function hr(i){const{UNSTABLE_extraContextMenuItems:n,UNSTABLE_contextMenuOptions:s,onUnregisterEntity:l,onInspectEntity:f}=i,[A,Z]=(0,W.useState)(),z=ms(),Ee=Ji(ho).allowed,ke=Ft=>{Z(Ft.currentTarget)},He=()=>{Z(void 0)},dt=(0,y.h_)(y.$v),bt=(0,W.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>dt.post({message:"Copied!",severity:"info",display:"transient"}))},[dt]),Ct=n&&[...n.map(Ft=>(0,r.jsxs)(lo.Z,{onClick:()=>{He(),Ft.onClick()},children:[(0,r.jsx)(Yr.Z,{children:(0,r.jsx)(Ft.Icon,{fontSize:"small"})}),(0,r.jsx)(co.Z,{primary:Ft.title})]},Ft.title)),(0,r.jsx)(er.Z,{},"the divider is here!")];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Xs.ZP,{title:"More",arrow:!0,children:(0,r.jsx)(_s.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!A,role:"button",onClick:ke,"data-testid":"menu-button",className:z.button,id:"long-menu",children:(0,r.jsx)(Ki.Z,{})})}),(0,r.jsx)(Vi.ZP,{open:Boolean(A),onClose:He,anchorEl:A,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,r.jsxs)(Hi.Z,{children:[Ct,(0,r.jsx)(gs,{unregisterEntityOptions:s,isUnregisterAllowed:Ee,onUnregisterEntity:l,onClose:He}),(0,r.jsxs)(lo.Z,{onClick:()=>{He(),f()},children:[(0,r.jsx)(Yr.Z,{children:(0,r.jsx)(Gi.Z,{fontSize:"small"})}),(0,r.jsx)(co.Z,{primary:"Inspect entity"})]}),(0,r.jsxs)(lo.Z,{onClick:()=>{He(),bt()},children:[(0,r.jsx)(Yr.Z,{children:(0,r.jsx)(Yi.Z,{fontSize:"small"})}),(0,r.jsx)(co.Z,{primary:"Copy entity URL"})]})]})})]})}const vs="plugin.catalog.entityLayoutRoute",fo=()=>null;(0,y.R5)(fo,vs,!0),(0,y.R5)(fo,"core.gatherMountPoints",!0);function si(i){const{entity:n,title:s}=i;return(0,r.jsxs)(Uo.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,r.jsx)(Uo.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:s}),n&&(0,r.jsx)(Bn.LH,{entity:n})]})}function Qi(i,n,s,l){var f;const A=(f=i!=null?i:l==null?void 0:l.kind)!==null&&f!==void 0?f:"";var Z;const z=(Z=n!=null?n:l==null?void 0:l.metadata.namespace)!==null&&Z!==void 0?Z:"";var ae,Ee,ke;return{headerTitle:`${(ke=(Ee=(ae=l==null?void 0:l.metadata.title)!==null&&ae!==void 0?ae:s)!==null&&Ee!==void 0?Ee:l==null?void 0:l.metadata.name)!==null&&ke!==void 0?ke:""}${z&&z!==io.zG?` in ${z}`:""}`,headerType:(()=>{let dt=A.toLocaleLowerCase("en-US");return l&&l.spec&&"type"in l.spec&&(dt+=" \u2014 ",dt+=l.spec.type.toLocaleLowerCase("en-US")),dt})()}}function or(i){var n;const{entity:s}=i,l=(0,Bn.hF)(s,io.S4);return(0,r.jsxs)(r.Fragment,{children:[l.length>0&&(0,r.jsx)(be.i9,{label:"Owner",value:(0,r.jsx)(Bn.rI,{entityRefs:l,defaultKind:"Group",color:"inherit"})}),((n=s.spec)===null||n===void 0?void 0:n.lifecycle)&&(0,r.jsx)(be.i9,{label:"Lifecycle",value:s.spec.lifecycle})]})}const ys=i=>{var n,s;const{UNSTABLE_extraContextMenuItems:l,UNSTABLE_contextMenuOptions:f,children:A,NotFoundComponent:Z}=i,{kind:z,namespace:ae,name:Ee}=(0,y.Oi)(Bn.wi),{entity:ke,loading:He,error:dt}=(0,Bn.ce)(),bt=(0,m.TH)(),Ct=(0,y.vJ)(A,bo=>bo.selectByComponentData({key:vs,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Br})=>{if(ke){if(Br.if&&!Br.if(ke))return[]}else return[];return[{path:Br.path,title:Br.title,children:Br.children,tabProps:Br.tabProps}]}),[ke]),{headerTitle:Ft,headerType:Nt}=Qi(z,ae,Ee,ke),[$n,tr]=(0,W.useState)(!1),[nr,Qr]=(0,W.useState)(!1),ji=(0,m.s0)(),Ei=async()=>{tr(!1),Qr(!1),ji("/")};(0,W.useEffect)(()=>{tr(!1),Qr(!1)},[bt.pathname]);var Yo;return(0,r.jsxs)(be.T3,{themeId:(Yo=ke==null||(n=ke.spec)===null||n===void 0||(s=n.type)===null||s===void 0?void 0:s.toString())!==null&&Yo!==void 0?Yo:"home",children:[(0,r.jsx)(be.h4,{title:(0,r.jsx)(si,{title:Ft,entity:ke}),pageTitleOverride:Ft,type:Nt,children:ke&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(or,{entity:ke}),(0,r.jsx)(hr,{UNSTABLE_extraContextMenuItems:l,UNSTABLE_contextMenuOptions:f,onUnregisterEntity:()=>tr(!0),onInspectEntity:()=>Qr(!0)})]})}),He&&(0,r.jsx)(be.Ex,{}),ke&&(0,r.jsx)(be.tn,{routes:Ct}),dt&&(0,r.jsx)(be.VY,{children:(0,r.jsx)(Wi.Z,{severity:"error",children:dt.toString()})}),!He&&!dt&&!ke&&(0,r.jsx)(be.VY,{children:Z||(0,r.jsxs)(be.GB,{title:"Entity not found",children:["There is no ",z," with the requested"," ",(0,r.jsx)(be.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,r.jsx)(Bn.pp,{open:$n,entity:ke,onConfirm:Ei,onClose:()=>tr(!1)}),(0,r.jsx)(Bn.U_,{open:nr,entity:ke,onClose:()=>Qr(!1)})]})};ys.Route=fo;function Xi(i){const{open:n,onClose:s,onConfirm:l,entity:f}=i,[A,Z]=useState(!1),z=useApi(catalogApiRef),ae=useApi(alertApiRef),Ee=async()=>{Z(!0);try{const ke=f.metadata.uid;await z.removeEntityByUid(ke),l()}catch(ke){assertError(ke),ae.post({message:ke.message})}finally{Z(!1)}};return _jsxs(Dialog,{open:n,onClose:s,children:[_jsx(DialogTitle,{id:"responsive-dialog-title",children:"Are you sure you want to delete this entity?"}),_jsxs(DialogActions,{children:[_jsx(Button,{variant:"contained",color:"secondary",disabled:A,onClick:Ee,children:"Delete"}),_jsx(Button,{onClick:s,color:"primary",children:"Cancel"})]})]})}var go=t(19625);function qi(i){var n,s;return(i==null||(n=i.metadata)===null||n===void 0||(s=n.annotations)===null||s===void 0?void 0:s["backstage.io/orphan"])==="true"}function _i(){const i=useNavigate(),n=useRouteRef(rootRouteRef),[s,l]=useState(!1),{entity:f}=useEntity(),A=async()=>{l(!1),i(n())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>l(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:s,entity:f,onConfirm:A,onClose:()=>l(!1)})]})}var mo=t(4791);const xs=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function zo(i,n){return{items:(await n.getEntityAncestors({entityRef:i})).items.map(f=>{var A,Z;return{errors:((Z=(A=f.entity.status)===null||A===void 0?void 0:A.items)!==null&&Z!==void 0?Z:[]).filter(xs).map(Ee=>Ee.error).filter(Ee=>Boolean(Ee)),entity:f.entity}}).filter(f=>f.errors.length>0)}}async function ii(i,n){const s=n.apis.get(catalogApiRef);if(!s)throw new Error(`No implementation available for ${catalogApiRef}`);return(await zo(stringifyEntityRef(i),s)).items.length>0}function ai(){const{entity:i}=useEntity(),n=stringifyEntityRef(i),s=useApi(catalogApiRef),{loading:l,error:f,value:A}=useAsync(async()=>zo(n,s),[n,s]);return f?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:f})}):l||!A?null:_jsx(_Fragment,{children:A.items.map((Z,z)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(Z.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:Z.entity})]}),Z.errors.map((ae,Ee)=>_jsx(ResponseErrorPanel,{error:ae},Ee))]},z))})}const vo="core.backstage.entitySwitch",bs=i=>null;(0,y.R5)(bs,vo,!0);const Ss=i=>{var n;const{entity:s,loading:l}=(0,Bn.ce)(),f=(0,y.I_)(),A=(0,y.vJ)(i.children,ae=>ae.selectByComponentData({key:vo,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(Ee=>{if(l)return[];const{if:ke,children:He}=Ee.props;return s?[{if:ke==null?void 0:ke(s,{apis:f}),children:He}]:[{if:ke===void 0,children:He}]}),[f,s,l]);if(A.some(ae=>typeof ae.if=="object"&&"then"in ae.if))return(0,r.jsx)(Cs,{results:A,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const ae=A.filter(Ee=>Ee.if).map(Ee=>Ee.children);return ae.length===0?Jr(A):(0,r.jsx)(r.Fragment,{children:ae})}var z;return(z=(n=A.find(ae=>ae.if))===null||n===void 0?void 0:n.children)!==null&&z!==void 0?z:Jr(A)};function Cs({results:i,renderMultipleMatches:n}){const{loading:s,value:l}=(0,Ce.default)(async()=>{const f=i.map(async({if:Z,children:z})=>{try{if(await Z)return z}catch{}return null});if(n==="all"){const Z=(await Promise.all(f)).filter(Boolean);return Z.length===0?Jr(i):(0,r.jsx)(r.Fragment,{children:Z})}var A;return(A=(await Promise.all(f)).find(Boolean))!==null&&A!==void 0?A:Jr(i)},[i]);return s||!l?null:l}function Jr(i){var n,s;return(s=(n=i.filter(l=>l.if===void 0)[0])===null||n===void 0?void 0:n.children)!==null&&s!==void 0?s:null}Ss.Case=bs;const ea=null,Wo=Bn._i.Filters,ta=Bn._i.Content;var na=t(85877),ws=t(15096);const Rn=(0,y.rx)({id:"catalog",apis:[(0,y.ni)({api:Bn.Ah,deps:{discoveryApi:y.NW,fetchApi:y.gP},factory:({discoveryApi:i,fetchApi:n})=>new mo.MS({discoveryApi:i,fetchApi:n})}),(0,y.ni)({api:Bn.p3,deps:{storageApi:y.E6},factory:({storageApi:i})=>new Vs({storageApi:i})})],routes:{catalogIndex:go._Z,catalogEntity:Bn.wi},externalRoutes:{createComponent:go.yw,viewTechDoc:go.jU},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),ra=Rn.provide((0,y.P4)({name:"CatalogIndexPage",component:()=>t.e(9323).then(t.bind(t,89323)).then(i=>i.CatalogPage),mountPoint:go._Z})),li=Rn.provide((0,y.P4)({name:"CatalogEntityPage",component:()=>t.e(8951).then(t.bind(t,78951)).then(i=>i.CatalogEntityPage),mountPoint:Bn.wi})),oa=Rn.provide((0,y.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,33414)).then(i=>i.AboutCard)}})),ci=Rn.provide((0,y.CO)({name:"EntityLinksCard",component:{lazy:()=>t.e(7750).then(t.bind(t,17750)).then(i=>i.EntityLinksCard)}})),sa=Rn.provide((0,y.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,85877)).then(i=>i.EntityLabelsCard)}})),Vo=Rn.provide((0,y.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>t.e(5458).then(t.bind(t,5458)).then(i=>i.HasSystemsCard)}})),di=Rn.provide((0,y.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>t.e(1105).then(t.bind(t,1105)).then(i=>i.HasComponentsCard)}})),ia=Rn.provide((0,y.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>t.e(2440).then(t.bind(t,82440)).then(i=>i.HasSubcomponentsCard)}})),ui=Rn.provide((0,y.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>t.e(9770).then(t.bind(t,79770)).then(i=>i.HasResourcesCard)}})),aa=Rn.provide((0,y.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>t.e(9545).then(t.bind(t,19545)).then(i=>i.DependsOnComponentsCard)}})),hi=Rn.provide((0,y.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>t.e(184).then(t.bind(t,40184)).then(i=>i.DependencyOfComponentsCard)}})),pi=Rn.provide((0,y.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>t.e(1032).then(t.bind(t,81032)).then(i=>i.DependsOnResourcesCard)}})),Kn=Rn.provide((0,y.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>t.e(732).then(t.bind(t,732)).then(i=>i.RelatedEntitiesCard)}})),la=Rn.provide((0,ws.E5)({name:"CatalogSearchResultListItem",component:()=>t.e(7670).then(t.bind(t,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var js=t(32838);class fi{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(n,s){const f=`${await this.getApiOrigin()}/${s}`,A=await fetch(`${f.endsWith("/")?f:`${f}/`}index.html`);if(A.status===404)throw new Error("Page not found");return A.text()}async syncEntityDocs(n){return"cached"}async getBaseUrl(n,s,l){const f=await this.getApiOrigin();return new URL(n,`${f}/${l}`).toString()}constructor({configApi:n,discoveryApi:s,identityApi:l}){(0,H.Z)(this,"configApi",void 0),(0,H.Z)(this,"discoveryApi",void 0),(0,H.Z)(this,"identityApi",void 0),this.configApi=n,this.discoveryApi=s,this.identityApi=l}}class Es{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(n){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(n){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:n,discoveryApi:s,identityApi:l}){(0,H.Z)(this,"configApi",void 0),(0,H.Z)(this,"discoveryApi",void 0),(0,H.Z)(this,"identityApi",void 0),this.configApi=n,this.discoveryApi=s,this.identityApi=l}}const gi=[(0,y.ni)({api:Se.Dl,deps:{configApi:y.Ds,discoveryApi:y.NW,identityApi:y.$4},factory:({configApi:i,discoveryApi:n,identityApi:s})=>new fi({configApi:i,discoveryApi:n,identityApi:s})}),(0,y.ni)({api:Se.gT,deps:{configApi:y.Ds,discoveryApi:y.NW,identityApi:y.$4},factory:({configApi:i,discoveryApi:n,identityApi:s})=>new Es({configApi:i,discoveryApi:n,identityApi:s})}),(0,y.ni)({api:js.q3,deps:{configApi:y.Ds},factory:({configApi:i})=>js.ae.fromConfig(i)})],ca={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},Ho={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function mi(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function vi(){const i=await no(),n=await mi();return[...i,{context:"detected",data:n?ca:Ho}]}var yi=t(58845);const yo=(0,Kr.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var xi=()=>{const i=yo();return(0,r.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,r.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 As=(0,Kr.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var ha=()=>{const i=As();return(0,r.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,r.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 pa=(0,Kr.Z)({root:{width:be.po.drawerWidthClosed,height:3*be.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:be.po.drawerWidthClosed,marginLeft:24}}),bi=()=>{const i=pa(),{isOpen:n}=(0,be.mZ)();return(0,r.jsx)("div",{className:i.root,children:(0,r.jsx)(be.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:n?(0,r.jsx)(xi,{}):(0,r.jsx)(ha,{})})})},fa=({children:i})=>(0,r.jsxs)(be.tR,{children:[(0,r.jsxs)(be.YE,{children:[(0,r.jsx)(bi,{}),(0,r.jsx)(be.v7,{}),(0,r.jsx)(be.R6,{icon:yi.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var ga=t(32388),Go=t(4142);const Ko=(0,Kr.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 sr;(function(i){i.LIGHT="light",i.DARK="dark"})(sr||(sr={}));const xo=()=>{const i=(0,y.h_)(y.hg),n=Ko(),[s,l]=(0,W.useState)(i.getActiveThemeId()===sr.DARK?sr.DARK:sr.LIGHT),f={[sr.LIGHT]:{icon:Go.Z,title:"Dark theme"},[sr.DARK]:{icon:ga.Z,title:"Light theme"}},{title:A,icon:Z}=f[s],z=()=>{l(ae=>{const Ee=ae===sr.LIGHT?sr.DARK:sr.LIGHT;return i.setActiveThemeId(Ee),Ee})};return(0,r.jsx)(Uo.Z,{display:"flex",alignItems:"center",mr:2,children:(0,r.jsx)(Xs.ZP,{title:A,arrow:!0,children:(0,r.jsx)(_s.Z,{size:"small",onClick:z,children:(0,r.jsx)(Z,{className:n.headerIcon})})})})},Si=()=>(0,r.jsxs)(L.I6,{children:[(0,r.jsx)($.S,{}),(0,r.jsx)(R.F,{withSearch:!1})]}),Ts=(0,r.jsx)(Si,{}),Rs=zs({apis:gi,configLoader:vi,plugins:Object.values(u)}),Ci=Rs.getProvider(),Is=Rs.getRouter(),wi=L.s4.provide((0,Se.KY)({name:"ThemeToggleAddon",component:xo,location:Se.oZ.Header})),Ps=(0,r.jsxs)(Bo,{children:[(0,r.jsx)(m.Fg,{to:"/docs/default/component/local/"},"/"),(0,r.jsx)(m.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,r.jsx)(li,{})}),(0,r.jsx)(m.AW,{path:"/docs",element:(0,r.jsx)(L.Jl,{}),children:(0,r.jsx)(D.u,{})}),(0,r.jsxs)(m.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,r.jsx)(L.I6,{}),children:[Ts,(0,r.jsx)(Se.DR,{children:(0,r.jsx)(wi,{})})]})]});var ma=()=>(0,r.jsx)(Ci,{children:(0,r.jsx)(Is,{children:(0,r.jsx)(fa,{children:Ps})})});P.render((0,r.jsx)(ma,{}),document.getElementById("root"))},51837:function(St,$e,t){"use strict";t.d($e,{CT:function(){return y},EI:function(){return Te},uW:function(){return P},Vt:function(){return c}});function u(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const r=u(),W=ue=>`__@backstage/${ue}__`;function P(ue,K){const $=W(ue);let R=r[$];return R||(R=K(),r[$]=R,R)}var m=t(2784);function y(ue){return P(ue,()=>(0,m.createContext)(void 0))}function c(ue){return(0,m.useContext)(y(ue))}function B(ue){return{set(K){globalThis[`__@backstage/${ue}__`]=createContext(createVersionedValueMap(K))},reset(){delete globalThis[`__@backstage/${ue}__`]}}}function Te(ue){Object.freeze(ue);const K={atVersion($){return ue[$]}};return Object.defineProperty(K,"$map",{configurable:!0,enumerable:!0,get(){return ue}}),K}},96641:function(St,$e,t){"use strict";t.d($e,{X2:function(){return Te},ce:function(){return ue},h$:function(){return c}});var u=t(52322),r=t(25271),W=t(60871),P=t(51837),m=t(2784);const y=(0,P.CT)("entity-context"),c=K=>{const{children:$,entity:R,loading:O,error:re,refresh:q}=K,ne={entity:R,loading:O,error:re,refresh:q};return(0,u.jsx)(y.Provider,{value:(0,P.EI)({1:ne}),children:(0,u.jsx)(W.fC,{attributes:{...R?{entityRef:(0,r.eE)(R)}:void 0},children:$})})},B=K=>_jsx(c,{entity:K.entity,loading:!Boolean(K.entity),error:void 0,refresh:void 0,children:K.children});function Te(){const K=(0,P.Vt)("entity-context");if(!K)throw new Error("Entity context is not available");const $=K.atVersion(1);if(!$)throw new Error("EntityContext v1 not available");if(!$.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:$.entity}}function ue(){const K=(0,P.Vt)("entity-context");if(!K)throw new Error("Entity context is not available");const $=K.atVersion(1);if(!$)throw new Error("EntityContext v1 not available");const{entity:R,loading:O,error:re,refresh:q}=$;return{entity:R,loading:O,error:re,refresh:q}}},40303:function(St,$e,t){"use strict";t.d($e,{h$:function(){return De.h$},n3:function(){return u.n3},_i:function(){return T},tW:function(){return Vn},df:function(){return Zt},UO:function(){return Ut},dq:function(){return Q},nl:function(){return so},dx:function(){return ut},rI:function(){return Re},u3:function(){return Oe},xE:function(){return An},sL:function(){return gn},LH:function(){return mr},U_:function(){return Zo},pp:function(){return $o},EW:function(){return rr},Ah:function(){return W},wi:function(){return We},hF:function(){return ct.hF},CV:function(){return ct.CV},$3:function(){return H},p3:function(){return P},ce:function(){return De.ce},X2:function(){return De.X2},wp:function(){return Vt},ZW:function(){return fn},eK:function(){return Pn},CR:function(){return Mn}});var u=t(4791),r=t(60871);const W=(0,r.T0)({id:"plugin.catalog.service"}),P=(0,r.T0)({id:"catalog-react.starred-entities"});var m=t(82394);class y{async toggleStarred(E){this.starredEntities.delete(E)||this.starredEntities.add(E);for(const I of this.subscribers)I.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){_define_property(this,"starredEntities",new Set),_define_property(this,"subscribers",new Set),_define_property(this,"observable",new ObservableImpl(E=>(E.next(new Set(this.starredEntities)),this.subscribers.add(E),()=>{this.subscribers.delete(E)})))}}var c=t(52322),B=t(2784),Te=t(41156),ue=t(60364),K=t(77277),$=t(4190),R=t(95544),O=t(90436),re=t(60905),q=t(36444);const ne=b=>{const E=(0,Te.Z)(ce=>ce.breakpoints.down("md")),I=(0,ue.Z)(),[M,te]=(0,B.useState)(!1);return E?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(K.Z,{style:{marginTop:I.spacing(1),marginLeft:I.spacing(1)},onClick:()=>te(!0),startIcon:(0,c.jsx)(q.Z,{}),children:"Filters"}),(0,c.jsx)($.ZP,{open:M,onClose:()=>te(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,c.jsxs)(R.Z,{m:2,children:[(0,c.jsx)(O.Z,{variant:"h6",component:"h2",style:{marginBottom:I.spacing(1)},children:"Filters"}),b.children]})})]}):(0,c.jsx)(re.Z,{item:!0,lg:2,children:b.children})},D=b=>(0,c.jsx)(re.Z,{item:!0,xs:12,lg:10,children:b.children}),T=b=>(0,c.jsx)(re.Z,{container:!0,style:{position:"relative"},children:b.children});T.Filters=ne,T.Content=D;var k=t(23196),L=t(47842),V=t(25271),Se=t(51837);const We=(0,Se.uW)("catalog:entity-route-ref",()=>(0,r.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function qe(b){var E,I;return{kind:b.kind.toLocaleLowerCase("en-US"),namespace:(I=(E=b.metadata.namespace)===null||E===void 0?void 0:E.toLocaleLowerCase("en-US"))!==null&&I!==void 0?I:DEFAULT_NAMESPACE,name:b.metadata.name}}function H(b,E){const I=E==null?void 0:E.defaultKind;let M,te,ce;return"metadata"in b?(M=b.kind,te=b.metadata.namespace,ce=b.metadata.name):(M=b.kind,te=b.namespace,ce=b.name),(te===void 0||te==="")&&(te=V.zG),(E==null?void 0:E.defaultNamespace)!==void 0?(E==null?void 0:E.defaultNamespace)===te&&(te=void 0):te===V.zG&&(te=void 0),M=M.toLocaleLowerCase("en-US"),M=I&&I.toLocaleLowerCase("en-US")===M?void 0:M,`${M?`${M}:`:""}${te?`${te}/`:""}${ce}`}var _e=t(80030);const ut=(0,B.forwardRef)((b,E)=>{const{entityRef:I,defaultKind:M,title:te,children:ce,...oe}=b,ye=(0,r.tg)(We);let Ae,Ie,Ze;if(typeof I=="string"){const Be=(0,V.of)(I);Ae=Be.kind,Ie=Be.namespace,Ze=Be.name}else"metadata"in I?(Ae=I.kind,Ie=I.metadata.namespace,Ze=I.metadata.name):(Ae=I.kind,Ie=I.namespace,Ze=I.name);Ae=Ae.toLocaleLowerCase("en-US");var be;Ie=(be=Ie==null?void 0:Ie.toLocaleLowerCase("en-US"))!==null&&be!==void 0?be:V.zG;const Ve={kind:Ae,namespace:Ie,name:Ze},st=H({kind:Ae,namespace:Ie,name:Ze},{defaultKind:M}),it=(0,c.jsxs)(k.rU,{...oe,ref:E,to:ye(Ve),children:[ce,!ce&&(te!=null?te:st)]});return te?(0,c.jsx)(_e.ZP,{title:st,children:it}):it});var ze=t(64279);function ft(b){const{entityRefs:E,defaultKind:I,getTitle:M,...te}=b,ce=(0,r.h_)(W),{value:oe=new Array,loading:ye,error:Ae}=(0,ze.default)(async()=>{const Ie=E.reduce((be,Ve)=>typeof Ve=="object"&&"metadata"in Ve?be:[...be,(0,V.of)(Ve)],new Array),Ze=E.filter(be=>typeof be=="object"&&"metadata"in be);return Ie.length>0?[...(await ce.getEntities({filter:Ie.map(be=>({kind:be.kind,"metadata.namespace":be.namespace,"metadata.name":be.name}))})).items,...Ze]:Ze},[E]);return ye?(0,c.jsx)(k.Ex,{}):Ae?(0,c.jsx)(k.yu,{error:Ae}):(0,c.jsx)(c.Fragment,{children:oe.map((Ie,Ze)=>(0,c.jsxs)(B.Fragment,{children:[Ze>0&&", ",(0,c.jsx)(ut,{...te,defaultKind:I,entityRef:Ie,title:M(Ie)})]},Ze))})}function Re(b){const{entityRefs:E,defaultKind:I,fetchEntities:M,getTitle:te,...ce}=b;return M?(0,c.jsx)(ft,{...ce,defaultKind:I,entityRefs:E,getTitle:te}):(0,c.jsx)(c.Fragment,{children:E.map((oe,ye)=>(0,c.jsxs)(B.Fragment,{children:[ye>0&&", ",(0,c.jsx)(ut,{...ce,defaultKind:I,entityRef:oe,title:te?te(oe):void 0})]},ye))})}var ct=t(49280);class jt{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(E){(0,L.Z)(this,"value",void 0),this.value=E}}class vt{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(E){(0,L.Z)(this,"value",void 0),this.value=E}}class gt{filterEntity(E){var I;return this.values.every(M=>((I=E.metadata.tags)!==null&&I!==void 0?I:[]).includes(M))}toQueryValue(){return this.values}constructor(E){(0,L.Z)(this,"values",void 0),this.values=E}}class Et{filterEntity(E){const I=this.toUpperArray(this.value.split(/\s/)),M=this.toUpperArray([E.metadata.tags]),te=this.toUpperArray([E.metadata.name,E.metadata.title]);for(const ce of I)if(M.every(oe=>oe!==ce)&&te.every(oe=>!oe.includes(ce)))return!1;return!0}toUpperArray(E){return E.flat().filter(I=>Boolean(I)).map(I=>I.toLocaleUpperCase("en-US"))}constructor(E){_define_property(this,"value",void 0),this.value=E}}class Dt{filterEntity(E){return this.values.some(I=>(0,ct.hF)(E,V.S4).some(M=>H(M,{defaultKind:"group"})===I))}toQueryValue(){return this.values}constructor(E){(0,L.Z)(this,"values",void 0),this.values=E}}class Ge{filterEntity(E){return this.values.some(I=>{var M;return((M=E.spec)===null||M===void 0?void 0:M.lifecycle)===I})}toQueryValue(){return this.values}constructor(E){(0,L.Z)(this,"values",void 0),this.values=E}}class Wt{filterEntity(E){switch(this.value){case"owned":return this.isOwnedEntity(E);case"starred":return this.isStarredEntity(E);default:return!0}}toQueryValue(){return this.value}constructor(E,I,M){(0,L.Z)(this,"value",void 0),(0,L.Z)(this,"isOwnedEntity",void 0),(0,L.Z)(this,"isStarredEntity",void 0),this.value=E,this.isOwnedEntity=I,this.isStarredEntity=M}}class xe{filterEntity(E){var I;const M=(I=E.metadata.annotations)===null||I===void 0?void 0:I["backstage.io/orphan"];return M!==void 0&&this.value.toString()===M}constructor(E){(0,L.Z)(this,"value",void 0),this.value=E}}class pe{filterEntity(E){var I,M;const te=(E==null||(I=E.status)===null||I===void 0||(M=I.items)===null||M===void 0?void 0:M.length)>0;return te!==void 0&&this.value===te}constructor(E){(0,L.Z)(this,"value",void 0),this.value=E}}var De=t(96641),Je=t(76635),At=t.n(Je),wt=t(19126),rt=t.n(wt),yt=t(73557),Ot=t(69294),Gt=t(48760),It=t(90736);const on=(0,B.createContext)(void 0),Ut=b=>{const E=(0,It.default)(),I=(0,r.h_)(W),[M,te]=(0,B.useState)({}),ce=(0,yt.TH)();var oe;const ye=(0,B.useMemo)(()=>(oe=rt().parse(ce.search,{ignoreQueryPrefix:!0}).filters)!==null&&oe!==void 0?oe:{},[ce]),[Ae,Ie]=(0,B.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:Ze,error:be},Ve]=(0,Ot.default)(async()=>{const Be=(0,Je.compact)(Object.values(M)),mt=(0,ct.Gz)(Be),$t=(0,ct.wq)(Be),yn=(0,ct.wq)((0,Je.compact)(Object.values(Ae.appliedFilters))),un=Object.keys(M).reduce((_t,bn)=>{const Sn=M[bn];return Sn!=null&&Sn.toQueryValue&&(_t[bn]=Sn.toQueryValue()),_t},{});if((0,Je.isEqual)(yn,$t))Ie({appliedFilters:M,backendEntities:Ae.backendEntities,entities:Ae.backendEntities.filter(mt)});else{const _t=await I.getEntities({filter:$t});Ie({appliedFilters:M,backendEntities:_t.items,entities:_t.items.filter(mt)})}if(E()){var xn;const _t=rt().parse(ce.search,{ignoreQueryPrefix:!0}),bn=rt().stringify({..._t,filters:un},{addQueryPrefix:!0,arrayFormat:"repeat"}),Sn=`${window.location.pathname}${bn}`;(xn=window.history)===null||xn===void 0||xn.replaceState(null,document.title,Sn)}},[I,ye,M,Ae],{loading:!0});(0,Gt.Z)(Ve,10,[M]);const st=(0,B.useCallback)(Be=>{te(mt=>{const $t=typeof Be=="function"?Be(mt):Be;return{...mt,...$t}})},[]),it=(0,B.useMemo)(()=>({filters:Ae.appliedFilters,entities:Ae.entities,backendEntities:Ae.backendEntities,updateFilters:st,queryParameters:ye,loading:Ze,error:be}),[Ae,st,ye,Ze,be]);return(0,c.jsx)(on.Provider,{value:it,children:b.children})};function Vt(){const b=(0,B.useContext)(on);if(!b)throw new Error("useEntityList must be used within EntityListProvider");return b}var zn=t(18149),In=t.n(zn),an=t(829),Fn=t.n(an);function jn(){const b=(0,r.h_)(W),{filters:{kind:E,type:I},queryParameters:{type:M},updateFilters:te}=Vt(),ce=(0,B.useMemo)(()=>[M].flat().filter(Boolean),[M]);var oe;const[ye,Ae]=(0,B.useState)(ce.length?ce:(oe=I==null?void 0:I.getTypes())!==null&&oe!==void 0?oe:[]);(0,B.useEffect)(()=>{ce.length&&Ae(ce)},[ce]);const[Ie,Ze]=(0,B.useState)([]),be=(0,B.useMemo)(()=>E==null?void 0:E.value,[E]),{error:Ve,loading:st,value:it}=(0,ze.default)(async()=>be?await b.getEntityFacets({filter:{kind:be},facets:["spec.type"]}).then($t=>$t.facets["spec.type"]||[]):[],[be,b]),Be=(0,B.useRef)(it);return(0,B.useEffect)(()=>{const mt=Be.current;if(Be.current=it,st||!be||mt===it||!it)return;const $t=[...new Set(Fn()(it,un=>-un.count).map(un=>un.value.toLocaleLowerCase("en-US")))];Ze($t);const yn=ye.filter(un=>$t.includes(un));In()(ye,yn)||Ae(yn)},[st,be,ye,Ae,it]),(0,B.useEffect)(()=>{te({type:ye.length?new vt(ye):void 0})},[ye,te]),{loading:st,error:Ve,availableTypes:Ie,selectedTypes:ye,setSelectedTypes:Ae}}const Un=20;function Pn(b,E){var I,M;const te=E==null||(I=E.type)===null||I===void 0?void 0:I.toLocaleLowerCase("en-US"),ce=E==null||(M=E.kind)===null||M===void 0?void 0:M.toLocaleLowerCase("en-US"),oe=(0,r.h_)(W),{loading:ye,value:Ae,error:Ie}=(0,ze.default)(async()=>{var Ze;const be=(Ze=b.relations)===null||Ze===void 0?void 0:Ze.map(Be=>({type:Be.type,target:(0,V.of)(Be.targetRef)})).filter(Be=>(!te||Be.type.toLocaleLowerCase("en-US")===te)&&(!ce||Be.target.kind===ce));if(!be)return[];const Ve=Object.values((0,Je.groupBy)(be,({target:Be})=>`${Be.kind}:${Be.namespace}`.toLocaleLowerCase("en-US"))),st=[];for(const Be of Ve)st.push({kind:Be[0].target.kind,namespace:Be[0].target.namespace,nameBatches:(0,Je.chunk)(Be.map(mt=>mt.target.name),Un)});return(await Promise.all(st.flatMap(Be=>Be.nameBatches.map(mt=>oe.getEntities({filter:{kind:Be.kind,"metadata.namespace":Be.namespace,"metadata.name":mt}}))))).flatMap(Be=>Be.items)},[b,te,ce]);return{entities:Ae,loading:ye,error:Ie}}var Jn=t(72164);function at(b){return typeof b=="string"?b:(0,V.eE)(b)}function Mn(){const b=(0,r.h_)(P),E=(0,Jn.Z)(b.starredEntitie$(),new Set),I=(0,B.useCallback)(te=>E.has(at(te)),[E]),M=(0,B.useCallback)(te=>b.toggleStarred(at(te)).then(),[b]);return{starredEntities:E,toggleStarredEntity:M,isStarredEntity:I}}function Ln(b){return typeof b=="string"?b:(0,V.eE)(b)}function Wn(b){const E=(0,r.h_)(P),[I,M]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{const ce=E.starredEntitie$().subscribe({next(oe){M(oe.has(Ln(b)))}});return()=>{ce.unsubscribe()}},[b,E]),{toggleStarredEntity:(0,B.useCallback)(()=>E.toggleStarred(Ln(b)).then(),[b,E]),isStarredEntity:I}}var En=t(75435);function fn(){const b=(0,r.h_)(r.$4),{loading:E,value:I}=(0,ze.default)(async()=>{const{ownershipEntityRefs:te}=await b.getBackstageIdentity();return te},[]),M=(0,B.useMemo)(()=>{const te=new Set(I!=null?I:[]);return ce=>{const oe=(0,En.h)(ce,V.S4).map(V.eE);for(const ye of oe)if(te.has(ye))return!0;return!1}},[I]);return(0,B.useMemo)(()=>({loading:E,isOwnedEntity:M}),[E,M])}function vn(){const b=(0,r.h_)(W),{error:E,loading:I,value:M}=(0,ze.default)(async()=>await b.getEntityFacets({facets:["kind"]}).then(ce=>{var oe;return((oe=ce.facets.kind)===null||oe===void 0?void 0:oe.map(ye=>ye.value).sort())||[]}),[b]);return{loading:I,error:E,allKinds:M!=null?M:[]}}function kn(b,E,I){let M=b;return E&&(M=M.filter(ce=>E.some(oe=>oe.toLocaleLowerCase("en-US")===ce.toLocaleLowerCase("en-US")))),I&&!b.some(ce=>ce.toLocaleLowerCase("en-US")===I.toLocaleLowerCase("en-US"))&&(M=M.concat([I])),M.sort().reduce((ce,oe)=>(ce[oe.toLocaleLowerCase("en-US")]=oe,ce),{})}function ln(b){var E;const{filters:I,queryParameters:{kind:M},updateFilters:te}=Vt(),ce=(0,B.useMemo)(()=>[M].flat()[0],[M]);var oe;const[ye,Ae]=(0,B.useState)((oe=ce!=null?ce:(E=I.kind)===null||E===void 0?void 0:E.value)!==null&&oe!==void 0?oe:b.initialFilter);(0,B.useEffect)(()=>{ce&&Ae(ce)},[ce]),(0,B.useEffect)(()=>{var Ve;if(!((Ve=I.kind)===null||Ve===void 0)&&Ve.value){var st;Ae((st=I.kind)===null||st===void 0?void 0:st.value)}},[I.kind]),(0,B.useEffect)(()=>{te({kind:ye?new jt(ye):void 0})},[ye,te]);const{allKinds:Ie,loading:Ze,error:be}=vn();return{loading:Ze,error:be,allKinds:Ie!=null?Ie:[],selectedKind:ye,setSelectedKind:Ae}}const Vn=b=>{const{allowedKinds:E,hidden:I,initialFilter:M="component"}=b,te=(0,r.h_)(r.$v),{error:ce,allKinds:oe,selectedKind:ye,setSelectedKind:Ae}=ln({initialFilter:M});if((0,B.useEffect)(()=>{ce&&te.post({message:"Failed to load entity kinds",severity:"error"})},[ce,te]),ce)return null;const Ie=kn(oe,E,ye),Ze=Object.keys(Ie).map(be=>({value:be,label:Ie[be]}));return I?null:(0,c.jsx)(R.Z,{pb:1,pt:1,children:(0,c.jsx)(k.Ph,{label:"Kind",items:Ze,selected:ye.toLocaleLowerCase("en-US"),onChange:be=>Ae(String(be))})})};var ge=t(79692),ie=t(5806),Le=t(21324),Fe=t(86619),Ke=t(19996),_=t(25505),F=t(38016),fe=t(88013);const je=(0,ge.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),Qe=(0,c.jsx)(_.Z,{fontSize:"small"}),et=(0,c.jsx)(Ke.Z,{fontSize:"small"}),Zt=b=>{var E;const{initialFilter:I=[]}=b,M=je(),{updateFilters:te,backendEntities:ce,filters:oe,queryParameters:{lifecycles:ye}}=Vt(),Ae=(0,B.useMemo)(()=>[ye].flat().filter(Boolean),[ye]);var Ie;const[Ze,be]=(0,B.useState)(Ae.length?Ae:(Ie=(E=oe.lifecycles)===null||E===void 0?void 0:E.values)!==null&&Ie!==void 0?Ie:I);(0,B.useEffect)(()=>{Ae.length&&be(Ae)},[Ae]);const Ve=(0,B.useMemo)(()=>[...new Set(ce.map(st=>{var it;return(it=st.spec)===null||it===void 0?void 0:it.lifecycle}).filter(Boolean))].sort(),[ce]);return(0,B.useEffect)(()=>{te({lifecycles:Ze.length&&Ve.length?new Ge(Ze):void 0})},[Ze,te,Ve]),Ve.length?(0,c.jsx)(R.Z,{pb:1,pt:1,children:(0,c.jsxs)(O.Z,{variant:"button",component:"label",children:["Lifecycle",(0,c.jsx)(fe.ZP,{multiple:!0,disableCloseOnSelect:!0,options:Ve,value:Ze,onChange:(st,it)=>be(it),renderOption:(st,{selected:it})=>(0,c.jsx)(ie.Z,{control:(0,c.jsx)(Le.Z,{icon:Qe,checkedIcon:et,checked:it}),onClick:Be=>Be.preventDefault(),label:st}),size:"small",popupIcon:(0,c.jsx)(F.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:st=>(0,c.jsx)(Fe.Z,{...st,className:M.input,variant:"outlined"})})]})}):null},Ht=(0,ge.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),sn=(0,c.jsx)(_.Z,{fontSize:"small"}),ee=(0,c.jsx)(Ke.Z,{fontSize:"small"}),Q=()=>{var b;const E=Ht(),{updateFilters:I,backendEntities:M,filters:te,queryParameters:{owners:ce}}=Vt(),oe=(0,B.useMemo)(()=>[ce].flat().filter(Boolean),[ce]);var ye;const[Ae,Ie]=(0,B.useState)(oe.length?oe:(ye=(b=te.owners)===null||b===void 0?void 0:b.values)!==null&&ye!==void 0?ye:[]);(0,B.useEffect)(()=>{oe.length&&Ie(oe)},[oe]);const Ze=(0,B.useMemo)(()=>[...new Set(M.flatMap(be=>(0,ct.hF)(be,V.S4).map(Ve=>H(Ve,{defaultKind:"group"}))).filter(Boolean))].sort(),[M]);return(0,B.useEffect)(()=>{I({owners:Ae.length&&Ze.length?new Dt(Ae):void 0})},[Ae,I,Ze]),Ze.length?(0,c.jsx)(R.Z,{pb:1,pt:1,children:(0,c.jsxs)(O.Z,{variant:"button",component:"label",children:["Owner",(0,c.jsx)(fe.ZP,{multiple:!0,disableCloseOnSelect:!0,options:Ze,value:Ae,onChange:(be,Ve)=>Ie(Ve),renderOption:(be,{selected:Ve})=>(0,c.jsx)(ie.Z,{control:(0,c.jsx)(Le.Z,{icon:sn,checkedIcon:ee,checked:Ve}),onClick:st=>st.preventDefault(),label:be}),size:"small",popupIcon:(0,c.jsx)(F.Z,{"data-testid":"owner-picker-expand"}),renderInput:be=>(0,c.jsx)(Fe.Z,{...be,className:E.input,variant:"outlined"})})]})}):null},se=b=>{const E=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:E(getCompoundEntityRef(b.entity)),children:_jsx(InfoIcon,{})})},g=b=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${b.email}`,to:`mailto:${b.email}`,children:_jsx(EmailIcon,{})}),w=b=>{var E;const I=(E=b.entity.spec.profile)===null||E===void 0?void 0:E.email;return I?_jsx(EmailCardAction,{email:I}):null},Y=b=>{var E;const I=(E=b.entity.spec.profile)===null||E===void 0?void 0:E.email;return I?_jsx(EmailCardAction,{email:I}):null},J=(0,ge.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),me=4,ve=b=>{var E,I,M;const{entityRef:te,children:ce,delayTime:oe=500}=b,ye=J(),Ae=useApiHolder(),Ie=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[Ze,be]=useState(!1),Ve=useMemo(()=>debounce(()=>be(!0),oe),[oe]),[{loading:st,error:it,value:Be},mt]=useAsyncFn(async()=>{const yn=Ae.get(catalogApiRef);if(yn){const un=await yn.getEntityByRef(te);if(!un)throw new Error(`${te} not found`);return un}},[Ae,te]),$t=()=>{be(!1),Ve.cancel()};return useEffect(()=>{Ie.isOpen&&!Be&&!it&&!st&&mt()},[Ie.isOpen,mt,Be,it,st]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:Ve,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Ie),children:ce})}),Ze&&_jsx(HoverPopover,{PaperProps:{className:ye.popoverPaper},...bindPopover(Ie),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:$t,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[it&&_jsx(ResponseErrorPanel,{error:it}),st&&_jsx(Progress,{}),Be&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:Be.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:Be.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:Be.kind}),Be.metadata.description&&_jsx(Typography,{className:ye.descriptionTypography,paragraph:!0,children:Be.metadata.description}),_jsx(Typography,{children:(E=Be.spec)===null||E===void 0?void 0:E.type}),_jsxs(Box,{marginTop:"0.5em",children:[(Be.metadata.tags||[]).slice(0,me).map(yn=>_jsx(Chip,{size:"small",label:yn},yn)),((I=Be.metadata.tags)===null||I===void 0?void 0:I.length)&&((M=Be.metadata.tags)===null||M===void 0?void 0:M.length)>me&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!it&&Be&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity(Be)&&_jsx(UserCardActions,{entity:Be}),isGroupEntity(Be)&&_jsx(GroupCardActions,{entity:Be}),_jsx(EntityCardActions,{entity:Be})]})})]})})]})},Ue=(0,ge.Z)(b=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),ot=()=>{var b;const E=Ue(),{filters:I,updateFilters:M}=useEntityList();var te;const[ce,oe]=useState((te=(b=I.text)===null||b===void 0?void 0:b.value)!==null&&te!==void 0?te:"");return useDebounce(()=>{M({text:ce.length?new EntityTextFilter(ce):void 0})},250,[ce,M]),_jsx(Toolbar,{className:E.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:E.input,placeholder:"Search",autoComplete:"off",onChange:ye=>oe(ye.target.value),value:ce,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>oe(""),edge:"end",disabled:ce.length===0,children:_jsx(Clear,{})})})})})})},tt=Object.freeze({createEntityRefColumn(b){const{defaultKind:E}=b;function I(M){var te;return((te=M.metadata)===null||te===void 0?void 0:te.title)||H(M,{defaultKind:E})}return{title:"Name",highlight:!0,customFilterAndSearch(M,te){return I(te).includes(M)},customSort(M,te){return I(M).localeCompare(I(te))},render:M=>{var te;return(0,c.jsx)(ut,{entityRef:M,defaultKind:E,title:(te=M.metadata)===null||te===void 0?void 0:te.title})}}},createEntityRelationColumn(b){const{title:E,relation:I,defaultKind:M,filter:te}=b;function ce(ye){return(0,ct.hF)(ye,I,te)}function oe(ye){return ce(ye).map(Ae=>H(Ae,{defaultKind:M})).join(", ")}return{title:E,customFilterAndSearch(ye,Ae){return oe(Ae).includes(ye)},customSort(ye,Ae){return oe(ye).localeCompare(oe(Ae))},render:ye=>(0,c.jsx)(Re,{entityRefs:ce(ye),defaultKind:M})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:V.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:V.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:V.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:b=>(0,c.jsx)(k.Or,{text:b.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),xt=[tt.createEntityRefColumn({defaultKind:"system"}),tt.createDomainColumn(),tt.createOwnerColumn(),tt.createMetadataDescriptionColumn()],lt=[tt.createEntityRefColumn({defaultKind:"component"}),tt.createSystemColumn(),tt.createOwnerColumn(),tt.createSpecTypeColumn(),tt.createSpecLifecycleColumn(),tt.createMetadataDescriptionColumn()],nt=(0,ge.Z)(b=>({empty:{padding:b.spacing(2),display:"flex",justifyContent:"center"}})),Oe=b=>{const{entities:E,title:I,emptyContent:M,variant:te="gridItem",columns:ce}=b,oe=nt(),ye={minWidth:"0",width:"100%"};return te==="gridItem"&&(ye.height="calc(100% - 10px)"),(0,c.jsx)(k.iA,{columns:ce,title:I,style:ye,emptyContent:M&&(0,c.jsx)("div",{className:oe.empty,children:M}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:E})};Oe.columns=tt,Oe.systemEntityColumns=xt,Oe.componentEntityColumns=lt;const Tt=(0,c.jsx)(_.Z,{fontSize:"small"}),Kt=(0,c.jsx)(Ke.Z,{fontSize:"small"});function Rt({selected:b}){return(0,c.jsx)(Le.Z,{icon:Tt,checkedIcon:Kt,checked:b})}const Pt=(0,B.memo)(b=>{const{selected:E,value:I,availableOptions:M,showCounts:te}=b,ce=te?`${I} (${M==null?void 0:M[I]})`:I;return(0,c.jsx)(ie.Z,{control:(0,c.jsx)(Rt,{selected:E}),label:ce,onClick:oe=>oe.preventDefault()})});var tn=t(72779),Mt=t.n(tn);const ht=(0,ge.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function Xe(b){const E=ht();return(0,c.jsx)(Fe.Z,{variant:"outlined",...b,className:Mt()(E.input,b.className)})}function Bt(b){var E;const{label:I,name:M,path:te,showCounts:ce,Filter:oe,InputProps:ye}=b,{updateFilters:Ae,filters:Ie,queryParameters:{[M]:Ze}}=Vt(),be=(0,r.h_)(W),{value:Ve}=(0,ze.default)(async()=>{var xn;const _t=te,{facets:bn}=await be.getEntityFacets({facets:[_t],filter:(xn=Ie.kind)===null||xn===void 0?void 0:xn.getCatalogFilters()});return Object.fromEntries(bn[_t].map(({value:Sn,count:br})=>[Sn,br]))},[Ie.kind]),st=(0,B.useMemo)(()=>[Ze].flat().filter(Boolean),[Ze]);var it;const[Be,mt]=(0,B.useState)(st.length?st:(it=(E=Ie[M])===null||E===void 0?void 0:E.values)!==null&&it!==void 0?it:[]);(0,B.useEffect)(()=>{st.length&&!At().isEqual(Be,st)&&mt(st)},[Be,st]);const $t=Object.keys(Ve!=null?Ve:{}),yn=Be.length&&$t.length;(0,B.useEffect)(()=>{Ae({[M]:yn?new oe(Be):void 0})},[M,yn,Be,oe,Ae]);const un=Ie[M];return un&&typeof un=="object"&&!("values"in un)||!$t.length?null:(0,c.jsx)(R.Z,{pb:1,pt:1,children:(0,c.jsxs)(O.Z,{variant:"button",component:"label",children:[I,(0,c.jsx)(fe.ZP,{multiple:!0,disableCloseOnSelect:!0,options:$t,value:Be,onChange:(xn,_t)=>mt(_t),renderOption:(xn,{selected:_t})=>(0,c.jsx)(Pt,{selected:_t,value:xn,availableOptions:Ve,showCounts:!!ce}),size:"small",popupIcon:(0,c.jsx)(F.Z,{"data-testid":`${String(M)}-picker-expand`}),renderInput:xn=>(0,c.jsx)(Xe,{...xn,...ye})})]})})}const qt=(0,ge.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),An=b=>{const E=qt();return(0,c.jsx)(Bt,{label:"Tags",name:"tags",path:"metadata.tags",Filter:gt,showCounts:b.showCounts,InputProps:{className:E.input}})},gn=b=>{const{hidden:E,initialFilter:I}=b,M=(0,r.h_)(r.$v),{error:te,availableTypes:ce,selectedTypes:oe,setSelectedTypes:ye}=jn();if((0,B.useEffect)(()=>{te&&M.post({message:"Failed to load entity types",severity:"error"}),I&&ye([I])},[te,M,I,ye]),ce.length===0||te)return null;const Ae=[{value:"all",label:"all"},...ce.map(Ze=>({value:Ze,label:Ze}))];var Ie;return E?null:(0,c.jsx)(R.Z,{pb:1,pt:1,children:(0,c.jsx)(k.Ph,{label:"Type",items:Ae,selected:(Ie=Ae.length>1?oe[0]:void 0)!==null&&Ie!==void 0?Ie:"all",onChange:Ze=>ye(Ze==="all"?[]:[String(Ze)])})})};var wn=t(15459),Qn=t(61837),Hn=t(11640),cn=t(28347);const gr=(0,wn.Z)({root:{color:"#f3ba37"}})(Hn.Z),mr=b=>{const{toggleStarredEntity:E,isStarredEntity:I}=Wn(b.entity);return(0,c.jsx)(Qn.Z,{"aria-label":"favorite",color:"inherit",...b,onClick:()=>E(),children:(0,c.jsx)(_e.ZP,{title:I?"Remove from favorites":"Add to favorites",children:I?(0,c.jsx)(gr,{}):(0,c.jsx)(cn.Z,{})})})};var S=t(8629),h=t(79249),x=t(38724),j=t(99152),X=t(6487),Ce=t(49429),he=t(55999),Ne=t(39412);const pt=Ne.Z;function zt(b,E){if(b)return b.toLocaleLowerCase("en-US");if(E)try{return(0,V.of)(E).kind.toLocaleLowerCase("en-US")}catch{return}}function dn(b,E){const I=(0,r.qD)(),M=zt(b,E);return M&&I.getSystemIcon(`kind:${M}`)||pt}function On(b){const{kind:E,entityRef:I,...M}=b,te=dn(E,I);return(0,c.jsx)(te,{...M})}const vr=(0,ge.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 Pr(b){const E=(0,r.h_)(W),I=(0,V.eE)(b),{loading:M,error:te,value:ce}=(0,ze.default)(async()=>{const oe=await E.getEntityAncestors({entityRef:I}),ye=new Array,Ae=new Array;for(const Ie of oe.items){const Ze=(0,V.eE)(Ie.entity),be=Ze===oe.rootEntityRef;ye.push({id:Ze,root:be,...Ie.entity});for(const Ve of Ie.parentEntityRefs)Ae.push({from:Ze,to:Ve})}return{nodes:ye,edges:Ae}},[I]);return{loading:M,error:te,nodes:(ce==null?void 0:ce.nodes)||[],edges:(ce==null?void 0:ce.edges)||[]}}function eo({node:b}){const E=vr(),I=(0,yt.s0)(),M=(0,r.tg)(We),[te,ce]=(0,B.useState)(0),[oe,ye]=(0,B.useState)(0),Ae=(0,B.useRef)(null);(0,B.useLayoutEffect)(()=>{if(Ae.current){let{height:mt,width:$t}=Ae.current.getBBox();mt=Math.round(mt),$t=Math.round($t),(mt!==oe||$t!==te)&&(ce($t),ye(mt))}},[te,oe]);const Ie=10,Ze=oe,be=Ze+Ie,Ve=be+te+Ie*2,st=oe+Ie*2,it=b.metadata.title||(b.kind&&b.metadata.name&&b.metadata.namespace?H({kind:b.kind,name:b.metadata.name,namespace:b.metadata.namespace||""}):b.id),Be=()=>{I(M({kind:b.kind,namespace:b.metadata.namespace||V.zG,name:b.metadata.name}))};return(0,c.jsxs)("g",{onClick:Be,className:E.clickable,children:[(0,c.jsx)("rect",{className:Mt()(E.node,b.root?"secondary":"primary"),width:Ve,height:st,rx:10}),(0,c.jsx)(On,{kind:b.kind,y:Ie,x:Ie,width:Ze,height:Ze,className:Mt()(E.text,b.root?"secondary":"primary")}),(0,c.jsx)("text",{ref:Ae,className:Mt()(E.text,b.root?"secondary":"primary"),y:st/2,x:be+(te+Ie*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:it})]})}function jo(b){const{loading:E,error:I,nodes:M,edges:te}=Pr(b.entity);return E?(0,c.jsx)(k.Ex,{}):I?(0,c.jsx)(k.Gk,{error:I}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(he.Z,{variant:"h2",children:"Ancestry"}),(0,c.jsxs)(he.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,c.jsx)(k.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,c.jsx)(R.Z,{mt:4,children:(0,c.jsx)(k.mn,{nodes:M,edges:te,renderNode:eo,direction:k.NX.Nm.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var ir=t(11776),Gn=t(38402),Xn=t(86136),ar=t(99688),Nr=t(49378),Eo=t(54506),yr=t(94339),_o=t(24579),Ao=t(27685);const to=(0,ge.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 E=to();return(0,c.jsx)(Nr.Z,{...b,primaryTypographyProps:{className:E.monospace},secondaryTypographyProps:{className:E.monospace}})}function Lr(b){const E=to();return(0,c.jsx)(Eo.Z,{className:E.monospace,children:b.children})}function kr(b){return(0,c.jsx)(R.Z,{mt:2,children:(0,c.jsx)(yr.Z,{variant:"outlined",children:(0,c.jsxs)(_o.Z,{children:[(0,c.jsxs)(O.Z,{variant:"h6",gutterBottom:!0,children:[b.title,b.helpLink&&(0,c.jsx)(Ur,{to:b.helpLink})]}),b.children]})})})}function To(b){if(b.match(/^url:https?:\/\//))return b.slice(4);if(b.match(/^https?:\/\//))return b}function Fr(b){const[E,I]=b.entry,M=To(I);return(0,c.jsxs)(Gn.Z,{children:[b.indent&&(0,c.jsx)(Xn.Z,{}),(0,c.jsx)(qn,{primary:E,secondary:M?(0,c.jsx)(k.rU,{to:M,children:I}):I})]})}function Ur(b){const E=to();return(0,c.jsx)(k.rU,{to:b.to,className:E.helpIcon,children:(0,c.jsx)(Ao.Z,{fontSize:"inherit"})})}const lr=(0,ge.Z)({root:{display:"flex",flexDirection:"column"}});function Mr(b){var E,I;const M=(0,r.h_)(W),te=(0,V.eE)(b),ce=(E=b.metadata.annotations)===null||E===void 0?void 0:E[V.P1],oe=(I=b.metadata.annotations)===null||I===void 0?void 0:I[V.q1],{loading:ye,error:Ae,value:Ie}=(0,ze.default)(async()=>!ce&&!oe?[]:(await M.getEntities({filter:[...ce?[{[`metadata.annotations.${V.P1}`]:ce}]:[],...oe?[{[`metadata.annotations.${V.q1}`]:oe}]:[]]})).items,[ce,oe]);return{loading:ye,error:Ae,location:ce,originLocation:oe,colocatedEntities:Ie==null?void 0:Ie.filter(Ze=>(0,V.eE)(Ze)!==te)}}function zr(b){return(0,c.jsxs)(ir.Z,{dense:!0,children:[b.header&&(0,c.jsx)(Fr,{entry:b.header},"header"),b.entities.map(E=>(0,c.jsxs)(Gn.Z,{children:[(0,c.jsx)(Xn.Z,{children:(0,c.jsx)(On,{kind:E.kind})}),(0,c.jsx)(qn,{primary:(0,c.jsx)(ut,{entityRef:E})})]},(0,V.eE)(E)))]})}function Ro(b){const{entity:E}=b,{loading:I,error:M,location:te,originLocation:ce,colocatedEntities:oe}=Mr(E);if(I)return(0,c.jsx)(k.Ex,{});if(M)return(0,c.jsx)(k.Gk,{error:M});if(!te&&!ce)return(0,c.jsx)(ar.Z,{severity:"warning",children:"Entity had no location information."});if(!(oe!=null&&oe.length))return(0,c.jsx)(ar.Z,{severity:"info",children:"There were no other entities on this location."});if(te===ce)return(0,c.jsx)(zr,{entities:oe});const ye=oe.filter(Ie=>{var Ze;return((Ze=Ie.metadata.annotations)===null||Ze===void 0?void 0:Ze[V.P1])===te}),Ae=oe.filter(Ie=>{var Ze;return((Ze=Ie.metadata.annotations)===null||Ze===void 0?void 0:Ze[V.q1])===ce});return(0,c.jsxs)(c.Fragment,{children:[ye.length>0&&(0,c.jsx)(zr,{entities:ye,header:["At the same location",te]}),Ae.length>0&&(0,c.jsx)(zr,{entities:Ae,header:["At the same origin",ce]})]})}function Io(b){const E=lr();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(he.Z,{variant:"h2",children:"Colocated"}),(0,c.jsx)(he.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,c.jsx)("div",{className:E.root,children:(0,c.jsx)(Ro,{entity:b.entity})})]})}function Po(b){return Object.fromEntries([...Object.entries(b)].sort((E,I)=>E[0]<I[0]?-1:1))}function Lo(b){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(he.Z,{variant:"h2",children:"Entity as JSON"}),(0,c.jsx)(he.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,c.jsx)(he.Z,{children:(0,c.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,c.jsx)(k.Oi,{text:JSON.stringify(Po(b.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var no=t(3440),es=t.n(no);const xr=(0,ge.Z)({root:{display:"flex",flexDirection:"column"}});function ko(b){var E,I;const M=xr(),{apiVersion:te,kind:ce,metadata:oe,spec:ye,relations:Ae=[],status:Ie={}}=b.entity,Ze=es()(Fn()(Ae,be=>be.targetRef),"type");return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(he.Z,{variant:"h2",children:"Overview"}),(0,c.jsxs)("div",{className:M.root,children:[(0,c.jsx)(kr,{title:"Identity",children:(0,c.jsxs)(ir.Z,{dense:!0,children:[(0,c.jsx)(Gn.Z,{children:(0,c.jsx)(qn,{primary:"apiVersion",secondary:te})}),(0,c.jsx)(Gn.Z,{children:(0,c.jsx)(qn,{primary:"kind",secondary:ce})}),(ye==null?void 0:ye.type)&&(0,c.jsx)(Gn.Z,{children:(0,c.jsx)(qn,{primary:"spec.type",secondary:ye.type})}),oe.uid&&(0,c.jsx)(Gn.Z,{children:(0,c.jsx)(qn,{primary:"uid",secondary:oe.uid})}),oe.etag&&(0,c.jsx)(Gn.Z,{children:(0,c.jsx)(qn,{primary:"etag",secondary:oe.etag})})]})}),(0,c.jsxs)(kr,{title:"Metadata",children:[!!Object.keys(oe.annotations||{}).length&&(0,c.jsx)(ir.Z,{dense:!0,subheader:(0,c.jsxs)(Lr,{children:["Annotations",(0,c.jsx)(Ur,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(oe.annotations).map(be=>(0,c.jsx)(Fr,{indent:!0,entry:be},be[0]))}),!!Object.keys(oe.labels||{}).length&&(0,c.jsx)(ir.Z,{dense:!0,subheader:(0,c.jsx)(Lr,{children:"Labels"}),children:Object.entries(oe.labels).map(be=>(0,c.jsx)(Fr,{indent:!0,entry:be},be[0]))}),!!(!((E=oe.tags)===null||E===void 0)&&E.length)&&(0,c.jsx)(ir.Z,{dense:!0,subheader:(0,c.jsx)(Lr,{children:"Tags"}),children:oe.tags.map((be,Ve)=>(0,c.jsxs)(Gn.Z,{children:[(0,c.jsx)(Xn.Z,{}),(0,c.jsx)(qn,{primary:be})]},`${be}-${Ve}`))})]}),!!Ae.length&&(0,c.jsx)(kr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Ze).map(([be,Ve],st)=>(0,c.jsx)("div",{children:(0,c.jsx)(ir.Z,{dense:!0,subheader:(0,c.jsx)(Lr,{children:be}),children:Ve.map(it=>(0,c.jsxs)(Gn.Z,{children:[(0,c.jsx)(Xn.Z,{children:(0,c.jsx)(On,{entityRef:it.targetRef})}),(0,c.jsx)(qn,{primary:(0,c.jsx)(ut,{entityRef:it.targetRef})})]},it.targetRef))})},st))}),!!(!((I=Ie.items)===null||I===void 0)&&I.length)&&(0,c.jsx)(kr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Ie.items.map((be,Ve)=>(0,c.jsxs)("div",{children:[(0,c.jsxs)(O.Z,{children:[be.level,": ",be.type]}),(0,c.jsx)(R.Z,{ml:2,children:be.message})]},Ve))})]})]})}var ro=t(72847);function Oo(b){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(he.Z,{variant:"h2",children:"Entity as YAML"}),(0,c.jsx)(he.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,c.jsx)(he.Z,{children:(0,c.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,c.jsx)(k.Oi,{text:ro.ZP.stringify(Po(b.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const oo=(0,ge.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 cr(b){const{children:E,value:I,index:M,...te}=b,ce=oo();return(0,c.jsx)("div",{role:"tabpanel",hidden:I!==M,id:`vertical-tabpanel-${M}`,"aria-labelledby":`vertical-tab-${M}`,className:ce.tabContents,...te,children:I===M&&(0,c.jsx)(R.Z,{pl:3,pr:3,children:E})})}function Cr(b){return{id:`vertical-tab-${b}`,"aria-controls":`vertical-tabpanel-${b}`}}function Zo(b){const E=oo(),[I,M]=B.useState(0);return(0,B.useEffect)(()=>{M(0)},[b.open]),b.entity?(0,c.jsxs)(S.Z,{fullWidth:!0,maxWidth:"xl",open:b.open,onClose:b.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:E.fullHeightDialog},children:[(0,c.jsx)(h.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,c.jsx)(x.Z,{dividers:!0,children:(0,c.jsxs)("div",{className:E.root,children:[(0,c.jsxs)(j.Z,{orientation:"vertical",variant:"scrollable",value:I,onChange:(te,ce)=>M(ce),"aria-label":"Inspector options",className:E.tabs,children:[(0,c.jsx)(X.Z,{label:"Overview",...Cr(0)}),(0,c.jsx)(X.Z,{label:"Ancestry",...Cr(1)}),(0,c.jsx)(X.Z,{label:"Colocated",...Cr(2)}),(0,c.jsx)(X.Z,{label:"Raw JSON",...Cr(3)}),(0,c.jsx)(X.Z,{label:"Raw YAML",...Cr(4)})]}),(0,c.jsx)(cr,{value:I,index:0,children:(0,c.jsx)(ko,{entity:b.entity})}),(0,c.jsx)(cr,{value:I,index:1,children:(0,c.jsx)(jo,{entity:b.entity})}),(0,c.jsx)(cr,{value:I,index:2,children:(0,c.jsx)(Io,{entity:b.entity})}),(0,c.jsx)(cr,{value:I,index:3,children:(0,c.jsx)(Lo,{entity:b.entity})}),(0,c.jsx)(cr,{value:I,index:4,children:(0,c.jsx)(Oo,{entity:b.entity})})]})}),(0,c.jsx)(Ce.Z,{children:(0,c.jsx)(K.Z,{onClick:b.onClose,color:"primary",children:"Close"})})]}):null}var Wr=t(85256);function Bo(b){var E;const I=(0,r.h_)(W),M=(E=b.metadata.annotations)===null||E===void 0?void 0:E[V.q1],te=b.metadata.uid,ce=M==="bootstrap:bootstrap",oe=(0,ze.default)(async()=>{const it=I.getLocationByRef(M);let Be;if(!M)Be=Promise.resolve([]);else{const mt=`metadata.annotations.${V.q1}`;Be=I.getEntities({filter:{[mt]:M},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then($t=>$t.items)}return Promise.all([it,Be]).then(([mt,$t])=>({location:mt,colocatedEntities:$t}))},[I,b]),ye=(0,B.useCallback)(async function(){const{location:Be}=oe.value;await I.removeLocationById(Be.id)},[I,oe]),Ae=(0,B.useCallback)(async function(){await I.removeEntityByUid(te)},[I,te]);if(ce)return{type:"bootstrap",location:M,deleteEntity:Ae};const{loading:Ie,error:Ze,value:be}=oe;if(Ie)return{type:"loading"};if(Ze)return{type:"error",error:Ze};const{location:Ve,colocatedEntities:st}=be;return Ve?{type:"unregister",location:M,colocatedEntities:st.map(V.iB),unregisterLocation:ye,deleteEntity:Ae}:{type:"only-delete",deleteEntity:Ae}}var Or=t(23054);const Yt=(0,ge.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),ts=({entity:b,onConfirm:E,onClose:I})=>{const M=(0,r.h_)(r.$v),te=(0,r.h_)(r.Ds),ce=Yt(),oe=Bo(b),[ye,Ae]=(0,B.useState)(!1),[Ie,Ze]=(0,B.useState)(!1);var be;const Ve=(be=te.getOptionalString("app.title"))!==null&&be!==void 0?be:"Backstage",st=(0,B.useCallback)(async function(){if("unregisterLocation"in oe){Ze(!0);try{await oe.unregisterLocation(),E()}catch($t){(0,Or.BD)($t),M.post({message:$t.message})}finally{Ze(!1)}}},[M,E,oe]),it=(0,B.useCallback)(async function(){if("deleteEntity"in oe){Ze(!0);try{await oe.deleteEntity(),E()}catch($t){(0,Or.BD)($t),M.post({message:$t.message})}finally{Ze(!1)}}},[M,E,oe]),Be=()=>(0,c.jsx)(Ce.Z,{className:ce.dialogActions,children:(0,c.jsx)(K.Z,{onClick:I,color:"primary",children:"Cancel"})});return oe.type==="loading"?(0,c.jsx)(k.Ex,{}):oe.type==="error"?(0,c.jsx)(k.Gk,{error:oe.error}):oe.type==="bootstrap"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(ar.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',oe.location,'"). If you believe this is in error, please contact the ',Ve," ","integrator."]}),(0,c.jsxs)(R.Z,{marginTop:2,children:[!ye&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(K.Z,{variant:"text",size:"small",color:"primary",className:ce.advancedButton,onClick:()=>Ae(!0),children:"Advanced Options"}),(0,c.jsx)(Be,{})]}),ye&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(he.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,c.jsx)(K.Z,{variant:"contained",color:"secondary",disabled:Ie,onClick:it,children:"Delete Entity"}),(0,c.jsx)(Be,{})]})]})]}):oe.type==="only-delete"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(he.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,c.jsx)(K.Z,{variant:"contained",color:"secondary",disabled:Ie,onClick:it,children:"Delete Entity"}),(0,c.jsx)(Be,{})]}):oe.type==="unregister"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(he.Z,{children:"This action will unregister the following entities:"}),(0,c.jsx)(he.Z,{component:"ul",children:oe.colocatedEntities.map(mt=>(0,c.jsx)("li",{children:(0,c.jsx)(ut,{entityRef:mt})},`${mt.kind}:${mt.namespace}/${mt.name}`))}),(0,c.jsx)(he.Z,{children:"Located at the following location:"}),(0,c.jsx)(he.Z,{component:"ul",children:(0,c.jsx)("li",{children:oe.location})}),(0,c.jsxs)(he.Z,{children:["To undo, just re-register the entity in ",Ve,"."]}),(0,c.jsxs)(R.Z,{marginTop:2,children:[(0,c.jsx)(K.Z,{variant:"contained",color:"secondary",disabled:Ie,onClick:st,children:"Unregister Location"}),!ye&&(0,c.jsx)(R.Z,{component:"span",marginLeft:2,children:(0,c.jsx)(K.Z,{variant:"text",size:"small",color:"primary",className:ce.advancedButton,onClick:()=>Ae(!0),children:"Advanced Options"})})]}),ye&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(R.Z,{paddingTop:4,paddingBottom:4,children:(0,c.jsx)(Wr.Z,{})}),(0,c.jsx)(he.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,c.jsx)(K.Z,{variant:"contained",color:"secondary",disabled:Ie,onClick:it,children:"Delete Entity"})]})]}):(0,c.jsx)(ar.Z,{severity:"error",children:"Internal error: Unknown state"})},$o=b=>{const{open:E,onConfirm:I,onClose:M,entity:te}=b;return(0,c.jsxs)(S.Z,{open:E,onClose:M,children:[(0,c.jsx)(h.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,c.jsx)(x.Z,{children:(0,c.jsx)(ts,{entity:te,onConfirm:I,onClose:M})})]})};var ns=t(12231),rs=t(9520),os=t(47603);const ss=(0,ge.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 is(b){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:os.Z},{id:"starred",label:"Starred",icon:Hn.Z}]},{name:b!=null?b:"Company",items:[{id:"all",label:"All"}]}]}const rr=b=>{const{initialFilter:E,availableFilters:I}=b,M=ss(),te=(0,r.h_)(r.Ds);var ce;const oe=(ce=te.getOptionalString("organization.name"))!==null&&ce!==void 0?ce:"Company",{filters:ye,updateFilters:Ae,backendEntities:Ie,queryParameters:{kind:Ze,user:be},loading:Ve}=Vt(),st=["starred","all"],it=is(oe).map(Tn=>({...Tn,items:Tn.items.filter(({id:Zn})=>["group","user"].some(wr=>wr===Ze)?st.includes(Zn):!I||I.includes(Zn))})).filter(({items:Tn})=>!!Tn.length),{isStarredEntity:Be}=Mn(),{isOwnedEntity:mt,loading:$t}=fn(),yn=Ve||$t,un=(0,B.useMemo)(()=>new Wt("owned",mt,Be),[mt,Be]),xn=(0,B.useMemo)(()=>new Wt("starred",mt,Be),[mt,Be]),_t=(0,B.useMemo)(()=>[be].flat()[0],[be]),[bn,Sn]=(0,B.useState)(_t!=null?_t:E),br=(0,B.useMemo)(()=>Ie.filter((0,ct.Gz)((0,Je.compact)(Object.values({...ye,user:void 0})))),[ye,Ie]),Hr=(0,B.useMemo)(()=>({all:br.length,starred:br.filter(Tn=>xn.filterEntity(Tn)).length,owned:br.filter(Tn=>un.filterEntity(Tn)).length}),[br,xn,un]);(0,B.useEffect)(()=>{_t&&Sn(_t)},[_t]),(0,B.useEffect)(()=>{!yn&&bn&&bn!=="all"&&Hr[bn]===0&&Sn("all")},[yn,Hr,bn,Sn]),(0,B.useEffect)(()=>{Ae({user:bn?new Wt(bn,mt,Be):void 0})},[bn,mt,Be,Ae]);var Gr;return(0,c.jsx)(yr.Z,{className:M.root,children:it.map(Tn=>(0,c.jsxs)(B.Fragment,{children:[(0,c.jsx)(O.Z,{variant:"subtitle2",component:"span",className:M.title,children:Tn.name}),(0,c.jsx)(yr.Z,{className:M.groupWrapper,children:(0,c.jsx)(ir.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":Tn.name,children:Tn.items.map(Zn=>{var wr;return(0,c.jsxs)(ns.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>Sn(Zn.id),selected:Zn.id===((wr=ye.user)===null||wr===void 0?void 0:wr.value),className:M.menuItem,disabled:Hr[Zn.id]===0,"data-testid":`user-picker-${Zn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Zn.icon&&(0,c.jsx)(Xn.Z,{className:M.listIcon,children:(0,c.jsx)(Zn.icon,{fontSize:"small"})}),(0,c.jsx)(Nr.Z,{children:(0,c.jsxs)(O.Z,{variant:"body1",children:[Zn.label," "]})}),(0,c.jsx)(rs.Z,{children:(Gr=Hr[Zn.id])!==null&&Gr!==void 0?Gr:"-"})]},Zn.id)})})})]},Tn.name))})},Zr=(0,ge.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),as=(0,c.jsx)(_.Z,{fontSize:"small"}),Do=(0,c.jsx)(Ke.Z,{fontSize:"small"}),so=()=>{const b=Zr(),{updateFilters:E}=Vt(),[I,M]=(0,B.useState)([]);function te(ye){E({orphan:ye?new xe(ye):void 0})}function ce(ye){E({error:ye?new pe(ye):void 0})}const oe=["Is Orphan","Has Error"];return(0,c.jsx)(R.Z,{pb:1,pt:1,children:(0,c.jsxs)(O.Z,{variant:"button",component:"label",children:["Processing Status",(0,c.jsx)(fe.ZP,{multiple:!0,disableCloseOnSelect:!0,options:oe,value:I,onChange:(ye,Ae)=>{M(Ae),te(Ae.includes("Is Orphan")),ce(Ae.includes("Has Error"))},renderOption:(ye,{selected:Ae})=>(0,c.jsx)(ie.Z,{control:(0,c.jsx)(Le.Z,{icon:as,checkedIcon:Do,checked:Ae}),onClick:Ie=>Ie.preventDefault(),label:ye}),size:"small",popupIcon:(0,c.jsx)(F.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:ye=>(0,c.jsx)(Fe.Z,{...ye,className:b.input,variant:"outlined"})})]})})};function Vr(b){const{children:E,value:I}=b;var M;const[te,ce]=useState((M=I==null?void 0:I.filters)!==null&&M!==void 0?M:{}),oe=useCallback(it=>{ce(Be=>{const mt=typeof it=="function"?it(Be):it;return{...Be,...mt}})},[]),ye=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Ae,Ie,Ze,be,Ve;const st=useMemo(()=>({entities:(Ae=I==null?void 0:I.entities)!==null&&Ae!==void 0?Ae:ye.entities,backendEntities:(Ie=I==null?void 0:I.backendEntities)!==null&&Ie!==void 0?Ie:ye.backendEntities,updateFilters:(Ze=I==null?void 0:I.updateFilters)!==null&&Ze!==void 0?Ze:oe,filters:te,loading:(be=I==null?void 0:I.loading)!==null&&be!==void 0?be:!1,queryParameters:(Ve=I==null?void 0:I.queryParameters)!==null&&Ve!==void 0?Ve:ye.queryParameters,error:I==null?void 0:I.error}),[I,ye,te,oe]);return _jsx(EntityListContext.Provider,{value:st,children:E})}},75435:function(St,$e,t){"use strict";t.d($e,{h:function(){return r}});var u=t(25271);function r(W,P,m){var y;let c=(W==null||(y=W.relations)===null||y===void 0?void 0:y.filter(B=>B.type===P).map(B=>(0,u.of)(B.targetRef)))||[];return m!=null&&m.kind&&(c=c.filter(B=>B.kind.toLocaleLowerCase("en-US")===m.kind.toLocaleLowerCase("en-US"))),c}},49280:function(St,$e,t){"use strict";t.d($e,{hF:function(){return W.h},CV:function(){return m},wq:function(){return u},Gz:function(){return r}});function u(c){return c.reduce((B,Te)=>({...B,...Te.getCatalogFilters?Te.getCatalogFilters():{}}),{})}function r(c){return B=>c.every(Te=>!Te.filterEntity||Te.filterEntity(B))}var W=t(75435),P=t(25271);function m(c,B){var Te;const ue=(Te=c.metadata.annotations)===null||Te===void 0?void 0:Te[P.M6];if(ue)try{const K=(0,P.Ou)(ue),$=B.byUrl(K.target);return{locationTargetUrl:K.target,integrationType:$==null?void 0:$.type}}catch{return}}function y(c,B){const Te=new Set([...getEntityRelations(c,RELATION_MEMBER_OF,{kind:"group"}),...c?[getCompoundEntityRef(c)]:[]].map(stringifyEntityRef)),ue=getEntityRelations(B,RELATION_OWNED_BY).map(stringifyEntityRef);for(const K of ue)if(Te.has(K))return!0;return!1}},33414:function(St,$e,t){"use strict";t.r($e),t.d($e,{AboutCard:function(){return ut},AboutContent:function(){return H},AboutField:function(){return V}});var u=t(52322),r=t(25271),W=t(23196),P=t(60871),m=t(32838),y=t(40303),c=t(79692),B=t(94339),Te=t(32552),ue=t(61837),K=t(85256),$=t(24579),R=t(52866),O=t(30254),re=t(27604),q=t(2784),ne=t(19625),D=t(60905),T=t(7089),k=t(90436);const L=(0,c.Z)(ze=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:ze.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function V(ze){const{label:ft,value:Re,gridSizes:ct,children:jt}=ze,vt=L(),gt=(0,P.vJ)(jt,Dt=>Dt.getElements()),Et=gt.length>0?gt:(0,u.jsx)(k.Z,{variant:"body2",className:vt.value,children:Re||"unknown"});return(0,u.jsxs)(D.Z,{item:!0,...ct,children:[(0,u.jsx)(k.Z,{variant:"h2",className:vt.label,children:ft}),Et]})}var Se=t(24851);const We=(0,c.Z)({description:{wordBreak:"break-word"}});function qe(ze,ft,Re){if(ft==="url"||ze.includes("://"))return ze;const ct=Re.type==="file"?`file://${Re.target}`:Re.target;return ft==="file"||Re.type==="file"?new URL(ze,ct).href:ct}function H(ze){var ft,Re,ct,jt,vt,gt,Et,Dt;const{entity:Ge}=ze,Wt=We(),xe=Ge.kind.toLocaleLowerCase("en-US")==="system",pe=Ge.kind.toLocaleLowerCase("en-US")==="resource",De=Ge.kind.toLocaleLowerCase("en-US")==="component",Je=Ge.kind.toLocaleLowerCase("en-US")==="api",At=Ge.kind.toLocaleLowerCase("en-US")==="template",wt=Ge.kind.toLocaleLowerCase("en-US")==="location",rt=Ge.kind.toLocaleLowerCase("en-US")==="group",yt=(0,y.hF)(Ge,r.cz,{kind:"system"}),Ot=(0,y.hF)(Ge,r.cz,{kind:"component"}),Gt=(0,y.hF)(Ge,r.cz,{kind:"domain"}),It=(0,y.hF)(Ge,r.S4);let on;try{on=(0,r.CV)(Ge)}catch{on=void 0}return(0,u.jsxs)(D.Z,{container:!0,children:[(0,u.jsx)(V,{label:"Description",gridSizes:{xs:12},children:(0,u.jsx)(W.SA,{className:Wt.description,content:(Ge==null||(ft=Ge.metadata)===null||ft===void 0?void 0:ft.description)||"No description"})}),(0,u.jsx)(V,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:It.length>0&&(0,u.jsx)(y.rI,{entityRefs:It,defaultKind:"group"})}),(xe||Gt.length>0)&&(0,u.jsx)(V,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:Gt.length>0&&(0,u.jsx)(y.rI,{entityRefs:Gt,defaultKind:"domain"})}),(Je||De||pe||yt.length>0)&&(0,u.jsx)(V,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:yt.length>0&&(0,u.jsx)(y.rI,{entityRefs:yt,defaultKind:"system"})}),De&&Ot.length>0&&(0,u.jsx)(V,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,u.jsx)(y.rI,{entityRefs:Ot,defaultKind:"component"})}),(Je||De||pe||At||rt||wt||typeof(Ge==null||(Re=Ge.spec)===null||Re===void 0?void 0:Re.type)=="string")&&(0,u.jsx)(V,{label:"Type",value:Ge==null||(ct=Ge.spec)===null||ct===void 0?void 0:ct.type,gridSizes:{xs:12,sm:6,lg:4}}),(Je||De||typeof(Ge==null||(jt=Ge.spec)===null||jt===void 0?void 0:jt.lifecycle)=="string")&&(0,u.jsx)(V,{label:"Lifecycle",value:Ge==null||(vt=Ge.spec)===null||vt===void 0?void 0:vt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,u.jsx)(V,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((Ge==null||(gt=Ge.metadata)===null||gt===void 0?void 0:gt.tags)||[]).map(Ut=>(0,u.jsx)(T.Z,{size:"small",label:Ut},Ut))}),wt&&((Ge==null||(Et=Ge.spec)===null||Et===void 0?void 0:Et.targets)||(Ge==null||(Dt=Ge.spec)===null||Dt===void 0?void 0:Dt.target))&&(0,u.jsx)(V,{label:"Targets",gridSizes:{xs:12},children:(0,u.jsx)(Se.s,{cols:1,items:(Ge.spec.targets||[Ge.spec.target]).map(Ut=>Ut).map(Ut=>{var Vt;return{text:Ut,href:qe(Ut,(Ge==null||(Vt=Ge.spec)===null||Vt===void 0?void 0:Vt.type)||"unknown",on)}})})})]})}const _e=(0,c.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 ut(ze){var ft,Re,ct;const{variant:jt}=ze,vt=_e(),{entity:gt}=(0,y.X2)(),Et=(0,P.h_)(m.q3),Dt=(0,P.h_)(y.Ah),Ge=(0,P.h_)(P.$v),Wt=(0,P.h_)(P.VE),xe=(0,P.tg)(ne.jU),pe=(0,y.CV)(gt,Et),De=(ft=gt.metadata.annotations)===null||ft===void 0?void 0:ft[r.Tf],Je={label:"View Source",disabled:!pe,icon:(0,u.jsx)(m.nW,{type:pe==null?void 0:pe.integrationType}),href:pe==null?void 0:pe.locationTargetUrl},At={label:"View TechDocs",disabled:!(!((Re=gt.metadata.annotations)===null||Re===void 0)&&Re["backstage.io/techdocs-ref"])||!xe,icon:(0,u.jsx)(O.Z,{}),href:xe&&xe({namespace:gt.metadata.namespace||r.zG,kind:gt.kind,name:gt.metadata.name})};let wt="";jt==="gridItem"?wt=vt.gridItemCard:jt==="fullHeight"&&(wt=vt.fullHeightCard);let rt="";jt==="gridItem"?rt=vt.gridItemCardContent:jt==="fullHeight"&&(rt=vt.fullHeightCardContent);const yt=(ct=gt.metadata.annotations)===null||ct===void 0?void 0:ct[r.P1],Ot=(yt==null?void 0:yt.startsWith("url:"))||(yt==null?void 0:yt.startsWith("file:")),Gt=(0,q.useCallback)(async()=>{try{await Dt.refreshEntity((0,r.eE)(gt)),Ge.post({message:"Refresh scheduled",severity:"info"})}catch(It){Wt.post(It)}},[Dt,Ge,Wt,gt]);return(0,u.jsxs)(B.Z,{className:wt,children:[(0,u.jsx)(Te.Z,{title:"About",action:(0,u.jsxs)(u.Fragment,{children:[Ot&&(0,u.jsx)(ue.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:Gt,children:(0,u.jsx)(R.Z,{})}),(0,u.jsx)(ue.Z,{component:W.rU,"aria-label":"Edit",disabled:!De,title:"Edit Metadata",to:De!=null?De:"#",children:(0,u.jsx)(re.Z,{})})]}),subheader:(0,u.jsx)(W.M6,{links:[Je,At]})}),(0,u.jsx)(K.Z,{}),(0,u.jsx)($.Z,{className:rt,children:(0,u.jsx)(H,{entity:gt})})]})}},86359:function(St,$e,t){"use strict";t.d($e,{E:function(){return ne}});var u=t(52322),r=t(25271),W=t(23196),P=t(40303),m=t(90436),y=t(15459),c=t(27604),B=t(2997),Te=t(11640),ue=t(28347),K=t(76635),$=t(2784),R=t(7089);const O=Object.freeze({createNameColumn(D){function T(k){var L;return((L=k.metadata)===null||L===void 0?void 0:L.title)||(0,P.$3)(k,{defaultKind:D==null?void 0:D.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:k},{entity:L}){return T(k).localeCompare(T(L))},render:({entity:k})=>{var L;return(0,u.jsx)(P.dx,{entityRef:k,defaultKind:(D==null?void 0:D.defaultKind)||"Component",title:(L=k.metadata)===null||L===void 0?void 0:L.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:D})=>(0,u.jsx)(P.rI,{entityRefs:D.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:D})=>(0,u.jsx)(P.rI,{entityRefs:D.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:D})=>{var T,k;return(0,u.jsx)(u.Fragment,{children:((D==null||(T=D.spec)===null||T===void 0?void 0:T.targets)||(D==null||(k=D.spec)===null||k===void 0?void 0:k.target))&&(0,u.jsx)(W.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,u.jsx)(W.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,u.jsx)(u.Fragment,{children:D.metadata.tags&&D.metadata.tags.map(T=>(0,u.jsx)(R.Z,{label:T,size:"small",variant:"outlined",style:{marginBottom:"0px"}},T))}),width:"auto"}},createTitleColumn(D){return{title:"Title",field:"entity.metadata.title",hidden:D==null?void 0:D.hidden,searchable:!0}},createLabelColumn(D,T){return{title:(T==null?void 0:T.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:k})=>{var L;const V=(L=k.metadata)===null||L===void 0?void 0:L.labels,Se=V&&V[D]||(T==null?void 0:T.defaultValue);return(0,u.jsx)(u.Fragment,{children:Se&&(0,u.jsx)(R.Z,{label:Se,size:"small",variant:"outlined"},Se)})},width:"auto"}}}),re=(0,y.Z)({root:{color:"#f3ba37"}})(Te.Z),q=(D,T)=>{const k=L=>L.metadata.title||(0,P.$3)(L,{defaultKind:"Component"});return k(D).localeCompare(k(T))},ne=D=>{var T,k;const{columns:L,actions:V,tableOptions:Se,subtitle:We,emptyContent:qe}=D,{isStarredEntity:H,toggleStarredEntity:_e}=(0,P.CR)(),{loading:ut,error:ze,entities:ft,filters:Re}=(0,P.wp)(),ct=(0,$.useMemo)(()=>{var xe;return[O.createTitleColumn({hidden:!0}),O.createNameColumn({defaultKind:(xe=Re.kind)===null||xe===void 0?void 0:xe.value}),...pe(),O.createMetadataDescriptionColumn(),O.createTagsColumn()];function pe(){var De;switch((De=Re.kind)===null||De===void 0?void 0:De.value){case"user":return[];case"domain":case"system":return[O.createOwnerColumn()];case"group":case"template":return[O.createSpecTypeColumn()];case"location":return[O.createSpecTypeColumn(),O.createSpecTargetsColumn()];default:return[O.createSystemColumn(),O.createOwnerColumn(),O.createSpecTypeColumn(),O.createSpecLifecycleColumn()]}}},[(T=Re.kind)===null||T===void 0?void 0:T.value]),jt=Re.type===void 0;var vt;const gt=(0,K.capitalize)((vt=(k=Re.user)===null||k===void 0?void 0:k.value)!==null&&vt!==void 0?vt:"all");if(ze)return(0,u.jsx)("div",{children:(0,u.jsx)(W.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,u.jsx)(W.Oi,{language:"text",text:ze.toString()})})});const Et=[({entity:xe})=>{var pe;const De=(pe=xe.metadata.annotations)===null||pe===void 0?void 0:pe[r.l2],Je="View";return{icon:()=>(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(m.Z,{variant:"srOnly",children:Je}),(0,u.jsx)(B.Z,{fontSize:"small"})]}),tooltip:Je,disabled:!De,onClick:()=>{De&&window.open(De,"_blank")}}},({entity:xe})=>{var pe;const De=(pe=xe.metadata.annotations)===null||pe===void 0?void 0:pe[r.Tf],Je="Edit";return{icon:()=>(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(m.Z,{variant:"srOnly",children:Je}),(0,u.jsx)(c.Z,{fontSize:"small"})]}),tooltip:Je,disabled:!De,onClick:()=>{De&&window.open(De,"_blank")}}},({entity:xe})=>{const pe=H(xe),De=pe?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(m.Z,{variant:"srOnly",children:De}),pe?(0,u.jsx)(re,{}):(0,u.jsx)(ue.Z,{})]}),tooltip:De,onClick:()=>_e(xe)}}],Dt=ft.sort(q).map(xe=>{const pe=(0,P.hF)(xe,r.cz,{kind:"system"}),De=(0,P.hF)(xe,r.S4);return{entity:xe,resolved:{name:(0,P.$3)(xe,{defaultKind:"Component"}),ownedByRelationsTitle:De.map(Je=>(0,P.$3)(Je,{defaultKind:"group"})).join(", "),ownedByRelations:De,partOfSystemRelationTitle:pe.map(Je=>(0,P.$3)(Je,{defaultKind:"system"})).join(", "),partOfSystemRelations:pe}}}),Ge=(L||ct).find(xe=>xe.title==="Type");Ge&&(Ge.hidden=!jt);const Wt=Dt.length>20;return(0,u.jsx)(W.iA,{isLoading:ut,columns:L||ct,options:{paging:Wt,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!ut,padding:"dense",pageSizeOptions:[20,50,100],...Se},title:`${gt} (${ft.length})`,data:Dt,actions:V||Et,subtitle:We,emptyContent:qe})};ne.columns=O},85877:function(St,$e,t){"use strict";t.r($e),t.d($e,{EntityLabelsCard:function(){return $},hasLabels:function(){return R}});var u=t(52322),r=t(40303),W=t(2784),P=t(23196),m=t(79692),y=t(90436),c=t(77277);const B=`metadata:
|
|
34
|
-
name: example
|
|
35
|
-
labels:
|
|
36
|
-
javaVersion: 1.2.3`,Te=(0,m.Z)(O=>({code:{borderRadius:6,margin:`${O.spacing(2)}px 0px`,background:O.palette.type==="dark"?"#444":O.palette.common.white}}),{name:"PluginCatalogEntityLabelsEmptyState"});function ue(){const O=Te();return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(y.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,u.jsx)("div",{className:O.code,children:(0,u.jsx)(P.Oi,{text:B,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,u.jsx)(c.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:"Read more"})]})}const K=(0,m.Z)(O=>({key:{fontWeight:"bold"}})),$=O=>{var re;const{variant:q,title:ne}=O,{entity:D}=(0,r.X2)(),T=K(),k=[{render:V=>(0,u.jsx)(y.Z,{className:T.key,variant:"body2",children:V.key})},{field:"value"}],L=D==null||(re=D.metadata)===null||re===void 0?void 0:re.labels;return(0,u.jsx)(P.rJ,{title:ne||"Labels",variant:q,children:!L||Object.keys(L).length===0?(0,u.jsx)(ue,{}):(0,u.jsx)(P.iA,{columns:k,data:Object.keys(L).map(V=>({key:V,value:L[V]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(L).length>5}})})};function R(O){var re,q;return!(O==null||(re=O.metadata)===null||re===void 0)&&re.labels?Object.keys(O==null||(q=O.metadata)===null||q===void 0?void 0:q.labels).some(Boolean):!1}},24851:function(St,$e,t){"use strict";t.d($e,{s:function(){return re}});var u=t(52322),r=t(90348),W=t(11861),P=t(2784),m=t(79692),y=t(95544),c=t(90436),B=t(52160),Te=t(23196);const ue=(0,m.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function K(q){const{href:ne,text:D,Icon:T}=q,k=ue();return(0,u.jsxs)(y.Z,{display:"flex",children:[(0,u.jsx)(y.Z,{mr:1,className:k.svgIcon,children:(0,u.jsx)(c.Z,{component:"div",children:T?(0,u.jsx)(T,{}):(0,u.jsx)(B.Z,{})})}),(0,u.jsx)(y.Z,{flexGrow:"1",children:(0,u.jsx)(Te.rU,{to:ne,target:"_blank",rel:"noopener",children:D||ne})})]})}var $=t(41156);const R={xs:1,sm:1,md:1,lg:2,xl:3};function O(q){const ne=[(0,$.Z)(L=>L.breakpoints.up("xl"))?"xl":null,(0,$.Z)(L=>L.breakpoints.up("lg"))?"lg":null,(0,$.Z)(L=>L.breakpoints.up("md"))?"md":null,(0,$.Z)(L=>L.breakpoints.up("sm"))?"sm":null,(0,$.Z)(L=>L.breakpoints.up("xs"))?"xs":null];let D=1;if(typeof q=="number")D=q;else{var T;const L=(T=ne.find(V=>V!==null))!==null&&T!==void 0?T:"xs";var k;D=(k=q==null?void 0:q[L])!==null&&k!==void 0?k:R[L]}return D}function re(q){const{items:ne,cols:D=void 0}=q,T=O(D);return(0,u.jsx)(r.Z,{rowHeight:"auto",cols:T,children:ne.map(({text:k,href:L,Icon:V},Se)=>(0,u.jsx)(W.Z,{children:(0,u.jsx)(K,{href:L,text:k!=null?k:L,Icon:V})},Se))})}},19625:function(St,$e,t){"use strict";t.d($e,{_Z:function(){return P},jU:function(){return W},yw:function(){return r}});var u=t(60871);const r=(0,u.x8)({id:"create-component",optional:!0}),W=(0,u.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),P=(0,u.NT)({id:"catalog"})},15096:function(St,$e,t){"use strict";t.d($e,{FA:function(){return Te},qO:function(){return vt},Nd:function(){return H},E5:function(){return Zt},Rx:function(){return L}});var u=t(60871);const r=(0,u.T0)({id:"plugin.search.queryservice"});class W{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(Q){_define_property(this,"mockedResults",void 0),this.mockedResults=Q}}var P=t(52322),m=t(2784),y=t(38402),c=t(79692);const B=(0,c.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),Te=ee=>{const{text:Q,preTag:se,postTag:g}=ee,w=B(),Y=(0,m.useMemo)(()=>Q.split(new RegExp(`(${se}.+?${g})`)),[g,se,Q]);return(0,P.jsx)(P.Fragment,{children:Y.map((J,me)=>J.includes(se)?(0,P.jsx)("mark",{className:w.highlight,children:J.replace(new RegExp(`${se}|${g}`,"g"),"")},me):J)})};var ue=t(48760),K=t(50581),$=t(61837),R=t(74603),O=t(21853),re=t(33375),q=t(76635),ne=t(64279),D=t(1849),T=t(51837);const k=(0,T.CT)("search-context"),L=()=>{const ee=(0,m.useContext)(k);if(!ee)throw new Error("useSearch must be used within a SearchContextProvider");const Q=ee.atVersion(1);if(!Q)throw new Error("No SearchContext v1 found");return Q},V=()=>(0,m.useContext)(k)!==void 0,Se={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},We=(ee=Se)=>{var Q,se,g,w;const Y=(0,u.h_)(r),[J,me]=(0,m.useState)(ee.term),[ve,Ue]=(0,m.useState)(ee.types),[ot,tt]=(0,m.useState)(ee.filters),[xt,lt]=(0,m.useState)(ee.pageLimit),[nt,Oe]=(0,m.useState)(ee.pageCursor),Tt=(0,D.Z)(J),Kt=(0,D.Z)(ot),Rt=(0,ne.default)(()=>Y.query({term:J,types:ve,filters:ot,pageLimit:xt,pageCursor:nt}),[J,ve,ot,xt,nt]),Pt=!Rt.loading&&!Rt.error&&((Q=Rt.value)===null||Q===void 0?void 0:Q.nextPageCursor),tn=!Rt.loading&&!Rt.error&&((se=Rt.value)===null||se===void 0?void 0:se.previousPageCursor),Mt=(0,m.useCallback)(()=>{var Bt;Oe((Bt=Rt.value)===null||Bt===void 0?void 0:Bt.nextPageCursor)},[(g=Rt.value)===null||g===void 0?void 0:g.nextPageCursor]),ht=(0,m.useCallback)(()=>{var Bt;Oe((Bt=Rt.value)===null||Bt===void 0?void 0:Bt.previousPageCursor)},[(w=Rt.value)===null||w===void 0?void 0:w.previousPageCursor]);return(0,m.useEffect)(()=>{Tt!==void 0&&J!==Tt&&Oe(void 0)},[J,Tt,Oe]),(0,m.useEffect)(()=>{Kt!==void 0&&!(0,q.isEqual)(ot,Kt)&&Oe(void 0)},[ot,Kt,Oe]),{result:Rt,term:J,setTerm:me,types:ve,setTypes:Ue,filters:ot,setFilters:tt,pageLimit:xt,setPageLimit:lt,pageCursor:nt,setPageCursor:Oe,fetchNextPage:Pt?Mt:void 0,fetchPreviousPage:tn?ht:void 0}},qe=ee=>{const{initialState:Q,children:se}=ee,g=We(Q);return(0,P.jsx)(u.fC,{attributes:{searchTypes:g.types.sort().join(",")},children:(0,P.jsx)(k.Provider,{value:(0,T.EI)({1:g}),children:se})})},H=ee=>{const{initialState:Q,inheritParentContextIfAvailable:se,children:g}=ee;return V()&&se?(0,P.jsx)(P.Fragment,{children:g}):(0,P.jsx)(qe,{initialState:Q,children:g})},_e=({children:ee})=>{var Q;const se=ot=>(0,D.Z)(ot)!==ot,g=(0,u.z$)(),{term:w,result:Y}=L();var J;const me=(J=(Q=Y.value)===null||Q===void 0?void 0:Q.numberOfResults)!==null&&J!==void 0?J:void 0,Ue=se(Y.loading)&&!Y.loading;return(0,m.useEffect)(()=>{w&&Ue&&g.captureEvent("search",w,{value:me})},[g,w,me,Ue]),(0,P.jsx)(P.Fragment,{children:ee})};function ut(ee){return(0,m.forwardRef)((Q,se)=>(0,P.jsx)(H,{inheritParentContextIfAvailable:!0,children:(0,P.jsx)(ee,{...Q,ref:se})}))}const ze=ut((0,m.forwardRef)((ee,Q)=>{const{onChange:se,onKeyDown:g=()=>{},onClear:w=()=>{},onSubmit:Y=()=>{},debounceTime:J=200,clearButton:me=!0,fullWidth:ve=!0,value:Ue,placeholder:ot,inputProps:tt={},endAdornment:xt,...lt}=ee,nt=(0,u.h_)(u.Ds),[Oe,Tt]=(0,m.useState)("");(0,m.useEffect)(()=>{Tt(Xe=>Xe!==Ue?String(Ue):Xe)},[Ue]),(0,ue.Z)(()=>se(Oe),J,[Oe]);const Kt=(0,m.useCallback)(Xe=>{Tt(Xe.target.value)},[Tt]),Rt=(0,m.useCallback)(Xe=>{g&&g(Xe),Y&&Xe.key==="Enter"&&Y()},[g,Y]),Pt=(0,m.useCallback)(()=>{se(""),w&&w()},[se,w]),tn=ot!=null?ot:`Search in ${nt.getOptionalString("app.title")||"Backstage"}`,Mt=(0,P.jsx)(K.Z,{position:"start",children:(0,P.jsx)($.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,P.jsx)(O.Z,{})})}),ht=(0,P.jsx)(K.Z,{position:"end",children:(0,P.jsx)($.Z,{"aria-label":"Clear",size:"small",onClick:Pt,children:(0,P.jsx)(re.Z,{})})});return(0,P.jsx)(_e,{children:(0,P.jsx)(R.Z,{"data-testid":"search-bar-next",ref:Q,value:Oe,placeholder:tn,startAdornment:Mt,endAdornment:me?ht:xt,inputProps:{"aria-label":"Search",...tt},fullWidth:ve,onChange:Kt,onKeyDown:Rt,...lt})})})),ft=ut((0,m.forwardRef)((ee,Q)=>{const{value:se="",onChange:g,...w}=ee,{term:Y,setTerm:J}=L();(0,m.useEffect)(()=>{se&&J(String(se))},[se,J]);const me=(0,m.useCallback)(ve=>{g?g(ve):J(ve)},[g,J]);return(0,P.jsx)(u.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,P.jsx)(ze,{...w,ref:Q,value:Y,onChange:me})})}));var Re=t(4614),ct=t(88013);const vt=(ee=>Q=>(0,P.jsx)(H,{inheritParentContextIfAvailable:!0,children:(0,P.jsx)(ee,{...Q})}))(function(Q){const{loading:se,value:g,onChange:w=()=>{},options:Y=[],getOptionLabel:J=Pt=>String(Pt),inputPlaceholder:me,inputDebounceTime:ve,freeSolo:Ue=!0,fullWidth:ot=!0,clearOnBlur:tt=!1,"data-testid":xt="search-autocomplete",...lt}=Q,{setTerm:nt}=L(),Oe=(0,m.useCallback)(Pt=>Pt?typeof Pt=="string"?Pt:J(Pt):"",[J]),Tt=(0,m.useMemo)(()=>Oe(g),[g,Oe]),Kt=(0,m.useCallback)((Pt,tn,Mt,ht)=>{nt(Oe(tn)),w(Pt,tn,Mt,ht)},[Oe,nt,w]),Rt=(0,m.useCallback)(({InputProps:{ref:Pt,endAdornment:tn},InputLabelProps:Mt,...ht})=>(0,P.jsx)(ft,{...ht,ref:Pt,clearButton:!1,value:Tt,placeholder:me,debounceTime:ve,endAdornment:se?(0,P.jsx)(Re.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):tn}),[se,Tt,me,ve]);return(0,P.jsx)(ct.ZP,{...lt,"data-testid":xt,value:g,onChange:Kt,options:Y,getOptionLabel:J,renderInput:Rt,freeSolo:Ue,fullWidth:ot,clearOnBlur:tt})}),gt=ee=>{const{icon:Q,primaryText:se,primaryTextTypographyProps:g,secondaryText:w,secondaryTextTypographyProps:Y,disableTextTypography:J}=ee;return _jsxs(_Fragment,{children:[Q?_jsx(ListItemIcon,{children:Q}):null,_jsx(ListItemText,{primary:se,primaryTypographyProps:g,secondary:w,secondaryTypographyProps:Y,disableTypography:J})]})};var Et=t(42494),Dt=t(84899),Ge=t(5806),Wt=t(21324),xe=t(56939),pe=t(73698),De=t(12231),Je=t(86619),At=t(7089),wt=t(69294);const rt=(ee,Q,se=[],g=250)=>{const w=(0,m.useRef)({}),Y=ee||(()=>Promise.resolve([])),[J,me]=(0,wt.default)(Y,[Q],{loading:!0});if((0,ue.Z)(()=>{w.current[Q]===void 0&&(w.current[Q]=me(Q).then(Ue=>(w.current[Q]=Ue,Ue)))},g,[me,Q]),se.length)return{loading:!1,value:se};const ve=w.current[Q];return Array.isArray(ve)?{loading:!1,value:ve}:J},yt=(ee,Q)=>{const{setFilters:se}=L();(0,m.useEffect)(()=>{Q&&[Q].flat().length>0&&se(g=>({...g,[ee]:Q}))},[])},Ot=ee=>{const{className:Q,defaultValue:se,name:g,values:w,valuesDebounceMs:Y,label:J,filterSelectedOptions:me,limitTags:ve,multiple:Ue}=ee,[ot,tt]=(0,m.useState)("");yt(g,se);const xt=typeof w=="function"?w:void 0,lt=typeof w=="function"?void 0:w,{value:nt,loading:Oe}=rt(xt,ot,lt,Y),{filters:Tt,setFilters:Kt}=L(),Rt=Tt[g]||(Ue?[]:null),Pt=(ht,Xe)=>{Kt(Bt=>{const{[g]:qt,...An}=Bt;return Xe?{...An,[g]:Xe}:{...An}})},tn=ht=>(0,P.jsx)(Je.Z,{...ht,name:"search",variant:"outlined",label:J,fullWidth:!0}),Mt=(ht,Xe)=>ht.map((Bt,qt)=>(0,P.jsx)(At.Z,{label:Bt,color:"primary",...Xe({index:qt})}));return(0,P.jsx)(ct.ZP,{filterSelectedOptions:me,limitTags:ve,multiple:Ue,className:Q,id:`${Ue?"multi-":""}select-filter-${g}--select`,options:nt||[],loading:Oe,value:Rt,onChange:Pt,onInputChange:(ht,Xe)=>tt(Xe),renderInput:tn,renderTags:Mt})},Gt=(0,c.Z)({label:{textTransform:"capitalize"}}),It=ee=>{const{className:Q,defaultValue:se,label:g,name:w,values:Y=[],valuesDebounceMs:J}=ee,me=Gt(),{filters:ve,setFilters:Ue}=L();yt(w,se);const ot=typeof Y=="function"?Y:void 0,tt=typeof Y=="function"?void 0:Y,{value:xt=[],loading:lt}=rt(ot,"",tt,J),nt=Tt=>{const{target:{value:Kt,checked:Rt}}=Tt;Ue(Pt=>{const{[w]:tn,...Mt}=Pt,ht=(tn||[]).filter(Bt=>Bt!==Kt),Xe=Rt?[...ht,Kt]:ht;return Xe.length?{...Mt,[w]:Xe}:Mt})};var Oe;return(0,P.jsxs)(Et.Z,{className:Q,disabled:lt,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[g?(0,P.jsx)(Dt.Z,{className:me.label,children:g}):null,xt.map(Tt=>(0,P.jsx)(Ge.Z,{control:(0,P.jsx)(Wt.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":Tt},value:Tt,name:Tt,onChange:nt,checked:((Oe=ve[w])!==null&&Oe!==void 0?Oe:[]).includes(Tt)}),label:Tt},Tt))]})},on=ee=>{const{className:Q,defaultValue:se,label:g,name:w,values:Y,valuesDebounceMs:J}=ee,me=Gt();yt(w,se);const ve=typeof Y=="function"?Y:void 0,Ue=typeof Y=="function"?void 0:Y,{value:ot=[],loading:tt}=rt(ve,"",Ue,J),{filters:xt,setFilters:lt}=L(),nt=Oe=>{const{target:{value:Tt}}=Oe;lt(Kt=>{const{[w]:Rt,...Pt}=Kt;return Tt?{...Pt,[w]:Tt}:Pt})};return(0,P.jsxs)(Et.Z,{disabled:tt,className:Q,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[g?(0,P.jsx)(xe.Z,{className:me.label,margin:"dense",children:g}):null,(0,P.jsxs)(pe.Z,{variant:"outlined",value:xt[w]||"",onChange:nt,children:[(0,P.jsx)(De.Z,{value:"",children:(0,P.jsx)("em",{children:"All"})}),ot.map(Oe=>(0,P.jsx)(De.Z,{value:Oe,children:Oe},Oe))]})]})},Ut=ee=>{const{component:Q,...se}=ee;return(0,P.jsx)(Q,{...se})};Ut.Checkbox=ee=>(0,P.jsx)(Ut,{...ee,component:It}),Ut.Select=ee=>(0,P.jsx)(Ut,{...ee,component:on}),Ut.Autocomplete=ee=>(0,P.jsx)(Ut,{...ee,component:Ot});var Vt=t(48834).lW;const zn=ee=>Vt.from(ee.toString(),"utf-8").toString("base64"),In=ee=>ee?Number(Vt.from(ee,"base64").toString("utf-8")):0,an=ee=>{const{total:Q=-1,cursor:se,hasNextPage:g,onCursorChange:w,limit:Y=25,limitLabel:J="Results per page:",limitText:me=({from:nt,to:Oe})=>Q>0?`of ${Q}`:`${nt}-${Oe}`,limitOptions:ve,onLimitChange:Ue,...ot}=ee,tt=useMemo(()=>In(se),[se]),xt=useCallback((nt,Oe)=>{w==null||w(zn(Oe))},[w]),lt=useCallback(nt=>{const Oe=nt.target.value;Ue==null||Ue(parseInt(Oe,10))},[Ue]);return _jsx(TablePagination,{...ot,component:"div",count:Q,page:tt,nextIconButtonProps:{...g!==void 0&&{disabled:!g}},onPageChange:xt,rowsPerPage:Y,labelRowsPerPage:J,labelDisplayedRows:me,rowsPerPageOptions:ve,onRowsPerPageChange:lt})},Fn=ee=>{const{pageLimit:Q,setPageLimit:se,pageCursor:g,setPageCursor:w,fetchNextPage:Y}=useSearch();return _jsx(an,{...ee,hasNextPage:!!Y,limit:Q,onLimitChange:se,cursor:g,onCursorChange:w})};var jn=t(23196);const Un=ee=>{const{children:Q}=ee,se=useSearch(),{result:g,...w}=se;return Q(g,w)},Pn=ee=>{const{query:Q,children:se}=ee,g=useApi(searchApiRef),w=useAsync(()=>{const{term:Y="",types:J=[],filters:me={},...ve}=Q;return g.query({...ve,term:Y,types:J,filters:me})},[Q]);return se(w,Q)},Jn=ee=>{const{query:Q,children:se}=ee;return Q?_jsx(Pn,{query:Q,children:se}):_jsx(Un,{children:se})},at=ee=>{const{query:Q,children:se,noResultsComponent:g=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...w}=ee;return _jsx(Jn,{query:Q,children:({loading:Y,error:J,value:me})=>Y?_jsx(Progress,{}):J?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:J}):me!=null&&me.results.length?isFunction(se)?se(me):_jsx(SearchResultListItemExtensions,{...w,results:me.results,children:se}):g})},Mn=ee=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(at,{...ee})}),Ln=({result:ee,highlight:Q,icon:se,secondaryAction:g,lineClamp:w=5})=>ee?_jsxs(_Fragment,{children:[se&&_jsx(ListItemIcon,{children:se}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:ee.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)||""}):ee.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:w,overflow:"hidden"},color:"textSecondary",variant:"body2",children:Q!=null&&Q.fields.text?_jsx(HighlightedSearchResultText,{text:Q.fields.text,preTag:Q.preTag,postTag:Q.postTag}):ee.text})}),g&&_jsx(Box,{alignItems:"flex-end",children:g})]}):null,Wn=ee=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(Ln,{...ee})}),En=ee=>{const{error:Q,loading:se,resultItems:g,renderResultItem:w=ve=>_jsx(DefaultResultListItem,{result:ve.document},ve.document.location),disableRenderingWithNoResults:Y,noResultsComponent:J=Y?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...me}=ee;return se?_jsx(Progress,{}):Q?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Q}):g!=null&&g.length?_jsx(List,{...me,children:g.map(w)}):_jsx(_Fragment,{children:J})},fn=ee=>{const{query:Q,renderResultItem:se,children:g,...w}=ee,Y=useSearchResultListItemExtensions(g);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:Q,children:({loading:J,error:me,value:ve})=>_jsx(En,{...w,error:me,loading:J,resultItems:ve==null?void 0:ve.results,renderResultItem:se!=null?se:Y})})})};var vn=t(19126);const kn=(0,c.Z)(ee=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:ee.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:ee.palette.text.secondary,margin:ee.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:ee.palette.text.secondary,margin:ee.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:ee.spacing(.5)}})),ln=ee=>{const Q=kn(),{label:se,children:g,...w}=ee;return _jsx(Chip,{...w,className:Q.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[se,": ",g]})})},Vn=()=>null,ge=(0,c.Z)(ee=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:ee.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:ee.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),ie=ee=>{const Q=ge(),{label:se,value:g="None",onChange:w,onDelete:Y}=ee,J=useCallback(me=>{w(me.target.value)},[w]);return _jsx(ln,{label:se,onDelete:Y,children:_jsx(Typography,{role:"textbox",component:"span",className:Q.root,onChange:J,contentEditable:!0,suppressContentEditableWarning:!0,children:g})})},Le=(0,c.Z)(ee=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:ee.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),Fe=ee=>{const Q=Le(),{label:se,value:g="none",onChange:w,onDelete:Y,children:J}=ee,me=useCallback(ve=>{w(ve.target.value)},[w]);return _jsx(ln,{label:se,onDelete:Y,children:_jsxs(Select,{className:Q.root,value:g,onChange:me,input:_jsx(InputBase,{}),IconComponent:Vn,children:[_jsx(MenuItem,{value:"none",children:"None"}),J]})})};function Ke(ee){const Q=kn(),[se,g]=useState(null),{error:w,loading:Y,icon:J,title:me,titleProps:ve={},link:Ue=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:Q.listSubheaderLinkIcon})]}),linkProps:ot={},filterOptions:tt,renderFilterOption:xt=Xe=>_jsx(MenuItem,{value:String(Xe),children:Xe},String(Xe)),filterFields:lt,renderFilterField:nt,resultItems:Oe,renderResultItem:Tt=Xe=>_jsx(DefaultResultListItem,{result:Xe.document},Xe.document.location),disableRenderingWithNoResults:Kt,noResultsComponent:Rt=Kt?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Pt}=ee,tn=useCallback(Xe=>{g(Xe.currentTarget)},[]),Mt=useCallback(()=>{g(null)},[]);if(Y)return _jsx(Progress,{});if(w)return _jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:w});if(!(Oe!=null&&Oe.length))return _jsx(_Fragment,{children:Rt});var ht;return _jsxs(List,{...Pt,children:[_jsxs(ListSubheader,{className:Q.listSubheader,children:[J,_jsx(Typography,{className:Q.listSubheaderName,component:"strong",...ve,children:me}),tt?_jsx(Chip,{className:Q.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:tn}):null,tt?_jsx(Menu,{id:"filters-menu",anchorEl:se,open:Boolean(se),onClose:Mt,onClick:Mt,keepMounted:!0,children:tt.map(xt)}):null,lt==null?void 0:lt.map(Xe=>(ht=nt==null?void 0:nt(Xe))!==null&&ht!==void 0?ht:null),_jsx(Link,{className:Q.listSubheaderLink,to:"/search",...ot,children:Ue})]}),Oe.map(Tt)]})}function _(ee){const{query:Q,children:se,renderResultItem:g,linkProps:w={},...Y}=ee,J=useSearchResultListItemExtensions(se);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:Q,children:({loading:me,error:ve,value:Ue},{term:ot,types:tt,pageCursor:xt,filters:lt={}})=>{const nt=`/search?${qs.stringify({term:ot,types:tt,filters:lt,pageCursor:xt,query:ot},{arrayFormat:"brackets"})}`;return _jsx(Ke,{...Y,error:ve,loading:me,linkProps:{to:nt,...w},filterFields:Object.keys(lt),resultItems:Ue==null?void 0:Ue.results,renderResultItem:g!=null?g:J})}})})}const F=(0,c.Z)(ee=>({root:{display:"flex",justifyContent:"space-between",gap:ee.spacing(2),margin:ee.spacing(2,0)}})),fe=()=>{const{fetchNextPage:ee,fetchPreviousPage:Q}=useSearch(),se=F();return!ee&&!Q?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:se.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!Q,onClick:Q,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!ee,onClick:ee,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},je="search.results.list.items.extensions.v1",Qe=(ee,Q)=>{for(const se of ee){if(!isValidElement(se))continue;const g=getComponentData(se,je);if(g!=null&&g(Q))return cloneElement(se,{rank:Q.rank,highlight:Q.highlight,result:Q.document,...se.props})}return null},et=ee=>{const{rank:Q,result:se,noTrack:g,children:w,alignItems:Y="flex-start",...J}=ee,me=(0,u.z$)(),ve=(0,m.useCallback)(()=>{g||se&&me.captureEvent("discover",se.title,{attributes:{to:se.location},value:Q})},[Q,se,g,me]);return(0,P.jsx)(y.Z,{divider:!0,alignItems:Y,onClickCapture:ve,...J,children:w})},Zt=ee=>{const{name:Q,component:se,predicate:g=()=>!0}=ee;return(0,u.YO)({name:Q,component:{lazy:()=>se().then(w=>Y=>(0,P.jsx)(et,{rank:Y.rank,result:Y.result,noTrack:Y.noTrack,children:(0,m.createElement)(w,Y)}))},data:{[je]:g}})},Ht=ee=>{const Q=useElementFilter(ee,se=>se.selectByComponentData({key:je}).getElements(),[ee]);return useCallback((se,g)=>{const w=Qe(Q,se);return _jsx(Fragment,{children:w!=null?w:_jsx(et,{rank:se.rank,result:se.document,children:_jsx(DefaultResultListItem,{rank:se.rank,highlight:se.highlight,result:se.document})})},g)},[Q])},sn=ee=>{const{results:Q,children:se,...g}=ee,w=Ht(se);return _jsx(List,{...g,children:Q.map(w)})}},61886:function(St,$e,t){"use strict";t.d($e,{Ox:function(){return Re},jM:function(){return m},Zz:function(){return y},oZ:function(){return H},DR:function(){return c},ZS:function(){return We},VA:function(){return vt},KY:function(){return Te},gT:function(){return O},Dl:function(){return re},ux:function(){return jt},$L:function(){return R},x1:function(){return qe}});var u=t(52322),r=t(2784),W=t(73557),P=t(60871);const m="techdocs.addons.addon.v1",y="techdocs.addons.wrapper.v1",c=()=>null;(0,P.R5)(c,y,!0);const B=xe=>`${m}.${xe.toLocaleLowerCase("en-US")}`;function Te(xe){const{name:pe,component:De}=xe;return(0,P.YO)({name:pe,component:{sync:Je=>(0,u.jsx)(De,{...Je})},data:{[m]:xe,[B(pe)]:!0}})}const ue=(xe,pe)=>xe.selectByComponentData({key:pe}).getElements()[0],K=xe=>xe.selectByComponentData({key:y}).selectByComponentData({key:m}),$=xe=>xe.selectByComponentData({key:y}).findComponentData({key:m}),R=()=>{const xe=(0,W.pC)(),pe=(0,P.vJ)(xe,K),De=(0,P.vJ)(xe,$),Je=(0,r.useCallback)(rt=>{if(!pe||!rt)return null;const yt=B(rt.name);var Ot;return(Ot=ue(pe,yt))!==null&&Ot!==void 0?Ot:null},[pe]),At=(0,r.useCallback)(rt=>{const yt=De.find(Ot=>Ot.name===rt);return yt?Je(yt):null},[De,Je]),wt=(0,r.useCallback)(rt=>{const yt=De.filter(Ot=>Ot.location===rt);return yt.length?yt.map(Je):null},[De,Je]);return{renderComponentByName:At,renderComponentsByLocation:wt}},O=(0,P.T0)({id:"plugin.techdocs.service"}),re=(0,P.T0)({id:"plugin.techdocs.storageservice"});var q=t(64279),ne=t(77446),D=t(25271),T=t(51837);function k(xe,pe){return pe.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(xe.kind=xe.kind.toLocaleLowerCase(),xe.name=xe.name.toLocaleLowerCase(),xe.namespace=xe.namespace.toLocaleLowerCase()),xe}const L=(xe,pe)=>(0,D.eE)(xe)===(0,D.eE)(pe),V={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},Se=(0,T.CT)("techdocs-reader-page-context"),We=(0,r.memo)(xe=>{const{entityRef:pe,children:De}=xe,Je=(0,P.h_)(O),At=(0,P.h_)(P.Ds),wt=(0,q.default)(async()=>Je.getEntityMetadata(pe),[pe]),rt=(0,ne.Z)(async()=>Je.getTechDocsMetadata(pe),[pe]),[yt,Ot]=(0,r.useState)(V.title),[Gt,It]=(0,r.useState)(V.subtitle),[on,Ut]=(0,r.useState)(V.shadowRoot);(0,r.useEffect)(()=>{on&&!rt.value&&!rt.loading&&rt.retry()},[rt.value,rt.loading,on,rt.retry,rt]);const Vt={metadata:rt,entityRef:k(pe,At),entityMetadata:wt,shadowRoot:on,setShadowRoot:Ut,title:yt,setTitle:Ot,subtitle:Gt,setSubtitle:It},zn=(0,T.EI)({1:Vt});return(0,u.jsx)(P.fC,{attributes:{entityRef:(0,D.eE)(pe)},children:(0,u.jsx)(Se.Provider,{value:zn,children:De instanceof Function?De(Vt):De})})},(xe,pe)=>L(xe.entityRef,pe.entityRef)),qe=()=>{const xe=(0,r.useContext)(Se);if(xe===void 0)return V;const pe=xe.atVersion(1);if(pe===void 0)throw new Error("No context found for version 1.");return pe},H=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var _e=t(70882),ut=t(50236),ze=t(19219),ft=t(23196);const Re="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",ct=xe=>{(0,r.useEffect)(()=>{if(!xe)return()=>{};const pe=xe.querySelectorAll('head > link[rel="stylesheet"]');var De;let Je=(De=pe==null?void 0:pe.length)!==null&&De!==void 0?De:0;const At=new CustomEvent(Re);if(!Je)return xe.dispatchEvent(At),()=>{};const wt=()=>{--Je===0&&xe.dispatchEvent(At)};return pe==null||pe.forEach(rt=>{rt.addEventListener("load",wt)}),()=>{pe==null||pe.forEach(rt=>{rt.removeEventListener("load",wt)})}},[xe])},jt=xe=>{const[pe,De]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(!xe)return()=>{};De(!0);const Je=xe.style;Je.setProperty("opacity","0");const At=()=>{De(!1),Je.setProperty("opacity","1")};return xe.addEventListener(Re,At),()=>{xe.removeEventListener(Re,At)}},[xe]),pe},vt=xe=>{const{element:pe,onAppend:De,children:Je}=xe,[At,wt]=(0,r.useState)((0,_e.Ue)({...(0,ut.Z)(),insertionPoint:void 0}));ct(pe);const rt=jt(pe),yt=(0,r.useCallback)(Ot=>{if(!pe||!Ot)return;wt((0,_e.Ue)({...(0,ut.Z)(),insertionPoint:pe.querySelector("head")||void 0}));let Gt=Ot.shadowRoot;Gt||(Gt=Ot.attachShadow({mode:"open"})),Gt.replaceChildren(pe),typeof De=="function"&&De(Gt)},[pe,De]);return(0,u.jsxs)(u.Fragment,{children:[rt&&(0,u.jsx)(ft.Ex,{}),(0,u.jsxs)(ze.ZP,{jss:At,sheetsManager:new Map,children:[(0,u.jsx)("div",{ref:yt,"data-testid":"techdocs-native-shadowroot"}),Je]})]})};var gt=t(54073);const Et=()=>{const{shadowRoot:xe}=useTechDocsReaderPage();return xe},Dt=xe=>{const pe=Et();return pe?xe.map(De=>pe==null?void 0:pe.querySelectorAll(De)).filter(De=>De.length).map(De=>Array.from(De)).flat():[]},Ge=xe=>xe.toString()&&xe.rangeCount&&xe.getRangeAt(0).getBoundingClientRect().top,Wt=(xe=0)=>{const pe=Et(),[De,Je]=useState(null),At=useMemo(()=>debounce(()=>{const wt=pe,rt=wt.getSelection?wt.getSelection():document.getSelection();rt&&Ge(rt)?Je(rt):Je(null)},xe),[pe,Je,xe]);return useEffect(()=>(window.document.addEventListener("selectionchange",At),()=>{At.cancel(),window.document.removeEventListener("selectionchange",At)}),[At]),De}},52943:function(St,$e,t){"use strict";t.r($e),t.d($e,{EmbeddedDocsRouter:function(){return q},Router:function(){return re},isTechDocsAvailable:function(){return O}});var u=t(52322),r=t(2784),W=t(73557),P=t(40303),m=t(23196),y=t(25271),c=t(89258),B=t(65124),Te=t(67896);const ue=({entity:ne})=>{const D=(0,y.iB)(ne);return(0,u.jsxs)(c.I6,{entityRef:D,children:[(0,u.jsx)(B.b,{}),(0,u.jsx)(Te.F,{withSearch:!1})]})};var K=t(18662),$=t(7476);const R="backstage.io/techdocs-ref",O=ne=>{var D,T;return Boolean(ne==null||(D=ne.metadata)===null||D===void 0||(T=D.annotations)===null||T===void 0?void 0:T[R])},re=()=>(0,u.jsxs)(W.Z5,{children:[(0,u.jsx)(W.AW,{path:"/",element:(0,u.jsx)(K.TechDocsIndexPage,{})}),(0,u.jsx)(W.AW,{path:"/:namespace/:kind/:name/*",element:(0,u.jsx)($.TechDocsReaderPage,{})})]}),q=ne=>{var D;const{children:T}=ne,{entity:k}=(0,P.X2)(),L=(0,W.V$)([{path:"/*",element:(0,u.jsx)(ue,{entity:k}),children:[{path:"*",element:T}]}]);return((D=k.metadata.annotations)===null||D===void 0?void 0:D[R])?L:(0,u.jsx)(m.sk,{annotation:R})}},92077:function(St,$e,t){"use strict";t.d($e,{k:function(){return y},p:function(){return m}});var u=t(47842),r=t(23054),W=t(76372),P=t.n(W);class m{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(B){const{kind:Te,namespace:ue,name:K}=B,R=`${await this.getApiOrigin()}/metadata/techdocs/${ue}/${Te}/${K}`,O=await this.fetchApi.fetch(`${R}`);if(!O.ok)throw await r.VL.fromResponse(O);return await O.json()}async getEntityMetadata(B){const{kind:Te,namespace:ue,name:K}=B,R=`${await this.getApiOrigin()}/metadata/entity/${ue}/${Te}/${K}`,O=await this.fetchApi.fetch(`${R}`);if(!O.ok)throw await r.VL.fromResponse(O);return await O.json()}constructor(B){(0,u.Z)(this,"configApi",void 0),(0,u.Z)(this,"discoveryApi",void 0),(0,u.Z)(this,"fetchApi",void 0),this.configApi=B.configApi,this.discoveryApi=B.discoveryApi,this.fetchApi=B.fetchApi}}class y{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var B;return(B=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&B!==void 0?B:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(B,Te){const{kind:ue,namespace:K,name:$}=B,O=`${await this.getStorageUrl()}/${K}/${ue}/${$}/${Te}`,re=await this.fetchApi.fetch(`${O.endsWith("/")?O:`${O}/`}index.html`);let q="";switch(re.status){case 404:throw q="Page not found. ",Te||(q+="This could be because there is no index.md file in the root of the docs directory of this repository."),new r.dR(q);case 500:throw q="Could not generate documentation or an error in the TechDocs backend. ",new Error(q);default:break}return re.text()}async syncEntityDocs(B,Te=()=>{}){const{kind:ue,namespace:K,name:$}=B,O=`${await this.getApiOrigin()}/sync/${K}/${ue}/${$}`,{token:re}=await this.identityApi.getCredentials();return new Promise((q,ne)=>{const D=new W.EventSourcePolyfill(O,{withCredentials:!0,headers:re?{Authorization:`Bearer ${re}`}:{}});D.addEventListener("log",T=>{T.data&&Te(JSON.parse(T.data))}),D.addEventListener("finish",T=>{let k=!1;T.data&&({updated:k}=JSON.parse(T.data)),q(k?"updated":"cached")}),D.onerror=T=>{switch(D.close(),T.status){case 404:ne(new r.dR(T.message));return;default:ne(new Error(T.data));return}}})}async getBaseUrl(B,Te,ue){const{kind:K,namespace:$,name:R}=Te,re=`${await this.getApiOrigin()}/static/docs/${$}/${K}/${R}/${ue}`;return new URL(B,re.endsWith("/")?re:`${re}/`).toString()}constructor(B){(0,u.Z)(this,"configApi",void 0),(0,u.Z)(this,"discoveryApi",void 0),(0,u.Z)(this,"identityApi",void 0),(0,u.Z)(this,"fetchApi",void 0),this.configApi=B.configApi,this.discoveryApi=B.discoveryApi,this.identityApi=B.identityApi,this.fetchApi=B.fetchApi}}},51953:function(St,$e,t){"use strict";t.d($e,{D:function(){return u}});function u(r,W){return W.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?r:r.toLocaleLowerCase("en-US")}},3482:function(St,$e,t){"use strict";t.d($e,{u:function(){return B}});var u=t(52322),r=t(2784),W=t(23196),P=t(40303),m=t(42081),y=t(48431),c=t(68435);const B=Te=>{const{initialFilter:ue="owned",columns:K,actions:$}=Te;return(0,u.jsx)(m.j,{children:(0,u.jsxs)(W.VY,{children:[(0,u.jsx)(W.yW,{title:"",children:(0,u.jsx)(W.qt,{children:"Discover documentation in your ecosystem."})}),(0,u.jsx)(P.UO,{children:(0,u.jsxs)(P._i,{children:[(0,u.jsxs)(P._i.Filters,{children:[(0,u.jsx)(y.f,{}),(0,u.jsx)(P.EW,{initialFilter:ue}),(0,u.jsx)(P.dq,{}),(0,u.jsx)(P.xE,{})]}),(0,u.jsx)(P._i.Content,{children:(0,u.jsx)(c.n,{actions:$,columns:K})})]})})]})})}},85478:function(St,$e,t){"use strict";t.d($e,{f:function(){return K}});var u=t(52322),r=t(95573),W=t(51953),P=t(60871),m=t(23196),y=t(94339),c=t(16111),B=t(24579),Te=t(14503),ue=t(2784);const K=q=>{const{entities:ne}=q,D=(0,P.tg)(r.Fw),T=(0,P.h_)(P.Ds);if(!ne)return null;var k,L;return(0,u.jsx)(m.Oh,{"data-testid":"docs-explore",children:ne!=null&&ne.length?ne.map((V,Se)=>(0,u.jsxs)(y.Z,{children:[(0,u.jsx)(c.Z,{children:(0,u.jsx)(m.hu,{title:(k=V.metadata.title)!==null&&k!==void 0?k:V.metadata.name})}),(0,u.jsx)(B.Z,{children:V.metadata.description}),(0,u.jsx)(Te.Z,{children:(0,u.jsx)(m.Qj,{to:D({namespace:(0,W.D)((L=V.metadata.namespace)!==null&&L!==void 0?L:"default",T),kind:(0,W.D)(V.kind,T),name:(0,W.D)(V.metadata.name,T)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},Se)):null})};var $=t(40303);const R={title:"All Documentation",filterPredicate:()=>!0},O=q=>{const{entities:ne,group:D}=q,{loading:T,isOwnedEntity:k}=useEntityOwnership(),L=ne.filter(Se=>D.filterPredicate==="ownedByUser"?T?!1:k(Se):typeof D.filterPredicate=="function"&&D.filterPredicate(Se)),V=(()=>typeof D.title=="string"?_jsx(ContentHeader,{title:D.title}):D.title)();return L.length===0?null:_jsxs(Content,{children:[V,_jsx(DocsCardGrid,{entities:L})]})},re=q=>{const{loading:ne,error:D,entities:T}=useEntityList();if(D)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:D.toString()})});if(ne)return _jsx(Progress,{});if(T.length===0)return _jsx("div",{"data-testid":"doc-not-found",children:_jsxs(Typography,{variant:"body2",children:["No documentation found that match your filter. Learn more about"," ",_jsx(Link,{to:"https://backstage.io/docs/features/techdocs/creating-and-publishing",children:"publishing documentation"}),"."]})});var k,L;return T.sort((V,Se)=>((k=V.metadata.title)!==null&&k!==void 0?k:V.metadata.name).localeCompare((L=Se.metadata.title)!==null&&L!==void 0?L:Se.metadata.name)),_jsx(Content,{children:(q.groups||[R]).map((V,Se)=>_jsx(O,{entities:T,group:V},`${V.title}-${Se}`))})}},68435:function(St,$e,t){"use strict";t.d($e,{H:function(){return T},n:function(){return k}});var u=t(52322),r=t(2784),W=t(95074),P=t(76635),m=t(23196),y=t(40303),c=t(60871),B=t(25271),Te=t(95573),ue=t(39981),K=t(2337),$=t(11640),R=t(28347);const O=(0,K.Z)({root:{color:"#f3ba37"}})($.Z),re={createCopyDocsUrlAction(L){return V=>({icon:()=>(0,u.jsx)(ue.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>L(`${window.location.origin}${V.resolved.docsUrl}`)})},createStarEntityAction(L,V){return Se=>{const We=Se.entity,qe=L(We);return{cellStyle:{paddingLeft:"1em"},icon:()=>qe?(0,u.jsx)(O,{}):(0,u.jsx)(R.Z,{}),tooltip:qe?"Remove from favorites":"Add to favorites",onClick:()=>V(We)}}}};function q(L){return L.metadata.title||L.metadata.name}const ne={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:L=>(0,u.jsx)(m.uw,{value:(0,u.jsx)(m.rU,{to:L.resolved.docsUrl,children:q(L.entity)}),subvalue:L.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:L})=>(0,u.jsx)(y.rI,{entityRefs:L.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var D=t(51953);const T=L=>{const{entities:V,title:Se,loading:We,columns:qe,actions:H,options:_e}=L,[,ut]=(0,W.Z)(),ze=(0,c.tg)(Te.Fw),ft=(0,c.h_)(c.Ds);if(!V)return null;const Re=V.map(vt=>{const gt=(0,y.hF)(vt,B.S4);var Et;return{entity:vt,resolved:{docsUrl:ze({namespace:(0,D.D)((Et=vt.metadata.namespace)!==null&&Et!==void 0?Et:"default",ft),kind:(0,D.D)(vt.kind,ft),name:(0,D.D)(vt.metadata.name,ft)}),ownedByRelations:gt,ownedByRelationsTitle:gt.map(Dt=>(0,y.$3)(Dt,{defaultKind:"group"})).join(", ")}}}),ct=[ne.createNameColumn(),ne.createOwnerColumn(),ne.createTypeColumn()],jt=[re.createCopyDocsUrlAction(ut)];return(0,u.jsx)(u.Fragment,{children:We||Re&&Re.length>0?(0,u.jsx)(m.iA,{isLoading:We,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1,..._e},data:Re,columns:qe||ct,actions:H||jt,title:Se?`${Se} (${Re.length})`:`All (${Re.length})`}):(0,u.jsx)(m.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,u.jsx)(m.Qj,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};T.columns=ne,T.actions=re;const k=L=>{var V;const{columns:Se,actions:We,options:qe}=L,{loading:H,error:_e,entities:ut,filters:ze}=(0,y.wp)(),{isStarredEntity:ft,toggleStarredEntity:Re}=(0,y.CR)(),[,ct]=(0,W.Z)();var jt;const vt=(0,P.capitalize)((jt=(V=ze.user)===null||V===void 0?void 0:V.value)!==null&&jt!==void 0?jt:"all"),gt=[re.createCopyDocsUrlAction(ct),re.createStarEntityAction(ft,Re)];return _e?(0,u.jsx)(m.GB,{severity:"error",title:"Could not load available documentation.",children:(0,u.jsx)(m.Oi,{language:"text",text:_e.toString()})}):(0,u.jsx)(T,{title:vt,entities:ut,loading:H,actions:We||gt,columns:Se,options:qe})};k.columns=ne,k.actions=re},18662:function(St,$e,t){"use strict";t.r($e),t.d($e,{TechDocsIndexPage:function(){return m}});var u=t(52322),r=t(2784),W=t(73557),P=t(3482);const m=y=>(0,W.pC)()||(0,u.jsx)(P.u,{...y})},42081:function(St,$e,t){"use strict";t.d($e,{j:function(){return m}});var u=t(52322),r=t(2784),W=t(23196),P=t(60871);const m=y=>{const{children:c}=y,B=(0,P.h_)(P.Ds);var Te;const ue=`Documentation available in ${(Te=B.getOptionalString("organization.name"))!==null&&Te!==void 0?Te:"Backstage"}`;return(0,u.jsx)(W.g9,{title:"Documentation",subtitle:ue,themeId:"documentation",children:c})}},48431:function(St,$e,t){"use strict";t.d($e,{f:function(){return P}});var u=t(2784),r=t(40303);class W{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":r.n3}}}const P=()=>{const{updateFilters:m}=(0,r.wp)();return(0,u.useEffect)(()=>{m({techdocs:new W})},[m]),null}},89258:function(St,$e,t){"use strict";t.d($e,{I6:function(){return K},Jl:function(){return ue},s4:function(){return y}});var u=t(61886),r=t(92077),W=t(95573),P=t(60871),m=t(15096);const y=(0,P.rx)({id:"techdocs",apis:[(0,P.ni)({api:u.Dl,deps:{configApi:P.Ds,discoveryApi:P.NW,identityApi:P.$4,fetchApi:P.gP},factory:({configApi:R,discoveryApi:O,identityApi:re,fetchApi:q})=>new r.k({configApi:R,discoveryApi:O,identityApi:re,fetchApi:q})}),(0,P.ni)({api:u.gT,deps:{configApi:P.Ds,discoveryApi:P.NW,fetchApi:P.gP},factory:({configApi:R,discoveryApi:O,fetchApi:re})=>new r.p({configApi:R,discoveryApi:O,fetchApi:re})})],routes:{root:W._Z,docRoot:W.Fw,entityContent:W.pd}}),c=y.provide((0,P.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(t.bind(t,52943)).then(R=>R.Router),mountPoint:W._Z})),B=y.provide((0,P.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(t.bind(t,52943)).then(R=>R.EmbeddedDocsRouter),mountPoint:W.pd})),Te=y.provide((0,P.P4)({name:"TechDocsCustomHome",component:()=>t.e(7560).then(t.bind(t,27560)).then(R=>R.TechDocsCustomHome),mountPoint:W._Z})),ue=y.provide((0,P.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(t.bind(t,18662)).then(R=>R.TechDocsIndexPage),mountPoint:W._Z})),K=y.provide((0,P.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(t.bind(t,7476)).then(R=>R.TechDocsReaderPage),mountPoint:W.Fw})),$=y.provide((0,m.E5)({name:"TechDocsSearchResultListItem",component:()=>Promise.resolve().then(t.bind(t,55511)).then(R=>R.TechDocsSearchResultListItem),predicate:R=>R.type==="techdocs"}))},7476:function(St,$e,t){"use strict";t.r($e),t.d($e,{TechDocsReaderLayout:function(){return K},TechDocsReaderPage:function(){return $}});var u=t(52322),r=t(2784),W=t(73557),P=t(23196),m=t(61886),y=t(67896),c=t(93225),B=t(65124),Te=t(95573),ue=t(60871);const K=R=>{const{withSearch:O,withHeader:re=!0}=R;return(0,u.jsxs)(P.T3,{themeId:"documentation",children:[re&&(0,u.jsx)(c.S,{}),(0,u.jsx)(B.b,{}),(0,u.jsx)(y.F,{withSearch:O})]})},$=R=>{const{kind:O,name:re,namespace:q}=(0,ue.Oi)(Te.Fw),{children:ne,entityRef:D={kind:O,name:re,namespace:q}}=R,T=(0,W.pC)();if(!ne){const L=T?r.Children.toArray(T.props.children):[];var k;const Se=L.flatMap(We=>{var qe;return(k=We==null||(qe=We.props)===null||qe===void 0?void 0:qe.children)!==null&&k!==void 0?k:[]}).find(We=>!(0,ue.IY)(We,m.Zz)&&!(0,ue.IY)(We,m.jM));return(0,u.jsx)(m.ZS,{entityRef:D,children:Se||(0,u.jsx)(K,{})})}return(0,u.jsx)(m.ZS,{entityRef:D,children:({metadata:L,entityMetadata:V,onReady:Se})=>(0,u.jsx)("div",{className:"techdocs-reader-page",children:(0,u.jsx)(P.T3,{themeId:"documentation",children:ne instanceof Function?ne({entityRef:D,techdocsMetadataValue:L.value,entityMetadataValue:V.value,onReady:Se}):ne})})})}},67896:function(St,$e,t){"use strict";t.d($e,{F:function(){return Q}});var u=t(52322),r=t(2784),W=t(79692),P=t(60905),m=t(61886),y=t(23196),c=t(22478),B=t(4614),Te=t(77277),ue=t(99688),K=t(12420),$=t(90436),R=t(61837),O=t(4190),re=t(87685);const q=(0,W.Z)(g=>(0,K.Z)({paper:{width:"100%",[g.breakpoints.up("sm")]:{width:"75%"},[g.breakpoints.up("md")]:{width:"50%"},padding:g.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:g.palette.background.default}})),ne=({buildLog:g,onClose:w})=>{const Y=q(),J=g.length===0?"Waiting for logs...":g.join(`
|
|
37
|
-
`);return(0,u.jsxs)(P.Z,{container:!0,direction:"column",className:Y.root,spacing:0,wrap:"nowrap",children:[(0,u.jsxs)(P.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,u.jsx)($.Z,{variant:"h5",children:"Build Details"}),(0,u.jsx)(R.Z,{title:"Close the drawer",onClick:w,color:"inherit",children:(0,u.jsx)(re.Z,{})},"dismiss")]}),(0,u.jsx)(P.Z,{item:!0,xs:!0,children:(0,u.jsx)(y.nU,{text:J,classes:{root:Y.logs}})})]})},D=({buildLog:g})=>{const w=q(),[Y,J]=(0,r.useState)(!1);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Te.Z,{color:"inherit",onClick:()=>J(!0),children:"Show Build Logs"}),(0,u.jsx)(O.ZP,{classes:{paper:w.paper},anchor:"right",open:Y,onClose:()=>J(!1),children:(0,u.jsx)(ne,{buildLog:g,onClose:()=>J(!1)})})]})};var T=t(60871);const k=({errorMessage:g})=>{const w=(0,T.h_)(T.Ds).getOptionalString("techdocs.builder");let Y="";return w!=="local"&&(Y="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,u.jsx)(y.mf,{status:"404",statusMessage:g||"Documentation not found",additionalInfo:Y})};var L=t(95481);const V=(0,W.Z)(g=>({root:{marginBottom:g.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),Se=()=>{let g=null;const w=V(),{state:Y,contentReload:J,contentErrorMessage:me,syncErrorMessage:ve,buildLog:Ue}=(0,L.DK)();return Y==="INITIAL_BUILD"&&(g=(0,u.jsx)(ue.Z,{classes:{root:w.root},variant:"outlined",severity:"info",icon:(0,u.jsx)(B.Z,{size:"24px"}),action:(0,u.jsx)(D,{buildLog:Ue}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),Y==="CONTENT_STALE_REFRESHING"&&(g=(0,u.jsx)(ue.Z,{variant:"outlined",severity:"info",icon:(0,u.jsx)(B.Z,{size:"24px"}),action:(0,u.jsx)(D,{buildLog:Ue}),classes:{root:w.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),Y==="CONTENT_STALE_READY"&&(g=(0,u.jsx)(ue.Z,{variant:"outlined",severity:"success",action:(0,u.jsx)(Te.Z,{color:"inherit",onClick:()=>J(),children:"Refresh"}),classes:{root:w.root},children:"A newer version of this documentation is now available, please refresh to view."})),Y==="CONTENT_STALE_ERROR"&&(g=(0,u.jsxs)(ue.Z,{variant:"outlined",severity:"error",action:(0,u.jsx)(D,{buildLog:Ue}),classes:{root:w.root,message:w.message},children:["Building a newer version of this documentation failed."," ",ve]})),Y==="CONTENT_NOT_FOUND"&&(g=(0,u.jsxs)(u.Fragment,{children:[ve&&(0,u.jsxs)(ue.Z,{variant:"outlined",severity:"error",action:(0,u.jsx)(D,{buildLog:Ue}),classes:{root:w.root,message:w.message},children:["Building a newer version of this documentation failed."," ",ve]}),(0,u.jsx)(k,{errorMessage:me})]})),g};var We=t(73557),qe=t(60364),H=t(41156),_e=t(32838),ut=t(35368),ze=t.n(ut);const ft=/main\.[A-Fa-f0-9]{8}\.min\.css$/,Re=/^https:\/\/fonts\.googleapis\.com/,ct=/^https:\/\/fonts\.gstatic\.com/,jt=g=>g.nodeName==="LINK",vt=g=>{const w=(g==null?void 0:g.getAttribute("href"))||"",Y=w.match(ft),J=w.match(Re),me=w.match(ct);return Y||J||me},gt=g=>(jt(g)&&!vt(g)&&g.remove(),g),Et=g=>g.nodeName==="IFRAME",Dt=(g,w)=>{const Y=g.getAttribute("src")||"";try{const{host:J}=new URL(Y);return w.includes(J)}catch{return!1}},Ge=g=>w=>(Et(w)&&!Dt(w,g)&&w.remove(),w),Wt=()=>{const g=(0,T.h_)(T.Ds);return(0,r.useMemo)(()=>g.getOptionalConfig("techdocs.sanitizer"),[g])},xe=()=>{const g=Wt();return(0,r.useCallback)(async w=>{const Y=g==null?void 0:g.getOptionalStringArray("allowedIframeHosts");ze().addHook("beforeSanitizeElements",gt);const J=["link"];return Y&&(J.push("iframe"),ze().addHook("beforeSanitizeElements",Ge(Y))),ze().sanitize(w.outerHTML,{ADD_TAGS:J,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[g])};var pe=t(41128),De=({theme:g})=>`
|
|
38
|
-
/*================== Variables ==================*/
|
|
39
|
-
/*
|
|
40
|
-
As the MkDocs output is rendered in shadow DOM, the CSS variable definitions on the root selector are not applied. Instead, they have to be applied on :host.
|
|
41
|
-
As there is no way to transform the served main*.css yet (for example in the backend), we have to copy from main*.css and modify them.
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
:host {
|
|
45
|
-
/* FONT */
|
|
46
|
-
--md-default-fg-color: ${g.palette.text.primary};
|
|
47
|
-
--md-default-fg-color--light: ${g.palette.text.secondary};
|
|
48
|
-
--md-default-fg-color--lighter: ${(0,pe.$n)(g.palette.text.secondary,.7)};
|
|
49
|
-
--md-default-fg-color--lightest: ${(0,pe.$n)(g.palette.text.secondary,.3)};
|
|
50
|
-
|
|
51
|
-
/* BACKGROUND */
|
|
52
|
-
--md-default-bg-color:${g.palette.background.default};
|
|
53
|
-
--md-default-bg-color--light: ${g.palette.background.paper};
|
|
54
|
-
--md-default-bg-color--lighter: ${(0,pe.$n)(g.palette.background.paper,.7)};
|
|
55
|
-
--md-default-bg-color--lightest: ${(0,pe.$n)(g.palette.background.paper,.3)};
|
|
56
|
-
|
|
57
|
-
/* PRIMARY */
|
|
58
|
-
--md-primary-fg-color: ${g.palette.primary.main};
|
|
59
|
-
--md-primary-fg-color--light: ${g.palette.primary.light};
|
|
60
|
-
--md-primary-fg-color--dark: ${g.palette.primary.dark};
|
|
61
|
-
--md-primary-bg-color: ${g.palette.primary.contrastText};
|
|
62
|
-
--md-primary-bg-color--light: ${(0,pe.$n)(g.palette.primary.contrastText,.7)};
|
|
63
|
-
|
|
64
|
-
/* ACCENT */
|
|
65
|
-
--md-accent-fg-color: var(--md-primary-fg-color);
|
|
66
|
-
|
|
67
|
-
/* SHADOW */
|
|
68
|
-
--md-shadow-z1: ${g.shadows[1]};
|
|
69
|
-
--md-shadow-z2: ${g.shadows[2]};
|
|
70
|
-
--md-shadow-z3: ${g.shadows[3]};
|
|
71
|
-
|
|
72
|
-
/* EXTENSIONS */
|
|
73
|
-
--md-admonition-fg-color: var(--md-default-fg-color);
|
|
74
|
-
--md-admonition-bg-color: var(--md-default-bg-color);
|
|
75
|
-
/* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */
|
|
76
|
-
--md-admonition-icon--note: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>');
|
|
77
|
-
--md-admonition-icon--abstract: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 5h16v2H4V5m0 4h16v2H4V9m0 4h16v2H4v-2m0 4h10v2H4v-2z"/></svg>');
|
|
78
|
-
--md-admonition-icon--info: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10A10 10 0 0012 2z"/></svg>');
|
|
79
|
-
--md-admonition-icon--tip: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.55 11.2c-.23-.3-.5-.56-.76-.82-.65-.6-1.4-1.03-2.03-1.66C13.3 7.26 13 4.85 13.91 3c-.91.23-1.75.75-2.45 1.32-2.54 2.08-3.54 5.75-2.34 8.9.04.1.08.2.08.33 0 .22-.15.42-.35.5-.22.1-.46.04-.64-.12a.83.83 0 01-.15-.17c-1.1-1.43-1.28-3.48-.53-5.12C5.89 10 5 12.3 5.14 14.47c.04.5.1 1 .27 1.5.14.6.4 1.2.72 1.73 1.04 1.73 2.87 2.97 4.84 3.22 2.1.27 4.35-.12 5.96-1.6 1.8-1.66 2.45-4.32 1.5-6.6l-.13-.26c-.2-.46-.47-.87-.8-1.25l.05-.01m-3.1 6.3c-.28.24-.73.5-1.08.6-1.1.4-2.2-.16-2.87-.82 1.19-.28 1.89-1.16 2.09-2.05.17-.8-.14-1.46-.27-2.23-.12-.74-.1-1.37.18-2.06.17.38.37.76.6 1.06.76 1 1.95 1.44 2.2 2.8.04.14.06.28.06.43.03.82-.32 1.72-.92 2.27h.01z"/></svg>');
|
|
80
|
-
--md-admonition-icon--success: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
|
|
81
|
-
--md-admonition-icon--question: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.07 11.25l-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 00-2-2 2 2 0 00-2 2H8a4 4 0 014-4 4 4 0 014 4 3.2 3.2 0 01-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10c0-5.53-4.5-10-10-10z"/></svg>');
|
|
82
|
-
--md-admonition-icon--warning: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 14h-2v-4h2m0 8h-2v-2h2M1 21h22L12 2 1 21z"/></svg>');
|
|
83
|
-
--md-admonition-icon--failure: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12 6.47 2 12 2m3.59 5L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41 15.59 7z"/></svg>');
|
|
84
|
-
--md-admonition-icon--danger: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.5 20l4.86-9.73H13V4l-5 9.73h3.5V20M12 2c2.75 0 5.1 1 7.05 2.95C21 6.9 22 9.25 22 12s-1 5.1-2.95 7.05C17.1 21 14.75 22 12 22s-5.1-1-7.05-2.95C3 17.1 2 14.75 2 12s1-5.1 2.95-7.05C6.9 3 9.25 2 12 2z"/></svg>');
|
|
85
|
-
--md-admonition-icon--bug: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 12h-4v-2h4m0 6h-4v-2h4m6-6h-2.81a5.985 5.985 0 00-1.82-1.96L17 4.41 15.59 3l-2.17 2.17a6.002 6.002 0 00-2.83 0L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8z"/></svg>');
|
|
86
|
-
--md-admonition-icon--example: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 13v-2h14v2H7m0 6v-2h14v2H7M7 7V5h14v2H7M3 8V5H2V4h2v4H3m-1 9v-1h3v4H2v-1h2v-.5H3v-1h1V17H2m2.25-7a.75.75 0 01.75.75c0 .2-.08.39-.21.52L3.12 13H5v1H2v-.92L4 11H2v-1h2.25z"/></svg>');
|
|
87
|
-
--md-admonition-icon--quote: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 17h3l2-4V7h-6v6h3M6 17h3l2-4V7H5v6h3l-2 4z"/></svg>');
|
|
88
|
-
--md-footnotes-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.42L5.83 13H21V7h-2z"/></svg>');
|
|
89
|
-
--md-details-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
|
|
90
|
-
--md-tasklist-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/></svg>');
|
|
91
|
-
--md-tasklist-icon--checked: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
|
|
92
|
-
--md-nav-icon--prev: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>');
|
|
93
|
-
--md-nav-icon--next: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
|
|
94
|
-
--md-toc-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 9h14V7H3v2m0 4h14v-2H3v2m0 4h14v-2H3v2m16 0h2v-2h-2v2m0-10v2h2V7h-2m0 6h2v-2h-2v2z"/></svg>');
|
|
95
|
-
--md-clipboard-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1z"/></svg>');
|
|
96
|
-
--md-search-result-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h7c-.41-.25-.8-.56-1.14-.9-.33-.33-.61-.7-.86-1.1H6V4h7v5h5v1.18c.71.16 1.39.43 2 .82V8l-6-6m6.31 16.9c1.33-2.11.69-4.9-1.4-6.22-2.11-1.33-4.91-.68-6.22 1.4-1.34 2.11-.69 4.89 1.4 6.22 1.46.93 3.32.93 4.79.02L22 23.39 23.39 22l-3.08-3.1m-3.81.1a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5z"/></svg>');
|
|
97
|
-
--md-source-forks-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 2.122a2.25 2.25 0 1 0-1.5 0v.878A2.25 2.25 0 0 0 5.75 8.5h1.5v2.128a2.251 2.251 0 1 0 1.5 0V8.5h1.5a2.25 2.25 0 0 0 2.25-2.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75h-4.5A.75.75 0 0 1 5 6.25v-.878zm3.75 7.378a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm3-8.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5z"/></svg>');
|
|
98
|
-
--md-source-repositories-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 1 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 0 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 0 1 1-1h8zM5 12.25v3.25a.25.25 0 0 0 .4.2l1.45-1.087a.25.25 0 0 1 .3 0L8.6 15.7a.25.25 0 0 0 .4-.2v-3.25a.25.25 0 0 0-.25-.25h-3.5a.25.25 0 0 0-.25.25z"/></svg>');
|
|
99
|
-
--md-source-stars-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694v.001z"/></svg>');
|
|
100
|
-
--md-source-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2.5 7.775V2.75a.25.25 0 0 1 .25-.25h5.025a.25.25 0 0 1 .177.073l6.25 6.25a.25.25 0 0 1 0 .354l-5.025 5.025a.25.25 0 0 1-.354 0l-6.25-6.25a.25.25 0 0 1-.073-.177zm-1.5 0V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.75 1.75 0 0 1 1 7.775zM6 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>');
|
|
101
|
-
--md-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="m310.6 246.6-127.1 128c-7.1 6.3-15.3 9.4-23.5 9.4s-16.38-3.125-22.63-9.375l-127.1-128C.224 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75s3.12 25.75-6.08 34.85z"/></svg>');
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
:host > * {
|
|
105
|
-
/* CODE */
|
|
106
|
-
--md-code-fg-color: ${g.palette.text.primary};
|
|
107
|
-
--md-code-bg-color: ${g.palette.background.paper};
|
|
108
|
-
--md-code-hl-color: ${(0,pe.Fq)(g.palette.warning.main,.5)};
|
|
109
|
-
--md-code-hl-keyword-color: ${g.palette.type==="dark"?g.palette.primary.light:g.palette.primary.dark};
|
|
110
|
-
--md-code-hl-function-color: ${g.palette.type==="dark"?g.palette.secondary.light:g.palette.secondary.dark};
|
|
111
|
-
--md-code-hl-string-color: ${g.palette.type==="dark"?g.palette.success.light:g.palette.success.dark};
|
|
112
|
-
--md-code-hl-number-color: ${g.palette.type==="dark"?g.palette.error.light:g.palette.error.dark};
|
|
113
|
-
--md-code-hl-constant-color: var(--md-code-hl-function-color);
|
|
114
|
-
--md-code-hl-special-color: var(--md-code-hl-function-color);
|
|
115
|
-
--md-code-hl-name-color: var(--md-code-fg-color);
|
|
116
|
-
--md-code-hl-comment-color: var(--md-default-fg-color--light);
|
|
117
|
-
--md-code-hl-generic-color: var(--md-default-fg-color--light);
|
|
118
|
-
--md-code-hl-variable-color: var(--md-default-fg-color--light);
|
|
119
|
-
--md-code-hl-operator-color: var(--md-default-fg-color--light);
|
|
120
|
-
--md-code-hl-punctuation-color: var(--md-default-fg-color--light);
|
|
121
|
-
|
|
122
|
-
/* TYPESET */
|
|
123
|
-
--md-typeset-font-size: 1rem;
|
|
124
|
-
--md-typeset-color: var(--md-default-fg-color);
|
|
125
|
-
--md-typeset-a-color: ${g.palette.link};
|
|
126
|
-
--md-typeset-table-color: ${g.palette.text.primary};
|
|
127
|
-
--md-typeset-del-color: ${g.palette.type==="dark"?(0,pe.Fq)(g.palette.error.dark,.5):(0,pe.Fq)(g.palette.error.light,.5)};
|
|
128
|
-
--md-typeset-ins-color: ${g.palette.type==="dark"?(0,pe.Fq)(g.palette.success.dark,.5):(0,pe.Fq)(g.palette.success.light,.5)};
|
|
129
|
-
--md-typeset-mark-color: ${g.palette.type==="dark"?(0,pe.Fq)(g.palette.warning.dark,.5):(0,pe.Fq)(g.palette.warning.light,.5)};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
@media screen and (max-width: 76.1875em) {
|
|
133
|
-
:host > * {
|
|
134
|
-
/* TYPESET */
|
|
135
|
-
--md-typeset-font-size: .9rem;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
@media screen and (max-width: 600px) {
|
|
140
|
-
:host > * {
|
|
141
|
-
/* TYPESET */
|
|
142
|
-
--md-typeset-font-size: .7rem;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
`,Je=({theme:g})=>`
|
|
146
|
-
/*================== Reset ==================*/
|
|
147
|
-
|
|
148
|
-
body {
|
|
149
|
-
--md-text-color: var(--md-default-fg-color);
|
|
150
|
-
--md-text-link-color: var(--md-accent-fg-color);
|
|
151
|
-
--md-text-font-family: ${g.typography.fontFamily};
|
|
152
|
-
font-family: var(--md-text-font-family);
|
|
153
|
-
background-color: unset;
|
|
154
|
-
}
|
|
155
|
-
`;const At="224px";var wt=({theme:g,sidebar:w})=>`
|
|
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:${g.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: ${g.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: ${w.isPinned?`calc(-12.1rem + ${At})`:"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 rt=["h1","h2","h3","h4","h5","h6"];var yt=({theme:g})=>`
|
|
361
|
-
/*================== Typeset ==================*/
|
|
362
|
-
|
|
363
|
-
.md-typeset {
|
|
364
|
-
font-size: var(--md-typeset-font-size);
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
${rt.reduce((w,Y)=>{var J;const me=(J=g.typography.htmlFontSize)!==null&&J!==void 0?J:16,ve=g.typography[Y],{lineHeight:Ue,fontFamily:ot,fontWeight:tt,fontSize:xt}=ve,lt=nt=>{let Oe=1;return typeof nt=="number"&&(Oe=nt/me*.6),typeof nt=="string"&&(Oe=nt.replace("rem","")),`calc(${Oe} * var(--md-typeset-font-size))`};return w.concat(`
|
|
368
|
-
.md-typeset ${Y} {
|
|
369
|
-
color: var(--md-default-fg-color);
|
|
370
|
-
line-height: ${Ue};
|
|
371
|
-
font-family: ${ot};
|
|
372
|
-
font-weight: ${tt};
|
|
373
|
-
font-size: ${lt(xt)};
|
|
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 ${g.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
|
-
`,Ot=()=>`
|
|
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
|
-
`,Gt=({theme:g})=>`
|
|
436
|
-
/*================== Extensions ==================*/
|
|
437
|
-
|
|
438
|
-
/* HIGHLIGHT */
|
|
439
|
-
.highlight .md-clipboard:after {
|
|
440
|
-
content: unset;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
.highlight .nx {
|
|
444
|
-
color: ${g.palette.type==="dark"?"#ff53a3":"#ec407a"};
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
/* CODE HILITE */
|
|
448
|
-
.codehilite .gd {
|
|
449
|
-
background-color: ${g.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
.codehilite .gi {
|
|
453
|
-
background-color: ${g.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: ${g.palette.action.disabledBackground};
|
|
484
|
-
}
|
|
485
|
-
.task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
|
|
486
|
-
background-color: ${g.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 It=[De,Je,wt,yt,Ot,Gt],on=()=>(0,y.Pf)(),Ut=()=>{const g=on(),w=(0,qe.Z)();return(0,r.useMemo)(()=>{const Y={theme:w,sidebar:g};return It.reduce((J,me)=>J+me(Y),"")},[w,g])},Vt=()=>{const g=Ut();return(0,r.useCallback)(w=>(w.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${g}</style>`),w),[g])},zn=(g,w,Y)=>{const J=g==="src"&&w.endsWith(".svg"),me=!w.match(/^([a-z]*:)?\/\//i),ve=w.startsWith(Y);return J&&(me||ve)},In=({techdocsStorageApi:g,entityId:w,path:Y})=>async J=>{const me=await g.getApiOrigin(),ve=async(Ue,ot)=>{for(const tt of Ue)if(tt.hasAttribute(ot)){const xt=tt.getAttribute(ot);if(!xt)return;const lt=await g.getBaseUrl(xt,w,Y);if(zn(ot,xt,me))try{const Oe=await(await fetch(lt,{credentials:"include"})).text();tt.setAttribute(ot,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(Oe)))}`)}catch{tt.setAttribute("alt",`Error: ${xt}`)}else tt.setAttribute(ot,lt)}};return await Promise.all([ve(J.querySelectorAll("img"),"src"),ve(J.querySelectorAll("script"),"src"),ve(J.querySelectorAll("source"),"src"),ve(J.querySelectorAll("link"),"href"),ve(J.querySelectorAll("a[download]"),"href")]),J};var an=t(79158),Fn=t(67097),jn=t(28316),Un=t(82717),Pn=t.n(Un);const Jn=g=>w=>{var Y;const J=w.querySelector('[title="Edit this page"]');if(!J||!J.href)return w;const me=new URL(J.href),ve=g.byUrl(me);if((ve==null?void 0:ve.type)!=="github"&&(ve==null?void 0:ve.type)!=="gitlab")return w;const Ue=((Y=w.querySelector("article>h1"))===null||Y===void 0?void 0:Y.childNodes[0].textContent)||"",ot=encodeURIComponent(`Documentation Feedback: ${Ue}`),tt=encodeURIComponent(`Page source:
|
|
504
|
-
${J.href}
|
|
505
|
-
|
|
506
|
-
Feedback:`),xt=(ve==null?void 0:ve.type)==="github"?(0,an.BT)(me.href,"blob"):me.href,lt=Pn()(xt),nt=`/${lt.organization}/${lt.name}`,Oe=J.cloneNode();switch(ve==null?void 0:ve.type){case"gitlab":Oe.href=`${me.origin}${nt}/issues/new?issue[title]=${ot}&issue[description]=${tt}`;break;case"github":Oe.href=`${me.origin}${nt}/issues/new?title=${ot}&body=${tt}`;break;default:return w}return jn.render(r.createElement(Fn.Z),Oe),Oe.style.paddingLeft="5px",Oe.title="Leave feedback for this page",Oe.id="git-feedback-link",J==null||J.insertAdjacentElement("beforebegin",Oe),w};var at=t(44882);const Mn=()=>g=>{const w=g.querySelector('.md-header label[for="__drawer"]'),Y=g.querySelector("article");if(!w||!Y)return g;const J=w.cloneNode();return jn.render(r.createElement(at.Z),J),J.id="toggle-sidebar",J.title="Toggle Sidebar",J.classList.add("md-content__button"),J.style.setProperty("padding","0 0 0 5px"),J.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),Y==null||Y.prepend(J),g},Ln=()=>g=>(((Y,J)=>{Array.from(Y).filter(me=>me.hasAttribute(J)).forEach(me=>{const ve=me.getAttribute(J);if(ve){ve.match(/^https?:\/\//i)&&me.setAttribute("target","_blank");try{const Ue=Wn(window.location.href);me.setAttribute(J,new URL(ve,Ue).toString())}catch{me.replaceWith(me.textContent||ve)}}})})(Array.from(g.getElementsByTagName("a")),"href"),g);function Wn(g){const w=new URL(g);return!w.pathname.endsWith("/")&&!w.pathname.endsWith(".html")&&(w.pathname+="/"),w.toString()}const En=({baseUrl:g,onClick:w})=>Y=>(Array.from(Y.getElementsByTagName("a")).forEach(J=>{J.addEventListener("click",me=>{const Ue=J.getAttribute("href");Ue&&Ue.startsWith(g)&&!J.hasAttribute("download")&&(me.preventDefault(),w(me,Ue))})}),Y);var fn=t(15459),vn=t(80030),kn=t(72379),ln=t(41547),Vn=t(95074);const ge=(0,fn.Z)(g=>({tooltip:{fontSize:"inherit",color:g.palette.text.primary,margin:0,padding:g.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(vn.ZP),ie=()=>(0,u.jsx)(kn.Z,{children:(0,u.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),Le=({text:g})=>{const[w,Y]=(0,r.useState)(!1),[,J]=(0,Vn.Z)(),me=(0,r.useCallback)(()=>{J(g),Y(!0)},[g,J]),ve=(0,r.useCallback)(()=>{Y(!1)},[Y]);return(0,u.jsx)(ge,{title:"Copied to clipboard",placement:"left",open:w,onClose:ve,leaveDelay:1e3,children:(0,u.jsx)(R.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:me,children:(0,u.jsx)(ie,{})})})},Fe=g=>w=>{const Y=w.querySelectorAll("pre > code");for(const me of Y){var J;const ve=me.textContent||"",Ue=document.createElement("div");me==null||(J=me.parentElement)===null||J===void 0||J.prepend(Ue),jn.render((0,u.jsx)(ln.Z,{theme:g,children:(0,u.jsx)(Le,{text:ve})}),Ue)}return w},Ke=()=>g=>{var w;return(w=g.querySelector(".md-header"))===null||w===void 0||w.remove(),g},_=()=>g=>{var w,Y;return(w=g.querySelector(".md-footer .md-copyright"))===null||w===void 0||w.remove(),(Y=g.querySelector(".md-footer-copyright"))===null||Y===void 0||Y.remove(),g},F=({onLoading:g,onLoaded:w})=>Y=>(g(),Y.addEventListener(m.Ox,function J(){w(),Y.removeEventListener(m.Ox,J)}),Y),fe=()=>g=>(g.addEventListener(m.Ox,function w(){if(window.location.hash){var Y;const J=window.location.hash.slice(1);(Y=g==null?void 0:g.querySelector(`[id="${J}"]`))===null||Y===void 0||Y.scrollIntoView()}g.removeEventListener(m.Ox,w)}),g),je=()=>g=>(setTimeout(()=>{const w=g==null?void 0:g.querySelectorAll("li.md-nav__item--active");w.length!==0&&(w.forEach(J=>{const me=J==null?void 0:J.querySelector("input");me!=null&&me.checked||me==null||me.click()}),w[w.length-1].scrollIntoView())},200),g),Qe=async(g,w)=>{let Y;if(typeof g=="string")Y=new DOMParser().parseFromString(g,"text/html").documentElement;else if(g instanceof Element)Y=g;else throw new Error("dom is not a recognized type");for(const J of w)Y=await J(Y);return Y},et="screen and (max-width: 76.1875em)",Zt=g=>{const w=(0,We.s0)(),Y=(0,qe.Z)(),J=(0,H.Z)(et),me=xe(),ve=Vt(),Ue=(0,T.z$)(),ot=(0,T.h_)(m.Dl),tt=(0,T.h_)(_e.q3),{state:xt,path:lt,content:nt}=(0,L.DK)(),[Oe,Tt]=(0,r.useState)(null),Kt=(0,m.ux)(Oe),Rt=(0,r.useCallback)(()=>{if(!Oe)return;Oe.querySelectorAll(".md-sidebar").forEach(Xe=>{if(J)Xe.style.top="0px";else{const gn=document==null?void 0:document.querySelector(".techdocs-reader-page");var Bt;const wn=(Bt=gn==null?void 0:gn.getBoundingClientRect().top)!==null&&Bt!==void 0?Bt:0;var qt;let Qn=(qt=Oe.getBoundingClientRect().top)!==null&&qt!==void 0?qt:0;const Hn=Oe.querySelector(".md-container > .md-tabs");var An;const cn=(An=Hn==null?void 0:Hn.getBoundingClientRect().height)!==null&&An!==void 0?An:0;Qn<wn&&(Qn=wn),Xe.style.top=`${Math.max(Qn,0)+cn}px`}Xe.style.setProperty("opacity","1")})},[Oe,J]);(0,r.useEffect)(()=>(window.addEventListener("resize",Rt),window.addEventListener("scroll",Rt,!0),()=>{window.removeEventListener("resize",Rt),window.removeEventListener("scroll",Rt,!0)}),[Oe,Rt]);const Pt=(0,r.useCallback)(()=>{if(!Oe)return;const ht=Oe.querySelector(".md-footer");ht&&(ht.style.width=`${Oe.getBoundingClientRect().width}px`)},[Oe]);(0,r.useEffect)(()=>(window.addEventListener("resize",Pt),()=>{window.removeEventListener("resize",Pt)}),[Oe,Pt]),(0,r.useEffect)(()=>{Kt||(Pt(),Rt())},[xt,Kt,Pt,Rt]);const tn=(0,r.useCallback)((ht,Xe)=>Qe(ht,[me,In({techdocsStorageApi:ot,entityId:g,path:Xe}),Ln(),Mn(),Ke(),_(),Jn(tt),ve]),[g,tt,ot,me,ve]),Mt=(0,r.useCallback)(async ht=>Qe(ht,[fe(),je(),Fe(Y),En({baseUrl:window.location.origin,onClick:(Xe,Bt)=>{var qt;const An=Xe.ctrlKey||Xe.metaKey,gn=new URL(Bt),wn=`${gn.pathname}${gn.search}${gn.hash}`,Qn=((qt=Xe.target)===null||qt===void 0?void 0:qt.innerText)||Bt,Hn=Bt.replace(window.location.origin,"");if(Ue.captureEvent("click",Qn,{attributes:{to:Hn}}),gn.hash)if(An)window.open(wn,"_blank");else{var cn;w(wn),(cn=ht==null?void 0:ht.querySelector(`[id="${gn.hash.slice(1)}"]`))===null||cn===void 0||cn.scrollIntoView()}else An?window.open(wn,"_blank"):w(wn)}}),F({onLoading:()=>{},onLoaded:()=>{var Xe;(Xe=ht.querySelector(".md-nav__title"))===null||Xe===void 0||Xe.removeAttribute("for")}}),F({onLoading:()=>{Array.from(ht.querySelectorAll(".md-sidebar")).forEach(Bt=>{Bt.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[Y,w,Ue]);return(0,r.useEffect)(()=>{if(!nt)return()=>{};let ht=!0;return tn(nt,lt).then(async Xe=>{if(!(Xe!=null&&Xe.innerHTML)||!ht)return;window.scroll({top:0});const Bt=await Mt(Xe);Tt(Bt)}),()=>{ht=!1}},[nt,lt,tn,Mt]),Oe};var Ht=t(8560);const sn=()=>{const g=(0,m.$L)(),{shadowRoot:w}=(0,m.x1)(),Y=w==null?void 0:w.querySelector('[data-md-component="content"]'),J=w==null?void 0:w.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let me=J==null?void 0:J.querySelector('[data-techdocs-addons-location="primary sidebar"]');me||(me=document.createElement("div"),me.setAttribute("data-techdocs-addons-location","primary sidebar"),J==null||J.prepend(me));const ve=w==null?void 0:w.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Ue=ve==null?void 0:ve.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Ue||(Ue=document.createElement("div"),Ue.setAttribute("data-techdocs-addons-location","secondary sidebar"),ve==null||ve.prepend(Ue)),(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Ht.Z,{container:me,children:g.renderComponentsByLocation(m.oZ.PrimarySidebar)}),(0,u.jsx)(Ht.Z,{container:Y,children:g.renderComponentsByLocation(m.oZ.Content)}),(0,u.jsx)(Ht.Z,{container:Ue,children:g.renderComponentsByLocation(m.oZ.SecondarySidebar)})]})},ee=(0,W.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),Q=(0,L.m1)(g=>{var w;const{withSearch:Y=!0,onReady:J}=g,me=ee(),{entityMetadata:{value:ve,loading:Ue},entityRef:ot,setShadowRoot:tt}=(0,m.x1)(),xt=Zt(ot),lt=(0,r.useCallback)(nt=>{tt(nt),J instanceof Function&&J()},[tt,J]);return Ue===!1&&!ve?(0,u.jsx)(y.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):xt?(0,u.jsx)(y.VY,{children:(0,u.jsxs)(P.Z,{container:!0,children:[(0,u.jsx)(P.Z,{xs:12,item:!0,children:(0,u.jsx)(Se,{})}),Y&&(0,u.jsx)(P.Z,{className:me.search,xs:"auto",item:!0,children:(0,u.jsx)(c.S,{entityId:ot,entityTitle:ve==null||(w=ve.metadata)===null||w===void 0?void 0:w.title})}),(0,u.jsx)(P.Z,{xs:12,item:!0,children:(0,u.jsx)(m.VA,{element:xt,onAppend:lt,children:(0,u.jsx)(sn,{})})})]})}):(0,u.jsx)(y.VY,{children:(0,u.jsx)(P.Z,{container:!0,children:(0,u.jsx)(P.Z,{xs:12,item:!0,children:(0,u.jsx)(Se,{})})})})}),se=null},93225:function(St,$e,t){"use strict";t.d($e,{S:function(){return q}});var u=t(52322),r=t(2784),W=t(18671),P=t(60905),m=t(98069),y=t(60364),c=t(73250),B=t(61886),Te=t(40303),ue=t(25271),K=t(23196),$=t(60871),R=t(76635),O=t(95573);const re=(0,u.jsx)(m.Z,{animation:"wave",variant:"text",height:40}),q=ne=>{const{palette:{common:{white:D}}}=(0,y.Z)(),{children:T}=ne,k=(0,B.$L)(),L=(0,$.h_)($.Ds),{title:V,setTitle:Se,subtitle:We,setSubtitle:qe,entityRef:H,metadata:{value:_e,loading:ut},entityMetadata:{value:ze,loading:ft}}=(0,B.x1)();(0,r.useEffect)(()=>{_e&&(Se(_e.site_name),qe(()=>{let{site_description:pe}=_e;return(!pe||pe==="None")&&(pe=""),pe}))},[_e,Se,qe]);const Re=L.getOptional("app.title")||"Backstage",ct=[V,We,Re].filter(Boolean).join(" | "),{locationMetadata:jt,spec:vt}=ze||{},gt=vt==null?void 0:vt.lifecycle,Et=ze?(0,Te.hF)(ze,ue.S4):[],Dt=(0,$.tg)(O._Z)(),Ge=(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(K.i9,{label:(0,R.capitalize)((ze==null?void 0:ze.kind)||"entity"),value:(0,u.jsx)(Te.dx,{color:"inherit",entityRef:H,title:ze==null?void 0:ze.metadata.title,defaultKind:"Component"})}),Et.length>0&&(0,u.jsx)(K.i9,{label:"Owner",value:(0,u.jsx)(Te.rI,{color:"inherit",entityRefs:Et,defaultKind:"group"})}),gt?(0,u.jsx)(K.i9,{label:"Lifecycle",value:gt}):null,jt&&jt.type!=="dir"&&jt.type!=="file"?(0,u.jsx)(K.i9,{label:"",value:(0,u.jsxs)(P.Z,{container:!0,direction:"column",alignItems:"center",style:{color:D},children:[(0,u.jsx)(P.Z,{style:{padding:0},item:!0,children:(0,u.jsx)(c.Z,{style:{marginTop:"-25px"}})}),(0,u.jsx)(P.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:jt.target}):null]});return!ft&&ze===void 0||!ut&&_e===void 0?null:(0,u.jsxs)(K.h4,{type:"Documentation",typeLink:Dt,title:V||re,subtitle:We===""?void 0:We||re,children:[(0,u.jsx)(W.Z,{titleTemplate:"%s",children:(0,u.jsx)("title",{children:ct})}),Ge,T,k.renderComponentsByLocation(B.oZ.Header)]})}},65124:function(St,$e,t){"use strict";t.d($e,{b:function(){return $}});var u=t(52322),r=t(2784),W=t(79692),P=t(15223),m=t(95544),y=t(80030),c=t(61837),B=t(48348),Te=t(47603),ue=t(61886);const K=(0,W.Z)(R=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:R.spacing(3,3,0)}})),$=R=>{const O=K(),[re,q]=(0,r.useState)(null),ne=(0,r.useCallback)(We=>{q(We.currentTarget)},[]),D=(0,r.useCallback)(()=>{q(null)},[]),{entityMetadata:{value:T,loading:k}}=(0,ue.x1)(),L=(0,ue.$L)(),V=L.renderComponentsByLocation(ue.oZ.Subheader),Se=L.renderComponentsByLocation(ue.oZ.Settings);return!V&&!Se||k===!1&&!T?null:(0,u.jsx)(P.Z,{classes:O,...R.toolbarProps,children:(0,u.jsxs)(m.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[V,Se?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(y.ZP,{title:"Settings",children:(0,u.jsx)(c.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:ne,children:(0,u.jsx)(Te.Z,{})})}),(0,u.jsx)(B.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:re,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(re),onClose:D,keepMounted:!0,children:(0,u.jsx)("div",{children:Se})})]}):null]})})}},95481:function(St,$e,t){"use strict";t.d($e,{DK:function(){return $},m1:function(){return O}});var u=t(52322),r=t(2784),W=t(73557),P=t(61886),m=t(60871),y=t(64279),c=t(77446);function B({contentLoading:re,content:q,activeSyncState:ne}){return re||ne==="BUILD_READY_RELOAD"||!q&&ne==="CHECKING"?"CHECKING":!q&&ne==="BUILDING"?"INITIAL_BUILD":q?ne==="BUILDING"?"CONTENT_STALE_REFRESHING":ne==="BUILD_READY"?"CONTENT_STALE_READY":ne==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function Te(re,q){const ne={...re};switch(q.type){case"sync":q.state==="CHECKING"&&(ne.buildLog=[]),ne.activeSyncState=q.state,ne.syncError=q.syncError;break;case"contentLoading":ne.contentLoading=!0,ne.contentError=void 0;break;case"content":typeof q.path=="string"&&(ne.path=q.path),ne.contentLoading=!1,ne.content=q.content,ne.contentError=q.contentError;break;case"buildLog":ne.buildLog=ne.buildLog.concat(q.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(ne.activeSyncState)&&["contentLoading","content"].includes(q.type)&&(ne.activeSyncState="UP_TO_DATE",ne.buildLog=[]),ne}function ue(re,q,ne,D){var T,k;const[L,V]=(0,r.useReducer)(Te,{activeSyncState:"CHECKING",path:D,contentLoading:!0,buildLog:[]}),Se=(0,m.h_)(P.Dl),{retry:We}=(0,c.Z)(async()=>{V({type:"contentLoading"});try{const _e=await Se.getEntityDocs({kind:re,namespace:q,name:ne},D);return V({type:"content",content:_e,path:D}),_e}catch(_e){V({type:"content",contentError:_e,path:D})}},[Se,re,q,ne,D]),qe=(0,r.useRef)({content:void 0,reload:()=>{}});return qe.current={content:L.content,reload:We},(0,y.default)(async()=>{V({type:"sync",state:"CHECKING"});const _e=setTimeout(()=>{V({type:"sync",state:"BUILDING"})},1e3);try{switch(await Se.syncEntityDocs({kind:re,namespace:q,name:ne},ze=>{V({type:"buildLog",log:ze})})){case"updated":qe.current.content?V({type:"sync",state:"BUILD_READY"}):(qe.current.reload(),V({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":V({type:"sync",state:"UP_TO_DATE"});break;default:V({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(ut){V({type:"sync",state:"ERROR",syncError:ut})}finally{clearTimeout(_e)}},[re,ne,q,Se,V,qe]),{state:(0,r.useMemo)(()=>B({activeSyncState:L.activeSyncState,contentLoading:L.contentLoading,content:L.content}),[L.activeSyncState,L.content,L.contentLoading]),contentReload:We,path:L.path,content:L.content,contentErrorMessage:(T=L.contentError)===null||T===void 0?void 0:T.toString(),syncErrorMessage:(k=L.syncError)===null||k===void 0?void 0:k.toString(),buildLog:L.buildLog}}const K=(0,r.createContext)({}),$=()=>(0,r.useContext)(K),R=re=>{const{children:q}=re,{"*":ne=""}=(0,W.UO)(),{entityRef:D}=(0,P.x1)(),{kind:T,namespace:k,name:L}=D,V=ue(T,k,L,ne);return(0,u.jsx)(K.Provider,{value:V,children:q instanceof Function?q(V):q})},O=re=>q=>(0,u.jsx)(R,{children:(0,u.jsx)(re,{...q})})},95573:function(St,$e,t){"use strict";t.d($e,{Fw:function(){return W},_Z:function(){return r},pd:function(){return P}});var u=t(60871);const r=(0,u.NT)({id:"techdocs:index-page"}),W=(0,u.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),P=(0,u.NT)({id:"techdocs:catalog-reader-view"})},55511:function(St,$e,t){"use strict";t.r($e),t.d($e,{TechDocsSearchResultListItem:function(){return ue}});var u=t(52322),r=t(2784),W=t(79692),P=t(49378),m=t(86136),y=t(90436),c=t(23196),B=t(15096);const Te=(0,W.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),ue=K=>{const{result:$,highlight:R,lineClamp:O=5,asListItem:re=!0,asLink:q=!0,title:ne,icon:D}=K,T=Te(),k=({children:Se})=>q?(0,u.jsx)(c.rU,{noTrack:!0,to:$.location,children:Se}):(0,u.jsx)(u.Fragment,{children:Se}),L=()=>{const Se=R!=null&&R.fields.title?(0,u.jsx)(B.FA,{text:R.fields.title,preTag:R.preTag,postTag:R.postTag}):$.title,We=R!=null&&R.fields.entityTitle?(0,u.jsx)(B.FA,{text:R.fields.entityTitle,preTag:R.preTag,postTag:R.postTag}):$.entityTitle,qe=R!=null&&R.fields.name?(0,u.jsx)(B.FA,{text:R.fields.name,preTag:R.preTag,postTag:R.postTag}):$.name;return $?(0,u.jsx)(P.Z,{className:T.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,u.jsx)(k,{children:ne||(0,u.jsxs)(u.Fragment,{children:[Se," | ",We!=null?We:qe," docs"]})}),secondary:(0,u.jsx)(y.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:O,overflow:"hidden"},color:"textSecondary",variant:"body2",children:R!=null&&R.fields.text?(0,u.jsx)(B.FA,{text:R.fields.text,preTag:R.preTag,postTag:R.postTag}):$.text})}):null},V=({children:Se})=>re?(0,u.jsxs)(u.Fragment,{children:[D&&(0,u.jsx)(m.Z,{children:typeof D=="function"?D($):D}),(0,u.jsx)("div",{className:T.flexContainer,children:Se})]}):(0,u.jsx)(u.Fragment,{children:Se});return(0,u.jsx)(V,{children:(0,u.jsx)(L,{})})}},22478:function(St,$e,t){"use strict";t.d($e,{S:function(){return K}});var u=t(52322),r=t(15096),W=t(79692),P=t(27556),m=t(2784),y=t(73557),c=t(55511);const B=(0,W.Z)($=>({root:{width:"100%"},bar:{padding:$.spacing(1)}})),Te=$=>$==null?void 0:$.document,ue=$=>{const{entityId:R,entityTitle:O,debounceTime:re=150}=$,[q,ne]=(0,m.useState)(!1),D=(0,y.s0)(),{setFilters:T,result:{loading:k,value:L}}=(0,r.Rx)(),V=B(),[Se,We]=(0,m.useState)([]);(0,m.useEffect)(()=>{let ze=!0;if(ze&&L){const ft=L.results.slice(0,10);We(ft)}return()=>{ze=!1}},[k,L]);const{kind:qe,name:H,namespace:_e}=R;(0,m.useEffect)(()=>{T(ze=>({...ze,kind:qe,namespace:_e,name:H}))},[qe,_e,H,T]);const ut=(ze,ft)=>{if(Te(ft)){const{location:Re}=ft.document;D(Re)}};return(0,u.jsx)(P.Z,{className:V.bar,variant:"outlined",children:(0,u.jsx)(r.qO,{classes:{root:V.root},"data-testid":"techdocs-search-bar",size:"small",open:q,getOptionLabel:()=>"",filterOptions:ze=>ze,onClose:()=>{ne(!1)},onFocus:()=>{ne(!0)},onChange:ut,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Se,renderOption:({document:ze,highlight:ft})=>(0,u.jsx)(c.TechDocsSearchResultListItem,{result:ze,lineClamp:3,asListItem:!1,asLink:!1,title:ze.title,highlight:ft}),loading:k,inputDebounceTime:re,inputPlaceholder:`Search ${O||R.name} docs`,freeSolo:!1})})},K=$=>{const R={term:"",types:["techdocs"],pageCursor:"",filters:$.entityId};return(0,u.jsx)(r.Nd,{initialState:R,children:(0,u.jsx)(ue,{...$})})}},53260:function(){}},function(St){var $e=function(u){return St(St.s=u)};St.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,242,5109,6816,5218,4736],function(){return $e(6290)});var t=St.O()}]);})();
|
|
507
|
-
|
|
508
|
-
//# sourceMappingURL=main.9f408ea9.js.map
|