@techdocs/cli 0.0.0-nightly-20221017030331 → 0.0.0-nightly-20221020030155
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 +16 -5
- package/dist/embedded-app/.config-schema.json +2 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{1032.98bf1656.chunk.js → 1032.3ec26faa.chunk.js} +2 -2
- package/dist/embedded-app/static/{1032.98bf1656.chunk.js.map → 1032.3ec26faa.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{1105.c44a4e31.chunk.js → 1105.48eaee97.chunk.js} +2 -2
- package/dist/embedded-app/static/{1105.c44a4e31.chunk.js.map → 1105.48eaee97.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{184.9b13e518.chunk.js → 184.57d084bd.chunk.js} +2 -2
- package/dist/embedded-app/static/{184.9b13e518.chunk.js.map → 184.57d084bd.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{2440.d2ba00eb.chunk.js → 2440.7c69ae66.chunk.js} +2 -2
- package/dist/embedded-app/static/{2440.d2ba00eb.chunk.js.map → 2440.7c69ae66.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{5458.75ad4388.chunk.js → 5458.eeb032d8.chunk.js} +2 -2
- package/dist/embedded-app/static/{5458.75ad4388.chunk.js.map → 5458.eeb032d8.chunk.js.map} +1 -1
- package/dist/embedded-app/static/5837.1a94aabb.chunk.js +3 -0
- package/dist/embedded-app/static/5837.1a94aabb.chunk.js.map +1 -0
- package/dist/embedded-app/static/{732.dc28074b.chunk.js → 732.84a8859a.chunk.js} +2 -2
- package/dist/embedded-app/static/{732.dc28074b.chunk.js.map → 732.84a8859a.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7560.7f574fa6.chunk.js → 7560.e59f6f97.chunk.js} +2 -2
- package/dist/embedded-app/static/{7560.7f574fa6.chunk.js.map → 7560.e59f6f97.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7750.f1fbf797.chunk.js → 7750.0f3395fe.chunk.js} +2 -2
- package/dist/embedded-app/static/{7750.f1fbf797.chunk.js.map → 7750.0f3395fe.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9545.d96fa9ec.chunk.js → 9545.dc231dd2.chunk.js} +2 -2
- package/dist/embedded-app/static/{9545.d96fa9ec.chunk.js.map → 9545.dc231dd2.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9770.f5e0b19c.chunk.js → 9770.b39cb4c4.chunk.js} +2 -2
- package/dist/embedded-app/static/{9770.f5e0b19c.chunk.js.map → 9770.b39cb4c4.chunk.js.map} +1 -1
- package/dist/embedded-app/static/main.8e8b82d7.js +492 -0
- package/dist/embedded-app/static/main.8e8b82d7.js.map +1 -0
- package/dist/embedded-app/static/{module-octokit.d25711cc.js → module-octokit.9fb0d235.js} +2 -2
- package/dist/embedded-app/static/{module-octokit.d25711cc.js.map → module-octokit.9fb0d235.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.5e3c320b.js → runtime.8e8b82d7.js} +2 -2
- package/dist/embedded-app/static/{runtime.5e3c320b.js.map → runtime.8e8b82d7.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.5e3c320b.js → vendor.8e8b82d7.js} +1 -1
- package/dist/embedded-app/static/{vendor.5e3c320b.js.map → vendor.8e8b82d7.js.map} +1 -1
- package/dist/index.cjs.js +1 -1
- package/package.json +6 -6
- package/dist/embedded-app/static/5837.b13b9c05.chunk.js +0 -3
- package/dist/embedded-app/static/5837.b13b9c05.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.5e3c320b.js +0 -492
- package/dist/embedded-app/static/main.5e3c320b.js.map +0 -1
|
@@ -1,492 +0,0 @@
|
|
|
1
|
-
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{29644:function(jt,Me,t){"use strict";t.d(Me,{n3:function(){return V},MS:function(){return y}});var h=t(25271),n=t(23054),m=t(96279),R=t.n(m);const V=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class y{async getEntityAncestors(P,ne){const{kind:q,namespace:_,name:F}=(0,h.of)(P.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(q)}/${encodeURIComponent(_)}/${encodeURIComponent(F)}/ancestry`,ne)}async getLocationById(P,ne){return await this.requestOptional("GET",`/locations/${encodeURIComponent(P)}`,ne)}async getEntities(P,ne){const{filter:q=[],fields:_=[],offset:F,limit:X,after:Q}=P!=null?P:{},ue=[];for(const $ of[q].flat()){const E=[];for(const[T,te]of Object.entries($))for(const Se of[te].flat())Se===V?E.push(encodeURIComponent(T)):typeof Se=="string"&&E.push(`${encodeURIComponent(T)}=${encodeURIComponent(Se)}`);E.length&&ue.push(`filter=${E.join(",")}`)}_.length&&ue.push(`fields=${_.map(encodeURIComponent).join(",")}`),F!==void 0&&ue.push(`offset=${F}`),X!==void 0&&ue.push(`limit=${X}`),Q!==void 0&&ue.push(`after=${encodeURIComponent(Q)}`);const le=ue.length?`?${ue.join("&")}`:"",L=await this.requestRequired("GET",`/entities${le}`,ne),I=($,E)=>{var T,te;if(((T=$.metadata)===null||T===void 0?void 0:T.name)===void 0||$.kind===void 0||((te=E.metadata)===null||te===void 0?void 0:te.name)===void 0||E.kind===void 0)return 0;const Se=(0,h.eE)($),Ke=(0,h.eE)(E);return Se<Ke?-1:Se>Ke?1:0};return{items:L.sort(I)}}async getEntityByRef(P,ne){const{kind:q,namespace:_,name:F}=(0,h.of)(P);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(q)}/${encodeURIComponent(_)}/${encodeURIComponent(F)}`,ne)}async getEntityByName(P,ne){const{kind:q,namespace:_="default",name:F}=P;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(q)}/${encodeURIComponent(_)}/${encodeURIComponent(F)}`,ne)}async refreshEntity(P,ne){const q=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(ne==null?void 0:ne.token)&&{Authorization:`Bearer ${ne==null?void 0:ne.token}`}},method:"POST",body:JSON.stringify({entityRef:P})});if(q.status!==200)throw new Error(await q.text())}async getEntityFacets(P,ne){const{filter:q=[],facets:_}=P,F=[];for(const Q of[q].flat()){const ue=[];for(const[le,L]of Object.entries(Q))for(const I of[L].flat())I===V?ue.push(encodeURIComponent(le)):typeof I=="string"&&ue.push(`${encodeURIComponent(le)}=${encodeURIComponent(I)}`);ue.length&&F.push(`filter=${ue.join(",")}`)}for(const Q of _)F.push(`facet=${encodeURIComponent(Q)}`);const X=F.length?`?${F.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${X}`,ne)}async addLocation(P,ne){const{type:q="url",target:_,dryRun:F}=P,X=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${F?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(ne==null?void 0:ne.token)&&{Authorization:`Bearer ${ne==null?void 0:ne.token}`}},method:"POST",body:JSON.stringify({type:q,target:_})});if(X.status!==201)throw new Error(await X.text());const{location:Q,entities:ue,exists:le}=await X.json();if(!Q)throw new Error(`Location wasn't added: ${_}`);return{location:Q,entities:ue,exists:le}}async getLocationByRef(P,ne){return(await this.requestRequired("GET","/locations",ne)).map(_=>_.data).find(_=>P===(0,h.NZ)(_))}async removeLocationById(P,ne){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(P)}`,ne)}async removeEntityByUid(P,ne){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(P)}`,ne)}async validateEntity(P,ne,q){const _=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(q==null?void 0:q.token)&&{Authorization:`Bearer ${q==null?void 0:q.token}`}},method:"POST",body:JSON.stringify({entity:P,location:ne})});if(_.ok)return{valid:!0};if(_.status!==400)throw await n.VL.fromResponse(_);const{errors:F=[]}=await _.json();return{valid:!1,errors:F}}async requestIgnored(P,ne,q){const _=`${await this.discoveryApi.getBaseUrl("catalog")}${ne}`,F=q!=null&&q.token?{Authorization:`Bearer ${q.token}`}:{},X=await this.fetchApi.fetch(_,{method:P,headers:F});if(!X.ok)throw await n.VL.fromResponse(X)}async requestRequired(P,ne,q){const _=`${await this.discoveryApi.getBaseUrl("catalog")}${ne}`,F=q!=null&&q.token?{Authorization:`Bearer ${q.token}`}:{},X=await this.fetchApi.fetch(_,{method:P,headers:F});if(!X.ok)throw await n.VL.fromResponse(X);return await X.json()}async requestOptional(P,ne,q){const _=`${await this.discoveryApi.getBaseUrl("catalog")}${ne}`,F=q!=null&&q.token?{Authorization:`Bearer ${q.token}`}:{},X=await this.fetchApi.fetch(_,{method:P,headers:F});if(!X.ok){if(X.status===404)return;throw await n.VL.fromResponse(X)}return await X.json()}constructor(P){this.discoveryApi=P.discoveryApi,this.fetchApi=P.fetchApi||{fetch:R()}}}},25271:function(jt,Me,t){"use strict";t.d(Me,{Tf:function(){return m},P1:function(){return ge},q1:function(){return ee},M6:function(){return Ae},l2:function(){return n},zG:function(){return h},w$:function(){return on},nP:function(){return jn},aS:function(){return An},S4:function(){return _t},cz:function(){return bn},iB:function(){return at},CV:function(){return et},of:function(){return ut},Ou:function(){return Ue},eE:function(){return lt},NZ:function(){return _e}});const h="default",n="backstage.io/view-url",m="backstage.io/edit-url",R="kubernetes.io/api-server",V="kubernetes.io/api-server-certificate-authority",y="kubernetes.io/auth-provider";var l=t(76635),P=t.n(l);class ne{async enforce(O){return O.metadata.namespace?O:lodash.merge({metadata:{namespace:this.namespace}},O)}constructor(O=DEFAULT_NAMESPACE){this.namespace=O}}class q{static isValidPrefixAndOrSuffix(O,ae,We,U){if(typeof O!="string")return!1;const Z=O.split(ae);return Z.length===1?U(Z[0]):Z.length===2?We(Z[0])&&U(Z[1]):!1}static isJsonSafe(O){try{return P().isEqual(O,JSON.parse(JSON.stringify(O)))}catch{return!1}}static isValidDnsSubdomain(O){return typeof O=="string"&&O.length>=1&&O.length<=253&&O.split(".").every(q.isValidDnsLabel)}static isValidDnsLabel(O){return typeof O=="string"&&O.length>=1&&O.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(O)}static isValidTag(O){return typeof O=="string"&&O.length>=1&&O.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(O)}static isValidUrl(O){if(typeof O!="string")return!1;try{return new URL(O),!0}catch{return!1}}static isValidString(O){var ae;return typeof O=="string"&&((ae=O==null?void 0:O.trim())===null||ae===void 0?void 0:ae.length)>=1}static isNonEmptyString(O){var ae;return typeof O=="string"&&((ae=O==null?void 0:O.trim())===null||ae===void 0?void 0:ae.length)>=1}}var _=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}}}}}'),F=t(27991),X=t.n(F),Q=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"}}}`),ue=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityMeta","description":"Metadata fields common to all versions/kinds of entity.","examples":[{"uid":"e01199ab-08cc-44c2-8e19-5c29ded82521","etag":"lsndfkjsndfkjnsdfkjnsd==","name":"my-component-yay","namespace":"the-namespace","labels":{"backstage.io/custom":"ValueStuff"},"annotations":{"example.com/bindings":"are-secret"},"tags":["java","data"]}],"type":"object","required":["name"],"additionalProperties":true,"properties":{"uid":{"type":"string","description":"A globally unique ID for the entity. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, but the server is free to reject requests that do so in such a way that it breaks semantics.","examples":["e01199ab-08cc-44c2-8e19-5c29ded82521"],"minLength":1},"etag":{"type":"string","description":"An opaque string that changes for each update operation to any part of the entity, including metadata. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, and the server will then reject the operation if it does not match the current stored value.","examples":["lsndfkjsndfkjnsdfkjnsd=="],"minLength":1},"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1},"title":{"type":"string","description":"A display name of the entity, to be presented in user interfaces instead of the name property, when available.","examples":["React SSR Template"],"minLength":1},"description":{"type":"string","description":"A short (typically relatively few words, on one line) description of the entity."},"labels":{"type":"object","description":"Key/value pairs of identifying information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"annotations":{"type":"object","description":"Key/value pairs of non-identifying auxiliary information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"tags":{"type":"array","description":"A list of single-valued strings, to for example classify catalog entities in various ways.","items":{"type":"string","minLength":1}},"links":{"type":"array","description":"A list of external hyperlinks related to the entity. Links can provide additional contextual information that may be located outside of Backstage itself. For example, an admin dashboard or external CMS page.","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://admin.example-org.com"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["Admin Dashboard"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"type":{"type":"string","description":"An optional value to categorize links into specific groups.","examples":["runbook","documentation","logs","dashboard"],"minLength":1}}}}}}'),le=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"common","type":"object","description":"Common definitions to import from other schemas","definitions":{"reference":{"$id":"#reference","type":"object","description":"A reference by name to another entity.","required":["kind","namespace","name"],"additionalProperties":false,"properties":{"kind":{"type":"string","description":"The kind field of the entity.","minLength":1},"namespace":{"type":"string","description":"The metadata.namespace field of the entity.","minLength":1},"name":{"type":"string","description":"The metadata.name field of the entity.","minLength":1}}},"relation":{"$id":"#relation","type":"object","description":"A directed relation from one entity to another.","required":["type","target"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference"},"targetRef":{"type":"string","minLength":1,"description":"The entity ref of the target of this relation."}}},"status":{"$id":"#status","type":"object","description":"The current status of the entity, as claimed by various sources.","required":[],"additionalProperties":true,"properties":{"items":{"type":"array","items":{"$ref":"#statusItem"}}}},"statusItem":{"$id":"#statusItem","type":"object","description":"A specific status item on a well known format.","required":["type","level","message"],"additionalProperties":true,"properties":{"type":{"type":"string","minLength":1},"level":{"$ref":"#statusLevel","description":"The status level / severity of the status item."},"message":{"type":"string","description":"A brief message describing the status, intended for human consumption."},"error":{"$ref":"#error","description":"An optional serialized error object related to the status."}}},"statusLevel":{"$id":"#statusLevel","type":"string","description":"A status level / severity.","enum":["info","warning","error"]},"error":{"$id":"#error","type":"object","description":"A serialized error object.","required":["name","message"],"additionalProperties":true,"properties":{"name":{"type":"string","examples":["Error","InputError"],"description":"The type name of the error","minLength":1},"message":{"type":"string","description":"The message of the error"},"code":{"type":"string","description":"An error code associated with the error"},"stack":{"type":"string","description":"An error stack trace"}}}}}');const L=new Map,I=[_,Q,ue,le];function $(Y){if(!(Y!=null&&Y.length))throw new TypeError("Unknown error");const O=Y[0];throw new TypeError(`${O.instancePath||"<root>"} ${O.message}${O.params?` - ${Object.entries(O.params).map(([ae,We])=>`${ae}: ${We}`).join(", ")}`:""}`)}function E(Y,O={}){var ae;const We=(ae=O==null?void 0:O.disableCache)!==null&&ae!==void 0?ae:!1,U=We?"":JSON.stringify(Y);if(!We){const be=L.get(U);if(be)return be}const Z=T(Y),he=new(X())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});Z.length&&he.addSchema(Z,void 0,void 0,!0);const ye=he.compile(Y);return We||L.set(U,ye),ye}function T(Y){if(typeof Y!="object")return[];const O=new Set;Y.$id&&O.add(Y.$id);const ae=new Array,We=[Y];for(;We.length;){const U=We.pop();for(const Z of te(U))if(!O.has(Z)){O.add(Z);const he=I.find(ye=>ye.$id===Z);he&&(ae.push(he),We.push(he))}}return ae}function*te(Y){const O=[Y];for(;O.length;){const ae=O.pop();if(typeof ae=="object"&&ae)for(const[We,U]of Object.entries(ae))We==="$ref"&&typeof U=="string"?yield U.split("#")[0]:O.push(U)}}function Se(Y){const O=compileAjvSchema(Y||entityEnvelopeSchema);return ae=>{if(O(ae)===!0)return ae;throw throwAjvError(O.errors)}}function Ke(Y){const O=E(Y);return ae=>{var We;if(O(ae)===!0)return ae;const Z=(We=O.errors)===null||We===void 0?void 0:We.filter(he=>["/kind","/apiVersion"].includes(he.instancePath));if((Z==null?void 0:Z.length)&&Z.every(he=>he.keyword==="enum"))return!1;throw $(O.errors)}}function Ge(Y){const O=compileAjvSchema(Y||entitySchema);return ae=>{if(O(ae)===!0)return ae;throw throwAjvError(O.errors)}}class Ee{static isValidApiVersion(O){return q.isValidPrefixAndOrSuffix(O,"/",q.isValidDnsSubdomain,ae=>ae.length>=1&&ae.length<=63&&/^[a-z0-9A-Z]+$/.test(ae))}static isValidKind(O){return typeof O=="string"&&O.length>=1&&O.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(O)}static isValidObjectName(O){return typeof O=="string"&&O.length>=1&&O.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(O)}static isValidNamespace(O){return q.isValidDnsLabel(O)}static isValidLabelKey(O){return q.isValidPrefixAndOrSuffix(O,"/",q.isValidDnsSubdomain,Ee.isValidObjectName)}static isValidLabelValue(O){return O===""||Ee.isValidObjectName(O)}static isValidAnnotationKey(O){return q.isValidPrefixAndOrSuffix(O,"/",q.isValidDnsSubdomain,Ee.isValidObjectName)}static isValidAnnotationValue(O){return typeof O=="string"}}const Je={isValidApiVersion:Ee.isValidApiVersion,isValidKind:Ee.isValidKind,isValidEntityName:Ee.isValidObjectName,isValidNamespace:Ee.isValidNamespace,isValidLabelKey:Ee.isValidLabelKey,isValidLabelValue:Ee.isValidLabelValue,isValidAnnotationKey:Ee.isValidAnnotationKey,isValidAnnotationValue:Ee.isValidAnnotationValue,isValidTag:Y=>typeof Y=="string"&&Y.length>=1&&Y.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(Y)};function ft(Y={}){return{...Je,...Y}}class Ze{async enforce(O){function ae(b,W,fe){if(W==null)throw new Error(`${b} must have a value`);let de;try{de=fe(W)}catch(Ce){throw new Error(`${b} could not be validated, ${Ce}`)}if(!de){let Ce;switch(fe.name){case"isValidLabelValue":case"isValidObjectName":Ce="a string that is sequences of [a-zA-Z0-9] separated by any of [-_.], at most 63 characters in total";break;case"isValidLabelKey":case"isValidApiVersion":case"isValidAnnotationKey":Ce="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":Ce="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":Ce="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":Ce="a string";break;case"isValidKind":Ce="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":Ce="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":Ce="a non empty string";break;default:Ce=void 0;break}const Ie=Ce?` expected ${Ce} but found "${W}".`:"";throw new Error(`"${b}" is not valid;${Ie} 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 We(b,W,fe){return W===void 0||ae(b,W,fe)}ae("apiVersion",O.apiVersion,this.validators.isValidApiVersion),ae("kind",O.kind,this.validators.isValidKind),ae("metadata.name",O.metadata.name,this.validators.isValidEntityName),We("metadata.namespace",O.metadata.namespace,this.validators.isValidNamespace);var U;for(const[b,W]of Object.entries((U=O.metadata.labels)!==null&&U!==void 0?U:[]))ae(`labels.${b}`,b,this.validators.isValidLabelKey),ae(`labels.${b}`,W,this.validators.isValidLabelValue);var Z;for(const[b,W]of Object.entries((Z=O.metadata.annotations)!==null&&Z!==void 0?Z:[]))ae(`annotations.${b}`,b,this.validators.isValidAnnotationKey),ae(`annotations.${b}`,W,this.validators.isValidAnnotationValue);var he;const ye=(he=O.metadata.tags)!==null&&he!==void 0?he:[];for(let b=0;b<ye.length;++b)ae(`tags.${b}`,ye[b],this.validators.isValidTag);var be;const De=(be=O.metadata.links)!==null&&be!==void 0?be:[];for(let b=0;b<De.length;++b){var Oe,He,qe;ae(`links.${b}.url`,(Oe=De[b])===null||Oe===void 0?void 0:Oe.url,CommonValidatorFunctions.isValidUrl),We(`links.${b}.title`,(He=De[b])===null||He===void 0?void 0:He.title,CommonValidatorFunctions.isNonEmptyString),We(`links.${b}.icon`,(qe=De[b])===null||qe===void 0?void 0:qe.icon,KubernetesValidatorFunctions.isValidObjectName)}return O}constructor(O=makeValidator()){this.validators=O}}class ke{async enforce(O){if(!this.validate){const U=new Ajv({allowUnionTypes:!0});this.validate=U.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(O)===!0)return O;const[We]=this.validate.errors||[];throw We?new Error(`Malformed envelope, ${We.instancePath||"<root>"} ${We.message}`):new Error("Malformed envelope, Unknown error")}}function nt(Y){let O=Y.indexOf(":");const ae=Y.indexOf("/");ae!==-1&&ae<O&&(O=-1);const We=O===-1?void 0:Y.slice(0,O),U=ae===-1?void 0:Y.slice(O+1,ae),Z=Y.slice(Math.max(O+1,ae+1));if(We===""||U===""||Z==="")throw new TypeError(`Entity reference "${Y}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:We,namespace:U,name:Z}}function at(Y){return{kind:Y.kind,namespace:Y.metadata.namespace||h,name:Y.metadata.name}}function ut(Y,O){if(!Y)throw new Error("Entity reference must not be empty");const ae=O==null?void 0:O.defaultKind,We=(O==null?void 0:O.defaultNamespace)||h;let U,Z,he;if(typeof Y=="string"){const He=nt(Y);var ye;U=(ye=He.kind)!==null&&ye!==void 0?ye:ae;var be;Z=(be=He.namespace)!==null&&be!==void 0?be:We,he=He.name}else{var De;U=(De=Y.kind)!==null&&De!==void 0?De:ae;var Oe;Z=(Oe=Y.namespace)!==null&&Oe!==void 0?Oe:We,he=Y.name}if(U)if(Z){if(!he){const He=JSON.stringify(Y);throw new Error(`Entity reference ${He} had missing or empty name`)}}else{const He=JSON.stringify(Y);throw new Error(`Entity reference ${He} had missing or empty namespace`)}else{const He=JSON.stringify(Y);throw new Error(`Entity reference ${He} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:U,namespace:Z,name:he}}function lt(Y){let O,ae,We;if("metadata"in Y){O=Y.kind;var U;ae=(U=Y.metadata.namespace)!==null&&U!==void 0?U:h,We=Y.metadata.name}else{O=Y.kind;var Z;ae=(Z=Y.namespace)!==null&&Z!==void 0?Z:h,We=Y.name}return`${O.toLocaleLowerCase("en-US")}:${ae.toLocaleLowerCase("en-US")}/${We.toLocaleLowerCase("en-US")}`}class ot{async enforce(O){let ae=O;for(const We of this.policies){const U=await We.enforce(ae);if(!U)throw new Error(`Policy ${We.constructor.name} did not return a result`);ae=U}return ae}constructor(O){this.policies=O}}class dt{async enforce(O){for(const ae of this.policies){const We=await ae.enforce(O);if(We)return We}throw new Error("The entity did not match any known policy")}constructor(O){this.policies=O}}const gt={allOf(Y){return new ot(Y)},oneOf(Y){return new dt(Y)}};var Be=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ApiV1alpha1","description":"An API describes an interface that can be exposed by a component. The API can be defined in different formats, like OpenAPI, AsyncAPI, GraphQL, gRPC, or other formats.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"API","metadata":{"name":"artist-api","description":"Retrieve artist details","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"openapi","lifecycle":"production","owner":"artist-relations-team","system":"artist-engagement-portal","definition":"openapi: \\"3.0.0\\"\\ninfo:..."}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["API"]},"spec":{"type":"object","required":["type","lifecycle","owner","definition"],"properties":{"type":{"type":"string","description":"The type of the API definition.","examples":["openapi","asyncapi","graphql","grpc"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the API.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the API.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the API belongs to.","minLength":1},"definition":{"type":"string","description":"The definition of the API, based on the format defined by the type.","minLength":1}}}}}]}');function ie(Y){let O;return{async check(ae){return O||(O=Ke(Y)),O(ae)===ae}}}const Te=ie(Be);var Fe=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 mt=ie(Fe);var bt=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 Pt=ie(bt);var ht=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 Ct=ie(ht);var Tt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"LocationV1alpha1","description":"A location is a marker that references other places to look for catalog data.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Location","metadata":{"name":"org-data"},"spec":{"type":"url","targets":["http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-consultants.yaml"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Location"]},"spec":{"type":"object","required":[],"properties":{"type":{"type":"string","description":"The single location type, that's common to the targets specified in the spec. If it is left out, it is inherited from the location type that originally read the entity data.","examples":["url"],"minLength":1},"target":{"type":"string","description":"A single target as a string. Can be either an absolute path/URL (depending on the type), or a relative path such as ./details/catalog-info.yaml which is resolved relative to the location of this Location entity itself.","examples":["./details/catalog-info.yaml"],"minLength":1},"targets":{"type":"array","description":"A list of targets as strings. They can all be either absolute paths/URLs (depending on the type), or relative paths such as ./details/catalog-info.yaml which are resolved relative to the location of this Location entity itself.","items":{"type":"string","examples":["./details/catalog-info.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml"],"minLength":1}},"presence":{"type":"string","description":"Whether the presence of the location target is required and it should be considered an error if it can not be found","default":"required","examples":["required"],"enum":["required","optional"]}}}}}]}`);const kt=ie(Tt),_t="ownedBy",en="ownerOf",Kt="consumesApi",Xt="apiConsumedBy",ln="providesApi",qt="apiProvidedBy",jn="dependsOn",on="dependencyOf",En="parentOf",cn="childOf",Wn="memberOf",Vt="hasMember",bn="partOf",An="hasPart";var Ut=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 dn=ie(Ut);var un=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 Sn=ie(un);var Tn=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 pn=ie(Tn),ge="backstage.io/managed-by-location",ee="backstage.io/managed-by-origin-location",Ae="backstage.io/source-location";function Ue(Y){if(typeof Y!="string")throw new TypeError(`Unable to parse location ref '${Y}', unexpected argument ${typeof Y}`);const O=Y.indexOf(":");if(O<0)throw new TypeError(`Unable to parse location ref '${Y}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const ae=Y.substring(0,O).trim(),We=Y.substring(O+1).trim();if(!ae||!We)throw new TypeError(`Unable to parse location ref '${Y}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(ae==="http"||ae==="https")throw new TypeError(`Invalid location ref '${Y}', please prefix it with 'url:', e.g. 'url:${Y}'`);return{type:ae,target:We}}function _e(Y){const{type:O,target:ae}=Y;if(O){if(!ae)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");return`${O}:${ae}`}function et(Y){var O,ae,We,U,Z;const he=(Z=(O=Y.metadata)===null||O===void 0||(ae=O.annotations)===null||ae===void 0?void 0:ae[Ae])!==null&&Z!==void 0?Z:(We=Y.metadata)===null||We===void 0||(U=We.annotations)===null||U===void 0?void 0:U[ge];if(!he)throw new Error(`Entity '${lt(Y)}' is missing location`);return Ue(he)}},71399:function(jt,Me,t){"use strict";t.d(Me,{zx:function(){return Ge},Oi:function(){return ot},VY:function(){return ji},yW:function(){return Fa},XF:function(){return Be},mn:function(){return ee},NX:function(){return h},ub:function(){return be},mf:function(){return Wa},yu:function(){return Zt},h4:function(){return Bi},M6:function(){return yr},i9:function(){return tl},aR:function(){return Ei},rJ:function(){return jr},Oh:function(){return ll},hu:function(){return ol},rU:function(){return Se},nU:function(){return Hr},sk:function(){return He},Or:function(){return ds},T3:function(){return Di},g9:function(){return ul},Ex:function(){return us},Gk:function(){return x},tn:function(){return Ai},Ph:function(){return yt},YE:function(){return Qo},v7:function(){return qi},R6:function(){return Ci},tR:function(){return Fo},uw:function(){return ua},qt:function(){return vi},iA:function(){return $i},GB:function(){return Dt},po:function(){return ir},mZ:function(){return ks},Pf:function(){return Zr}});var h={};t.r(h),t.d(h,{Nm:function(){return ie},ht:function(){return mt},LJ:function(){return Fe}});var n=t(52322),m=t(2784),R=t(25248),V=t(19928);function y(e){const[s,i]=useState([]),d=useApi(alertApiRef),{anchorOrigin:p={vertical:"top",horizontal:"center"}}=e;if(useEffect(()=>{const B=d.alert$().subscribe(z=>i(N=>N.concat(z)));return()=>{B.unsubscribe()}},[d]),s.length===0)return null;const[g]=s,w=()=>{i(B=>B.filter(z=>z!==g))};return _jsx(Snackbar,{open:!0,anchorOrigin:p,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:w,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:g.severity,children:_jsxs("span",{children:[g.message.toString(),s.length>1&&_jsx("em",{children:` (${s.length-1} older ${pluralize("message",s.length-1)})`})]})})})}var l=t(79692),P=t(12420);const ne=(0,l.Z)(e=>(0,P.Z)({avatar:{width:"4rem",height:"4rem",color:"#fff",fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function q(e){const{displayName:s,picture:i,customStyles:d}=e,p=ne();let g={...d};return i||(g={backgroundColor:stringToColor(s||""),...d}),_jsx(MaterialAvatar,{alt:s,src:i,className:p.avatar,style:g,children:s&&extractInitials(s)})}var _=t(77277),F=t(72779),X=t.n(F),Q=t(86689),ue=t(62833),le=t(76635);const L=(0,l.Z)({visuallyHidden:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",height:1,width:1},externalLink:{position:"relative"}},{name:"Link"}),I=e=>/^([a-z+.-]+):/.test(e),$=()=>{try{return(0,R.h_)(R.Ds).getOptionalString("app.baseUrl")}catch{return}},E=()=>{const e="http://dummy.dev";var s;const i=(s=$())!==null&&s!==void 0?s:"/",{pathname:d}=new URL(i,e);return(0,le.trimEnd)(d,"/")},T=e=>{let s=String(e);const i=E(),d=I(s),p=s.startsWith(i);return!d&&!p&&(s=i.concat(s)),s},te=e=>{if(e instanceof Array)return e.map(te).join(" ").trim();if(typeof e=="object"&&e){var s;return te(e==null||(s=e.props)===null||s===void 0?void 0:s.children)}return["string","number"].includes(typeof e)?String(e):""},Se=m.forwardRef(({onClick:e,noTrack:s,...i},d)=>{const p=L(),g=(0,R.z$)(),w=T(i.to),B=te(i.children)||w,z=I(w),N=z&&!!/^https?:/.exec(w),ve=oe=>{e==null||e(oe),s||g.captureEvent("click",B,{attributes:{to:w}})};return z?(0,n.jsxs)(Q.Z,{...N?{target:"_blank",rel:"noopener"}:{},...i,ref:d,href:w,onClick:ve,className:X()(p.externalLink,i.className),children:[i.children,(0,n.jsx)("span",{className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,n.jsx)(Q.Z,{...i,ref:d,component:ue.rU,to:w,onClick:ve})}),Ke=m.forwardRef((e,s)=>(0,n.jsx)(Se,{ref:s,...e,color:"initial"})),Ge=m.forwardRef((e,s)=>(0,n.jsx)(_.Z,{ref:s,component:Ke,...e}));var Ee=t(60364),Je=t(61837),ft=t(80030),Ze=t(19353),ke=t(95074);function nt(e){const{text:s,tooltipDelay:i=1e3,tooltipText:d="Text copied to clipboard","aria-label":p="Copy text"}=e,g=(0,R.h_)(R.VE),[w,B]=(0,m.useState)(!1),[{error:z},N]=(0,ke.Z)();(0,m.useEffect)(()=>{z&&g.post(z)},[z,g]);const ve=oe=>{oe.stopPropagation(),B(!0),N(s)};return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(ft.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:i,onClose:()=>B(!1),open:w,children:(0,n.jsx)(Je.Z,{onClick:ve,"aria-label":p,children:(0,n.jsx)(Ze.Z,{})})})})}var at=t(83229),ut=t(26639),lt=t(39595);function ot(e){const{text:s,language:i,showLineNumbers:d=!1,highlightedNumbers:p,customStyle:g,showCopyCodeButton:w=!1}=e,B=(0,Ee.Z)(),z=B.palette.type==="dark"?ut.Z:lt.Z,N=B.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,n.jsxs)("div",{style:{position:"relative"},children:[(0,n.jsx)(at.Z,{customStyle:g,language:i,style:z,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:B.palette.textVerySubtle},lineProps:ve=>p!=null&&p.includes(ve)?{style:{backgroundColor:N}}:{},children:s}),w&&(0,n.jsx)("div",{style:{position:"absolute",top:0,right:0},children:(0,n.jsx)(nt,{text:s})})]})}var dt=t(41156),gt=t(88188);function Be(e){const{title:s,to:i}=e,d=(0,dt.Z)(p=>p.breakpoints.down("xs"));return i?d?(0,n.jsx)(Je.Z,{component:ue.rU,color:"primary",title:s,size:"small",to:i,children:(0,n.jsx)(gt.Z,{})}):(0,n.jsx)(_.Z,{component:ue.rU,variant:"contained",color:"primary",to:i,children:s}):null}var ie;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(ie||(ie={}));var Te;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(Te||(Te={}));var Fe;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(Fe||(Fe={}));var mt;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(mt||(mt={}));var bt=t(27397),Pt=t(11105),ht=t(97963),Ct=t(46506),Tt=t.n(Ct),kt=t(54073),_t=t.n(kt),en=t(10368);const Kt=(0,l.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function Xt({node:{id:e}}){const s=Kt(),[i,d]=m.useState(0),[p,g]=m.useState(0),w=m.useRef(null);m.useLayoutEffect(()=>{if(w.current){let{height:ve,width:oe}=w.current.getBBox();ve=Math.round(ve),oe=Math.round(oe),(ve!==p||oe!==i)&&(d(oe),g(ve))}},[i,p]);const B=10,z=i+B*2,N=p+B*2;return(0,n.jsxs)("g",{children:[(0,n.jsx)("rect",{className:s.node,width:z,height:N,rx:10}),(0,n.jsx)("text",{ref:w,className:s.text,y:N/2,x:z/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const ln="arrow-marker",qt="node",jn="edge",on="label",En=(0,en.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),cn=e=>(0,n.jsx)(Xt,{...e});function Wn({render:e=cn,setNode:s,node:i}){const{width:d,height:p,x:g=0,y:w=0}=i,B=i,z=En(),N=m.useRef(null);return m.useLayoutEffect(()=>{if(N.current){let{height:ve,width:oe}=N.current.getBBox();ve=Math.round(ve),oe=Math.round(oe),(ve!==p||oe!==d)&&s(i.id,{...i,height:ve,width:oe})}},[i,d,p,s]),(0,n.jsx)("g",{ref:N,"data-testid":qt,className:z.node,transform:`translate(${g-d/2},${w-p/2})`,children:e({node:B})})}var Vt=t(76985),bn=t(27916),An=t(19574),Ut=t.n(An);const dn=(0,en.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function un({edge:{label:e}}){const s=dn();return(0,n.jsx)("text",{className:s.text,textAnchor:"middle",children:e})}const Sn=(0,en.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"}),Tn=e=>(0,n.jsx)(un,{...e});function pn({render:e=Tn,setEdge:s,id:i,edge:d,curve:p}){const{x:g=0,y:w=0,width:B,height:z,points:N}=d,ve=d,oe=Sn(),me=m.useRef(null);m.useLayoutEffect(()=>{if(me.current){let{height:tt,width:Rt}=me.current.getBBox();tt=Math.round(tt),Rt=Math.round(Rt),(tt!==z||Rt!==B)&&s(i,{...d,height:tt,width:Rt})}},[d,z,B,s,i]);let Le="";const Ye=m.useMemo(()=>Vt.Z().x(tt=>tt.x).y(tt=>tt.y).curve(bn[p]),[p]);if(N){const tt=N.filter(Rt=>Ut()(Rt.x)&&Ut()(Rt.y));Le=Ye(tt)||""}return(0,n.jsxs)(n.Fragment,{children:[Le&&(0,n.jsx)("path",{"data-testid":jn,className:oe.path,d:Le}),ve.label?(0,n.jsx)("g",{ref:me,"data-testid":on,className:oe.label,transform:`translate(${g},${w})`,children:e({edge:ve})}):null]})}const ge="workspace";function ee(e){var s,i;const{edges:d,nodes:p,renderNode:g,direction:w=ie.TOP_BOTTOM,align:B,nodeMargin:z=50,edgeMargin:N=10,rankMargin:ve=50,paddingX:oe=0,paddingY:me=0,acyclicer:Le,ranker:Ye=Fe.NETWORK_SIMPLEX,labelPosition:tt=mt.RIGHT,labelOffset:Rt=10,edgeRanks:Mt=1,edgeWeight:Jt=1,renderLabel:Qt,defs:Lt,zoom:Ht="enabled",curve:zt="curveMonotoneX",...pr}=e,fr=(0,ht.Z)(),[Xn,Dr]=m.useState(100),[Bs,Zs]=m.useState(100),Gt=m.useRef(new(Tt()).graphlib.Graph),[Nr,si]=m.useState(((s=Gt.current.graph())===null||s===void 0?void 0:s.width)||0),[Fr,bo]=m.useState(((i=Gt.current.graph())===null||i===void 0?void 0:i.height)||0),[oi,Cn]=m.useState([]),[ar,Ur]=m.useState([]),qn=Math.max(Nr,Xn),nn=Math.max(Fr,Bs),Zn=m.useMemo(()=>_t()(sn=>{if(!sn)return;const wn=Pt.Z(sn),rn=Pt.Z(sn.getElementById(ge));function er(){wn.call(bt.sP().scaleExtent([1,10]).on("zoom",gr=>{gr.transform.x=Math.min(0,Math.max(gr.transform.x,qn-qn*gr.transform.k)),gr.transform.y=Math.min(0,Math.max(gr.transform.y,nn-nn*gr.transform.k)),rn.attr("transform",gr.transform)}))}Ht==="enabled"?er():Ht==="enable-on-click"&&wn.on("click",()=>er());const{width:tr,height:So}=sn.getBoundingClientRect();Xn!==tr&&Dr(tr),Bs!==So&&Zs(So)},100),[Bs,Xn,qn,nn,Ht]),Mr=m.useCallback(()=>{const sn=Gt.current.nodes(),wn=Gt.current.edges();sn.forEach(rn=>{p.some(tr=>tr.id===rn)||Gt.current.removeNode(rn)}),wn.forEach(rn=>{d.some(tr=>tr.from===rn.v&&tr.to===rn.w)||Gt.current.removeEdge(rn.v,rn.w)}),p.forEach(rn=>{const er=Gt.current.nodes().find(tr=>rn.id===tr);if(er&&Gt.current.node(er)){const{width:tr,height:So,x:gr,y:Rl}=Gt.current.node(er);Gt.current.setNode(er,{...rn,width:tr,height:So,x:gr,y:Rl})}else Gt.current.setNode(rn.id,{...rn,width:0,height:0})}),d.forEach(rn=>{Gt.current.setEdge(rn.from,rn.to,{...rn,label:rn.label,width:0,height:0,labelpos:tt,labeloffset:Rt,weight:Jt,minlen:Mt})})},[d,p,tt,Rt,Jt,Mt]),_n=m.useMemo(()=>_t()(()=>{Tt().layout(Gt.current);const{height:sn,width:wn}=Gt.current.graph(),rn=Math.max(0,sn||0),er=Math.max(0,wn||0);si(er),bo(rn),Cn(Gt.current.nodes()),Ur(Gt.current.edges())},250,{leading:!0}),[]);m.useEffect(()=>(Gt.current.setGraph({rankdir:w,align:B,nodesep:z,edgesep:N,ranksep:ve,marginx:oe,marginy:me,acyclicer:Le,ranker:Ye}),Mr(),_n(),_n.cancel),[Le,B,w,N,oe,me,z,ve,Ye,Mr,_n]);function Ds(sn,wn){return Gt.current.setNode(sn,wn),_n(),Gt.current}function Il(sn,wn){return Gt.current.setEdge(sn,wn),_n(),Gt.current}return(0,n.jsxs)("svg",{ref:Zn,...pr,width:"100%",height:nn,viewBox:`0 0 ${qn} ${nn}`,children:[(0,n.jsxs)("defs",{children:[(0,n.jsx)("marker",{id:ln,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,n.jsx)("path",{fill:fr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),Lt]}),(0,n.jsx)("g",{id:ge,children:(0,n.jsxs)("svg",{width:Nr,height:Fr,y:nn/2-Fr/2,x:qn/2-Nr/2,viewBox:`0 0 ${Nr} ${Fr}`,children:[ar.map(sn=>{const wn=Gt.current.edge(sn);return wn?(0,n.jsx)(pn,{id:sn,setEdge:Il,render:Qt,edge:wn,curve:zt},`${sn.v}-${sn.w}`):null}),oi.map(sn=>{const wn=Gt.current.node(sn);return wn?(0,n.jsx)(Wn,{setNode:Ds,render:g,node:wn},sn):null})]})})]})}var Ae;const Ue=(0,l.Z)(e=>({root:{padding:e.spacing(0),marginBottom:e.spacing(0),marginTop:e.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:e.spacing(6),marginTop:-e.spacing(3),zIndex:"unset"},icon:{fontSize:20},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:(Ae=e.palette.banner.warning)!==null&&Ae!==void 0?Ae:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),_e=e=>{const{variant:s,message:i,id:d,fixed:p=!1}=e,g=Ue(),B=useApi(storageApiRef).forBucket("notifications");var z;const N=(z=B.snapshot("dismissedBanners").value)!==null&&z!==void 0?z:[],[ve,oe]=useState(new Set(N)),me=useObservable(B.observe$("dismissedBanners"));useEffect(()=>{if(me!=null&&me.value){var Ye;const tt=(Ye=me==null?void 0:me.value)!==null&&Ye!==void 0?Ye:[];oe(new Set(tt))}},[me==null?void 0:me.value]);const Le=()=>{B.set("dismissedBanners",[...ve,d])};return _jsx(Snackbar,{anchorOrigin:p?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!ve.has(d),classes:{root:classNames(g.root,!p&&g.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(g.content,g[s]),message:g.message},message:i,action:[_jsx(IconButton,{title:"Permanently dismiss this message",color:"inherit",onClick:Le,children:_jsx(Close,{className:g.icon})},"dismiss")]})})};var et=t(60905),Y=t(90436),O=t.p+"static/missingAnnotation.67f79e98..svg",ae=t.p+"static/noInformation.4b426325..svg",We=t.p+"static/createComponent.975d1e1e..svg",U=t.p+"static/noBuild.1715fa71..svg";const Z=(0,l.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),he=({missing:e})=>{const s=Z();switch(e){case"field":return(0,n.jsx)("img",{src:O,className:s.generalImg,alt:"annotation is missing"});case"info":return(0,n.jsx)("img",{src:ae,alt:"no Information",className:s.generalImg});case"content":return(0,n.jsx)("img",{src:We,alt:"create Component",className:s.generalImg});case"data":return(0,n.jsx)("img",{src:U,alt:"no Build",className:s.generalImg});default:return null}},ye=(0,l.Z)(e=>({root:{backgroundColor:e.palette.background.default,padding:e.spacing(2,0,0,0)},action:{marginTop:e.spacing(2)},imageContainer:{position:"relative"}}),{name:"BackstageEmptyState"});function be(e){const{title:s,description:i,missing:d,action:p}=e,g=ye();return(0,n.jsxs)(et.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:g.root,spacing:2,children:[(0,n.jsx)(et.Z,{item:!0,xs:12,md:6,children:(0,n.jsxs)(et.Z,{container:!0,direction:"column",children:[(0,n.jsx)(et.Z,{item:!0,xs:!0,children:(0,n.jsx)(Y.Z,{variant:"h5",children:s})}),(0,n.jsx)(et.Z,{item:!0,xs:!0,children:(0,n.jsx)(Y.Z,{variant:"body1",children:i})}),(0,n.jsx)(et.Z,{item:!0,xs:!0,className:g.action,children:p})]})}),(0,n.jsx)(et.Z,{item:!0,xs:12,md:6,className:g.imageContainer,children:typeof d=="string"?(0,n.jsx)(he,{missing:d}):d.customImage})]})}const De=`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`,Oe=(0,l.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":"#fff"}}),{name:"BackstageMissingAnnotationEmptyState"});function He(e){const{annotation:s,readMoreUrl:i}=e,d=i||"https://backstage.io/docs/features/software-catalog/well-known-annotations",p=Oe(),g=(0,n.jsxs)(n.Fragment,{children:["The ",(0,n.jsx)("code",{children:s})," annotation is missing. You need to add the annotation to your component if you want to enable this tool."]});return(0,n.jsx)(be,{missing:"field",title:"Missing Annotation",description:g,action:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Y.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,n.jsx)("div",{className:p.code,children:(0,n.jsx)(ot,{text:De.replace("ANNOTATION",s),language:"yaml",showLineNumbers:!0,highlightedNumbers:[6,7],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(_.Z,{color:"primary",component:Se,to:d,children:"Read more"})]})})}var qe=t(11776),b=t(38402),W=t(49378),fe=t(41128),de=t(27616),Ce=t(8284),Ie=t(70660),Ne=t(91750),rt=t(38016);const xt=(e,s)=>(s.palette.type==="light"?fe._j:fe.$n)(s.palette[e].light,.6),vt=(e,s)=>(s.palette.type==="light"?fe.$n:fe._j)(s.palette[e].light,.9),st=(0,l.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:s})=>xt(s,e)}})),pt=({severity:e})=>{const s=st({severity:e});return(0,n.jsx)(Ne.Z,{classes:s})},At=({severity:e})=>{const s=st({severity:e});return(0,n.jsx)(rt.Z,{classes:s})},Et=(0,l.Z)(e=>({panel:{backgroundColor:({severity:s})=>vt(s,e),color:({severity:s})=>xt(s,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:s})=>xt(s,e),fontWeight:"bold"},message:{width:"100%",display:"block",color:({severity:s})=>xt(s,e),backgroundColor:({severity:s})=>vt(s,e)},details:{width:"100%",display:"block",color:e.palette.textContrast,backgroundColor:e.palette.background.default,border:`1px solid ${e.palette.border}`,padding:e.spacing(2),fontFamily:"sans-serif"}}),{name:"BackstageWarningPanel"}),It=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function Dt(e){const{severity:s="warning",title:i,message:d,children:p,defaultExpanded:g}=e,w=Et({severity:s}),B=It(s)+(i?`: ${i}`:"");return(0,n.jsxs)(de.Z,{defaultExpanded:g!=null?g:!1,className:w.panel,role:"alert",children:[(0,n.jsxs)(Ce.Z,{expandIcon:(0,n.jsx)(At,{severity:s}),className:w.summary,children:[(0,n.jsx)(pt,{severity:s}),(0,n.jsx)(Y.Z,{className:w.summaryText,variant:"subtitle1",children:B})]}),(d||p)&&(0,n.jsx)(Ie.Z,{children:(0,n.jsxs)(et.Z,{container:!0,children:[d&&(0,n.jsx)(et.Z,{item:!0,xs:12,children:(0,n.jsx)(Y.Z,{className:w.message,variant:"body1",children:d})}),p&&(0,n.jsx)(et.Z,{item:!0,xs:12,className:w.details,children:p})]})})]})}const In=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),Dn=({error:e,message:s,stack:i,children:d})=>{const p=In();return(0,n.jsxs)(qe.Z,{dense:!0,children:[(0,n.jsxs)(b.Z,{alignItems:"flex-start",children:[(0,n.jsx)(W.Z,{classes:{secondary:p.text},primary:"Error",secondary:e}),(0,n.jsx)(nt,{text:e})]}),(0,n.jsxs)(b.Z,{alignItems:"flex-start",children:[(0,n.jsx)(W.Z,{classes:{secondary:p.text},primary:"Message",secondary:s}),(0,n.jsx)(nt,{text:s})]}),i&&(0,n.jsxs)(b.Z,{alignItems:"flex-start",children:[(0,n.jsx)(W.Z,{classes:{secondary:p.text},primary:"Stack Trace",secondary:i}),(0,n.jsx)(nt,{text:i})]}),d]})};function Zt(e){const{title:s,error:i,defaultExpanded:d,children:p}=e;return(0,n.jsx)(Dt,{severity:"error",title:s!=null?s:i.message,defaultExpanded:d,children:(0,n.jsx)(Dn,{error:i.name,message:i.message,stack:i.stack,children:p})})}var C=t(85256);const u=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function x(e){var s;const{title:i,error:d,defaultExpanded:p}=e,g=u();if(d.name!=="ResponseError")return(0,n.jsx)(Zt,{title:i!=null?i:d.message,defaultExpanded:p,error:d});const{body:w,cause:B}=d,{request:z,response:N}=w,ve=`${N.statusCode}: ${B.name}`,oe=z&&`${z.method} ${z.url}`,me=B.message.replace(/\\n/g,`
|
|
12
|
-
`),Le=(s=B.stack)===null||s===void 0?void 0:s.replace(/\\n/g,`
|
|
13
|
-
`),Ye=JSON.stringify(w,void 0,2);return(0,n.jsxs)(Zt,{title:i!=null?i:d.message,defaultExpanded:p,error:{name:ve,message:me,stack:Le},children:[oe&&(0,n.jsxs)(b.Z,{alignItems:"flex-start",children:[(0,n.jsx)(W.Z,{classes:{secondary:g.text},primary:"Request",secondary:z?`${oe}`:void 0}),(0,n.jsx)(nt,{text:oe})]}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(C.Z,{component:"li",className:g.divider}),(0,n.jsx)(b.Z,{alignItems:"flex-start",children:(0,n.jsx)(W.Z,{classes:{secondary:g.text},primary:"Full Error as JSON"})}),(0,n.jsx)(ot,{language:"json",text:Ye,showCopyCodeButton:!0})]})]})}var j=t(28316);function J(e){const s=document.createElement("div");return s.setAttribute("id",e),s}function xe(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function we(e){const s=useRef(null);useEffect(function(){const p=document.querySelector(`#${e}`),g=p||J(e);return p||xe(g),g.appendChild(s.current),function(){s.current.remove(),g.childNodes.length===-1&&g.remove()}},[e]);function i(){return s.current||(s.current=document.createElement("div")),s.current}return i()}var $e=null;const it="core.calloutSeen";function Bt(){const[e,s]=useState(()=>{const d=localStorage.getItem(it);return d?JSON.parse(d):{}}),i=useCallback((d,p)=>{const g=localStorage.getItem(it),B={...g?JSON.parse(g):{},[d]:p};s(B),localStorage.setItem(it,JSON.stringify(B))},[]);return{states:e,setState:i}}function hn(e){const{states:s,setState:i}=Bt(),d=useCallback(()=>{i(e,!0)},[i,e]);return{seen:s[e]===!0,markSeen:d}}function Nn(e){const{seen:s,markSeen:i}=hn(e);return{show:s===!1,hide:i}}const mr=(0,l.Z)({"@keyframes pulsateSlightly":{"0%":{transform:"scale(1.0)"},"100%":{transform:"scale(1.1)"}},"@keyframes pulsateAndFade":{"0%":{transform:"scale(1.0)",opacity:.9},"100%":{transform:"scale(1.5)",opacity:0}},featureWrapper:{position:"relative"},backdrop:{zIndex:2e3,position:"fixed",overflow:"hidden",left:0,right:0,top:0,bottom:0},dot:{position:"absolute",backgroundColor:"transparent",borderRadius:"100%",border:"1px solid rgba(103, 146, 180, 0.98)",boxShadow:"0px 0px 0px 20000px rgba(0, 0, 0, 0.5)",zIndex:2001,transformOrigin:"center center",animation:"$pulsateSlightly 1744ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) alternate infinite"},pulseCircle:{width:"100%",height:"100%",backgroundColor:"transparent",borderRadius:"100%",border:"2px solid white",zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:"white",zIndex:2003}},{name:"BackstageFeatureCalloutCircular"});function tn(e){const{featureId:s,title:i,description:d,children:p}=e,{show:g,hide:w}=useShowCallout(s),B=usePortal("core.callout"),z=useRef(null),[N,ve]=useState(),oe=mr(),me=useCallback(()=>{if(z.current){const Le=z.current.getBoundingClientRect(),Ye=Math.max(Le.width,Le.height),tt=800,Rt=Le.x-(Ye-Le.width)/2-tt,Mt=Le.y-(Ye-Le.height)/2-tt,Jt=Ye+2*tt,Qt=450,Lt=Le.x+Le.width/2-Qt,Ht=Le.y-(Ye-Le.height)/2+Ye+20;ve({dotLeft:Rt,dotTop:Mt,dotSize:Jt,borderWidth:tt,textTop:Ht,textLeft:Lt,textWidth:Qt})}},[]);return useEffect(()=>(window.addEventListener("resize",me),window.addEventListener("scroll",me),()=>{window.removeEventListener("resize",me),window.removeEventListener("scroll",me)}),[me]),useLayoutEffect(me,[z.current,me]),g?_jsxs(_Fragment,{children:[_jsx("div",{className:oe.featureWrapper,ref:z,children:p}),createPortal(_jsx("div",{className:oe.backdrop,children:_jsx(ClickAwayListener,{onClickAway:w,children:_jsxs(_Fragment,{children:[_jsx("div",{className:oe.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:w,onKeyDown:w,role:"button",tabIndex:0,children:_jsx("div",{className:oe.pulseCircle})}),_jsxs("div",{className:oe.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:i}),_jsx(Typography,{children:d})]})]})})}),B)]}):_jsx(_Fragment,{children:p})}var lr=t(35292);const vr=(0,l.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{fontSize:"0.7rem",textTransform:"uppercase",fontWeight:600,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function zr({color:e="primary",disabled:s=!1,href:i="#",icon:d=(0,n.jsx)(lr.Z,{}),label:p,onClick:g,title:w}){const B=vr();return s?(0,n.jsxs)(Q.Z,{title:w,className:X()(B.link,B.disabled),underline:"none",children:[d,(0,n.jsx)("span",{className:B.label,children:p})]}):(0,n.jsxs)(Q.Z,{title:w,className:X()(B.link,B[e]),to:i,component:Se,onClick:g,children:[d,(0,n.jsx)("span",{className:B.label,children:p})]})}const Vr=(0,l.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function yr(e){const{links:s}=e,i=Vr();return(0,n.jsx)("nav",{className:i.links,children:s.map((d,p)=>(0,n.jsx)(zr,{...d},p+1))})}const Wr=e=>{const s=e==="dark"?"16%":"97%";return`
|
|
14
|
-
hsl(0, 0%, ${s}) 0%,
|
|
15
|
-
hsla(0, 0%, ${s}, 0.987) 8.1%,
|
|
16
|
-
hsla(0, 0%, ${s}, 0.951) 15.5%,
|
|
17
|
-
hsla(0, 0%, ${s}, 0.896) 22.5%,
|
|
18
|
-
hsla(0, 0%, ${s}, 0.825) 29%,
|
|
19
|
-
hsla(0, 0%, ${s}, 0.741) 35.3%,
|
|
20
|
-
hsla(0, 0%, ${s}, 0.648) 41.2%,
|
|
21
|
-
hsla(0, 0%, ${s}, 0.55) 47.1%,
|
|
22
|
-
hsla(0, 0%, ${s}, 0.45) 52.9%,
|
|
23
|
-
hsla(0, 0%, ${s}, 0.352) 58.8%,
|
|
24
|
-
hsla(0, 0%, ${s}, 0.259) 64.7%,
|
|
25
|
-
hsla(0, 0%, ${s}, 0.175) 71%,
|
|
26
|
-
hsla(0, 0%, ${s}, 0.104) 77.5%,
|
|
27
|
-
hsla(0, 0%, ${s}, 0.049) 84.5%,
|
|
28
|
-
hsla(0, 0%, ${s}, 0.013) 91.9%,
|
|
29
|
-
hsla(0, 0%, ${s}, 0) 100%
|
|
30
|
-
`},Ir=100,Rr=10,rs=(0,l.Z)(e=>({root:{position:"relative",display:"flex",flexFlow:"row nowrap",alignItems:"center"},container:{overflow:"auto",scrollbarWidth:0,"&::-webkit-scrollbar":{display:"none"}},fade:{position:"absolute",width:Ir,height:`calc(100% + ${Rr}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-Rr,background:`linear-gradient(90deg, ${Wr(e.palette.type)})`},fadeRight:{right:-Rr,background:`linear-gradient(270deg, ${Wr(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function ss(e){const[[s,i],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const p=e.current;if(!p){d([0,0]);return}const g=()=>{const w=p.scrollLeft,B=p.scrollWidth-p.offsetWidth-p.scrollLeft;d([w,B])};return g(),p.addEventListener("scroll",g),window.addEventListener("resize",g),()=>{p.removeEventListener("scroll",g),window.removeEventListener("resize",g)}},[e]),[s,i]}function os(e,s,i){const[d,p]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const g=performance.now(),w=requestAnimationFrame(B=>{if(!e.current)return;const z=B-g,N=Math.abs(d)*z/s,oe=Math.max(i,N)*Math.sign(d);e.current.scrollBy({left:oe});const me=d-oe;Math.sign(d)!==Math.sign(me)?p(0):p(me)});return()=>cancelAnimationFrame(w)},[e,d,s,i]),p}function nr(e){const{scrollStep:s=100,scrollSpeed:i=50,minScrollDistance:d=5,children:p,...g}=e,w=rs(e),B=React.useRef(),[z,N]=ss(B),ve=os(B,i,d),oe=me=>{!B.current||ve(me?s:-s)};return _jsxs("div",{...g,className:w.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:w.container,ref:B,children:p}),_jsx("div",{className:classNames(w.fade,w.fadeLeft,{[w.fadeHidden]:z===0})}),_jsx("div",{className:classNames(w.fade,w.fadeRight,{[w.fadeHidden]:N===0})}),z>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>oe(!1),className:classNames(w.button,w.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),N>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>oe(!0),className:classNames(w.button,w.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const kn=(0,l.Z)({alpha:{color:"#ffffff",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}},{name:"BackstageLifecycle"});function xr(e){const s=kn(e),{shorthand:i,alpha:d}=e;return i?_jsx("span",{className:s[d?"alpha":"beta"],style:{fontSize:"120%"},children:d?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx("span",{className:s[d?"alpha":"beta"],children:d?"Alpha":"Beta"})}const br=(0,m.lazy)(()=>Promise.all([t.e(5869),t.e(6051)]).then(t.bind(t,76051)).then(e=>({default:e.RealLogViewer})));function Hr(e){const{Progress:s}=(0,R.qD)().getComponents();return(0,n.jsx)(m.Suspense,{fallback:(0,n.jsx)(s,{}),children:(0,n.jsx)(br,{...e})})}const is=(0,l.Z)(e=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${e.palette.border}`},"& th, & td":{border:`1px solid ${e.palette.border}`,padding:e.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:e.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:e.palette.background.paper},"& tr":{backgroundColor:e.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:e.palette.background.default},"& a":{color:e.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),cr=(e,s)=>s?typeof s=="string"?e+s:m.Children.toArray(s.props.children).reduce(cr,e):e,Hn=({level:e,children:s})=>{const p=m.Children.toArray(s).reduce(cr,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return m.createElement(`h${e}`,{id:p},s)},as={code:({inline:e,className:s,children:i,...d})=>{const p=String(i).replace(/\n+$/,""),g=/language-(\w+)/.exec(s||"");return!e&&g?(0,n.jsx)(ot,{language:g[1],text:p}):(0,n.jsx)("code",{className:s,...d,children:i})},h1:Hn,h2:Hn,h3:Hn,h4:Hn,h5:Hn,h6:Hn};function Gr(e){const{content:s,dialect:i="gfm",linkTarget:d,transformLinkUri:p,transformImageUri:g,className:w}=e,B=is();return _jsx(ReactMarkdown,{remarkPlugins:i==="gfm"?[gfm]:[],className:`${B.markdown} ${w}`,children:s,components:as,linkTarget:d,transformLinkUri:p,transformImageUri:g})}var Fn=t(23054);const Sr=(0,l.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),Cr=({request:e,busy:s,setBusy:i})=>{const d=Sr(),[p,g]=useState(),w=async()=>{i(!0);try{await e.trigger()}catch(z){g(isError(z)?z.message:"An unspecified error occurred")}finally{i(!1)}},B=e.provider.icon;return _jsxs(ListItem,{disabled:s,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx(B,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:p&&_jsx(Typography,{color:"error",children:p})}),_jsx(Button,{color:"primary",variant:"contained",onClick:w,children:"Log in"})]})};var ls=null;const Lr=(0,l.Z)(e=>({dialog:{paddingTop:e.spacing(1)},title:{minWidth:0},titleHeading:{fontSize:e.typography.h6.fontSize},contentList:{padding:0},actionButtons:{padding:e.spacing(2,0)}}),{name:"OAuthRequestDialog"});function rr(e){const s=Lr(),[i,d]=useState(!1),p=useApi(oauthRequestApiRef),g=useObservable(useMemo(()=>p.authRequest$(),[p]),[]),w=()=>{g.forEach(B=>B.reject())};return _jsxs(Dialog,{open:Boolean(g.length),fullWidth:!0,maxWidth:"xs",classes:{paper:s.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsx(DialogTitle,{classes:{root:s.title},id:"oauth-req-dialog-title",children:_jsx(Typography,{className:s.titleHeading,variant:"h1",children:"Login Required"})}),_jsx(DialogContent,{dividers:!0,classes:{root:s.contentList},children:_jsx(List,{children:g.map(B=>_jsx(LoginRequestListItem,{request:B,busy:i,setBusy:d},B.provider.title))})})]}),_jsx(DialogActions,{classes:{root:s.actionButtons},children:_jsx(Button,{onClick:w,children:"Reject All"})})]})}var cs=t(15277),Kr=t.n(cs),wr=t(29862);const Pr=(0,l.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function ds(e){const[s,i]=(0,m.useState)(!1),d=(0,wr.t)(),p=Pr(),g=B=>{d()&&i(B)};var w;return(0,n.jsx)(ft.ZP,{title:(w=e.title)!==null&&w!==void 0?w:e.text||"",placement:e.placement,disableHoverListener:!s,children:(0,n.jsx)(Kr(),{text:e.text,line:e.line,onToggled:g,containerClassName:p.container})})}var Yr=t(67358);function us(e){const[s,i]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{const d=setTimeout(()=>i(!0),250);return()=>clearTimeout(d)},[]),s?(0,n.jsx)(Yr.Z,{...e,"data-testid":"progress"}):(0,n.jsx)("div",{style:{display:"none"}})}var hs=t(94339),kr=t(14503),ps=t(24579),Or=t(32552),fn=t(15459),Gn=t(95544),Ft=t(27597);const sr=(0,l.Z)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function dr(e){const{link:s,title:i,onClick:d}=e,p=sr();return(0,n.jsxs)("div",{children:[(0,n.jsx)(C.Z,{}),(0,n.jsx)(Se,{to:s,onClick:d,underline:"none",children:(0,n.jsxs)(Gn.Z,{display:"flex",alignItems:"center",className:p.root,children:[(0,n.jsx)(Gn.Z,{className:p.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,n.jsx)(Y.Z,{children:(0,n.jsx)("strong",{children:i})})}),(0,n.jsx)(Ft.Z,{className:p.arrow})]})})]})}const fs=e=>{const{slackChannel:s}=e;if(s){if(typeof s=="string")return(0,n.jsxs)(n.Fragment,{children:["Please contact ",s," for help."]});if(!s.href)return(0,n.jsxs)(n.Fragment,{children:["Please contact ",s.name," for help."]})}else return null;return(0,n.jsx)(Ge,{to:s.href,variant:"contained",children:s.name})},gs=class extends m.Component{componentDidCatch(s,i){console.error(`ErrorBoundary, error: ${s}, info: ${i}`),this.setState({error:s,errorInfo:i})}render(){const{slackChannel:s,children:i}=this.props,{error:d}=this.state;return d?(0,n.jsx)(Zt,{title:"Something Went Wrong",error:d,children:(0,n.jsx)(fs,{slackChannel:s})}):i}constructor(s){super(s),this.state={error:void 0,errorInfo:void 0}}},ms=(0,l.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:700},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),Jr=(0,fn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(kr.Z),Qr={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function jr(e){const{title:s,subheader:i,divider:d=!0,deepLink:p,slackChannel:g,errorBoundaryProps:w,variant:B,children:z,headerStyle:N,headerProps:ve,icon:oe,action:me,actionsClassName:Le,actions:Ye,cardClassName:tt,actionsTopRight:Rt,className:Mt,noPadding:Jt,titleTypographyProps:Qt}=e,Lt=ms();let Ht={},zt={};B&&B.split(/[\s]+/g).forEach(Dr=>{Ht={...Ht,...Qr.card[Dr]},zt={...zt,...Qr.cardContent[Dr]}});const pr=()=>(0,n.jsxs)("div",{className:Lt.headerSubheader,children:[i&&(0,n.jsx)("div",{className:Lt.subheader,children:i}),oe]}),fr=w||(g?{slackChannel:g}:{});return(0,n.jsx)(hs.Z,{style:Ht,className:Mt,children:(0,n.jsxs)(gs,{...fr,children:[s&&(0,n.jsx)(Or.Z,{classes:{root:Lt.header,title:Lt.headerTitle,subheader:Lt.headerSubheader,avatar:Lt.headerAvatar,action:Lt.headerAction,content:Lt.headerContent},title:s,subheader:pr(),action:me,style:{...N},titleTypographyProps:Qt,...ve}),Rt&&(0,n.jsx)(Jr,{children:Rt}),d&&(0,n.jsx)(C.Z,{}),(0,n.jsx)(ps.Z,{className:X()(tt,{[Lt.noPadding]:Jt}),style:zt,children:z}),Ye&&(0,n.jsx)(kr.Z,{className:Le,children:Ye}),p&&(0,n.jsx)(dr,{...p})]})})}var Ns=t(39307);const vs=(0,l.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:45,fontWeight:"bold",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"}),Xr={fractional:!0,inverse:!1,unit:"%",max:100},ys=({palette:e,value:s,inverse:i,max:d})=>{if(isNaN(s))return"#ddd";const p=d||Xr.max,g=i?p-s:s;return g<p/3?e.status.error:g<p*(2/3)?e.status.warning:e.status.ok};function Fs(e){const[s,i]=useState(null),{getColor:d=ys}=e,p=vs(e),{palette:g}=useTheme(),{value:w,fractional:B,inverse:z,unit:N,max:ve,description:oe}={...Xr,...e},me=B?Math.round(w*ve):w,Le=ve!==100?Math.round(w):me,[Ye,tt]=useState(!1);return useEffect(()=>{const Rt=s,Mt=()=>tt(!0),Jt=()=>tt(!1);return Rt&&oe?(Rt.addEventListener("mouseenter",Mt),Rt.addEventListener("mouseleave",Jt),()=>{Rt.removeEventListener("mouseenter",Mt),Rt.removeEventListener("mouseleave",Jt)}):()=>{tt(!1)}},[oe,s]),_jsxs("div",{ref:i,className:p.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:me,strokeWidth:12,trailWidth:12,strokeColor:d({palette:g,value:Le,inverse:z,max:ve}),className:p.circle}),oe&&Ye?_jsx("div",{className:p.description,children:oe}):_jsx("div",{className:p.overlay,children:isNaN(w)?"N/A":`${Le}${N}`})]})}const xs=(0,l.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function Us(e){const s=xs(e),{title:i,subheader:d,progress:p,inverse:g,deepLink:w,description:B,icon:z,variant:N,getColor:ve}=e,oe={inverse:g,description:B,getColor:ve,value:p};return _jsx("div",{className:s.root,children:_jsx(InfoCard,{title:i,subheader:d,deepLink:w,variant:N,icon:z,children:_jsx(Gauge,{...oe})})})}function Ms(e){const{value:s,getColor:i=getProgressColor}=e,{palette:d}=useTheme();if(isNaN(s))return null;let p=Math.round(s*100*100)/100;p>100&&(p=100);const g=i({palette:d,value:p,inverse:!1,max:100});return _jsx(Tooltip,{title:`${p}%`,children:_jsx("span",{children:_jsx(Line,{percent:p,strokeWidth:4,trailWidth:4,strokeColor:g})})})}var bs=t(21324),Ss=t(7089),Cs=t(1292),qr=t(42494),v=t(74603),S=t(56939),A=t(12231),D=t(73698),G=t(72379);const K=(0,l.Z)(()=>(0,P.Z)({icon:{position:"absolute",right:"4px",pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var se=()=>{const e=K();return(0,n.jsx)(G.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const pe=(0,l.Z)(()=>(0,P.Z)({icon:{position:"absolute",right:"4px",pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Re=()=>{const e=pe();return(0,n.jsx)(G.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const Pe=(0,fn.Z)(e=>(0,P.Z)({root:{"label + &":{marginTop:e.spacing(3)}},input:{borderRadius:4,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:16,padding:"10px 26px 10px 12px",transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:4}}}),{name:"BackstageSelectInputBase"})(v.Z),Qe=(0,l.Z)(e=>(0,P.Z)({formControl:{margin:`${e.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:14,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:14,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 yt(e){const{multiple:s,items:i,label:d,placeholder:p,selected:g,onChange:w,triggerReset:B,native:z=!1,disabled:N=!1,margin:ve}=e,oe=Qe(),[me,Le]=(0,m.useState)(g||(s?[]:"")),[Ye,tt]=(0,m.useState)(!1);(0,m.useEffect)(()=>{Le(s?[]:"")},[B,s]),(0,m.useEffect)(()=>{g!==void 0&&Le(g)},[g]);const Rt=Lt=>{Le(Lt.target.value),w(Lt.target.value)},Mt=Lt=>{if(N){Lt.preventDefault();return}tt(Ht=>s&&!(Lt.target instanceof HTMLElement)?!0:!Ht)},Jt=()=>{tt(!1)},Qt=Lt=>()=>{const Ht=me.filter(zt=>zt!==Lt);Le(Ht),w(Ht)};return(0,n.jsx)("div",{className:oe.root,children:(0,n.jsx)(Cs.Z,{onClickAway:Jt,children:(0,n.jsxs)(qr.Z,{className:oe.formControl,children:[(0,n.jsx)(S.Z,{className:oe.formLabel,children:d}),(0,n.jsxs)(D.Z,{"aria-label":d,value:me,native:z,disabled:N,"data-testid":"select",displayEmpty:!0,multiple:s,margin:ve,onChange:Rt,onClick:Mt,open:Ye,input:(0,n.jsx)(Pe,{}),label:d,tabIndex:0,renderValue:Lt=>{var Ht;return s&&me.length!==0?(0,n.jsx)("div",{className:oe.chips,children:Lt.map(zt=>{var pr,fr;return(0,n.jsx)(Ss.Z,{label:(pr=i.find(Xn=>Xn.value===zt))===null||pr===void 0?void 0:pr.label,clickable:!0,onDelete:Qt(zt),className:oe.chip},(fr=i.find(Xn=>Xn.value===zt))===null||fr===void 0?void 0:fr.value)})}):(0,n.jsx)(Y.Z,{children:me.length===0?p||"":(Ht=i.find(zt=>zt.value===Lt))===null||Ht===void 0?void 0:Ht.label})},IconComponent:()=>Ye?(0,n.jsx)(Re,{}):(0,n.jsx)(se,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[p&&!s&&(0,n.jsx)(A.Z,{value:[],children:p}),z?i&&i.map(Lt=>(0,n.jsx)("option",{value:Lt.value,children:Lt.label},Lt.value)):i&&i.map(Lt=>(0,n.jsxs)(A.Z,{value:Lt.value,children:[s&&(0,n.jsx)(bs.Z,{color:"primary",checked:me.includes(Lt.value)||!1,className:oe.checkbox}),Lt.label]},Lt.value))]})]})})})}const St=()=>{},Xe=m.createContext({stepperLength:0,stepIndex:0,setStepIndex:St,stepHistory:[],setStepHistory:St,onStepChange:St});function Ot(e){const{children:s,elevated:i,onStepChange:d,activeStep:p=0}=e,[g,w]=useState(p),[B,z]=useState([0]);useEffect(()=>{w(p)},[p]);const N=[];let ve;return Children.forEach(s,oe=>{isValidElement(oe)&&(oe.props.end?ve=oe:N.push(oe))}),_jsxs(_Fragment,{children:[_jsx(Xe.Provider,{value:{stepIndex:g,setStepIndex:w,stepHistory:B,setStepHistory:z,onStepChange:d,stepperLength:Children.count(s)},children:_jsx(MuiStepper,{activeStep:g,orientation:"vertical",elevation:i?2:0,children:N})}),g>=Children.count(s)-1&&ve]})}const Wt=(0,l.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),Jn=({text:e,handleClick:s})=>_jsx(Button,{onClick:s,children:e||"Reset"}),On=({text:e,handleClick:s,disabled:i,last:d,stepIndex:p})=>_jsx(Button,{variant:"contained",color:"primary",disabled:i,"data-testid":`nextButton-${p}`,onClick:s,children:e||(d?"Finish":"Next")}),or=({text:e,handleClick:s,disabled:i,stepIndex:d})=>_jsx(Button,{onClick:s,"data-testid":`backButton-${d}`,disabled:i,children:e||"Back"}),gn=({actions:e={},children:s})=>{const i=Wt(),{stepperLength:d,stepIndex:p,setStepIndex:g,stepHistory:w,setStepHistory:B,onStepChange:z}=useContext(VerticalStepperContext),N=(Le,Ye)=>{Ye&&Ye(),z&&z(p,Le),g(Le)},ve=()=>{const Le=e.nextStep?e.nextStep(p,d-1):p+1;N(Le,e.onNext),B([...w,Le])},oe=()=>{w.pop(),N(w[w.length-1],e.onBack),B([...w])},me=()=>{N(0,e.onRestart),B([0])};return _jsxs("div",{className:i.root,children:[[void 0,!0].includes(e.showBack)&&p!==0&&_jsx(or,{text:e.backText,handleClick:oe,disabled:p===0,stepIndex:p}),[void 0,!0].includes(e.showNext)&&_jsx(On,{text:e.nextText,handleClick:ve,disabled:!!d&&p>=d||!!e.canNext&&!e.canNext(),stepIndex:p}),e.showRestart&&p!==0&&_jsx(Jn,{text:e.restartText,handleClick:me,stepIndex:p}),s]})},mn=(0,l.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function Rn(e){const{title:s,children:i,end:d,actions:p,...g}=e,w=mn();return d?_jsxs("div",{className:w.end,children:[_jsx(Typography,{variant:"h6",children:s}),i,_jsx(SimpleStepperFooter,{actions:{...p||{},showNext:!1}})]}):_jsxs(MuiStep,{...g,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:s})}),_jsxs(StepContent,{children:[i,_jsx(SimpleStepperFooter,{actions:p})]})]})}const Un=(0,l.Z)(e=>({status:{fontWeight:500,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:8,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 $r(e){const s=Un(e);return _jsx("span",{className:classNames(s.status,s.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function Er(e){const s=Un(e);return _jsx("span",{className:classNames(s.status,s.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function vn(e){const s=Un(e);return _jsx("span",{className:classNames(s.status,s.error),"aria-label":"Status error","aria-hidden":"true",...e})}function Ln(e){const s=Un(e);return _jsx("span",{className:classNames(s.status,s.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function Ar(e){const s=Un(e);return _jsx("span",{className:classNames(s.status,s.running),"aria-label":"Status running","aria-hidden":"true",...e})}function Wi(e){const s=Un(e);return _jsx("span",{className:classNames(s.status,s.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var Hi=t(74600),ur=t(15584);const ii=e=>(0,P.Z)({root:{fontWeight:"bolder",whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),Co={root:{border:"0",verticalAlign:"top"}},ai=e=>(0,P.Z)({root:{listStyle:"none",margin:e.spacing(0,0,-1,0),padding:"0"}}),li=e=>(0,P.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),yn=(0,fn.Z)(ii,{name:"BackstageMetadataTableTitleCell"})(ur.Z),ws=(0,fn.Z)(Co,{name:"BackstageMetadataTableCell"})(ur.Z),ci=({dense:e,children:s})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:s})}),js=({title:e,children:s,...i})=>_jsxs(TableRow,{children:[e&&_jsx(yn,{children:e}),_jsx(ws,{colSpan:e?1:2,...i,children:s})]}),Br=(0,fn.Z)(ai,{name:"BackstageMetadataTableList"})(({classes:e,children:s})=>(0,n.jsx)("ul",{className:e.root,children:s})),Es=(0,fn.Z)(li,{name:"BackstageMetadataTableListItem"})(({classes:e,children:s})=>(0,n.jsx)("li",{className:e.root,children:s})),zs=(0,P.Z)({root:{margin:"0 0",listStyleType:"none"}}),Vs=e=>(0,P.Z)({root:{...zs.root,paddingLeft:e.spacing(1)}}),Ws=(0,fn.Z)(zs,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:s})=>(0,n.jsx)(Br,{classes:e,children:s})),Hs=(0,fn.Z)(Vs,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:s})=>(0,n.jsx)(Br,{classes:e,children:s}));function wo(e,s){const i=e.map((d,p)=>_jsx(MetadataListItem,{children:As(d)},p));return s?_jsx(Hs,{children:i}):_jsx(Ws,{children:i})}function jo(e,s,i){const d=Object.keys(e).map(p=>{const g=As(e[p],!0),w=i&&i.titleFormat?i.titleFormat(p):startCase(p);return _jsxs(MetadataListItem,{children:[`${w}: `,g]},p)});return s?_jsx(Hs,{children:d}):_jsx(Ws,{children:d})}function As(e,s,i){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?jo(e,s,i):Array.isArray(e)?wo(e,i):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Fragment,{children:e})}const hr=({value:e,options:s})=>_jsx(Fragment,{children:As(e,s)}),Ts=({title:e,value:s,options:i})=>_jsx(MetadataTableItem,{title:i&&i.titleFormat?i.titleFormat(e):startCase(e),children:_jsx(hr,{value:s,options:i})});function Eo(e,s){return Object.keys(e).map(i=>_jsx(Ts,{title:i,value:e[i],options:s},i))}function di(e){const{metadata:s,dense:i=!0,options:d}=e,p=Eo(s,d||{});return _jsx(MetadataTable,{dense:i,children:p})}var Gs=t(49429),Ao=t(86136),Ks=t(79784),To=t(19126),Ys=t.n(To);function ui(e){return qs.stringify(e,{strictNullHandling:!0})}function Js(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function Qs(e,s){return Js(e)[s]}function Io(e,s,i){const d={...Js(e),[s]:i};return ui(d)}function hi(e,s=250){const[i,d]=useSearchParams(),p=i.toString(),[g,w]=useState(Qs(p,e));return useEffect(()=>{const B=Qs(p,e);w(z=>isEqual(B,z)?z:B)},[p,w,e]),useDebouncedEffect(()=>{const B=Io(p,e,g);p!==B&&d(B,{replace:!0})},[d,g,p,e],s),[g,w]}const Xs={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 _r(){const s=(0,R.I_)().get(R.Ds),i=s==null?void 0:s.getOptionalConfig("app.support");if(!i)return Xs;var d;return{url:i.getString("url"),items:i.getConfigArray("items").flatMap(p=>({title:p.getString("title"),icon:p.getOptionalString("icon"),links:((d=p.getOptionalConfigArray("links"))!==null&&d!==void 0?d:[]).flatMap(g=>({url:g.getString("url"),title:g.getString("title")}))}))}}var Ro=t(80079);function Mn(e,s){const d=(0,R.qD)().getSystemIcon(e);return d?(0,n.jsx)(d,{...s}):(0,n.jsx)(Ro.Z,{...s})}function pi(e){return Mn("brokenImage",e)}function fi(e){return Mn("catalog",e)}function Gi(e){return Mn("chat",e)}function Ki(e){return Mn("dashboard",e)}function Is(e){return Mn("docs",e)}function Yi(e){return Mn("email",e)}function Ji(e){return Mn("github",e)}function gi(e){return Mn("group",e)}function es(e){return Mn("help",e)}function Lo(e){return Mn("user",e)}function Qi(e){return Mn("warning",e)}const mi=(0,l.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),_s=({icon:e})=>{const s=(0,R.qD)();var i;const d=e&&(i=s.getSystemIcon(e))!==null&&i!==void 0?i:es;return(0,n.jsx)(d,{})};var ts;const Po=({link:e})=>(0,n.jsx)(Se,{to:e.url,children:(ts=e.title)!==null&&ts!==void 0?ts:e.url}),ko=({item:e})=>{var s;return(0,n.jsxs)(b.Z,{children:[(0,n.jsx)(Ao.Z,{children:(0,n.jsx)(_s,{icon:e.icon})}),(0,n.jsx)(W.Z,{primary:e.title,secondary:(s=e.links)===null||s===void 0?void 0:s.reduce((i,d,p)=>[...i,p>0&&(0,n.jsx)("br",{},p),(0,n.jsx)(Po,{link:d},d.url)],[])})]})};function vi(e){const{title:s,children:i}=e,{items:d}=_r(),[p,g]=(0,m.useState)(!1),[w,B]=(0,m.useState)(null),z=mi(),N=(0,dt.Z)(me=>me.breakpoints.down("sm")),ve=me=>{B(me.currentTarget),g(!0)},oe=()=>{g(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Gn.Z,{display:"flex",ml:1,children:N?(0,n.jsx)(Je.Z,{color:"primary",size:"small",onClick:ve,"data-testid":"support-button",children:(0,n.jsx)(es,{})}):(0,n.jsx)(_.Z,{"data-testid":"support-button","aria-label":"support",color:"primary",onClick:ve,startIcon:(0,n.jsx)(es,{}),children:"Support"})}),(0,n.jsxs)(Ks.ZP,{"data-testid":"support-button-popover",open:p,anchorEl:w,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:oe,children:[(0,n.jsxs)(qe.Z,{className:z.popoverList,children:[s&&(0,n.jsx)(b.Z,{alignItems:"flex-start",children:(0,n.jsx)(Y.Z,{variant:"subtitle1",children:s})}),m.Children.map(i,(me,Le)=>(0,n.jsx)(b.Z,{alignItems:"flex-start",children:me},`child-${Le}`)),d&&d.map((me,Le)=>(0,n.jsx)(ko,{item:me},`item-${Le}`))]}),(0,n.jsx)(Gs.Z,{children:(0,n.jsx)(_.Z,{color:"primary",onClick:oe,children:"Close"})})]})]})}var eo=t(18671),zn=t(10289);const xn=72,Oo=24,to=18,ir={drawerWidthClosed:xn,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:xn,iconSize:xn-Oo*2,iconPadding:Oo,selectedIndicatorWidth:3,userBadgePadding:to,userBadgeDiameter:xn-to*2,mobileSidebarHeight:56},yi=e=>({...ir,...e,iconContainerWidth:ir.drawerWidthClosed,iconSize:ir.drawerWidthClosed-ir.iconPadding*2,userBadgeDiameter:ir.drawerWidthClosed-ir.userBadgePadding*2}),$o={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:ir.defaultOpenDelayMs+200},xi=e=>({...$o,...e}),Xi="@backstage/core/sidebar-intro-dismissed",Qn=(0,m.createContext)({sidebarConfig:ir,submenuConfig:$o}),Bo=(0,m.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var Rs;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(Rs||(Rs={}));const Zo={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(Rs.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(Rs.SIDEBAR_PIN_STATE,JSON.stringify(e))}};var Ls=t(51837);const Ps={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},no=(0,m.createContext)(Ps),ro=(0,Ls.CT)("sidebar-pin-state-context");function Do(e){const{children:s,value:i}=e;return(0,n.jsx)(no.Provider,{value:i,children:(0,n.jsx)(ro.Provider,{value:(0,Ls.EI)({1:i}),children:s})})}const Zr=()=>{const e=(0,m.useContext)(ro),s=(0,m.useContext)(no);if(e===void 0)return s||Ps;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i},No=(0,l.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:s=>s.isPinned?s.sidebarConfig.drawerWidthOpen:s.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:s=>s.sidebarConfig.mobileSidebarHeight}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),so=(0,m.createContext)({content:{contentRef:void 0}});function Fo(e){const[s,i]=(0,m.useState)(()=>Zo.getSidebarPinState()),{sidebarConfig:d}=(0,m.useContext)(Qn),p=(0,m.useRef)(null),g=(0,m.useMemo)(()=>({content:{contentRef:p}}),[p]);(0,m.useEffect)(()=>{Zo.setSidebarPinState(s)},[s]);const w=(0,dt.Z)(N=>N.breakpoints.down("xs"),{noSsr:!0}),B=()=>i(!s),z=No({isPinned:s,sidebarConfig:d});return(0,n.jsx)(Do,{value:{isPinned:s,toggleSidebarPinState:B,isMobile:w},children:(0,n.jsx)(so.Provider,{value:g,children:(0,n.jsx)("div",{className:z.root,children:e.children})})})}function oo(){const{content:e}=(0,m.useContext)(so);return{focusContent:(0,m.useCallback)(()=>{var i,d;e==null||(i=e.contentRef)===null||i===void 0||(d=i.current)===null||d===void 0||d.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const io={isOpen:!1,setOpen:()=>{}},ao=(0,m.createContext)(io),Uo=(0,Ls.CT)("sidebar-open-state-context");function lo(e){const{children:s,value:i}=e;return(0,n.jsx)(ao.Provider,{value:i,children:(0,n.jsx)(Uo.Provider,{value:(0,Ls.EI)({1:i}),children:s})})}const ks=()=>{const e=(0,m.useContext)(Uo),s=(0,m.useContext)(ao);if(e===void 0)return s||io;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i};var bi=t(50023),Mo=t(4190),zo=t(87685),Vo=t(44882),Wo=t(57998);const Ho=(0,l.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:s=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${s.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),Go=e=>{const{to:s,label:i,icon:d,value:p}=e,{sidebarConfig:g}=(0,m.useContext)(Qn),w=Ho({sidebarConfig:g}),B=(0,zn.TH)(),{selectedMenuItemIndex:z,setSelectedMenuItemIndex:N}=(0,m.useContext)(ho),ve=(me,Le)=>{N(Le===z?-1:Le)},oe=p===z&&z>=0||p!==z&&!(z>=0)&&s===B.pathname;return(0,n.jsx)(Wo.Z,{label:i,icon:d,component:Se,to:s||B.pathname,onChange:ve,value:p,selected:oe,classes:w})},co=e=>{const{children:s,to:i,label:d,icon:p,value:g}=e,{isMobile:w}=Zr();return w?(0,n.jsx)(Go,{to:i,label:d,icon:p,value:g}):(0,n.jsx)(n.Fragment,{children:s})},uo=(0,l.Z)(e=>({root:{position:"fixed",backgroundColor:e.palette.navigation.background,color:e.palette.navigation.color,bottom:0,left:0,right:0,zIndex:e.zIndex.snackbar,borderTop:"1px solid #383838"},overlay:s=>({background:e.palette.navigation.background,width:"100%",bottom:`${s.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${s.sidebarConfig.mobileSidebarHeight}px)`,flex:"0 1 auto",overflow:"auto"}),overlayHeader:{display:"flex",color:e.palette.text.primary,alignItems:"center",justifyContent:"space-between",padding:e.spacing(2,3)},overlayHeaderClose:{color:e.palette.text.primary},marginMobileSidebar:s=>({marginBottom:`${s.sidebarConfig.mobileSidebarHeight}px`})})),Kn=e=>(0,le.orderBy)(e,({props:{priority:s}})=>Number.isInteger(s)?s:-1,"desc"),Ko=m.createElement(co).type,Yo=({children:e,label:s="Menu",open:i,onClose:d})=>{const{sidebarConfig:p}=(0,m.useContext)(Qn),g=uo({sidebarConfig:p});return(0,n.jsxs)(Mo.ZP,{anchor:"bottom",open:i,onClose:d,ModalProps:{BackdropProps:{classes:{root:g.marginMobileSidebar}}},classes:{root:g.marginMobileSidebar,paperAnchorBottom:g.overlay},children:[(0,n.jsxs)(Gn.Z,{className:g.overlayHeader,children:[(0,n.jsx)(Y.Z,{variant:"h3",children:s}),(0,n.jsx)(Je.Z,{onClick:d,classes:{root:g.overlayHeaderClose},children:(0,n.jsx)(zo.Z,{})})]}),(0,n.jsx)(Gn.Z,{component:"nav",children:e})]})},ho=(0,m.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),po=e=>{const{sidebarConfig:s}=(0,m.useContext)(Qn),{children:i}=e,d=uo({sidebarConfig:s}),p=(0,zn.TH)(),[g,w]=(0,m.useState)(-1);(0,m.useEffect)(()=>{w(-1)},[p.pathname]);let B=(0,R.vJ)(i,N=>N.getElements().filter(ve=>ve.type===Ko));if(i)B.length?B=Kn(B):B.push((0,n.jsx)(co,{icon:(0,n.jsx)(Vo.Z,{}),children:i},"default_menu"));else return null;const z=g>=0&&!B[g].props.to;return(0,n.jsx)(lo,{value:{isOpen:!0,setOpen:()=>{}},children:(0,n.jsxs)(ho.Provider,{value:{selectedMenuItemIndex:g,setSelectedMenuItemIndex:w},children:[(0,n.jsx)(Yo,{label:B[g]&&B[g].props.label,open:z,onClose:()=>w(-1),children:B[g]&&B[g].props.children}),(0,n.jsx)(bi.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:B})]})})},fo=(0,l.Z)(e=>({drawer:s=>({display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:e.zIndex.appBar,background:e.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",width:s.sidebarConfig.drawerWidthClosed,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}),drawerOpen:s=>({width:s.sidebarConfig.drawerWidthOpen,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shorter})}),visuallyHidden:{top:0,position:"absolute",zIndex:1e3,transform:"translateY(-200%)","&:focus":{transform:"translateY(5px)"}}}),{name:"BackstageSidebar"});var Pn;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Pn||(Pn={}));const Jo=e=>{const{sidebarConfig:s}=(0,m.useContext)(Qn),{openDelayMs:i=s.defaultOpenDelayMs,closeDelayMs:d=s.defaultCloseDelayMs,disableExpandOnHover:p,children:g}=e,w=fo({sidebarConfig:s}),B=(0,dt.Z)(Mt=>Mt.breakpoints.down("md"),{noSsr:!0}),[z,N]=(0,m.useState)(Pn.Closed),ve=(0,m.useRef)(),{isPinned:oe,toggleSidebarPinState:me}=Zr(),Le=()=>{oe||p||(ve.current&&(clearTimeout(ve.current),ve.current=void 0),z!==Pn.Open&&!B&&(ve.current=window.setTimeout(()=>{ve.current=void 0,N(Pn.Open)},i),N(Pn.Idle)))},Ye=()=>{oe||p||(ve.current&&(clearTimeout(ve.current),ve.current=void 0),z===Pn.Idle?N(Pn.Closed):z===Pn.Open&&(ve.current=window.setTimeout(()=>{ve.current=void 0,N(Pn.Closed)},d)))},tt=z===Pn.Open&&!B||oe,Rt=Mt=>{Mt?(N(Pn.Open),me()):(N(Pn.Closed),me())};return(0,n.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,n.jsx)(Si,{}),(0,n.jsx)(lo,{value:{isOpen:tt,setOpen:Rt},children:(0,n.jsx)("div",{className:w.root,"data-testid":"sidebar-root",onMouseEnter:p?()=>{}:Le,onFocus:p?()=>{}:Le,onMouseLeave:p?()=>{}:Ye,onBlur:p?()=>{}:Ye,children:(0,n.jsx)("div",{className:X()(w.drawer,{[w.drawerOpen]:tt}),children:g})})})]})},Qo=e=>{var s;const i=yi((s=e.sidebarOptions)!==null&&s!==void 0?s:{});var d;const p=xi((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:g,disableExpandOnHover:w,openDelayMs:B,closeDelayMs:z}=e,{isMobile:N}=Zr();return N?(0,n.jsx)(po,{children:g}):(0,n.jsx)(Qn.Provider,{value:{sidebarConfig:i,submenuConfig:p},children:(0,n.jsx)(Jo,{openDelayMs:B,closeDelayMs:z,disableExpandOnHover:w,children:g})})};function Si(){const{sidebarConfig:e}=(0,m.useContext)(Qn),{focusContent:s,contentRef:i}=oo(),d=fo({sidebarConfig:e});return i!=null&&i.current?(0,n.jsx)(_.Z,{onClick:s,variant:"contained",className:X()(d.visuallyHidden),children:"Skip to content"}):null}function go(e,s){const i=new URLSearchParams(s.search).toString(),d=Ys().parse(i),p=new URLSearchParams(e.search).toString(),g=Ys().parse(p);return(0,le.isEqual)(s.pathname,e.pathname)&&(0,le.isMatch)(g,d)}const a=(0,l.Z)(e=>({item:{height:48,width:"100%","&:hover":{background:"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:20,cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:"#FFF"},label:{margin:14,marginLeft:7,fontSize:14,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:"14px",whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}),{name:"BackstageSidebarSubmenuItem"}),r=e=>{const{title:s,subtitle:i,to:d,icon:p,dropdownItems:g}=e,w=a(),{setIsHoveredOn:B}=useContext(SidebarItemWithSubmenuContext),z=()=>{B(!1)},N=useResolvedPath(d!=null?d:""),ve=useLocation();let oe=isLocationMatch(ve,N);const[me,Le]=useState(!1),Ye=()=>{Le(!me)};return g!==void 0?(g.some(tt=>{const Rt=resolvePath(tt.to);return oe=isLocationMatch(ve,Rt),oe}),_jsxs("div",{className:w.itemContainer,children:[_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs("button",{onClick:Ye,onTouchStart:tt=>tt.stopPropagation(),className:classnames(w.item,oe?w.selected:void 0),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:w.label,children:[s,_jsx("br",{}),i&&_jsx(Typography,{variant:"caption",className:w.subtitle,children:i})]}),me?_jsx(ArrowDropUpIcon,{className:w.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:w.dropdownArrow})]})}),g&&me&&_jsx("div",{className:w.dropdown,children:g.map((tt,Rt)=>_jsx(Tooltip,{title:tt.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:tt.to,underline:"none",className:w.dropdownItem,onClick:z,onTouchStart:Mt=>Mt.stopPropagation(),children:_jsx(Typography,{className:w.textContent,children:tt.title})})},Rt))})]})):_jsx("div",{className:w.itemContainer,children:_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames(w.item,oe?w.selected:void 0),onClick:z,onTouchStart:tt=>tt.stopPropagation(),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:w.label,children:[s,_jsx("br",{}),i&&_jsx(Typography,{variant:"caption",className:w.subtitle,children:i})]})]})})})};var o;const c=(0,l.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:s=>{var i;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:s.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(o=(i=e.palette.navigation.submenu)===null||i===void 0?void 0:i.background)!==null&&o!==void 0?o:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:s.submenuConfig.drawerWidthClosed,transitionDelay:`${s.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:s=>({width:s.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:24,fontWeight:500,color:"#FFF",padding:20,[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),f=e=>{const{isOpen:s}=ks(),{sidebarConfig:i,submenuConfig:d}=(0,m.useContext)(Qn),p=s?i.drawerWidthOpen:i.drawerWidthClosed,g=c({left:p,submenuConfig:d}),{isHoveredOn:w}=(0,m.useContext)(Bo),[B,z]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{z(w)},[w]),(0,n.jsxs)("div",{className:X()(g.drawer,{[g.drawerOpen]:B}),children:[(0,n.jsx)(Y.Z,{variant:"h5",className:g.title,children:e.title}),e.children]})};var k=t(76600),M=t(26739),H=t(98989),re=t(59797),Ve=t(83543);const ze=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),wt=()=>{const e=ze();return _jsxs("div",{className:e.iconContainer,children:[_jsx("div",{className:e.arrow1,children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})}),_jsx("div",{children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})})]})};var ct=null;const $t=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Nt=()=>{const e=$t();return _jsxs("div",{className:e.iconContainer,children:[_jsx("div",{className:e.arrow1,children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})}),_jsx("div",{children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})})]})};var Yt=null,an,Vn;const Yn=e=>(0,l.Z)(s=>{var i,d;return{root:{color:s.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[s.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(an=(i=s.palette.navigation.navItem)===null||i===void 0?void 0:i.hoverBackground)!==null&&an!==void 0?an:"#404040"}},highlighted:{background:(Vn=(d=s.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&Vn!==void 0?Vn:"#404040"},label:{fontWeight:"bold",whiteSpace:"nowrap",lineHeight:"auto",flex:"3 1 auto",width:"110px",overflow:"hidden","text-overflow":"ellipsis"},iconContainer:{boxSizing:"border-box",height:"100%",width:e.iconContainerWidth,marginRight:-s.spacing(2),display:"flex",alignItems:"center",justifyContent:"center"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:"bold",fontSize:s.typography.fontSize},searchFieldHTMLInput:{padding:s.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:s.spacing(6),textAlign:"center",marginRight:s.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:s.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${s.palette.navigation.indicator}`,color:s.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function $n(e){return(0,m.useMemo)(()=>Yn(e),[e])()}const ns=(e,s)=>(0,R.vJ)(e.props.children,i=>{let d=!1;return i.getElements().forEach(({props:{to:p,dropdownItems:g}})=>{if(!d){if(g!=null&&g.length){g.forEach(({to:w})=>d=d||go(s,(0,zn.i3)(w)));return}p&&(d=go(s,(0,zn.i3)(p)))}}),d},[s.pathname]);function mo(e){return e.to===void 0}const Xo=m.createElement(f).type,Os=m.forwardRef(function({to:s,end:i,style:d,className:p,activeStyle:g,caseSensitive:w,activeClassName:B="active","aria-current":z="page",...N},ve){let{pathname:oe}=(0,zn.TH)(),{pathname:me}=(0,zn.WU)(s);w||(oe=oe.toLocaleLowerCase("en-US"),me=me.toLocaleLowerCase("en-US"));let Le=oe===me;!Le&&!i&&(Le=oe.startsWith(`${me}/`));const Ye=Le?z:void 0;return(0,n.jsx)(ue.rU,{...N,to:s,ref:ve,"aria-current":Ye,style:{...d,...Le?g:void 0},className:X()([p,Le?B:void 0])})}),vo=(0,m.forwardRef)((e,s)=>{const{icon:i,text:d,hasNotifications:p=!1,hasSubmenu:g=!1,disableHighlight:w=!1,onClick:B,children:z,className:N,...ve}=e,{sidebarConfig:oe}=(0,m.useContext)(Qn),me=$n(oe),{isOpen:Le}=ks(),Ye=!Le&&g?{display:"flex",marginLeft:"24px"}:{},tt=(0,n.jsxs)("div",{style:Ye,children:[(0,n.jsx)(i,{fontSize:"small"}),!Le&&g?(0,n.jsx)(H.Z,{}):(0,n.jsx)(n.Fragment,{})]}),Rt=(0,n.jsx)(M.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!p,className:X()({[me.closedItemIcon]:!Le}),children:tt}),Mt=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{"data-testid":"login-button",className:me.iconContainer,children:Rt}),d&&(0,n.jsx)(Y.Z,{variant:"subtitle2",className:me.label,children:d}),(0,n.jsx)("div",{className:me.secondaryAction,children:z})]}),Jt=Le?Mt:Rt,Qt={onClick:B,className:X()(N,me.root,Le?me.open:me.closed,mo(e)&&me.buttonItem,{[me.highlightable]:!w})};return mo(e)?(0,n.jsx)("button",{"aria-label":d,...Qt,ref:s,children:Jt}):(0,n.jsx)(Os,{...Qt,activeClassName:me.selected,to:e.to?e.to:"",ref:s,"aria-label":d||e.to,...ve,children:Jt})}),Tr=({children:e,...s})=>{const{sidebarConfig:i}=(0,m.useContext)(Qn),d=$n(i),[p,g]=(0,m.useState)(!1),w=(0,zn.TH)(),B=ns(e,w),z=(0,dt.Z)(me=>me.breakpoints.down("sm")),N=()=>{g(!0)},ve=()=>{g(!1)},oe=()=>z?p?(0,n.jsx)(re.Z,{fontSize:"small",className:d.submenuArrow}):(0,n.jsx)(Ve.Z,{fontSize:"small",className:d.submenuArrow}):!p&&(0,n.jsx)(H.Z,{fontSize:"small",className:d.submenuArrow});return(0,n.jsx)(Bo.Provider,{value:{isHoveredOn:p,setIsHoveredOn:g},children:(0,n.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:ve,onTouchStart:p?ve:N,onMouseEnter:N,className:X()(p&&d.highlighted),children:[(0,n.jsx)(vo,{hasSubmenu:!0,className:B?d.selected:"",...s,children:oe()}),p&&e]})})},Ci=(0,m.forwardRef)((e,s)=>{const[i]=(0,R.vJ)(e.children,d=>d.getElements().filter(p=>p.type===Xo));return i?(0,n.jsx)(Tr,{...e,children:i}):(0,n.jsx)(vo,{...e,ref:s})});function Ll(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),[i,d]=useState(""),p=$n(s),g=e.icon?e.icon:SearchIcon,w=()=>{e.onSearch(i),d("")},B=oe=>{oe.key==="Enter"&&(oe.preventDefault(),w())},z=oe=>{d(oe.target.value)},N=oe=>{oe.preventDefault(),oe.stopPropagation()},ve=oe=>{w(),oe.preventDefault()};return _jsx("div",{className:p.searchRoot,children:_jsx(Ci,{icon:g,to:e.to,onClick:ve,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:i,onClick:N,onChange:z,onKeyDown:B,className:p.searchContainer,InputProps:{disableUnderline:!0,className:p.searchField},inputProps:{className:p.searchFieldHTMLInput}})})})}const Pl=(0,k.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),kl=(0,k.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),qi=(0,k.Z)("hr")({height:1,width:"100%",background:"#383838",border:"none",margin:"12px 0px"},{name:"BackstageSidebarDivider"}),_i=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),Ol=(0,k.Z)("div")(({theme:e})=>{const s=_i(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":s,"&:hover":s}}),$l=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),s=$n(e),{isOpen:i,setOpen:d}=useSidebarOpenState();if(useMediaQuery(w=>w.breakpoints.down("md"),{noSsr:!0}))return null;const g=()=>{d(!i)};return _jsx("button",{onClick:g,className:s.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx("div",{className:s.arrows,children:i?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},ea=(0,l.Z)(e=>({introCard:s=>({color:"#b5b5b5",fontSize:12,width:s.sidebarConfig.drawerWidthOpen,marginTop:18,marginBottom:12,paddingLeft:s.sidebarConfig.iconPadding,paddingRight:s.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:12},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:4,"&: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:12}}),{name:"BackstageSidebarIntro"});function ta(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),i=ea({sidebarConfig:s}),{text:d,onClose:p}=e,g=()=>p();return _jsxs("div",{className:i.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:d}),_jsx("div",{className:i.introDismiss,children:_jsxs(Link,{component:"button",onClick:g,underline:"none",className:i.introDismissLink,children:[_jsx(CloseIcon,{className:i.introDismissIcon}),_jsx(Typography,{component:"span",className:i.introDismissText,children:"Dismiss"})]})})]})}const wi=e=>{const{text:s,onDismiss:i}=e,[d,p]=useState(!1),g=()=>{p(!0)};return _jsx(Collapse,{in:!d,onExited:i,children:_jsx(ta,{text:s,onClose:g})})},na=null,ra="And your recently viewed plugins will pop up here!";function Bl(e){const{isOpen:s}=useSidebarOpenState(),i={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},[d,p]=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:g,recentlyViewedItemsDismissed:w}=d!=null?d:{},B=()=>{p(N=>({...i,...N,starredItemsDismissed:!0}))},z=()=>{p(N=>({...i,...N,recentlyViewedItemsDismissed:!0}))};return s?_jsxs(_Fragment,{children:[!g&&_jsxs(_Fragment,{children:[_jsx(wi,{text:na,onDismiss:B}),_jsx(SidebarDivider,{})]}),!w&&_jsx(wi,{text:ra,onDismiss:z})]}):null}const sa=(0,l.Z)(e=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:e.spacing(3),paddingBottom:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function ji(e){const{className:s,stretch:i,noPadding:d,children:p,...g}=e,{contentRef:w}=oo(),B=sa();return(0,n.jsx)("article",{ref:w,tabIndex:-1,...g,className:X()(B.root,s,{[B.stretch]:i,[B.noPadding]:d}),children:p})}var oa=t(6487),ia=t(99152);const aa=(0,l.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{padding:e.spacing(3,3),...e.typography.caption,textTransform:"uppercase",fontWeight:"bold",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 Ei(e){const{tabs:s,onChange:i,selectedIndex:d}=e,[p,g]=(0,m.useState)(d!=null?d:0),w=aa(),B=(0,m.useCallback)((z,N)=>{d===void 0&&g(N),i&&d!==N&&i(N)},[d,i]);return(0,m.useEffect)(()=>{d!==void 0&&g(d)},[d]),(0,n.jsx)("div",{className:w.tabsWrapper,children:(0,n.jsx)(ia.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"scrollable auto tabs example",onChange:B,value:p,children:s.map((z,N)=>(0,m.createElement)(oa.Z,{...z.tabProps,"data-testid":`header-tab-${N}`,label:z.label,key:z.id,value:N,className:w.defaultTab,classes:{selected:w.selected,root:w.tabRoot}}))})})}function la(e){const s=(0,zn.UO)(),d=e.map(({path:me,children:Le})=>({caseSensitive:!1,path:`${me}/*`,element:Le})).sort((me,Le)=>Le.path.replace(/\/\*$/,"").localeCompare(me.path.replace(/\/\*$/,"")));var p;const g=(p=(0,zn.V$)(d))!==null&&p!==void 0?p:e[0].children;var w;let B=(w=s["*"])!==null&&w!==void 0?w:"";B.startsWith("/")||(B=`/${B}`);var z;const[N]=(z=(0,zn.fp)(d,B))!==null&&z!==void 0?z:[],ve=N?e.findIndex(me=>`${me.path}/*`===N.route.path):0;var oe;return{index:ve===-1?0:ve,element:g,route:(oe=e[ve])!==null&&oe!==void 0?oe:e[0]}}function Ai(e){const{routes:s}=e,i=(0,zn.s0)(),{index:d,route:p,element:g}=la(s),w=(0,m.useMemo)(()=>s.map(z=>({id:z.path,label:z.title,tabProps:z.tabProps})),[s]),B=z=>{let{path:N}=s[z];N=N.replace(/\/\*$/,""),N=N.replace(/^\//,""),i(N)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ei,{tabs:w,selectedIndex:d,onChange:B}),(0,n.jsxs)(ji,{children:[(0,n.jsx)(eo.q,{title:p.title}),g]})]})}const qo=()=>null;(0,R.R5)(qo,"core.gatherMountPoints",!0);function Ti(e){const s=(0,n.jsx)(qo,{path:"",title:"",children:(0,n.jsx)("div",{})}).type;return m.Children.toArray(e).flatMap(i=>{if(!(0,m.isValidElement)(i))return[];if(i.type===m.Fragment)return Ti(i.props.children);if(i.type!==s)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:p,children:g,tabProps:w}=i.props;return[{path:d,title:p,children:g,tabProps:w}]})}function ca(e){const s=Ti(e.children);return(0,n.jsx)(Ai,{routes:s})}ca.Route=qo;const da=(0,l.Z)(e=>({value:{marginBottom:"6px"},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function ua(e){const{value:s,subvalue:i}=e,d=da();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:d.value,children:s}),(0,n.jsx)("div",{className:d.subvalue,children:i})]})}var ha=t(21070),pa=t(90324),fa=t(98281),ga=t(48049),Ii=t(51209),Ri=t(33375),ma=t(44233),va=t(27604),_o=t(36444),ya=t(37971),xa=t(59709),ba=t(17373),Sa=t(3702),Ca=t(93111),yo=t(67222);const wa=(0,l.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:"60px",justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),ja=e=>{var s;const i=wa(),{onChangeFilters:d}=e,[p,g]=(0,m.useState)({...e.selectedFilters}),[w,B]=(0,m.useState)(!1),z=()=>{g({}),B(N=>!N)};return(0,m.useEffect)(()=>{d(p)},[p,d]),(0,n.jsxs)("div",{className:i.root,children:[(0,n.jsxs)("div",{className:i.header,children:[(0,n.jsx)("div",{className:i.value,children:"Filters"}),(0,n.jsx)(_.Z,{color:"primary",onClick:z,children:"Clear all"})]}),(0,n.jsx)("div",{className:i.filters,children:((s=e.filters)===null||s===void 0?void 0:s.length)&&e.filters.map(N=>(0,n.jsx)(yt,{triggerReset:w,...N.element,selected:p[N.element.label],onChange:ve=>g({...p,[N.element.label]:ve})},N.element.label))})]})},Li={Add:(0,m.forwardRef)((e,s)=>(0,n.jsx)(ha.Z,{...e,ref:s})),Check:(0,m.forwardRef)((e,s)=>(0,n.jsx)(fa.Z,{...e,ref:s})),Clear:(0,m.forwardRef)((e,s)=>(0,n.jsx)(Ri.Z,{...e,ref:s})),Delete:(0,m.forwardRef)((e,s)=>(0,n.jsx)(ma.Z,{...e,ref:s})),DetailPanel:(0,m.forwardRef)((e,s)=>(0,n.jsx)(Ii.Z,{...e,ref:s})),Edit:(0,m.forwardRef)((e,s)=>(0,n.jsx)(va.Z,{...e,ref:s})),Export:(0,m.forwardRef)((e,s)=>(0,n.jsx)(Sa.Z,{...e,ref:s})),Filter:(0,m.forwardRef)((e,s)=>(0,n.jsx)(_o.Z,{...e,ref:s})),FirstPage:(0,m.forwardRef)((e,s)=>(0,n.jsx)(ya.Z,{...e,ref:s})),LastPage:(0,m.forwardRef)((e,s)=>(0,n.jsx)(xa.Z,{...e,ref:s})),NextPage:(0,m.forwardRef)((e,s)=>(0,n.jsx)(Ii.Z,{...e,ref:s})),PreviousPage:(0,m.forwardRef)((e,s)=>(0,n.jsx)(ga.Z,{...e,ref:s})),ResetSearch:(0,m.forwardRef)((e,s)=>(0,n.jsx)(Ri.Z,{...e,ref:s})),Search:(0,m.forwardRef)((e,s)=>(0,n.jsx)(_o.Z,{...e,ref:s})),SortArrow:(0,m.forwardRef)((e,s)=>(0,n.jsx)(pa.Z,{...e,ref:s})),ThirdStateCheck:(0,m.forwardRef)((e,s)=>(0,n.jsx)(ba.Z,{...e,ref:s})),ViewColumn:(0,m.forwardRef)((e,s)=>(0,n.jsx)(Ca.Z,{...e,ref:s}))};function Pi(e,s){const i=s.split(".");let d=e[i[0]];for(let p=1;p<i.length;++p){if(d===void 0)return d;const g=i[p];d=d[g]}return d}const Ea=(0,fn.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"})(yo.W$),ki=(0,fn.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:"bold"}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(yo.UW),Aa=(0,l.Z)(()=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:"bold",fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Ta=(0,l.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Ia(e,s){return e.map(i=>{const d={};let p=i.cellStyle||{};if(i.highlight)if(d.color=s.palette.textContrast,typeof p=="object")p.fontWeight=s.typography.fontWeightBold;else{const g=p;p=(w,B,z)=>({...g(w,B,z),fontWeight:s.typography.fontWeightBold})}return{...i,headerStyle:d,cellStyle:p}})}function Ra(e,s){return(0,le.transform)(e,(i,d,p)=>{(0,le.isEqual)(d,s[p])||(i[p]=d)})}const Oi={search:"",filtersOpen:!1,filters:{}};function La(e){const{toolbarRef:s,setSearch:i,hasFilters:d,selectedFiltersLength:p,toggleFilters:g}=e,w=Aa(),B=(0,m.useCallback)(z=>{e.onSearchChanged(z),i(z)},[e,i]);return d?(0,n.jsxs)("div",{className:w.root,children:[(0,n.jsxs)("div",{className:w.root,children:[(0,n.jsx)(Je.Z,{onClick:g,"aria-label":"filter list",children:(0,n.jsx)(_o.Z,{})}),(0,n.jsxs)(Y.Z,{className:w.title,children:["Filters (",p,")"]})]}),(0,n.jsx)(ki,{...e,ref:s,onSearchChanged:B})]}):(0,n.jsx)(ki,{...e,ref:s,onSearchChanged:B})}function $i(e){const{data:s,columns:i,options:d,title:p,subtitle:g,filters:w,initialState:B,emptyContent:z,onStateChange:N,components:ve,...oe}=e,me=Ta(),Le=(0,Ee.Z)(),Ye={...Oi,...B},[tt,Rt]=(0,m.useState)(Ye.filtersOpen),Mt=(0,m.useCallback)(()=>Rt(Cn=>!Cn),[Rt]),[Jt,Qt]=(0,m.useState)(0),[Lt,Ht]=(0,m.useState)(s),[zt,pr]=(0,m.useState)(Ye.filters),fr=Ia(i,Le),[Xn,Dr]=(0,m.useState)(Ye.search);(0,m.useEffect)(()=>{if(N){const Cn=Ra({search:Xn,filtersOpen:tt,filters:zt},Oi);N(Cn)}},[Xn,tt,zt,N]);const Bs={headerStyle:{textTransform:"uppercase"}},Zs=(0,m.useCallback)(Cn=>{var ar;return(ar=i.find(Ur=>Ur.title===Cn))===null||ar===void 0?void 0:ar.field},[i]);(0,m.useEffect)(()=>{if(typeof s=="function")return;if(!zt){Ht(s);return}const Cn=Object.values(zt);if(s&&Cn.flat().length){const ar=s.filter(Ur=>!!Object.entries(zt).filter(([,qn])=>!!qn.length).every(([qn,nn])=>{const Zn=Pi(Ur,Zs(qn));return Array.isArray(Zn)&&Array.isArray(nn)?Zn.some(Mr=>nn.includes(Mr)):Array.isArray(Zn)?Zn.includes(nn):Array.isArray(nn)?nn.includes(Zn):Zn===nn}));Ht(ar)}else Ht(s);Qt(Cn.flat().length)},[s,zt,Zs]);const Gt=(Cn,ar)=>{const Ur=nn=>{const Zn=new Set,Mr=_n=>{_n!=null&&Zn.add(_n)};return ar&&ar.forEach(_n=>{const Ds=Pi(_n,Zs(nn));Array.isArray(Ds)?Ds.forEach(Mr):Mr(Ds)}),Zn},qn=nn=>({placeholder:"All results",label:nn.column,multiple:nn.type==="multiple-select",items:[...Ur(nn.column)].sort().map(Zn=>({label:Zn,value:Zn}))});return Cn.map(nn=>({type:nn.type,element:qn(nn)}))},Nr=!!(w!=null&&w.length),si=(0,m.useCallback)(Cn=>(0,n.jsx)(La,{setSearch:Dr,hasFilters:Nr,selectedFiltersLength:Jt,toggleFilters:Mt,...Cn}),[Mt,Nr,Jt,Dr]),Fr=typeof s!="function"&&s.length===0,bo=i.length,oi=(0,m.useCallback)(Cn=>z&&Fr?(0,n.jsx)("tbody",{children:(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:bo,children:z})})}):(0,n.jsx)(yo.os,{...Cn}),[Fr,z,bo]);return(0,n.jsxs)("div",{className:me.root,children:[tt&&s&&typeof s!="function"&&(w==null?void 0:w.length)&&(0,n.jsx)(ja,{filters:Gt(w,s),selectedFilters:zt,onChangeFilters:pr}),(0,n.jsx)(yo.ZP,{components:{Header:Ea,Toolbar:si,Body:oi,...ve},options:{...Bs,...d},columns:fr,icons:Li,title:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Y.Z,{variant:"h5",component:"h2",children:p}),g&&(0,n.jsx)(Y.Z,{color:"textSecondary",variant:"body1",children:g})]}),data:typeof s=="function"?s:Lt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter"}},...oe})]})}$i.icons=Object.freeze(Li);const Zl=e=>{const{children:s,value:i,index:d,...p}=e;return _jsx("div",{role:"tabpanel",hidden:i!==d,"aria-labelledby":`scrollable-auto-tab-${d}`,...p,children:i===d&&_jsx(Box,{p:3,children:s})})},Pa=(0,l.Z)(()=>({root:{color:"#6E6E6E",overflow:"visible",fontSize:"1.5rem",textAlign:"center",borderRadius:"50%",backgroundColor:"#E6E6E6",marginLeft:e=>e.isNext?"auto":"0",marginRight:e=>e.isNext?"0":"10px","&:hover":{backgroundColor:"#E6E6E6",opacity:"1"}}}),{name:"BackstageTabIcon"}),Dl=e=>{const s=Pa(e),{ariaLabel:i,onClick:d}=e;return _jsx(IconButton,{onClick:d,className:s.root,size:"small",disableRipple:!0,disableFocusRipple:!0,"aria-label":i,children:e.children})},ka=(e,s)=>s?e?"20px":"0":"40px",Oa=(0,l.Z)(e=>({root:{textTransform:"none",height:"64px",fontWeight:e.typography.fontWeightBold,fontSize:e.typography.pxToRem(13),color:e.palette.textSubtle,marginLeft:s=>ka(s.isFirstNav,s.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:e.palette.textSubtle}}}),{name:"BackstageTab"}),Nl=e=>{const s=Oa(e),{isFirstNav:i,isFirstIndex:d,...p}=e;return _jsx(Tab,{classes:s,disableRipple:!0,...p})},$a=(0,l.Z)(e=>({indicator:{display:"flex",justifyContent:"center",backgroundColor:e.palette.tabbar.indicator,height:"4px"},flexContainer:{alignItems:"center"},root:{"&:last-child":{marginLeft:"auto"}}}),{name:"BackstageTabBar"}),Fl=e=>{const s=$a(e);return _jsx(Tabs,{classes:s,...e,TabIndicatorProps:{children:_jsx("span",{})}})},Ba=(0,l.Z)(e=>({root:{flexGrow:1,width:"100%"},styledTabs:{backgroundColor:e.palette.background.paper},appbar:{boxShadow:"none",backgroundColor:e.palette.background.paper,paddingLeft:"10px",paddingRight:"10px"}}),{name:"BackstageTabs"});function Ul(e){const{tabs:s}=e,i=Ba(),[d,p]=useState([0,0]),[g,w]=useState(0),[B,z]=useState(0),[N,ve]=useState([[]]),oe=useRef(),{width:me}=useWindowSize(),Le=(Jt,Qt)=>{p([g,Qt])},Ye=()=>{w(g-1)},tt=()=>{w(g+1)},Rt=()=>g+1<N.length;useEffect(()=>{const Qt=g===0?1:2,Lt=oe.current.offsetWidth-20-Qt*30,Ht=d[0]*B+d[1],zt=Math.floor(Lt/170);z(zt),ve(chunkArray(s,zt)),p([Math.floor(Ht/zt),Ht%zt])},[me,s]);const Mt=g===d[0]?d[1]:!1;return _jsxs("div",{className:i.root,children:[_jsx(AppBar,{ref:oe,className:i.appbar,position:"static",children:_jsx("div",{children:_jsxs(StyledTabs,{value:Mt,onChange:Le,selectionFollowsFocus:!0,children:[g!==0&&_jsx(StyledIcon,{onClick:Ye,ariaLabel:"navigate-before",children:_jsx(NavigateBeforeIcon,{})}),N[g].map((Jt,Qt)=>_jsx(StyledTab,{value:Qt,isFirstIndex:Qt===0,isFirstNav:g===0,icon:Jt.icon||void 0,label:Jt.label||void 0},Qt)),Rt()&&_jsx(StyledIcon,{isNext:!0,onClick:tt,ariaLabel:"navigate-next",children:_jsx(NavigateNextIcon,{})})]})})}),Mt!==!1?N[g].map((Jt,Qt)=>_jsx(TabPanel,{value:Qt,index:Mt,children:Jt.content},Qt)):_jsx(TabPanel,{value:d[1],index:d[1],children:N[d[0]][d[1]].content},"panel_outside_chunked_array")]})}var Ml=t(44311);function Za(e,s){const i=e[e.length-1];if(!!i)return i>=.9?s.palette.status.ok:i>=.5?s.palette.status.warning:s.palette.status.error}function zl(e){const s=useTheme();if(!e.data)return null;var i;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(i=e.color)!==null&&i!==void 0?i:Za(e.data,s)})]})}const Da=e=>(0,l.Z)(s=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:s.spacing(2),textAlign:e.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:s.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),Na=({title:e="Unknown page",className:s})=>(0,n.jsx)(Y.Z,{variant:"h4",component:"h2",className:s,"data-testid":"header-title",children:e});function Fa(e){const{description:s,title:i,titleComponent:d=void 0,children:p,textAlign:g="left"}=e,w=Da({textAlign:g})(),B=d||(0,n.jsx)(Na,{title:i,className:w.title});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eo.q,{title:i}),(0,n.jsxs)("div",{className:w.container,children:[(0,n.jsxs)("div",{className:w.leftItemsBox,children:[B,s&&(0,n.jsx)(Y.Z,{className:w.description,variant:"body2",children:s})]}),(0,n.jsx)("div",{className:w.rightItemsBox,children:p})]})]})}var Ua=t.p+"static/mic-drop.fe3ef4d0..svg";const Ma=(0,l.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),za=()=>{const e=Ma();return(0,n.jsx)("img",{src:Ua,className:e.micDrop,alt:"Girl dropping mic from her hands"})},Va=(0,l.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:32}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function Wa(e){const{status:s,statusMessage:i,additionalInfo:d,supportUrl:p}=e,g=Va(),w=(0,zn.s0)(),B=_r();return(0,n.jsxs)(et.Z,{container:!0,spacing:0,className:g.container,children:[(0,n.jsxs)(et.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,n.jsxs)(Y.Z,{"data-testid":"error",variant:"body1",className:g.subtitle,children:["ERROR ",s,": ",i]}),(0,n.jsx)(Y.Z,{variant:"body1",className:g.subtitle,children:d}),(0,n.jsx)(Y.Z,{variant:"h2",className:g.title,children:"Looks like someone dropped the mic!"}),(0,n.jsxs)(Y.Z,{variant:"h6",children:[(0,n.jsx)(Se,{to:"#","data-testid":"go-back-link",onClick:()=>w(-1),children:"Go back"}),"... or please"," ",(0,n.jsx)(Se,{to:p||B.url,children:"contact support"})," if you think this is a bug."]})]}),(0,n.jsx)(za,{})]})}var Ha=t(16173);const Ga=(0,fn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(Y.Z),ei=(0,fn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(Gn.Z);function Ka(e){const{children:s,...i}=e,[d,p]=m.useState(null),g=m.Children.toArray(s),[w,B,...z]=g,N=z.length?z.pop():g[g.length-1],ve=g.length>3,oe=Ye=>{p(Ye.currentTarget)},me=()=>{p(null)},Le=Boolean(d);return(0,n.jsxs)(m.Fragment,{children:[(0,n.jsxs)(Ha.Z,{"aria-label":"breadcrumb",...i,children:[g.length>1&&(0,n.jsx)(ei,{clone:!0,children:w}),g.length>2&&(0,n.jsx)(ei,{clone:!0,children:B}),ve&&(0,n.jsx)(Ga,{onClick:oe,children:"..."}),(0,n.jsx)(Gn.Z,{style:{fontStyle:"italic"},children:N})]}),(0,n.jsx)(Ks.ZP,{open:Le,anchorEl:d,onClose:me,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,n.jsx)(qe.Z,{children:z.map((Ye,tt)=>(0,n.jsx)(b.Z,{button:!0,children:(0,n.jsx)(ei,{clone:!0,children:Ye})},tt))})})]})}const Ya=(0,l.Z)(e=>({header:{gridArea:"pageHeader",padding:e.spacing(3),width:"100%",boxShadow:e.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:e.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[e.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto",alignItems:"center"},title:{color:e.page.fontColor,wordBreak:"break-word",fontSize:e.typography.h3.fontSize,marginBottom:0},subtitle:{color:e.page.fontColor,opacity:.8,display:"inline-block",marginTop:e.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:e.spacing(1),color:e.page.fontColor},breadcrumb:{color:e.page.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-e.spacing(.3),marginBottom:e.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-e.spacing(.3),marginBottom:e.spacing(.3)}}),{name:"BackstageHeader"}),Ja=({type:e,typeLink:s,classes:i,pageTitle:d})=>e?s?(0,n.jsxs)(Ka,{className:i.breadcrumb,children:[(0,n.jsx)(Se,{to:s,children:e}),(0,n.jsx)(Y.Z,{children:d})]}):(0,n.jsx)(Y.Z,{className:i.type,children:e}):null,Qa=({pageTitle:e,classes:s,tooltip:i})=>{const d=(0,n.jsx)(Y.Z,{className:s.title,variant:"h1",children:e});return i?(0,n.jsx)(ft.ZP,{title:i,placement:"top-start",children:d}):d},Xa=({classes:e,subtitle:s})=>s?typeof s!="string"?(0,n.jsx)(n.Fragment,{children:s}):(0,n.jsx)(Y.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:s}):null;function Bi(e){const{children:s,pageTitleOverride:i,style:d,subtitle:p,title:g,tooltip:w,type:B,typeLink:z}=e,N=Ya(),oe=(0,R.h_)(R.Ds).getOptionalString("app.title")||"Backstage",me=i||g,Le=g||i,Ye=`${me} | %s | ${oe}`,tt=`${me} | ${oe}`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eo.q,{titleTemplate:Ye,defaultTitle:tt}),(0,n.jsxs)("header",{style:d,className:N.header,children:[(0,n.jsxs)(Gn.Z,{className:N.leftItemsBox,children:[(0,n.jsx)(Ja,{classes:N,type:B,typeLink:z,pageTitle:Le}),(0,n.jsx)(Qa,{classes:N,pageTitle:Le,tooltip:w}),(0,n.jsx)(Xa,{classes:N,subtitle:p})]}),(0,n.jsx)(et.Z,{container:!0,className:N.rightItemsBox,spacing:4,children:s})]})]})}const qa=({label:e,secondaryLabel:s,icon:i,disabled:d=!1,onClick:p})=>_jsx(React.Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:d,button:!0,onClick:g=>{p&&p(g)},children:[i&&_jsx(ListItemIcon,{children:i}),_jsx(ListItemText,{primary:e,secondary:s})]})});function Vl(e){const{actionItems:s}=e,[i,d]=React.useState(!1),p=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>d(!0),"data-testid":"header-action-menu",ref:p,style:{color:"white",height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:i,anchorEl:p.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>d(!1),children:_jsx(List,{children:s.map((g,w)=>_jsx(qa,{...g},`header-action-menu-${w}`))})})]})}const _a=(0,l.Z)(e=>({root:{textAlign:"left"},label:{color:e.palette.common.white,fontWeight:"bold",letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:"rgba(255, 255, 255, 0.8)",fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),el=({value:e,className:s})=>(0,n.jsx)(Y.Z,{className:s,children:e});function tl(e){const{label:s,value:i,url:d}=e,p=_a(),g=(0,n.jsx)(el,{className:p.value,value:i||"<Unknown>"});return(0,n.jsx)(et.Z,{item:!0,children:(0,n.jsxs)("span",{className:p.root,children:[(0,n.jsx)(Y.Z,{className:p.label,children:s}),d?(0,n.jsx)(Se,{to:d,children:g}):g]})})}const nl={hour:"2-digit",minute:"2-digit"};function Zi(e){const s=new Date,i=window.navigator.language,d=[];if(!e.has("homepage.clocks"))return d;const p=e.getConfigArray("homepage.clocks");for(const g of p)if(g.has("label")&&g.has("timezone")){let w=g.getString("label");const B={timeZone:g.getString("timezone"),...nl};try{new Date().toLocaleString(i,B)}catch{console.warn(`The timezone ${B.timeZone} is invalid. Defaulting to GMT`),B.timeZone="GMT",w="GMT"}const z=s.toLocaleTimeString(i,B);d.push({time:z,label:w})}return d}function Wl(e){const s=useApi(configApiRef),i=[],[d,p]=React.useState(i);return React.useEffect(()=>{p(Zi(s));const g=setInterval(()=>{p(Zi(s))},1e3);return()=>{clearInterval(g)}},[s]),d.length!==0?_jsx(_Fragment,{children:d.map(g=>_jsx(HeaderLabel,{label:g.label,value:g.time},g.label))}):null}const rl=e=>(0,P.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),sl=(0,l.Z)(rl,{name:"BackstageItemCardHeader"});function ol(e){const{title:s,subtitle:i,children:d}=e,p=sl(e);return(0,n.jsxs)("div",{className:p.root,children:[i&&(0,n.jsx)(Y.Z,{variant:"subtitle2",component:"h3",children:i}),s&&(0,n.jsx)(Y.Z,{variant:"h6",component:"h4",children:s}),d]})}function Hl(e){const{description:s,tags:i,title:d,type:p,subtitle:g,label:w,onClick:B,href:z}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:d,subtitle:g||p})}),_jsxs(CardContent,{children:[i!=null&&i.length?_jsx(Box,{children:i.map((N,ve)=>_jsx(Chip,{size:"small",label:N},ve))}):null,s]}),_jsxs(CardActions,{children:[!z&&_jsx(Button,{to:"#",onClick:B,color:"primary",children:w}),z&&_jsx(Button,{to:z,color:"primary",children:w})]})]})}const il=e=>(0,P.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),al=(0,l.Z)(il,{name:"BackstageItemCardGrid"});function ll(e){const{children:s,...i}=e,d=al(i);return(0,n.jsx)("div",{className:d.root,...i,children:s})}var cl=t(41547);const dl=(0,l.Z)(()=>({root:({isMobile:e})=>({display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",height:e?"100%":"100vh",overflowY:"auto"})}),{name:"BackstagePage"});function Di(e){const{themeId:s,children:i}=e,{isMobile:d}=Zr(),p=dl({isMobile:d});return(0,n.jsx)(cl.Z,{theme:g=>({...g,page:g.getPageTheme({themeId:s})}),children:(0,n.jsx)("main",{className:p.root,children:i})})}function ul(e){const{themeId:s,children:i,...d}=e;return(0,n.jsxs)(Di,{themeId:s,children:[(0,n.jsx)(Bi,{...d}),i]})}var Bn=t(30195);const Gl=Bn.z.object({providerInfo:Bn.z.object({}).catchall(Bn.z.unknown()).optional(),profile:Bn.z.object({email:Bn.z.string().optional(),displayName:Bn.z.string().optional(),picture:Bn.z.string().optional()}),backstageIdentity:Bn.z.object({token:Bn.z.string(),identity:Bn.z.object({type:Bn.z.literal("user"),userEntityRef:Bn.z.string(),ownershipEntityRefs:Bn.z.array(Bn.z.string())})})}),Ni={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function hl(e){const s=new Date(Date.now()+Ni.defaultTokenExpiryMillis);if(!e)return s;const[i,d,p]=e.split("."),g=JSON.parse(atob(d));return typeof g.exp!="number"?s:new Date(g.exp*1e3-Ni.tokenExpiryMarginMillis)}class Kl{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:s}=this.getSessionSync(),i=s.identity.userEntityRef,d=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(i);if(!d)throw new TypeError(`Invalid user entity reference "${i}"`);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 s=this.state.type==="active"?this.state.session:void 0,i=this.fetchSession().then(d=>(this.state={type:"active",session:d,expiresAt:hl(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:i,previous:s},i}async fetchSession(){const s=await this.options.discoveryApi.getBaseUrl("auth"),i=await fetch(`${s}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"});if(!i.ok)throw await ResponseError.fromResponse(i);return proxiedSessionSchema.parse(await i.json())}constructor(s){this.options=s,this.abortController=new AbortController,this.state={type:"empty"}}}const Yl=e=>{const s=useApi(discoveryApiRef),[{status:i,error:d},{execute:p}]=useAsync(async()=>{const g=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:s});await g.start(),e.onSignInSuccess(g)});return useMountEffect(p),i==="loading"?_jsx(Progress,{}):d?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},pl=(0,l.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),ti=({children:e})=>{const s=pl();return(0,n.jsx)(et.Z,{component:"li",item:!0,classes:s,children:e})};class ni{getUserId(){return"guest"}async getIdToken(){}getProfile(){return{email:"guest@example.com",displayName:"Guest"}}async getProfileInfo(){return{email:"guest@example.com",displayName:"Guest"}}async getBackstageIdentity(){const s="user:default/guest";return{type:"user",userEntityRef:s,ownershipEntityRefs:[s]}}async getCredentials(){return{}}async signOut(){}}function fl(e){const[s,i,d]=e.split(".");return JSON.parse(atob(i))}class ri{getUserId(){return this.result.userId}static fromResult(s){return new ri(s)}async getIdToken(){var s,i;return(i=(s=this.result).getIdToken)===null||i===void 0?void 0:i.call(s)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const s=await this.getIdToken();if(!s){const p=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:p,ownershipEntityRefs:[p]}}const{sub:i,ent:d}=fl(s);return{type:"user",userEntityRef:i,ownershipEntityRefs:d!=null?d:[]}}async getCredentials(){var s,i;return{token:await((i=(s=this.result).getIdToken)===null||i===void 0?void 0:i.call(s))}}async signOut(){var s,i;return(i=(s=this.result).signOut)===null||i===void 0?void 0:i.call(s)}constructor(s){this.result=s}}class $s{static createGuest(){return new ni}static fromLegacy(s){return ri.fromResult(s)}static create(s){return new $s(s.identity,s.authApi,s.profile)}getUserId(){const s=this.identity.userEntityRef,i=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(s);if(!i)throw new TypeError(`Invalid user entity reference "${s}"`);return i[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(s){throw this.profilePromise=void 0,s}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(s,i,d){this.identity=s,this.authApi=i,this.profile=d}}const gl={Component:({config:e,onSignInSuccess:s})=>{const{apiRef:i,title:d,message:p}=e,g=(0,R.h_)(i),w=(0,R.h_)(R.VE),B=async()=>{try{const z=await g.getBackstageIdentity({instantPopup:!0});if(!z)throw new Error(`The ${d} provider is not configured to support sign-in`);const N=await g.getProfile();s($s.create({identity:z.identity,profile:N,authApi:g}))}catch(z){w.post(new Fn.SP("Login failed",z))}};return(0,n.jsx)(ti,{children:(0,n.jsx)(jr,{variant:"fullHeight",title:d,actions:(0,n.jsx)(_.Z,{color:"primary",variant:"outlined",onClick:B,children:"Sign In"}),children:(0,n.jsx)(Y.Z,{variant:"body1",children:p})})})},loader:async(e,s)=>{const i=e.get(s),d=await i.getBackstageIdentity({optional:!0});if(!d)return;const p=await i.getProfile();return $s.create({identity:d.identity,profile:p,authApi:i})}},ml={Component:({onSignInSuccess:e})=>(0,n.jsx)(ti,{children:(0,n.jsx)(jr,{title:"Guest",variant:"fullHeight",actions:(0,n.jsx)(_.Z,{color:"primary",variant:"outlined",onClick:()=>e(new ni),children:"Enter"}),children:(0,n.jsxs)(Y.Z,{variant:"body1",children:["Enter as a Guest User.",(0,n.jsx)("br",{}),"You will not have a verified identity,",(0,n.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new ni};var vl=t(63955),Fi=t(86619),Ui=t(74828),yl=t(45455),xl=t.n(yl);const bl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Sl=(0,l.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Mi=e=>{const{ref:s,...i}=e;return{inputRef:s,...i}},Cl={Component:({onSignInSuccess:e})=>{const s=Sl(),{register:i,handleSubmit:d,formState:p}=(0,vl.cI)({mode:"onChange"}),{errors:g}=p,w=({userId:B})=>{e($s.fromLegacy({userId:B,profile:{email:`${B}@example.com`}}))};return(0,n.jsx)(ti,{children:(0,n.jsxs)(jr,{title:"Custom User",variant:"fullHeight",children:[(0,n.jsxs)(Y.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,n.jsx)("br",{}),"This selection will not be stored."]}),(0,n.jsxs)("form",{className:s.form,onSubmit:d(w),children:[(0,n.jsxs)(qr.Z,{children:[(0,n.jsx)(Fi.Z,{...Mi(i("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(g.userId)}),g.userId&&(0,n.jsx)(Ui.Z,{error:!0,children:g.userId.message})]}),(0,n.jsxs)(qr.Z,{children:[(0,n.jsx)(Fi.Z,{...Mi(i("idToken",{required:!1,validate:B=>!B||bl.test(B)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(g.idToken)}),g.idToken&&(0,n.jsx)(Ui.Z,{error:!0,children:g.idToken.message})]}),(0,n.jsx)(_.Z,{type:"submit",color:"primary",variant:"outlined",className:s.button,disabled:!(p!=null&&p.isDirty)||!xl()(g),children:"Continue"})]})]})})},loader:async()=>{}},xo="@backstage/core:SignInPage:provider",zi={guest:ml,custom:Cl,common:gl};function Vi(e,s){if(e in s)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function tc(e){return e.reduce((i,d)=>{if(typeof d=="string")return Vi(d,i),i[d]={components:zi[d],id:d},i;const{id:p}=d;return Vi(p,i),i[p]={components:zi.common,id:p,config:d},i},{})}const nc=(e,s)=>{const i=useApi(errorApiRef),d=useApiHolder(),[p,g]=useState(!0),w=useCallback(z=>{s(IdentityApiSignOutProxy.from({identityApi:z,signOut:async()=>{var N;localStorage.removeItem(xo),await((N=z.signOut)===null||N===void 0?void 0:N.call(z))}}))},[s]);useLayoutEffect(()=>{var z;if(!p)return;const N=localStorage.getItem(xo);if(N===null){g(!1);return}const ve=e[N];if(!ve){g(!1);return}let oe=!1;return ve.components.loader(d,(z=ve.config)===null||z===void 0?void 0:z.apiRef).then(me=>{oe||(me?w(me):g(!1))}).catch(me=>{oe||(localStorage.removeItem(xo),i.post(me),g(!1))}),()=>{oe=!0}},[p,i,s,d,e,w]);const B=useMemo(()=>Object.keys(e).map(z=>{const N=e[z],{Component:ve}=N.components,oe=me=>{localStorage.setItem(xo,N.id),w(me)};return _jsx(ve,{config:N.config,onSignInSuccess:oe},N.id)}),[e,w]);return[p,B]},wl=({onSignInSuccess:e,providers:s=[],title:i,align:d="left"})=>{const p=useApi(configApiRef),g=useStyles(),w=getSignInProviders(s),[B,z]=useSignInProviders(w,e);return B?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:p.getString("app.title")}),_jsxs(Content,{children:[i&&_jsx(ContentHeader,{title:i,textAlign:d}),_jsx(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:g,children:z})]})]})},jl=({provider:e,auto:s,onSignInSuccess:i})=>{const d=useStyles(),p=useApi(e.apiRef),g=useApi(configApiRef),[w,B]=useState(),[z,N]=useState(!1),ve=async({checkExisting:oe,showPopup:me})=>{try{let Le;if(oe&&(Le=await p.getBackstageIdentity({optional:!0})),!Le&&(me||s)&&(N(!0),Le=await p.getBackstageIdentity({instantPopup:!0}),!Le))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Le){N(!0);return}const Ye=await p.getProfile();i(UserIdentity.create({identity:Le.identity,authApi:p,profile:Ye}))}catch(Le){B(Le),N(!0)}};return useMountEffect(()=>ve({checkExisting:!0})),z?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:g.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:()=>{ve({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),w&&w.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:w.message})]})})})})]}):_jsx(Progress,{})};function rc(e){return"provider"in e?_jsx(jl,{...e}):_jsx(wl,{...e})}const El=(0,l.Z)(e=>({root:{padding:e.spacing(0,2,0,2.5),minHeight:e.spacing(3)},indicator:{backgroundColor:e.palette.info.main,height:e.spacing(.3)}}),{name:"BackstageTabbedCard"}),Al=(0,fn.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 sc(e){const{slackChannel:s,errorBoundaryProps:i,children:d,title:p,deepLink:g,value:w,onChange:B}=e,z=El(),[N,ve]=useState(0),oe=B||((Ye,tt)=>ve(tt));let me;w?React.Children.map(d,Ye=>{React.isValidElement(Ye)&&(Ye==null?void 0:Ye.props.value)===w&&(me=Ye==null?void 0:Ye.props.children)}):React.Children.map(d,(Ye,tt)=>{React.isValidElement(Ye)&&tt===N&&(me=Ye==null?void 0:Ye.props.children)});const Le=i||(s?{slackChannel:s}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Le,children:[p&&_jsx(Al,{title:p}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:z,value:w||N,onChange:oe,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:me}),g&&_jsx(BottomLink,{...g})]})})}const Tl=(0,l.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:"bold"}}),{name:"BackstageCardTab"});function oc(e){const{children:s,...i}=e,d=Tl();return _jsx(Tab,{disableRipple:!0,classes:d,...i})}},25248:function(jt,Me,t){"use strict";t.d(Me,{fC:function(){return y},CL:function(){return Ze},sM:function(){return Q},$v:function(){return Se},v_:function(){return Ke},hg:function(){return Ge},uB:function(){return te},R5:function(){return Pt},bq:function(){return T},Ds:function(){return Ee},ni:function(){return X},T0:function(){return F},CO:function(){return An},x8:function(){return on},rx:function(){return pn},YO:function(){return Ut},P4:function(){return bn},NT:function(){return _t},NW:function(){return Je},VE:function(){return ft},W0:function(){return ke},gP:function(){return nt},IY:function(){return ht},F4:function(){return le},ux:function(){return I},Kp:function(){return ue},$4:function(){return at},p_:function(){return $},ZM:function(){return ut},D:function(){return L},gW:function(){return E},E6:function(){return lt},z$:function(){return gt},h_:function(){return ne},I_:function(){return P},qD:function(){return Fe},vJ:function(){return Sn},yx:function(){return Te},tg:function(){return cn},Oi:function(){return Wn}});var h=t(52322),n=t(51837),m=t(2784);const R=(0,n.CT)("analytics-context"),V=()=>{const ge=(0,m.useContext)(R);if(ge===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const ee=ge.atVersion(1);if(ee===void 0)throw new Error("No context found for version 1.");return ee},y=ge=>{const{attributes:ee,children:Ae}=ge,_e={...V(),...ee},et=(0,n.EI)({1:_e});return(0,h.jsx)(R.Provider,{value:et,children:Ae})};function l(ge,ee){const Ae=Ue=>_jsx(y,{attributes:ee,children:_jsx(ge,{...Ue})});return Ae.displayName=`WithAnalyticsContext(${ge.displayName||ge.name||"Component"})`,Ae}function P(){const ge=(0,n.Vt)("api-context");if(!ge)throw new Error("API context is not available");const ee=ge.atVersion(1);if(!ee)throw new Error("ApiContext v1 not available");return ee}function ne(ge){const Ae=P().get(ge);if(!Ae)throw new Error(`No implementation available for ${ge}`);return Ae}function q(ge){return function(Ae){const Ue=et=>{const Y=P(),O={};for(const ae in ge)if(ge.hasOwnProperty(ae)){const We=ge[ae],U=Y.get(We);if(!U)throw new Error(`No implementation available for ${We}`);O[ae]=U}return _jsx(Ae,{...et,...O})},_e=Ae.displayName||Ae.name||"Component";return Ue.displayName=`withApis(${_e})`,Ue}}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(ee){if(this.config=ee,!ee.id.split(".").flatMap(Ue=>Ue.split("-")).every(Ue=>Ue.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${ee.id}'`)}}function F(ge){return new _(ge)}function X(ge,ee){return"id"in ge?{api:ge,deps:{},factory:()=>ee}:ge}var Q;(function(ge){ge.SignedIn="SignedIn",ge.SignedOut="SignedOut"})(Q||(Q={}));const ue=F({id:"core.auth.google"}),le=F({id:"core.auth.github"}),L=F({id:"core.auth.okta"}),I=F({id:"core.auth.gitlab"}),$=F({id:"core.auth.microsoft"}),E=F({id:"core.auth.onelogin"}),T=F({id:"core.auth.bitbucket"}),te=F({id:"core.auth.atlassian"}),Se=F({id:"core.alert"}),Ke=F({id:"core.analytics"}),Ge=F({id:"core.apptheme"}),Ee=F({id:"core.config"}),Je=F({id:"core.discovery"}),ft=F({id:"core.error"});var Ze;(function(ge){ge[ge.None=0]="None",ge[ge.Active=1]="Active"})(Ze||(Ze={}));const ke=F({id:"core.featureflags"}),nt=F({id:"core.fetch"}),at=F({id:"core.identity"}),ut=F({id:"core.oauthrequest"}),lt=F({id:"core.storage"});class ot{setContext(ee){this.context=ee}captureEvent(ee,Ae,{value:Ue,attributes:_e}={}){try{this.analyticsApi.captureEvent({action:ee,subject:Ae,value:Ue,attributes:_e,context:this.context})}catch(et){console.warn("Error during analytics event capture. %o",et)}}constructor(ee,Ae={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=ee,this.context=Ae}}function dt(){try{return ne(Ke)}catch{return{captureEvent:()=>{}}}}function gt(){const ge=(0,m.useRef)(null),ee=V(),Ae=dt();function Ue(){return ge.current===null&&(ge.current=new ot(Ae)),ge.current}const _e=Ue();return _e.setContext(ee),_e}const Be="plugin-context",ie=ge=>{const{children:ee,plugin:Ae}=ge,{Provider:Ue}=(0,n.CT)(Be);return(0,h.jsx)(Ue,{value:(0,n.EI)({1:{plugin:Ae}}),children:ee})};function Te(){const ge=(0,n.Vt)(Be);if(!ge)throw new Error("Plugin Options context is not available");const ee=ge.atVersion(1);if(!ee)throw new Error("Plugin Options v1 is not available");return ee.plugin.getPluginOptions()}const Fe=()=>{const ge=(0,n.Vt)("app-context");if(!ge)throw new Error("App context is not available");const ee=ge.atVersion(1);if(!ee)throw new Error("AppContext v1 not available");return ee},mt=(0,n.uW)("component-data-store",()=>new WeakMap),bt="__backstage_data";function Pt(ge,ee,Ae){const Ue=ge;var _e;let et=(_e=Ue[bt])!==null&&_e!==void 0?_e:mt.get(ge);if(et||(et={map:new Map},Object.defineProperty(Ue,bt,{enumerable:!1,configurable:!0,writable:!1,value:et}),mt.set(ge,et)),et.map.has(ee)){const Y=ge.displayName||ge.name;throw new Error(`Attempted to attach duplicate data "${ee}" to component "${Y}"`)}et.map.set(ee,Ae)}function ht(ge,ee){if(!ge)return;const Ae=ge.type;if(!Ae)return;var Ue;const _e=(Ue=Ae[bt])!==null&&Ue!==void 0?Ue:mt.get(Ae);if(!!_e)return _e.map.get(ee)}const Ct=(0,n.uW)("route-ref-type",()=>Symbol("route-ref-type"));let Tt=Ct;class kt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(ee,Ae){this.id=ee,this.params=Ae,this[Tt]="absolute"}}function _t(ge){var ee;return new kt(ge.id,(ee=ge.params)!==null&&ee!==void 0?ee:[])}const en=/^\w+$/;let Kt=null;class Xt{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(ee,Ae,Ue,_e){this.id=ee,this.path=Ae,this.parent=Ue,this.params=_e,this[Kt]="sub"}}function ln(ge){const{id:ee,path:Ae,parent:Ue}=ge,_e=Ae.split("/").filter(O=>O.startsWith(":")).map(O=>O.substring(1)),et=[...Ue.params,..._e];if(Ue.params.some(O=>_e.includes(O)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Ae.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Ae}'`);if(Ae.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Ae}'`);for(const O of _e)if(!en.test(O))throw new Error(`SubRouteRef path has invalid param, got '${O}'`);return new Xt(ee,Ae,Ue,et)}let qt=Ct;class jn{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(ee,Ae,Ue){this.id=ee,this.params=Ae,this.optional=Ue,this[qt]="external"}}function on(ge){var ee;return new jn(ge.id,(ee=ge.params)!==null&&ee!==void 0?ee:[],Boolean(ge.optional))}var En=t(10289);function cn(ge){const ee=(0,En.TH)(),Ae=(0,n.Vt)("routing-context");if(!Ae)throw new Error("Routing context is not available");const Ue=Ae.atVersion(1),_e=(0,m.useMemo)(()=>Ue&&Ue.resolve(ge,ee),[Ue,ge,ee]);if(!Ae)throw new Error("useRouteRef used outside of routing context");if(!Ue)throw new Error("RoutingContext v1 not available");const et="optional"in ge&&ge.optional;if(!_e&&!et)throw new Error(`No path for ${ge}`);return _e}function Wn(ge){return(0,En.UO)()}class Vt extends m.Component{static getDerivedStateFromError(ee){return{error:ee}}render(){const{error:ee}=this.state,{app:Ae,plugin:Ue}=this.props,{ErrorBoundaryFallback:_e}=Ae.getComponents();return ee?(0,h.jsx)(_e,{error:ee,resetError:this.handleErrorReset,plugin:Ue}):this.props.children}constructor(...ee){super(...ee),this.state={error:void 0},this.handleErrorReset=()=>{this.setState({error:void 0})}}}function bn(ge){const{component:ee,mountPoint:Ae,name:Ue}=ge;return Ut({component:{lazy:()=>ee().then(_e=>{const et=O=>{try{cn(Ae)}catch(ae){if(typeof ae=="object"&&ae!==null){const{message:We}=ae;if(typeof We=="string"&&We.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Ae} was not discovered in the app element tree. Routable extension components may not be rendered by other components and must be directly available as an element within the App provider component.`)}throw ae}return(0,h.jsx)(_e,{...O})},Y=Ue||_e.displayName||_e.name||"LazyComponent";return et.displayName=`RoutableExtension(${Y})`,et},_e=>Y=>{const O=Fe(),{BootErrorPage:ae}=O.getComponents();return(0,h.jsx)(ae,{step:"load-chunk",error:_e})})},data:{"core.mountPoint":Ae},name:Ue})}function An(ge){const{component:ee,name:Ae}=ge;return Ut({component:ee,name:Ae})}function Ut(ge){const{data:ee={},name:Ae}=ge;Ae||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Ue;if("lazy"in ge.component){const et=ge.component.lazy;Ue=(0,m.lazy)(()=>et().then(Y=>({default:Y})))}else Ue=ge.component.sync;const _e=Ae||Ue.displayName||Ue.name||"Component";return{expose(et){const Y=O=>{const ae=Fe(),{Progress:We}=ae.getComponents(),U=ee==null?void 0:ee["core.mountPoint"];return(0,h.jsx)(m.Suspense,{fallback:(0,h.jsx)(We,{}),children:(0,h.jsx)(Vt,{app:ae,plugin:et,children:(0,h.jsx)(y,{attributes:{pluginId:et.getId(),...Ae&&{extension:Ae},...U&&{routeRef:U.id}},children:(0,h.jsx)(ie,{plugin:et,children:(0,h.jsx)(Ue,{...O})})})})})};Pt(Y,"core.plugin",et);for(const[O,ae]of Object.entries(ee))Pt(Y,O,ae);return Y.displayName=`Extension(${_e})`,Y}}}function dn(ge,ee,Ae,Ue){return m.Children.toArray(ge).flatMap(_e=>{if(!(0,m.isValidElement)(_e))return[];if(_e.type===m.Fragment)return dn(_e.props.children,ee,Ae,Ue);if(ht(_e,"core.featureFlagged")){const et=_e.props;return("with"in et?ee.isActive(et.with):!ee.isActive(et.without))?dn(_e.props.children,ee,Ae,Ue):[]}if(Ae===void 0||Ae(_e))return[_e];if(Ue)throw new Error(Ue);return dn(_e.props.children,ee,Ae,Ue)})}class un{selectByComponentData(ee){const Ae=dn(this.node,this.featureFlagsApi,Ue=>ht(Ue,ee.key)!==void 0,ee.withStrictError);return new un(Ae,this.featureFlagsApi)}findComponentData(ee){return dn(this.node,this.featureFlagsApi,Ue=>ht(Ue,ee.key)!==void 0).map(Ue=>ht(Ue,ee.key)).filter(Ue=>Ue!==void 0)}getElements(){return dn(this.node,this.featureFlagsApi)}constructor(ee,Ae){this.node=ee,this.featureFlagsApi=Ae}}function Sn(ge,ee,Ae=[]){const Ue=ne(ke),_e=new un(ge,Ue);return(0,m.useMemo)(()=>ee(_e),[ge,...Ae])}class Tn{getId(){return this.config.id}getApis(){var ee;return(ee=this.config.apis)!==null&&ee!==void 0?ee:[]}getFeatureFlags(){var ee,Ae;return(Ae=(ee=this.config.featureFlags)===null||ee===void 0?void 0:ee.slice())!==null&&Ae!==void 0?Ae:[]}get routes(){var ee;return(ee=this.config.routes)!==null&&ee!==void 0?ee:{}}get externalRoutes(){var ee;return(ee=this.config.externalRoutes)!==null&&ee!==void 0?ee:{}}provide(ee){return ee.expose(this)}__experimentalReconfigure(ee){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(ee))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var ee;return(ee=this.options)!==null&&ee!==void 0?ee:{}}toString(){return`plugin{${this.config.id}}`}constructor(ee){this.config=ee,this.options=void 0}}function pn(ge){return new Tn(ge)}},23054:function(jt,Me,t){"use strict";t.d(Me,{SP:function(){return Q},dR:function(){return _},VL:function(){return le},BD:function(){return n}});function h(L){if(typeof L!="object"||L===null||Array.isArray(L))return!1;const I=L;return!(typeof I.name!="string"||I.name===""||typeof I.message!="string")}function n(L){if(typeof L!="object"||L===null||Array.isArray(L))throw new Error(`Encountered invalid error, not an object, got '${L}'`);const I=L;if(typeof I.name!="string"||I.name==="")throw new Error(`Encountered error object without a name, got '${L}'`);if(typeof I.message!="string")throw new Error(`Encountered error object without a message, got '${L}'`)}var m=t(24852);function R(L,I){const $=serializeErrorInternal(L),E={name:"Unknown",message:"<no reason given>",...$};return I!=null&&I.includeStack||delete E.stack,E}function V(L){const I=(0,m.deserializeError)(L);return L.stack||(I.stack=void 0),I}function y(L){if(h(L)){const I=String(L);return I!=="[object Object]"?I:`${L.name}: ${L.message}`}return`unknown error '${L}'`}class l extends Error{constructor(I,$){var E;let T=I;if($!==void 0){const te=y($);T?T+=`; caused by ${te}`:T=`caused by ${te}`}super(T),(E=Error.captureStackTrace)===null||E===void 0||E.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=h($)?$:void 0}}class P extends null{}class ne extends null{}class q extends null{}class _ extends l{}class F extends null{}class X extends null{}class Q extends l{constructor(I,$){super(I,$),this.name=h($)?$.name:"Error"}}async function ue(L){try{const $=await L.text();if($){var I;if(!((I=L.headers.get("content-type"))===null||I===void 0)&&I.startsWith("application/json"))try{const E=JSON.parse($);if(E.error&&E.response)return E}catch{}return{error:{name:"Error",message:`Request failed with status ${L.status} ${L.statusText}, ${$}`},response:{statusCode:L.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${L.status} ${L.statusText}`},response:{statusCode:L.status}}}class le extends Error{static async fromResponse(I){const $=await ue(I),E=$.response.statusCode||I.status,T=$.error.name||I.statusText,te=`Request failed with ${E} ${T}`,Se=V($.error);return new le({message:te,response:I,data:$,cause:Se})}constructor(I){super(I.message),this.name="ResponseError",this.response=I.response,this.body=I.data,this.cause=I.cause}}},32838:function(jt,Me,t){"use strict";t.d(Me,{nW:function(){return le},ae:function(){return _},q3:function(){return F}});var h=t(25248);const n=(0,h.T0)({id:"core.scmauth"});var m=new WeakMap;class R{async getCredentials(I){const $=new URL(I.url),E=_class_private_field_get(this,m).find(T=>T.isUrlSupported($));if(!E)throw new Error(`No auth provider available for '${I.url}', see https://backstage.io/link?scm-auth`);return E.getCredentials(I)}constructor(I){_class_private_field_init(this,m,{writable:!0,value:void 0}),_class_private_field_set(this,m,I)}}var V=new WeakMap,y=new WeakMap,l=new WeakMap,P=new WeakMap;class ne{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:I,gitlab:$,azure:E,bitbucket:T})=>ne.merge(ne.forGithub(I),ne.forGitlab($),ne.forAzure(E),ne.forBitbucket(T))})}static forAuthApi(I,$){return new ne("generic",I,$.host,$.scopeMapping)}static forGithub(I,$){var E;const T=(E=$==null?void 0:$.host)!==null&&E!==void 0?E:"github.com";return new ne("github",I,T,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(I,$){var E;const T=(E=$==null?void 0:$.host)!==null&&E!==void 0?E:"gitlab.com";return new ne("gitlab",I,T,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(I,$){var E;const T=(E=$==null?void 0:$.host)!==null&&E!==void 0?E:"dev.azure.com";return new ne("azure",I,T,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(I,$){var E;const T=(E=$==null?void 0:$.host)!==null&&E!==void 0?E:"bitbucket.org";return new ne("bitbucket",I,T,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...I){return new R(I)}isUrlSupported(I){return I.host===_class_private_field_get(this,y)}getAdditionalScopesForProvider(I){var $;if(!(I!=null&&I.customScopes)||_class_private_field_get(this,P)==="generic")return[];var E;return(E=($=I.customScopes)===null||$===void 0?void 0:$[_class_private_field_get(this,P)])!==null&&E!==void 0?E:[]}async getCredentials(I){const{url:$,additionalScope:E,...T}=I,te=_class_private_field_get(this,l).default.slice();E!=null&&E.repoWrite&&te.push(..._class_private_field_get(this,l).repoWrite);const Se=this.getAdditionalScopesForProvider(E);Se.length&&te.push(...Se);const Ke=[...new Set(te)],Ge=await _class_private_field_get(this,V).getAccessToken(Ke,T);return{token:Ge,headers:{Authorization:`Bearer ${Ge}`}}}constructor(I,$,E,T){_class_private_field_init(this,V,{writable:!0,value:void 0}),_class_private_field_init(this,y,{writable:!0,value:void 0}),_class_private_field_init(this,l,{writable:!0,value:void 0}),_class_private_field_init(this,P,{writable:!0,value:void 0}),_class_private_field_set(this,V,$),_class_private_field_set(this,y,E),_class_private_field_set(this,l,T),_class_private_field_set(this,P,I)}}var q=t(39619);class _{static fromConfig(I){return q.Lx.fromConfig(I)}}const F=(0,h.T0)({id:"integration.scmintegrations"});var X=t(52322),Q=t(73250),ue=t(2784);const le=L=>{const{type:I}=L,$=(0,h.qD)(),E=Q.Z;var T;const te=I&&(T=$.getSystemIcon(I))!==null&&T!==void 0?T:E;return(0,X.jsx)(te,{})}},39619:function(jt,Me,t){"use strict";t.d(Me,{Lx:function(){return Zt},Pb:function(){return Ne}});var h=t(82717),n=t.n(h),m=t(76635);function R(C){const u=new URL("http://example.com");return u.host=C,u.host===C}function V(C){try{return new URL(C),!0}catch{return!1}}function y(C,u){return{list(){return C},byUrl(x){try{const j=typeof x=="string"?new URL(x):x;return C.find(J=>u(J)===j.host)}catch{return}},byHost(x){return C.find(j=>u(j)===x)}}}function l(C){const{url:u,base:x,lineNumber:j}=C;try{return new URL(u),u}catch{}let J;if(u.startsWith("/")){const{filepath:xe}=n()(x);J=new URL(x);const we=(0,m.trimEnd)(J.pathname.substring(0,J.pathname.length-xe.length),"/");J.pathname=`${we}${u}`}else J=new URL(u,x);return J.search=new URL(x).search,j&&(J.hash=`L${j}`),J.toString()}const P="amazonaws.com";function ne(C){const u=C.getOptionalString("endpoint");var x;const j=(x=C.getOptionalBoolean("s3ForcePathStyle"))!==null&&x!==void 0?x:!1;let J,xe;if(u){try{const hn=new URL(u);J=hn.host,xe=hn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${u}' is not a valid URL`)}if(xe!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${u}'`)}else J=P;const we=C.getOptionalString("accessKeyId"),$e=C.getOptionalString("secretAccessKey"),it=C.getOptionalString("roleArn"),Bt=C.getOptionalString("externalId");return{host:J,endpoint:u,s3ForcePathStyle:j,accessKeyId:we,secretAccessKey:$e,roleArn:it,externalId:Bt}}function q(C){const u=C.map(ne);return u.some(x=>x.host===P)||u.push({host:P}),u}class _{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return l(u)}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}_.factory=({config:C})=>{var u;const x=q((u=C.getOptionalConfigArray("integrations.awsS3"))!==null&&u!==void 0?u:[]);return y(x.map(j=>new _(j)),j=>j.config.host)};var F=t(90383),X=t(22504),Q=t(69866);const ue="GB";var le=new WeakMap,L=new WeakMap,I=new WeakMap,$=new WeakMap,E=new WeakMap,T=new WeakMap,te=new WeakMap;class Se{static fromRepoUrl(u){const x=new URL(u);let j,J,xe;const we=x.pathname.split("/").map(Nn=>decodeURIComponent(Nn));if(we[2]==="_git"?(j=we[1],J=xe=we[3]):we[3]==="_git"?(j=we[1],J=we[2],xe=we[4]):we[4]==="_git"&&(j=`${we[1]}/${we[2]}`,J=we[3],xe=we[5]),!j||!J||!xe)throw new Error("Azure URL must point to a git repository");var $e;const it=($e=x.searchParams.get("path"))!==null&&$e!==void 0?$e:void 0;let Bt;const hn=x.searchParams.get("version");if(hn){if(hn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Bt=hn.slice(2)}return new Se(x.origin,j,J,xe,it,Bt)}toRepoUrl(){let u;return(0,F.Z)(this,I)===(0,F.Z)(this,$)?u=(0,F.Z)(this,te).call(this,(0,F.Z)(this,L),"_git",(0,F.Z)(this,$)):u=(0,F.Z)(this,te).call(this,(0,F.Z)(this,L),(0,F.Z)(this,I),"_git",(0,F.Z)(this,$)),(0,F.Z)(this,E)&&u.searchParams.set("path",(0,F.Z)(this,E)),(0,F.Z)(this,T)&&u.searchParams.set("version",ue+(0,F.Z)(this,T)),u.toString()}toFileUrl(){if(!(0,F.Z)(this,E))throw new Error("Azure URL must point to a specific path to be able to download a file");const u=(0,F.Z)(this,te).call(this,(0,F.Z)(this,L),(0,F.Z)(this,I),"_apis","git","repositories",(0,F.Z)(this,$),"items");return u.searchParams.set("api-version","6.0"),u.searchParams.set("path",(0,F.Z)(this,E)),(0,F.Z)(this,T)&&u.searchParams.set("version",(0,F.Z)(this,T)),u.toString()}toArchiveUrl(){const u=(0,F.Z)(this,te).call(this,(0,F.Z)(this,L),(0,F.Z)(this,I),"_apis","git","repositories",(0,F.Z)(this,$),"items");return u.searchParams.set("recursionLevel","full"),u.searchParams.set("download","true"),u.searchParams.set("api-version","6.0"),(0,F.Z)(this,E)&&u.searchParams.set("scopePath",(0,F.Z)(this,E)),(0,F.Z)(this,T)&&u.searchParams.set("version",(0,F.Z)(this,T)),u.toString()}toCommitsUrl(){const u=(0,F.Z)(this,te).call(this,(0,F.Z)(this,L),(0,F.Z)(this,I),"_apis","git","repositories",(0,F.Z)(this,$),"commits");return u.searchParams.set("api-version","6.0"),(0,F.Z)(this,T)&&u.searchParams.set("searchCriteria.itemVersion.version",(0,F.Z)(this,T)),u.toString()}getOwner(){return(0,F.Z)(this,L)}getProject(){return(0,F.Z)(this,I)}getRepo(){return(0,F.Z)(this,$)}getPath(){return(0,F.Z)(this,E)}getRef(){return(0,F.Z)(this,T)}constructor(u,x,j,J,xe,we){(0,X.Z)(this,le,{writable:!0,value:void 0}),(0,X.Z)(this,L,{writable:!0,value:void 0}),(0,X.Z)(this,I,{writable:!0,value:void 0}),(0,X.Z)(this,$,{writable:!0,value:void 0}),(0,X.Z)(this,E,{writable:!0,value:void 0}),(0,X.Z)(this,T,{writable:!0,value:void 0}),(0,X.Z)(this,te,{writable:!0,value:(...$e)=>{const it=new URL((0,F.Z)(this,le));return it.pathname=$e.map(Bt=>encodeURIComponent(Bt)).join("/"),it}}),(0,Q.Z)(this,le,u),(0,Q.Z)(this,L,x),(0,Q.Z)(this,I,j),(0,Q.Z)(this,$,J),(0,Q.Z)(this,E,xe),(0,Q.Z)(this,T,we)}}const Ke="dev.azure.com";function Ge(C){var u;const x=(u=C.getOptionalString("host"))!==null&&u!==void 0?u:Ke,j=C.getOptionalString("token");if(!R(x))throw new Error(`Invalid Azure integration config, '${x}' is not a valid host`);return{host:x,token:j}}function Ee(C){const u=C.map(Ge);return u.some(x=>x.host===Ke)||u.push({host:Ke}),u}class Je{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:x,base:j}=u;if(V(x))return x;try{const xe=Se.fromRepoUrl(j),we=new URL(j);var J;const $e=new URL(`https://a.com${(J=xe.getPath())!==null&&J!==void 0?J:""}`),it=new URL(x,$e).pathname;return we.searchParams.set("path",it),u.lineNumber&&(we.searchParams.set("line",String(u.lineNumber)),we.searchParams.set("lineEnd",String(u.lineNumber+1)),we.searchParams.set("lineStartColumn","1"),we.searchParams.set("lineEndColumn","1")),we.toString()}catch{return new URL(x,j).toString()}}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}Je.factory=({config:C})=>{var u;const x=Ee((u=C.getOptionalConfigArray("integrations.azure"))!==null&&u!==void 0?u:[]);return y(x.map(j=>new Je(j)),j=>j.config.host)};var ft=t(48834).lW;function Ze(C){return AzureUrl.fromRepoUrl(C).toFileUrl()}function ke(C){return AzureUrl.fromRepoUrl(C).toArchiveUrl()}function nt(C){return AzureUrl.fromRepoUrl(C).toCommitsUrl()}function at(C,u){const x=u?{...u}:{};if(C.token){const j=ft.from(`:${C.token}`,"utf8");x.Authorization=`Basic ${j.toString("base64")}`}return{headers:x}}const ut="bitbucket.org",lt="https://api.bitbucket.org/2.0";function ot(C){var u;const x=(u=C.getOptionalString("host"))!==null&&u!==void 0?u:ut;let j=C.getOptionalString("apiBaseUrl");const J=C.getOptionalString("token"),xe=C.getOptionalString("username"),we=C.getOptionalString("appPassword");if(!R(x))throw new Error(`Invalid Bitbucket integration config, '${x}' is not a valid host`);return j?j=(0,m.trimEnd)(j,"/"):x===ut?j=lt:j=`https://${x}/rest/api/1.0`,{host:x,apiBaseUrl:j,token:J,username:xe,appPassword:we}}function dt(C){const u=C.map(ot);return u.some(x=>x.host===ut)||u.push({host:ut,apiBaseUrl:lt}),u}class gt{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const x=l(u);if(!u.lineNumber)return x;const j=new URL(x);return this.integrationConfig.host==="bitbucket.org"?j.hash=`lines-${u.lineNumber}`:j.hash=`${u.lineNumber}`,j.toString()}resolveEditUrl(u){const x=n()(u),j=new URL(u);return j.searchParams.set("mode","edit"),j.searchParams.set("spa","0"),j.searchParams.set("at",x.ref),j.toString()}constructor(u){this.integrationConfig=u}}gt.factory=({config:C})=>{var u,x,j;const J=dt((j=C.getOptionalConfigArray("integrations.bitbucket"))!==null&&j!==void 0?j:[...(u=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[],...(x=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&x!==void 0?x:[]]);return y(J.map(xe=>new gt(xe)),xe=>xe.config.host)};var Be=t(96279),ie=t(48834).lW;async function Te(C,u){const{name:x,owner:j,resource:J}=parseGitUrl(C),xe=J==="bitbucket.org";let we=xe?`${u.apiBaseUrl}/repositories/${j}/${x}`:`${u.apiBaseUrl}/projects/${j}/repos/${x}/default-branch`,$e=await fetch(we,bt(u));if($e.status===404&&!xe&&(we=`${u.apiBaseUrl}/projects/${j}/repos/${x}/branches/default`,$e=await fetch(we,bt(u))),!$e.ok){const Bt=`Failed to retrieve default branch from ${we}, ${$e.status} ${$e.statusText}`;throw new Error(Bt)}let it;if(xe)it=(await $e.json()).mainbranch.name;else{const{displayId:Bt}=await $e.json();it=Bt}if(!it)throw new Error(`Failed to read default branch from ${we}. Response ${$e.status} ${$e.json()}`);return it}async function Fe(C,u){const{name:x,owner:j,ref:J,protocol:xe,resource:we,filepath:$e}=parseGitUrl(C),it=we==="bitbucket.org";let Bt=J;Bt||(Bt=await Te(C,u));const hn=$e?`&path=${encodeURIComponent(decodeURIComponent($e))}`:"";return it?`${xe}://${we}/${j}/${x}/get/${Bt}.tar.gz`:`${u.apiBaseUrl}/projects/${j}/repos/${x}/archive?format=tgz&at=${Bt}&prefix=${j}-${x}${hn}`}function mt(C,u){try{const{owner:x,name:j,ref:J,filepathtype:xe,filepath:we}=parseGitUrl(C);if(!x||!j||xe!=="browse"&&xe!=="raw"&&xe!=="src")throw new Error("Invalid Bitbucket URL or file path");const $e=we.replace(/^\//,"");if(u.host==="bitbucket.org"){if(!J)throw new Error("Invalid Bitbucket URL or file path");return`${u.apiBaseUrl}/repositories/${x}/${j}/src/${J}/${$e}`}return`${u.apiBaseUrl}/projects/${x}/repos/${j}/raw/${$e}?at=${J}`}catch(x){throw new Error(`Incorrect URL: ${C}, ${x}`)}}function bt(C){const u={};if(C.token)u.Authorization=`Bearer ${C.token}`;else if(C.username&&C.appPassword){const x=ie.from(`${C.username}:${C.appPassword}`,"utf8");u.Authorization=`Basic ${x.toString("base64")}`}return{headers:u}}const Pt="bitbucket.org",ht="https://api.bitbucket.org/2.0";function Ct(C){const u=Pt,x=ht,j=C.getString("username"),J=C.getString("appPassword");return{host:u,apiBaseUrl:x,username:j,appPassword:J}}function Tt(C){const u=C.map(Ct);return u.length===0&&u.push({host:Pt,apiBaseUrl:ht}),u}class kt{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const x=l(u);if(u.lineNumber){const j=new URL(x);return j.hash=`lines-${u.lineNumber}`,j.toString()}return x}resolveEditUrl(u){const x=n()(u),j=new URL(u);return j.searchParams.set("mode","edit"),j.searchParams.set("at",x.ref),j.toString()}constructor(u){this.integrationConfig=u}}kt.factory=({config:C})=>{var u;const x=Tt((u=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[]);return y(x.map(j=>new kt(j)),j=>j.config.host)};var _t=t(48834).lW;async function en(C,u){const{name:x,owner:j}=parseGitUrl(C),J=`${u.apiBaseUrl}/repositories/${j}/${x}`,xe=await fetch(J,ln(u));if(!xe.ok){const it=`Failed to retrieve default branch from ${J}, ${xe.status} ${xe.statusText}`;throw new Error(it)}const $e=(await xe.json()).mainbranch.name;if(!$e)throw new Error(`Failed to read default branch from ${J}. Response ${xe.status} ${xe.json()}`);return $e}async function Kt(C,u){const{name:x,owner:j,ref:J,protocol:xe,resource:we}=parseGitUrl(C);let $e=J;return $e||($e=await en(C,u)),`${xe}://${we}/${j}/${x}/get/${$e}.tar.gz`}function Xt(C,u){try{const{owner:x,name:j,ref:J,filepathtype:xe,filepath:we}=parseGitUrl(C);if(!x||!j||xe!=="src"&&xe!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const $e=we.replace(/^\//,"");if(!J)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${u.apiBaseUrl}/repositories/${x}/${j}/src/${J}/${$e}`}catch(x){throw new Error(`Incorrect URL: ${C}, ${x}`)}}function ln(C){const u={};if(C.username&&C.appPassword){const x=_t.from(`${C.username}:${C.appPassword}`,"utf8");u.Authorization=`Basic ${x.toString("base64")}`}return{headers:u}}function qt(C){const u=C.getString("host");let x=C.getOptionalString("apiBaseUrl");const j=C.getOptionalString("token"),J=C.getOptionalString("username"),xe=C.getOptionalString("password");if(!R(u))throw new Error(`Invalid Bitbucket Server integration config, '${u}' is not a valid host`);return x?x=(0,m.trimEnd)(x,"/"):x=`https://${u}/rest/api/1.0`,{host:u,apiBaseUrl:x,token:j,username:J,password:xe}}function jn(C){return C.map(qt)}class on{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const x=l(u);if(u.lineNumber){const j=new URL(x);return j.hash=u.lineNumber.toString(),j.toString()}return x}resolveEditUrl(u){return u.includes("?")?u.substring(0,u.indexOf("?")):u}constructor(u){this.integrationConfig=u}}on.factory=({config:C})=>{var u;const x=jn((u=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&u!==void 0?u:[]);return y(x.map(j=>new on(j)),j=>j.config.host)};var En=t(48834).lW;async function cn(C,u){const{name:x,owner:j}=parseGitUrl(C);let J=`${u.apiBaseUrl}/projects/${j}/repos/${x}/default-branch`,xe=await fetch(J,bn(u));if(xe.status===404&&(J=`${u.apiBaseUrl}/projects/${j}/repos/${x}/branches/default`,xe=await fetch(J,bn(u))),!xe.ok){const it=`Failed to retrieve default branch from ${J}, ${xe.status} ${xe.statusText}`;throw new Error(it)}const{displayId:we}=await xe.json(),$e=we;if(!$e)throw new Error(`Failed to read default branch from ${J}. Response ${xe.status} ${xe.json()}`);return $e}async function Wn(C,u){const{name:x,owner:j,ref:J,filepath:xe}=parseGitUrl(C);let we=J;we||(we=await cn(C,u));const $e=xe?`&path=${encodeURIComponent(decodeURIComponent(xe))}`:"";return`${u.apiBaseUrl}/projects/${j}/repos/${x}/archive?format=tgz&at=${we}&prefix=${j}-${x}${$e}`}function Vt(C,u){try{const{owner:x,name:j,ref:J,filepathtype:xe,filepath:we}=parseGitUrl(C);if(!x||!j||xe!=="browse"&&xe!=="raw"&&xe!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const $e=we.replace(/^\//,"");return`${u.apiBaseUrl}/projects/${x}/repos/${j}/raw/${$e}?at=${J}`}catch(x){throw new Error(`Incorrect URL: ${C}, ${x}`)}}function bn(C){const u={};if(C.token)u.Authorization=`Bearer ${C.token}`;else if(C.username&&C.password){const x=En.from(`${C.username}:${C.password}`,"utf8");u.Authorization=`Basic ${x.toString("base64")}`}return{headers:u}}function An(C){const u=C.getString("host");let x=C.getOptionalString("baseUrl"),j=C.getOptionalString("cloneUrl"),J=C.getOptionalString("gitilesBaseUrl");const xe=C.getOptionalString("username"),we=C.getOptionalString("password");if(R(u)){if(x&&!V(x))throw new Error(`Invalid Gerrit integration config, '${x}' is not a valid baseUrl`);if(j&&!V(j))throw new Error(`Invalid Gerrit integration config, '${j}' is not a valid cloneUrl`);if(J&&!V(J))throw new Error(`Invalid Gerrit integration config, '${J}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${u}' is not a valid host`);return x?x=(0,m.trimEnd)(x,"/"):x=`https://${u}`,J?J=(0,m.trimEnd)(J,"/"):J=`https://${u}`,j?j=(0,m.trimEnd)(j,"/"):j=x,{host:u,baseUrl:x,cloneUrl:j,gitilesBaseUrl:J,username:xe,password:we}}function Ut(C){return C.map(An)}var dn=t(48834).lW;const un=")]}'";function Sn(C,u){const j=u.replace(C.gitilesBaseUrl,"").split("/").filter(Bt=>!!Bt),J=j.indexOf("+");if(J<=0)throw new Error(`Unable to parse project from url: ${u}`);const xe=(0,m.trimStart)(j.slice(0,J).join("/"),"/"),we=j.indexOf("heads");if(we<=0)throw new Error(`Unable to parse branch from url: ${u}`);const $e=j[we+1],it=j.slice(we+2).join("/");return{branch:$e,filePath:it===""?"/":it,project:xe}}function Tn(C,u,x,j){return`${C.gitilesBaseUrl}/${u}/+/refs/heads/${x}/${(0,m.trimStart)(j,"/")}`}function pn(C){return C.password?"/a/":"/"}function ge(C,u){const{branch:x,project:j}=Sn(C,u);return`${C.baseUrl}${pn(C)}projects/${encodeURIComponent(j)}/branches/${x}`}function ee(C,u){const{project:x}=Sn(C,u);return`${C.cloneUrl}${pn(C)}${x}`}function Ae(C,u){const{branch:x,filePath:j,project:J}=Sn(C,u);return`${C.baseUrl}${pn(C)}projects/${encodeURIComponent(J)}/branches/${x}/files/${encodeURIComponent(j)}/content`}function Ue(C){return`${C.baseUrl}${pn(C)}projects/`}function _e(C){const u={};if(!C.password)return u;const x=dn.from(`${C.username}:${C.password}`,"utf8");return u.Authorization=`Basic ${x.toString("base64")}`,{headers:u}}async function et(C){const u=await C.text();if(u.startsWith(un))try{return JSON.parse(u.slice(un.length))}catch(x){throw new Error(`Invalid response from Gerrit: ${u.slice(0,10)} - ${x}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${u.slice(0,10)}`)}class Y{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:x,base:j,lineNumber:J}=u;let xe;if(x.startsWith("/")){const{branch:we,project:$e}=Sn(this.config,j);return Tn(this.config,$e,we,x)}return x?xe=new URL(x,j):xe=new URL(j),J&&(xe.hash=J.toString()),xe.toString()}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}Y.factory=({config:C})=>{var u;const x=Ut((u=C.getOptionalConfigArray("integrations.gerrit"))!==null&&u!==void 0?u:[]);return y(x.map(j=>new Y(j)),j=>j.config.host)};const O="github.com",ae="https://api.github.com",We="https://raw.githubusercontent.com";function U(C){var u,x;const j=(x=C.getOptionalString("host"))!==null&&x!==void 0?x:O;let J=C.getOptionalString("apiBaseUrl"),xe=C.getOptionalString("rawBaseUrl");const we=C.getOptionalString("token"),$e=(u=C.getOptionalConfigArray("apps"))===null||u===void 0?void 0:u.map(it=>({appId:it.getNumber("appId"),clientId:it.getString("clientId"),clientSecret:it.getString("clientSecret"),webhookSecret:it.getString("webhookSecret"),privateKey:it.getString("privateKey"),allowedInstallationOwners:it.getOptionalStringArray("allowedInstallationOwners")}));if(!R(j))throw new Error(`Invalid GitHub integration config, '${j}' is not a valid host`);return J?J=(0,m.trimEnd)(J,"/"):j===O&&(J=ae),xe?xe=(0,m.trimEnd)(xe,"/"):j===O&&(xe=We),{host:j,apiBaseUrl:J,rawBaseUrl:xe,token:we,apps:$e}}function Z(C){const u=C.map(U);return u.some(x=>x.host===O)||u.push({host:O,apiBaseUrl:ae,rawBaseUrl:We}),u}function he(C,u,x){try{const{owner:j,name:J,ref:xe,filepathtype:we,filepath:$e}=parseGitUrl(C);if(!j||!J||!xe||we!=="blob"&&we!=="raw"&&we!=="tree")throw new Error("Invalid GitHub URL or file path");const it=$e.replace(/^\//,"");return be(u,x)==="api"?`${u.apiBaseUrl}/repos/${j}/${J}/contents/${it}?ref=${xe}`:`${u.rawBaseUrl}/${j}/${J}/${xe}/${it}`}catch(j){throw new Error(`Incorrect URL: ${C}, ${j}`)}}function ye(C,u){const x={};return be(C,u)==="api"&&(x.Accept="application/vnd.github.v3.raw"),u.token&&(x.Authorization=`token ${u.token}`),{headers:x}}function be(C,u){return C.apiBaseUrl&&(u.token||!C.rawBaseUrl)?"api":"raw"}var De=t(42822),Oe=t(89393),He=t(26228);class qe{async getOrCreateToken(u,x,j){let J=this.tokenCache.get(u);if((!J||this.isExpired(J.expiresAt))&&(J=await j(),J.expiresAt=J.expiresAt.minus({minutes:10}),this.tokenCache.set(u,J)),!this.appliesToRepo(J,x))throw new Error(`The Backstage GitHub application used in the ${u} organization does not have access to a repository with the name ${x}`);return{accessToken:J.token}}appliesToRepo(u,x){return x===void 0?!0:u.repositories!==void 0?u.repositories.includes(x):!0}constructor(){this.tokenCache=new Map,this.isExpired=u=>He.ou.local()>u}}const b={Accept:"application/vnd.github.machine-man-preview+json"};class W{async getInstallationCredentials(u,x){if(this.allowedInstallationOwners){var j;if(!(!((j=this.allowedInstallationOwners)===null||j===void 0)&&j.includes(u)))return{accessToken:void 0}}return this.cache.getOrCreateToken(u,x,async()=>{const{installationId:J,suspended:xe}=await this.getInstallationData(u);if(xe)throw new Error(`The GitHub application for ${u} is suspended`);const we=await this.appClient.apps.createInstallationAccessToken({installation_id:J,headers:b});let $e;if(we.data.repository_selection==="selected"){const Bt=new Oe.v({baseUrl:this.baseUrl,auth:we.data.token}),hn=await Bt.paginate(Bt.apps.listReposAccessibleToInstallation);var it;$e=((it=hn.repositories)!==null&&it!==void 0?it:hn).map(mr=>mr.name)}return{token:we.data.token,expiresAt:He.ou.fromISO(we.data.expires_at),repositories:$e}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(u){const j=(await this.getInstallations()).find(xe=>{var we,$e;return((we=xe.account)===null||we===void 0||($e=we.login)===null||$e===void 0?void 0:$e.toLocaleLowerCase("en-US"))===u.toLocaleLowerCase("en-US")});if(j)return{installationId:j.id,suspended:Boolean(j.suspended_by)};const J=new Error(`No app installation found for ${u} in ${this.baseAuthConfig.appId}`);throw J.name="NotFoundError",J}constructor(u,x){this.cache=new qe,this.allowedInstallationOwners=u.allowedInstallationOwners,this.baseUrl=x,this.baseAuthConfig={appId:u.appId,privateKey:u.privateKey.replace(/\\n/gm,`
|
|
31
|
-
`)},this.appClient=new Oe.v({baseUrl:x,headers:b,authStrategy:De.i,auth:this.baseAuthConfig})}}class fe{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(x=>x.getInstallations()))).flat():[]}async getAppToken(u,x){if(this.apps.length===0)return;const j=await Promise.all(this.apps.map($e=>$e.getInstallationCredentials(u,x).then(it=>({credentials:it,error:void 0}),it=>({credentials:void 0,error:it})))),J=j.find($e=>$e.credentials);if(J)return J.credentials.accessToken;const we=j.map($e=>$e.error).find($e=>$e.name!=="NotFoundError");if(we)throw we}constructor(u){var x,j;this.apps=(j=(x=u.apps)===null||x===void 0?void 0:x.map(J=>new W(J,u.apiBaseUrl)))!==null&&j!==void 0?j:[]}}class de{async getCredentials(u){const x=n()(u.url),j=x.owner||x.name,J=x.owner?x.name:void 0;let xe="app",we=await this.githubAppCredentialsMux.getAppToken(j,J);return we||(xe="token",we=this.token),{headers:we?{Authorization:`Bearer ${we}`}:void 0,token:we,type:xe}}constructor(u,x){this.githubAppCredentialsMux=u,this.token=x}}de.create=C=>new de(new fe(C),C.token);class Ce{static fromIntegrations(u){const x=new Map;return u.github.list().forEach(j=>{const J=SingleInstanceGithubCredentialsProvider.create(j.config);x.set(j.config.host,J)}),new Ce(x)}async getCredentials(u){const x=new URL(u.url),j=this.providers.get(x.host);if(!j)throw new Error(`There is no GitHub integration that matches ${u.url}. Please add a configuration for an integration.`);return j.getCredentials(u)}constructor(u){this.providers=u}}class Ie{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return Ne(l(u),"tree")}resolveEditUrl(u){return Ne(u,"edit")}constructor(u){this.integrationConfig=u}}Ie.factory=({config:C})=>{var u;const x=Z((u=C.getOptionalConfigArray("integrations.github"))!==null&&u!==void 0?u:[]);return y(x.map(j=>new Ie(j)),j=>j.config.host)};function Ne(C,u){return C.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(x,j,J,xe)=>`//${j}/${J}/${xe}/${u}/`)}const rt="gitlab.com",xt="https://gitlab.com/api/v4";function vt(C){const u=C.getString("host");let x=C.getOptionalString("apiBaseUrl");const j=C.getOptionalString("token");let J=C.getOptionalString("baseUrl");if(x?x=(0,m.trimEnd)(x,"/"):u===rt&&(x=xt),J?J=(0,m.trimEnd)(J,"/"):J=`https://${u}`,R(u)){if(!x||!V(x))throw new Error(`Invalid GitLab integration config, '${x}' is not a valid apiBaseUrl`);if(!V(J))throw new Error(`Invalid GitLab integration config, '${J}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${u}' is not a valid host`);return{host:u,token:j,apiBaseUrl:x,baseUrl:J}}function st(C){const u=C.map(vt);return u.some(x=>x.host===rt)||u.push({host:rt,apiBaseUrl:xt,baseUrl:`https://${rt}`}),u}function pt(C){let u="";return C.host!==rt&&(u=new URL(C.baseUrl).pathname),trimEnd(u,"/")}async function At(C,u){const x=await Dt(C,u);return It(C,x,u).toString()}function Et(C){const{token:u=""}=C;return{headers:{"PRIVATE-TOKEN":u}}}function It(C,u,x){try{const j=new URL(C),J=j.pathname.split("/blob/").slice(1).join("/blob/"),[xe,...we]=J.split("/"),$e=getGitLabIntegrationRelativePath(x);return j.pathname=[...$e?[$e]:[],"api/v4/projects",u,"repository/files",encodeURIComponent(decodeURIComponent(we.join("/"))),"raw"].join("/"),j.search=`?ref=${xe}`,j}catch(j){throw new Error(`Incorrect url: ${C}, ${j}`)}}async function Dt(C,u){const x=new URL(C);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 J=getGitLabIntegrationRelativePath(u);J&&(j=j.replace(J,""));const xe=new URL(`${x.origin}${J}/api/v4/projects/${encodeURIComponent(j.replace(/^\//,""))}`),we=await fetch(xe.toString(),Et(u)),$e=await we.json();if(!we.ok)throw new Error(`GitLab Error '${$e.error}', ${$e.error_description}`);return Number($e.id)}catch(j){throw new Error(`Could not get GitLab project ID for: ${C}, ${j}`)}}class In{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return l(u)}resolveEditUrl(u){return Dn(u,"edit")}constructor(u){this.integrationConfig=u}}In.factory=({config:C})=>{var u;const x=st((u=C.getOptionalConfigArray("integrations.gitlab"))!==null&&u!==void 0?u:[]);return y(x.map(j=>new In(j)),j=>j.config.host)};function Dn(C,u){return C.replace(/\/\-\/(blob|tree|edit)\//,`/-/${u}/`)}class Zt{static fromConfig(u){return new Zt({awsS3:_.factory({config:u}),azure:Je.factory({config:u}),bitbucket:gt.factory({config:u}),bitbucketCloud:kt.factory({config:u}),bitbucketServer:on.factory({config:u}),gerrit:Y.factory({config:u}),github:Ie.factory({config:u}),gitlab:In.factory({config:u})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}list(){return Object.values(this.byType).flatMap(u=>u.list())}byUrl(u){let x=Object.values(this.byType).map(j=>j.byUrl(u)).filter(Boolean);if(x.length>1){const j=x.filter(J=>!(J instanceof gt));j.length!==0&&(x=j)}return x[0]}byHost(u){return Object.values(this.byType).map(x=>x.byHost(u)).find(Boolean)}resolveUrl(u){const x=this.byUrl(u.base);return x?x.resolveUrl(u):l(u)}resolveEditUrl(u){const x=this.byUrl(u);return x?x.resolveEditUrl(u):u}constructor(u){this.byType=u}}},96215:function(jt,Me,t){"use strict";var h={};t.r(h),t.d(h,{TechDocsPlugin:function(){return T.s4}});var n=t(52322),m=t(2784),R=t(28316),V=t(10289),y=t(25248);const l=(0,y.T0)({id:"plugin.techdocs.storageservice"}),P=(0,y.T0)({id:"plugin.techdocs.service"});var ne=t(92077),q=t(95481),_=t(7476),F=t(93225),X=t(67896),Q=t(65124),ue=t(17339),le=t(85478),L=t(68435),I=t(3482),$=t(42081),E=t(48431),T=t(89258),te=t(52943),Se=t(61886),Ke=t(13980),Ge=t.n(Ke);class Ee{get(r){for(const o of this.holders){const c=o.get(r);if(c)return c}}constructor(...r){this.holders=r}}var Je=t(51837);const ft=(0,Je.CT)("api-context"),Ze=a=>{var r;const{apis:o,children:c}=a,f=(r=(0,m.useContext)(ft))===null||r===void 0?void 0:r.atVersion(1),k=f?new Ee(o,f):o;return(0,n.jsx)(ft.Provider,{value:(0,Je.EI)({1:k}),children:c})};Ze.propTypes={apis:Ge().shape({get:Ge().func.isRequired}).isRequired,children:Ge().node};class ke{static validateFactories(r,o){for(const c of o){const f=[c],k=new Set;for(;f.length;){const M=f.shift(),H=r.get(M);if(!!H)for(const re of Object.values(H.deps)){if(re.id===c.id)throw new Error(`Circular dependency of api factory for ${c}`);k.has(re)||(k.add(re),f.push(re))}}}}get(r){return this.load(r)}load(r,o=[]){const c=this.apis.get(r.id);if(c)return c;const f=this.factories.get(r);if(!f)return;if(o.includes(f.api))throw new Error(`Circular dependency of api factory for ${f.api}`);const k=this.loadDeps(r,f.deps,[...o,f.api]),M=f.factory(k);return this.apis.set(r.id,M),M}loadDeps(r,o,c){const f={};for(const k in o)if(o.hasOwnProperty(k)){const M=o[k],H=this.load(M,c);if(!H)throw new Error(`No API factory available for dependency ${M} of dependent ${r}`);f[k]=H}return f}constructor(r){this.factories=r,this.apis=new Map}}var nt;(function(a){a[a.default=10]="default",a[a.app=50]="app",a[a.static=100]="static"})(nt||(nt={}));class at{register(r,o){const c=nt[r],f=this.factories.get(o.api.id);return f&&f.priority>=c?!1:(this.factories.set(o.api.id,{priority:c,factory:o}),!0)}get(r){const o=this.factories.get(r.id);if(!!o)return o.factory}getAllApis(){const r=new Set;for(const{factory:o}of this.factories.values())r.add(o.api);return r}constructor(){this.factories=new Map}}function ut(a){return new Promise((r,o)=>{const c=a.width||500,f=a.height||700,k=window.screen.width/2-c/2,M=window.screen.height/2-f/2,H=window.open(a.url,a.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${c},height=${f},top=${M},left=${k}`);let re="";if(!H||typeof H.closed=="undefined"||H.closed){const ct=new Error("Failed to open auth popup.");ct.name="PopupRejectedError",o(ct);return}const Ve=ct=>{if(ct.source!==H||ct.origin!==a.origin)return;const{data:$t}=ct;if($t.type==="config_info"){re=$t.targetOrigin;return}if($t.type!=="authorization_response")return;const Nt=$t;if("error"in Nt){const Yt=new Error(Nt.error.message);Yt.name=Nt.error.name,o(Yt)}else r(Nt.response);wt()},ze=setInterval(()=>{if(H.closed){const ct=`Login failed, ${re&&re!==window.location.origin?`Incorrect app origin, expected ${re}`:"popup was closed"}`,$t=new Error(ct);$t.name="PopupClosedError",o($t),wt()}},100);function wt(){window.removeEventListener("message",Ve),clearInterval(ze)}window.addEventListener("message",Ve)})}function lt(a){return[...a].join(" ")}class ot{async createSession(r){return r.instantPopup?this.showPopup(r.scopes):this.authRequester(r.scopes)}async refreshSession(){const r=await fetch(await this.buildUrl("/refresh",{optional:!0}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(c=>{throw new Error(`Auth refresh request failed, ${c}`)});if(!r.ok){const c=new Error(`Auth refresh request failed, ${r.statusText}`);throw c.status=r.status,c}const o=await r.json();if(o.error){const c=new Error(o.error.message);throw o.error.name&&(c.name=o.error.name),c}return await this.sessionTransform(o)}async removeSession(){const r=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(o=>{throw new Error(`Logout request failed, ${o}`)});if(!r.ok){const o=new Error(`Logout request failed, ${r.statusText}`);throw o.status=r.status,o}}async showPopup(r){const o=this.joinScopesFunc(r),c=await this.buildUrl("/start",{scope:o,origin:location.origin}),f=await ut({url:c,name:`${this.provider.title} Login`,origin:new URL(c).origin,width:450,height:730});return await this.sessionTransform(f)}async buildUrl(r,o){const c=await this.discoveryApi.getBaseUrl("auth"),f=this.buildQueryString({...o,env:this.environment});return`${c}/${this.provider.id}${r}${f}`}buildQueryString(r){if(!r)return"";const o=Object.entries(r).map(([c,f])=>{if(typeof f=="string")return`${encodeURIComponent(c)}=${encodeURIComponent(f)}`;if(f)return encodeURIComponent(c)}).filter(Boolean).join("&");return o?`?${o}`:""}constructor(r){const{discoveryApi:o,environment:c,provider:f,joinScopes:k=lt,oauthRequestApi:M,sessionTransform:H=re=>re}=r;this.authRequester=M.createAuthRequester({provider:f,onAuthRequest:re=>this.showPopup(re)}),this.discoveryApi=o,this.environment=c,this.provider=f,this.joinScopesFunc=k,this.sessionTransform=H}}function dt(a,r){for(const o of r)if(!a.has(o))return!1;return!0}class gt{sessionExistsAndHasScope(r,o){if(!r)return!1;if(!o||this.options.sessionScopes===void 0)return!0;const c=this.options.sessionScopes(r);return dt(c,o)}getExtendedScope(r,o){const c=new Set(this.options.defaultScopes);if(r&&this.options.sessionScopes!==void 0){const f=this.options.sessionScopes(r);for(const k of f)c.add(k)}if(o)for(const f of o)c.add(f);return c}constructor(r){this.options=r}}var Be=t(82394),ie=t.n(Be);let Te=Symbol.observable;class Fe{[Te](){return this}get closed(){return this.isClosed}next(r){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(o=>o.next(r))}error(r){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=r,this.subscribers.forEach(o=>o.error(r))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(r=>r.complete())}subscribe(r,o,c){const f=typeof r=="function"?{next:r,error:o,complete:c}:r;return this.observable.subscribe(f)}constructor(){this.isClosed=!1,this.observable=new(ie())(r=>this.isClosed?(this.terminatingError?r.error(this.terminatingError):r.complete(),()=>{}):(this.subscribers.add(r),()=>{this.subscribers.delete(r)})),this.subscribers=new Set}}let mt=Symbol.observable;class bt{[mt](){return this}get closed(){return this.isClosed}next(r){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=r,this.subscribers.forEach(o=>o.next(r))}error(r){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=r,this.subscribers.forEach(o=>o.error(r))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(r=>r.complete())}subscribe(r,o,c){const f=typeof r=="function"?{next:r,error:o,complete:c}:r;return this.observable.subscribe(f)}constructor(r){this.subscribers=new Set,this.isClosed=!1,this.currentValue=r,this.terminatingError=void 0,this.observable=new(ie())(o=>this.isClosed?(this.terminatingError?o.error(this.terminatingError):o.complete(),()=>{}):(o.next(this.currentValue),this.subscribers.add(o),()=>{this.subscribers.delete(o)}))}}class Pt{setIsSignedIn(r){this.signedIn!==r&&(this.signedIn=r,this.subject.next(this.signedIn?y.sM.SignedIn:y.sM.SignedOut))}sessionState$(){return this.subject}constructor(){this.subject=new bt(y.sM.SignedOut),this.signedIn=!1}}class ht{async getSession(r){if(this.helper.sessionExistsAndHasScope(this.currentSession,r.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const c=await this.collapsedSessionRefresh(),f=this.sessionScopesFunc(this.currentSession),k=this.sessionScopesFunc(c);return dt(k,f)&&(this.currentSession=c),c}catch(c){if(r.optional)return;throw c}}if(!this.currentSession&&!r.instantPopup)try{const o=await this.collapsedSessionRefresh();return this.currentSession=o,this.getSession(r)}catch{}if(!r.optional)return this.currentSession=await this.connector.createSession({...r,scopes:this.helper.getExtendedScope(this.currentSession,r.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession();try{const r=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),r}finally{delete this.refreshPromise}}constructor(r){this.stateTracker=new Pt;const{connector:o,defaultScopes:c=new Set,sessionScopes:f,sessionShouldRefresh:k}=r;this.connector=o,this.sessionScopesFunc=f,this.sessionShouldRefreshFunc=k,this.helper=new gt({sessionScopes:f,defaultScopes:c})}}class Ct{setSession(r){this.currentSession=r,this.stateTracker.setIsSignedIn(Boolean(r))}async getSession(r){if(this.helper.sessionExistsAndHasScope(this.currentSession,r.scopes))return this.currentSession;if(!r.optional)return this.currentSession=await this.connector.createSession({...r,scopes:this.helper.getExtendedScope(this.currentSession,r.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(r){this.stateTracker=new SessionStateTracker;const{connector:o,defaultScopes:c=new Set,sessionScopes:f}=r;this.connector=o,this.helper=new SessionScopeHelper({sessionScopes:f,defaultScopes:c})}}const Tt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class kt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Tt,oauthRequestApi:k,defaultScopes:M=[],scopeTransform:H=ze=>ze}=r,re=new ot({discoveryApi:o,environment:c,provider:f,oauthRequestApi:k,sessionTransform(ze){return{...ze,providerInfo:{idToken:ze.providerInfo.idToken,accessToken:ze.providerInfo.accessToken,scopes:kt.normalizeScopes(H,ze.providerInfo.scope),expiresAt:new Date(Date.now()+ze.providerInfo.expiresInSeconds*1e3)}}}}),Ve=new ht({connector:re,defaultScopes:new Set(M),sessionScopes:ze=>ze.providerInfo.scopes,sessionShouldRefresh:ze=>(ze.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new kt({sessionManager:Ve,scopeTransform:H})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(r,o){const c=kt.normalizeScopes(this.scopeTransform,r),f=await this.sessionManager.getSession({...o,scopes:c});var k;return(k=f==null?void 0:f.providerInfo.accessToken)!==null&&k!==void 0?k:""}async getIdToken(r={}){const o=await this.sessionManager.getSession(r);var c;return(c=o==null?void 0:o.providerInfo.idToken)!==null&&c!==void 0?c:""}async getBackstageIdentity(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.backstageIdentity}async getProfile(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.profile}static normalizeScopes(r,o){if(!o)return new Set;const c=Array.isArray(o)?o:o.split(/[\s|,]/).filter(Boolean);return new Set(r(c))}constructor(r){this.sessionManager=r.sessionManager,this.scopeTransform=r.scopeTransform}}const _t={id:"github",title:"GitHub",icon:()=>null};class en{static create(r){const{discoveryApi:o,environment:c="development",provider:f=_t,oauthRequestApi:k,defaultScopes:M=["read:user"]}=r;return kt.create({discoveryApi:o,oauthRequestApi:k,provider:f,environment:c,defaultScopes:M})}}const Kt={id:"gitlab",title:"GitLab",icon:()=>null};class Xt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Kt,oauthRequestApi:k,defaultScopes:M=["read_user"]}=r;return kt.create({discoveryApi:o,oauthRequestApi:k,provider:f,environment:c,defaultScopes:M})}}const ln={id:"google",title:"Google",icon:()=>null},qt="https://www.googleapis.com/auth/";class jn{static create(r){const{discoveryApi:o,oauthRequestApi:c,environment:f="development",provider:k=ln,defaultScopes:M=["openid",`${qt}userinfo.email`,`${qt}userinfo.profile`]}=r;return kt.create({discoveryApi:o,oauthRequestApi:c,provider:k,environment:f,defaultScopes:M,scopeTransform(H){return H.map(re=>re==="openid"?re:re==="profile"||re==="email"?`${qt}userinfo.${re}`:re.startsWith(qt)?re:`${qt}${re}`)}})}}const on={id:"okta",title:"Okta",icon:()=>null},En=new Set(["openid","profile","email","phone","address","groups","offline_access"]),cn="okta.";class Wn{static create(r){const{discoveryApi:o,environment:c="development",provider:f=on,oauthRequestApi:k,defaultScopes:M=["openid","email","profile","offline_access"]}=r;return kt.create({discoveryApi:o,oauthRequestApi:k,provider:f,environment:c,defaultScopes:M,scopeTransform(H){return H.map(re=>En.has(re)||re.startsWith(cn)?re:`${cn}${re}`)}})}}var Vt=t(30195);const bn=Vt.z.object({profile:Vt.z.object({email:Vt.z.string().optional(),displayName:Vt.z.string().optional(),picture:Vt.z.string().optional()}),backstageIdentity:Vt.z.object({token:Vt.z.string(),identity:Vt.z.object({type:Vt.z.literal("user"),userEntityRef:Vt.z.string(),ownershipEntityRefs:Vt.z.array(Vt.z.string())})})}),An={id:"saml",title:"SAML",icon:()=>null};class Ut{static create(r){const{discoveryApi:o,environment:c="development",provider:f=An}=r,k=new DirectAuthConnector({discoveryApi:o,environment:c,provider:f}),M=new StaticAuthSessionManager({connector:k}),H=new AuthSessionStore({manager:M,storageKey:`${f.id}Session`,schema:samlSessionSchema});return new Ut(H)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.backstageIdentity}async getProfile(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.profile}constructor(r){this.sessionManager=r}}const dn={id:"microsoft",title:"Microsoft",icon:()=>null};class un{static create(r){const{environment:o="development",provider:c=dn,oauthRequestApi:f,discoveryApi:k,defaultScopes:M=["openid","offline_access","profile","email","User.Read"]}=r;return kt.create({discoveryApi:k,oauthRequestApi:f,provider:c,environment:o,defaultScopes:M})}}const Sn={id:"onelogin",title:"onelogin",icon:()=>null},Tn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),pn="onelogin.";class ge{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Sn,oauthRequestApi:k}=r;return kt.create({discoveryApi:o,oauthRequestApi:k,provider:f,environment:c,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(M){return M.map(H=>Tn.has(H)||H.startsWith(pn)?H:`${pn}${H}`)}})}}const ee={id:"bitbucket",title:"Bitbucket",icon:()=>null};class Ae{static create(r){const{discoveryApi:o,environment:c="development",provider:f=ee,oauthRequestApi:k,defaultScopes:M=["team"]}=r;return kt.create({discoveryApi:o,oauthRequestApi:k,provider:f,environment:c,defaultScopes:M})}}const Ue={id:"atlassian",title:"Atlassian",icon:()=>null};class _e{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Ue,oauthRequestApi:k}=r;return kt.create({discoveryApi:o,oauthRequestApi:k,provider:f,environment:c})}}class et{post(r){this.subject.next(r)}alert$(){return this.subject}constructor(){this.subject=new Fe}}class Y{captureEvent(r){}}const O="theme";class ae{static createWithStorage(r){const o=new ae(r);if(!window.localStorage)return o;var c;const f=(c=window.localStorage.getItem(O))!==null&&c!==void 0?c:void 0;return o.setActiveThemeId(f),o.activeThemeId$().subscribe(k=>{k?window.localStorage.setItem(O,k):window.localStorage.removeItem(O)}),window.addEventListener("storage",k=>{if(k.key===O){var M;const H=(M=localStorage.getItem(O))!==null&&M!==void 0?M:void 0;o.setActiveThemeId(H)}}),o}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(r){this.activeThemeId=r,this.subject.next(r)}constructor(r){this.themes=r,this.subject=new bt(void 0)}}var We=t(9850),U=t.n(We),Z=t(12782),he=t.n(Z);const ye=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function be(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function De(a){if(a===null)return"null";if(Array.isArray(a))return"array";const r=typeof a;return r==="number"&&isNaN(a)?"nan":r==="string"&&a===""?"empty-string":r}const Oe={type(a,r,o,c){return`Invalid type in config for key '${a}' in '${r}', got ${o}, wanted ${c}`},missing(a){return`Missing required config value at '${a}'`},convert(a,r,o){return`Unable to convert config value for key '${a}' in '${r}' to a ${o}`}};class He{static fromConfigs(r){return r.length===0?new He(void 0):r.reduce((o,{data:c,context:f,filteredKeys:k,deprecatedKeys:M})=>{const H=new He(c,f,o);if(H.filteredKeys=k,M)for(const{key:re,description:Ve}of M)console.warn(`The configuration key '${re}' of ${f} is deprecated and may be removed soon. ${Ve||""}`);return H},void 0)}has(r){var o;if(this.readValue(r)!==void 0)return!0;var f;return(f=(o=this.fallback)===null||o===void 0?void 0:o.has(r))!==null&&f!==void 0?f:!1}keys(){var r;const o=this.data?Object.keys(this.data):[];var c;const f=(c=(r=this.fallback)===null||r===void 0?void 0:r.keys())!==null&&c!==void 0?c:[];return[...new Set([...o,...f])]}get(r){const o=this.getOptional(r);if(o===void 0)throw new Error(Oe.missing(this.fullKey(r!=null?r:"")));return o}getOptional(r){var o;const c=U()(this.readValue(r)),f=(o=this.fallback)===null||o===void 0?void 0:o.getOptional(r);if(c===void 0){if(!1)var k;return f}else if(f===void 0)return c;return he()({},{value:f},{value:c},(M,H)=>!be(H)||!be(M)?H:void 0).value}getConfig(r){const o=this.getOptionalConfig(r);if(o===void 0)throw new Error(Oe.missing(this.fullKey(r)));return o}getOptionalConfig(r){var o;const c=this.readValue(r),f=(o=this.fallback)===null||o===void 0?void 0:o.getOptionalConfig(r);if(be(c))return this.copy(c,r,f);if(c!==void 0)throw new TypeError(Oe.type(this.fullKey(r),this.context,De(c),"object"));return f}getConfigArray(r){const o=this.getOptionalConfigArray(r);if(o===void 0)throw new Error(Oe.missing(this.fullKey(r)));return o}getOptionalConfigArray(r){const o=this.readConfigValue(r,f=>{if(!Array.isArray(f))return{expected:"object-array"};for(const[k,M]of f.entries())if(!be(M))return{expected:"object-array",value:M,key:`${r}[${k}]`};return!0});if(!o){if(!1)var c;return}return o.map((f,k)=>this.copy(f,`${r}[${k}]`))}getNumber(r){const o=this.getOptionalNumber(r);if(o===void 0)throw new Error(Oe.missing(this.fullKey(r)));return o}getOptionalNumber(r){const o=this.readConfigValue(r,f=>typeof f=="number"||typeof f=="string"||{expected:"number"});if(typeof o=="number"||o===void 0)return o;const c=Number(o);if(!Number.isFinite(c))throw new Error(Oe.convert(this.fullKey(r),this.context,"number"));return c}getBoolean(r){const o=this.getOptionalBoolean(r);if(o===void 0)throw new Error(Oe.missing(this.fullKey(r)));return o}getOptionalBoolean(r){return this.readConfigValue(r,o=>typeof o=="boolean"||{expected:"boolean"})}getString(r){const o=this.getOptionalString(r);if(o===void 0)throw new Error(Oe.missing(this.fullKey(r)));return o}getOptionalString(r){return this.readConfigValue(r,o=>typeof o=="string"&&o!==""||{expected:"string"})}getStringArray(r){const o=this.getOptionalStringArray(r);if(o===void 0)throw new Error(Oe.missing(this.fullKey(r)));return o}getOptionalStringArray(r){return this.readConfigValue(r,o=>{if(!Array.isArray(o))return{expected:"string-array"};for(const[c,f]of o.entries())if(typeof f!="string"||f==="")return{expected:"string-array",value:f,key:`${r}[${c}]`};return!0})}fullKey(r){return`${this.prefix}${this.prefix?".":""}${r}`}copy(r,o,c){const f=new He(r,this.context,c,this.fullKey(o));return f.filteredKeys=this.filteredKeys,f}readConfigValue(r,o){const c=this.readValue(r);if(c===void 0){var f;if(!1)var k;return(f=this.fallback)===null||f===void 0?void 0:f.readConfigValue(r,o)}const M=o(c);if(M!==!0){const{key:H=r,value:re=c,expected:Ve}=M;throw new TypeError(Oe.type(this.fullKey(H),this.context,De(re),Ve))}return c}readValue(r){const o=r?r.split("."):[];for(const f of o)if(!ye.test(f))throw new TypeError(`Invalid config key '${r}'`);if(this.data===void 0)return;let c=this.data;for(const[f,k]of o.entries())if(be(c))c=c[k];else if(c!==void 0){const M=this.fullKey(o.slice(0,f).join("."));throw new TypeError(Oe.type(M,this.context,De(c),"object"))}return c}constructor(r,o="mock-config",c,f=""){this.data=r,this.context=o,this.fallback=c,this.prefix=f,this.notifiedFilteredKeys=new Set}}const qe="Invalid discovery URL pattern,";class b{static compile(r){const o=r.split(/\{\{\s*pluginId\s*\}\}/),c=o.join("pluginId");let f;try{f=new URL(c)}catch{throw new Error(`${qe} URL '${c}' is invalid`)}if(f.hash)throw new Error(`${qe} URL must not have a hash`);if(f.search)throw new Error(`${qe} URL must not have a query`);if(c.endsWith("/"))throw new Error(`${qe} URL must not end with a slash`);return new b(o)}async getBaseUrl(r){return this.parts.join(r)}constructor(r){this.parts=r}}class W{post(r,o){return o!=null&&o.hidden||this.alertApi.post({message:r.message,severity:"error"}),this.errorApi.post(r,o)}error$(){return this.errorApi.error$()}constructor(r,o){this.alertApi=r,this.errorApi=o}}class fe{post(r,o){this.subject.next({error:r,context:o})}error$(){return this.subject}constructor(){this.subject=new Fe}}class de{static forward(r,o){window.addEventListener("unhandledrejection",c=>{r.post(c.reason,o)})}}function Ce(a){if(a.length<3)throw new Error(`The '${a}' feature flag must have a minimum length of three characters.`);if(a.length>150)throw new Error(`The '${a}' feature flag must not exceed 150 characters.`);if(!a.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${a}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class Ie{registerFlag(r){Ce(r.name),this.registeredFeatureFlags.push(r)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(r){return this.flags||(this.flags=this.load()),this.flags.get(r)===y.CL.Active}save(r){this.flags||(this.flags=this.load()),r.merge||this.flags.clear();for(const[c,f]of Object.entries(r.states))this.flags.set(c,f);const o=Array.from(this.flags.entries()).filter(([,c])=>c===y.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(o)))}load(){try{const r=window.localStorage.getItem("featureFlags");if(!r)return new Map;const o=JSON.parse(r);if(typeof o!="object"||o===null||Array.isArray(o))return new Map;const c=Object.entries(o).filter(([f,k])=>(Ce(f),k===y.CL.Active));return new Map(c)}catch{return new Map}}constructor(){this.registeredFeatureFlags=[]}}function Ne(a){let r=a.baseImplementation||t.g.fetch;var o;const c=[(o=a.middleware)!==null&&o!==void 0?o:[]].flat().reverse();for(const f of c)r=f.apply(r);return{fetch:r}}class rt{static create(r){var o,c;const f=xt(r),k=((o=r.header)===null||o===void 0?void 0:o.name)||"authorization",M=((c=r.header)===null||c===void 0?void 0:c.value)||(H=>`Bearer ${H}`);return new rt(r.identityApi,f,k,M)}apply(r){return async(o,c)=>{const f=new Request(o,c),{token:k}=await this.identityApi.getCredentials();return f.headers.get(this.headerName)||typeof k!="string"||!k||!this.allowUrl(f.url)?r(o,c):(f.headers.set(this.headerName,this.headerValue(k)),r(f))}}constructor(r,o,c,f){this.identityApi=r,this.allowUrl=o,this.headerName=c,this.headerValue=f}}function xt(a){return a.allowUrl?a.allowUrl:a.urlPrefixAllowlist?vt(a.urlPrefixAllowlist):a.config?vt([a.config.getString("backend.baseUrl")]):()=>!1}function vt(a){const r=a.map(o=>o.replace(/\/$/,""));return o=>r.some(c=>o===c||o.startsWith(`${c}/`))}function st(a,r){return!r||r==="/"?a:`${a.replace(/\/$/,"")}/${r.replace(/^\//,"")}`}class pt{apply(r){return async(o,c)=>{const f=new Request(o,c),k="plugin://";if(!f.url.startsWith(k))return r(o,c);const{hostname:M,pathname:H,search:re,hash:Ve,username:ze,password:wt}=new URL(`http://${f.url.substring(k.length)}`);let ct=await this.discoveryApi.getBaseUrl(M);if(ze||wt){const Nt=new URL(ct),Yt=`${ze}${wt?`:${wt}`:""}@`;ct=`${Nt.protocol}//${Yt}${Nt.host}${Nt.pathname}`}const $t=`${st(ct,H)}${re}${Ve}`;return r($t,typeof o=="string"||At(o)?c:o)}}constructor(r){this.discoveryApi=r}}function At(a){return typeof a=="object"&&(a==null?void 0:a.constructor)===URL}class Et{static resolvePluginProtocol(r){return new pt(r.discoveryApi)}static injectIdentityAuth(r){return rt.create(r)}constructor(){}}function It(a,r){for(const o of r)if(!a.has(o))return!1;return!0}function Dt(a,...r){const o=new Set(a);for(const c of r)for(const f of c)o.add(f);return o}class In{request(r){return new Promise((o,c)=>{this.requests.push({scopes:r,resolve:o,reject:c}),this.subject.next(this.getCurrentPending())})}resolve(r,o){this.requests=this.requests.filter(c=>It(r,c.scopes)?(c.resolve(o),!1):!0),this.subject.next(this.getCurrentPending())}reject(r){this.requests.forEach(o=>o.reject(r)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const r=this.requests.length===0?void 0:this.requests.slice(1).reduce((o,c)=>Dt(o,c.scopes),this.requests[0].scopes);return{scopes:r,resolve:o=>{r&&this.resolve(r,o)},reject:o=>{r&&this.reject(o)}}}constructor(){this.requests=[],this.subject=new bt(this.getCurrentPending())}}class Dn{createAuthRequester(r){const o=new In,c=this.handlerCount;return this.handlerCount++,o.pending().subscribe({next:f=>{const k=this.currentRequests.slice(),M=this.makeAuthRequest(f,r);M?k[c]=M:delete k[c],this.currentRequests=k,this.subject.next(k.filter(Boolean))}}),f=>o.request(f)}makeAuthRequest(r,o){const{scopes:c}=r;if(!!c)return{provider:o.provider,trigger:async()=>{const f=await o.onAuthRequest(c);r.resolve(f)},reject:()=>{const f=new Error("Login failed, rejected by user");f.name="RejectedError",r.reject(f)}}}authRequest$(){return this.subject}constructor(){this.subject=new bt([]),this.currentRequests=[],this.handlerCount=0}}const Zt=new Map;class C{static create(r){var o;return new C((o=r.namespace)!==null&&o!==void 0?o:"",r.errorApi)}get(r){return this.snapshot(r).value}snapshot(r){let o,c="absent";try{const f=localStorage.getItem(this.getKeyName(r));f&&(o=JSON.parse(f,(k,M)=>(typeof M=="object"&&M!==null&&Object.freeze(M),M)),c="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${r}`))}return{key:r,value:o,presence:c}}forBucket(r){const o=`${this.namespace}/${r}`;return Zt.has(o)||Zt.set(o,new C(o,this.errorApi)),Zt.get(o)}async set(r,o){localStorage.setItem(this.getKeyName(r),JSON.stringify(o)),this.notifyChanges(r)}async remove(r){localStorage.removeItem(this.getKeyName(r)),this.notifyChanges(r)}observe$(r){return this.observable.filter(({key:o})=>o===r)}getKeyName(r){return`${this.namespace}/${encodeURIComponent(r)}`}notifyChanges(r){const o=this.snapshot(r);for(const c of this.subscribers)c.next(o)}constructor(r,o){this.namespace=r,this.errorApi=o,this.subscribers=new Set,this.observable=new(ie())(c=>(this.subscribers.add(c),()=>{this.subscribers.delete(c)}))}}var u=t(64279);function x(a){const r={};for(const c in a.collectors)a.collectors.hasOwnProperty(c)&&(r[c]=a.collectors[c]());const o=[{node:m.Children.toArray(a.root),parent:void 0,contexts:{}}];for(;o.length!==0;){const{node:c,parent:f,contexts:k}=o.shift();m.Children.forEach(c,M=>{if(!(0,m.isValidElement)(M))return;const H={};for(const re in r)if(r.hasOwnProperty(re)){const Ve=r[re];H[re]=Ve.visit(Ve.accumulator,M,f,k[re])}for(const re of a.discoverers){const Ve=re(M);Ve&&o.push({node:Ve,parent:M,contexts:H})}})}return Object.fromEntries(Object.entries(r).map(([c,f])=>[c,f.accumulator]))}function j(a,r){return()=>({accumulator:a(),visit:r})}function J(a){var r;return(r=a.props)===null||r===void 0?void 0:r.children}function xe(a){var r,o;if(((r=a.props)===null||r===void 0?void 0:r.path)&&((o=a.props)===null||o===void 0?void 0:o.element)){var c;return(c=a.props)===null||c===void 0?void 0:c.element}}const we=j(()=>new Set,(a,r)=>{const o=(0,y.IY)(r,"core.plugin");o&&a.add(o)}),$e=a=>{const{children:r}=a,o=(0,y.h_)(y.W0),c="with"in a?o.isActive(a.with):!o.isActive(a.without);return(0,n.jsx)(n.Fragment,{children:c?r:null})};(0,y.R5)($e,"core.featureFlagged",!0);const it={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function Bt(a){const r=a;if(r!=null&&r.type){var o,c;return(c=(o=r.type.displayName)!==null&&o!==void 0?o:r.type.name)!==null&&c!==void 0?c:String(r.type)}return String(r)}function hn(a,r=new Array){return m.Children.forEach(a,o=>{if(!(0,m.isValidElement)(o))return;const c=(0,y.IY)(o,"core.mountPoint");if(c){const f=(0,y.IY)(o,"core.plugin");r.push({routeRef:c,plugin:f})}hn(o.props.children,r)}),r}const Nn=j(()=>({paths:new Map,parents:new Map,objects:new Array}),(a,r,o,c)=>{var f,k;if(c!=null&&c.isElementAncestor)return c;if((o==null?void 0:o.props.element)===r)return{...c,isElementAncestor:!0};const M=(f=r.props)===null||f===void 0?void 0:f.path,H=(0,y.IY)(r,"core.mountPoint");if(H&&M)throw new Error(`Path property may not be set directly on a routable extension "${Bt(r)}"`);var re;const Ve=(re=c==null||(k=c.obj)===null||k===void 0?void 0:k.children)!==null&&re!==void 0?re:a.objects;if(M!==void 0){if(typeof M!="string")throw new Error(`Element path must be a string at "${Bt(r)}"`);const $t=M.startsWith("/")?M.slice(1):M,Nt=r.props.element;if((0,y.IY)(r,"core.gatherMountPoints")){var ze;if(Nt)throw new Error(`Mount point gatherers may not have an element prop "${Bt(r)}"`);const Yt={path:$t,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((ze=r.props)===null||ze===void 0?void 0:ze.caseSensitive),children:[it],plugin:void 0};return Ve.push(Yt),{obj:Yt,gatherPath:$t,routeRef:c==null?void 0:c.routeRef,gatherRouteRef:c==null?void 0:c.routeRef}}if(Nt){var wt;const[Yt,...an]=hn(Nt);if(an.length>0)throw new Error(`Route element with path "${M}" may not contain multiple routable extensions`);if(!Yt)return c;const{routeRef:Vn,plugin:Yn}=Yt,$n={path:$t,element:"mounted",routeRefs:new Set([Vn]),caseSensitive:Boolean((wt=r.props)===null||wt===void 0?void 0:wt.caseSensitive),children:[it],plugin:Yn};return Ve.push($n),a.paths.set(Vn,$t),a.parents.set(Vn,c==null?void 0:c.routeRef),{obj:$n,routeRef:Vn!=null?Vn:c==null?void 0:c.routeRef,gatherPath:$t,gatherRouteRef:c==null?void 0:c.gatherRouteRef}}}if(H){var ct;if((c==null?void 0:c.gatherPath)===void 0)throw new Error(`Routable extension "${Bt(r)}" with mount point "${H}" must be assigned a path`);return c==null||(ct=c.obj)===null||ct===void 0||ct.routeRefs.add(H),a.paths.set(H,c.gatherPath),a.parents.set(H,c==null?void 0:c.gatherRouteRef),{...c,routeRef:H}}return c}),mr=j(()=>({paths:new Map,parents:new Map,objects:new Array}),(a,r,o,c)=>{var f,k,M;if((o==null?void 0:o.props.element)===r)return c;let H=c==null?void 0:c.obj,re=c==null?void 0:c.routeRef,Ve=c==null?void 0:c.sticky;const ze=(f=r.props)===null||f===void 0?void 0:f.path;var wt;const ct=(wt=H==null?void 0:H.children)!==null&&wt!==void 0?wt:a.objects,$t=Boolean((k=r.props)===null||k===void 0?void 0:k.caseSensitive);let Nt=c==null?void 0:c.path;if((0,y.IY)(r,"core.gatherMountPoints")){if(!ze)throw new Error("Mount point gatherer must have a path");Nt=ze}const Yt=(M=r.props)===null||M===void 0?void 0:M.element;let an=(0,y.IY)(r,"core.mountPoint");if(!an&&(0,m.isValidElement)(Yt)&&(an=(0,y.IY)(Yt,"core.mountPoint")),an){let $n=ze;if(Nt&&($n?Nt=void 0:$n=Nt),!$n)throw new Error("Mounted routable extension must have a path");a.paths.set(an,$n),re&&Ve?(a.parents.set(an,re),ze&&(re=an,Ve=!1)):(a.parents.set(an,re),re=an),ze?(H={caseSensitive:$t,path:ze,element:"mounted",routeRefs:new Set([an]),children:[it],plugin:(0,y.IY)(r.props.element,"core.plugin")},ct.push(H)):H==null||H.routeRefs.add(an)}if((0,y.IY)(r,"core.gatherMountPoints")&&(Ve=!0),(0,y.IY)(r,"core.gatherMountPoints")){if(!ze)throw new Error("Mount point gatherer must have a path");if(!an){var Yn;H={caseSensitive:$t,path:ze,element:"gathered",routeRefs:new Set,children:[it],plugin:c==null||(Yn=c.obj)===null||Yn===void 0?void 0:Yn.plugin},ct.push(H)}}return{obj:H,path:Nt,routeRef:re,sticky:Ve}}),tn=j(()=>new Set,(a,r)=>{if(r.type===$e){const o=r.props;a.add("with"in o?o.with:o.without)}}),lr=(0,Je.uW)("route-ref-type",()=>Symbol("route-ref-type"));function vr(a){return a[lr]==="absolute"}function zr(a){return a[lr]==="sub"}function Vr(a){return a[lr]==="external"}function yr(...a){const r=a.join("/").replace(/\/\/+/g,"/");return r!=="/"&&r.endsWith("/")?r.slice(0,-1):r}function Wr(a,r,o){let c,f="";if(vr(a))c=a;else if(zr(a))c=a.parent,f=a.path;else if(Vr(a)){const H=o.get(a);if(!H)return[void 0,""];if(vr(H))c=H;else if(zr(H))c=H.parent,f=H.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${H}`)}else throw a[lr]?new Error(`Unknown or invalid route ref type, ${a[lr]}`):new Error(`Unknown object passed to useRouteRef, got ${a}`);if(!c)return[void 0,""];const k=r.get(c);if(k===void 0)return[void 0,""];const M=yr(k,f);return[c,M]}function Ir(a,r,o,c,f){var k;const M=(k=(0,V.fp)(f,r))!==null&&k!==void 0?k:[],H=Array();let re=-1;for(let wt=a;wt&&(re=M.findIndex(ct=>ct.route.routeRefs.has(wt)),re===-1);wt=c.get(wt))H.unshift(wt);H.length===0&&(re-=1);const Ve=re===-1?"":M[re].pathname,ze=H.slice(0,-1).map(wt=>{const ct=o.get(wt);if(ct===void 0)throw new Error(`No path for ${wt}`);if(ct.includes(":"))throw new Error(`Cannot route to ${a} with parent ${wt} as it has parameters`);return ct});return`${yr(Ve,...ze)}/`}class Rr{resolve(r,o){const[c,f]=Wr(r,this.routePaths,this.routeBindings);if(!c)return;let k;typeof o=="string"?k=this.trimPath(o):o.pathname?k={...o,pathname:this.trimPath(o.pathname)}:k=o;const M=this.appBasePath+Ir(c,k,this.routePaths,this.routeParents,this.routeObjects);return(...[re])=>yr(M,(0,V.Gn)(f,re))}trimPath(r){return r&&(r.startsWith(this.appBasePath)?r.slice(this.appBasePath.length):r)}constructor(r,o,c,f,k){this.routePaths=r,this.routeParents=o,this.routeObjects=c,this.routeBindings=f,this.appBasePath=k}}const rs=(0,Je.CT)("routing-context"),ss=({routePaths:a,routeParents:r,routeObjects:o,routeBindings:c,basePath:f="",children:k})=>{const M=new Rr(a,r,o,c,f),H=(0,Je.EI)({1:M});return(0,n.jsx)(rs.Provider,{value:H,children:k})},os=(a,r)=>{try{var o,c;const f=(0,V.fp)(r,{pathname:a}),k=(o=f==null?void 0:f.filter(H=>{var re;return((re=H==null?void 0:H.route.routeRefs)===null||re===void 0?void 0:re.size)>0}).pop())===null||o===void 0?void 0:o.route;if(!k)return{};let M;return k.routeRefs.size===1&&(M=k.routeRefs.values().next().value),{extension:"App",pluginId:((c=k.plugin)===null||c===void 0?void 0:c.getId())||"root",...M?{routeRef:M.id}:{}}}catch{return{}}},nr=({pathname:a,search:r,hash:o})=>{const c=(0,y.z$)();return(0,m.useEffect)(()=>{c.captureEvent("navigate",`${a}${r}${o}`)},[c,a,r,o]),null},kn=({routeObjects:a})=>{const{pathname:r,search:o,hash:c}=(0,V.TH)();return(0,n.jsx)(y.fC,{attributes:os(r,a),children:(0,n.jsx)(nr,{pathname:r,search:o,hash:c})})};function xr(a,r){const o=new Set(r.values());o.delete(void 0);for(const c of r.keys()){if(o.has(c))continue;let f=c,k="";for(;f;){const H=a.get(f);if(H===void 0)throw new Error(`No path for ${f}`);k=yr(H,k),f=r.get(f)}const M=k.match(/:(\w+)/g);if(M){for(let H=0;H<M.length;H++)for(let re=H+1;re<M.length;re++)if(M[re]===M[H])throw new Error(`Parameter ${M[re]} is duplicated in path ${k}`)}}}function br(a,r){for(const o of r)if(!!o.externalRoutes){for(const[c,f]of Object.entries(o.externalRoutes))if(!f.optional&&!a.has(f))throw new Error(`External route '${c}' of the '${o.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const Hr=(0,Je.CT)("app-context"),is=({appContext:a,children:r})=>{const o=(0,Je.EI)({1:a});return(0,n.jsx)(Hr.Provider,{value:o,children:r})};function cr(a){return new Error(`Tried to access IdentityApi ${a} before app was loaded`)}function Hn(a){console.warn(`WARNING: Call to ${a} is deprecated and will break in the future`)}class as{setTarget(r,o){this.target=r,this.signOutTargetUrl=o.signOutTargetUrl,this.resolveTarget(r)}getUserId(){if(!this.target)throw cr("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Hn("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw cr("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Hn("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(r=>r.getProfileInfo())}async getBackstageIdentity(){const r=await this.waitForTarget.then(o=>o.getBackstageIdentity());return r.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${r.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),r}async getCredentials(){return this.waitForTarget.then(r=>r.getCredentials())}async getIdToken(){return this.waitForTarget.then(r=>{if(!r.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return Hn("getIdToken"),r.getIdToken()})}async signOut(){await this.waitForTarget.then(r=>r.signOut()),location.href=this.signOutTargetUrl}constructor(){this.resolveTarget=()=>{},this.signOutTargetUrl="/",this.waitForTarget=new Promise(r=>{this.resolveTarget=r})}}var Gr=t(72164);function Fn(a,r,o){if(a!==void 0){const f=o.find(k=>k.id===a);if(f)return f}if(r){const f=o.find(k=>k.variant==="dark");if(f)return f}const c=o.find(f=>f.variant==="light");return c||o[0]}const Sr=()=>{const a=(0,m.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[r,o]=(0,m.useState)(a.matches);return(0,m.useEffect)(()=>{const c=f=>{o(f.matches)};return a.addListener(c),()=>{a.removeListener(c)}},[a]),r};function Cr({children:a}){const r=(0,y.h_)(y.hg),o=(0,Gr.Z)(r.activeThemeId$(),r.getActiveThemeId()),c=Boolean(window.matchMedia)?Sr():!1,f=Fn(o,c,r.getInstalledThemes());if(!f)throw new Error("App has no themes");return(0,n.jsx)(f.Provider,{children:a})}const ls=async(a="__APP_INJECTED_RUNTIME_CONFIG__")=>{const r=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!r)throw new Error("No static configuration provided");if(!Array.isArray(r))throw new Error("Static configuration has invalid format");const o=r.slice();if(a!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const f=JSON.parse(a);Array.isArray(f)?o.push(...f):o.push({data:f,context:"env"})}catch(f){throw new Error(`Failed to load runtime configuration, ${f}`)}const c=window.__APP_CONFIG__;return c&&o.push({context:"window",data:c}),o};class Lr{add(r,o){return this.apis.push([r.id,o]),o}build(){return new rr(new Map(this.apis))}constructor(){this.apis=[]}}class rr{static builder(){return new Lr}static from(r){return new rr(new Map(r.map(([o,c])=>[o.id,c])))}static with(r,o){return new rr(new Map([[r.id,o]]))}with(r,o){return new rr(new Map([...this.apis,[r.id,o]]))}get(r){return this.apis.get(r.id)}constructor(r){this.apis=r}}function cs(a){const r=new Map;return a&&a({bind:(c,f)=>{for(const[k,M]of Object.entries(f)){const H=c[k];if(!H)throw new Error(`Key ${k} is not an existing external route`);if(!M&&!H.optional)throw new Error(`External route ${k} is required but was undefined`);M&&r.set(H,M)}}}),r}function Kr(){const[a]=(0,V.is)((0,n.jsx)(V.AW,{index:!0,element:(0,n.jsx)("div",{})}));return!a.index}const wr=(0,m.createContext)({routeObjects:[]});function Pr(a){var r;let{pathname:o}=new URL((r=a.getOptionalString("app.baseUrl"))!==null&&r!==void 0?r:"/","http://dummy.dev");return o=o.replace(/\/*$/,""),o}function ds(a,r,o){const c=Boolean(a),f=(0,u.default)(a||(()=>Promise.resolve([])));let k;if(c&&f.loading){const{Progress:Ve}=r;k=(0,n.jsx)(Ve,{})}else if(f.error){const{BootErrorPage:Ve}=r;k=(0,n.jsx)(Ve,{step:"load-config",error:f.error})}const{ThemeProvider:M=Cr}=r;if(k)return{node:(0,n.jsx)(Ze,{apis:rr.with(y.hg,o),children:(0,n.jsx)(M,{children:k})})};var H;return{api:He.fromConfigs((H=f.value)!==null&&H!==void 0?H:[])}}class Yr{getPlugins(){return this.app.getPlugins()}getSystemIcon(r){return this.app.getSystemIcon(r)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(r){this.app=r}}class us{getPlugins(){return Array.from(this.plugins)}getSystemIcon(r){return this.icons[r]}getSystemIcons(){return this.icons}getComponents(){return this.components}getProvider(){const r=new Yr(this);let o=!1;return({children:f})=>{const k=(0,m.useMemo)(()=>ae.createWithStorage(this.themes),[]),{routing:M,featureFlags:H,routeBindings:re}=(0,m.useMemo)(()=>{const ct=x({root:f,discoverers:[J,xe],collectors:{routing:Kr()?mr:Nn,collectedPlugins:we,featureFlags:tn}});return ct.collectedPlugins.forEach($t=>this.plugins.add($t)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...ct,routeBindings:cs(this.bindRoutes)}},[f]);o||(o=!0,xr(M.paths,M.parents),br(re,this.plugins));const Ve=ds(this.configLoader,this.components,k),ze="api"in Ve;if(ze){const{api:ct}=Ve;this.configApi=ct}if((0,m.useEffect)(()=>{if(ze){const ct=this.getApiHolder().get(y.W0);for(const $t of this.plugins.values())if("getFeatureFlags"in $t)for(const Nt of $t.getFeatureFlags())ct.registerFlag({name:Nt.name,pluginId:$t.getId()});else for(const Nt of $t.output())Nt.type==="feature-flag"&&ct.registerFlag({name:Nt.name,pluginId:$t.getId()});for(const $t of H)ct.registerFlag({name:$t,pluginId:""})}},[ze,Ve,H]),"node"in Ve)return Ve.node;const{ThemeProvider:wt=Cr}=this.components;return(0,n.jsx)(Ze,{apis:this.getApiHolder(),children:(0,n.jsx)(is,{appContext:r,children:(0,n.jsx)(wt,{children:(0,n.jsx)(ss,{routePaths:M.paths,routeParents:M.parents,routeObjects:M.objects,routeBindings:re,basePath:Pr(Ve.api),children:(0,n.jsx)(wr.Provider,{value:{routeObjects:M.objects},children:f})})})})})}}getRouter(){const{Router:r,SignInPage:o}=this.components,c=({component:k,children:M})=>{const[H,re]=(0,m.useState)(),Ve=(0,y.h_)(y.Ds),ze=Pr(Ve);return H?(this.appIdentityProxy.setTarget(H,{signOutTargetUrl:ze||"/"}),M):(0,n.jsx)(k,{onSignInSuccess:re})};return({children:k})=>{const M=(0,y.h_)(y.Ds),H=Pr(M),re=`${H}/*`,{routeObjects:Ve}=(0,m.useContext)(wr);return o?(0,n.jsxs)(r,{children:[(0,n.jsx)(kn,{routeObjects:Ve}),(0,n.jsx)(c,{component:o,children:(0,n.jsx)(V.Z5,{children:(0,n.jsx)(V.AW,{path:re,element:(0,n.jsx)(n.Fragment,{children:k})})})})]}):(this.appIdentityProxy.setTarget({getUserId:()=>"guest",getIdToken:async()=>{},getProfile:()=>({email:"guest@example.com",displayName:"Guest"}),getProfileInfo:async()=>({email:"guest@example.com",displayName:"Guest"}),getBackstageIdentity:async()=>({type:"user",userEntityRef:"user:default/guest",ownershipEntityRefs:["user:default/guest"]}),getCredentials:async()=>({}),signOut:async()=>{}},{signOutTargetUrl:H||"/"}),(0,n.jsxs)(r,{children:[(0,n.jsx)(kn,{routeObjects:Ve}),(0,n.jsx)(V.Z5,{children:(0,n.jsx)(V.AW,{path:re,element:(0,n.jsx)(n.Fragment,{children:k})})})]}))}}getApiHolder(){if(this.apiHolder){for(const r of this.plugins)for(const o of r.getApis())this.apiFactoryRegistry.get(o.api)||this.apiFactoryRegistry.register("default",o);return ke.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:y.hg,deps:{},factory:()=>ae.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 Ie});for(const r of this.defaultApis)this.apiFactoryRegistry.register("default",r);for(const r of this.plugins)for(const o of r.getApis())if(!this.apiFactoryRegistry.register("default",o))throw new Error(`Plugin ${r.getId()} tried to register duplicate or forbidden API factory for ${o.api}`);for(const r of this.apis)if(!this.apiFactoryRegistry.register("app",r))throw new Error(`Duplicate or forbidden API factory for ${r.api} in app`);return ke.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new ke(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(r){const o=new Set;for(const c of r){const f=c.getId();if(o.has(f))throw new Error(`Duplicate plugin found '${f}'`);o.add(f)}}constructor(r){this.appIdentityProxy=new as;var o;this.apis=(o=r.apis)!==null&&o!==void 0?o:[],this.icons=r.icons;var c;this.plugins=new Set((c=r.plugins)!==null&&c!==void 0?c:[]),this.components=r.components,this.themes=r.themes;var f;this.configLoader=(f=r.configLoader)!==null&&f!==void 0?f:ls;var k;this.defaultApis=(k=r.defaultApis)!==null&&k!==void 0?k:[],this.bindRoutes=r.bindRoutes,this.apiFactoryRegistry=new at}}function hs(a){return new us(a)}let kr=!1;const ps=a=>{const r=(0,y.qD)(),{NotFoundErrorPage:o}=r.getComponents(),c=(0,m.useMemo)(()=>Kr(),[]),k=[...(0,y.vJ)(a.children,M=>M.getElements().flatMap(H=>{let re=H.props.path;if(re==="")return[];var Ve;re=(Ve=re==null?void 0:re.replace(/\/\*$/,""))!==null&&Ve!==void 0?Ve:"/";let ze=c?H:H.props.element;return!c&&!ze&&(ze=H,kr||(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] />} />."),kr=!0)),[{path:re,element:ze,children:H.props.children?[{path:re==="/"?"/":"*",element:H.props.children}]:void 0}]}).sort((H,re)=>re.path.localeCompare(H.path)).map(H=>({...H,path:H.path==="/"?"/":`${H.path}/*`}))),{path:"*",element:(0,n.jsx)(o,{})}];return(0,V.V$)(k)};var Or=t(25488);const fn=[(0,y.ni)({api:y.NW,deps:{configApi:y.Ds},factory:({configApi:a})=>b.compile(`${a.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,y.ni)({api:y.$v,deps:{},factory:()=>new et}),(0,y.ni)({api:y.v_,deps:{},factory:()=>new Y}),(0,y.ni)({api:y.VE,deps:{alertApi:y.$v},factory:({alertApi:a})=>{const r=new W(a,new fe);return de.forward(r,{hidden:!1}),r}}),(0,y.ni)({api:y.E6,deps:{errorApi:y.VE},factory:({errorApi:a})=>C.create({errorApi:a})}),(0,y.ni)({api:y.gP,deps:{configApi:y.Ds,identityApi:y.$4,discoveryApi:y.NW},factory:({configApi:a,identityApi:r,discoveryApi:o})=>Ne({middleware:[Et.resolvePluginProtocol({discoveryApi:o}),Et.injectIdentityAuth({identityApi:r,config:a})]})}),(0,y.ni)({api:y.ZM,deps:{},factory:()=>new Dn}),(0,y.ni)({api:y.Kp,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>jn.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.p_,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>un.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.F4,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>en.create({discoveryApi:a,oauthRequestApi:r,defaultScopes:["read:user"],environment:o.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.D,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Wn.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.ux,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Xt.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.gW,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>ge.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.bq,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Ae.create({discoveryApi:a,oauthRequestApi:r,defaultScopes:["team"],environment:o.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.uB,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>_e.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,y.ni)({api:Or.RV,deps:{discovery:y.NW,identity:y.$4,config:y.Ds},factory:({config:a,discovery:r,identity:o})=>Or.iM.create({config:a,discovery:r,identity:o})})];var Gn=t(77277),Ft=t(71399),sr=t(62833);function dr({children:a}){return(0,V.GV)()?(0,n.jsx)(n.Fragment,{children:a}):(0,n.jsx)(V.VA,{children:a})}const fs=()=>(0,n.jsx)(Ft.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),gs=({step:a,error:r})=>{let o="";return a==="load-config"?o=`The configuration failed to load, someone should have a look at this error: ${r.message}`:a==="load-chunk"&&(o=`Lazy loaded chunk failed to load, try to reload the page: ${r.message}`),(0,n.jsx)(dr,{children:(0,n.jsx)(Ft.mf,{status:"501",statusMessage:o})})},ms=({error:a,resetError:r,plugin:o})=>(0,n.jsx)(Ft.yu,{title:`Error in ${o==null?void 0:o.getId()}`,defaultExpanded:!0,error:a,children:(0,n.jsx)(Gn.Z,{variant:"outlined",onClick:r,children:"Retry"})}),Jr={Progress:Ft.Ex,Router:sr.VK,NotFoundErrorPage:fs,BootErrorPage:gs,ErrorBoundaryFallback:ms};var Qr=t(43642),jr=t(80079),Ns=t(90941),vs=t(32915),Xr=t(40562),ys=t(21853),Fs=t(60744),xs=t(66569),Us=t(30254),Ms=t(13384),bs=t(15933),Ss=t(58838),Cs=t(86737),qr=t(4989),v=t(44407),S=t(18628),A=t(84219),D=t(98685),G=t(39781);const K={brokenImage:jr.Z,catalog:S.Z,scaffolder:vs.Z,techdocs:Xr.Z,search:ys.Z,chat:Fs.Z,dashboard:xs.Z,docs:Us.Z,email:Ms.Z,github:Ss.Z,group:A.Z,help:Cs.Z,"kind:api":bs.Z,"kind:component":v.Z,"kind:domain":Qr.Z,"kind:group":A.Z,"kind:location":qr.Z,"kind:system":Ns.Z,"kind:user":D.Z,user:D.Z,warning:G.Z};var ce=t(73689),se=t(48032);const pe={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")`},je={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 Re(a){const{colors:r,shape:o,options:c}=a,k=`linear-gradient(90deg, ${(r.length===1?[r[0],r[0]]:r).join(", ")})`,M=`${o}, ${k}`;var H;const re=(H=c==null?void 0:c.fontColor)!==null&&H!==void 0?H:"#FFFFFF";return{colors:r,shape:o,backgroundImage:M,fontColor:re}}const Pe={home:Re({colors:je.teal,shape:pe.wave}),documentation:Re({colors:je.pinkSea,shape:pe.wave2}),tool:Re({colors:je.purpleSky,shape:pe.round}),service:Re({colors:je.marineBlue,shape:pe.wave}),website:Re({colors:je.veryBlue,shape:pe.wave}),library:Re({colors:je.rubyRed,shape:pe.wave}),other:Re({colors:je.darkGrey,shape:pe.wave}),app:Re({colors:je.toastyOrange,shape:pe.wave}),apis:Re({colors:je.teal,shape:pe.wave2}),card:Re({colors:je.greens,shape:pe.wave})},Qe=16,yt='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function St(a){const{palette:r,htmlFontSize:o=Qe,fontFamily:c=yt,defaultPageTheme:f,pageTheme:k=Pe}=a;if(!k[f])throw new Error(`${f} is not defined in pageTheme.`);var M;return{palette:r,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:o,fontFamily:c,h6:{fontWeight:700,fontSize:20,marginBottom:2},h5:{fontWeight:700,fontSize:24,marginBottom:4},h4:{fontWeight:700,fontSize:28,marginBottom:6},h3:{fontSize:32,fontWeight:700,marginBottom:6},h2:{fontSize:40,fontWeight:700,marginBottom:8},h1:{fontSize:54,fontWeight:700,marginBottom:10}},page:k[f],getPageTheme:({themeId:H})=>(M=k[H])!==null&&M!==void 0?M:k[f]}}function Xe(a){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:a.typography.fontFamily},body:{height:"100%",fontFamily:a.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:a.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:a.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:a.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:a.spacing(1.5,2,1.5,2.5)},head:{wordBreak:"break-word",overflow:"hidden",color:"rgb(179, 179, 179)",fontWeight:"normal",lineHeight:"1"}},MuiTabs:{root:{minHeight:24}},MuiTab:{root:{color:a.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,se.darken)(a.palette.link,.3),background:(0,se.lighten)(a.palette.link,.95)},[a.breakpoints.up("md")]:{minWidth:120,fontSize:a.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:a.palette.link}},MuiTableSortLabel:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"}},active:{fontWeight:"bold",color:"inherit"}},MuiListItemText:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},MuiButton:{text:{padding:void 0}},MuiChip:{root:{backgroundColor:"#D9D9D9",marginRight:a.spacing(1),marginBottom:a.spacing(1),color:a.palette.grey[900]},outlined:{color:a.palette.text.primary},label:{lineHeight:`${a.spacing(2.5)}px`,fontWeight:a.typography.fontWeightMedium,fontSize:`${a.spacing(1.75)}px`},labelSmall:{fontSize:`${a.spacing(1.5)}px`},deleteIcon:{color:a.palette.grey[500],width:`${a.spacing(3)}px`,height:`${a.spacing(3)}px`,margin:`0 ${a.spacing(.75)}px 0 -${a.spacing(.75)}px`},deleteIconSmall:{width:`${a.spacing(2)}px`,height:`${a.spacing(2)}px`,margin:`0 ${a.spacing(.5)}px 0 -${a.spacing(.5)}px`}},MuiCard:{root:{display:"flex",flexDirection:"column"}},MuiCardHeader:{root:{paddingBottom:0}},MuiCardContent:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}},MuiCardActions:{root:{justifyContent:"flex-end"}}}}function Ot(a){const r=St(a),o=(0,ce.Z)(r),c=Xe(o);return{...o,overrides:c}}var Wt=t(34505);const Jn=Ot({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:Wt.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:Pe}),On=Ot({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:Wt.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:Pe});var or=t(98192),gn=t(15222),mn=t(41547),Rn=t(87561);const Un=[{id:"light",title:"Light Theme",variant:"light",icon:(0,n.jsx)(gn.Z,{}),Provider:({children:a})=>(0,n.jsx)(mn.Z,{theme:Jn,children:(0,n.jsx)(Rn.ZP,{children:a})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,n.jsx)(or.Z,{}),Provider:({children:a})=>(0,n.jsx)(mn.Z,{theme:On,children:(0,n.jsx)(Rn.ZP,{children:a})})}];function $r(a){var r,o,c;return hs({...a,apis:(r=a==null?void 0:a.apis)!==null&&r!==void 0?r:[],bindRoutes:a==null?void 0:a.bindRoutes,components:{...Jr,...a==null?void 0:a.components},configLoader:a==null?void 0:a.configLoader,defaultApis:fn,icons:{...K,...a==null?void 0:a.icons},plugins:(o=a==null?void 0:a.plugins)!==null&&o!==void 0?o:[],themes:(c=a==null?void 0:a.themes)!==null&&c!==void 0?c:Un})}var Er=t(25271),vn=t(76635);async function Ln({storageApi:a}){const r=a.forBucket("settings"),o=a.forBucket("starredEntities"),c=r.snapshot("starredEntities").value;if(!(0,vn.isArray)(c))return;var f;const k=new Set((f=o.snapshot("entityRefs").value)!==null&&f!==void 0?f:[]);c.filter(vn.isString).map(M=>M.split(":")).filter(M=>M.length===4&&M[0]==="entity").map(([M,H,re,Ve])=>(0,Er.eE)({kind:H,namespace:re,name:Ve})).forEach(M=>k.add(M)),await o.set("entityRefs",Array.from(k)),await r.remove("starredEntities")}class Ar{async toggleStarred(r){this.starredEntities.has(r)?this.starredEntities.delete(r):this.starredEntities.add(r),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const r of this.subscribers)r.next(new Set(this.starredEntities))}constructor(r){this.subscribers=new Set,this.observable=new(ie())(c=>(c.next(new Set(this.starredEntities)),this.subscribers.add(c),()=>{this.subscribers.delete(c)})),Ln(r).then(),this.settingsStore=r.storageApi.forBucket("starredEntities");var o;this.starredEntities=new Set((o=this.settingsStore.snapshot("entityRefs").value)!==null&&o!==void 0?o:[]),this.settingsStore.observe$("entityRefs").subscribe({next:c=>{var f;this.starredEntities=new Set((f=c.value)!==null&&f!==void 0?f:[]),this.notifyChanges()}})}}var Wi=t(33414),Hi=t(79324),ur=t(79692),ii=t(65826);const Co=(0,ur.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",wordBreak:"break-all",marginBottom:"1rem"}});function ai(a){var r,o;const c=a.result,f=Co(),k=useAnalytics(),M=()=>{k.captureEvent("discover",c.title,{attributes:{to:c.location},value:a.rank})};return _jsxs(Link,{noTrack:!0,to:c.location,onClick:M,children:[_jsxs(ListItem,{alignItems:"flex-start",children:[a.icon&&_jsx(ListItemIcon,{children:a.icon}),_jsxs("div",{className:f.flexContainer,children:[_jsx(ListItemText,{className:f.itemText,primaryTypographyProps:{variant:"h6"},primary:!((r=a.highlight)===null||r===void 0)&&r.fields.title?_jsx(HighlightedSearchResultText,{text:a.highlight.fields.title,preTag:a.highlight.preTag,postTag:a.highlight.postTag}):c.title,secondary:!((o=a.highlight)===null||o===void 0)&&o.fields.text?_jsx(HighlightedSearchResultText,{text:a.highlight.fields.text,preTag:a.highlight.preTag,postTag:a.highlight.postTag}):c.text}),_jsxs(Box,{children:[c.kind&&_jsx(Chip,{label:`Kind: ${c.kind}`,size:"small"}),c.lifecycle&&_jsx(Chip,{label:`Lifecycle: ${c.lifecycle}`,size:"small"})]})]})]}),_jsx(Divider,{component:"li"})]})}var li=t(86359),yn=t(43297),ws=t(95544),ci=t(99688),js=t(12231),Br=t(86136),Es=t(49378),zs=t(85256),Vs=t(61837),Ws=t(79784),Hs=t(50758),wo=t(31654),jo=t(43054),As=t(65759),hr=t(51666);const Ts="catalog-entity",Eo=(0,hr.J$)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:Ts}),di=(0,hr.J$)({name:"catalog.entity.create",attributes:{action:"create"}}),Gs=(0,hr.J$)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:Ts}),Ao=(0,hr.J$)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:Ts}),Ks=(0,hr.J$)({name:"catalog.location.read",attributes:{action:"read"}}),To=(0,hr.J$)({name:"catalog.location.create",attributes:{action:"create"}}),Ys=(0,hr.J$)({name:"catalog.location.delete",attributes:{action:"delete"}}),ui=[Eo,di,Gs,Ao,Ks,To,Ys];var Js=t(49166);function Qs(a){const{unregisterEntityOptions:r,isUnregisterAllowed:o,onUnregisterEntity:c,onClose:f}=a,k=typeof(r==null?void 0:r.disableUnregister)=="boolean";var M;const H=(M=!o||(k?!!(r!=null&&r.disableUnregister):(r==null?void 0:r.disableUnregister)==="disable"))!==null&&M!==void 0?M:!1;let re=(0,n.jsx)(n.Fragment,{});return(r==null?void 0:r.disableUnregister)!=="hidden"&&(re=(0,n.jsxs)(js.Z,{onClick:()=>{f(),c()},disabled:H,children:[(0,n.jsx)(Br.Z,{children:(0,n.jsx)(Js.Z,{fontSize:"small"})}),(0,n.jsx)(Es.Z,{primary:"Unregister entity"})]})),(0,n.jsx)(n.Fragment,{children:re})}const Io=(0,ur.Z)(a=>({button:{color:a.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function hi(a){const{UNSTABLE_extraContextMenuItems:r,UNSTABLE_contextMenuOptions:o,onUnregisterEntity:c,onInspectEntity:f}=a,[k,M]=(0,m.useState)(),H=Io(),Ve=(0,yn.N$)(Gs).allowed,ze=Yt=>{M(Yt.currentTarget)},wt=()=>{M(void 0)},ct=(0,y.h_)(y.$v),$t=(0,m.useCallback)(()=>{navigator.clipboard.writeText(window.location.toString()).then(()=>ct.post({message:"Copied!",severity:"info"}))},[ct]),Nt=r&&[...r.map(Yt=>(0,n.jsxs)(js.Z,{onClick:()=>{wt(),Yt.onClick()},children:[(0,n.jsx)(Br.Z,{children:(0,n.jsx)(Yt.Icon,{fontSize:"small"})}),(0,n.jsx)(Es.Z,{primary:Yt.title})]},Yt.title)),(0,n.jsx)(zs.Z,{},"the divider is here!")];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Vs.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!k,role:"button",onClick:ze,"data-testid":"menu-button",className:H.button,id:"long-menu",children:(0,n.jsx)(jo.Z,{})}),(0,n.jsx)(Ws.ZP,{open:Boolean(k),onClose:wt,anchorEl:k,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,n.jsxs)(Hs.Z,{children:[Nt,(0,n.jsx)(Qs,{unregisterEntityOptions:o,isUnregisterAllowed:Ve,onUnregisterEntity:c,onClose:wt}),(0,n.jsxs)(js.Z,{onClick:()=>{wt(),f()},children:[(0,n.jsx)(Br.Z,{children:(0,n.jsx)(wo.Z,{fontSize:"small"})}),(0,n.jsx)(Es.Z,{primary:"Inspect entity"})]}),(0,n.jsxs)(js.Z,{onClick:()=>{wt(),$t()},children:[(0,n.jsx)(Br.Z,{children:(0,n.jsx)(As.Z,{fontSize:"small"})}),(0,n.jsx)(Es.Z,{primary:"Copy entity URL"})]})]})})]})}const Xs="plugin.catalog.entityLayoutRoute",_r=()=>null;(0,y.R5)(_r,Xs,!0),(0,y.R5)(_r,"core.gatherMountPoints",!0);function Ro(a){const{entity:r,title:o}=a;return(0,n.jsxs)(ws.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,n.jsx)(ws.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:o}),r&&(0,n.jsx)(yn.LH,{entity:r})]})}function Mn(a,r,o,c){var f;const k=(f=a!=null?a:c==null?void 0:c.kind)!==null&&f!==void 0?f:"";var M;const H=(M=r!=null?r:c==null?void 0:c.metadata.namespace)!==null&&M!==void 0?M:"";var re,Ve,ze;return{headerTitle:`${(ze=(Ve=(re=c==null?void 0:c.metadata.title)!==null&&re!==void 0?re:o)!==null&&Ve!==void 0?Ve:c==null?void 0:c.metadata.name)!==null&&ze!==void 0?ze:""}${H&&H!==Er.zG?` in ${H}`:""}`,headerType:(()=>{let ct=k.toLocaleLowerCase("en-US");return c&&c.spec&&"type"in c.spec&&(ct+=" \u2014 ",ct+=c.spec.type.toLocaleLowerCase("en-US")),ct})()}}function pi(a){var r;const{entity:o}=a,c=(0,yn.hF)(o,Er.S4);return(0,n.jsxs)(n.Fragment,{children:[c.length>0&&(0,n.jsx)(Ft.i9,{label:"Owner",value:(0,n.jsx)(yn.rI,{entityRefs:c,defaultKind:"Group",color:"inherit"})}),((r=o.spec)===null||r===void 0?void 0:r.lifecycle)&&(0,n.jsx)(Ft.i9,{label:"Lifecycle",value:o.spec.lifecycle})]})}const fi=a=>{var r,o;const{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,children:k,NotFoundComponent:M}=a,{kind:H,namespace:re,name:Ve}=(0,y.Oi)(yn.wi),{entity:ze,loading:wt,error:ct}=(0,yn.ce)(),$t=(0,V.TH)(),Nt=(0,y.vJ)(k,vo=>vo.selectByComponentData({key:Xs,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Tr})=>{if(ze){if(Tr.if&&!Tr.if(ze))return[]}else return[];return[{path:Tr.path,title:Tr.title,children:Tr.children,tabProps:Tr.tabProps}]}),[ze]),{headerTitle:Yt,headerType:an}=Mn(H,re,Ve,ze),[Vn,Yn]=(0,m.useState)(!1),[$n,ns]=(0,m.useState)(!1),mo=(0,V.s0)(),Xo=async()=>{Yn(!1),ns(!1),mo("/")};(0,m.useEffect)(()=>{Yn(!1),ns(!1)},[$t.pathname]);var Os;return(0,n.jsxs)(Ft.T3,{themeId:(Os=ze==null||(r=ze.spec)===null||r===void 0||(o=r.type)===null||o===void 0?void 0:o.toString())!==null&&Os!==void 0?Os:"home",children:[(0,n.jsx)(Ft.h4,{title:(0,n.jsx)(Ro,{title:Yt,entity:ze}),pageTitleOverride:Yt,type:an,children:ze&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(pi,{entity:ze}),(0,n.jsx)(hi,{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,onUnregisterEntity:()=>Yn(!0),onInspectEntity:()=>ns(!0)})]})}),wt&&(0,n.jsx)(Ft.Ex,{}),ze&&(0,n.jsx)(Ft.tn,{routes:Nt}),ct&&(0,n.jsx)(Ft.VY,{children:(0,n.jsx)(ci.Z,{severity:"error",children:ct.toString()})}),!wt&&!ct&&!ze&&(0,n.jsx)(Ft.VY,{children:M||(0,n.jsxs)(Ft.GB,{title:"Entity not found",children:["There is no ",H," with the requested"," ",(0,n.jsx)(Ft.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,n.jsx)(yn.pp,{open:Vn,entity:ze,onConfirm:Xo,onClose:()=>Yn(!1)}),(0,n.jsx)(yn.U_,{open:$n,entity:ze,onClose:()=>ns(!1)})]})};fi.Route=_r;var Gi=t(23054);function Ki(a){const{open:r,onClose:o,onConfirm:c,entity:f}=a,[k,M]=useState(!1),H=useApi(catalogApiRef),re=useApi(alertApiRef),Ve=async()=>{M(!0);try{const ze=f.metadata.uid;await H.removeEntityByUid(ze),c()}catch(ze){assertError(ze),re.post({message:ze.message})}finally{M(!1)}};return _jsxs(Dialog,{open:r,onClose:o,children:[_jsx(DialogTitle,{id:"responsive-dialog-title",children:"Are you sure you want to delete this entity?"}),_jsxs(DialogActions,{children:[_jsx(Button,{variant:"contained",color:"secondary",disabled:k,onClick:Ve,children:"Delete"}),_jsx(Button,{onClick:o,color:"primary",children:"Cancel"})]})]})}var Is=t(19625);function Yi(a){var r,o;return(a==null||(r=a.metadata)===null||r===void 0||(o=r.annotations)===null||o===void 0?void 0:o["backstage.io/orphan"])==="true"}function Ji(){const a=useNavigate(),r=useRouteRef(rootRouteRef),[o,c]=useState(!1),{entity:f}=useEntity(),k=async()=>{c(!1),a(r())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>c(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:o,entity:f,onConfirm:k,onClose:()=>c(!1)})]})}var gi=t(29644);const es=a=>a.error&&a.level==="error"&&a.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function Lo(a,r){return{items:(await r.getEntityAncestors({entityRef:a})).items.map(f=>{var k,M;return{errors:((M=(k=f.entity.status)===null||k===void 0?void 0:k.items)!==null&&M!==void 0?M:[]).filter(es).map(Ve=>Ve.error).filter(Ve=>Boolean(Ve)),entity:f.entity}}).filter(f=>f.errors.length>0)}}async function Qi(a,r){const o=r.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Lo(stringifyEntityRef(a),o)).items.length>0}function mi(){const{entity:a}=useEntity(),r=stringifyEntityRef(a),o=useApi(catalogApiRef),{loading:c,error:f,value:k}=useAsync(async()=>Lo(r,o),[r,o]);return f?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:f})}):c||!k?null:_jsx(_Fragment,{children:k.items.map((M,H)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(a)!==stringifyEntityRef(M.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:M.entity})]}),M.errors.map((re,Ve)=>_jsx(ResponseErrorPanel,{error:re},Ve))]},H))})}const _s="core.backstage.entitySwitch",ts=a=>null;(0,y.R5)(ts,_s,!0);const Po=a=>{var r;const{entity:o,loading:c}=(0,yn.ce)(),f=(0,y.I_)(),k=(0,y.vJ)(a.children,re=>re.selectByComponentData({key:_s,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(Ve=>{if(c)return[];const{if:ze,children:wt}=Ve.props;if(!o)return[{if:ze===void 0,children:wt}];var ct;return[{if:(ct=ze==null?void 0:ze(o,{apis:f}))!==null&&ct!==void 0?ct:!0,children:wt}]}),[f,o,c]);if(k.some(re=>typeof re.if=="object"&&"then"in re.if))return(0,n.jsx)(ko,{results:k});var H;return(H=(r=k.find(re=>re.if))===null||r===void 0?void 0:r.children)!==null&&H!==void 0?H:null};function ko({results:a}){const{loading:r,value:o}=(0,u.default)(async()=>{const c=a.map(async({if:k,children:M})=>{try{if(await k)return M}catch{}return null});var f;return(f=(await Promise.all(c)).find(Boolean))!==null&&f!==void 0?f:null},[a]);return r||!o?null:o}Po.Case=ts;const vi=null,eo=yn._i.Filters,zn=yn._i.Content,xn=(0,y.rx)({id:"catalog",apis:[(0,y.ni)({api:yn.Ah,deps:{discoveryApi:y.NW,fetchApi:y.gP},factory:({discoveryApi:a,fetchApi:r})=>new gi.MS({discoveryApi:a,fetchApi:r})}),(0,y.ni)({api:yn.p3,deps:{storageApi:y.E6},factory:({storageApi:a})=>new Ar({storageApi:a})})],routes:{catalogIndex:Is._Z,catalogEntity:yn.wi},externalRoutes:{createComponent:Is.yw,viewTechDoc:Is.jU},__experimentalConfigure(a){return{...{createButtonTitle:"Create"},...a}}}),Oo=xn.provide((0,y.P4)({name:"CatalogIndexPage",component:()=>t.e(5837).then(t.bind(t,95837)).then(a=>a.CatalogPage),mountPoint:Is._Z})),to=xn.provide((0,y.P4)({name:"CatalogEntityPage",component:()=>t.e(8951).then(t.bind(t,78951)).then(a=>a.CatalogEntityPage),mountPoint:yn.wi})),ir=xn.provide((0,y.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,33414)).then(a=>a.AboutCard)}})),yi=xn.provide((0,y.CO)({name:"EntityLinksCard",component:{lazy:()=>t.e(7750).then(t.bind(t,17750)).then(a=>a.EntityLinksCard)}})),$o=xn.provide((0,y.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>t.e(5458).then(t.bind(t,5458)).then(a=>a.HasSystemsCard)}})),xi=xn.provide((0,y.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>t.e(1105).then(t.bind(t,1105)).then(a=>a.HasComponentsCard)}})),Xi=xn.provide((0,y.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>t.e(2440).then(t.bind(t,82440)).then(a=>a.HasSubcomponentsCard)}})),Qn=xn.provide((0,y.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>t.e(9770).then(t.bind(t,79770)).then(a=>a.HasResourcesCard)}})),Bo=xn.provide((0,y.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>t.e(9545).then(t.bind(t,19545)).then(a=>a.DependsOnComponentsCard)}})),Rs=xn.provide((0,y.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>t.e(184).then(t.bind(t,40184)).then(a=>a.DependencyOfComponentsCard)}})),Zo=xn.provide((0,y.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>t.e(1032).then(t.bind(t,81032)).then(a=>a.DependsOnResourcesCard)}})),Ls=xn.provide((0,y.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>t.e(732).then(t.bind(t,732)).then(a=>a.RelatedEntitiesCard)}}));var Ps=t(32838);class no{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(r,o){const f=`${await this.getApiOrigin()}/${o}`,k=await fetch(`${f.endsWith("/")?f:`${f}/`}index.html`);if(k.status===404)throw new Error("Page not found");return k.text()}async syncEntityDocs(r){return"cached"}async getBaseUrl(r,o,c){const f=await this.getApiOrigin();return new URL(r,`${f}/${c}`).toString()}constructor({configApi:r,discoveryApi:o,identityApi:c}){this.configApi=r,this.discoveryApi=o,this.identityApi=c}}class ro{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(r){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(r){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:r,discoveryApi:o,identityApi:c}){this.configApi=r,this.discoveryApi=o,this.identityApi=c}}const Do=[(0,y.ni)({api:Se.Dl,deps:{configApi:y.Ds,discoveryApi:y.NW,identityApi:y.$4},factory:({configApi:a,discoveryApi:r,identityApi:o})=>new no({configApi:a,discoveryApi:r,identityApi:o})}),(0,y.ni)({api:Se.gT,deps:{configApi:y.Ds,discoveryApi:y.NW,identityApi:y.$4},factory:({configApi:a,discoveryApi:r,identityApi:o})=>new ro({configApi:a,discoveryApi:r,identityApi:o})}),(0,y.ni)({api:Ps.q3,deps:{configApi:y.Ds},factory:({configApi:a})=>Ps.ae.fromConfig(a)})],Zr={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},No={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function so(){const a=await fetch("/.detect");return a.ok?(await a.text()).trim()==="techdocs-cli-server":!1}async function Fo(){const a=await ls(),r=await so();return[...a,{context:"detected",data:r?Zr:No}]}var oo=t(86689),io=t(58845);const ao=(0,ur.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var lo=()=>{const a=ao();return(0,n.jsx)("svg",{className:a.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,n.jsx)("path",{className:a.path,d:"M302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Zm241-88.84q7.94,0,17.09.17t18.12,1a139.3,139.3,0,0,1,16.74,2.57,42.78,42.78,0,0,1,13.3,5.14,64.27,64.27,0,0,1,20.54,19.89Q662,168,662,186.54q0,19.54-9.49,33.78t-27.1,21.09v.68q22.78,4.82,34.87,20.58t12.08,38.4a72.62,72.62,0,0,1-4.83,26.06,65.29,65.29,0,0,1-14.33,22.46,71.57,71.57,0,0,1-23.47,15.78q-14,6-32.28,6H478.38V126.54Zm9,105.27q28,0,40.21-9.78t12.26-29.31q0-13-4.14-20.58a29.47,29.47,0,0,0-11.4-11.66A45,45,0,0,0,597,155.17a161.2,161.2,0,0,0-20.19-1.2h-65.6v77.84Zm16.57,112.13q21.74,0,34-11.66T639.59,300q0-12-4.48-19.88a34.85,34.85,0,0,0-11.91-12.52,50.14,50.14,0,0,0-17.09-6.52,105,105,0,0,0-20-1.88H511.17v84.7Zm274.79,26.74q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58A41.19,41.19,0,0,1,705,348.56q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.08-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7T736.6,249.29H707.26q.69-16.46,6.9-27.77a52.21,52.21,0,0,1,16.57-18.35,70,70,0,0,1,23.65-10.11A125.51,125.51,0,0,1,782.86,190a168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7A41.23,41.23,0,0,1,844,213.59q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-18,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.5,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14ZM1002.07,225q-11.05-9.25-29.69-9.26-15.89,0-26.58,5.83A47.29,47.29,0,0,0,928.71,237a64.66,64.66,0,0,0-9.15,22.12A119.83,119.83,0,0,0,916.8,285a98.22,98.22,0,0,0,2.93,24,64.18,64.18,0,0,0,9.15,20.74,46.2,46.2,0,0,0,16.23,14.58q10,5.49,23.82,5.48,21.75,0,34-11.31t15-31.89h30q-4.83,32.91-24.68,50.75t-54,17.83q-20.37,0-36.07-6.52A69.86,69.86,0,0,1,907,350.11a79.92,79.92,0,0,1-15.88-28.63A118.64,118.64,0,0,1,885.73,285a129.41,129.41,0,0,1,5.18-37.21,85.63,85.63,0,0,1,15.71-30.17A73.46,73.46,0,0,1,933,197.35Q948.91,190,970,190a108.54,108.54,0,0,1,28.48,3.6,69.59,69.59,0,0,1,23.48,11.15,61,61,0,0,1,16.74,19q6.55,11.49,8.29,27.26h-30.38Q1013.11,234.21,1002.07,225Zm109.77-98.41v145l81.47-77.49h39.36l-70.77,64.46,75.95,112.82h-37.29l-61.1-92.59-27.62,25.38v67.21H1082.5V126.54Zm170.54,205.22a31.07,31.07,0,0,0,10.87,10.63,49,49,0,0,0,15.19,5.66,87.06,87.06,0,0,0,17.44,1.71,109.18,109.18,0,0,0,14.5-1,53.22,53.22,0,0,0,14-3.78,26.27,26.27,0,0,0,10.53-8q4.14-5.32,4.14-13.55,0-11.31-8.63-17.14a73.69,73.69,0,0,0-21.58-9.43q-12.94-3.6-28.13-6.52a146,146,0,0,1-28.14-8.23A58.16,58.16,0,0,1,1261,267.13q-8.64-9.6-8.63-26.75,0-13.38,6-23a49.26,49.26,0,0,1,15.53-15.61,71.76,71.76,0,0,1,21.4-8.91A99.41,99.41,0,0,1,1319,190a141.31,141.31,0,0,1,28,2.58,64.85,64.85,0,0,1,22.62,8.91,46.16,46.16,0,0,1,15.7,17.15q5.87,10.8,6.91,26.91h-29.35q-.69-8.57-4.48-14.23a29.36,29.36,0,0,0-9.67-9.08,44.16,44.16,0,0,0-12.94-5,67.68,67.68,0,0,0-14.33-1.54,87.29,87.29,0,0,0-13.29,1,45.28,45.28,0,0,0-12.26,3.6,24.49,24.49,0,0,0-9,6.86q-3.46,4.29-3.46,11.14a16.32,16.32,0,0,0,5.36,12.52,42.75,42.75,0,0,0,13.63,8.23,120,120,0,0,0,18.64,5.48q10.37,2.24,20.72,4.63,11,2.4,21.57,5.83A70.74,70.74,0,0,1,1382,284.1a44.55,44.55,0,0,1,13.12,14.23q5,8.58,5,21.26,0,16.13-6.73,26.75a52.5,52.5,0,0,1-17.61,17.14,73.89,73.89,0,0,1-24.51,9.09,146.3,146.3,0,0,1-27.1,2.57,126.24,126.24,0,0,1-28.31-3.09A69.56,69.56,0,0,1,1272,361.94a51.74,51.74,0,0,1-16.57-18.52q-6.21-11.49-6.9-27.95h29.34A32.65,32.65,0,0,0,1282.38,331.76Zm226.46-137.67v25.72h-35.56V329.88a31.37,31.37,0,0,0,.87,8.23,8.42,8.42,0,0,0,3.28,4.8,14.61,14.61,0,0,0,6.73,2.23,99.19,99.19,0,0,0,11.22.51h13.46v25.72H1486.4a105.8,105.8,0,0,1-19.5-1.55,28.65,28.65,0,0,1-13.12-5.65,24.09,24.09,0,0,1-7.42-11.66q-2.43-7.54-2.42-19.89V219.81h-30.38V194.09h30.38V140.94h29.34v53.15ZM1699.4,370.68q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58,41.19,41.19,0,0,1-12.6-15.26q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.07-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7t-13.46,26.57h-29.34q.67-16.46,6.9-27.77A52.21,52.21,0,0,1,1562,203.17a70,70,0,0,1,23.65-10.11,125.51,125.51,0,0,1,28.48-3.09,168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7,41.23,41.23,0,0,1,15.53,14.89q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-17.95,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.51,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14Zm208.85,141.62q-20,21.6-62.83,21.6a122.11,122.11,0,0,1-25.37-2.74,78,78,0,0,1-23.48-8.92,54.41,54.41,0,0,1-17.43-16.11q-6.91-10-7.6-24.35h29.35a21.47,21.47,0,0,0,5,13.38,36.67,36.67,0,0,0,11.4,8.91,55.52,55.52,0,0,0,14.67,5,79.51,79.51,0,0,0,15.19,1.55q14.49,0,24.51-5A46,46,0,0,0,1840.59,401a56.53,56.53,0,0,0,9.49-21.09,117.46,117.46,0,0,0,2.94-27.09V341.19h-.7q-7.59,16.46-23,24.18a71.8,71.8,0,0,1-32.63,7.71q-20,0-34.86-7.2A72.88,72.88,0,0,1,1737,346.51a82.13,82.13,0,0,1-15-28.46,116.62,116.62,0,0,1-5-34.47,133.92,133.92,0,0,1,4.14-32.4A88.17,88.17,0,0,1,1735,221a75.49,75.49,0,0,1,25.55-22.29q15.87-8.75,39-8.75a66.21,66.21,0,0,1,31.07,7.38,52.13,52.13,0,0,1,22.09,22.11h.35V194.09h27.61V356.28Q1880.63,399.83,1860.61,421.43Zm-37.46-79.72a47.94,47.94,0,0,0,16.4-15.78,71.89,71.89,0,0,0,9.15-22.11,106.77,106.77,0,0,0,2.93-24.69,96.71,96.71,0,0,0-2.76-23,64,64,0,0,0-8.8-20.4,45.76,45.76,0,0,0-15.71-14.57q-9.66-5.49-23.47-5.49-14.16,0-24.17,5.32a46.77,46.77,0,0,0-16.4,14.23,60.14,60.14,0,0,0-9.32,20.57,99.69,99.69,0,0,0-2.93,24.35,120.63,120.63,0,0,0,2.42,24,67.5,67.5,0,0,0,8.28,21.77,46.37,46.37,0,0,0,15.54,15.78q9.66,6,24.16,6T1823.15,341.71Zm228,18.34q-20,15.09-50.41,15.09-21.4,0-37.11-6.86a73.16,73.16,0,0,1-26.41-19.2,81.52,81.52,0,0,1-16-29.49,141.12,141.12,0,0,1-6-37.38,106.1,106.1,0,0,1,6.21-37A88.56,88.56,0,0,1,1938.8,216a79.09,79.09,0,0,1,26.58-19.2A81.66,81.66,0,0,1,1999,190q23.82,0,39.53,9.78a78,78,0,0,1,25.2,24.86,98.18,98.18,0,0,1,13.12,32.91,140.6,140.6,0,0,1,2.93,34h-133.6a70,70,0,0,0,2.76,22.12,49.9,49.9,0,0,0,10,18.51A49.1,49.1,0,0,0,1976.6,345q10.7,4.82,25.2,4.8,18.65,0,30.55-8.57t15.71-26.06h29Q2071.18,345,2051.17,360.05Zm-7.08-113.84a50,50,0,0,0-10.7-16,53.1,53.1,0,0,0-56.62-10.63,47.48,47.48,0,0,0-15.71,10.81,51.69,51.69,0,0,0-10.35,15.94,60.18,60.18,0,0,0-4.49,19.37h102.53A59.47,59.47,0,0,0,2044.09,246.21ZM302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Z"})})};const ks=(0,ur.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Mo=()=>{const a=ks();return(0,n.jsx)("svg",{className:a.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,n.jsx)("path",{className:a.path,d:"M303,166.05a80.69,80.69,0,0,0,13.45-10.37c.79-.77,1.55-1.53,2.3-2.3a83.12,83.12,0,0,0,7.93-9.38A63.69,63.69,0,0,0,333,133.23a48.58,48.58,0,0,0,4.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56,0,78.3,115.23,0,190.25l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.22,49.22,0,0,0-6.8-8.87A89.17,89.17,0,0,0,259,178.29h.15a85.08,85.08,0,0,0,31-5.79A80.88,80.88,0,0,0,303,166.05ZM202.45,225.86c-19.32,18.51-50.4,21.23-75.7,5.9L51.61,186.15l67.45-64.64,76.41,46.38C223,184.58,221.49,207.61,202.45,225.86Zm8.93-82.22-70.65-42.89L205.14,39,274.51,81.1c25.94,15.72,29.31,37,10.55,55A60.69,60.69,0,0,1,211.38,143.64Zm29.86,190c-19.57,18.75-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,282.52v24.67L108.6,373.1a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.27,87.27,0,0,1,241.24,333.68Zm0-39c-19.57,18.75-46.17,29.08-74.88,29.08a123.81,123.81,0,0,1-64.1-18.19L0,243.53v24.68l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.5v-1.78A87.27,87.27,0,0,1,241.24,294.7Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.81,123.81,0,0,1-64.1-18.19L0,204.55v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.82A86.09,86.09,0,0,1,241.24,255.71Zm83.7,25.74a94.15,94.15,0,0,1-60.2,25.86h0V334a81.6,81.6,0,0,0,51.74-22.37c14-13.38,21.14-28.11,21-42.64v-2.19A94.92,94.92,0,0,1,324.94,281.45Zm-83.7,91.21c-19.57,18.76-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,321.5v24.68l108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A86.29,86.29,0,0,1,241.24,372.66ZM327,162.45c-.68.69-1.35,1.38-2.05,2.06a94.37,94.37,0,0,1-10.64,8.65,91.35,91.35,0,0,1-11.6,7,94.53,94.53,0,0,1-26.24,8.71,97.69,97.69,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a53.27,53.27,0,0,1,1.14,12V217h.05a84.41,84.41,0,0,0,25.35-5.55,81,81,0,0,0,26.39-16.82c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,172.17a48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08,1.54-2.25,3.09A96.73,96.73,0,0,1,327,162.45Zm0,77.92c-.69.7-1.31,1.41-2,2.1a94.2,94.2,0,0,1-60.2,25.86h0l0,26.67h0a81.6,81.6,0,0,0,51.74-22.37A73.51,73.51,0,0,0,333,250.13a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74,1.07-1.46,2.15-2.27,3.21A95.68,95.68,0,0,1,327,240.37Zm0-39c-.69.7-1.31,1.41-2,2.1a93.18,93.18,0,0,1-10.63,8.65,91.63,91.63,0,0,1-11.63,7,95.47,95.47,0,0,1-37.94,10.18h0V256h0a81.65,81.65,0,0,0,51.74-22.37c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,211.15a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.46,2.16-2.27,3.22A95.68,95.68,0,0,1,327,201.39Z"})})};const zo=(0,ur.Z)({root:{width:Ft.po.drawerWidthClosed,height:3*Ft.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:Ft.po.drawerWidthClosed,marginLeft:24}}),Vo=()=>{const a=zo(),{isOpen:r}=(0,Ft.mZ)();return(0,n.jsx)("div",{className:a.root,children:(0,n.jsx)(oo.Z,{component:sr.OL,to:"/docs/default/component/local/",underline:"none",className:a.link,children:r?(0,n.jsx)(lo,{}):(0,n.jsx)(Mo,{})})})},Wo=({children:a})=>(0,n.jsxs)(Ft.tR,{children:[(0,n.jsxs)(Ft.YE,{children:[(0,n.jsx)(Vo,{}),(0,n.jsx)(Ft.v7,{}),(0,n.jsx)(Ft.R6,{icon:io.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),a]});var Ho=t(80030),Go=t(32388),co=t(4142);const uo=(0,ur.Z)(a=>({headerIcon:{color:a.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:a.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var Kn;(function(a){a.LIGHT="light",a.DARK="dark"})(Kn||(Kn={}));const Ko=()=>{const a=(0,y.h_)(y.hg),r=uo(),[o,c]=(0,m.useState)(a.getActiveThemeId()===Kn.DARK?Kn.DARK:Kn.LIGHT),f={[Kn.LIGHT]:{icon:co.Z,title:"Dark theme"},[Kn.DARK]:{icon:Go.Z,title:"Light theme"}},{title:k,icon:M}=f[o],H=()=>{c(re=>{const Ve=re===Kn.LIGHT?Kn.DARK:Kn.LIGHT;return a.setActiveThemeId(Ve),Ve})};return(0,n.jsx)(ws.Z,{display:"flex",alignItems:"center",mr:2,children:(0,n.jsx)(Ho.ZP,{title:k,arrow:!0,children:(0,n.jsx)(Vs.Z,{size:"small",onClick:H,children:(0,n.jsx)(M,{className:r.headerIcon})})})})},Yo=()=>(0,n.jsxs)(T.I6,{children:[(0,n.jsx)(F.S,{}),(0,n.jsx)(X.F,{withSearch:!1})]}),ho=(0,n.jsx)(Yo,{}),po=$r({apis:Do,configLoader:Fo,plugins:Object.values(h)}),fo=po.getProvider(),Pn=po.getRouter(),Jo=T.s4.provide((0,Se.KY)({name:"ThemeToggleAddon",component:Ko,location:Se.oZ.Header})),Qo=(0,n.jsxs)(ps,{children:[(0,n.jsx)(V.Fg,{to:"/docs/default/component/local/"},"/"),(0,n.jsx)(V.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,n.jsx)(to,{})}),(0,n.jsx)(V.AW,{path:"/docs",element:(0,n.jsx)(T.Jl,{}),children:(0,n.jsx)(I.u,{})}),(0,n.jsxs)(V.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,n.jsx)(T.I6,{}),children:[ho,(0,n.jsx)(Se.DR,{children:(0,n.jsx)(Jo,{})})]})]});var go=()=>(0,n.jsx)(fo,{children:(0,n.jsx)(Pn,{children:(0,n.jsx)(Wo,{children:Qo})})});R.render((0,n.jsx)(go,{}),document.getElementById("root"))},51837:function(jt,Me,t){"use strict";t.d(Me,{CT:function(){return y},EI:function(){return ne},uW:function(){return R},Vt:function(){return l}});function h(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const n=h(),m=q=>`__@backstage/${q}__`;function R(q,_){const F=m(q);let X=n[F];return X||(X=_(),n[F]=X,X)}var V=t(2784);function y(q){return R(q,()=>(0,V.createContext)(void 0))}function l(q){return(0,V.useContext)(y(q))}function P(q){return{set(_){globalThis[`__@backstage/${q}__`]=createContext(createVersionedValueMap(_))},reset(){delete globalThis[`__@backstage/${q}__`]}}}function ne(q){return Object.freeze(q),{atVersion(_){return q[_]}}}},43297:function(jt,Me,t){"use strict";t.d(Me,{h$:function(){return en},n3:function(){return h.n3},_i:function(){return $},zo:function(){return Te},tW:function(){return U},df:function(){return de},UO:function(){return An},dq:function(){return rt},nl:function(){return Cs},dx:function(){return at},rI:function(){return lt},u3:function(){return It},xE:function(){return Zt},sL:function(){return C},LH:function(){return we},U_:function(){return fs},pp:function(){return Ns},EW:function(){return Us},Ah:function(){return m},wi:function(){return ft},hF:function(){return gt},CV:function(){return Be},$3:function(){return ke},p3:function(){return R},ce:function(){return ln},X2:function(){return Xt},wp:function(){return Ut},ZW:function(){return et},N$:function(){return O},eK:function(){return pn},CR:function(){return Ae}});var h=t(29644),n=t(25248);const m=(0,n.T0)({id:"plugin.catalog.service"}),R=(0,n.T0)({id:"catalog-react.starred-entities"});var V=t(82394);class y{async toggleStarred(S){this.starredEntities.delete(S)||this.starredEntities.add(S);for(const A of this.subscribers)A.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){this.starredEntities=new Set,this.subscribers=new Set,this.observable=new ObservableImpl(S=>(S.next(new Set(this.starredEntities)),this.subscribers.add(S),()=>{this.subscribers.delete(S)}))}}var l=t(52322),P=t(2784),ne=t(41156),q=t(60364),_=t(77277),F=t(4190),X=t(95544),Q=t(90436),ue=t(60905),le=t(36444);const L=v=>{const S=(0,ne.Z)(K=>K.breakpoints.down("md")),A=(0,q.Z)(),[D,G]=(0,P.useState)(!1);return S?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(_.Z,{style:{marginTop:A.spacing(1),marginLeft:A.spacing(1)},onClick:()=>G(!0),startIcon:(0,l.jsx)(le.Z,{}),children:"Filters"}),(0,l.jsx)(F.ZP,{open:D,onClose:()=>G(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,l.jsxs)(X.Z,{m:2,children:[(0,l.jsx)(Q.Z,{variant:"h6",component:"h2",style:{marginBottom:A.spacing(1)},children:"Filters"}),v.children]})})]}):(0,l.jsx)(ue.Z,{item:!0,lg:2,children:v.children})},I=v=>(0,l.jsx)(ue.Z,{item:!0,xs:12,lg:10,children:v.children}),$=v=>(0,l.jsx)(ue.Z,{container:!0,style:{position:"relative"},children:v.children});$.Filters=L,$.Content=I;var E=t(71399),T=t(82108),te=t.n(T),Se=t(829),Ke=t.n(Se),Ge=t(64279),Ee=t(25271),Je=t(51837);const ft=(0,Je.uW)("catalog:entity-route-ref",()=>(0,n.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function Ze(v){var S,A;return{kind:v.kind.toLocaleLowerCase("en-US"),namespace:(A=(S=v.metadata.namespace)===null||S===void 0?void 0:S.toLocaleLowerCase("en-US"))!==null&&A!==void 0?A:DEFAULT_NAMESPACE,name:v.metadata.name}}function ke(v,S){const A=S==null?void 0:S.defaultKind;let D,G,K;return"metadata"in v?(D=v.kind,G=v.metadata.namespace,K=v.metadata.name):(D=v.kind,G=v.namespace,K=v.name),(G===void 0||G==="")&&(G=Ee.zG),(S==null?void 0:S.defaultNamespace)!==void 0?(S==null?void 0:S.defaultNamespace)===G&&(G=void 0):G===Ee.zG&&(G=void 0),D=D.toLocaleLowerCase("en-US"),D=A&&A.toLocaleLowerCase("en-US")===D?void 0:D,`${D?`${D}:`:""}${G?`${G}/`:""}${K}`}var nt=t(80030);const at=(0,P.forwardRef)((v,S)=>{const{entityRef:A,defaultKind:D,title:G,children:K,...ce}=v,se=(0,n.tg)(ft);let pe,je,Re;if(typeof A=="string"){const Xe=(0,Ee.of)(A);pe=Xe.kind,je=Xe.namespace,Re=Xe.name}else"metadata"in A?(pe=A.kind,je=A.metadata.namespace,Re=A.metadata.name):(pe=A.kind,je=A.namespace,Re=A.name);pe=pe.toLocaleLowerCase("en-US");var Pe;je=(Pe=je==null?void 0:je.toLocaleLowerCase("en-US"))!==null&&Pe!==void 0?Pe:Ee.zG;const Qe={kind:pe,namespace:je,name:Re},yt=ke({kind:pe,namespace:je,name:Re},{defaultKind:D}),St=(0,l.jsxs)(E.rU,{...ce,ref:S,to:se(Qe),children:[K,!K&&(G!=null?G:yt)]});return G?(0,l.jsx)(nt.ZP,{title:yt,children:St}):St});function ut(v){const{entityRefs:S,defaultKind:A,getTitle:D,...G}=v,K=(0,n.h_)(m),{value:ce=new Array,loading:se,error:pe}=(0,Ge.default)(async()=>{const je=S.reduce((Pe,Qe)=>"metadata"in Qe?Pe:[...Pe,(0,Ee.of)(Qe)],new Array),Re=S.filter(Pe=>"metadata"in Pe);return je.length>0?[...(await K.getEntities({filter:je.map(Pe=>({kind:Pe.kind,"metadata.namespace":Pe.namespace,"metadata.name":Pe.name}))})).items,...Re]:Re},[S]);return se?(0,l.jsx)(E.Ex,{}):pe?(0,l.jsx)(E.yu,{error:pe}):(0,l.jsx)(l.Fragment,{children:ce.map((je,Re)=>(0,l.jsxs)(P.Fragment,{children:[Re>0&&", ",(0,l.jsx)(at,{...G,defaultKind:A,entityRef:je,title:D(je)})]},Re))})}function lt(v){const{entityRefs:S,defaultKind:A,fetchEntities:D,getTitle:G,...K}=v;return D?(0,l.jsx)(ut,{...K,defaultKind:A,entityRefs:S,getTitle:G}):(0,l.jsx)(l.Fragment,{children:S.map((ce,se)=>(0,l.jsxs)(P.Fragment,{children:[se>0&&", ",(0,l.jsx)(at,{...K,defaultKind:A,entityRef:ce,title:G?G(ce):void 0})]},se))})}function ot(v){return v.reduce((S,A)=>({...S,...A.getCatalogFilters?A.getCatalogFilters():{}}),{})}function dt(v){return S=>v.every(A=>!A.filterEntity||A.filterEntity(S))}function gt(v,S,A){var D;let G=(v==null||(D=v.relations)===null||D===void 0?void 0:D.filter(K=>K.type===S).map(K=>(0,Ee.of)(K.targetRef)))||[];return A!=null&&A.kind&&(G=G.filter(K=>K.kind.toLocaleLowerCase("en-US")===A.kind.toLocaleLowerCase("en-US"))),G}function Be(v,S){var A;const D=(A=v.metadata.annotations)===null||A===void 0?void 0:A[Ee.M6];if(!!D)try{const G=(0,Ee.Ou)(D),K=S.byUrl(G.target);return{locationTargetUrl:G.target,integrationType:K==null?void 0:K.type}}catch{return}}function ie(v,S){const A=new Set([...getEntityRelations(v,RELATION_MEMBER_OF,{kind:"group"}),...v?[getCompoundEntityRef(v)]:[]].map(stringifyEntityRef)),D=getEntityRelations(S,RELATION_OWNED_BY).map(stringifyEntityRef);for(const G of D)if(A.has(G))return!0;return!1}class Te{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(S){this.value=S}}class Fe{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(S){this.value=S}}class mt{filterEntity(S){var A;return this.values.every(D=>((A=S.metadata.tags)!==null&&A!==void 0?A:[]).includes(D))}toQueryValue(){return this.values}constructor(S){this.values=S}}class bt{filterEntity(S){const A=this.toUpperArray(this.value.split(/\s/)),D=this.toUpperArray([S.metadata.tags]),G=this.toUpperArray([S.metadata.name,S.metadata.title]);for(const K of A)if(D.every(ce=>ce!==K)&&G.every(ce=>!ce.includes(K)))return!1;return!0}toUpperArray(S){return S.flat().filter(A=>Boolean(A)).map(A=>A.toLocaleUpperCase("en-US"))}constructor(S){this.value=S}}class Pt{filterEntity(S){return this.values.some(A=>gt(S,Ee.S4).some(D=>ke(D,{defaultKind:"group"})===A))}toQueryValue(){return this.values}constructor(S){this.values=S}}class ht{filterEntity(S){return this.values.some(A=>{var D;return((D=S.spec)===null||D===void 0?void 0:D.lifecycle)===A})}toQueryValue(){return this.values}constructor(S){this.values=S}}class Ct{filterEntity(S){switch(this.value){case"owned":return this.isOwnedEntity(S);case"starred":return this.isStarredEntity(S);default:return!0}}toQueryValue(){return this.value}constructor(S,A,D){this.value=S,this.isOwnedEntity=A,this.isStarredEntity=D}}class Tt{filterEntity(S){var A;const D=(A=S.metadata.annotations)===null||A===void 0?void 0:A["backstage.io/orphan"];return D!==void 0&&this.value.toString()===D}constructor(S){this.value=S}}class kt{filterEntity(S){var A,D;const G=(S==null||(A=S.status)===null||A===void 0||(D=A.items)===null||D===void 0?void 0:D.length)>0;return G!==void 0&&this.value===G}constructor(S){this.value=S}}const _t=(0,Je.CT)("entity-context"),en=({children:v,entity:S,loading:A,error:D,refresh:G})=>{const K={entity:S,loading:A,error:D,refresh:G};return(0,l.jsx)(_t.Provider,{value:(0,Je.EI)({1:K}),children:v})},Kt=v=>_jsx(en,{entity:v.entity,loading:!Boolean(v.entity),error:void 0,refresh:void 0,children:v.children});function Xt(){const v=(0,Je.Vt)("entity-context");if(!v)throw new Error("Entity context is not available");const S=v.atVersion(1);if(!S)throw new Error("EntityContext v1 not available");if(!S.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:S.entity}}function ln(){const v=(0,Je.Vt)("entity-context");if(!v)throw new Error("Entity context is not available");const S=v.atVersion(1);if(!S)throw new Error("EntityContext v1 not available");const{entity:A,loading:D,error:G,refresh:K}=S;return{entity:A,loading:D,error:G,refresh:K}}var qt=t(76635),jn=t(19126),on=t.n(jn),En=t(10289),cn=t(69294),Wn=t(48760),Vt=t(90736);const bn=(0,P.createContext)(void 0),An=({children:v})=>{const S=(0,Vt.default)(),A=(0,n.h_)(m),[D,G]=(0,P.useState)({}),K=(0,En.TH)();var ce;const se=(0,P.useMemo)(()=>(ce=on().parse(K.search,{ignoreQueryPrefix:!0}).filters)!==null&&ce!==void 0?ce:{},[K]),[pe,je]=(0,P.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:Re,error:Pe},Qe]=(0,cn.default)(async()=>{const Xe=(0,qt.compact)(Object.values(D)),Ot=dt(Xe),Wt=ot(Xe),Jn=ot((0,qt.compact)(Object.values(pe.appliedFilters))),On=Object.keys(D).reduce((gn,mn)=>{const Rn=D[mn];return Rn!=null&&Rn.toQueryValue&&(gn[mn]=Rn.toQueryValue()),gn},{});if((0,qt.isEqual)(Jn,Wt))je({appliedFilters:D,backendEntities:pe.backendEntities,entities:pe.backendEntities.filter(Ot)});else{const gn=await A.getEntities({filter:Wt});je({appliedFilters:D,backendEntities:gn.items,entities:gn.items.filter(Ot)})}if(S()){var or;const gn=on().parse(K.search,{ignoreQueryPrefix:!0}),mn=on().stringify({...gn,filters:On},{addQueryPrefix:!0,arrayFormat:"repeat"}),Rn=`${window.location.pathname}${mn}`;(or=window.history)===null||or===void 0||or.replaceState(null,document.title,Rn)}},[A,se,D,pe],{loading:!0});(0,Wn.Z)(Qe,10,[D]);const yt=(0,P.useCallback)(Xe=>{G(Ot=>{const Wt=typeof Xe=="function"?Xe(Ot):Xe;return{...Ot,...Wt}})},[]),St=(0,P.useMemo)(()=>({filters:pe.appliedFilters,entities:pe.entities,backendEntities:pe.backendEntities,updateFilters:yt,queryParameters:se,loading:Re,error:Pe}),[pe,yt,se,Re,Pe]);return(0,l.jsx)(bn.Provider,{value:St,children:v})};function Ut(){const v=(0,P.useContext)(bn);if(!v)throw new Error("useEntityList must be used within EntityListProvider");return v}var dn=t(18149),un=t.n(dn);function Sn(){const v=(0,n.h_)(m),{filters:{kind:S,type:A},queryParameters:{type:D},updateFilters:G}=Ut(),K=(0,P.useMemo)(()=>[D].flat().filter(Boolean),[D]);var ce;const[se,pe]=(0,P.useState)(K.length?K:(ce=A==null?void 0:A.getTypes())!==null&&ce!==void 0?ce:[]);(0,P.useEffect)(()=>{K.length&&pe(K)},[K]);const[je,Re]=(0,P.useState)([]),Pe=(0,P.useMemo)(()=>S==null?void 0:S.value,[S]),{error:Qe,loading:yt,value:St}=(0,Ge.default)(async()=>Pe?await v.getEntityFacets({filter:{kind:Pe},facets:["spec.type"]}).then(Wt=>Wt.facets["spec.type"]||[]):[],[Pe,v]),Xe=(0,P.useRef)(St);return(0,P.useEffect)(()=>{const Ot=Xe.current;if(Xe.current=St,yt||!Pe||Ot===St||!St)return;const Wt=[...new Set(Ke()(St,On=>-On.count).map(On=>On.value.toLocaleLowerCase("en-US")))];Re(Wt);const Jn=se.filter(On=>Wt.includes(On));un()(se,Jn)||pe(Jn)},[yt,Pe,se,pe,St]),(0,P.useEffect)(()=>{G({type:se.length?new Fe(se):void 0})},[se,G]),{loading:yt,error:Qe,availableTypes:je,selectedTypes:se,setSelectedTypes:pe}}const Tn=20;function pn(v,S){var A,D;const G=S==null||(A=S.type)===null||A===void 0?void 0:A.toLocaleLowerCase("en-US"),K=S==null||(D=S.kind)===null||D===void 0?void 0:D.toLocaleLowerCase("en-US"),ce=(0,n.h_)(m),{loading:se,value:pe,error:je}=(0,Ge.default)(async()=>{var Re;const Pe=(Re=v.relations)===null||Re===void 0?void 0:Re.map(Xe=>({type:Xe.type,target:(0,Ee.of)(Xe.targetRef)})).filter(Xe=>(!G||Xe.type.toLocaleLowerCase("en-US")===G)&&(!K||Xe.target.kind===K));if(!Pe)return[];const Qe=Object.values((0,qt.groupBy)(Pe,({target:Xe})=>`${Xe.kind}:${Xe.namespace}`.toLocaleLowerCase("en-US"))),yt=[];for(const Xe of Qe)yt.push({kind:Xe[0].target.kind,namespace:Xe[0].target.namespace,nameBatches:(0,qt.chunk)(Xe.map(Ot=>Ot.target.name),Tn)});return(await Promise.all(yt.flatMap(Xe=>Xe.nameBatches.map(Ot=>ce.getEntities({filter:{kind:Xe.kind,"metadata.namespace":Xe.namespace,"metadata.name":Ot}}))))).flatMap(Xe=>Xe.items)},[v,G,K]);return{entities:pe,loading:se,error:je}}var ge=t(72164);function ee(v){return typeof v=="string"?v:(0,Ee.eE)(v)}function Ae(){const v=(0,n.h_)(R),S=(0,ge.Z)(v.starredEntitie$(),new Set),A=(0,P.useCallback)(G=>S.has(ee(G)),[S]),D=(0,P.useCallback)(G=>v.toggleStarred(ee(G)).then(),[v]);return{starredEntities:S,toggleStarredEntity:D,isStarredEntity:A}}function Ue(v){return typeof v=="string"?v:(0,Ee.eE)(v)}function _e(v){const S=(0,n.h_)(R),[A,D]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{const K=S.starredEntitie$().subscribe({next(ce){D(ce.has(Ue(v)))}});return()=>{K.unsubscribe()}},[v,S]),{toggleStarredEntity:(0,P.useCallback)(()=>S.toggleStarred(Ue(v)).then(),[v,S]),isStarredEntity:A}}function et(){const v=(0,n.h_)(n.$4),{loading:S,value:A}=(0,Ge.default)(async()=>{const{ownershipEntityRefs:G}=await v.getBackstageIdentity();return G},[]),D=(0,P.useMemo)(()=>{const G=new Set(A!=null?A:[]);return K=>{const ce=gt(K,Ee.S4).map(Ee.eE);for(const se of ce)if(G.has(se))return!0;return!1}},[A]);return(0,P.useMemo)(()=>({loading:S,isOwnedEntity:D}),[S,D])}var Y=t(25488);function O(v){const{entity:S,loading:A,error:D}=ln(),{allowed:G,loading:K,error:ce}=(0,Y.gI)({permission:v,resourceRef:S?(0,Ee.eE)(S):void 0});return A||K?{loading:!0,allowed:!1}:D?{loading:!1,allowed:!1,error:D}:{loading:!1,allowed:G,error:ce}}function ae(){const v=(0,n.h_)(m),[S,A]=(0,P.useState)([]),{error:D,loading:G,value:K}=(0,Ge.default)(async()=>{const se="kind";return await v.getEntityFacets({facets:[se]}).then(je=>je.facets[se]||[])},[v]),ce=(0,P.useRef)(K);return(0,P.useEffect)(()=>{const se=ce.current;if(ce.current=K,G||se===K||!K)return;const pe=[...new Set(Ke()(K,je=>je.value).map(je=>je.value.toLocaleLowerCase("en-US")))];A(pe)},[G,K,A]),{loading:G,error:D,availableKinds:S}}function We(v){var S;const{filters:A,queryParameters:{kind:D},updateFilters:G}=Ut(),K=(0,P.useMemo)(()=>[D].flat()[0],[D]);var ce;const[se,pe]=(0,P.useState)((ce=K!=null?K:(S=A.kind)===null||S===void 0?void 0:S.value)!==null&&ce!==void 0?ce:v.initialFilter);(0,P.useEffect)(()=>{K&&pe(K)},[K]),(0,P.useEffect)(()=>{var Qe;if(!((Qe=A.kind)===null||Qe===void 0)&&Qe.value){var yt;pe((yt=A.kind)===null||yt===void 0?void 0:yt.value)}},[A.kind]);const{availableKinds:je,loading:Re,error:Pe}=ae();return(0,P.useEffect)(()=>{G({kind:se?new Te(se):void 0})},[se,G]),{loading:Re,error:Pe,availableKinds:je,selectedKind:se,setSelectedKind:pe}}const U=v=>{const{hidden:S,initialFilter:A="component"}=v,D=(0,n.h_)(n.$v),{error:G,availableKinds:K,selectedKind:ce,setSelectedKind:se}=We({initialFilter:A});if((0,P.useEffect)(()=>{G&&D.post({message:"Failed to load entity kinds",severity:"error"}),A&&se(A)},[G,D,A,se]),(K==null?void 0:K.length)===0||G)return null;const pe=[...K.map(je=>({value:je,label:te()(je)}))];return S?null:(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsx)(E.Ph,{label:"Kind",items:pe,selected:ce,onChange:je=>se(String(je))})})};var Z=t(79692),he=t(5806),ye=t(21324),be=t(86619),De=t(19996),Oe=t(25505),He=t(38016),qe=t(88013);const b=(0,Z.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),W=(0,l.jsx)(Oe.Z,{fontSize:"small"}),fe=(0,l.jsx)(De.Z,{fontSize:"small"}),de=()=>{var v;const S=b(),{updateFilters:A,backendEntities:D,filters:G,queryParameters:{lifecycles:K}}=Ut(),ce=(0,P.useMemo)(()=>[K].flat().filter(Boolean),[K]);var se;const[pe,je]=(0,P.useState)(ce.length?ce:(se=(v=G.lifecycles)===null||v===void 0?void 0:v.values)!==null&&se!==void 0?se:[]);(0,P.useEffect)(()=>{ce.length&&je(ce)},[ce]),(0,P.useEffect)(()=>{A({lifecycles:pe.length?new ht(pe):void 0})},[pe,A]);const Re=(0,P.useMemo)(()=>[...new Set(D.map(Pe=>{var Qe;return(Qe=Pe.spec)===null||Qe===void 0?void 0:Qe.lifecycle}).filter(Boolean))].sort(),[D]);return Re.length?(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsxs)(Q.Z,{variant:"button",component:"label",children:["Lifecycle",(0,l.jsx)(qe.ZP,{multiple:!0,options:Re,value:pe,onChange:(Pe,Qe)=>je(Qe),renderOption:(Pe,{selected:Qe})=>(0,l.jsx)(he.Z,{control:(0,l.jsx)(ye.Z,{icon:W,checkedIcon:fe,checked:Qe}),label:Pe}),size:"small",popupIcon:(0,l.jsx)(He.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:Pe=>(0,l.jsx)(be.Z,{...Pe,className:S.input,variant:"outlined"})})]})}):null},Ce=(0,Z.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),Ie=(0,l.jsx)(Oe.Z,{fontSize:"small"}),Ne=(0,l.jsx)(De.Z,{fontSize:"small"}),rt=()=>{var v;const S=Ce(),{updateFilters:A,backendEntities:D,filters:G,queryParameters:{owners:K}}=Ut(),ce=(0,P.useMemo)(()=>[K].flat().filter(Boolean),[K]);var se;const[pe,je]=(0,P.useState)(ce.length?ce:(se=(v=G.owners)===null||v===void 0?void 0:v.values)!==null&&se!==void 0?se:[]);(0,P.useEffect)(()=>{ce.length&&je(ce)},[ce]),(0,P.useEffect)(()=>{A({owners:pe.length?new Pt(pe):void 0})},[pe,A]);const Re=(0,P.useMemo)(()=>[...new Set(D.flatMap(Pe=>gt(Pe,Ee.S4).map(Qe=>ke(Qe,{defaultKind:"group"}))).filter(Boolean))].sort(),[D]);return Re.length?(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsxs)(Q.Z,{variant:"button",component:"label",children:["Owner",(0,l.jsx)(qe.ZP,{multiple:!0,options:Re,value:pe,onChange:(Pe,Qe)=>je(Qe),renderOption:(Pe,{selected:Qe})=>(0,l.jsx)(he.Z,{control:(0,l.jsx)(ye.Z,{icon:Ie,checkedIcon:Ne,checked:Qe}),label:Pe}),size:"small",popupIcon:(0,l.jsx)(He.Z,{"data-testid":"owner-picker-expand"}),renderInput:Pe=>(0,l.jsx)(be.Z,{...Pe,className:S.input,variant:"outlined"})})]})}):null},xt=(0,Z.Z)(v=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),vt=()=>{var v;const S=xt(),{filters:A,updateFilters:D}=useEntityList();var G;const[K,ce]=useState((G=(v=A.text)===null||v===void 0?void 0:v.value)!==null&&G!==void 0?G:"");return useDebounce(()=>{D({text:K.length?new EntityTextFilter(K):void 0})},250,[K,D]),_jsx(Toolbar,{className:S.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:S.input,placeholder:"Search",autoComplete:"off",onChange:se=>ce(se.target.value),value:K,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>ce(""),edge:"end",disabled:K.length===0,children:_jsx(Clear,{})})})})})})},st=Object.freeze({createEntityRefColumn(v){const{defaultKind:S}=v;function A(D){var G;return((G=D.metadata)===null||G===void 0?void 0:G.title)||ke(D,{defaultKind:S})}return{title:"Name",highlight:!0,customFilterAndSearch(D,G){return A(G).includes(D)},customSort(D,G){return A(D).localeCompare(A(G))},render:D=>{var G;return(0,l.jsx)(at,{entityRef:D,defaultKind:S,title:(G=D.metadata)===null||G===void 0?void 0:G.title})}}},createEntityRelationColumn(v){const{title:S,relation:A,defaultKind:D,filter:G}=v;function K(se){return gt(se,A,G)}function ce(se){return K(se).map(pe=>ke(pe,{defaultKind:D})).join(", ")}return{title:S,customFilterAndSearch(se,pe){return ce(pe).includes(se)},customSort(se,pe){return ce(se).localeCompare(ce(pe))},render:se=>(0,l.jsx)(lt,{entityRefs:K(se),defaultKind:D})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:Ee.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:Ee.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:Ee.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:v=>(0,l.jsx)(E.Or,{text:v.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),pt=[st.createEntityRefColumn({defaultKind:"system"}),st.createDomainColumn(),st.createOwnerColumn(),st.createMetadataDescriptionColumn()],At=[st.createEntityRefColumn({defaultKind:"component"}),st.createSystemColumn(),st.createOwnerColumn(),st.createSpecTypeColumn(),st.createSpecLifecycleColumn(),st.createMetadataDescriptionColumn()],Et=(0,Z.Z)(v=>({empty:{padding:v.spacing(2),display:"flex",justifyContent:"center"}})),It=v=>{const{entities:S,title:A,emptyContent:D,variant:G="gridItem",columns:K}=v,ce=Et(),se={minWidth:"0",width:"100%"};return G==="gridItem"&&(se.height="calc(100% - 10px)"),(0,l.jsx)(E.iA,{columns:K,title:A,style:se,emptyContent:D&&(0,l.jsx)("div",{className:ce.empty,children:D}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:S})};It.columns=st,It.systemEntityColumns=pt,It.componentEntityColumns=At;const Dt=(0,Z.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),In=(0,l.jsx)(Oe.Z,{fontSize:"small"}),Dn=(0,l.jsx)(De.Z,{fontSize:"small"}),Zt=v=>{var S;const A=Dt(),{updateFilters:D,filters:G,queryParameters:{tags:K}}=Ut(),ce=(0,n.h_)(m),{value:se}=(0,Ge.default)(async()=>{var Qe;const yt="metadata.tags",{facets:St}=await ce.getEntityFacets({facets:[yt],filter:(Qe=G.kind)===null||Qe===void 0?void 0:Qe.getCatalogFilters()});return Object.fromEntries(St[yt].map(({value:Xe,count:Ot})=>[Xe,Ot]))},[G.kind]),pe=(0,P.useMemo)(()=>[K].flat().filter(Boolean),[K]);var je;const[Re,Pe]=(0,P.useState)(pe.length?pe:(je=(S=G.tags)===null||S===void 0?void 0:S.values)!==null&&je!==void 0?je:[]);return(0,P.useEffect)(()=>{pe.length&&Pe(pe)},[pe]),(0,P.useEffect)(()=>{D({tags:Re.length?new mt(Re):void 0})},[Re,D]),Object.keys(se!=null?se:{}).length?(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsxs)(Q.Z,{variant:"button",component:"label",children:["Tags",(0,l.jsx)(qe.ZP,{multiple:!0,options:Object.keys(se!=null?se:{}),value:Re,onChange:(Qe,yt)=>Pe(yt),renderOption:(Qe,{selected:yt})=>(0,l.jsx)(he.Z,{control:(0,l.jsx)(ye.Z,{icon:In,checkedIcon:Dn,checked:yt}),label:v.showCounts?`${Qe} (${se==null?void 0:se[Qe]})`:Qe}),size:"small",popupIcon:(0,l.jsx)(He.Z,{"data-testid":"tag-picker-expand"}),renderInput:Qe=>(0,l.jsx)(be.Z,{...Qe,className:A.input,variant:"outlined"})})]})}):null},C=v=>{const{hidden:S,initialFilter:A}=v,D=(0,n.h_)(n.$v),{error:G,availableTypes:K,selectedTypes:ce,setSelectedTypes:se}=Sn();if((0,P.useEffect)(()=>{G&&D.post({message:"Failed to load entity types",severity:"error"}),A&&se([A])},[G,D,A,se]),K.length===0||G)return null;const pe=[{value:"all",label:"All"},...K.map(Re=>({value:Re,label:te()(Re)}))];var je;return S?null:(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsx)(E.Ph,{label:"Type",items:pe,selected:(je=pe.length>1?ce[0]:void 0)!==null&&je!==void 0?je:"all",onChange:Re=>se(Re==="all"?[]:[String(Re)])})})};var u=t(15459),x=t(61837),j=t(11640),J=t(28347);const xe=(0,u.Z)({root:{color:"#f3ba37"}})(j.Z),we=v=>{const{toggleStarredEntity:S,isStarredEntity:A}=_e(v.entity);return(0,l.jsx)(x.Z,{"aria-label":"favorite",color:"inherit",...v,onClick:()=>S(),children:(0,l.jsx)(nt.ZP,{title:A?"Remove from favorites":"Add to favorites",children:A?(0,l.jsx)(xe,{}):(0,l.jsx)(J.Z,{})})})};var $e=t(8629),it=t(79249),Bt=t(38724),hn=t(99152),Nn=t(6487),mr=t(49429),tn=t(55999),lr=t(72779),vr=t.n(lr),zr=t(39412);const Vr=zr.Z;function yr(v,S){if(v)return v.toLocaleLowerCase("en-US");if(S)try{return(0,Ee.of)(S).kind.toLocaleLowerCase("en-US")}catch{return}}function Wr(v,S){const A=(0,n.qD)(),D=yr(v,S);return D&&A.getSystemIcon(`kind:${D}`)||Vr}function Ir(v){const{kind:S,entityRef:A,...D}=v,G=Wr(S,A);return(0,l.jsx)(G,{...D})}const Rr=(0,Z.Z)(v=>({node:{fill:v.palette.grey[300],stroke:v.palette.grey[300],"&.primary":{fill:v.palette.primary.light,stroke:v.palette.primary.light},"&.secondary":{fill:v.palette.secondary.light,stroke:v.palette.secondary.light}},text:{fill:v.palette.getContrastText(v.palette.grey[300]),"&.primary":{fill:v.palette.primary.contrastText},"&.secondary":{fill:v.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function rs(v){const S=(0,n.h_)(m),A=(0,Ee.eE)(v),{loading:D,error:G,value:K}=(0,Ge.default)(async()=>{const ce=await S.getEntityAncestors({entityRef:A}),se=new Array,pe=new Array;for(const je of ce.items){const Re=(0,Ee.eE)(je.entity),Pe=Re===ce.rootEntityRef;se.push({id:Re,root:Pe,...je.entity});for(const Qe of je.parentEntityRefs)pe.push({from:Re,to:Qe})}return{nodes:se,edges:pe}},[A]);return{loading:D,error:G,nodes:(K==null?void 0:K.nodes)||[],edges:(K==null?void 0:K.edges)||[]}}function ss({node:v}){const S=Rr(),A=(0,En.s0)(),D=(0,n.tg)(ft),[G,K]=(0,P.useState)(0),[ce,se]=(0,P.useState)(0),pe=(0,P.useRef)(null);(0,P.useLayoutEffect)(()=>{if(pe.current){let{height:Ot,width:Wt}=pe.current.getBBox();Ot=Math.round(Ot),Wt=Math.round(Wt),(Ot!==ce||Wt!==G)&&(K(Wt),se(Ot))}},[G,ce]);const je=10,Re=ce,Pe=Re+je,Qe=Pe+G+je*2,yt=ce+je*2,St=v.metadata.title||(v.kind&&v.metadata.name&&v.metadata.namespace?ke({kind:v.kind,name:v.metadata.name,namespace:v.metadata.namespace||""}):v.id),Xe=()=>{A(D({kind:v.kind,namespace:v.metadata.namespace||Ee.zG,name:v.metadata.name}))};return(0,l.jsxs)("g",{onClick:Xe,className:S.clickable,children:[(0,l.jsx)("rect",{className:vr()(S.node,v.root?"secondary":"primary"),width:Qe,height:yt,rx:10}),(0,l.jsx)(Ir,{kind:v.kind,y:je,x:je,width:Re,height:Re,className:vr()(S.text,v.root?"secondary":"primary")}),(0,l.jsx)("text",{ref:pe,className:vr()(S.text,v.root?"secondary":"primary"),y:yt/2,x:Pe+(G+je*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:St})]})}function os(v){const{loading:S,error:A,nodes:D,edges:G}=rs(v.entity);return S?(0,l.jsx)(E.Ex,{}):A?(0,l.jsx)(E.Gk,{error:A}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tn.Z,{variant:"h2",children:"Ancestry"}),(0,l.jsxs)(tn.Z,{gutterBottom:!0,children:["This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where"," ",(0,l.jsx)(E.rU,{to:"https://backstage.io/docs/features/software-catalog/life-of-an-entity",children:"processors emitted"})," ","child entities that ultimately led to the current one existing. Note that this is a completely different mechanism from relations."]}),(0,l.jsx)(X.Z,{mt:4,children:(0,l.jsx)(E.mn,{nodes:D,edges:G,renderNode:ss,direction:E.NX.Nm.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var nr=t(11776),kn=t(38402),xr=t(86136),br=t(99688),Hr=t(49378),is=t(54506),cr=t(94339),Hn=t(24579),as=t(27685);const Gr=(0,Z.Z)(v=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:v.spacing(2)},helpIcon:{marginLeft:v.spacing(1),color:v.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function Fn(v){const S=Gr();return(0,l.jsx)(Hr.Z,{...v,primaryTypographyProps:{className:S.monospace},secondaryTypographyProps:{className:S.monospace}})}function Sr(v){const S=Gr();return(0,l.jsx)(is.Z,{className:S.monospace,children:v.children})}function Cr(v){return(0,l.jsx)(X.Z,{mt:2,children:(0,l.jsx)(cr.Z,{variant:"outlined",children:(0,l.jsxs)(Hn.Z,{children:[(0,l.jsxs)(Q.Z,{variant:"h6",gutterBottom:!0,children:[v.title,v.helpLink&&(0,l.jsx)(rr,{to:v.helpLink})]}),v.children]})})})}function ls(v){if(v.match(/^url:https?:\/\//))return v.slice(4);if(v.match(/^https?:\/\//))return v}function Lr(v){const[S,A]=v.entry,D=ls(A);return(0,l.jsxs)(kn.Z,{children:[v.indent&&(0,l.jsx)(xr.Z,{}),(0,l.jsx)(Fn,{primary:S,secondary:D?(0,l.jsx)(E.rU,{to:D,children:A}):A})]})}function rr(v){const S=Gr();return(0,l.jsx)(E.rU,{to:v.to,className:S.helpIcon,children:(0,l.jsx)(as.Z,{fontSize:"inherit"})})}const cs=(0,Z.Z)({root:{display:"flex",flexDirection:"column"}});function Kr(v){var S,A;const D=(0,n.h_)(m),G=(0,Ee.eE)(v),K=(S=v.metadata.annotations)===null||S===void 0?void 0:S[Ee.P1],ce=(A=v.metadata.annotations)===null||A===void 0?void 0:A[Ee.q1],{loading:se,error:pe,value:je}=(0,Ge.default)(async()=>!K&&!ce?[]:(await D.getEntities({filter:[...K?[{[`metadata.annotations.${Ee.P1}`]:K}]:[],...ce?[{[`metadata.annotations.${Ee.q1}`]:ce}]:[]]})).items,[K,ce]);return{loading:se,error:pe,location:K,originLocation:ce,colocatedEntities:je==null?void 0:je.filter(Re=>(0,Ee.eE)(Re)!==G)}}function wr(v){return(0,l.jsxs)(nr.Z,{dense:!0,children:[v.header&&(0,l.jsx)(Lr,{entry:v.header},"header"),v.entities.map(S=>(0,l.jsxs)(kn.Z,{children:[(0,l.jsx)(xr.Z,{children:(0,l.jsx)(Ir,{kind:S.kind})}),(0,l.jsx)(Fn,{primary:(0,l.jsx)(at,{entityRef:S})})]},(0,Ee.eE)(S)))]})}function Pr(v){const{entity:S}=v,{loading:A,error:D,location:G,originLocation:K,colocatedEntities:ce}=Kr(S);if(A)return(0,l.jsx)(E.Ex,{});if(D)return(0,l.jsx)(E.Gk,{error:D});if(!G&&!K)return(0,l.jsx)(br.Z,{severity:"warning",children:"Entity had no location information."});if(!(ce!=null&&ce.length))return(0,l.jsx)(br.Z,{severity:"info",children:"There were no other entities on this location."});if(G===K)return(0,l.jsx)(wr,{entities:ce});const se=ce.filter(je=>{var Re;return((Re=je.metadata.annotations)===null||Re===void 0?void 0:Re[Ee.P1])===G}),pe=ce.filter(je=>{var Re;return((Re=je.metadata.annotations)===null||Re===void 0?void 0:Re[Ee.q1])===K});return(0,l.jsxs)(l.Fragment,{children:[se.length>0&&(0,l.jsx)(wr,{entities:se,header:["At the same location",G]}),pe.length>0&&(0,l.jsx)(wr,{entities:pe,header:["At the same origin",K]})]})}function ds(v){const S=cs();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tn.Z,{variant:"h2",children:"Colocated"}),(0,l.jsx)(tn.Z,{children:"These are the entities that are colocated with this entity - as in, they originated from the same data source (e.g. came from the same YAML file), or from the same origin (e.g. the originally registered URL)."}),(0,l.jsx)("div",{className:S.root,children:(0,l.jsx)(Pr,{entity:v.entity})})]})}function Yr(v){return Object.fromEntries([...Object.entries(v)].sort((S,A)=>S[0]<A[0]?-1:1))}function us(v){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tn.Z,{variant:"h2",children:"Entity as JSON"}),(0,l.jsx)(tn.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,l.jsx)(tn.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)(E.Oi,{text:JSON.stringify(Yr(v.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var hs=t(3440),kr=t.n(hs);const ps=(0,Z.Z)({root:{display:"flex",flexDirection:"column"}});function Or(v){var S,A;const D=ps(),{apiVersion:G,kind:K,metadata:ce,spec:se,relations:pe=[],status:je={}}=v.entity,Re=kr()(Ke()(pe,Pe=>Pe.targetRef),"type");return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tn.Z,{variant:"h2",children:"Overview"}),(0,l.jsxs)("div",{className:D.root,children:[(0,l.jsx)(Cr,{title:"Identity",children:(0,l.jsxs)(nr.Z,{dense:!0,children:[(0,l.jsx)(kn.Z,{children:(0,l.jsx)(Fn,{primary:"apiVersion",secondary:G})}),(0,l.jsx)(kn.Z,{children:(0,l.jsx)(Fn,{primary:"kind",secondary:K})}),(se==null?void 0:se.type)&&(0,l.jsx)(kn.Z,{children:(0,l.jsx)(Fn,{primary:"spec.type",secondary:se.type})}),ce.uid&&(0,l.jsx)(kn.Z,{children:(0,l.jsx)(Fn,{primary:"uid",secondary:ce.uid})}),ce.etag&&(0,l.jsx)(kn.Z,{children:(0,l.jsx)(Fn,{primary:"etag",secondary:ce.etag})})]})}),(0,l.jsxs)(Cr,{title:"Metadata",children:[!!Object.keys(ce.annotations||{}).length&&(0,l.jsx)(nr.Z,{dense:!0,subheader:(0,l.jsxs)(Sr,{children:["Annotations",(0,l.jsx)(rr,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(ce.annotations).map(Pe=>(0,l.jsx)(Lr,{indent:!0,entry:Pe},Pe[0]))}),!!Object.keys(ce.labels||{}).length&&(0,l.jsx)(nr.Z,{dense:!0,subheader:(0,l.jsx)(Sr,{children:"Labels"}),children:Object.entries(ce.labels).map(Pe=>(0,l.jsx)(Lr,{indent:!0,entry:Pe},Pe[0]))}),!!(!((S=ce.tags)===null||S===void 0)&&S.length)&&(0,l.jsx)(nr.Z,{dense:!0,subheader:(0,l.jsx)(Sr,{children:"Tags"}),children:ce.tags.map((Pe,Qe)=>(0,l.jsxs)(kn.Z,{children:[(0,l.jsx)(xr.Z,{}),(0,l.jsx)(Fn,{primary:Pe})]},`${Pe}-${Qe}`))})]}),!!pe.length&&(0,l.jsx)(Cr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Re).map(([Pe,Qe],yt)=>(0,l.jsx)("div",{children:(0,l.jsx)(nr.Z,{dense:!0,subheader:(0,l.jsx)(Sr,{children:Pe}),children:Qe.map(St=>(0,l.jsxs)(kn.Z,{children:[(0,l.jsx)(xr.Z,{children:(0,l.jsx)(Ir,{entityRef:St.targetRef})}),(0,l.jsx)(Fn,{primary:(0,l.jsx)(at,{entityRef:St.targetRef})})]},St.targetRef))})},yt))}),!!(!((A=je.items)===null||A===void 0)&&A.length)&&(0,l.jsx)(Cr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:je.items.map((Pe,Qe)=>(0,l.jsxs)("div",{children:[(0,l.jsxs)(Q.Z,{children:[Pe.level,": ",Pe.type]}),(0,l.jsx)(X.Z,{ml:2,children:Pe.message})]},Qe))})]})]})}var fn=t(72847);function Gn(v){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tn.Z,{variant:"h2",children:"Entity as YAML"}),(0,l.jsx)(tn.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,l.jsx)(tn.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)(E.Oi,{text:fn.ZP.stringify(Yr(v.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const Ft=(0,Z.Z)(v=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:v.palette.background.paper},tabs:{borderRight:`1px solid ${v.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function sr(v){const{children:S,value:A,index:D,...G}=v,K=Ft();return(0,l.jsx)("div",{role:"tabpanel",hidden:A!==D,id:`vertical-tabpanel-${D}`,"aria-labelledby":`vertical-tab-${D}`,className:K.tabContents,...G,children:A===D&&(0,l.jsx)(X.Z,{pl:3,pr:3,children:S})})}function dr(v){return{id:`vertical-tab-${v}`,"aria-controls":`vertical-tabpanel-${v}`}}function fs(v){const S=Ft(),[A,D]=P.useState(0);return(0,P.useEffect)(()=>{D(0)},[v.open]),v.entity?(0,l.jsxs)($e.Z,{fullWidth:!0,maxWidth:"xl",open:v.open,onClose:v.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:S.fullHeightDialog},children:[(0,l.jsx)(it.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,l.jsx)(Bt.Z,{dividers:!0,children:(0,l.jsxs)("div",{className:S.root,children:[(0,l.jsxs)(hn.Z,{orientation:"vertical",variant:"scrollable",value:A,onChange:(G,K)=>D(K),"aria-label":"Inspector options",className:S.tabs,children:[(0,l.jsx)(Nn.Z,{label:"Overview",...dr(0)}),(0,l.jsx)(Nn.Z,{label:"Ancestry",...dr(1)}),(0,l.jsx)(Nn.Z,{label:"Colocated",...dr(2)}),(0,l.jsx)(Nn.Z,{label:"Raw JSON",...dr(3)}),(0,l.jsx)(Nn.Z,{label:"Raw YAML",...dr(4)})]}),(0,l.jsx)(sr,{value:A,index:0,children:(0,l.jsx)(Or,{entity:v.entity})}),(0,l.jsx)(sr,{value:A,index:1,children:(0,l.jsx)(os,{entity:v.entity})}),(0,l.jsx)(sr,{value:A,index:2,children:(0,l.jsx)(ds,{entity:v.entity})}),(0,l.jsx)(sr,{value:A,index:3,children:(0,l.jsx)(us,{entity:v.entity})}),(0,l.jsx)(sr,{value:A,index:4,children:(0,l.jsx)(Gn,{entity:v.entity})})]})}),(0,l.jsx)(mr.Z,{children:(0,l.jsx)(_.Z,{onClick:v.onClose,color:"primary",children:"Close"})})]}):null}var gs=t(85256);function ms(v){var S;const A=(0,n.h_)(m),D=(S=v.metadata.annotations)===null||S===void 0?void 0:S[Ee.q1],G=v.metadata.uid,K=D==="bootstrap:bootstrap",ce=(0,Ge.default)(async()=>{const St=A.getLocationByRef(D);let Xe;if(!D)Xe=Promise.resolve([]);else{const Ot=`metadata.annotations.${Ee.q1}`;Xe=A.getEntities({filter:{[Ot]:D},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Wt=>Wt.items)}return Promise.all([St,Xe]).then(([Ot,Wt])=>({location:Ot,colocatedEntities:Wt}))},[A,v]),se=(0,P.useCallback)(async function(){const{location:Xe}=ce.value;await A.removeLocationById(Xe.id)},[A,ce]),pe=(0,P.useCallback)(async function(){await A.removeEntityByUid(G)},[A,G]);if(K)return{type:"bootstrap",location:D,deleteEntity:pe};const{loading:je,error:Re,value:Pe}=ce;if(je)return{type:"loading"};if(Re)return{type:"error",error:Re};const{location:Qe,colocatedEntities:yt}=Pe;return Qe?{type:"unregister",location:D,colocatedEntities:yt.map(Ee.iB),unregisterLocation:se,deleteEntity:pe}:{type:"only-delete",deleteEntity:pe}}var Jr=t(23054);const Qr=(0,Z.Z)({advancedButton:{fontSize:"0.7em"}}),jr=({entity:v,onConfirm:S})=>{const A=(0,n.h_)(n.$v),D=(0,n.h_)(n.Ds),G=Qr(),K=ms(v),[ce,se]=(0,P.useState)(!1),[pe,je]=(0,P.useState)(!1);var Re;const Pe=(Re=D.getOptionalString("app.title"))!==null&&Re!==void 0?Re:"Backstage",Qe=(0,P.useCallback)(async function(){if("unregisterLocation"in K){je(!0);try{await K.unregisterLocation(),S()}catch(Xe){(0,Jr.BD)(Xe),A.post({message:Xe.message})}finally{je(!1)}}},[A,S,K]),yt=(0,P.useCallback)(async function(){if("deleteEntity"in K){je(!0);try{await K.deleteEntity(),S()}catch(Xe){(0,Jr.BD)(Xe),A.post({message:Xe.message})}finally{je(!1)}}},[A,S,K]);return K.type==="loading"?(0,l.jsx)(E.Ex,{}):K.type==="error"?(0,l.jsx)(E.Gk,{error:K.error}):K.type==="bootstrap"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(br.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',K.location,'"). If you believe this is in error, please contact the ',Pe," ","integrator."]}),(0,l.jsxs)(X.Z,{marginTop:2,children:[!ce&&(0,l.jsx)(_.Z,{variant:"text",size:"small",color:"primary",className:G.advancedButton,onClick:()=>se(!0),children:"Advanced Options"}),ce&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tn.Z,{children:"You have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,l.jsx)(_.Z,{variant:"contained",color:"secondary",disabled:pe,onClick:yt,children:"Delete Entity"})]})]})]}):K.type==="only-delete"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tn.Z,{children:"This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog."}),(0,l.jsx)(_.Z,{variant:"contained",color:"secondary",disabled:pe,onClick:yt,children:"Delete Entity"})]}):K.type==="unregister"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tn.Z,{children:"This action will unregister the following entities:"}),(0,l.jsx)(tn.Z,{component:"ul",children:K.colocatedEntities.map(St=>(0,l.jsx)("li",{children:(0,l.jsx)(at,{entityRef:St})},`${St.kind}:${St.namespace}/${St.name}`))}),(0,l.jsx)(tn.Z,{children:"Located at the following location:"}),(0,l.jsx)(tn.Z,{component:"ul",children:(0,l.jsx)("li",{children:K.location})}),(0,l.jsxs)(tn.Z,{children:["To undo, just re-register the entity in ",Pe,"."]}),(0,l.jsxs)(X.Z,{marginTop:2,children:[(0,l.jsx)(_.Z,{variant:"contained",color:"secondary",disabled:pe,onClick:Qe,children:"Unregister Location"}),!ce&&(0,l.jsx)(X.Z,{component:"span",marginLeft:2,children:(0,l.jsx)(_.Z,{variant:"text",size:"small",color:"primary",className:G.advancedButton,onClick:()=>se(!0),children:"Advanced Options"})})]}),ce&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(X.Z,{paddingTop:4,paddingBottom:4,children:(0,l.jsx)(gs.Z,{})}),(0,l.jsx)(tn.Z,{children:"You also have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,l.jsx)(_.Z,{variant:"contained",color:"secondary",disabled:pe,onClick:yt,children:"Delete Entity"})]})]}):(0,l.jsx)(br.Z,{severity:"error",children:"Internal error: Unknown state"})},Ns=v=>{const{open:S,onConfirm:A,onClose:D,entity:G}=v;return(0,l.jsxs)($e.Z,{open:S,onClose:D,children:[(0,l.jsx)(it.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,l.jsx)(Bt.Z,{children:(0,l.jsx)(jr,{entity:G,onConfirm:A})}),(0,l.jsx)(mr.Z,{children:(0,l.jsx)(_.Z,{onClick:D,color:"primary",children:"Cancel"})})]})};var vs=t(12231),Xr=t(9520),ys=t(47603);const Fs=(0,Z.Z)(v=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:v.spacing(1,0,1,0)},title:{margin:v.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:v.palette.text.primary},menuItem:{minHeight:v.spacing(6)},groupWrapper:{margin:v.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function xs(v){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:ys.Z},{id:"starred",label:"Starred",icon:j.Z}]},{name:v!=null?v:"Company",items:[{id:"all",label:"All"}]}]}const Us=v=>{const{initialFilter:S,availableFilters:A}=v,D=Fs(),G=(0,n.h_)(n.Ds);var K;const ce=(K=G.getOptionalString("organization.name"))!==null&&K!==void 0?K:"Company",{filters:se,updateFilters:pe,backendEntities:je,queryParameters:{kind:Re,user:Pe},loading:Qe}=Ut(),yt=["starred","all"],St=xs(ce).map(vn=>({...vn,items:vn.items.filter(({id:Ln})=>["group","user"].some(Ar=>Ar===Re)?yt.includes(Ln):!A||A.includes(Ln))})).filter(({items:vn})=>!!vn.length),{isStarredEntity:Xe}=Ae(),{isOwnedEntity:Ot,loading:Wt}=et(),Jn=Qe||Wt,On=(0,P.useMemo)(()=>new Ct("owned",Ot,Xe),[Ot,Xe]),or=(0,P.useMemo)(()=>new Ct("starred",Ot,Xe),[Ot,Xe]),gn=(0,P.useMemo)(()=>[Pe].flat()[0],[Pe]),[mn,Rn]=(0,P.useState)(gn!=null?gn:S),Un=(0,P.useMemo)(()=>je.filter(dt((0,qt.compact)(Object.values({...se,user:void 0})))),[se,je]),$r=(0,P.useMemo)(()=>({all:Un.length,starred:Un.filter(vn=>or.filterEntity(vn)).length,owned:Un.filter(vn=>On.filterEntity(vn)).length}),[Un,or,On]);(0,P.useEffect)(()=>{gn&&Rn(gn)},[gn]),(0,P.useEffect)(()=>{!Jn&&!!mn&&mn!=="all"&&$r[mn]===0&&Rn("all")},[Jn,$r,mn,Rn]),(0,P.useEffect)(()=>{pe({user:mn?new Ct(mn,Ot,Xe):void 0})},[mn,Ot,Xe,pe]);var Er;return(0,l.jsx)(cr.Z,{className:D.root,children:St.map(vn=>(0,l.jsxs)(P.Fragment,{children:[(0,l.jsx)(Q.Z,{variant:"subtitle2",component:"span",className:D.title,children:vn.name}),(0,l.jsx)(cr.Z,{className:D.groupWrapper,children:(0,l.jsx)(nr.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":vn.name,children:vn.items.map(Ln=>{var Ar;return(0,l.jsxs)(vs.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>Rn(Ln.id),selected:Ln.id===((Ar=se.user)===null||Ar===void 0?void 0:Ar.value),className:D.menuItem,disabled:$r[Ln.id]===0,"data-testid":`user-picker-${Ln.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Ln.icon&&(0,l.jsx)(xr.Z,{className:D.listIcon,children:(0,l.jsx)(Ln.icon,{fontSize:"small"})}),(0,l.jsx)(Hr.Z,{children:(0,l.jsxs)(Q.Z,{variant:"body1",children:[Ln.label," "]})}),(0,l.jsx)(Xr.Z,{children:(Er=$r[Ln.id])!==null&&Er!==void 0?Er:"-"})]},Ln.id)})})})]},vn.name))})},Ms=(0,Z.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),bs=(0,l.jsx)(Oe.Z,{fontSize:"small"}),Ss=(0,l.jsx)(De.Z,{fontSize:"small"}),Cs=()=>{const v=Ms(),{updateFilters:S}=Ut(),[A,D]=(0,P.useState)([]);function G(se){S({orphan:se?new Tt(se):void 0})}function K(se){S({error:se?new kt(se):void 0})}const ce=["Is Orphan","Has Error"];return(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsxs)(Q.Z,{variant:"button",component:"label",children:["Processing Status",(0,l.jsx)(qe.ZP,{multiple:!0,options:ce,value:A,onChange:(se,pe)=>{D(pe),G(pe.includes("Is Orphan")),K(pe.includes("Has Error"))},renderOption:(se,{selected:pe})=>(0,l.jsx)(he.Z,{control:(0,l.jsx)(ye.Z,{icon:bs,checkedIcon:Ss,checked:pe}),label:se}),size:"small",popupIcon:(0,l.jsx)(He.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:se=>(0,l.jsx)(be.Z,{...se,className:v.input,variant:"outlined"})})]})})},qr=({children:v,value:S})=>{var A;const[D,G]=useState((A=S==null?void 0:S.filters)!==null&&A!==void 0?A:{}),K=useCallback(yt=>{G(St=>{const Xe=typeof yt=="function"?yt(St):yt;return{...St,...Xe}})},[]),ce=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var se,pe,je,Re,Pe;const Qe=useMemo(()=>({entities:(se=S==null?void 0:S.entities)!==null&&se!==void 0?se:ce.entities,backendEntities:(pe=S==null?void 0:S.backendEntities)!==null&&pe!==void 0?pe:ce.backendEntities,updateFilters:(je=S==null?void 0:S.updateFilters)!==null&&je!==void 0?je:K,filters:D,loading:(Re=S==null?void 0:S.loading)!==null&&Re!==void 0?Re:!1,queryParameters:(Pe=S==null?void 0:S.queryParameters)!==null&&Pe!==void 0?Pe:ce.queryParameters,error:S==null?void 0:S.error}),[S,ce,D,K]);return _jsx(EntityListContext.Provider,{value:Qe,children:v})}},33414:function(jt,Me,t){"use strict";t.r(Me),t.d(Me,{AboutCard:function(){return ft},AboutContent:function(){return Ee},AboutField:function(){return te}});var h=t(52322),n=t(25271),m=t(71399),R=t(25248),V=t(32838),y=t(43297),l=t(79692),P=t(94339),ne=t(32552),q=t(61837),_=t(85256),F=t(24579),X=t(52866),Q=t(30254),ue=t(27604),le=t(2784),L=t(19625),I=t(60905),$=t(90436),E=t(7089);const T=(0,l.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 te(Ze){const{label:ke,value:nt,gridSizes:at,children:ut}=Ze,lt=T(),ot=(0,R.vJ)(ut,gt=>gt.getElements()),dt=ot.length>0?ot:(0,h.jsx)($.Z,{variant:"body2",className:lt.value,children:nt||"unknown"});return(0,h.jsxs)(I.Z,{item:!0,...at,children:[(0,h.jsx)($.Z,{variant:"h2",className:lt.label,children:ke}),dt]})}var Se=t(24851);const Ke=(0,l.Z)({description:{wordBreak:"break-word"}});function Ge(Ze,ke,nt){if(ke==="url"||Ze.includes("://"))return Ze;const at=nt.type==="file"?`file://${nt.target}`:nt.target;return ke==="file"||nt.type==="file"?new URL(Ze,at).href:at}function Ee(Ze){var ke,nt,at,ut,lt,ot,dt,gt;const{entity:Be}=Ze,ie=Ke(),Te=Be.kind.toLocaleLowerCase("en-US")==="system",Fe=Be.kind.toLocaleLowerCase("en-US")==="resource",mt=Be.kind.toLocaleLowerCase("en-US")==="component",bt=Be.kind.toLocaleLowerCase("en-US")==="api",Pt=Be.kind.toLocaleLowerCase("en-US")==="template",ht=Be.kind.toLocaleLowerCase("en-US")==="location",Ct=Be.kind.toLocaleLowerCase("en-US")==="group",Tt=(0,y.hF)(Be,n.cz,{kind:"system"}),kt=(0,y.hF)(Be,n.cz,{kind:"component"}),_t=(0,y.hF)(Be,n.cz,{kind:"domain"}),en=(0,y.hF)(Be,n.S4);let Kt;try{Kt=(0,n.CV)(Be)}catch{Kt=void 0}return(0,h.jsxs)(I.Z,{container:!0,children:[(0,h.jsx)(te,{label:"Description",gridSizes:{xs:12},children:(0,h.jsx)($.Z,{variant:"body2",paragraph:!0,className:ie.description,children:(Be==null||(ke=Be.metadata)===null||ke===void 0?void 0:ke.description)||"No description"})}),(0,h.jsx)(te,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:en.length>0&&(0,h.jsx)(y.rI,{entityRefs:en,defaultKind:"group"})}),(Te||_t.length>0)&&(0,h.jsx)(te,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:_t.length>0&&(0,h.jsx)(y.rI,{entityRefs:_t,defaultKind:"domain"})}),(bt||mt||Fe||Tt.length>0)&&(0,h.jsx)(te,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:Tt.length>0&&(0,h.jsx)(y.rI,{entityRefs:Tt,defaultKind:"system"})}),mt&&kt.length>0&&(0,h.jsx)(te,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,h.jsx)(y.rI,{entityRefs:kt,defaultKind:"component"})}),(bt||mt||Fe||Pt||Ct||ht||typeof(Be==null||(nt=Be.spec)===null||nt===void 0?void 0:nt.type)=="string")&&(0,h.jsx)(te,{label:"Type",value:Be==null||(at=Be.spec)===null||at===void 0?void 0:at.type,gridSizes:{xs:12,sm:6,lg:4}}),(bt||mt||typeof(Be==null||(ut=Be.spec)===null||ut===void 0?void 0:ut.lifecycle)=="string")&&(0,h.jsx)(te,{label:"Lifecycle",value:Be==null||(lt=Be.spec)===null||lt===void 0?void 0:lt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,h.jsx)(te,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((Be==null||(ot=Be.metadata)===null||ot===void 0?void 0:ot.tags)||[]).map(Xt=>(0,h.jsx)(E.Z,{size:"small",label:Xt},Xt))}),ht&&((Be==null||(dt=Be.spec)===null||dt===void 0?void 0:dt.targets)||(Be==null||(gt=Be.spec)===null||gt===void 0?void 0:gt.target))&&(0,h.jsx)(te,{label:"Targets",gridSizes:{xs:12},children:(0,h.jsx)(Se.s,{cols:1,items:(Be.spec.targets||[Be.spec.target]).map(Xt=>Xt).map(Xt=>{var ln;return{text:Xt,href:Ge(Xt,(Be==null||(ln=Be.spec)===null||ln===void 0?void 0:ln.type)||"unknown",Kt)}})})})]})}const Je=(0,l.Z)({gridItemCard:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"},fullHeightCard:{display:"flex",flexDirection:"column",height:"100%"},gridItemCardContent:{flex:1},fullHeightCardContent:{flex:1}});function ft(Ze){var ke,nt,at;const{variant:ut}=Ze,lt=Je(),{entity:ot}=(0,y.X2)(),dt=(0,R.h_)(V.q3),gt=(0,R.h_)(y.Ah),Be=(0,R.h_)(R.$v),ie=(0,R.tg)(L.jU),Te=(0,y.CV)(ot,dt),Fe=(ke=ot.metadata.annotations)===null||ke===void 0?void 0:ke[n.Tf],mt={label:"View Source",disabled:!Te,icon:(0,h.jsx)(V.nW,{type:Te==null?void 0:Te.integrationType}),href:Te==null?void 0:Te.locationTargetUrl},bt={label:"View TechDocs",disabled:!(!((nt=ot.metadata.annotations)===null||nt===void 0)&&nt["backstage.io/techdocs-ref"])||!ie,icon:(0,h.jsx)(Q.Z,{}),href:ie&&ie({namespace:ot.metadata.namespace||n.zG,kind:ot.kind,name:ot.metadata.name})};let Pt="";ut==="gridItem"?Pt=lt.gridItemCard:ut==="fullHeight"&&(Pt=lt.fullHeightCard);let ht="";ut==="gridItem"?ht=lt.gridItemCardContent:ut==="fullHeight"&&(ht=lt.fullHeightCardContent);const Ct=(at=ot.metadata.annotations)===null||at===void 0?void 0:at[n.P1],Tt=(Ct==null?void 0:Ct.startsWith("url:"))||(Ct==null?void 0:Ct.startsWith("file:")),kt=(0,le.useCallback)(async()=>{await gt.refreshEntity((0,n.eE)(ot)),Be.post({message:"Refresh scheduled",severity:"info"})},[gt,Be,ot]);return(0,h.jsxs)(P.Z,{className:Pt,children:[(0,h.jsx)(ne.Z,{title:"About",action:(0,h.jsxs)(h.Fragment,{children:[Tt&&(0,h.jsx)(q.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:kt,children:(0,h.jsx)(X.Z,{})}),(0,h.jsx)(q.Z,{component:m.rU,"aria-label":"Edit",disabled:!Fe,title:"Edit Metadata",to:Fe!=null?Fe:"#",children:(0,h.jsx)(ue.Z,{})})]}),subheader:(0,h.jsx)(m.M6,{links:[mt,bt]})}),(0,h.jsx)(_.Z,{}),(0,h.jsx)(F.Z,{className:ht,children:(0,h.jsx)(Ee,{entity:ot})})]})}},79324:function(jt,Me,t){"use strict";t.d(Me,{K:function(){return X}});var h=t(52322),n=t(2784),m=t(79692),R=t(12420),V=t(97580),y=t(73698),l=t(74603),P=t(12231),ne=t(43297),q=t(64279),_=t(25248);const F=(0,m.Z)(Q=>(0,R.Z)({root:{...Q.typography.h4}}));function X(Q){const{initialFilter:ue="component",allowedKinds:le}=Q,L=F(),I=(0,_.h_)(ne.Ah),{value:$}=(0,q.default)(async()=>await I.getEntityFacets({facets:["kind"]}).then(Ze=>{var ke;return((ke=Ze.facets.kind)===null||ke===void 0?void 0:ke.map(nt=>nt.value).sort())||[]})),{filters:E,updateFilters:T,queryParameters:{kind:te}}=(0,ne.wp)(),Se=(0,n.useMemo)(()=>{var Ze;return(Ze=[te].flat()[0])===null||Ze===void 0?void 0:Ze.toLocaleLowerCase("en-US")},[te]),[Ke,Ge]=(0,n.useState)(Se!=null?Se:ue);(0,n.useEffect)(()=>{var Ze;if(!((Ze=E.kind)===null||Ze===void 0)&&Ze.value){var ke;Ge((ke=E.kind)===null||ke===void 0?void 0:ke.value)}},[E.kind]),(0,n.useEffect)(()=>{T({kind:Ke?new ne.zo(Ke):void 0})},[Ke,T]),(0,n.useEffect)(()=>{Se&&Ge(Se)},[Se]);var Ee;const ft=[(0,V.Z)(Ke)].concat((Ee=$==null?void 0:$.filter(Ze=>le?le.some(ke=>ke.toLocaleLowerCase("en-US")===Ze.toLocaleLowerCase("en-US")):!0))!==null&&Ee!==void 0?Ee:[]).sort().reduce((Ze,ke)=>(Ze[ke.toLocaleLowerCase("en-US")]=ke,Ze),{});return(0,h.jsx)(y.Z,{input:(0,h.jsx)(l.Z,{value:Ke}),value:Ke,onChange:Ze=>Ge(Ze.target.value),classes:L,children:Object.keys(ft).map(Ze=>(0,h.jsx)(P.Z,{value:Ze,children:`${ft[Ze]}s`},Ze))})}},86359:function(jt,Me,t){"use strict";t.d(Me,{E:function(){return le}});var h=t(52322),n=t(25271),m=t(71399),R=t(43297),V=t(90436),y=t(15459),l=t(27604),P=t(2997),ne=t(11640),q=t(28347),_=t(76635),F=t(2784),X=t(7089);const Q=Object.freeze({createNameColumn(L){function I($){var E;return((E=$.metadata)===null||E===void 0?void 0:E.title)||(0,R.$3)($,{defaultKind:L==null?void 0:L.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:$},{entity:E}){return I($).localeCompare(I(E))},render:({entity:$})=>{var E;return(0,h.jsx)(R.dx,{entityRef:$,defaultKind:(L==null?void 0:L.defaultKind)||"Component",title:(E=$.metadata)===null||E===void 0?void 0:E.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:L})=>(0,h.jsx)(R.rI,{entityRefs:L.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:L})=>(0,h.jsx)(R.rI,{entityRefs:L.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:L})=>{var I,$;return(0,h.jsx)(h.Fragment,{children:((L==null||(I=L.spec)===null||I===void 0?void 0:I.targets)||(L==null||($=L.spec)===null||$===void 0?void 0:$.target))&&(0,h.jsx)(m.Or,{text:(L.spec.targets||[L.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:L})=>(0,h.jsx)(m.Or,{text:L.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:L})=>(0,h.jsx)(h.Fragment,{children:L.metadata.tags&&L.metadata.tags.map(I=>(0,h.jsx)(X.Z,{label:I,size:"small",variant:"outlined",style:{marginBottom:"0px"}},I))}),width:"auto"}},createTitleColumn(L){return{title:"Title",field:"entity.metadata.title",hidden:L==null?void 0:L.hidden,searchable:!0}},createLabelColumn(L,I){return{title:(I==null?void 0:I.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:$})=>{var E;const T=(E=$.metadata)===null||E===void 0?void 0:E.labels,te=T&&T[L]||(I==null?void 0:I.defaultValue);return(0,h.jsx)(h.Fragment,{children:te&&(0,h.jsx)(X.Z,{label:te,size:"small",variant:"outlined"},te)})},width:"auto"}}}),ue=(0,y.Z)({root:{color:"#f3ba37"}})(ne.Z),le=L=>{var I,$;const{columns:E,actions:T,tableOptions:te,subtitle:Se}=L,{isStarredEntity:Ke,toggleStarredEntity:Ge}=(0,R.CR)(),{loading:Ee,error:Je,entities:ft,filters:Ze}=(0,R.wp)(),ke=(0,F.useMemo)(()=>{var Be;return[Q.createTitleColumn({hidden:!0}),Q.createNameColumn({defaultKind:(Be=Ze.kind)===null||Be===void 0?void 0:Be.value}),...ie(),Q.createMetadataDescriptionColumn(),Q.createTagsColumn()];function ie(){var Te;switch((Te=Ze.kind)===null||Te===void 0?void 0:Te.value){case"user":return[];case"domain":case"system":return[Q.createOwnerColumn()];case"group":case"template":return[Q.createSpecTypeColumn()];case"location":return[Q.createSpecTypeColumn(),Q.createSpecTargetsColumn()];default:return[Q.createSystemColumn(),Q.createOwnerColumn(),Q.createSpecTypeColumn(),Q.createSpecLifecycleColumn()]}}},[(I=Ze.kind)===null||I===void 0?void 0:I.value]),nt=Ze.type===void 0;var at;const ut=(0,_.capitalize)((at=($=Ze.user)===null||$===void 0?void 0:$.value)!==null&&at!==void 0?at:"all");if(Je)return(0,h.jsx)("div",{children:(0,h.jsx)(m.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,h.jsx)(m.Oi,{language:"text",text:Je.toString()})})});const lt=[({entity:Be})=>{var ie;const Te=(ie=Be.metadata.annotations)===null||ie===void 0?void 0:ie[n.l2],Fe="View";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(V.Z,{variant:"srOnly",children:Fe}),(0,h.jsx)(P.Z,{fontSize:"small"})]}),tooltip:Fe,disabled:!Te,onClick:()=>{!Te||window.open(Te,"_blank")}}},({entity:Be})=>{var ie;const Te=(ie=Be.metadata.annotations)===null||ie===void 0?void 0:ie[n.Tf],Fe="Edit";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(V.Z,{variant:"srOnly",children:Fe}),(0,h.jsx)(l.Z,{fontSize:"small"})]}),tooltip:Fe,disabled:!Te,onClick:()=>{!Te||window.open(Te,"_blank")}}},({entity:Be})=>{const ie=Ke(Be),Te=ie?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(V.Z,{variant:"srOnly",children:Te}),ie?(0,h.jsx)(ue,{}):(0,h.jsx)(q.Z,{})]}),tooltip:Te,onClick:()=>Ge(Be)}}],ot=ft.map(Be=>{const ie=(0,R.hF)(Be,n.cz,{kind:"system"}),Te=(0,R.hF)(Be,n.S4);return{entity:Be,resolved:{name:(0,R.$3)(Be,{defaultKind:"Component"}),ownedByRelationsTitle:Te.map(Fe=>(0,R.$3)(Fe,{defaultKind:"group"})).join(", "),ownedByRelations:Te,partOfSystemRelationTitle:ie.map(Fe=>(0,R.$3)(Fe,{defaultKind:"system"})).join(", "),partOfSystemRelations:ie}}}),dt=(E||ke).find(Be=>Be.title==="Type");dt&&(dt.hidden=!nt);const gt=ot.length>20;return(0,h.jsx)(m.iA,{isLoading:Ee,columns:E||ke,options:{paging:gt,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!Ee,padding:"dense",pageSizeOptions:[20,50,100],...te},title:`${ut} (${ft.length})`,data:ot,actions:T||lt,subtitle:Se})};le.columns=Q},24851:function(jt,Me,t){"use strict";t.d(Me,{s:function(){return ue}});var h=t(52322),n=t(90348),m=t(11861),R=t(2784),V=t(79692),y=t(95544),l=t(90436),P=t(52160),ne=t(71399);const q=(0,V.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function _(le){const{href:L,text:I,Icon:$}=le,E=q();return(0,h.jsxs)(y.Z,{display:"flex",children:[(0,h.jsx)(y.Z,{mr:1,className:E.svgIcon,children:(0,h.jsx)(l.Z,{component:"div",children:$?(0,h.jsx)($,{}):(0,h.jsx)(P.Z,{})})}),(0,h.jsx)(y.Z,{flexGrow:"1",children:(0,h.jsx)(ne.rU,{to:L,target:"_blank",rel:"noopener",children:I||L})})]})}var F=t(41156);const X={xs:1,sm:1,md:1,lg:2,xl:3};function Q(le){const L=[(0,F.Z)(T=>T.breakpoints.up("xl"))?"xl":null,(0,F.Z)(T=>T.breakpoints.up("lg"))?"lg":null,(0,F.Z)(T=>T.breakpoints.up("md"))?"md":null,(0,F.Z)(T=>T.breakpoints.up("sm"))?"sm":null,(0,F.Z)(T=>T.breakpoints.up("xs"))?"xs":null];let I=1;if(typeof le=="number")I=le;else{var $;const T=($=L.find(te=>te!==null))!==null&&$!==void 0?$:"xs";var E;I=(E=le==null?void 0:le[T])!==null&&E!==void 0?E:X[T]}return I}function ue(le){const{items:L,cols:I=void 0}=le,$=Q(I);return(0,h.jsx)(n.Z,{rowHeight:"auto",cols:$,children:L.map(({text:E,href:T,Icon:te},Se)=>(0,h.jsx)(m.Z,{children:(0,h.jsx)(_,{href:T,text:E!=null?E:T,Icon:te})},Se))})}},19625:function(jt,Me,t){"use strict";t.d(Me,{_Z:function(){return R},jU:function(){return m},yw:function(){return n}});var h=t(25248);const n=(0,h.x8)({id:"create-component",optional:!0}),m=(0,h.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),R=(0,h.NT)({id:"catalog"})},51666:function(jt,Me,t){"use strict";t.d(Me,{rG:function(){return h},Y2:function(){return $},J$:function(){return ne},g2:function(){return m}});var h;(function(E){E.DENY="DENY",E.ALLOW="ALLOW",E.CONDITIONAL="CONDITIONAL"})(h||(h={}));function n(E,T){return E.name===T.name}function m(E,T){return"resourceType"in E?!T||E.resourceType===T:!1}function R(E){return E.attributes.action==="create"}function V(E){return E.attributes.action==="read"}function y(E){return E.attributes.action==="update"}function l(E){return E.attributes.action==="delete"}function P(E){return{authorize:async(T,te)=>await E.authorize(T,te),authorizeConditional(T,te){const Se=T;return E.authorize(Se,te)}}}function ne({name:E,attributes:T,resourceType:te}){return te?{type:"resource",name:E,attributes:T,resourceType:te}:{type:"basic",name:E,attributes:T}}var q=t(23054),_=t(96279),F=t.n(_),X=t(9571),Q=t(30195);const ue=Q.z.lazy(()=>Q.z.object({rule:Q.z.string(),resourceType:Q.z.string(),params:Q.z.record(Q.z.any())}).or(Q.z.object({anyOf:Q.z.array(ue).nonempty()})).or(Q.z.object({allOf:Q.z.array(ue).nonempty()})).or(Q.z.object({not:ue}))),le=Q.z.object({result:Q.z.literal(h.ALLOW).or(Q.z.literal(h.DENY))}),L=Q.z.union([Q.z.object({result:Q.z.literal(h.ALLOW).or(Q.z.literal(h.DENY))}),Q.z.object({result:Q.z.literal(h.CONDITIONAL),pluginId:Q.z.string(),resourceType:Q.z.string(),conditions:ue})]),I=(E,T)=>Q.z.object({items:Q.z.array(Q.z.intersection(Q.z.object({id:Q.z.string()}),E)).refine(te=>te.length===T.size&&te.every(({id:Se})=>T.has(Se)),{message:"Items in response do not match request"})});class ${async authorize(T,te){return this.makeRequest(T,le,te)}async authorizeConditional(T,te){return this.makeRequest(T,L,te)}async makeRequest(T,te,Se){if(!this.enabled)return T.map(ke=>({result:h.ALLOW}));const Ke={items:T.map(ke=>({id:X.Z(),...ke}))},Ge=await this.discovery.getBaseUrl("permission"),Ee=await F()(`${Ge}/authorize`,{method:"POST",body:JSON.stringify(Ke),headers:{...this.getAuthorizationHeader(Se==null?void 0:Se.token),"content-type":"application/json"}});if(!Ee.ok)throw await q.VL.fromResponse(Ee);const Je=await Ee.json(),Ze=I(te,new Set(Ke.items.map(({id:ke})=>ke))).parse(Je).items.reduce((ke,nt)=>(ke[nt.id]=nt,ke),{});return Ke.items.map(ke=>Ze[ke.id])}getAuthorizationHeader(T){return T?{Authorization:`Bearer ${T}`}:{}}constructor(T){this.discovery=T.discovery;var te;this.enabled=(te=T.config.getOptionalBoolean("permission.enabled"))!==null&&te!==void 0?te:!1}}},25488:function(jt,Me,t){"use strict";t.d(Me,{iM:function(){return y},RV:function(){return R},gI:function(){return P}});var h=t(52322),n=t(2784),m=t(25248);const R=(0,m.T0)({id:"plugin.permission.api"});var V=t(51666);class y{static create(F){const{config:X,discovery:Q,identity:ue}=F,le=new V.Y2({discovery:Q,config:X});return new y(le,ue)}async authorize(F){return(await this.permissionClient.authorize([F],await this.identityApi.getCredentials()))[0]}constructor(F,X){this.permissionClient=F,this.identityApi=X}}var l=t(49857);function P(_){const F=(0,m.h_)(R),{data:X,error:Q}=(0,l.ZP)(_,async ue=>{if((0,V.g2)(ue.permission)&&!ue.resourceRef)return V.rG.DENY;const{result:le}=await F.authorize(ue);return le});return Q?{error:Q,loading:!1,allowed:!1}:X===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:X===V.rG.ALLOW}}const ne=_=>{const{permission:F,resourceRef:X,errorComponent:Q,...ue}=_,le=usePermission(isResourcePermission(F)?{permission:F,resourceRef:X}:{permission:F}),L=useApp(),{NotFoundErrorPage:I}=L.getComponents();let $=Q===void 0?_jsx(I,{}):Q;return le.loading?$=null:le.allowed&&($=_.element),_jsx(Route,{...ue,element:$})};function q(_){const{permission:F,resourceRef:X}=_,Q=usePermission(isResourcePermission(F)?{permission:F,resourceRef:X}:{permission:F}),ue=useApp();if(Q.loading)return null;if(Q.allowed)return _jsx(_Fragment,{children:_.children});if(_.errorPage)return _jsx(_Fragment,{children:_.errorPage});const{NotFoundErrorPage:le}=ue.getComponents();return _jsx(le,{})}},65826:function(jt,Me,t){"use strict";t.d(Me,{FA:function(){return P},qO:function(){return ut},Nd:function(){return Ge},Rx:function(){return E}});var h=t(25248);const n=(0,h.T0)({id:"plugin.search.queryservice"});class m{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(Z){this.mockedResults=Z}}var R=t(52322),V=t(2784),y=t(79692);const l=(0,y.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),P=({text:U,preTag:Z,postTag:he})=>{const ye=l(),be=(0,V.useMemo)(()=>U.split(new RegExp(`(${Z}.+?${he})`)),[he,Z,U]);return(0,R.jsx)(R.Fragment,{children:be.map((De,Oe)=>De.includes(Z)?(0,R.jsx)("mark",{className:ye.highlight,children:De.replace(new RegExp(`${Z}|${he}`,"g"),"")},Oe):De)})};var ne=t(48760),q=t(50581),_=t(61837),F=t(74603),X=t(21853),Q=t(33375),ue=t(76635),le=t(64279),L=t(1849),I=t(51837);const $=(0,I.CT)("search-context"),E=()=>{const U=(0,V.useContext)($);if(!U)throw new Error("useSearch must be used within a SearchContextProvider");const Z=U.atVersion(1);if(!Z)throw new Error("No SearchContext v1 found");return Z},T=()=>(0,V.useContext)($)!==void 0,te={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},Se=(U=te)=>{var Z,he,ye,be;const De=(0,h.h_)(n),[Oe,He]=(0,V.useState)(U.term),[qe,b]=(0,V.useState)(U.types),[W,fe]=(0,V.useState)(U.filters),[de,Ce]=(0,V.useState)(U.pageLimit),[Ie,Ne]=(0,V.useState)(U.pageCursor),rt=(0,L.Z)(Oe),xt=(0,L.Z)(W),vt=(0,le.default)(()=>De.query({term:Oe,types:qe,filters:W,pageLimit:de,pageCursor:Ie}),[Oe,qe,W,de,Ie]),st=!vt.loading&&!vt.error&&((Z=vt.value)===null||Z===void 0?void 0:Z.nextPageCursor),pt=!vt.loading&&!vt.error&&((he=vt.value)===null||he===void 0?void 0:he.previousPageCursor),At=(0,V.useCallback)(()=>{var Dt;Ne((Dt=vt.value)===null||Dt===void 0?void 0:Dt.nextPageCursor)},[(ye=vt.value)===null||ye===void 0?void 0:ye.nextPageCursor]),Et=(0,V.useCallback)(()=>{var Dt;Ne((Dt=vt.value)===null||Dt===void 0?void 0:Dt.previousPageCursor)},[(be=vt.value)===null||be===void 0?void 0:be.previousPageCursor]);return(0,V.useEffect)(()=>{rt!==void 0&&Oe!==rt&&Ne(void 0)},[Oe,rt,Ne]),(0,V.useEffect)(()=>{xt!==void 0&&!(0,ue.isEqual)(W,xt)&&Ne(void 0)},[W,xt,Ne]),{result:vt,term:Oe,setTerm:He,types:qe,setTypes:b,filters:W,setFilters:fe,pageLimit:de,setPageLimit:Ce,pageCursor:Ie,setPageCursor:Ne,fetchNextPage:st?At:void 0,fetchPreviousPage:pt?Et:void 0}},Ke=U=>{const{initialState:Z,children:he}=U,ye=Se(Z);return(0,R.jsx)(h.fC,{attributes:{searchTypes:ye.types.sort().join(",")},children:(0,R.jsx)($.Provider,{value:(0,I.EI)({1:ye}),children:he})})},Ge=U=>{const{initialState:Z,inheritParentContextIfAvailable:he,children:ye}=U;return T()&&he?(0,R.jsx)(R.Fragment,{children:ye}):(0,R.jsx)(Ke,{initialState:Z,children:ye})},Ee=({children:U})=>{const Z=(0,h.z$)(),{term:he}=E();return(0,V.useEffect)(()=>{he&&Z.captureEvent("search",he)},[Z,he]),(0,R.jsx)(R.Fragment,{children:U})};function Je(U){return(0,V.forwardRef)((Z,he)=>(0,R.jsx)(Ge,{inheritParentContextIfAvailable:!0,children:(0,R.jsx)(U,{...Z,ref:he})}))}const ft=Je((0,V.forwardRef)((U,Z)=>{const{onChange:he,onKeyDown:ye=()=>{},onClear:be=()=>{},onSubmit:De=()=>{},debounceTime:Oe=200,clearButton:He=!0,fullWidth:qe=!0,value:b,placeholder:W,inputProps:fe={},endAdornment:de,...Ce}=U,Ie=(0,h.h_)(h.Ds),[Ne,rt]=(0,V.useState)("");(0,V.useEffect)(()=>{rt(It=>It!==b?String(b):It)},[b]),(0,ne.Z)(()=>he(Ne),Oe,[Ne]);const xt=(0,V.useCallback)(It=>{rt(It.target.value)},[rt]),vt=(0,V.useCallback)(It=>{ye&&ye(It),De&&It.key==="Enter"&&De()},[ye,De]),st=(0,V.useCallback)(()=>{he(""),be&&be()},[he,be]),pt=W!=null?W:`Search in ${Ie.getOptionalString("app.title")||"Backstage"}`,At=(0,R.jsx)(q.Z,{position:"start",children:(0,R.jsx)(_.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,R.jsx)(X.Z,{})})}),Et=(0,R.jsx)(q.Z,{position:"end",children:(0,R.jsx)(_.Z,{"aria-label":"Clear",size:"small",onClick:st,children:(0,R.jsx)(Q.Z,{})})});return(0,R.jsx)(Ee,{children:(0,R.jsx)(F.Z,{"data-testid":"search-bar-next",ref:Z,value:Ne,placeholder:pt,startAdornment:At,endAdornment:He?Et:de,inputProps:{"aria-label":"Search",...fe},fullWidth:qe,onChange:xt,onKeyDown:vt,...Ce})})})),Ze=Je((0,V.forwardRef)((U,Z)=>{const{value:he="",onChange:ye,...be}=U,{term:De,setTerm:Oe}=E();(0,V.useEffect)(()=>{he&&Oe(String(he))},[he,Oe]);const He=(0,V.useCallback)(qe=>{ye?ye(qe):Oe(qe)},[ye,Oe]);return(0,R.jsx)(h.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,R.jsx)(ft,{...be,ref:Z,value:De,onChange:He})})}));var ke=t(4614),nt=t(88013);const ut=(U=>Z=>(0,R.jsx)(Ge,{inheritParentContextIfAvailable:!0,children:(0,R.jsx)(U,{...Z})}))(function(Z){const{loading:he,value:ye,onChange:be=()=>{},options:De=[],getOptionLabel:Oe=st=>String(st),inputPlaceholder:He,inputDebounceTime:qe,freeSolo:b=!0,fullWidth:W=!0,clearOnBlur:fe=!1,"data-testid":de="search-autocomplete",...Ce}=Z,{setTerm:Ie}=E(),Ne=(0,V.useCallback)(st=>st?typeof st=="string"?st:Oe(st):"",[Oe]),rt=(0,V.useMemo)(()=>Ne(ye),[ye,Ne]),xt=(0,V.useCallback)((st,pt,At,Et)=>{Ie(Ne(pt)),be(st,pt,At,Et)},[Ne,Ie,be]),vt=(0,V.useCallback)(({InputProps:{ref:st,endAdornment:pt},InputLabelProps:At,...Et})=>(0,R.jsx)(Ze,{...Et,ref:st,clearButton:!1,value:rt,placeholder:He,debounceTime:qe,endAdornment:he?(0,R.jsx)(ke.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):pt}),[he,rt,He,qe]);return(0,R.jsx)(nt.ZP,{...Ce,"data-testid":de,value:ye,onChange:xt,options:De,getOptionLabel:Oe,renderInput:vt,freeSolo:b,fullWidth:W,clearOnBlur:fe})}),lt=({icon:U,primaryText:Z,primaryTextTypographyProps:he,secondaryText:ye,secondaryTextTypographyProps:be,disableTextTypography:De})=>_jsxs(_Fragment,{children:[U?_jsx(ListItemIcon,{children:U}):null,_jsx(ListItemText,{primary:Z,primaryTypographyProps:he,secondary:ye,secondaryTypographyProps:be,disableTypography:De})]});var ot=t(42494),dt=t(84899),gt=t(5806),Be=t(21324),ie=t(56939),Te=t(73698),Fe=t(12231),mt=t(86619),bt=t(7089),Pt=t(69294);const ht=(U,Z,he=[],ye=250)=>{const be=(0,V.useRef)({}),De=U||(()=>Promise.resolve([])),[Oe,He]=(0,Pt.default)(De,[Z],{loading:!0});if((0,ne.Z)(()=>{be.current[Z]===void 0&&(be.current[Z]=He(Z).then(b=>(be.current[Z]=b,b)))},ye,[He,Z]),he.length)return{loading:!1,value:he};const qe=be.current[Z];return Array.isArray(qe)?{loading:!1,value:qe}:Oe},Ct=(U,Z)=>{const{setFilters:he}=E();(0,V.useEffect)(()=>{Z&&[Z].flat().length>0&&he(ye=>({...ye,[U]:Z}))},[])},Tt=U=>{const{className:Z,defaultValue:he,name:ye,values:be,valuesDebounceMs:De,label:Oe,filterSelectedOptions:He,limitTags:qe,multiple:b}=U,[W,fe]=(0,V.useState)("");Ct(ye,he);const de=typeof be=="function"?be:void 0,Ce=typeof be=="function"?void 0:be,{value:Ie,loading:Ne}=ht(de,W,Ce,De),{filters:rt,setFilters:xt}=E(),vt=rt[ye]||(b?[]:null),st=(Et,It)=>{xt(Dt=>{const{[ye]:In,...Dn}=Dt;return It?{...Dn,[ye]:It}:{...Dn}})},pt=Et=>(0,R.jsx)(mt.Z,{...Et,name:"search",variant:"outlined",label:Oe,fullWidth:!0}),At=(Et,It)=>Et.map((Dt,In)=>(0,R.jsx)(bt.Z,{label:Dt,color:"primary",...It({index:In})}));return(0,R.jsx)(nt.ZP,{filterSelectedOptions:He,limitTags:qe,multiple:b,className:Z,id:`${b?"multi-":""}select-filter-${ye}--select`,options:Ie||[],loading:Ne,value:vt,onChange:st,onInputChange:(Et,It)=>fe(It),renderInput:pt,renderTags:At})},kt=(0,y.Z)({label:{textTransform:"capitalize"}}),_t=U=>{const{className:Z,defaultValue:he,label:ye,name:be,values:De=[],valuesDebounceMs:Oe}=U,He=kt(),{filters:qe,setFilters:b}=E();Ct(be,he);const W=typeof De=="function"?De:void 0,fe=typeof De=="function"?void 0:De,{value:de=[],loading:Ce}=ht(W,"",fe,Oe),Ie=rt=>{const{target:{value:xt,checked:vt}}=rt;b(st=>{const{[be]:pt,...At}=st,Et=(pt||[]).filter(Dt=>Dt!==xt),It=vt?[...Et,xt]:Et;return It.length?{...At,[be]:It}:At})};var Ne;return(0,R.jsxs)(ot.Z,{className:Z,disabled:Ce,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[ye?(0,R.jsx)(dt.Z,{className:He.label,children:ye}):null,de.map(rt=>(0,R.jsx)(gt.Z,{control:(0,R.jsx)(Be.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":rt},value:rt,name:rt,onChange:Ie,checked:((Ne=qe[be])!==null&&Ne!==void 0?Ne:[]).includes(rt)}),label:rt},rt))]})},en=U=>{const{className:Z,defaultValue:he,label:ye,name:be,values:De,valuesDebounceMs:Oe}=U,He=kt();Ct(be,he);const qe=typeof De=="function"?De:void 0,b=typeof De=="function"?void 0:De,{value:W=[],loading:fe}=ht(qe,"",b,Oe),{filters:de,setFilters:Ce}=E(),Ie=Ne=>{const{target:{value:rt}}=Ne;Ce(xt=>{const{[be]:vt,...st}=xt;return rt?{...st,[be]:rt}:st})};return(0,R.jsxs)(ot.Z,{disabled:fe,className:Z,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[ye?(0,R.jsx)(ie.Z,{className:He.label,margin:"dense",children:ye}):null,(0,R.jsxs)(Te.Z,{variant:"outlined",value:de[be]||"",onChange:Ie,children:[(0,R.jsx)(Fe.Z,{value:"",children:(0,R.jsx)("em",{children:"All"})}),W.map(Ne=>(0,R.jsx)(Fe.Z,{value:Ne,children:Ne},Ne))]})]})},Kt=({component:U,...Z})=>(0,R.jsx)(U,{...Z});Kt.Checkbox=U=>(0,R.jsx)(Kt,{...U,component:_t}),Kt.Select=U=>(0,R.jsx)(Kt,{...U,component:en}),Kt.Autocomplete=U=>(0,R.jsx)(Kt,{...U,component:Tt});var Xt=t(71399);const ln=U=>{const{children:Z}=U,ye=useSearch().result;return Z(ye)},qt=U=>{const{query:Z,children:he}=U,ye=useApi(searchApiRef),be=useAsync(()=>{const{term:De="",types:Oe=[],filters:He={},...qe}=Z;return ye.query({...qe,term:De,types:Oe,filters:He})},[Z]);return he(be)},jn=U=>{const{query:Z,children:he}=U;return Z?_jsx(qt,{query:Z,children:he}):_jsx(ln,{children:he})},on=U=>{const{query:Z,children:he}=U;return _jsx(jn,{query:Z,children:({loading:ye,error:be,value:De})=>ye?_jsx(Progress,{}):be?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:be}):De!=null&&De.results.length?he(De):_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"})})},En=U=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(on,{...U})}),cn=(0,y.Z)(U=>({root:{display:"flex",justifyContent:"space-between",gap:U.spacing(2),margin:U.spacing(2,0)}})),Wn=()=>{const{fetchNextPage:U,fetchPreviousPage:Z}=useSearch(),he=cn();return!U&&!Z?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:he.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!Z,onClick:Z,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!U,onClick:U,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})};var Vt=t(48834).lW;const bn=U=>Vt.from(U.toString(),"utf-8").toString("base64"),An=U=>U?Number(Vt.from(U,"base64").toString("utf-8")):0,Ut=U=>{const{total:Z=-1,cursor:he,onCursorChange:ye,limit:be=25,limitLabel:De="Results per page:",limitText:Oe=({from:Ce,to:Ie})=>Z>0?`of ${Z}`:`${Ce}-${Ie}`,limitOptions:He,onLimitChange:qe,...b}=U,W=useMemo(()=>An(he),[he]),fe=useCallback((Ce,Ie)=>{ye==null||ye(bn(Ie))},[ye]),de=useCallback(Ce=>{const Ie=Ce.target.value;qe==null||qe(parseInt(Ie,10))},[qe]);return _jsx(TablePagination,{...b,component:"div",count:Z,page:W,onPageChange:fe,rowsPerPage:be,labelRowsPerPage:De,labelDisplayedRows:Oe,rowsPerPageOptions:He,onRowsPerPageChange:de})},dn=U=>{const{pageLimit:Z,setPageLimit:he,pageCursor:ye,setPageCursor:be}=useSearch();return _jsx(Ut,{...U,limit:Z,onLimitChange:he,cursor:ye,onCursorChange:be})},un=({result:U,highlight:Z,rank:he,icon:ye,secondaryAction:be,lineClamp:De=5})=>{const Oe=useAnalytics(),He=()=>{Oe.captureEvent("discover",U.title,{attributes:{to:U.location},value:he})};return _jsxs(Link,{noTrack:!0,to:U.location,onClick:He,children:[_jsxs(ListItem,{alignItems:"center",children:[ye&&_jsx(ListItemIcon,{children:ye}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:Z!=null&&Z.fields.title?_jsx(HighlightedSearchResultText,{text:Z.fields.title,preTag:Z.preTag,postTag:Z.postTag}):U.title,secondary:_jsx("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:De,overflow:"hidden"},children:Z!=null&&Z.fields.text?_jsx(HighlightedSearchResultText,{text:Z.fields.text,preTag:Z.preTag,postTag:Z.postTag}):U.text})}),be&&_jsx(Box,{alignItems:"flex-end",children:be})]}),_jsx(Divider,{})]})},Sn=U=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(un,{...U})}),Tn=U=>{const{loading:Z,error:he,resultItems:ye,renderResultItem:be=He=>_jsx(DefaultResultListItem,{result:He.document},He.document.location),noResultsComponent:De=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Oe}=U;return _jsxs(List,{...Oe,children:[Z?_jsx(Progress,{}):null,!Z&&he?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:he}):null,!Z&&!he&&(ye==null?void 0:ye.length)?ye.map(be):null,!Z&&!he&&!(ye!=null&&ye.length)?_jsx(ListItem,{children:De}):null]})},pn=U=>{const{query:Z,disableRenderingWithNoResults:he,...ye}=U;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:Z,children:({loading:be,error:De,value:Oe})=>{var He;return!(!(Oe==null||(He=Oe.results)===null||He===void 0)&&He.length)&&he?null:_jsx(Tn,{...ye,loading:be,error:De,resultItems:Oe==null?void 0:Oe.results})}})})};var ge=t(19126);const ee=(0,y.Z)(U=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:U.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:U.palette.text.secondary,margin:U.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:U.palette.text.secondary,margin:U.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:U.spacing(.5)}})),Ae=U=>{const Z=ee(),{label:he,children:ye,...be}=U;return _jsx(Chip,{...be,className:Z.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[he,": ",ye]})})},Ue=()=>null,_e=(0,y.Z)(U=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:U.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:U.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),et=U=>{const Z=_e(),{label:he,value:ye="None",onChange:be,onDelete:De}=U,Oe=useCallback(He=>{be(He.target.value)},[be]);return _jsx(Ae,{label:he,onDelete:De,children:_jsx(Typography,{role:"textbox",component:"span",className:Z.root,onChange:Oe,contentEditable:!0,suppressContentEditableWarning:!0,children:ye})})},Y=(0,y.Z)(U=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:U.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),O=U=>{const Z=Y(),{label:he,value:ye="none",onChange:be,onDelete:De,children:Oe}=U,He=useCallback(qe=>{be(qe.target.value)},[be]);return _jsx(Ae,{label:he,onDelete:De,children:_jsxs(Select,{className:Z.root,value:ye,onChange:He,input:_jsx(InputBase,{}),IconComponent:Ue,children:[_jsx(MenuItem,{value:"none",children:"None"}),Oe]})})};function ae(U){const Z=ee(),[he,ye]=useState(null),{loading:be,error:De,icon:Oe,title:He,titleProps:qe={},link:b=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:Z.listSubheaderLinkIcon})]}),linkProps:W={},filterOptions:fe,renderFilterOption:de=Et=>_jsx(MenuItem,{value:String(Et),children:Et},String(Et)),filterFields:Ce,renderFilterField:Ie,resultItems:Ne,renderResultItem:rt=Et=>_jsx(DefaultResultListItem,{result:Et.document},Et.document.location),noResultsComponent:xt=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...vt}=U,st=useCallback(Et=>{ye(Et.currentTarget)},[]),pt=useCallback(()=>{ye(null)},[]);var At;return _jsxs(List,{...vt,children:[_jsxs(ListSubheader,{className:Z.listSubheader,children:[Oe,_jsx(Typography,{className:Z.listSubheaderName,component:"strong",...qe,children:He}),fe?_jsx(Chip,{className:Z.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:st}):null,fe?_jsx(Menu,{id:"filters-menu",anchorEl:he,open:Boolean(he),onClose:pt,onClick:pt,keepMounted:!0,children:fe.map(de)}):null,Ce==null?void 0:Ce.map(Et=>(At=Ie==null?void 0:Ie(Et))!==null&&At!==void 0?At:null),_jsx(Link,{className:Z.listSubheaderLink,to:"/search",...W,children:b})]}),be?_jsx(Progress,{}):null,!be&&De?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:De}):null,!be&&!De&&(Ne==null?void 0:Ne.length)?Ne.map(rt):null,!be&&!De&&!(Ne!=null&&Ne.length)?_jsx(ListItem,{children:xt}):null]})}function We(U){const{query:Z,linkProps:he={},disableRenderingWithNoResults:ye,...be}=U,De=`/search?${qs.stringify({query:Z.term,types:Z.types,filters:Z.filters,pageCursor:Z.pageCursor},{arrayFormat:"brackets"})}`;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:Z,children:({loading:Oe,error:He,value:qe})=>{var b;if(!(!(qe==null||(b=qe.results)===null||b===void 0)&&b.length)&&ye)return null;var W;return _jsx(ae,{...be,loading:Oe,error:He,linkProps:{to:De,...he},resultItems:qe==null?void 0:qe.results,filterFields:Object.keys((W=Z.filters)!==null&&W!==void 0?W:{})})}})})}},61886:function(jt,Me,t){"use strict";t.d(Me,{Ox:function(){return ke},Zz:function(){return y},oZ:function(){return Ge},DR:function(){return l},ZS:function(){return Se},VA:function(){return ut},KY:function(){return ne},gT:function(){return Q},Dl:function(){return ue},ux:function(){return at},$L:function(){return X},x1:function(){return Ke}});var h=t(52322),n=t(2784),m=t(10289),R=t(25248);const V="techdocs.addons.addon.v1",y="techdocs.addons.wrapper.v1",l=()=>null;(0,R.R5)(l,y,!0);const P=ie=>`${V}.${ie.toLocaleLowerCase("en-US")}`;function ne(ie){const{name:Te,component:Fe}=ie;return(0,R.YO)({name:Te,component:{sync:mt=>(0,h.jsx)(Fe,{...mt})},data:{[V]:ie,[P(Te)]:!0}})}const q=(ie,Te)=>ie.selectByComponentData({key:Te}).getElements()[0],_=ie=>ie.selectByComponentData({key:y}).selectByComponentData({key:V}),F=ie=>ie.selectByComponentData({key:y}).findComponentData({key:V}),X=()=>{const ie=(0,m.pC)(),Te=(0,R.vJ)(ie,_),Fe=(0,R.vJ)(ie,F),mt=(0,n.useCallback)(ht=>{if(!Te||!ht)return null;const Ct=P(ht.name);var Tt;return(Tt=q(Te,Ct))!==null&&Tt!==void 0?Tt:null},[Te]),bt=(0,n.useCallback)(ht=>{const Ct=Fe.find(Tt=>Tt.name===ht);return Ct?mt(Ct):null},[Fe,mt]),Pt=(0,n.useCallback)(ht=>{const Ct=Fe.filter(Tt=>Tt.location===ht);return Ct.length?Ct.map(mt):null},[Fe,mt]);return{renderComponentByName:bt,renderComponentsByLocation:Pt}},Q=(0,R.T0)({id:"plugin.techdocs.service"}),ue=(0,R.T0)({id:"plugin.techdocs.storageservice"});var le=t(64279),L=t(25271),I=t(51837);function $(ie,Te){return Te.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(ie.kind=ie.kind.toLocaleLowerCase(),ie.name=ie.name.toLocaleLowerCase(),ie.namespace=ie.namespace.toLocaleLowerCase()),ie}const E=(ie,Te)=>(0,L.eE)(ie)===(0,L.eE)(Te),T={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},te=(0,I.CT)("techdocs-reader-page-context"),Se=(0,n.memo)(({entityRef:ie,children:Te})=>{const Fe=(0,R.h_)(Q),mt=(0,R.h_)(R.Ds),bt=(0,le.default)(async()=>Fe.getTechDocsMetadata(ie),[ie]),Pt=(0,le.default)(async()=>Fe.getEntityMetadata(ie),[ie]),[ht,Ct]=(0,n.useState)(T.title),[Tt,kt]=(0,n.useState)(T.subtitle),[_t,en]=(0,n.useState)(T.shadowRoot),Kt={metadata:bt,entityRef:$(ie,mt),entityMetadata:Pt,shadowRoot:_t,setShadowRoot:en,title:ht,setTitle:Ct,subtitle:Tt,setSubtitle:kt},Xt=(0,I.EI)({1:Kt});return(0,h.jsx)(te.Provider,{value:Xt,children:Te instanceof Function?Te(Kt):Te})},(ie,Te)=>E(ie.entityRef,Te.entityRef)),Ke=()=>{const ie=(0,n.useContext)(te);if(ie===void 0)return T;const Te=ie.atVersion(1);if(Te===void 0)throw new Error("No context found for version 1.");return Te},Ge=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var Ee=t(70882),Je=t(50236),ft=t(19219),Ze=t(71399);const ke="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",nt=ie=>{(0,n.useEffect)(()=>{if(!ie)return()=>{};const Te=ie.querySelectorAll('head > link[rel="stylesheet"]');var Fe;let mt=(Fe=Te==null?void 0:Te.length)!==null&&Fe!==void 0?Fe:0;const bt=new CustomEvent(ke);if(!mt)return ie.dispatchEvent(bt),()=>{};const Pt=()=>{--mt===0&&ie.dispatchEvent(bt)};return Te==null||Te.forEach(ht=>{ht.addEventListener("load",Pt)}),()=>{Te==null||Te.forEach(ht=>{ht.removeEventListener("load",Pt)})}},[ie])},at=ie=>{const[Te,Fe]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(!ie)return()=>{};Fe(!0);const mt=ie.style;mt.setProperty("opacity","0");const bt=()=>{Fe(!1),mt.setProperty("opacity","1")};return ie.addEventListener(ke,bt),()=>{ie.removeEventListener(ke,bt)}},[ie]),Te},ut=({element:ie,onAppend:Te,children:Fe})=>{const[mt,bt]=(0,n.useState)((0,Ee.Ue)({...(0,Je.Z)(),insertionPoint:void 0}));nt(ie);const Pt=at(ie),ht=(0,n.useCallback)(Ct=>{if(!ie||!Ct)return;bt((0,Ee.Ue)({...(0,Je.Z)(),insertionPoint:ie.querySelector("head")||void 0}));let Tt=Ct.shadowRoot;Tt||(Tt=Ct.attachShadow({mode:"open"})),Tt.replaceChildren(ie),typeof Te=="function"&&Te(Tt)},[ie,Te]);return(0,h.jsxs)(h.Fragment,{children:[Pt&&(0,h.jsx)(Ze.Ex,{}),(0,h.jsxs)(ft.ZP,{jss:mt,sheetsManager:new Map,children:[(0,h.jsx)("div",{ref:ht,"data-testid":"techdocs-native-shadowroot"}),Fe]})]})};var lt=t(54073);const ot=()=>{const{shadowRoot:ie}=useTechDocsReaderPage();return ie},dt=ie=>{const Te=ot();return Te?ie.map(Fe=>Te==null?void 0:Te.querySelectorAll(Fe)).filter(Fe=>Fe.length).map(Fe=>Array.from(Fe)).flat():[]},gt=ie=>ie.toString()&&ie.rangeCount&&ie.getRangeAt(0).getBoundingClientRect().top,Be=(ie=0)=>{const Te=ot(),[Fe,mt]=useState(null),bt=useMemo(()=>debounce(()=>{const Pt=Te,ht=Pt.getSelection?Pt.getSelection():document.getSelection();ht&>(ht)?mt(ht):mt(null)},ie),[Te,mt,ie]);return useEffect(()=>(window.document.addEventListener("selectionchange",bt),()=>window.document.removeEventListener("selectionchange",bt)),[bt]),Fe}},52943:function(jt,Me,t){"use strict";t.r(Me),t.d(Me,{EmbeddedDocsRouter:function(){return le},Router:function(){return ue},isTechDocsAvailable:function(){return Q}});var h=t(52322),n=t(2784),m=t(10289),R=t(43297),V=t(71399),y=t(25271),l=t(89258),P=t(65124),ne=t(67896);const q=({entity:L})=>{const I=(0,y.iB)(L);return(0,h.jsxs)(l.I6,{entityRef:I,children:[(0,h.jsx)(P.b,{}),(0,h.jsx)(ne.F,{withSearch:!1})]})};var _=t(18662),F=t(7476);const X="backstage.io/techdocs-ref",Q=L=>{var I,$;return Boolean(L==null||(I=L.metadata)===null||I===void 0||($=I.annotations)===null||$===void 0?void 0:$[X])},ue=()=>(0,h.jsxs)(m.Z5,{children:[(0,h.jsx)(m.AW,{path:"/",element:(0,h.jsx)(_.TechDocsIndexPage,{})}),(0,h.jsx)(m.AW,{path:"/:namespace/:kind/:name/*",element:(0,h.jsx)(F.TechDocsReaderPage,{})})]}),le=L=>{var I;const{children:$}=L,{entity:E}=(0,R.X2)(),T=(0,m.V$)([{path:"/*",element:(0,h.jsx)(q,{entity:E}),children:[{path:"*",element:$}]}]);return((I=E.metadata.annotations)===null||I===void 0?void 0:I[X])?T:(0,h.jsx)(V.sk,{annotation:X})}},92077:function(jt,Me,t){"use strict";t.d(Me,{k:function(){return V},p:function(){return R}});var h=t(23054),n=t(76372),m=t.n(n);class R{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(l){const{kind:P,namespace:ne,name:q}=l,F=`${await this.getApiOrigin()}/metadata/techdocs/${ne}/${P}/${q}`,X=await this.fetchApi.fetch(`${F}`);if(!X.ok)throw await h.VL.fromResponse(X);return await X.json()}async getEntityMetadata(l){const{kind:P,namespace:ne,name:q}=l,F=`${await this.getApiOrigin()}/metadata/entity/${ne}/${P}/${q}`,X=await this.fetchApi.fetch(`${F}`);if(!X.ok)throw await h.VL.fromResponse(X);return await X.json()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.fetchApi=l.fetchApi}}class V{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var l;return(l=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&l!==void 0?l:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(l,P){const{kind:ne,namespace:q,name:_}=l,X=`${await this.getStorageUrl()}/${q}/${ne}/${_}/${P}`,Q=await this.fetchApi.fetch(`${X.endsWith("/")?X:`${X}/`}index.html`);let ue="";switch(Q.status){case 404:throw ue="Page not found. ",P||(ue+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(ue);case 500:throw ue="Could not generate documentation or an error in the TechDocs backend. ",new Error(ue);default:break}return Q.text()}async syncEntityDocs(l,P=()=>{}){const{kind:ne,namespace:q,name:_}=l,X=`${await this.getApiOrigin()}/sync/${q}/${ne}/${_}`,{token:Q}=await this.identityApi.getCredentials();return new Promise((ue,le)=>{const L=new n.EventSourcePolyfill(X,{withCredentials:!0,headers:Q?{Authorization:`Bearer ${Q}`}:{}});L.addEventListener("log",I=>{I.data&&P(JSON.parse(I.data))}),L.addEventListener("finish",I=>{let $=!1;I.data&&({updated:$}=JSON.parse(I.data)),ue($?"updated":"cached")}),L.onerror=I=>{switch(L.close(),I.status){case 404:le(new h.dR(I.message));return;default:le(new Error(I.data));return}}})}async getBaseUrl(l,P,ne){const{kind:q,namespace:_,name:F}=P,Q=`${await this.getApiOrigin()}/static/docs/${_}/${q}/${F}/${ne}`;return new URL(l,Q.endsWith("/")?Q:`${Q}/`).toString()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.identityApi=l.identityApi,this.fetchApi=l.fetchApi}}},51953:function(jt,Me,t){"use strict";t.d(Me,{D:function(){return h}});function h(n,m){return m.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?n:n.toLocaleLowerCase("en-US")}},3482:function(jt,Me,t){"use strict";t.d(Me,{u:function(){return P}});var h=t(52322),n=t(2784),m=t(71399),R=t(43297),V=t(42081),y=t(48431),l=t(68435);const P=ne=>{const{initialFilter:q="owned",columns:_,actions:F}=ne;return(0,h.jsx)(V.j,{children:(0,h.jsxs)(m.VY,{children:[(0,h.jsx)(m.yW,{title:"",children:(0,h.jsx)(m.qt,{children:"Discover documentation in your ecosystem."})}),(0,h.jsx)(R.UO,{children:(0,h.jsxs)(R._i,{children:[(0,h.jsxs)(R._i.Filters,{children:[(0,h.jsx)(y.f,{}),(0,h.jsx)(R.EW,{initialFilter:q}),(0,h.jsx)(R.dq,{}),(0,h.jsx)(R.xE,{})]}),(0,h.jsx)(R._i.Content,{children:(0,h.jsx)(l.n,{actions:F,columns:_})})]})})]})})}},85478:function(jt,Me,t){"use strict";t.d(Me,{f:function(){return _}});var h=t(52322),n=t(95573),m=t(51953),R=t(25248),V=t(71399),y=t(94339),l=t(16111),P=t(24579),ne=t(14503),q=t(2784);const _=Q=>{const{entities:ue}=Q,le=(0,R.tg)(n.Fw),L=(0,R.h_)(R.Ds);if(!ue)return null;var I,$;return(0,h.jsx)(V.Oh,{"data-testid":"docs-explore",children:ue!=null&&ue.length?ue.map((E,T)=>(0,h.jsxs)(y.Z,{children:[(0,h.jsx)(l.Z,{children:(0,h.jsx)(V.hu,{title:(I=E.metadata.title)!==null&&I!==void 0?I:E.metadata.name})}),(0,h.jsx)(P.Z,{children:E.metadata.description}),(0,h.jsx)(ne.Z,{children:(0,h.jsx)(V.zx,{to:le({namespace:(0,m.D)(($=E.metadata.namespace)!==null&&$!==void 0?$:"default",L),kind:(0,m.D)(E.kind,L),name:(0,m.D)(E.metadata.name,L)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},T)):null})};var F=t(43297);const X=()=>{const{loading:Q,error:ue,entities:le}=useEntityList();if(ue)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:ue.toString()})});if(Q||!le)return _jsx(Progress,{});var L,I;return le.sort(($,E)=>((L=$.metadata.title)!==null&&L!==void 0?L:$.metadata.name).localeCompare((I=E.metadata.title)!==null&&I!==void 0?I:E.metadata.name)),_jsx(DocsCardGrid,{entities:le})}},68435:function(jt,Me,t){"use strict";t.d(Me,{H:function(){return $},n:function(){return E}});var h=t(52322),n=t(2784),m=t(95074),R=t(76635),V=t(71399),y=t(43297),l=t(25248),P=t(25271),ne=t(95573),q=t(39981),_=t(2337),F=t(11640),X=t(28347);const Q=(0,_.Z)({root:{color:"#f3ba37"}})(F.Z),ue={createCopyDocsUrlAction(T){return te=>({icon:()=>(0,h.jsx)(q.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>T(`${window.location.origin}${te.resolved.docsUrl}`)})},createStarEntityAction(T,te){return({entity:Se})=>{const Ke=T(Se);return{cellStyle:{paddingLeft:"1em"},icon:()=>Ke?(0,h.jsx)(Q,{}):(0,h.jsx)(X.Z,{}),tooltip:Ke?"Remove from favorites":"Add to favorites",onClick:()=>te(Se)}}}};function le(T){return T.metadata.title||T.metadata.name}const L={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:T=>(0,h.jsx)(V.uw,{value:(0,h.jsx)(V.rU,{to:T.resolved.docsUrl,children:le(T.entity)}),subvalue:T.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:T})=>(0,h.jsx)(y.rI,{entityRefs:T.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var I=t(51953);const $=T=>{const{entities:te,title:Se,loading:Ke,columns:Ge,actions:Ee}=T,[,Je]=(0,m.Z)(),ft=(0,l.tg)(ne.Fw),Ze=(0,l.h_)(l.Ds);if(!te)return null;const ke=te.map(ut=>{const lt=(0,y.hF)(ut,P.S4);var ot;return{entity:ut,resolved:{docsUrl:ft({namespace:(0,I.D)((ot=ut.metadata.namespace)!==null&&ot!==void 0?ot:"default",Ze),kind:(0,I.D)(ut.kind,Ze),name:(0,I.D)(ut.metadata.name,Ze)}),ownedByRelations:lt,ownedByRelationsTitle:lt.map(dt=>(0,y.$3)(dt,{defaultKind:"group"})).join(", ")}}}),nt=[L.createNameColumn(),L.createOwnerColumn(),L.createTypeColumn()],at=[ue.createCopyDocsUrlAction(Je)];return(0,h.jsx)(h.Fragment,{children:Ke||ke&&ke.length>0?(0,h.jsx)(V.iA,{isLoading:Ke,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1},data:ke,columns:Ge||nt,actions:Ee||at,title:Se?`${Se} (${ke.length})`:`All (${ke.length})`}):(0,h.jsx)(V.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,h.jsx)(V.zx,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};$.columns=L,$.actions=ue;const E=T=>{var te;const{columns:Se,actions:Ke}=T,{loading:Ge,error:Ee,entities:Je,filters:ft}=(0,y.wp)(),{isStarredEntity:Ze,toggleStarredEntity:ke}=(0,y.CR)(),[,nt]=(0,m.Z)();var at;const ut=(0,R.capitalize)((at=(te=ft.user)===null||te===void 0?void 0:te.value)!==null&&at!==void 0?at:"all"),lt=[ue.createCopyDocsUrlAction(nt),ue.createStarEntityAction(Ze,ke)];return Ee?(0,h.jsx)(V.GB,{severity:"error",title:"Could not load available documentation.",children:(0,h.jsx)(V.Oi,{language:"text",text:Ee.toString()})}):(0,h.jsx)($,{title:ut,entities:Je,loading:Ge,actions:Ke||lt,columns:Se})};E.columns=L,E.actions=ue},18662:function(jt,Me,t){"use strict";t.r(Me),t.d(Me,{TechDocsIndexPage:function(){return V}});var h=t(52322),n=t(2784),m=t(10289),R=t(3482);const V=y=>(0,m.pC)()||(0,h.jsx)(R.u,{...y})},42081:function(jt,Me,t){"use strict";t.d(Me,{j:function(){return V}});var h=t(52322),n=t(2784),m=t(71399),R=t(25248);const V=y=>{const{children:l}=y,P=(0,R.h_)(R.Ds);var ne;const q=`Documentation available in ${(ne=P.getOptionalString("organization.name"))!==null&&ne!==void 0?ne:"Backstage"}`;return(0,h.jsx)(m.g9,{title:"Documentation",subtitle:q,themeId:"documentation",children:l})}},48431:function(jt,Me,t){"use strict";t.d(Me,{f:function(){return R}});var h=t(2784),n=t(43297);class m{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":n.n3}}}const R=()=>{const{updateFilters:V}=(0,n.wp)();return(0,h.useEffect)(()=>{V({techdocs:new m})},[V]),null}},89258:function(jt,Me,t){"use strict";t.d(Me,{I6:function(){return q},Jl:function(){return ne},s4:function(){return V}});var h=t(61886),n=t(92077),m=t(95573),R=t(25248);const V=(0,R.rx)({id:"techdocs",apis:[(0,R.ni)({api:h.Dl,deps:{configApi:R.Ds,discoveryApi:R.NW,identityApi:R.$4,fetchApi:R.gP},factory:({configApi:_,discoveryApi:F,identityApi:X,fetchApi:Q})=>new n.k({configApi:_,discoveryApi:F,identityApi:X,fetchApi:Q})}),(0,R.ni)({api:h.gT,deps:{configApi:R.Ds,discoveryApi:R.NW,fetchApi:R.gP},factory:({configApi:_,discoveryApi:F,fetchApi:X})=>new n.p({configApi:_,discoveryApi:F,fetchApi:X})})],routes:{root:m._Z,docRoot:m.Fw,entityContent:m.pd}}),y=V.provide((0,R.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(t.bind(t,52943)).then(_=>_.Router),mountPoint:m._Z})),l=V.provide((0,R.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(t.bind(t,52943)).then(_=>_.EmbeddedDocsRouter),mountPoint:m.pd})),P=V.provide((0,R.P4)({name:"TechDocsCustomHome",component:()=>t.e(7560).then(t.bind(t,27560)).then(_=>_.TechDocsCustomHome),mountPoint:m._Z})),ne=V.provide((0,R.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(t.bind(t,18662)).then(_=>_.TechDocsIndexPage),mountPoint:m._Z})),q=V.provide((0,R.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(t.bind(t,7476)).then(_=>_.TechDocsReaderPage),mountPoint:m.Fw}))},7476:function(jt,Me,t){"use strict";t.r(Me),t.d(Me,{TechDocsReaderLayout:function(){return _},TechDocsReaderPage:function(){return F}});var h=t(52322),n=t(2784),m=t(10289),R=t(71399),V=t(61886),y=t(67896),l=t(93225),P=t(65124),ne=t(95573),q=t(25248);const _=({withSearch:X,withHeader:Q=!0})=>(0,h.jsxs)(R.T3,{themeId:"documentation",children:[Q&&(0,h.jsx)(l.S,{}),(0,h.jsx)(P.b,{}),(0,h.jsx)(y.F,{withSearch:X})]}),F=X=>{const{kind:Q,name:ue,namespace:le}=(0,q.Oi)(ne.Fw),{children:L,entityRef:I={kind:Q,name:ue,namespace:le}}=X,$=(0,m.pC)();if(!L){const T=($?n.Children.toArray($.props.children):[]).find(te=>{var Se;if((0,q.IY)(te,V.Zz))return!1;const Ke=te==null||(Se=te.props)===null||Se===void 0?void 0:Se.children;return Ke?!n.Children.toArray(Ke).some(Ge=>(0,q.IY)(Ge,V.Zz)):!0});return(0,h.jsx)(V.ZS,{entityRef:I,children:T||(0,h.jsx)(_,{})})}return(0,h.jsx)(V.ZS,{entityRef:I,children:({metadata:E,entityMetadata:T,onReady:te})=>(0,h.jsx)("div",{className:"techdocs-reader-page",children:(0,h.jsx)(R.T3,{themeId:"documentation",children:L instanceof Function?L({entityRef:I,techdocsMetadataValue:E.value,entityMetadataValue:T.value,onReady:te}):L})})})}},67896:function(jt,Me,t){"use strict";t.d(Me,{F:function(){return He}});var h=t(52322),n=t(2784),m=t(79692),R=t(60905),V=t(61886),y=t(71399),l=t(17339),P=t(4614),ne=t(77277),q=t(99688),_=t(12420),F=t(90436),X=t(61837),Q=t(4190),ue=t(87685);const le=(0,m.Z)(b=>(0,_.Z)({paper:{width:"100%",[b.breakpoints.up("sm")]:{width:"75%"},[b.breakpoints.up("md")]:{width:"50%"},padding:b.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:b.palette.background.default}})),L=({buildLog:b,onClose:W})=>{const fe=le(),de=b.length===0?"Waiting for logs...":b.join(`
|
|
32
|
-
`);return(0,h.jsxs)(R.Z,{container:!0,direction:"column",className:fe.root,spacing:0,wrap:"nowrap",children:[(0,h.jsxs)(R.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,h.jsx)(F.Z,{variant:"h5",children:"Build Details"}),(0,h.jsx)(X.Z,{title:"Close the drawer",onClick:W,color:"inherit",children:(0,h.jsx)(ue.Z,{})},"dismiss")]}),(0,h.jsx)(y.nU,{text:de,classes:{root:fe.logs}})]})},I=({buildLog:b})=>{const W=le(),[fe,de]=(0,n.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ne.Z,{color:"inherit",onClick:()=>de(!0),children:"Show Build Logs"}),(0,h.jsx)(Q.ZP,{classes:{paper:W.paper},anchor:"right",open:fe,onClose:()=>de(!1),children:(0,h.jsx)(L,{buildLog:b,onClose:()=>de(!1)})})]})};var $=t(25248);const E=({errorMessage:b})=>{const W=(0,$.h_)($.Ds).getOptionalString("techdocs.builder");let fe="";return W!=="local"&&(fe="Note that techdocs.builder is not set to 'local' in your config, which means this Backstage app will not generate docs if they are not found. Make sure the project's docs are generated and published by some external process (e.g. CI/CD pipeline). Or change techdocs.builder to 'local' to generate docs from this Backstage instance."),(0,h.jsx)(y.mf,{status:"404",statusMessage:b||"Documentation not found",additionalInfo:fe})};var T=t(95481);const te=(0,m.Z)(b=>({root:{marginBottom:b.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),Se=()=>{let b=null;const W=te(),{state:fe,contentReload:de,contentErrorMessage:Ce,syncErrorMessage:Ie,buildLog:Ne}=(0,T.DK)();return fe==="INITIAL_BUILD"&&(b=(0,h.jsx)(q.Z,{classes:{root:W.root},variant:"outlined",severity:"info",icon:(0,h.jsx)(P.Z,{size:"24px"}),action:(0,h.jsx)(I,{buildLog:Ne}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),fe==="CONTENT_STALE_REFRESHING"&&(b=(0,h.jsx)(q.Z,{variant:"outlined",severity:"info",icon:(0,h.jsx)(P.Z,{size:"24px"}),action:(0,h.jsx)(I,{buildLog:Ne}),classes:{root:W.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),fe==="CONTENT_STALE_READY"&&(b=(0,h.jsx)(q.Z,{variant:"outlined",severity:"success",action:(0,h.jsx)(ne.Z,{color:"inherit",onClick:()=>de(),children:"Refresh"}),classes:{root:W.root},children:"A newer version of this documentation is now available, please refresh to view."})),fe==="CONTENT_STALE_ERROR"&&(b=(0,h.jsxs)(q.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(I,{buildLog:Ne}),classes:{root:W.root,message:W.message},children:["Building a newer version of this documentation failed."," ",Ie]})),fe==="CONTENT_NOT_FOUND"&&(b=(0,h.jsxs)(h.Fragment,{children:[Ie&&(0,h.jsxs)(q.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(I,{buildLog:Ne}),classes:{root:W.root,message:W.message},children:["Building a newer version of this documentation failed."," ",Ie]}),(0,h.jsx)(E,{errorMessage:Ce})]})),b};var Ke=t(10289),Ge=t(60364),Ee=t(41156),Je=t(32838),ft=t(35368),Ze=t.n(ft);const ke=/main\.[A-Fa-f0-9]{8}\.min\.css$/,nt=/^https:\/\/fonts\.googleapis\.com/,at=/^https:\/\/fonts\.gstatic\.com/,ut=b=>b.nodeName==="LINK",lt=b=>{const W=(b==null?void 0:b.getAttribute("href"))||"",fe=W.match(ke),de=W.match(nt),Ce=W.match(at);return fe||de||Ce},ot=b=>(ut(b)&&!lt(b)&&b.remove(),b),dt=b=>b.nodeName==="IFRAME",gt=(b,W)=>{const fe=b.getAttribute("src")||"";try{const{host:de}=new URL(fe);return W.includes(de)}catch{return!1}},Be=b=>W=>(dt(W)&&!gt(W,b)&&W.remove(),W),ie=()=>{const b=(0,$.h_)($.Ds);return(0,n.useMemo)(()=>b.getOptionalConfig("techdocs.sanitizer"),[b])},Te=()=>{const b=ie();return(0,n.useCallback)(async W=>{const fe=b==null?void 0:b.getOptionalStringArray("allowedIframeHosts");Ze().addHook("beforeSanitizeElements",ot);const de=["link"];return fe&&(de.push("iframe"),Ze().addHook("beforeSanitizeElements",Be(fe))),Ze().sanitize(W.innerHTML,{ADD_TAGS:de,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[b])};var Fe=t(41128),mt=({theme:b})=>`
|
|
33
|
-
/*================== Variables ==================*/
|
|
34
|
-
/*
|
|
35
|
-
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.
|
|
36
|
-
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.
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
:host {
|
|
40
|
-
/* FONT */
|
|
41
|
-
--md-default-fg-color: ${b.palette.text.primary};
|
|
42
|
-
--md-default-fg-color--light: ${b.palette.text.secondary};
|
|
43
|
-
--md-default-fg-color--lighter: ${(0,Fe.$n)(b.palette.text.secondary,.7)};
|
|
44
|
-
--md-default-fg-color--lightest: ${(0,Fe.$n)(b.palette.text.secondary,.3)};
|
|
45
|
-
|
|
46
|
-
/* BACKGROUND */
|
|
47
|
-
--md-default-bg-color:${b.palette.background.default};
|
|
48
|
-
--md-default-bg-color--light: ${b.palette.background.paper};
|
|
49
|
-
--md-default-bg-color--lighter: ${(0,Fe.$n)(b.palette.background.paper,.7)};
|
|
50
|
-
--md-default-bg-color--lightest: ${(0,Fe.$n)(b.palette.background.paper,.3)};
|
|
51
|
-
|
|
52
|
-
/* PRIMARY */
|
|
53
|
-
--md-primary-fg-color: ${b.palette.primary.main};
|
|
54
|
-
--md-primary-fg-color--light: ${b.palette.primary.light};
|
|
55
|
-
--md-primary-fg-color--dark: ${b.palette.primary.dark};
|
|
56
|
-
--md-primary-bg-color: ${b.palette.primary.contrastText};
|
|
57
|
-
--md-primary-bg-color--light: ${(0,Fe.$n)(b.palette.primary.contrastText,.7)};
|
|
58
|
-
|
|
59
|
-
/* ACCENT */
|
|
60
|
-
--md-accent-fg-color: var(--md-primary-fg-color);
|
|
61
|
-
|
|
62
|
-
/* SHADOW */
|
|
63
|
-
--md-shadow-z1: ${b.shadows[1]};
|
|
64
|
-
--md-shadow-z2: ${b.shadows[2]};
|
|
65
|
-
--md-shadow-z3: ${b.shadows[3]};
|
|
66
|
-
|
|
67
|
-
/* EXTENSIONS */
|
|
68
|
-
--md-admonition-fg-color: var(--md-default-fg-color);
|
|
69
|
-
--md-admonition-bg-color: var(--md-default-bg-color);
|
|
70
|
-
/* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */
|
|
71
|
-
--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>');
|
|
72
|
-
--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>');
|
|
73
|
-
--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>');
|
|
74
|
-
--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>');
|
|
75
|
-
--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>');
|
|
76
|
-
--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>');
|
|
77
|
-
--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>');
|
|
78
|
-
--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>');
|
|
79
|
-
--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>');
|
|
80
|
-
--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>');
|
|
81
|
-
--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>');
|
|
82
|
-
--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>');
|
|
83
|
-
--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>');
|
|
84
|
-
--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>');
|
|
85
|
-
--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>');
|
|
86
|
-
--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>');
|
|
87
|
-
--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>');
|
|
88
|
-
--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>');
|
|
89
|
-
--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>');
|
|
90
|
-
--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>');
|
|
91
|
-
--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>');
|
|
92
|
-
--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>');
|
|
93
|
-
--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>');
|
|
94
|
-
--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>');
|
|
95
|
-
--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>');
|
|
96
|
-
--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>');
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
:host > * {
|
|
100
|
-
/* CODE */
|
|
101
|
-
--md-code-fg-color: ${b.palette.text.primary};
|
|
102
|
-
--md-code-bg-color: ${b.palette.background.paper};
|
|
103
|
-
--md-code-hl-color: ${(0,Fe.Fq)(b.palette.warning.main,.5)};
|
|
104
|
-
--md-code-hl-keyword-color: ${b.palette.type==="dark"?b.palette.primary.light:b.palette.primary.dark};
|
|
105
|
-
--md-code-hl-function-color: ${b.palette.type==="dark"?b.palette.secondary.light:b.palette.secondary.dark};
|
|
106
|
-
--md-code-hl-string-color: ${b.palette.type==="dark"?b.palette.success.light:b.palette.success.dark};
|
|
107
|
-
--md-code-hl-number-color: ${b.palette.type==="dark"?b.palette.error.light:b.palette.error.dark};
|
|
108
|
-
--md-code-hl-constant-color: var(--md-code-hl-function-color);
|
|
109
|
-
--md-code-hl-special-color: var(--md-code-hl-function-color);
|
|
110
|
-
--md-code-hl-name-color: var(--md-code-fg-color);
|
|
111
|
-
--md-code-hl-comment-color: var(--md-default-fg-color--light);
|
|
112
|
-
--md-code-hl-generic-color: var(--md-default-fg-color--light);
|
|
113
|
-
--md-code-hl-variable-color: var(--md-default-fg-color--light);
|
|
114
|
-
--md-code-hl-operator-color: var(--md-default-fg-color--light);
|
|
115
|
-
--md-code-hl-punctuation-color: var(--md-default-fg-color--light);
|
|
116
|
-
|
|
117
|
-
/* TYPESET */
|
|
118
|
-
--md-typeset-font-size: 1rem;
|
|
119
|
-
--md-typeset-color: var(--md-default-fg-color);
|
|
120
|
-
--md-typeset-a-color: var(--md-accent-fg-color);
|
|
121
|
-
--md-typeset-table-color: ${b.palette.text.primary};
|
|
122
|
-
--md-typeset-del-color: ${b.palette.type==="dark"?(0,Fe.Fq)(b.palette.error.dark,.5):(0,Fe.Fq)(b.palette.error.light,.5)};
|
|
123
|
-
--md-typeset-ins-color: ${b.palette.type==="dark"?(0,Fe.Fq)(b.palette.success.dark,.5):(0,Fe.Fq)(b.palette.success.light,.5)};
|
|
124
|
-
--md-typeset-mark-color: ${b.palette.type==="dark"?(0,Fe.Fq)(b.palette.warning.dark,.5):(0,Fe.Fq)(b.palette.warning.light,.5)};
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
@media screen and (max-width: 76.1875em) {
|
|
128
|
-
:host > * {
|
|
129
|
-
/* TYPESET */
|
|
130
|
-
--md-typeset-font-size: .9rem;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
@media screen and (max-width: 600px) {
|
|
135
|
-
:host > * {
|
|
136
|
-
/* TYPESET */
|
|
137
|
-
--md-typeset-font-size: .7rem;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
`,bt=({theme:b})=>`
|
|
141
|
-
/*================== Reset ==================*/
|
|
142
|
-
|
|
143
|
-
body {
|
|
144
|
-
--md-text-color: var(--md-default-fg-color);
|
|
145
|
-
--md-text-link-color: var(--md-accent-fg-color);
|
|
146
|
-
--md-text-font-family: ${b.typography.fontFamily};
|
|
147
|
-
font-family: var(--md-text-font-family);
|
|
148
|
-
background-color: unset;
|
|
149
|
-
}
|
|
150
|
-
`;const Pt="224px";var ht=({theme:b,sidebar:W})=>`
|
|
151
|
-
/*================== Layout ==================*/
|
|
152
|
-
|
|
153
|
-
.md-grid {
|
|
154
|
-
max-width: 100%;
|
|
155
|
-
margin: 0;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.md-nav {
|
|
159
|
-
font-size: calc(var(--md-typeset-font-size) * 0.9);
|
|
160
|
-
}
|
|
161
|
-
.md-nav__link {
|
|
162
|
-
display: flex;
|
|
163
|
-
align-items: center;
|
|
164
|
-
justify-content: space-between;
|
|
165
|
-
}
|
|
166
|
-
.md-nav__icon {
|
|
167
|
-
height: 20px !important;
|
|
168
|
-
width: 20px !important;
|
|
169
|
-
margin-left:${b.spacing(1)}px;
|
|
170
|
-
}
|
|
171
|
-
.md-nav__icon svg {
|
|
172
|
-
margin: 0;
|
|
173
|
-
width: 20px !important;
|
|
174
|
-
height: 20px !important;
|
|
175
|
-
}
|
|
176
|
-
.md-nav__icon:after {
|
|
177
|
-
width: 20px !important;
|
|
178
|
-
height: 20px !important;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.md-nav__item--active > .md-nav__link, a.md-nav__link--active {
|
|
182
|
-
text-decoration: underline;
|
|
183
|
-
color: var(--md-typeset-a-color);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.md-main__inner {
|
|
187
|
-
margin-top: 0;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.md-sidebar {
|
|
191
|
-
bottom: 75px;
|
|
192
|
-
position: fixed;
|
|
193
|
-
width: 16rem;
|
|
194
|
-
overflow-y: auto;
|
|
195
|
-
overflow-x: hidden;
|
|
196
|
-
scrollbar-color: rgb(193, 193, 193) #eee;
|
|
197
|
-
scrollbar-width: thin;
|
|
198
|
-
}
|
|
199
|
-
.md-sidebar .md-sidebar__scrollwrap {
|
|
200
|
-
width: calc(12.1rem);
|
|
201
|
-
}
|
|
202
|
-
.md-sidebar--secondary {
|
|
203
|
-
right: ${b.spacing(3)}px;
|
|
204
|
-
}
|
|
205
|
-
.md-sidebar::-webkit-scrollbar {
|
|
206
|
-
width: 5px;
|
|
207
|
-
}
|
|
208
|
-
.md-sidebar::-webkit-scrollbar-button {
|
|
209
|
-
width: 5px;
|
|
210
|
-
height: 5px;
|
|
211
|
-
}
|
|
212
|
-
.md-sidebar::-webkit-scrollbar-track {
|
|
213
|
-
background: #eee;
|
|
214
|
-
border: 1 px solid rgb(250, 250, 250);
|
|
215
|
-
box-shadow: 0px 0px 3px #dfdfdf inset;
|
|
216
|
-
border-radius: 3px;
|
|
217
|
-
}
|
|
218
|
-
.md-sidebar::-webkit-scrollbar-thumb {
|
|
219
|
-
width: 5px;
|
|
220
|
-
background: rgb(193, 193, 193);
|
|
221
|
-
border: transparent;
|
|
222
|
-
border-radius: 3px;
|
|
223
|
-
}
|
|
224
|
-
.md-sidebar::-webkit-scrollbar-thumb:hover {
|
|
225
|
-
background: rgb(125, 125, 125);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
.md-content {
|
|
229
|
-
max-width: calc(100% - 16rem * 2);
|
|
230
|
-
margin-left: 16rem;
|
|
231
|
-
margin-bottom: 50px;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.md-footer {
|
|
235
|
-
position: fixed;
|
|
236
|
-
bottom: 0px;
|
|
237
|
-
}
|
|
238
|
-
.md-footer__title {
|
|
239
|
-
background-color: unset;
|
|
240
|
-
}
|
|
241
|
-
.md-footer-nav__link {
|
|
242
|
-
width: 16rem;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
.md-dialog {
|
|
246
|
-
background-color: unset;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
@media screen and (min-width: 76.25em) {
|
|
250
|
-
.md-sidebar {
|
|
251
|
-
height: auto;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
@media screen and (max-width: 76.1875em) {
|
|
256
|
-
.md-nav {
|
|
257
|
-
transition: none !important;
|
|
258
|
-
background-color: var(--md-default-bg-color)
|
|
259
|
-
}
|
|
260
|
-
.md-nav--primary .md-nav__title {
|
|
261
|
-
cursor: auto;
|
|
262
|
-
color: var(--md-default-fg-color);
|
|
263
|
-
font-weight: 700;
|
|
264
|
-
white-space: normal;
|
|
265
|
-
line-height: 1rem;
|
|
266
|
-
height: auto;
|
|
267
|
-
display: flex;
|
|
268
|
-
flex-flow: column;
|
|
269
|
-
row-gap: 1.6rem;
|
|
270
|
-
padding: 1.2rem .8rem .8rem;
|
|
271
|
-
background-color: var(--md-default-bg-color);
|
|
272
|
-
}
|
|
273
|
-
.md-nav--primary .md-nav__title~.md-nav__list {
|
|
274
|
-
box-shadow: none;
|
|
275
|
-
}
|
|
276
|
-
.md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
|
|
277
|
-
border-top: none;
|
|
278
|
-
}
|
|
279
|
-
.md-nav--primary .md-nav__title .md-nav__button {
|
|
280
|
-
display: none;
|
|
281
|
-
}
|
|
282
|
-
.md-nav--primary .md-nav__title .md-nav__icon {
|
|
283
|
-
color: var(--md-default-fg-color);
|
|
284
|
-
position: static;
|
|
285
|
-
height: auto;
|
|
286
|
-
margin: 0 0 0 -0.2rem;
|
|
287
|
-
}
|
|
288
|
-
.md-nav--primary > .md-nav__title [for="none"] {
|
|
289
|
-
padding-top: 0;
|
|
290
|
-
}
|
|
291
|
-
.md-nav--primary .md-nav__item {
|
|
292
|
-
border-top: none;
|
|
293
|
-
}
|
|
294
|
-
.md-nav--primary :is(.md-nav__title,.md-nav__item) {
|
|
295
|
-
font-size : var(--md-typeset-font-size);
|
|
296
|
-
}
|
|
297
|
-
.md-nav .md-source {
|
|
298
|
-
display: none;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
.md-sidebar {
|
|
302
|
-
height: 100%;
|
|
303
|
-
}
|
|
304
|
-
.md-sidebar--primary {
|
|
305
|
-
width: 12.1rem !important;
|
|
306
|
-
z-index: 200;
|
|
307
|
-
left: ${W.isPinned?`calc(-12.1rem + ${Pt})`:"calc(-12.1rem + 72px)"} !important;
|
|
308
|
-
}
|
|
309
|
-
.md-sidebar--secondary:not([hidden]) {
|
|
310
|
-
display: none;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
.md-content {
|
|
314
|
-
max-width: 100%;
|
|
315
|
-
margin-left: 0;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
.md-header__button {
|
|
319
|
-
margin: 0.4rem 0;
|
|
320
|
-
margin-left: 0.4rem;
|
|
321
|
-
padding: 0;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
.md-overlay {
|
|
325
|
-
left: 0;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
.md-footer {
|
|
329
|
-
position: static;
|
|
330
|
-
padding-left: 0;
|
|
331
|
-
}
|
|
332
|
-
.md-footer-nav__link {
|
|
333
|
-
/* footer links begin to overlap at small sizes without setting width */
|
|
334
|
-
width: 50%;
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
@media screen and (max-width: 600px) {
|
|
339
|
-
.md-sidebar--primary {
|
|
340
|
-
left: -12.1rem !important;
|
|
341
|
-
width: 12.1rem;
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
`;const Ct=["h1","h2","h3","h4","h5","h6"];var Tt=({theme:b})=>`
|
|
345
|
-
/*================== Typeset ==================*/
|
|
346
|
-
|
|
347
|
-
.md-typeset {
|
|
348
|
-
font-size: var(--md-typeset-font-size);
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
${Ct.reduce((W,fe)=>{var de;const Ce=(de=b.typography.htmlFontSize)!==null&&de!==void 0?de:16,Ie=b.typography[fe],{lineHeight:Ne,fontFamily:rt,fontWeight:xt,fontSize:vt}=Ie,st=pt=>{let At=1;return typeof pt=="number"&&(At=pt/Ce*.6),typeof pt=="string"&&(At=pt.replace("rem","")),`calc(${At} * var(--md-typeset-font-size))`};return W.concat(`
|
|
352
|
-
.md-typeset ${fe} {
|
|
353
|
-
color: var(--md-default-fg-color);
|
|
354
|
-
line-height: ${Ne};
|
|
355
|
-
font-family: ${rt};
|
|
356
|
-
font-weight: ${xt};
|
|
357
|
-
font-size: ${st(vt)};
|
|
358
|
-
}
|
|
359
|
-
`)},"")}
|
|
360
|
-
|
|
361
|
-
.md-typeset .md-content__button {
|
|
362
|
-
color: var(--md-default-fg-color);
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
.md-typeset hr {
|
|
366
|
-
border-bottom: 0.05rem dotted ${b.palette.divider};
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
.md-typeset details {
|
|
370
|
-
font-size: var(--md-typeset-font-size) !important;
|
|
371
|
-
}
|
|
372
|
-
.md-typeset details summary {
|
|
373
|
-
padding-left: 2.5rem !important;
|
|
374
|
-
}
|
|
375
|
-
.md-typeset details summary:before,
|
|
376
|
-
.md-typeset details summary:after {
|
|
377
|
-
top: 50% !important;
|
|
378
|
-
width: 20px !important;
|
|
379
|
-
height: 20px !important;
|
|
380
|
-
transform: rotate(0deg) translateY(-50%) !important;
|
|
381
|
-
}
|
|
382
|
-
.md-typeset details[open] > summary:after {
|
|
383
|
-
transform: rotate(90deg) translateX(-50%) !important;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
.md-typeset blockquote {
|
|
387
|
-
color: var(--md-default-fg-color--light);
|
|
388
|
-
border-left: 0.2rem solid var(--md-default-fg-color--light);
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
.md-typeset table:not([class]) {
|
|
392
|
-
font-size: var(--md-typeset-font-size);
|
|
393
|
-
border: 1px solid var(--md-default-fg-color);
|
|
394
|
-
border-bottom: none;
|
|
395
|
-
border-collapse: collapse;
|
|
396
|
-
}
|
|
397
|
-
.md-typeset table:not([class]) th {
|
|
398
|
-
font-weight: bold;
|
|
399
|
-
}
|
|
400
|
-
.md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
|
|
401
|
-
border-bottom: 1px solid var(--md-default-fg-color);
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
.md-typeset pre > code::-webkit-scrollbar-thumb {
|
|
405
|
-
background-color: hsla(0, 0%, 0%, 0.32);
|
|
406
|
-
}
|
|
407
|
-
.md-typeset pre > code::-webkit-scrollbar-thumb:hover {
|
|
408
|
-
background-color: hsla(0, 0%, 0%, 0.87);
|
|
409
|
-
}
|
|
410
|
-
`,kt=()=>`
|
|
411
|
-
/*================== Animations ==================*/
|
|
412
|
-
/*
|
|
413
|
-
Disable CSS animations on link colors as they lead to issues in dark mode.
|
|
414
|
-
The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
|
|
415
|
-
*/
|
|
416
|
-
.md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
|
|
417
|
-
transition: none;
|
|
418
|
-
}
|
|
419
|
-
`,_t=({theme:b})=>`
|
|
420
|
-
/*================== Extensions ==================*/
|
|
421
|
-
|
|
422
|
-
/* HIGHLIGHT */
|
|
423
|
-
.highlight .md-clipboard:after {
|
|
424
|
-
content: unset;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
.highlight .nx {
|
|
428
|
-
color: ${b.palette.type==="dark"?"#ff53a3":"#ec407a"};
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
/* CODE HILITE */
|
|
432
|
-
.codehilite .gd {
|
|
433
|
-
background-color: ${b.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
.codehilite .gi {
|
|
437
|
-
background-color: ${b.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
/* TABBED */
|
|
441
|
-
.tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
|
|
442
|
-
.tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
|
|
443
|
-
.tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
|
|
444
|
-
.tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
|
|
445
|
-
.tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
|
|
446
|
-
.tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
|
|
447
|
-
.tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
|
|
448
|
-
.tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
|
|
449
|
-
.tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
|
|
450
|
-
.tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
|
|
451
|
-
.tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
|
|
452
|
-
.tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
|
|
453
|
-
.tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
|
|
454
|
-
.tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
|
|
455
|
-
.tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
|
|
456
|
-
.tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
|
|
457
|
-
.tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
|
|
458
|
-
.tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
|
|
459
|
-
.tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
|
|
460
|
-
.tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
|
|
461
|
-
color: var(--md-accent-fg-color);
|
|
462
|
-
border-color: var(--md-accent-fg-color);
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
/* TASK-LIST */
|
|
466
|
-
.task-list-control .task-list-indicator::before {
|
|
467
|
-
background-color: ${b.palette.action.disabledBackground};
|
|
468
|
-
}
|
|
469
|
-
.task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
|
|
470
|
-
background-color: ${b.palette.success.main};
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
/* ADMONITION */
|
|
474
|
-
.admonition {
|
|
475
|
-
font-size: var(--md-typeset-font-size) !important;
|
|
476
|
-
}
|
|
477
|
-
.admonition .admonition-title {
|
|
478
|
-
padding-left: 2.5rem !important;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
.admonition .admonition-title:before {
|
|
482
|
-
top: 50% !important;
|
|
483
|
-
width: 20px !important;
|
|
484
|
-
height: 20px !important;
|
|
485
|
-
transform: translateY(-50%) !important;
|
|
486
|
-
}
|
|
487
|
-
`;const en=[mt,bt,ht,Tt,kt,_t],Kt=()=>(0,y.Pf)(),Xt=()=>{const b=Kt(),W=(0,Ge.Z)();return(0,n.useMemo)(()=>{const fe={theme:W,sidebar:b};return en.reduce((de,Ce)=>de+Ce(fe),"")},[W,b])},ln=()=>{const b=Xt();return(0,n.useCallback)(W=>(W.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${b}</style>`),W),[b])},qt=(b,W,fe)=>{const de=b==="src"&&W.endsWith(".svg"),Ce=!W.match(/^([a-z]*:)?\/\//i),Ie=W.startsWith(fe);return de&&(Ce||Ie)},jn=({techdocsStorageApi:b,entityId:W,path:fe})=>async de=>{const Ce=await b.getApiOrigin(),Ie=async(Ne,rt)=>{for(const xt of Ne)if(xt.hasAttribute(rt)){const vt=xt.getAttribute(rt);if(!vt)return;const st=await b.getBaseUrl(vt,W,fe);if(qt(rt,vt,Ce))try{const At=await(await fetch(st,{credentials:"include"})).text();xt.setAttribute(rt,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(At)))}`)}catch{xt.setAttribute("alt",`Error: ${vt}`)}else xt.setAttribute(rt,st)}};return await Promise.all([Ie(de.querySelectorAll("img"),"src"),Ie(de.querySelectorAll("script"),"src"),Ie(de.querySelectorAll("source"),"src"),Ie(de.querySelectorAll("link"),"href"),Ie(de.querySelectorAll("a[download]"),"href")]),de};var on=t(39619),En=t(67097),cn=t(28316),Wn=t(82717),Vt=t.n(Wn);const bn=b=>W=>{var fe;const de=W.querySelector('[title="Edit this page"]');if(!de||!de.href)return W;const Ce=new URL(de.href),Ie=b.byUrl(Ce);if((Ie==null?void 0:Ie.type)!=="github"&&(Ie==null?void 0:Ie.type)!=="gitlab")return W;const Ne=((fe=W.querySelector("article>h1"))===null||fe===void 0?void 0:fe.childNodes[0].textContent)||"",rt=encodeURIComponent(`Documentation Feedback: ${Ne}`),xt=encodeURIComponent(`Page source:
|
|
488
|
-
${de.href}
|
|
489
|
-
|
|
490
|
-
Feedback:`),vt=(Ie==null?void 0:Ie.type)==="github"?(0,on.Pb)(Ce.href,"blob"):Ce.href,st=Vt()(vt),pt=`/${st.organization}/${st.name}`,At=de.cloneNode();switch(Ie==null?void 0:Ie.type){case"gitlab":At.href=`${Ce.origin}${pt}/issues/new?issue[title]=${rt}&issue[description]=${xt}`;break;case"github":At.href=`${Ce.origin}${pt}/issues/new?title=${rt}&body=${xt}`;break;default:return W}return cn.render(n.createElement(En.Z),At),At.style.paddingLeft="5px",At.title="Leave feedback for this page",At.id="git-feedback-link",de==null||de.insertAdjacentElement("beforebegin",At),W};var An=t(44882);const Ut=()=>b=>{const W=b.querySelector('.md-header label[for="__drawer"]'),fe=b.querySelector("article");if(!W||!fe)return b;const de=W.cloneNode();return cn.render(n.createElement(An.Z),de),de.id="toggle-sidebar",de.title="Toggle Sidebar",de.classList.add("md-content__button"),de.style.setProperty("padding","0 0 0 5px"),de.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),fe==null||fe.prepend(de),b},dn=()=>b=>(((fe,de)=>{Array.from(fe).filter(Ce=>Ce.hasAttribute(de)).forEach(Ce=>{const Ie=Ce.getAttribute(de);if(Ie){Ie.match(/^https?:\/\//i)&&Ce.setAttribute("target","_blank");try{const Ne=un(window.location.href);Ce.setAttribute(de,new URL(Ie,Ne).toString())}catch{Ce.replaceWith(Ce.textContent||Ie)}}})})(Array.from(b.getElementsByTagName("a")),"href"),b);function un(b){const W=new URL(b);return!W.pathname.endsWith("/")&&!W.pathname.endsWith(".html")&&(W.pathname+="/"),W.toString()}const Sn=({baseUrl:b,onClick:W})=>fe=>(Array.from(fe.getElementsByTagName("a")).forEach(de=>{de.addEventListener("click",Ce=>{const Ne=de.getAttribute("href");!Ne||Ne.startsWith(b)&&!de.hasAttribute("download")&&(Ce.preventDefault(),W(Ce,Ne))})}),fe);var Tn=t(15459),pn=t(80030),ge=t(72379),ee=t(41547);const Ae=(0,Tn.Z)(b=>({tooltip:{fontSize:"inherit",color:b.palette.text.primary,margin:0,padding:b.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(pn.ZP),Ue=()=>(0,h.jsx)(ge.Z,{children:(0,h.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),_e=({text:b})=>{const[W,fe]=(0,n.useState)(!1),de=(0,n.useCallback)(()=>{navigator.clipboard.writeText(b),fe(!0)},[b]),Ce=(0,n.useCallback)(()=>{fe(!1)},[fe]);return(0,h.jsx)(Ae,{title:"Copied to clipboard",placement:"left",open:W,onClose:Ce,leaveDelay:1e3,children:(0,h.jsx)("button",{className:"md-clipboard md-icon",onClick:de,children:(0,h.jsx)(Ue,{})})})},et=b=>W=>{const fe=W.querySelectorAll("pre > code");for(const Ce of fe){var de;const Ie=Ce.textContent||"",Ne=document.createElement("div");Ce==null||(de=Ce.parentElement)===null||de===void 0||de.prepend(Ne),cn.render((0,h.jsx)(ee.Z,{theme:b,children:(0,h.jsx)(_e,{text:Ie})}),Ne)}return W},Y=()=>b=>{var W;return(W=b.querySelector(".md-header"))===null||W===void 0||W.remove(),b},O=()=>b=>{var W,fe;return(W=b.querySelector(".md-footer .md-copyright"))===null||W===void 0||W.remove(),(fe=b.querySelector(".md-footer-copyright"))===null||fe===void 0||fe.remove(),b},ae=({onLoading:b,onLoaded:W})=>fe=>(b(),fe.addEventListener(V.Ox,function de(){W(),fe.removeEventListener(V.Ox,de)}),fe),We=()=>b=>(setTimeout(()=>{if(window.location.hash){var W;const fe=window.location.hash.slice(1);(W=b==null?void 0:b.querySelector(`[id="${fe}"]`))===null||W===void 0||W.scrollIntoView()}},200),b),U=()=>b=>(setTimeout(()=>{const W=b==null?void 0:b.querySelectorAll("li.md-nav__item--active");W.length!==0&&(W.forEach(de=>{const Ce=de==null?void 0:de.querySelector("input");Ce!=null&&Ce.checked||Ce==null||Ce.click()}),W[W.length-1].scrollIntoView())},200),b),Z=async(b,W)=>{let fe;if(typeof b=="string")fe=new DOMParser().parseFromString(b,"text/html").documentElement;else if(b instanceof Element)fe=b;else throw new Error("dom is not a recognized type");for(const de of W)fe=await de(fe);return fe},he="screen and (max-width: 76.1875em)",ye=b=>{const W=(0,Ke.s0)(),fe=(0,Ge.Z)(),de=(0,Ee.Z)(he),Ce=Te(),Ie=ln(),Ne=(0,$.h_)(V.Dl),rt=(0,$.h_)(Je.q3),{state:xt,path:vt,content:st}=(0,T.DK)(),[pt,At]=(0,n.useState)(null),Et=(0,V.ux)(pt),It=(0,n.useCallback)(()=>{if(!pt)return;pt.querySelectorAll(".md-sidebar").forEach(C=>{if(de)C.style.top="0px";else{const J=document==null?void 0:document.querySelector(".techdocs-reader-page");var u;const xe=(u=J==null?void 0:J.getBoundingClientRect().top)!==null&&u!==void 0?u:0;var x;let we=(x=pt.getBoundingClientRect().top)!==null&&x!==void 0?x:0;const $e=pt.querySelector(".md-container > .md-tabs");var j;const it=(j=$e==null?void 0:$e.getBoundingClientRect().height)!==null&&j!==void 0?j:0;we<xe&&(we=xe),C.style.top=`${Math.max(we,0)+it}px`}C.style.setProperty("opacity","1")})},[pt,de]);(0,n.useEffect)(()=>(window.addEventListener("resize",It),window.addEventListener("scroll",It,!0),()=>{window.removeEventListener("resize",It),window.removeEventListener("scroll",It,!0)}),[pt,It]);const Dt=(0,n.useCallback)(()=>{if(!pt)return;const Zt=pt.querySelector(".md-footer");Zt&&(Zt.style.width=`${pt.getBoundingClientRect().width}px`)},[pt]);(0,n.useEffect)(()=>(window.addEventListener("resize",Dt),()=>{window.removeEventListener("resize",Dt)}),[pt,Dt]),(0,n.useEffect)(()=>{Et||(Dt(),It())},[xt,Et,Dt,It]);const In=(0,n.useCallback)((Zt,C)=>Z(Zt,[Ce,jn({techdocsStorageApi:Ne,entityId:b,path:C}),dn(),Ut(),Y(),O(),bn(rt),Ie]),[b,rt,Ne,Ce,Ie]),Dn=(0,n.useCallback)(async Zt=>Z(Zt,[We(),U(),et(fe),Sn({baseUrl:window.location.origin,onClick:(C,u)=>{const x=C.ctrlKey||C.metaKey,j=new URL(u);if(j.hash)if(x)window.open(`${j.pathname}${j.hash}`,"_blank");else{var J;W(`${j.pathname}${j.hash}`),(J=Zt==null?void 0:Zt.querySelector(`[id="${j.hash.slice(1)}"]`))===null||J===void 0||J.scrollIntoView()}else x?window.open(j.pathname,"_blank"):W(j.pathname)}}),ae({onLoading:()=>{},onLoaded:()=>{var C;(C=Zt.querySelector(".md-nav__title"))===null||C===void 0||C.removeAttribute("for")}}),ae({onLoading:()=>{Array.from(Zt.querySelectorAll(".md-sidebar")).forEach(u=>{u.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[fe,W]);return(0,n.useEffect)(()=>{if(!st)return()=>{};let Zt=!0;return In(st,vt).then(async C=>{if(!(C!=null&&C.innerHTML)||!Zt)return;window.scroll({top:0});const u=await Dn(C);At(u)}),()=>{Zt=!1}},[st,vt,In,Dn]),pt};var be=t(8560);const De=()=>{const b=(0,V.$L)(),{shadowRoot:W}=(0,V.x1)(),fe=W==null?void 0:W.querySelector('[data-md-component="content"]'),de=W==null?void 0:W.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let Ce=de==null?void 0:de.querySelector('[data-techdocs-addons-location="primary sidebar"]');Ce||(Ce=document.createElement("div"),Ce.setAttribute("data-techdocs-addons-location","primary sidebar"),de==null||de.prepend(Ce));const Ie=W==null?void 0:W.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Ne=Ie==null?void 0:Ie.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Ne||(Ne=document.createElement("div"),Ne.setAttribute("data-techdocs-addons-location","secondary sidebar"),Ie==null||Ie.prepend(Ne)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(be.Z,{container:Ce,children:b.renderComponentsByLocation(V.oZ.PrimarySidebar)}),(0,h.jsx)(be.Z,{container:fe,children:b.renderComponentsByLocation(V.oZ.Content)}),(0,h.jsx)(be.Z,{container:Ne,children:b.renderComponentsByLocation(V.oZ.SecondarySidebar)})]})},Oe=(0,m.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),He=(0,T.m1)(b=>{var W;const{withSearch:fe=!0,onReady:de}=b,Ce=Oe(),{entityMetadata:{value:Ie,loading:Ne},entityRef:rt,setShadowRoot:xt}=(0,V.x1)(),vt=ye(rt),st=(0,n.useCallback)(pt=>{xt(pt),de instanceof Function&&de()},[xt,de]);return Ne===!1&&!Ie?(0,h.jsx)(y.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):vt?(0,h.jsx)(y.VY,{children:(0,h.jsxs)(R.Z,{container:!0,children:[(0,h.jsx)(R.Z,{xs:12,item:!0,children:(0,h.jsx)(Se,{})}),fe&&(0,h.jsx)(R.Z,{className:Ce.search,xs:"auto",item:!0,children:(0,h.jsx)(l.S,{entityId:rt,entityTitle:Ie==null||(W=Ie.metadata)===null||W===void 0?void 0:W.title})}),(0,h.jsx)(R.Z,{xs:12,item:!0,children:(0,h.jsx)(V.VA,{element:vt,onAppend:st,children:(0,h.jsx)(De,{})})})]})}):(0,h.jsx)(y.VY,{children:(0,h.jsx)(R.Z,{container:!0,children:(0,h.jsx)(R.Z,{xs:12,item:!0,children:(0,h.jsx)(Se,{})})})})}),qe=null},93225:function(jt,Me,t){"use strict";t.d(Me,{S:function(){return X}});var h=t(52322),n=t(2784),m=t(18671),R=t(98069),V=t(73250),y=t(61886),l=t(43297),P=t(25271),ne=t(71399),q=t(25248),_=t(95573);const F=(0,h.jsx)(R.Z,{animation:"wave",variant:"text",height:40}),X=Q=>{const{children:ue}=Q,le=(0,y.$L)(),L=(0,q.h_)(q.Ds),{title:I,setTitle:$,subtitle:E,setSubtitle:T,entityRef:te,metadata:{value:Se,loading:Ke},entityMetadata:{value:Ge,loading:Ee}}=(0,y.x1)();(0,n.useEffect)(()=>{!Se||($(Se.site_name),T(()=>{let{site_description:gt}=Se;return(!gt||gt==="None")&&(gt="Home"),gt}))},[Se,$,T]);const Je=L.getOptional("app.title")||"Backstage",ft=[I,E,Je].filter(Boolean).join(" | "),{locationMetadata:Ze,spec:ke}=Ge||{},nt=ke==null?void 0:ke.lifecycle,at=Ge?(0,l.hF)(Ge,P.S4):[],ut=(0,q.tg)(_._Z)(),lt=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ne.i9,{label:"Component",value:(0,h.jsx)(l.dx,{color:"inherit",entityRef:te,title:Ge==null?void 0:Ge.metadata.title,defaultKind:"Component"})}),at.length>0&&(0,h.jsx)(ne.i9,{label:"Owner",value:(0,h.jsx)(l.rI,{color:"inherit",entityRefs:at,defaultKind:"group"})}),nt?(0,h.jsx)(ne.i9,{label:"Lifecycle",value:nt}):null,Ze&&Ze.type!=="dir"&&Ze.type!=="file"?(0,h.jsx)(ne.i9,{label:"",value:(0,h.jsx)("a",{href:Ze.target,target:"_blank",rel:"noopener noreferrer",children:(0,h.jsx)(V.Z,{style:{marginTop:"-25px",fill:"#fff"}})})}):null]});return!Ee&&Ge===void 0||!Ke&&Se===void 0?null:(0,h.jsxs)(ne.h4,{type:"Documentation",typeLink:ut,title:I||F,subtitle:E||F,children:[(0,h.jsx)(m.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:ft})}),lt,ue,le.renderComponentsByLocation(y.oZ.Header)]})}},65124:function(jt,Me,t){"use strict";t.d(Me,{b:function(){return F}});var h=t(52322),n=t(2784),m=t(79692),R=t(15223),V=t(95544),y=t(80030),l=t(61837),P=t(48348),ne=t(47603),q=t(61886);const _=(0,m.Z)(X=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:X.spacing(3,3,0)}})),F=X=>{const Q=_(),[ue,le]=(0,n.useState)(null),L=(0,n.useCallback)(Ke=>{le(Ke.currentTarget)},[]),I=(0,n.useCallback)(()=>{le(null)},[]),{entityMetadata:{value:$,loading:E}}=(0,q.x1)(),T=(0,q.$L)(),te=T.renderComponentsByLocation(q.oZ.Subheader),Se=T.renderComponentsByLocation(q.oZ.Settings);return!te&&!Se||E===!1&&!$?null:(0,h.jsx)(R.Z,{classes:Q,...X.toolbarProps,children:(0,h.jsxs)(V.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[te,Se?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(y.ZP,{title:"Settings",children:(0,h.jsx)(l.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:L,children:(0,h.jsx)(ne.Z,{})})}),(0,h.jsx)(P.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:ue,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(ue),onClose:I,keepMounted:!0,children:Se})]}):null]})})}},95481:function(jt,Me,t){"use strict";t.d(Me,{DK:function(){return F},m1:function(){return Q}});var h=t(52322),n=t(2784),m=t(10289),R=t(61886),V=t(25248),y=t(64279),l=t(77446);function P({contentLoading:ue,content:le,activeSyncState:L}){return ue||L==="BUILD_READY_RELOAD"||!le&&L==="CHECKING"?"CHECKING":!le&&L==="BUILDING"?"INITIAL_BUILD":le?L==="BUILDING"?"CONTENT_STALE_REFRESHING":L==="BUILD_READY"?"CONTENT_STALE_READY":L==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ne(ue,le){const L={...ue};switch(le.type){case"sync":le.state==="CHECKING"&&(L.buildLog=[]),L.activeSyncState=le.state,L.syncError=le.syncError;break;case"contentLoading":L.contentLoading=!0,L.contentError=void 0;break;case"content":typeof le.path=="string"&&(L.path=le.path),L.contentLoading=!1,L.content=le.content,L.contentError=le.contentError;break;case"buildLog":L.buildLog=L.buildLog.concat(le.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(L.activeSyncState)&&["contentLoading","content"].includes(le.type)&&(L.activeSyncState="UP_TO_DATE",L.buildLog=[]),L}function q(ue,le,L,I){var $,E;const[T,te]=(0,n.useReducer)(ne,{activeSyncState:"CHECKING",path:I,contentLoading:!0,buildLog:[]}),Se=(0,V.h_)(R.Dl),{retry:Ke}=(0,l.Z)(async()=>{te({type:"contentLoading"});try{const Je=await Se.getEntityDocs({kind:ue,namespace:le,name:L},I);return te({type:"content",content:Je,path:I}),Je}catch(Je){te({type:"content",contentError:Je,path:I})}},[Se,ue,le,L,I]),Ge=(0,n.useRef)({content:void 0,reload:()=>{}});return Ge.current={content:T.content,reload:Ke},(0,y.default)(async()=>{te({type:"sync",state:"CHECKING"});const Je=setTimeout(()=>{te({type:"sync",state:"BUILDING"})},1e3);try{switch(await Se.syncEntityDocs({kind:ue,namespace:le,name:L},Ze=>{te({type:"buildLog",log:Ze})})){case"updated":Ge.current.content?te({type:"sync",state:"BUILD_READY"}):(Ge.current.reload(),te({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":te({type:"sync",state:"UP_TO_DATE"});break;default:te({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(ft){te({type:"sync",state:"ERROR",syncError:ft})}finally{clearTimeout(Je)}},[ue,L,le,Se,te,Ge]),{state:(0,n.useMemo)(()=>P({activeSyncState:T.activeSyncState,contentLoading:T.contentLoading,content:T.content}),[T.activeSyncState,T.content,T.contentLoading]),contentReload:Ke,path:T.path,content:T.content,contentErrorMessage:($=T.contentError)===null||$===void 0?void 0:$.toString(),syncErrorMessage:(E=T.syncError)===null||E===void 0?void 0:E.toString(),buildLog:T.buildLog}}const _=(0,n.createContext)({}),F=()=>(0,n.useContext)(_),X=({children:ue})=>{const{"*":le=""}=(0,m.UO)(),{entityRef:L}=(0,R.x1)(),{kind:I,namespace:$,name:E}=L,T=q(I,$,E,le);return(0,h.jsx)(_.Provider,{value:T,children:ue instanceof Function?ue(T):ue})},Q=ue=>le=>(0,h.jsx)(X,{children:(0,h.jsx)(ue,{...le})})},95573:function(jt,Me,t){"use strict";t.d(Me,{Fw:function(){return m},_Z:function(){return n},pd:function(){return R}});var h=t(25248);const n=(0,h.NT)({id:"techdocs:index-page"}),m=(0,h.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),R=(0,h.NT)({id:"techdocs:catalog-reader-view"})},17339:function(jt,Me,t){"use strict";t.d(Me,{S:function(){return I}});var h=t(52322),n=t(2784),m=t(79692),R=t(49378),V=t(38402),y=t(86136),l=t(85256),P=t(71399),ne=t(25248),q=t(65826);const _=(0,m.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),F=$=>{const{result:E,highlight:T,rank:te,lineClamp:Se=5,asListItem:Ke=!0,asLink:Ge=!0,title:Ee,icon:Je}=$,ft=_(),Ze=(0,ne.z$)(),ke=()=>{Ze.captureEvent("discover",E.title,{attributes:{to:E.location},value:te})},nt=()=>{const lt=T!=null&&T.fields.title?(0,h.jsx)(q.FA,{text:T.fields.title,preTag:T.preTag,postTag:T.postTag}):E.title,ot=T!=null&&T.fields.entityTitle?(0,h.jsx)(q.FA,{text:T.fields.entityTitle,preTag:T.preTag,postTag:T.postTag}):E.entityTitle,dt=T!=null&&T.fields.name?(0,h.jsx)(q.FA,{text:T.fields.name,preTag:T.preTag,postTag:T.postTag}):E.name;return(0,h.jsx)(R.Z,{className:ft.itemText,primaryTypographyProps:{variant:"h6"},primary:Ee||(0,h.jsxs)(h.Fragment,{children:[lt," | ",ot!=null?ot:dt," docs"]}),secondary:(0,h.jsx)("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Se,overflow:"hidden"},children:T!=null&&T.fields.text?(0,h.jsx)(q.FA,{text:T.fields.text,preTag:T.preTag,postTag:T.postTag}):E.text})})},at=({children:lt})=>Ge?(0,h.jsx)(P.rU,{noTrack:!0,to:E.location,onClick:ke,children:lt}):(0,h.jsx)(h.Fragment,{children:lt}),ut=({children:lt})=>Ke?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(V.Z,{alignItems:"flex-start",children:[Je&&(0,h.jsx)(y.Z,{children:Je}),(0,h.jsx)("div",{className:ft.flexContainer,children:lt})]}),(0,h.jsx)(l.Z,{component:"li"})]}):(0,h.jsx)(h.Fragment,{children:lt});return(0,h.jsx)(at,{children:(0,h.jsx)(ut,{children:(0,h.jsx)(nt,{})})})};var X=t(27556),Q=t(10289);const ue=(0,m.Z)($=>({root:{width:"100%"},bar:{padding:$.spacing(1)}})),le=$=>$==null?void 0:$.document,L=$=>{const{entityId:E,entityTitle:T,debounceTime:te=150}=$,[Se,Ke]=(0,n.useState)(!1),Ge=(0,Q.s0)(),{setFilters:Ee,result:{loading:Je,value:ft}}=(0,q.Rx)(),Ze=ue(),[ke,nt]=(0,n.useState)([]);(0,n.useEffect)(()=>{let dt=!0;if(dt&&ft){const gt=ft.results.slice(0,10);nt(gt)}return()=>{dt=!1}},[Je,ft]);const{kind:at,name:ut,namespace:lt}=E;(0,n.useEffect)(()=>{Ee(dt=>({...dt,kind:at,namespace:lt,name:ut}))},[at,lt,ut,Ee]);const ot=(dt,gt)=>{if(le(gt)){const{location:Be}=gt.document;Ge(Be)}};return(0,h.jsx)(X.Z,{className:Ze.bar,variant:"outlined",children:(0,h.jsx)(q.qO,{classes:{root:Ze.root},"data-testid":"techdocs-search-bar",size:"small",open:Se,getOptionLabel:()=>"",filterOptions:dt=>dt,onClose:()=>{Ke(!1)},onFocus:()=>{Ke(!0)},onChange:ot,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:ke,renderOption:({document:dt,highlight:gt})=>(0,h.jsx)(F,{result:dt,lineClamp:3,asListItem:!1,asLink:!1,title:dt.title,highlight:gt}),loading:Je,inputDebounceTime:te,inputPlaceholder:`Search ${T||E.name} docs`,freeSolo:!1})})},I=$=>{const E={term:"",types:["techdocs"],pageCursor:"",filters:$.entityId};return(0,h.jsx)(q.Nd,{initialState:E,children:(0,h.jsx)(L,{...$})})}},53260:function(){}},function(jt){var Me=function(h){return jt(jt.s=h)};jt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,4736],function(){return Me(96215)});var t=jt.O()}]);})();
|
|
491
|
-
|
|
492
|
-
//# sourceMappingURL=main.5e3c320b.js.map
|