@techdocs/cli 1.4.0-next.1 → 1.4.0
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 +25 -0
- package/dist/embedded-app/.config-schema.json +8 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{6051.784227d8.chunk.js → 6051.3a9f0bec.chunk.js} +1 -1
- package/dist/embedded-app/static/{6051.784227d8.chunk.js.map → 6051.3a9f0bec.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{8951.8fbde266.chunk.js → 8951.4ffeac5f.chunk.js} +1 -1
- package/dist/embedded-app/static/{8951.8fbde266.chunk.js.map → 8951.4ffeac5f.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9323.f715e2ef.chunk.js → 9323.a4a386cd.chunk.js} +1 -1
- package/dist/embedded-app/static/{9323.f715e2ef.chunk.js.map → 9323.a4a386cd.chunk.js.map} +1 -1
- package/dist/embedded-app/static/main.08eb1867.js +503 -0
- package/dist/embedded-app/static/main.08eb1867.js.map +1 -0
- package/dist/embedded-app/static/module-react-router-dom.34e67991.js +30 -0
- package/dist/embedded-app/static/module-react-router-dom.34e67991.js.map +1 -0
- package/dist/embedded-app/static/{react-syntax-highlighter_languages_highlight_java.a244ed31.chunk.js → react-syntax-highlighter_languages_highlight_java.0c380b2f.chunk.js} +2 -2
- package/dist/embedded-app/static/{react-syntax-highlighter_languages_highlight_java.a244ed31.chunk.js.map → react-syntax-highlighter_languages_highlight_java.0c380b2f.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.f29d79fc.js → runtime.08eb1867.js} +2 -2
- package/dist/embedded-app/static/{runtime.f29d79fc.js.map → runtime.08eb1867.js.map} +1 -1
- package/dist/embedded-app/static/vendor.08eb1867.js +252 -0
- package/dist/embedded-app/static/vendor.08eb1867.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +7 -7
- package/dist/embedded-app/static/main.f29d79fc.js +0 -503
- package/dist/embedded-app/static/main.f29d79fc.js.map +0 -1
- package/dist/embedded-app/static/module-remix-run.4d35bb97.js +0 -12
- package/dist/embedded-app/static/module-remix-run.4d35bb97.js.map +0 -1
- package/dist/embedded-app/static/vendor.f29d79fc.js +0 -270
- package/dist/embedded-app/static/vendor.f29d79fc.js.map +0 -1
|
@@ -1,503 +0,0 @@
|
|
|
1
|
-
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{4791:function(bt,Be,t){"use strict";t.d(Be,{n3:function(){return m},MS:function(){return M}});var h=t(25271),r=t(23054),F=t(96279),L=t.n(F);const m=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");function y(be){return!be.cursor}function l(be){return!y(be)}class M{async getEntityAncestors(V,G){const{kind:b,namespace:B,name:Y}=(0,h.of)(V.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(b)}/${encodeURIComponent(B)}/${encodeURIComponent(Y)}/ancestry`,G)}async getLocationById(V,G){return await this.requestOptional("GET",`/locations/${encodeURIComponent(V)}`,G)}async getEntities(V,G){const{filter:b=[],fields:B=[],order:Y,offset:le,limit:ee,after:X}=V!=null?V:{},j=this.getParams(b);if(B.length&&j.push(`fields=${B.map(encodeURIComponent).join(",")}`),Y)for(const re of[Y].flat())re&&j.push(`order=${encodeURIComponent(re.order)}:${encodeURIComponent(re.field)}`);le!==void 0&&j.push(`offset=${le}`),ee!==void 0&&j.push(`limit=${ee}`),X!==void 0&&j.push(`after=${encodeURIComponent(X)}`);const P=j.length?`?${j.join("&")}`:"",$=await this.requestRequired("GET",`/entities${P}`,G),T=(re,Re)=>{var Xe,_e;if(((Xe=re.metadata)===null||Xe===void 0?void 0:Xe.name)===void 0||re.kind===void 0||((_e=Re.metadata)===null||_e===void 0?void 0:_e.name)===void 0||Re.kind===void 0)return 0;const it=(0,h.eE)(re),Fe=(0,h.eE)(Re);return it<Fe?-1:it>Fe?1:0};return{items:$.sort(T)}}async getEntitiesByRefs(V,G){var b;const B={entityRefs:V.entityRefs};!((b=V.fields)===null||b===void 0)&&b.length&&(B.fields=V.fields);const le=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,ee=await this.fetchApi.fetch(le,{headers:{"Content-Type":"application/json",...(G==null?void 0:G.token)&&{Authorization:`Bearer ${G==null?void 0:G.token}`}},method:"POST",body:JSON.stringify(B)});if(!ee.ok)throw await r.VL.fromResponse(ee);const{items:X}=await ee.json();return{items:X}}async queryEntities(V={},G){const b=[];if(y(V)){var B,Y;const{fields:ee=[],filter:X,limit:j,orderFields:P,fullTextFilter:$}=V;b.push(...this.getParams(X)),j!==void 0&&b.push(`limit=${j}`),P!==void 0&&(Array.isArray(P)?P:[P]).forEach(({field:re,order:Re})=>b.push(`sortField=${re},${Re}`)),ee.length&&b.push(`fields=${ee.map(encodeURIComponent).join(",")}`);const T=$==null||(B=$.term)===null||B===void 0?void 0:B.trim();T&&b.push(`fullTextFilterTerm=${T}`),!($==null||(Y=$.fields)===null||Y===void 0)&&Y.length&&b.push(`fullTextFilterFields=${$.fields.join(",")}`)}else{const{fields:ee=[],limit:X,cursor:j}=V;b.push(`cursor=${j}`),X!==void 0&&b.push(`limit=${X}`),ee.length&&b.push(`fields=${ee.map(encodeURIComponent).join(",")}`)}const le=b.length?`?${b.join("&")}`:"";return this.requestRequired("GET",`/entities/by-query${le}`,G)}async getEntityByRef(V,G){const{kind:b,namespace:B,name:Y}=(0,h.of)(V);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(b)}/${encodeURIComponent(B)}/${encodeURIComponent(Y)}`,G)}async getEntityByName(V,G){const{kind:b,namespace:B="default",name:Y}=V;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(b)}/${encodeURIComponent(B)}/${encodeURIComponent(Y)}`,G)}async refreshEntity(V,G){const b=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(G==null?void 0:G.token)&&{Authorization:`Bearer ${G==null?void 0:G.token}`}},method:"POST",body:JSON.stringify({entityRef:V})});if(b.status!==200)throw new Error(await b.text())}async getEntityFacets(V,G){const{filter:b=[],facets:B}=V,Y=this.getParams(b);for(const ee of B)Y.push(`facet=${encodeURIComponent(ee)}`);const le=Y.length?`?${Y.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${le}`,G)}async addLocation(V,G){const{type:b="url",target:B,dryRun:Y}=V,le=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${Y?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(G==null?void 0:G.token)&&{Authorization:`Bearer ${G==null?void 0:G.token}`}},method:"POST",body:JSON.stringify({type:b,target:B})});if(le.status!==201)throw new Error(await le.text());const{location:ee,entities:X,exists:j}=await le.json();if(!ee)throw new Error(`Location wasn't added: ${B}`);return{location:ee,entities:X,exists:j}}async getLocationByRef(V,G){return(await this.requestRequired("GET","/locations",G)).map(B=>B.data).find(B=>V===(0,h.NZ)(B))}async removeLocationById(V,G){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(V)}`,G)}async removeEntityByUid(V,G){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(V)}`,G)}async validateEntity(V,G,b){const B=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(b==null?void 0:b.token)&&{Authorization:`Bearer ${b==null?void 0:b.token}`}},method:"POST",body:JSON.stringify({entity:V,location:G})});if(B.ok)return{valid:!0};if(B.status!==400)throw await r.VL.fromResponse(B);const{errors:Y=[]}=await B.json();return{valid:!1,errors:Y}}async requestIgnored(V,G,b){const B=`${await this.discoveryApi.getBaseUrl("catalog")}${G}`,Y=b!=null&&b.token?{Authorization:`Bearer ${b.token}`}:{},le=await this.fetchApi.fetch(B,{method:V,headers:Y});if(!le.ok)throw await r.VL.fromResponse(le)}async requestRequired(V,G,b){const B=`${await this.discoveryApi.getBaseUrl("catalog")}${G}`,Y=b!=null&&b.token?{Authorization:`Bearer ${b.token}`}:{},le=await this.fetchApi.fetch(B,{method:V,headers:Y});if(!le.ok)throw await r.VL.fromResponse(le);return le.json()}async requestOptional(V,G,b){const B=`${await this.discoveryApi.getBaseUrl("catalog")}${G}`,Y=b!=null&&b.token?{Authorization:`Bearer ${b.token}`}:{},le=await this.fetchApi.fetch(B,{method:V,headers:Y});if(!le.ok){if(le.status===404)return;throw await r.VL.fromResponse(le)}return await le.json()}getParams(V=[]){const G=[];for(const b of[V].flat()){const B=[];for(const[Y,le]of Object.entries(b))for(const ee of[le].flat())ee===m?B.push(encodeURIComponent(Y)):typeof ee=="string"&&B.push(`${encodeURIComponent(Y)}=${encodeURIComponent(ee)}`);B.length&&G.push(`filter=${B.join(",")}`)}return G}constructor(V){this.discoveryApi=V.discoveryApi,this.fetchApi=V.fetchApi||{fetch:L()}}}},25271:function(bt,Be,t){"use strict";t.d(Be,{Tf:function(){return F},P1:function(){return oe},q1:function(){return Oe},M6:function(){return Pe},l2:function(){return r},zG:function(){return h},w$:function(){return an},nP:function(){return Tn},aS:function(){return wn},S4:function(){return en},cz:function(){return Bn},iB:function(){return Et},CV:function(){return Rt},of:function(){return St},Ou:function(){return ft},eE:function(){return gt},NZ:function(){return Ht}});const h="default",r="backstage.io/view-url",F="backstage.io/edit-url",L="kubernetes.io/api-server",m="kubernetes.io/api-server-certificate-authority",y="kubernetes.io/auth-provider";var l=t(76635),M=t.n(l);class be{async enforce(U){return U.metadata.namespace?U:lodash.merge({metadata:{namespace:this.namespace}},U)}constructor(U=DEFAULT_NAMESPACE){this.namespace=U}}class V{static isValidPrefixAndOrSuffix(U,he,Ke,Ve){if(typeof U!="string")return!1;const at=U.split(he);return at.length===1?Ve(at[0]):at.length===2?Ke(at[0])&&Ve(at[1]):!1}static isJsonSafe(U){try{return M().isEqual(U,JSON.parse(JSON.stringify(U)))}catch{return!1}}static isValidDnsSubdomain(U){return typeof U=="string"&&U.length>=1&&U.length<=253&&U.split(".").every(V.isValidDnsLabel)}static isValidDnsLabel(U){return typeof U=="string"&&U.length>=1&&U.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(U)}static isValidTag(U){return typeof U=="string"&&U.length>=1&&U.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(U)}static isValidUrl(U){if(typeof U!="string")return!1;try{return new URL(U),!0}catch{return!1}}static isValidString(U){var he;return typeof U=="string"&&((he=U==null?void 0:U.trim())===null||he===void 0?void 0:he.length)>=1}static isNonEmptyString(U){var he;return typeof U=="string"&&((he=U==null?void 0:U.trim())===null||he===void 0?void 0:he.length)>=1}}var G=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}}}}}'),b=t(27991),B=t.n(b),Y=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"}}}`),le=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}}}}}}'),ee=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 X=new Map,j=[G,Y,le,ee];function P(ce){if(!(ce!=null&&ce.length))throw new TypeError("Unknown error");const U=ce[0];throw new TypeError(`${U.instancePath||"<root>"} ${U.message}${U.params?` - ${Object.entries(U.params).map(([he,Ke])=>`${he}: ${Ke}`).join(", ")}`:""}`)}function $(ce,U={}){var he;const Ke=(he=U==null?void 0:U.disableCache)!==null&&he!==void 0?he:!1,Ve=Ke?"":JSON.stringify(ce);if(!Ke){const Xt=X.get(Ve);if(Xt)return Xt}const at=T(ce),Tt=new(B())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});at.length&&Tt.addSchema(at,void 0,void 0,!0);const tn=Tt.compile(ce);return Ke||X.set(Ve,tn),tn}function T(ce){if(typeof ce!="object")return[];const U=new Set;ce.$id&&U.add(ce.$id);const he=new Array,Ke=[ce];for(;Ke.length;){const Ve=Ke.pop();for(const at of re(Ve))if(!U.has(at)){U.add(at);const Tt=j.find(tn=>tn.$id===at);Tt&&(he.push(Tt),Ke.push(Tt))}}return he}function*re(ce){const U=[ce];for(;U.length;){const he=U.pop();if(typeof he=="object"&&he)for(const[Ke,Ve]of Object.entries(he))Ke==="$ref"&&typeof Ve=="string"?yield Ve.split("#")[0]:U.push(Ve)}}function Re(ce){const U=compileAjvSchema(ce||entityEnvelopeSchema);return he=>{if(U(he)===!0)return he;throw throwAjvError(U.errors)}}function Xe(ce){const U=$(ce);return he=>{var Ke;if(U(he)===!0)return he;const at=(Ke=U.errors)===null||Ke===void 0?void 0:Ke.filter(Tt=>["/kind","/apiVersion"].includes(Tt.instancePath));if(at!=null&&at.length&&at.every(Tt=>Tt.keyword==="enum"))return!1;throw P(U.errors)}}function _e(ce){const U=compileAjvSchema(ce||entitySchema);return he=>{if(U(he)===!0)return he;throw throwAjvError(U.errors)}}class it{static isValidApiVersion(U){return V.isValidPrefixAndOrSuffix(U,"/",V.isValidDnsSubdomain,he=>he.length>=1&&he.length<=63&&/^[a-z0-9A-Z]+$/.test(he))}static isValidKind(U){return typeof U=="string"&&U.length>=1&&U.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(U)}static isValidObjectName(U){return typeof U=="string"&&U.length>=1&&U.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(U)}static isValidNamespace(U){return V.isValidDnsLabel(U)}static isValidLabelKey(U){return V.isValidPrefixAndOrSuffix(U,"/",V.isValidDnsSubdomain,it.isValidObjectName)}static isValidLabelValue(U){return U===""||it.isValidObjectName(U)}static isValidAnnotationKey(U){return V.isValidPrefixAndOrSuffix(U,"/",V.isValidDnsSubdomain,it.isValidObjectName)}static isValidAnnotationValue(U){return typeof U=="string"}}const Fe={isValidApiVersion:it.isValidApiVersion,isValidKind:it.isValidKind,isValidEntityName:it.isValidObjectName,isValidNamespace:it.isValidNamespace,isValidLabelKey:it.isValidLabelKey,isValidLabelValue:it.isValidLabelValue,isValidAnnotationKey:it.isValidAnnotationKey,isValidAnnotationValue:it.isValidAnnotationValue,isValidTag:ce=>typeof ce=="string"&&ce.length>=1&&ce.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(ce)};function jt(ce={}){return{...Fe,...ce}}class He{async enforce(U){function he(g,R,J){if(R==null)throw new Error(`${g} must have a value`);let K;try{K=J(R)}catch(ae){throw new Error(`${g} could not be validated, ${ae}`)}if(!K){let ae;switch(J.name){case"isValidLabelValue":case"isValidObjectName":ae="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":ae="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":ae="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":ae="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":ae="a string";break;case"isValidKind":ae="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":ae="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":ae="a non empty string";break;default:ae=void 0;break}const fe=ae?` expected ${ae} but found "${R}".`:"";throw new Error(`"${g}" is not valid;${fe} 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 Ke(g,R,J){return R===void 0||he(g,R,J)}he("apiVersion",U.apiVersion,this.validators.isValidApiVersion),he("kind",U.kind,this.validators.isValidKind),he("metadata.name",U.metadata.name,this.validators.isValidEntityName),Ke("metadata.namespace",U.metadata.namespace,this.validators.isValidNamespace);var Ve;for(const[g,R]of Object.entries((Ve=U.metadata.labels)!==null&&Ve!==void 0?Ve:[]))he(`labels.${g}`,g,this.validators.isValidLabelKey),he(`labels.${g}`,R,this.validators.isValidLabelValue);var at;for(const[g,R]of Object.entries((at=U.metadata.annotations)!==null&&at!==void 0?at:[]))he(`annotations.${g}`,g,this.validators.isValidAnnotationKey),he(`annotations.${g}`,R,this.validators.isValidAnnotationValue);var Tt;const tn=(Tt=U.metadata.tags)!==null&&Tt!==void 0?Tt:[];for(let g=0;g<tn.length;++g)he(`tags.${g}`,tn[g],this.validators.isValidTag);var Xt;const sn=(Xt=U.metadata.links)!==null&&Xt!==void 0?Xt:[];for(let g=0;g<sn.length;++g){var q,W,de;he(`links.${g}.url`,(q=sn[g])===null||q===void 0?void 0:q.url,CommonValidatorFunctions.isValidUrl),Ke(`links.${g}.title`,(W=sn[g])===null||W===void 0?void 0:W.title,CommonValidatorFunctions.isNonEmptyString),Ke(`links.${g}.icon`,(de=sn[g])===null||de===void 0?void 0:de.icon,KubernetesValidatorFunctions.isValidObjectName)}return U}constructor(U=makeValidator()){this.validators=U}}class st{async enforce(U){if(!this.validate){const Ve=new Ajv({allowUnionTypes:!0});this.validate=Ve.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(U)===!0)return U;const[Ke]=this.validate.errors||[];throw Ke?new Error(`Malformed envelope, ${Ke.instancePath||"<root>"} ${Ke.message}`):new Error("Malformed envelope, Unknown error")}}function je(ce){let U=ce.indexOf(":");const he=ce.indexOf("/");he!==-1&&he<U&&(U=-1);const Ke=U===-1?void 0:ce.slice(0,U),Ve=he===-1?void 0:ce.slice(U+1,he),at=ce.slice(Math.max(U+1,he+1));if(Ke===""||Ve===""||at==="")throw new TypeError(`Entity reference "${ce}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Ke,namespace:Ve,name:at}}function Et(ce){return{kind:ce.kind,namespace:ce.metadata.namespace||h,name:ce.metadata.name}}function St(ce,U){if(!ce)throw new Error("Entity reference must not be empty");const he=U==null?void 0:U.defaultKind,Ke=(U==null?void 0:U.defaultNamespace)||h;let Ve,at,Tt;if(typeof ce=="string"){const W=je(ce);var tn;Ve=(tn=W.kind)!==null&&tn!==void 0?tn:he;var Xt;at=(Xt=W.namespace)!==null&&Xt!==void 0?Xt:Ke,Tt=W.name}else{var sn;Ve=(sn=ce.kind)!==null&&sn!==void 0?sn:he;var q;at=(q=ce.namespace)!==null&&q!==void 0?q:Ke,Tt=ce.name}if(Ve)if(at){if(!Tt){const W=JSON.stringify(ce);throw new Error(`Entity reference ${W} had missing or empty name`)}}else{const W=JSON.stringify(ce);throw new Error(`Entity reference ${W} had missing or empty namespace`)}else{const W=JSON.stringify(ce);throw new Error(`Entity reference ${W} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:Ve,namespace:at,name:Tt}}function gt(ce){let U,he,Ke;if("metadata"in ce){U=ce.kind;var Ve;he=(Ve=ce.metadata.namespace)!==null&&Ve!==void 0?Ve:h,Ke=ce.metadata.name}else{U=ce.kind;var at;he=(at=ce.namespace)!==null&&at!==void 0?at:h,Ke=ce.name}return`${U.toLocaleLowerCase("en-US")}:${he.toLocaleLowerCase("en-US")}/${Ke.toLocaleLowerCase("en-US")}`}class yt{async enforce(U){let he=U;for(const Ke of this.policies){const Ve=await Ke.enforce(he);if(!Ve)throw new Error(`Policy ${Ke.constructor.name} did not return a result`);he=Ve}return he}constructor(U){this.policies=U}}class At{async enforce(U){for(const he of this.policies){const Ke=await he.enforce(U);if(Ke)return Ke}throw new Error("The entity did not match any known policy")}constructor(U){this.policies=U}}const Lt={allOf(ce){return new yt(ce)},oneOf(ce){return new At(ce)}};var ze=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ApiV1alpha1","description":"An API describes an interface that can be exposed by a component. The API can be defined in different formats, like OpenAPI, AsyncAPI, GraphQL, gRPC, or other formats.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"API","metadata":{"name":"artist-api","description":"Retrieve artist details","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"openapi","lifecycle":"production","owner":"artist-relations-team","system":"artist-engagement-portal","definition":"openapi: \\"3.0.0\\"\\ninfo:..."}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["API"]},"spec":{"type":"object","required":["type","lifecycle","owner","definition"],"properties":{"type":{"type":"string","description":"The type of the API definition.","examples":["openapi","asyncapi","graphql","grpc","trpc"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the API.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the API.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the API belongs to.","minLength":1},"definition":{"type":"string","description":"The definition of the API, based on the format defined by the type.","minLength":1}}}}}]}');function xe(ce){let U;return{async check(he){return U||(U=Xe(ce)),U(he)===he}}}const Te=xe(ze);var Ae=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 Ze=xe(Ae);var rt=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 zt=xe(rt);var pt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"GroupV1alpha1","description":"A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Group","metadata":{"name":"infrastructure","description":"The infra business unit"},"spec":{"type":"business-unit","profile":{"displayName":"Infrastructure","email":"infrastructure@example.com","picture":"https://example.com/groups/bu-infrastructure.jpeg"},"parent":"ops","children":["backstage","other"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Group"]},"spec":{"type":"object","required":["type","children"],"properties":{"type":{"type":"string","description":"The type of group. There is currently no enforced set of values for this field, so it is left up to the adopting organization to choose a nomenclature that matches their org hierarchy.","examples":["team","business-unit","product-area","root"],"minLength":1},"profile":{"type":"object","description":"Optional profile information about the group, mainly for display purposes. All fields of this structure are also optional. The email would be a group email of some form, that the group may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the group, and that a browser could fetch and render on a group page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Infrastructure"],"minLength":1},"email":{"type":"string","description":"An email where this entity can be reached.","examples":["infrastructure@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this entity.","examples":["https://example.com/groups/bu-infrastructure.jpeg"],"minLength":1}}},"parent":{"type":"string","description":"The immediate parent group in the hierarchy, if any. Not all groups must have a parent; the catalog supports multi-root hierarchies. Groups may however not have more than one parent. This field is an entity reference.","examples":["ops"],"minLength":1},"children":{"type":"array","description":"The immediate child groups of this group in the hierarchy (whose parent field points to this group). The list must be present, but may be empty if there are no child groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["backstage","other"],"minLength":1}},"members":{"type":"array","description":"The users that are members of this group. The entries of this array are entity references.","items":{"type":"string","examples":["jdoe"],"minLength":1}}}}}}]}`);const Pt=xe(pt);var mt=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 It=xe(mt),en="ownedBy",on="ownerOf",vn="consumesApi",$t="apiConsumedBy",pn="providesApi",Cn="apiProvidedBy",Tn="dependsOn",an="dependencyOf",Xn="parentOf",On="childOf",qn="memberOf",ct="hasMember",Bn="partOf",wn="hasPart";var ln=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ResourceV1alpha1","description":"A resource describes the infrastructure a system needs to operate, like BigTable databases, Pub/Sub topics, S3 buckets or CDNs. Modelling them together with components and systems allows to visualize resource footprint, and create tooling around them.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Resource","metadata":{"name":"artists-db","description":"Stores artist details"},"spec":{"type":"database","owner":"artist-relations-team","system":"artist-engagement-portal"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Resource"]},"spec":{"type":"object","required":["type","owner"],"properties":{"type":{"type":"string","description":"The type of resource.","examples":["database","s3-bucket","cluster"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the resource.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"dependsOn":{"type":"array","description":"An array of references to other entities that the resource depends on to function.","items":{"type":"string","minLength":1}},"system":{"type":"string","description":"An entity reference to the system that the resource belongs to.","minLength":1}}}}}]}');const $n=xe(ln);var zn=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 jn=xe(zn);var Gn=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 ve=xe(Gn),oe="backstage.io/managed-by-location",Oe="backstage.io/managed-by-origin-location",Pe="backstage.io/source-location",Ge=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;function ft(ce){if(typeof ce!="string")throw new TypeError(`Unable to parse location ref '${ce}', unexpected argument ${typeof ce}`);const U=ce.indexOf(":");if(U<0)throw new TypeError(`Unable to parse location ref '${ce}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const he=ce.substring(0,U).trim(),Ke=ce.substring(U+1).trim();if(!he||!Ke)throw new TypeError(`Unable to parse location ref '${ce}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(he==="http"||he==="https")throw new TypeError(`Invalid location ref '${ce}', please prefix it with 'url:', e.g. 'url:${ce}'`);if(Ge.test(Ke))throw new TypeError(`Invalid location ref '${ce}', target is a javascript: URL`);return{type:he,target:Ke}}function Ht(ce){const{type:U,target:he}=ce;if(U){if(!he)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");if(Ge.test(he))throw new TypeError(`Invalid location ref '${U}:${he}', target is a javascript: URL`);return`${U}:${he}`}function Rt(ce){var U,he,Ke,Ve,at;const Tt=(at=(U=ce.metadata)===null||U===void 0||(he=U.annotations)===null||he===void 0?void 0:he[Pe])!==null&&at!==void 0?at:(Ke=ce.metadata)===null||Ke===void 0||(Ve=Ke.annotations)===null||Ve===void 0?void 0:Ve[oe];if(!Tt)throw new Error(`Entity '${gt(ce)}' is missing location`);return ft(Tt)}},23196:function(bt,Be,t){"use strict";t.d(Be,{Oi:function(){return Ae},VY:function(){return Ft},yW:function(){return il},XF:function(){return zt},mn:function(){return ce},NX:function(){return h},ub:function(){return de},mf:function(){return ul},yu:function(){return bn},h4:function(){return Ca},M6:function(){return Rn},i9:function(){return Cl},aR:function(){return rr},rJ:function(){return Or},Oh:function(){return Il},hu:function(){return El},rU:function(){return Fe},Qj:function(){return He},nU:function(){return Lr},SA:function(){return wo},sk:function(){return ut},Or:function(){return xr},T3:function(){return wa},g9:function(){return Pl},Ex:function(){return io},Gk:function(){return x},tn:function(){return js},Ph:function(){return An},YE:function(){return di},v7:function(){return f},R6:function(){return i},tR:function(){return la},uw:function(){return ka},qt:function(){return Xi},iA:function(){return Sa},GB:function(){return Zn},po:function(){return _n},mZ:function(){return Mo},Pf:function(){return _r}});var h={};t.r(h),t.d(h,{Nm:function(){return pt},ht:function(){return It},LJ:function(){return mt}});var r=t(52322),F=t(60871),L=t(19928),m=t(2784);function y(e){const[o,a]=useState([]),d=useApi(alertApiRef),{anchorOrigin:p={vertical:"top",horizontal:"center"},transientTimeoutMs:v}=e,E=v!=null?v:5e3;useEffect(()=>{const N=d.alert$().subscribe(ue=>a(ie=>ie.concat(ue)));return()=>{N.unsubscribe()}},[d]);const[Z]=o;if(useEffect(()=>{if(Z&&Z.display==="transient"){const N=setTimeout(()=>{a(ue=>{const ie=ue.filter(ye=>ye!==Z);return ie.length===ue.length?ue:ie})},E);return()=>clearTimeout(N)}},[Z,E]),o.length===0)return null;const H=()=>{a(N=>N.filter(ue=>ue!==Z))};return _jsx(Snackbar,{open:!0,anchorOrigin:p,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:H,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:Z.severity,children:_jsxs(Typography,{component:"span",children:[String(Z.message),o.length>1&&_jsx("em",{children:` (${o.length-1} older ${pluralize("message",o.length-1)})`})]})})})}var l=t(79692);const M=(0,l.Z)(e=>({avatar:{width:"4rem",height:"4rem",color:e.palette.common.white},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function be(e){const{displayName:o,picture:a,customStyles:d}=e,p=M();let v={...d};const E={fontFamily:v.fontFamily,fontSize:v.fontSize,fontWeight:v.fontWeight};return a||(v={backgroundColor:stringToColor(o||""),...d}),_jsx(MaterialAvatar,{alt:o,src:a,className:p.avatar,style:v,children:o&&_jsx(Typography,{variant:"h6",component:"span",className:p.avatarText,style:E,children:extractInitials(o)})})}var V=t(77277),G=t(86689),b=t(90436),B=t(72779),Y=t.n(B),le=t(76635),ee=t(79635),X=t(39857);function j(){const[e]=(0,ee.is)((0,r.jsx)(ee.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!e.index}const P=(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"}),$=e=>/^([a-z+.-]+):/.test(e),T=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i,re=window.open;if(re&&!re.__backstage){const e=function(...a){const d=String(a[0]);if(T.test(d))throw new Error("Rejected window.open() with a javascript: URL as a security precaution");return re.apply(this,a)};e.__backstage=!0,window.open=e}const Re=()=>{try{return(0,F.h_)(F.Ds).getOptionalString("app.baseUrl")}catch{return}},Xe=()=>{const e="http://sample.dev";var o;const a=(o=Re())!==null&&o!==void 0?o:"/",{pathname:d}=new URL(a,e);return(0,le.trimEnd)(d,"/")},_e=e=>{let o=String(e);const a=Xe(),d=$(o),p=o.startsWith(a);return!d&&!p&&(o=a.concat(o)),o},it=e=>{if(e instanceof Array)return e.map(it).join(" ").trim();if(typeof e=="object"&&e){var o;return it(e==null||(o=e.props)===null||o===void 0?void 0:o.children)}return["string","number"].includes(typeof e)?String(e):""},Fe=m.forwardRef(({onClick:e,noTrack:o,...a},d)=>{const p=P(),v=(0,F.z$)(),E=j()?_e(a.to):a.to,Z=it(a.children)||E,H=$(E),N=H&&!!/^https?:/.exec(E);if(T.test(E))throw new Error("Link component rejected javascript: URL as a security precaution");const ue=ie=>{e==null||e(ie),o||v.captureEvent("click",Z,{attributes:{to:E}})};return H?(0,r.jsxs)(G.Z,{...N?{target:"_blank",rel:"noopener"}:{},...a,ref:d,href:E,onClick:ue,className:Y()(p.externalLink,a.className),children:[a.children,(0,r.jsx)(b.Z,{component:"span",className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,r.jsx)(G.Z,{...a,ref:d,component:X.rU,to:E,onClick:ue})}),jt=m.forwardRef((e,o)=>(0,r.jsx)(Fe,{ref:o,...e,color:"initial"})),He=m.forwardRef((e,o)=>(0,r.jsx)(V.Z,{ref:o,component:jt,...e})),st=null;var je=t(95544),Et=t(60364),St=t(83229),gt=t(26639),yt=t(39595),At=t(61837),Lt=t(80030),ze=t(19353),xe=t(95074);function Te(e){const{text:o,tooltipDelay:a=1e3,tooltipText:d="Text copied to clipboard","aria-label":p="Copy text"}=e,v=(0,F.h_)(F.VE),[E,Z]=(0,m.useState)(!1),[{error:H},N]=(0,xe.Z)();(0,m.useEffect)(()=>{H&&v.post(H)},[H,v]);const ue=ie=>{ie.stopPropagation(),Z(!0),N(o)};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(Lt.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:a,onClose:()=>Z(!1),open:E,children:(0,r.jsx)(At.Z,{onClick:ue,"aria-label":p,children:(0,r.jsx)(ze.Z,{})})})})}function Ae(e){const{text:o,language:a,showLineNumbers:d=!1,highlightedNumbers:p,customStyle:v,showCopyCodeButton:E=!1}=e,Z=(0,Et.Z)(),H=Z.palette.type==="dark"?gt.Z:yt.Z,N=Z.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,r.jsxs)(je.Z,{position:"relative",children:[(0,r.jsx)(St.Z,{customStyle:v,language:a,style:H,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:Z.palette.textVerySubtle},lineProps:ue=>p!=null&&p.includes(ue)?{style:{backgroundColor:N}}:{},children:o}),E&&(0,r.jsx)(je.Z,{position:"absolute",top:0,right:0,children:(0,r.jsx)(Te,{text:o})})]})}var Ze=t(41156),rt=t(88188);function zt(e){const{title:o,to:a}=e,d=(0,Ze.Z)(p=>p.breakpoints.down("xs"));return a?d?(0,r.jsx)(At.Z,{component:X.rU,color:"primary",title:o,size:"small",to:a,children:(0,r.jsx)(rt.Z,{})}):(0,r.jsx)(V.Z,{component:X.rU,variant:"contained",color:"primary",to:a,children:o}):null}var pt;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(pt||(pt={}));var Pt;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(Pt||(Pt={}));var mt;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(mt||(mt={}));var It;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(It||(It={}));var en=t(27397),on=t(11105),vn=t(97963),$t=t(46506),pn=t.n($t),Cn=t(54073),Tn=t.n(Cn),an=t(10368);const Xn=(0,l.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function On({node:{id:e}}){const o=Xn(),[a,d]=m.useState(0),[p,v]=m.useState(0),E=m.useRef(null);m.useLayoutEffect(()=>{if(E.current){let{height:ue,width:ie}=E.current.getBBox();ue=Math.round(ue),ie=Math.round(ie),(ue!==p||ie!==a)&&(d(ie),v(ue))}},[a,p]);const Z=10,H=a+Z*2,N=p+Z*2;return(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{className:o.node,width:H,height:N,rx:10}),(0,r.jsx)("text",{ref:E,className:o.text,y:N/2,x:H/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const qn="arrow-marker",ct="node",Bn="edge",wn="label",ln=(0,an.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),$n=e=>(0,r.jsx)(On,{...e});function zn({render:e=$n,setNode:o,node:a}){const{width:d,height:p,x:v=0,y:E=0}=a,Z=a,H=ln(),N=m.useRef(null);return m.useLayoutEffect(()=>{if(N.current){let{height:ue,width:ie}=N.current.getBBox();ue=Math.round(ue),ie=Math.round(ie),(ue!==p||ie!==d)&&o(a.id,{...a,height:ue,width:ie})}},[a,d,p,o]),(0,r.jsx)("g",{ref:N,"data-testid":ct,className:H.node,transform:`translate(${v-d/2},${E-p/2})`,children:e({node:Z})})}var jn=t(76985),Gn=t(39829),ve=t(19574),oe=t.n(ve);const Oe=(0,an.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function Pe({edge:{label:e}}){const o=Oe();return(0,r.jsx)("text",{className:o.text,textAnchor:"middle",children:e})}const Ge=(0,an.Z)(e=>({path:{strokeWidth:1,stroke:e.palette.textSubtle,fill:"none",transition:`${e.transitions.duration.shortest}ms`},label:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphEdge"}),ft=e=>(0,r.jsx)(Pe,{...e});function Ht({render:e=ft,setEdge:o,id:a,edge:d,curve:p}){const{x:v=0,y:E=0,width:Z,height:H,points:N}=d,ue=d,ie=Ge(),ye=m.useRef(null);m.useLayoutEffect(()=>{if(ye.current){let{height:Qe,width:Ot}=ye.current.getBBox();Qe=Math.round(Qe),Ot=Math.round(Ot),(Qe!==H||Ot!==Z)&&o(a,{...d,height:Qe,width:Ot})}},[d,H,Z,o,a]);let Le="";const Me=m.useMemo(()=>jn.Z().x(Qe=>Qe.x).y(Qe=>Qe.y).curve(Gn[p]),[p]);if(N){const Qe=N.filter(Ot=>oe()(Ot.x)&&oe()(Ot.y));Le=Me(Qe)||""}return(0,r.jsxs)(r.Fragment,{children:[Le&&(0,r.jsx)("path",{"data-testid":Bn,className:ie.path,d:Le}),ue.label?(0,r.jsx)("g",{ref:ye,"data-testid":wn,className:ie.label,transform:`translate(${v},${E})`,children:e({edge:ue})}):null]})}const Rt="workspace";function ce(e){var o,a;const{edges:d,nodes:p,renderNode:v,direction:E=pt.TOP_BOTTOM,align:Z,nodeMargin:H=50,edgeMargin:N=10,rankMargin:ue=50,paddingX:ie=0,paddingY:ye=0,acyclicer:Le,ranker:Me=mt.NETWORK_SIMPLEX,labelPosition:Qe=It.RIGHT,labelOffset:Ot=10,edgeRanks:Yt=1,edgeWeight:nn=1,renderLabel:rn,defs:Bt,zoom:_t="enabled",curve:Jt="curveMonotoneX",fit:Cr="grow",...wr}=e,jr=(0,vn.Z)(),[Er,Li]=m.useState(100),[Ur,Pi]=m.useState(100),Qt=m.useRef(new(pn()).graphlib.Graph),[vo,Ts]=m.useState(((o=Qt.current.graph())===null||o===void 0?void 0:o.width)||0),[Mr,ki]=m.useState(((a=Qt.current.graph())===null||a===void 0?void 0:a.height)||0),[Un,vr]=m.useState([]),[to,no]=m.useState([]),un=Math.max(vo,Er),Sn=Math.max(Mr,Ur),yo=Math.min(Mr,Ur),ro=Cr==="grow"?Sn:yo,Jo=m.useMemo(()=>Tn()(mn=>{if(!mn)return;const Mn=on.Z(mn),hn=on.Z(mn.getElementById(Rt));function hr(){Mn.call(en.sP().scaleExtent([1,10]).on("zoom",Ar=>{Ar.transform.x=Math.min(0,Math.max(Ar.transform.x,un-un*Ar.transform.k)),Ar.transform.y=Math.min(0,Math.max(Ar.transform.y,Sn-Sn*Ar.transform.k)),hn.attr("transform",Ar.transform)}))}_t==="enabled"?hr():_t==="enable-on-click"&&Mn.on("click",()=>hr());const{width:pr,height:Is}=mn.getBoundingClientRect();Er!==pr&&Li(pr),Ur!==Is&&Pi(Is)},100),[Ur,Er,un,Sn,_t]),La=m.useCallback(()=>{const mn=Qt.current.nodes(),Mn=Qt.current.edges();mn.forEach(hn=>{p.some(pr=>pr.id===hn)||Qt.current.removeNode(hn)}),Mn.forEach(hn=>{d.some(pr=>pr.from===hn.v&&pr.to===hn.w)||Qt.current.removeEdge(hn.v,hn.w)}),p.forEach(hn=>{const hr=Qt.current.nodes().find(pr=>hn.id===pr);if(hr&&Qt.current.node(hr)){const{width:pr,height:Is,x:Ar,y:Ql}=Qt.current.node(hr);Qt.current.setNode(hr,{...hn,width:pr,height:Is,x:Ar,y:Ql})}else Qt.current.setNode(hn.id,{...hn,width:0,height:0})}),d.forEach(hn=>{Qt.current.setEdge(hn.from,hn.to,{...hn,label:hn.label,width:0,height:0,labelpos:Qe,labeloffset:Ot,weight:nn,minlen:Yt})})},[d,p,Qe,Ot,nn,Yt]),Qo=m.useMemo(()=>Tn()(()=>{pn().layout(Qt.current);const{height:mn,width:Mn}=Qt.current.graph(),hn=Math.max(0,mn||0),hr=Math.max(0,Mn||0);Ts(hr),ki(hn),vr(Qt.current.nodes()),no(Qt.current.edges())},250,{leading:!0}),[]);m.useEffect(()=>(Qt.current.setGraph({rankdir:E,align:Z,nodesep:H,edgesep:N,ranksep:ue,marginx:ie,marginy:ye,acyclicer:Le,ranker:Me}),La(),Qo(),Qo.cancel),[Le,Z,E,N,ie,ye,H,ue,Me,La,Qo]);function Yl(mn,Mn){return Qt.current.setNode(mn,Mn),Qo(),Qt.current}function Jl(mn,Mn){return Qt.current.setEdge(mn,Mn),Qo(),Qt.current}return(0,r.jsxs)("svg",{ref:Jo,...wr,width:"100%",height:ro,viewBox:`0 0 ${un} ${Sn}`,children:[(0,r.jsxs)("defs",{children:[(0,r.jsx)("marker",{id:qn,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{fill:jr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),Bt]}),(0,r.jsx)("g",{id:Rt,children:(0,r.jsxs)("svg",{width:vo,height:Mr,y:Sn/2-Mr/2,x:un/2-vo/2,viewBox:`0 0 ${vo} ${Mr}`,children:[to.map(mn=>{const Mn=Qt.current.edge(mn);return Mn?(0,r.jsx)(Ht,{id:mn,setEdge:Jl,render:rn,edge:Mn,curve:Jt},`${mn.v}-${mn.w}`):null}),Un.map(mn=>{const Mn=Qt.current.node(mn);return Mn?(0,r.jsx)(zn,{setNode:Yl,render:v,node:Mn},mn):null})]})})]})}var U;const he=(0,l.Z)(e=>({root:{padding:e.spacing(0),marginBottom:e.spacing(0),marginTop:e.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:e.spacing(6),marginTop:-e.spacing(3),zIndex:"unset"},icon:{fontSize:e.typography.h6.fontSize},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap"},message:{display:"flex",alignItems:"center",color:e.palette.banner.text,"& a":{color:e.palette.banner.link}},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(U=e.palette.banner.warning)!==null&&U!==void 0?U:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),Ke=e=>{const{variant:o,message:a,id:d,fixed:p=!1}=e,v=he(),Z=useApi(storageApiRef).forBucket("notifications");var H;const N=(H=Z.snapshot("dismissedBanners").value)!==null&&H!==void 0?H:[],[ue,ie]=useState(new Set(N)),ye=useObservable(Z.observe$("dismissedBanners"));useEffect(()=>{if(ye!=null&&ye.value){var Me;const Qe=(Me=ye==null?void 0:ye.value)!==null&&Me!==void 0?Me:[];ie(new Set(Qe))}},[ye==null?void 0:ye.value]);const Le=()=>{Z.set("dismissedBanners",[...ue,d])};return _jsx(Snackbar,{anchorOrigin:p?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!ue.has(d),classes:{root:classNames(v.root,!p&&v.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(v.content,v[o]),message:v.message},message:a,action:[_jsx(IconButton,{title:"Permanently dismiss this message",color:"inherit",onClick:Le,children:_jsx(Close,{className:v.icon})},"dismiss")]})})};var Ve=t(60905),at=t.p+"static/missingAnnotation.67f79e98..svg",Tt=t.p+"static/noInformation.4b426325..svg",tn=t.p+"static/createComponent.975d1e1e..svg",Xt=t.p+"static/noBuild.1715fa71..svg";const sn=(0,l.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),q=({missing:e})=>{const o=sn();switch(e){case"field":return(0,r.jsx)("img",{src:at,className:o.generalImg,alt:"annotation is missing"});case"info":return(0,r.jsx)("img",{src:Tt,alt:"no Information",className:o.generalImg});case"content":return(0,r.jsx)("img",{src:tn,alt:"create Component",className:o.generalImg});case"data":return(0,r.jsx)("img",{src:Xt,alt:"no Build",className:o.generalImg});default:return null}},W=(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 de(e){const{title:o,description:a,missing:d,action:p}=e,v=W();return(0,r.jsxs)(Ve.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2,children:[(0,r.jsx)(Ve.Z,{item:!0,xs:12,md:6,children:(0,r.jsxs)(Ve.Z,{container:!0,direction:"column",children:[(0,r.jsx)(Ve.Z,{item:!0,xs:!0,children:(0,r.jsx)(b.Z,{variant:"h5",children:o})}),(0,r.jsx)(Ve.Z,{item:!0,xs:!0,children:(0,r.jsx)(b.Z,{variant:"body1",children:a})}),(0,r.jsx)(Ve.Z,{item:!0,xs:!0,className:v.action,children:p})]})}),(0,r.jsx)(Ve.Z,{item:!0,xs:12,md:6,className:v.imageContainer,children:typeof d=="string"?(0,r.jsx)(q,{missing:d}):d.customImage})]})}const g=`apiVersion: backstage.io/v1alpha1
|
|
2
|
-
kind: Component
|
|
3
|
-
metadata:
|
|
4
|
-
name: example
|
|
5
|
-
description: example.com
|
|
6
|
-
annotations:
|
|
7
|
-
ANNOTATION: value
|
|
8
|
-
spec:
|
|
9
|
-
type: website
|
|
10
|
-
lifecycle: production
|
|
11
|
-
owner: user:guest`,R=/^.*ANNOTATION.*$/m,J=g.match(R)[0],K=g.split(`
|
|
12
|
-
`).findIndex(e=>R.test(e)),ae=(0,l.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":e.palette.common.white}}),{name:"BackstageMissingAnnotationEmptyState"});function fe(e){return Array.from(Array(e+1).keys(),o=>o+K)}function Ue(e){const o=e.map(a=>J.replace("ANNOTATION",a)).join(`
|
|
13
|
-
`);return g.replace(J,o)}function Ye(e){const o=e.length<=1;return(0,r.jsxs)(r.Fragment,{children:["The ",o?"annotation":"annotations"," ",e.map(a=>(0,r.jsx)("code",{children:a})).reduce((a,d)=>(0,r.jsxs)(r.Fragment,{children:[a,", ",d]}))," ",o?"is":"are"," missing. You need to add the"," ",o?"annotation":"annotations"," to your component if you want to enable this tool."]})}function ut(e){const{annotation:o,readMoreUrl:a}=e,d=Array.isArray(o)?o:[o],p=a||"https://backstage.io/docs/features/software-catalog/well-known-annotations",v=ae();return(0,r.jsx)(de,{missing:"field",title:"Missing Annotation",description:Ye(d),action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(b.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,r.jsx)(je.Z,{className:v.code,children:(0,r.jsx)(Ae,{text:Ue(d),language:"yaml",showLineNumbers:!0,highlightedNumbers:fe(d.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,r.jsx)(V.Z,{color:"primary",component:Fe,to:p,children:"Read more"})]})})}var vt=t(11776),et=t(38402),qe=t(49378),Ne=t(41128),Zt=t(27616),Kt=t(8284),kt=t(70660),Dt=t(91750),Wt=t(38016);const Gt=(e,o)=>(o.palette.type==="light"?Ne._j:Ne.$n)(o.palette[e].light,.6),ht=(e,o)=>(o.palette.type==="light"?Ne.$n:Ne._j)(o.palette[e].light,.9),We=(0,l.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:o})=>Gt(o,e)}})),Ut=({severity:e})=>{const o=We({severity:e});return(0,r.jsx)(Dt.Z,{classes:o})},cn=({severity:e})=>{const o=We({severity:e});return(0,r.jsx)(Wt.Z,{classes:o})},yn=(0,l.Z)(e=>({panel:{backgroundColor:({severity:o})=>ht(o,e),color:({severity:o})=>Gt(o,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:o})=>Gt(o,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:o})=>Gt(o,e),backgroundColor:({severity:o})=>ht(o,e)},details:{width:"100%",display:"block",color:e.palette.textContrast,backgroundColor:e.palette.background.default,border:`1px solid ${e.palette.border}`,padding:e.spacing(2),fontFamily:"sans-serif"}}),{name:"BackstageWarningPanel"}),In=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function Zn(e){const{severity:o="warning",title:a,message:d,children:p,defaultExpanded:v}=e,E=yn({severity:o}),Z=In(o)+(a?`: ${a}`:"");return(0,r.jsxs)(Zt.Z,{defaultExpanded:v!=null?v:!1,className:E.panel,role:"alert",children:[(0,r.jsxs)(Kt.Z,{expandIcon:(0,r.jsx)(cn,{severity:o}),className:E.summary,children:[(0,r.jsx)(Ut,{severity:o}),(0,r.jsx)(b.Z,{className:E.summaryText,variant:"subtitle1",children:Z})]}),(d||p)&&(0,r.jsx)(kt.Z,{children:(0,r.jsxs)(Ve.Z,{container:!0,children:[d&&(0,r.jsx)(Ve.Z,{item:!0,xs:12,children:(0,r.jsx)(b.Z,{className:E.message,variant:"body1",children:d})}),p&&(0,r.jsx)(Ve.Z,{item:!0,xs:12,className:E.details,children:p})]})})]})}const xn=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),Kn=({error:e,message:o,stack:a,children:d})=>{const p=xn();return(0,r.jsxs)(vt.Z,{dense:!0,children:[(0,r.jsxs)(et.Z,{alignItems:"flex-start",children:[(0,r.jsx)(qe.Z,{classes:{secondary:p.text},primary:"Error",secondary:e}),(0,r.jsx)(Te,{text:e})]}),(0,r.jsxs)(et.Z,{alignItems:"flex-start",children:[(0,r.jsx)(qe.Z,{classes:{secondary:p.text},primary:"Message",secondary:o}),(0,r.jsx)(Te,{text:o})]}),a&&(0,r.jsxs)(et.Z,{alignItems:"flex-start",children:[(0,r.jsx)(qe.Z,{classes:{secondary:p.text},primary:"Stack Trace",secondary:a}),(0,r.jsx)(Te,{text:a})]}),d]})};function bn(e){const{title:o,error:a,defaultExpanded:d,children:p}=e;return(0,r.jsx)(Zn,{severity:"error",title:o!=null?o:a.message,defaultExpanded:d,children:(0,r.jsx)(Kn,{error:a.name,message:a.message,stack:a.stack,children:p})})}var w=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 o;const{title:a,error:d,defaultExpanded:p}=e,v=u();if(d.name!=="ResponseError")return(0,r.jsx)(bn,{title:a!=null?a:d.message,defaultExpanded:p,error:d});const{body:E,cause:Z}=d,{request:H,response:N}=E,ue=`${N.statusCode}: ${Z.name}`,ie=H&&`${H.method} ${H.url}`,ye=Z.message.replace(/\\n/g,`
|
|
14
|
-
`),Le=(o=Z.stack)===null||o===void 0?void 0:o.replace(/\\n/g,`
|
|
15
|
-
`),Me=JSON.stringify(E,void 0,2);return(0,r.jsxs)(bn,{title:a!=null?a:d.message,defaultExpanded:p,error:{name:ue,message:ye,stack:Le},children:[ie&&(0,r.jsxs)(et.Z,{alignItems:"flex-start",children:[(0,r.jsx)(qe.Z,{classes:{secondary:v.text},primary:"Request",secondary:H?`${ie}`:void 0}),(0,r.jsx)(Te,{text:ie})]}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(w.Z,{component:"li",className:v.divider}),(0,r.jsx)(et.Z,{alignItems:"flex-start",children:(0,r.jsx)(qe.Z,{classes:{secondary:v.text},primary:"Full Error as JSON"})}),(0,r.jsx)(Ae,{language:"json",text:Me,showCopyCodeButton:!0})]})]})}var A=t(28316);function Q(e){const o=document.createElement("div");return o.setAttribute("id",e),o}function pe(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function we(e){const o=useRef(null);useEffect(function(){const p=document.querySelector(`#${e}`),v=p||Q(e);return p||pe(v),v.appendChild(o.current),function(){o.current.remove(),v.childNodes.length===-1&&v.remove()}},[e]);function a(){return o.current||(o.current=document.createElement("div")),o.current}return a()}var Se=null;const dt="core.calloutSeen";function Vt(){const[e,o]=useState(()=>{const d=localStorage.getItem(dt);return d?JSON.parse(d):{}}),a=useCallback((d,p)=>{const v=localStorage.getItem(dt),Z={...v?JSON.parse(v):{},[d]:p};o(Z),localStorage.setItem(dt,JSON.stringify(Z))},[]);return{states:e,setState:a}}function dn(e){const{states:o,setState:a}=Vt(),d=useCallback(()=>{a(e,!0)},[a,e]);return{seen:o[e]===!0,markSeen:d}}function Yn(e){const{seen:o,markSeen:a}=dn(e);return{show:o===!1,hide:a}}const er=(0,l.Z)(e=>({"@keyframes pulsateSlightly":{"0%":{transform:"scale(1.0)"},"100%":{transform:"scale(1.1)"}},"@keyframes pulsateAndFade":{"0%":{transform:"scale(1.0)",opacity:.9},"100%":{transform:"scale(1.5)",opacity:0}},featureWrapper:{position:"relative"},backdrop:{zIndex:2e3,position:"fixed",overflow:"hidden",left:0,right:0,top:0,bottom:0},dot:{position:"absolute",backgroundColor:"transparent",borderRadius:"100%",border:"1px solid rgba(103, 146, 180, 0.98)",boxShadow:"0px 0px 0px 20000px rgba(0, 0, 0, 0.5)",zIndex:2001,transformOrigin:"center center",animation:"$pulsateSlightly 1744ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) alternate infinite"},pulseCircle:{width:"100%",height:"100%",backgroundColor:"transparent",borderRadius:"100%",border:`2px solid ${e.palette.common.white}`,zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:e.palette.common.white,zIndex:2003}}),{name:"BackstageFeatureCalloutCircular"});function zr(e){const{featureId:o,title:a,description:d,children:p}=e,{show:v,hide:E}=useShowCallout(o),Z=usePortal("core.callout"),H=useRef(null),[N,ue]=useState(),ie=er(),ye=useCallback(()=>{if(H.current){const Le=H.current.getBoundingClientRect(),Me=Math.max(Le.width,Le.height),Qe=800,Ot=Le.x-(Me-Le.width)/2-Qe,Yt=Le.y-(Me-Le.height)/2-Qe,nn=Me+2*Qe,rn=450,Bt=Le.x+Le.width/2-rn,_t=Le.y-(Me-Le.height)/2+Me+20;ue({dotLeft:Ot,dotTop:Yt,dotSize:nn,borderWidth:Qe,textTop:_t,textLeft:Bt,textWidth:rn})}},[]);return useEffect(()=>(window.addEventListener("resize",ye),window.addEventListener("scroll",ye),()=>{window.removeEventListener("resize",ye),window.removeEventListener("scroll",ye)}),[ye]),useLayoutEffect(ye,[H.current,ye]),v?_jsxs(_Fragment,{children:[_jsx(Box,{className:ie.featureWrapper,ref:H,children:p}),createPortal(_jsx(Box,{className:ie.backdrop,children:_jsx(ClickAwayListener,{onClickAway:E,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:ie.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:E,onKeyDown:E,role:"button",tabIndex:0,children:_jsx(Box,{className:ie.pulseCircle})}),_jsxs(Box,{className:ie.text,"data-testid":"text",style:{left:N==null?void 0:N.textLeft,top:N==null?void 0:N.textTop,width:N==null?void 0:N.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:a}),_jsx(Typography,{children:d})]})]})})}),Z)]}):_jsx(_Fragment,{children:p})}var oo=t(35292);const xo=(0,l.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function bo({color:e="primary",disabled:o=!1,href:a="#",icon:d=(0,r.jsx)(oo.Z,{}),label:p,onClick:v,title:E}){const Z=xo();return o?(0,r.jsxs)(je.Z,{title:E,className:Y()(Z.link,Z.disabled),children:[d,(0,r.jsx)(b.Z,{variant:"caption",component:"span",className:Z.label,children:p})]}):(0,r.jsxs)(Fe,{title:E,className:Y()(Z.link,Z[e]),to:a,onClick:v,children:[d,(0,r.jsx)(b.Z,{variant:"caption",component:"span",className:Z.label,children:p})]})}const or=(0,l.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function Rn(e){const{links:o}=e,a=or();return(0,r.jsx)("nav",{className:a.links,children:o.map((d,p)=>(0,r.jsx)(bo,{...d},p+1))})}const sr=e=>{const o=e==="dark"?"16%":"97%";return`
|
|
16
|
-
hsl(0, 0%, ${o}) 0%,
|
|
17
|
-
hsla(0, 0%, ${o}, 0.987) 8.1%,
|
|
18
|
-
hsla(0, 0%, ${o}, 0.951) 15.5%,
|
|
19
|
-
hsla(0, 0%, ${o}, 0.896) 22.5%,
|
|
20
|
-
hsla(0, 0%, ${o}, 0.825) 29%,
|
|
21
|
-
hsla(0, 0%, ${o}, 0.741) 35.3%,
|
|
22
|
-
hsla(0, 0%, ${o}, 0.648) 41.2%,
|
|
23
|
-
hsla(0, 0%, ${o}, 0.55) 47.1%,
|
|
24
|
-
hsla(0, 0%, ${o}, 0.45) 52.9%,
|
|
25
|
-
hsla(0, 0%, ${o}, 0.352) 58.8%,
|
|
26
|
-
hsla(0, 0%, ${o}, 0.259) 64.7%,
|
|
27
|
-
hsla(0, 0%, ${o}, 0.175) 71%,
|
|
28
|
-
hsla(0, 0%, ${o}, 0.104) 77.5%,
|
|
29
|
-
hsla(0, 0%, ${o}, 0.049) 84.5%,
|
|
30
|
-
hsla(0, 0%, ${o}, 0.013) 91.9%,
|
|
31
|
-
hsla(0, 0%, ${o}, 0) 100%
|
|
32
|
-
`},yr=100,Tr=10,Ir=(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:yr,height:`calc(100% + ${Tr}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-Tr,background:`linear-gradient(90deg, ${sr(e.palette.type)})`},fadeRight:{right:-Tr,background:`linear-gradient(270deg, ${sr(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function Wr(e){const[[o,a],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const p=e.current;if(!p){d([0,0]);return}const v=()=>{const E=p.scrollLeft,Z=p.scrollWidth-p.offsetWidth-p.scrollLeft;d([E,Z])};return v(),p.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{p.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[e]),[o,a]}function So(e,o,a){const[d,p]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const v=window.performance.now(),E=requestAnimationFrame(Z=>{if(!e.current)return;const H=Z-v,N=Math.abs(d)*H/o,ie=Math.max(a,N)*Math.sign(d);e.current.scrollBy({left:ie});const ye=d-ie;Math.sign(d)!==Math.sign(ye)?p(0):p(ye)});return()=>cancelAnimationFrame(E)},[e,d,o,a]),p}function Xo(e){const{scrollStep:o=100,scrollSpeed:a=50,minScrollDistance:d=5,children:p,...v}=e,E=Ir(e),Z=React.useRef(),[H,N]=Wr(Z),ue=So(Z,a,d),ie=ye=>{Z.current&&ue(ye?o:-o)};return _jsxs(Box,{...v,className:E.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:E.container,ref:Z,children:p}),_jsx(Box,{className:classNames(E.fade,E.fadeLeft,{[E.fadeHidden]:H===0})}),_jsx(Box,{className:classNames(E.fade,E.fadeRight,{[E.fadeHidden]:N===0})}),H>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>ie(!1),className:classNames(E.button,E.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),N>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>ie(!0),className:classNames(E.button,E.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const Vr=(0,l.Z)(e=>({alpha:{color:e.palette.common.white,fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}}),{name:"BackstageLifecycle"});function tr(e){const o=Vr(e),{shorthand:a,alpha:d}=e;return a?_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],style:{fontSize:"120%"},children:d?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],children:d?"Alpha":"Beta"})}const Rr=(0,m.lazy)(()=>Promise.all([t.e(5869),t.e(6051)]).then(t.bind(t,76051)).then(e=>({default:e.RealLogViewer})));function Lr(e){const{Progress:o}=(0,F.qD)().getComponents();return(0,r.jsx)(m.Suspense,{fallback:(0,r.jsx)(o,{}),children:(0,r.jsx)(Rr,{...e})})}var Co=t(28865),Hr=t(60251);const Gr=(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"}),Pr=(e,o)=>o?typeof o=="string"?e+o:m.Children.toArray(o.props.children).reduce(Pr,e):e,fr=({level:e,children:o})=>{const p=m.Children.toArray(o).reduce(Pr,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return m.createElement(`h${e}`,{id:p},o)},Kr={code:({inline:e,className:o,children:a,...d})=>{const p=String(a).replace(/\n+$/,""),v=/language-(\w+)/.exec(o||"");return!e&&v?(0,r.jsx)(Ae,{language:v[1],text:p}):(0,r.jsx)("code",{className:o,...d,children:a})},h1:fr,h2:fr,h3:fr,h4:fr,h5:fr,h6:fr};function wo(e){const{content:o,dialect:a="gfm",linkTarget:d,transformLinkUri:p,transformImageUri:v,className:E}=e,Z=Gr();return(0,r.jsx)(Co.D,{remarkPlugins:a==="gfm"?[Hr.Z]:[],className:`${Z.markdown} ${E}`,children:o,components:Kr,linkTarget:d,transformLinkUri:p,transformImageUri:v})}var jo=t(23054);const Yr=(0,l.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),Eo=({request:e,busy:o,setBusy:a})=>{const d=Yr(),[p,v]=useState(),E=async()=>{a(!0);try{await e.trigger()}catch(H){v(isError(H)?H.message:"An unspecified error occurred")}finally{a(!1)}},Z=e.provider.icon;return _jsxs(ListItem,{disabled:o,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx(Z,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:p&&_jsx(Typography,{color:"error",children:p})}),_jsx(Button,{color:"primary",variant:"contained",onClick:E,children:"Log in"})]})};var qo=null;const gr=(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 _o(e){const o=gr(),[a,d]=useState(!1),p=useApi(oauthRequestApiRef),v=useObservable(useMemo(()=>p.authRequest$(),[p]),[]),E=()=>{v.forEach(Z=>Z.reject())};return _jsxs(Dialog,{open:Boolean(v.length),fullWidth:!0,maxWidth:"xs",classes:{paper:o.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsx(DialogTitle,{classes:{root:o.title},id:"oauth-req-dialog-title",children:_jsx(Typography,{className:o.titleHeading,variant:"h1",children:"Login Required"})}),_jsx(DialogContent,{dividers:!0,classes:{root:o.contentList},children:_jsx(List,{children:v.map(Z=>_jsx(LoginRequestListItem,{request:Z,busy:a,setBusy:d},Z.provider.title))})})]}),_jsx(DialogActions,{classes:{root:o.actionButtons},children:_jsx(Button,{onClick:E,children:"Reject All"})})]})}var so=t(15277),Ao=t.n(so),To=t(29862);const kr=(0,l.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function xr(e){const[o,a]=(0,m.useState)(!1),d=(0,To.t)(),p=kr(),v=Z=>{d()&&a(Z)};var E;return(0,r.jsx)(Lt.ZP,{title:(E=e.title)!==null&&E!==void 0?E:e.text||"",placement:e.placement,disableHoverListener:!o,children:(0,r.jsx)(Ao(),{text:e.text,line:e.line,onToggled:v,containerClassName:p.container})})}var br=t(67358);function io(e){const o=(0,Et.Z)(),[a,d]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{const p=setTimeout(()=>d(!0),o.transitions.duration.short);return()=>clearTimeout(p)},[o.transitions.duration.short]),a?(0,r.jsx)(br.Z,{...e,"data-testid":"progress"}):(0,r.jsx)(je.Z,{display:"none"})}var Io=t(94339),Jr=t(14503),Wn=t(24579),Ro=t(32552),Ln=t(15459),es=t(27597);const ts=(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 ns(e){const{link:o,title:a,onClick:d}=e,p=ts();return(0,r.jsxs)(je.Z,{children:[(0,r.jsx)(w.Z,{}),(0,r.jsx)(Fe,{to:o,onClick:d,underline:"none",children:(0,r.jsxs)(je.Z,{display:"flex",alignItems:"center",className:p.root,children:[(0,r.jsx)(je.Z,{className:p.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)(b.Z,{children:(0,r.jsx)("strong",{children:a})})}),(0,r.jsx)(es.Z,{className:p.arrow})]})})]})}const rs=e=>{const{slackChannel:o}=e;if(o){if(typeof o=="string")return(0,r.jsxs)(b.Z,{children:["Please contact ",o," for help."]});if(!o.href)return(0,r.jsxs)(b.Z,{children:["Please contact ",o.name," for help."]})}else return null;return(0,r.jsx)(He,{to:o.href,variant:"contained",children:o.name})},os=class extends m.Component{componentDidCatch(o,a){console.error(`ErrorBoundary, error: ${o}, info: ${a}`),this.setState({error:o,errorInfo:a})}render(){const{slackChannel:o,children:a}=this.props,{error:d}=this.state;return d?(0,r.jsx)(bn,{title:"Something Went Wrong",error:d,children:(0,r.jsx)(rs,{slackChannel:o})}):a}constructor(o){super(o),this.state={error:void 0,errorInfo:void 0}}},ir=(0,l.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),Lo=(0,Ln.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Jr.Z),ao={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 Or(e){const{title:o,subheader:a,divider:d=!0,deepLink:p,slackChannel:v,errorBoundaryProps:E,variant:Z,children:H,headerStyle:N,headerProps:ue,icon:ie,action:ye,actionsClassName:Le,actions:Me,cardClassName:Qe,actionsTopRight:Ot,className:Yt,noPadding:nn,titleTypographyProps:rn}=e,Bt=ir();let _t={},Jt={};Z&&Z.split(/[\s]+/g).forEach(Er=>{_t={..._t,...ao.card[Er]},Jt={...Jt,...ao.cardContent[Er]}});const Cr=()=>!a&&!ie?null:(0,r.jsxs)("div",{className:Bt.headerSubheader,"data-testid":"info-card-subheader",children:[a&&(0,r.jsx)("div",{className:Bt.subheader,children:a}),ie]}),wr=E||(v?{slackChannel:v}:{});return(0,r.jsx)(Io.Z,{style:_t,className:Yt,children:(0,r.jsxs)(os,{...wr,children:[o&&(0,r.jsx)(Ro.Z,{classes:{root:Bt.header,title:Bt.headerTitle,subheader:Bt.headerSubheader,avatar:Bt.headerAvatar,action:Bt.headerAction,content:Bt.headerContent},title:o,subheader:Cr(),action:ye,style:{...N},titleTypographyProps:rn,...ue}),Ot&&(0,r.jsx)(Lo,{children:Ot}),d&&(0,r.jsx)(w.Z,{}),(0,r.jsx)(Wn.Z,{className:Y()(Qe,{[Bt.noPadding]:nn}),style:Jt,children:H}),Me&&(0,r.jsx)(Jr.Z,{className:Le,children:Me}),p&&(0,r.jsx)(ns,{...p})]})})}var ss=t(39307);const Br=(0,l.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:e.typography.pxToRem(45),fontWeight:e.typography.fontWeightBold,color:e.palette.textContrast},description:{fontSize:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)",position:"absolute",wordBreak:"break-all",display:"inline-block"},circle:{width:"80%",transform:"translate(10%, 0)"},colorUnknown:{}}),{name:"BackstageGauge"}),Po={fractional:!0,inverse:!1,unit:"%",max:100},S=({palette:e,value:o,inverse:a,max:d})=>{if(isNaN(o))return"#ddd";const p=d||Po.max,v=a?p-o:o;return v<p/3?e.status.error:v<p*(2/3)?e.status.warning:e.status.ok};function C(e){const[o,a]=useState(null),{getColor:d=S}=e,p=Br(e),{palette:v}=useTheme(),{value:E,fractional:Z,inverse:H,unit:N,max:ue,description:ie}={...Po,...e},ye=Z?Math.round(E*ue):E,Le=ue!==100?Math.round(E):ye,[Me,Qe]=useState(!1);return useEffect(()=>{const Ot=o,Yt=()=>Qe(!0),nn=()=>Qe(!1);return Ot&&ie?(Ot.addEventListener("mouseenter",Yt),Ot.addEventListener("mouseleave",nn),()=>{Ot.removeEventListener("mouseenter",Yt),Ot.removeEventListener("mouseleave",nn)}):()=>{Qe(!1)}},[ie,o]),_jsxs(Box,{ref:a,className:p.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:ye,strokeWidth:12,trailWidth:12,strokeColor:d({palette:v,value:Le,inverse:H,max:ue}),className:p.circle}),ie&&Me?_jsx(Box,{className:p.description,children:ie}):_jsx(Box,{className:p.overlay,children:isNaN(E)?"N/A":`${Le}${N}`})]})}const O=(0,l.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function D(e){const o=O(e),{title:a,subheader:d,progress:p,inverse:v,deepLink:E,description:Z,icon:H,variant:N,getColor:ue}=e,ie={inverse:v,description:Z,getColor:ue,value:p};return _jsx(Box,{className:o.root,children:_jsx(InfoCard,{title:a,subheader:d,deepLink:E,variant:N,icon:H,children:_jsx(Gauge,{...ie})})})}function _(e){const{value:o,getColor:a=getProgressColor}=e,{palette:d}=useTheme();if(isNaN(o))return null;let p=Math.round(o*100*100)/100;p>100&&(p=100);const v=a({palette:d,value:p,inverse:!1,max:100});return _jsx(Tooltip,{title:`${p}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:p,strokeWidth:4,trailWidth:4,strokeColor:v})})})}var se=t(21324),ne=t(7089),ge=t(1292),Ce=t(42494),Ie=t(74603),me=t(56939),ke=t(12231),nt=t(73698),Je=t(12420),ot=t(72379);const $e=(0,l.Z)(e=>(0,Je.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var Nt=()=>{const e=$e();return(0,r.jsx)(ot.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const fn=(0,l.Z)(e=>(0,Je.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Pn=()=>{const e=fn();return(0,r.jsx)(ot.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const gn=(0,Ln.Z)(e=>(0,Je.Z)({root:{"label + &":{marginTop:e.spacing(3)}},input:{borderRadius:e.shape.borderRadius,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:e.typography.body1.fontSize,padding:e.spacing(1.25,3.25,1.25,1.5),transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:e.shape.borderRadius}}}),{name:"BackstageSelectInputBase"})(Ie.Z),En=(0,l.Z)(e=>(0,Je.Z)({formControl:{margin:`${e.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:2},checkbox:{},root:{display:"flex",flexDirection:"column"}}),{name:"BackstageSelect"});function An(e){const{multiple:o,items:a,label:d,placeholder:p,selected:v,onChange:E,triggerReset:Z,native:H=!1,disabled:N=!1,margin:ue}=e,ie=En(),[ye,Le]=(0,m.useState)(v||(o?[]:"")),[Me,Qe]=(0,m.useState)(!1);(0,m.useEffect)(()=>{Le(o?[]:"")},[Z,o]),(0,m.useEffect)(()=>{v!==void 0&&Le(v)},[v]);const Ot=Bt=>{Le(Bt.target.value),E(Bt.target.value)},Yt=Bt=>{if(N){Bt.preventDefault();return}Qe(_t=>o&&!(Bt.target instanceof HTMLElement)?!0:!_t)},nn=()=>{Qe(!1)},rn=Bt=>()=>{const _t=ye.filter(Jt=>Jt!==Bt);Le(_t),E(_t)};return(0,r.jsx)(je.Z,{className:ie.root,children:(0,r.jsx)(ge.Z,{onClickAway:nn,children:(0,r.jsxs)(Ce.Z,{className:ie.formControl,children:[(0,r.jsx)(me.Z,{className:ie.formLabel,children:d}),(0,r.jsxs)(nt.Z,{"aria-label":d,value:ye,native:H,disabled:N,"data-testid":"select",displayEmpty:!0,multiple:o,margin:ue,onChange:Ot,onClick:Yt,open:Me,input:(0,r.jsx)(gn,{}),label:d,tabIndex:0,renderValue:Bt=>{var _t;return o&&ye.length!==0?(0,r.jsx)(je.Z,{className:ie.chips,children:Bt.map(Jt=>{var Cr,wr;return(0,r.jsx)(ne.Z,{label:(Cr=a.find(jr=>jr.value===Jt))===null||Cr===void 0?void 0:Cr.label,clickable:!0,onDelete:rn(Jt),className:ie.chip},(wr=a.find(jr=>jr.value===Jt))===null||wr===void 0?void 0:wr.value)})}):(0,r.jsx)(b.Z,{children:ye.length===0?p||"":(_t=a.find(Jt=>Jt.value===Bt))===null||_t===void 0?void 0:_t.label})},IconComponent:()=>Me?(0,r.jsx)(Pn,{}):(0,r.jsx)(Nt,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[p&&!o&&(0,r.jsx)(ke.Z,{value:[],children:p}),H?a&&a.map(Bt=>(0,r.jsx)("option",{value:Bt.value,children:Bt.label},Bt.value)):a&&a.map(Bt=>(0,r.jsxs)(ke.Z,{value:Bt.value,children:[o&&(0,r.jsx)(se.Z,{color:"primary",checked:ye.includes(Bt.value)||!1,className:ie.checkbox}),Bt.label]},Bt.value))]})]})})})}const mr=()=>{},$r=m.createContext({stepperLength:0,stepIndex:0,setStepIndex:mr,stepHistory:[],setStepHistory:mr,onStepChange:mr});function lo(e){const{children:o,elevated:a,onStepChange:d,activeStep:p=0}=e,[v,E]=useState(p),[Z,H]=useState([0]);useEffect(()=>{E(p)},[p]);const N=[];let ue;return Children.forEach(o,ie=>{isValidElement(ie)&&(ie.props.end?ue=ie:N.push(ie))}),_jsxs(_Fragment,{children:[_jsx($r.Provider,{value:{stepIndex:v,setStepIndex:E,stepHistory:Z,setStepHistory:H,onStepChange:d,stepperLength:Children.count(o)},children:_jsx(MuiStepper,{activeStep:v,orientation:"vertical",elevation:a?2:0,children:N})}),v>=Children.count(o)-1&&ue]})}const kn=(0,l.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),Dn=({text:e,handleClick:o})=>_jsx(Button,{onClick:o,children:e||"Reset"}),Sr=({text:e,handleClick:o,disabled:a,last:d,stepIndex:p})=>_jsx(Button,{variant:"contained",color:"primary",disabled:a,"data-testid":`nextButton-${p}`,onClick:o,children:e||(d?"Finish":"Next")}),Rs=({text:e,handleClick:o,disabled:a,stepIndex:d})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:a,"data-testid":`skipButton-${d}`,onClick:o,children:e||"Skip"}),Ls=({text:e,handleClick:o,disabled:a,stepIndex:d})=>_jsx(Button,{onClick:o,"data-testid":`backButton-${d}`,disabled:a,children:e||"Back"}),Oi=({actions:e={},children:o})=>{const a=kn(),{stepperLength:d,stepIndex:p,setStepIndex:v,stepHistory:E,setStepHistory:Z,onStepChange:H}=useContext(VerticalStepperContext),N=(Le,Me)=>{Me&&Me(),H&&H(p,Le),v(Le)},ue=()=>{const Le=e.nextStep?e.nextStep(p,d-1):p+1;N(Le,e.onNext),Z([...E,Le])},ie=()=>{E.pop(),N(E[E.length-1],e.onBack),Z([...E])},ye=()=>{N(0,e.onRestart),Z([0])};return _jsxs(Box,{className:a.root,children:[[void 0,!0].includes(e.showBack)&&p!==0&&_jsx(Ls,{text:e.backText,handleClick:ie,disabled:p===0,stepIndex:p}),e.showSkip&&_jsx(Rs,{text:e.skipText,handleClick:ue,disabled:!!d&&p>=d||!!e.canSkip&&!e.canSkip(),stepIndex:p}),[void 0,!0].includes(e.showNext)&&_jsx(Sr,{text:e.nextText,handleClick:ue,disabled:!!d&&p>=d||!!e.canNext&&!e.canNext(),stepIndex:p}),e.showRestart&&p!==0&&_jsx(Dn,{text:e.restartText,handleClick:ye,stepIndex:p}),o]})},is=(0,l.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function Ps(e){const{title:o,children:a,end:d,actions:p,...v}=e,E=is();return d?_jsxs(Box,{className:E.end,children:[_jsx(Typography,{variant:"h6",children:o}),a,_jsx(SimpleStepperFooter,{actions:{...p||{},showNext:!1}})]}):_jsxs(MuiStep,{...v,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:o})}),_jsxs(StepContent,{children:[a,_jsx(SimpleStepperFooter,{actions:p})]})]})}const Zr=(0,l.Z)(e=>({status:{fontWeight:e.typography.fontWeightMedium,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:e.spacing(1),borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:e.palette.status.ok}},warning:{"&::before":{backgroundColor:e.palette.status.warning}},error:{"&::before":{backgroundColor:e.palette.status.error}},pending:{"&::before":{backgroundColor:e.palette.status.pending}},running:{"&::before":{backgroundColor:e.palette.status.running}},aborted:{"&::before":{backgroundColor:e.palette.status.aborted}}}),{name:"BackstageStatus"});function Bi(e){const o=Zr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function $i(e){const o=Zr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function ks(e){const o=Zr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.error),"aria-label":"Status error","aria-hidden":"true",...e})}function ar(e){const o=Zr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function lr(e){const o=Zr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.running),"aria-label":"Status running","aria-hidden":"true",...e})}function cr(e){const o=Zr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var as=t(74600),ls=t(15584);const Os=e=>(0,Je.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),Bs={root:{border:"0",verticalAlign:"top"}},$s=e=>(0,Je.Z)({root:{margin:e.spacing(0,0,-1,0)}}),cs=e=>(0,Je.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),ds=(0,Ln.Z)(Os,{name:"BackstageMetadataTableTitleCell"})(ls.Z),Zs=(0,Ln.Z)(Bs,{name:"BackstageMetadataTableCell"})(ls.Z),Zi=({dense:e,children:o})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:o})}),Di=({title:e,children:o,...a})=>_jsxs(TableRow,{children:[e&&_jsx(ds,{children:e}),_jsx(Zs,{colSpan:e?1:2,...a,children:o})]}),us=(0,Ln.Z)($s,{name:"BackstageMetadataTableList"})(({classes:e,children:o})=>(0,r.jsx)(vt.Z,{disablePadding:!0,className:e.root,children:o})),Ds=(0,Ln.Z)(cs,{name:"BackstageMetadataTableListItem"})(({classes:e,children:o})=>(0,r.jsx)(et.Z,{className:e.root,children:o})),ko=(0,Je.Z)({root:{margin:"0 0",listStyleType:"none"}}),Ns=e=>(0,Je.Z)({root:{...ko.root,paddingLeft:e.spacing(1)}}),hs=(0,Ln.Z)(ko,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:o})=>(0,r.jsx)(us,{classes:e,children:o})),Qr=(0,Ln.Z)(Ns,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:o})=>(0,r.jsx)(us,{classes:e,children:o}));function ps(e,o){const a=e.map((d,p)=>_jsx(MetadataListItem,{children:Oo(d)},p));return o?_jsx(Qr,{children:a}):_jsx(hs,{children:a})}function Fs(e,o,a){const d=Object.keys(e).map(p=>{const v=Oo(e[p],!0),E=a&&a.titleFormat?a.titleFormat(p):startCase(p);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${E}: `}),v]},p)});return o?_jsx(Qr,{children:d}):_jsx(hs,{children:d})}function Oo(e,o,a){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?Fs(e,o,a):Array.isArray(e)?ps(e,a):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const Ni=({value:e,options:o})=>_jsx(Fragment,{children:Oo(e,o)}),Dr=({title:e,value:o,options:a})=>_jsx(MetadataTableItem,{title:a&&a.titleFormat?a.titleFormat(e):startCase(e),children:_jsx(Ni,{value:o,options:a})});function Us(e,o){return Object.keys(e).map(a=>_jsx(Dr,{title:a,value:e[a],options:o},a))}function Vn(e){const{metadata:o,dense:a=!0,options:d}=e,p=Us(o,d||{});return _jsx(MetadataTable,{dense:a,children:p})}var Fi=t(49429),Ui=t(86136),Ms=t(79784),zs=t(19126),Ws=t.n(zs);function Mi(e){return qs.stringify(e,{strictNullHandling:!0})}function co(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function fs(e,o){return co(e)[o]}function uo(e,o,a){const d={...co(e),[o]:a};return Mi(d)}function Bo(e,o=250){const[a,d]=useSearchParams(),p=a.toString(),[v,E]=useState(fs(p,e));return useEffect(()=>{const Z=fs(p,e);E(H=>isEqual(Z,H)?H:Z)},[p,E,e]),useDebouncedEffect(()=>{const Z=uo(p,e,v);p!==Z&&d(Z,{replace:!0})},[d,v,p,e],o),[v,E]}const ho={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 gs(){const o=(0,F.I_)().get(F.Ds),a=o==null?void 0:o.getOptionalConfig("app.support");if(!a)return ho;var d;return{url:a.getString("url"),items:a.getConfigArray("items").flatMap(p=>({title:p.getString("title"),icon:p.getOptionalString("icon"),links:((d=p.getOptionalConfigArray("links"))!==null&&d!==void 0?d:[]).flatMap(v=>({url:v.getString("url"),title:v.getString("title")}))}))}}var ms=t(80079);function Jn(e,o){const d=(0,F.qD)().getSystemIcon(e);return d?(0,r.jsx)(d,{...o}):(0,r.jsx)(ms.Z,{...o})}function zi(e){return Jn("brokenImage",e)}function Wi(e){return Jn("catalog",e)}function Vi(e){return Jn("chat",e)}function Hi(e){return Jn("dashboard",e)}function Gi(e){return Jn("docs",e)}function Pa(e){return Jn("email",e)}function Ki(e){return Jn("github",e)}function Yi(e){return Jn("group",e)}function Nr(e){return Jn("help",e)}function Ji(e){return Jn("user",e)}function Qi(e){return Jn("warning",e)}const vs=(0,l.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),Vs=({icon:e})=>{const o=(0,F.qD)();var a;const d=e&&(a=o.getSystemIcon(e))!==null&&a!==void 0?a:Nr;return(0,r.jsx)(d,{})};var $o;const Hs=({link:e})=>(0,r.jsx)(Fe,{to:e.url,children:($o=e.title)!==null&&$o!==void 0?$o:e.url}),Gs=({item:e})=>{var o;return(0,r.jsxs)(et.Z,{children:[(0,r.jsx)(Ui.Z,{children:(0,r.jsx)(Vs,{icon:e.icon})}),(0,r.jsx)(qe.Z,{primary:e.title,secondary:(o=e.links)===null||o===void 0?void 0:o.reduce((a,d,p)=>[...a,p>0&&(0,r.jsx)("br",{},p),(0,r.jsx)(Hs,{link:d},d.url)],[])})]})};function Xi(e){const{title:o,items:a,children:d}=e,{items:p}=gs(),[v,E]=(0,m.useState)(!1),[Z,H]=(0,m.useState)(null),N=vs(),ue=(0,Ze.Z)(Le=>Le.breakpoints.down("sm")),ie=Le=>{H(Le.currentTarget),E(!0)},ye=()=>{E(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(je.Z,{display:"flex",ml:1,children:ue?(0,r.jsx)(At.Z,{color:"primary",size:"small",onClick:ie,"data-testid":"support-button","aria-label":"Support",children:(0,r.jsx)(Nr,{})}):(0,r.jsx)(V.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:ie,startIcon:(0,r.jsx)(Nr,{}),children:"Support"})}),(0,r.jsxs)(Ms.ZP,{"data-testid":"support-button-popover",open:v,anchorEl:Z,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:ye,children:[(0,r.jsxs)(vt.Z,{className:N.popoverList,children:[o&&(0,r.jsx)(et.Z,{alignItems:"flex-start",children:(0,r.jsx)(b.Z,{variant:"subtitle1",children:o})}),m.Children.map(d,(Le,Me)=>(0,r.jsx)(et.Z,{alignItems:"flex-start",children:Le},`child-${Me}`)),(a!=null?a:p).map((Le,Me)=>(0,r.jsx)(Gs,{item:Le},`item-${Me}`))]}),(0,r.jsx)(Fi.Z,{children:(0,r.jsx)(V.Z,{color:"primary",onClick:ye,"aria-label":"Close",children:"Close"})})]})]})}var Zo=t(18671),Do=t(16060);const po=72,ys=24,No=18,_n={drawerWidthClosed:po,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:po,iconSize:po-ys*2,iconPadding:ys,selectedIndicatorWidth:3,userBadgePadding:No,userBadgeDiameter:po-No*2,mobileSidebarHeight:56},Ks=e=>({..._n,...e,iconContainerWidth:_n.drawerWidthClosed,iconSize:_n.drawerWidthClosed-_n.iconPadding*2,userBadgeDiameter:_n.drawerWidthClosed-_n.userBadgePadding*2}),xs={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:_n.defaultOpenDelayMs+200},Ys=e=>({...xs,...e}),qi="@backstage/core/sidebar-intro-dismissed",dr=(0,m.createContext)({sidebarConfig:_n,submenuConfig:xs}),Xr=(0,m.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var _i=t(50023),ea=t(4190),Js=t(87685),Qs=t(44882),qr=t(51837);const Xs={isOpen:!1,setOpen:()=>{}},_s=(0,m.createContext)(Xs),Fo=(0,qr.CT)("sidebar-open-state-context");function Uo(e){const{children:o,value:a}=e;return(0,r.jsx)(_s.Provider,{value:a,children:(0,r.jsx)(Fo.Provider,{value:(0,qr.EI)({1:a}),children:o})})}const Mo=()=>{const e=(0,m.useContext)(Fo),o=(0,m.useContext)(_s);if(e===void 0)return o||Xs;const a=e.atVersion(1);if(a===void 0)throw new Error("No context found for version 1.");return a};var ei=t(57998);const ti={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},ni=(0,m.createContext)(ti),ri=(0,qr.CT)("sidebar-pin-state-context");function ta(e){const{children:o,value:a}=e;return(0,r.jsx)(ni.Provider,{value:a,children:(0,r.jsx)(ri.Provider,{value:(0,qr.EI)({1:a}),children:o})})}const _r=()=>{const e=(0,m.useContext)(ri),o=(0,m.useContext)(ni);if(e===void 0)return o||ti;const a=e.atVersion(1);if(a===void 0)throw new Error("No context found for version 1.");return a},Nn=(0,l.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:o=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${o.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),na=e=>{const{to:o,label:a,icon:d,value:p}=e,{sidebarConfig:v}=(0,m.useContext)(dr),E=Nn({sidebarConfig:v}),Z=(0,ee.TH)(),{selectedMenuItemIndex:H,setSelectedMenuItemIndex:N}=(0,m.useContext)(si),ue=(ye,Le)=>{N(Le===H?-1:Le)},ie=p===H&&H>=0||p!==H&&!(H>=0)&&o===Z.pathname;return(0,r.jsx)(ei.Z,{"aria-label":a,label:a,icon:d,component:Fe,to:o||Z.pathname,onChange:ue,value:p,selected:ie,classes:E})},bs=e=>{const{children:o,to:a,label:d,icon:p,value:v}=e,{isMobile:E}=_r();return E?(0,r.jsx)(na,{to:a,label:d,icon:p,value:v}):(0,r.jsx)(r.Fragment,{children:o})},oi=(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:o=>({background:e.palette.navigation.background,width:"100%",bottom:`${o.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${o.sidebarConfig.mobileSidebarHeight}px)`,flex:"0 1 auto",overflow:"auto"}),overlayHeader:{display:"flex",color:e.palette.text.primary,alignItems:"center",justifyContent:"space-between",padding:e.spacing(2,3)},overlayHeaderClose:{color:e.palette.text.primary},marginMobileSidebar:o=>({marginBottom:`${o.sidebarConfig.mobileSidebarHeight}px`})})),ra=e=>(0,le.orderBy)(e,({props:{priority:o}})=>Number.isInteger(o)?o:-1,"desc"),oa=m.createElement(bs).type,sa=({children:e,label:o="Menu",open:a,onClose:d})=>{const{sidebarConfig:p}=(0,m.useContext)(dr),v=oi({sidebarConfig:p});return(0,r.jsxs)(ea.ZP,{anchor:"bottom",open:a,onClose:d,ModalProps:{BackdropProps:{classes:{root:v.marginMobileSidebar}}},classes:{root:v.marginMobileSidebar,paperAnchorBottom:v.overlay},children:[(0,r.jsxs)(je.Z,{className:v.overlayHeader,children:[(0,r.jsx)(b.Z,{variant:"h3",children:o}),(0,r.jsx)(At.Z,{onClick:d,classes:{root:v.overlayHeaderClose},children:(0,r.jsx)(Js.Z,{})})]}),(0,r.jsx)(je.Z,{component:"nav",children:e})]})},si=(0,m.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),ia=e=>{const{sidebarConfig:o}=(0,m.useContext)(dr),{children:a}=e,d=oi({sidebarConfig:o}),p=(0,ee.TH)(),[v,E]=(0,m.useState)(-1);(0,m.useEffect)(()=>{E(-1)},[p.pathname]);let Z=(0,F.vJ)(a,N=>N.getElements().filter(ue=>ue.type===oa));if(a)Z.length?Z=ra(Z):Z.push((0,r.jsx)(bs,{icon:(0,r.jsx)(Qs.Z,{}),children:a},"default_menu"));else return null;const H=v>=0&&!Z[v].props.to;return(0,r.jsx)(Uo,{value:{isOpen:!0,setOpen:()=>{}},children:(0,r.jsxs)(si.Provider,{value:{selectedMenuItemIndex:v,setSelectedMenuItemIndex:E},children:[(0,r.jsx)(sa,{label:Z[v]&&Z[v].props.label,open:H,onClose:()=>E(-1),children:Z[v]&&Z[v].props.children}),(0,r.jsx)(_i.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:Z})]})})};var zo;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(zo||(zo={}));const ii={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(zo.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(zo.SIDEBAR_PIN_STATE,JSON.stringify(e))}},aa=(0,l.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:o=>o.isPinned?o.sidebarConfig.drawerWidthOpen:o.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:o=>o.sidebarConfig.mobileSidebarHeight}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),ai=(0,m.createContext)({content:{contentRef:void 0}});function la(e){const[o,a]=(0,m.useState)(()=>ii.getSidebarPinState()),{sidebarConfig:d}=(0,m.useContext)(dr),p=(0,m.useRef)(null),v=(0,m.useMemo)(()=>({content:{contentRef:p}}),[p]);(0,m.useEffect)(()=>{ii.setSidebarPinState(o)},[o]);const E=(0,Ze.Z)(N=>N.breakpoints.down("xs"),{noSsr:!0}),Z=()=>a(!o),H=aa({isPinned:o,sidebarConfig:d});return(0,r.jsx)(ta,{value:{isPinned:o,toggleSidebarPinState:Z,isMobile:E},children:(0,r.jsx)(ai.Provider,{value:v,children:(0,r.jsx)(je.Z,{className:H.root,children:e.children})})})}function li(){const{content:e}=(0,m.useContext)(ai);return{focusContent:(0,m.useCallback)(()=>{var a,d;e==null||(a=e.contentRef)===null||a===void 0||(d=a.current)===null||d===void 0||d.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const Wo=(0,l.Z)(e=>({drawer:o=>({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:o.sidebarConfig.drawerWidthClosed,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"},"& .MuiButtonBase-root":{textTransform:"none"}}),drawerOpen:o=>({width:o.sidebarConfig.drawerWidthOpen,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shorter})}),visuallyHidden:{top:0,position:"absolute",zIndex:1e3,transform:"translateY(-200%)","&:focus":{transform:"translateY(5px)"}}}),{name:"BackstageSidebar"});var Hn;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Hn||(Hn={}));const ci=e=>{const{sidebarConfig:o}=(0,m.useContext)(dr),{openDelayMs:a=o.defaultOpenDelayMs,closeDelayMs:d=o.defaultCloseDelayMs,disableExpandOnHover:p,children:v}=e,E=Wo({sidebarConfig:o}),Z=(0,Ze.Z)(Yt=>Yt.breakpoints.down("md"),{noSsr:!0}),[H,N]=(0,m.useState)(Hn.Closed),ue=(0,m.useRef)(),{isPinned:ie,toggleSidebarPinState:ye}=_r(),Le=()=>{ie||p||(ue.current&&(clearTimeout(ue.current),ue.current=void 0),H!==Hn.Open&&!Z&&(ue.current=window.setTimeout(()=>{ue.current=void 0,N(Hn.Open)},a),N(Hn.Idle)))},Me=()=>{ie||p||(ue.current&&(clearTimeout(ue.current),ue.current=void 0),H===Hn.Idle?N(Hn.Closed):H===Hn.Open&&(ue.current=window.setTimeout(()=>{ue.current=void 0,N(Hn.Closed)},d)))},Qe=H===Hn.Open&&!Z||ie,Ot=Yt=>{Yt?(N(Hn.Open),ye()):(N(Hn.Closed),ye())};return(0,r.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,r.jsx)(ui,{}),(0,r.jsx)(Uo,{value:{isOpen:Qe,setOpen:Ot},children:(0,r.jsx)(je.Z,{className:E.root,"data-testid":"sidebar-root",onMouseEnter:p?()=>{}:Le,onFocus:p?()=>{}:Le,onMouseLeave:p?()=>{}:Me,onBlur:p?()=>{}:Me,children:(0,r.jsx)(je.Z,{className:Y()(E.drawer,{[E.drawerOpen]:Qe}),children:v})})})]})},di=e=>{var o;const a=Ks((o=e.sidebarOptions)!==null&&o!==void 0?o:{});var d;const p=Ys((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:v,disableExpandOnHover:E,openDelayMs:Z,closeDelayMs:H}=e,{isMobile:N}=_r();return N?(0,r.jsx)(ia,{children:v}):(0,r.jsx)(dr.Provider,{value:{sidebarConfig:a,submenuConfig:p},children:(0,r.jsx)(ci,{openDelayMs:Z,closeDelayMs:H,disableExpandOnHover:E,children:v})})};function ui(){const{sidebarConfig:e}=(0,m.useContext)(dr),{focusContent:o,contentRef:a}=li(),d=Wo({sidebarConfig:e});return a!=null&&a.current?(0,r.jsx)(V.Z,{onClick:o,variant:"contained",className:Y()(d.visuallyHidden),children:"Skip to content"}):null}function Ss(e,o){const a=new URLSearchParams(o.search).toString(),d=Ws().parse(a),p=new URLSearchParams(e.search).toString(),v=Ws().parse(p);return(0,le.isEqual)(o.pathname,e.pathname)&&(0,le.isMatch)(v,d)}const hi=(0,l.Z)(e=>{var o,a;return{item:{height:48,width:"100%","&:hover":{background:((o=e.palette.navigation.navItem)===null||o===void 0?void 0:o.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:e.spacing(2.5),cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:e.palette.common.white},label:{margin:e.spacing(1.75),marginLeft:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:((a=e.palette.navigation.navItem)===null||a===void 0?void 0:a.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}},{name:"BackstageSidebarSubmenuItem"}),ca=e=>{const{title:o,subtitle:a,to:d,icon:p,dropdownItems:v}=e,E=hi(),{setIsHoveredOn:Z}=useContext(SidebarItemWithSubmenuContext),H=()=>{Z(!1)},N=useResolvedPath(d!=null?d:""),ue=useLocation();let ie=isLocationMatch(ue,N);const[ye,Le]=useState(!1),Me=()=>{Le(!ye)};return v!==void 0?(v.some(Qe=>{const Ot=resolvePath(Qe.to);return ie=isLocationMatch(ue,Ot),ie}),_jsxs(Box,{className:E.itemContainer,children:[_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:Me,onTouchStart:Qe=>Qe.stopPropagation(),className:classnames(E.item,ie?E.selected:void 0),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:E.label,children:[o,_jsx("br",{}),a&&_jsx(Typography,{variant:"caption",className:E.subtitle,children:a})]}),ye?_jsx(ArrowDropUpIcon,{className:E.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:E.dropdownArrow})]})}),v&&ye&&_jsx(Box,{className:E.dropdown,children:v.map((Qe,Ot)=>_jsx(Tooltip,{title:Qe.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:Qe.to,underline:"none",className:E.dropdownItem,onClick:H,onTouchStart:Yt=>Yt.stopPropagation(),children:_jsx(Typography,{className:E.textContent,children:Qe.title})})},Ot))})]})):_jsx(Box,{className:E.itemContainer,children:_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames(E.item,ie?E.selected:void 0),onClick:H,onTouchStart:Qe=>Qe.stopPropagation(),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:E.label,children:[o,_jsx("br",{}),a&&_jsx(Typography,{variant:"caption",className:E.subtitle,children:a})]})]})})})};var Vo;const pi=(0,l.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:o=>{var a;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:o.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(Vo=(a=e.palette.navigation.submenu)===null||a===void 0?void 0:a.background)!==null&&Vo!==void 0?Vo:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:o.submenuConfig.drawerWidthClosed,transitionDelay:`${o.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:o=>({width:o.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium,color:e.palette.common.white,padding:e.spacing(2.5),[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),da=e=>{const{isOpen:o}=Mo(),{sidebarConfig:a,submenuConfig:d}=(0,m.useContext)(dr),p=o?a.drawerWidthOpen:a.drawerWidthClosed,v=pi({left:p,submenuConfig:d}),{isHoveredOn:E}=(0,m.useContext)(Xr),[Z,H]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{H(E)},[E]),(0,r.jsxs)(je.Z,{className:Y()(v.drawer,{[v.drawerOpen]:Z}),children:[(0,r.jsx)(b.Z,{variant:"h5",className:v.title,children:e.title}),e.children]})};var fi=t(26739),fo=t(76600),ua=t(83543),gi=t(59797),Cs=t(98989);const mi=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),ha=()=>{const e=mi();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})})]})};var pa=null;const vi=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),fa=()=>{const e=vi();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})})]})};var ur=null,Ho,Go;const yi=e=>(0,l.Z)(o=>{var a,d;return{root:{color:o.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[o.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(Ho=(a=o.palette.navigation.navItem)===null||a===void 0?void 0:a.hoverBackground)!==null&&Ho!==void 0?Ho:"#404040"}},highlighted:{background:(Go=(d=o.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&Go!==void 0?Go:"#404040"},label:{fontWeight:"bold",whiteSpace:"nowrap",lineHeight:"auto",flex:"3 1 auto",width:"110px",overflow:"hidden","text-overflow":"ellipsis"},iconContainer:{boxSizing:"border-box",height:"100%",width:e.iconContainerWidth,marginRight:-o.spacing(2),display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"0"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:o.typography.fontWeightBold,fontSize:o.typography.fontSize},searchFieldHTMLInput:{padding:o.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:o.spacing(6),textAlign:"center",marginRight:o.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:o.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${o.palette.navigation.indicator}`,color:o.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function eo(e){return(0,m.useMemo)(()=>yi(e),[e])()}const xi=(e,o)=>(0,F.vJ)(e.props.children,a=>{let d=!1;return a.getElements().forEach(({props:{to:p,dropdownItems:v}})=>{if(!d){if(v!=null&&v.length){v.forEach(({to:E})=>d=d||Ss(o,(0,Do.i3)(E)));return}p&&(d=Ss(o,(0,Do.i3)(p)))}}),d},[o.pathname]);function ws(e){return e.to===void 0}const bi=m.createElement(da).type,Si=m.forwardRef(function({to:o,end:a,style:d,className:p,activeStyle:v,caseSensitive:E,activeClassName:Z="active","aria-current":H="page",...N},ue){let{pathname:ie}=(0,ee.TH)(),{pathname:ye}=(0,ee.WU)(o);E||(ie=ie.toLocaleLowerCase("en-US"),ye=ye.toLocaleLowerCase("en-US"));let Le=ie===ye;!Le&&!a&&(Le=ie.startsWith(`${ye}/`));const Me=Le?H:void 0;return(0,r.jsx)(X.rU,{...N,to:o,ref:ue,"aria-current":Me,style:{...d,...Le?v:void 0},className:Y()([p,Le?Z:void 0])})}),Ci=(0,m.forwardRef)((e,o)=>{const{icon:a,text:d,hasNotifications:p=!1,hasSubmenu:v=!1,disableHighlight:E=!1,onClick:Z,children:H,className:N,...ue}=e,{sidebarConfig:ie}=(0,m.useContext)(dr),ye=eo(ie),{isOpen:Le}=Mo(),Me=!Le&&v?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},Qe=(0,r.jsxs)(je.Z,{style:Me,children:[(0,r.jsx)(a,{fontSize:"small"}),!Le&&v?(0,r.jsx)(Cs.Z,{fontSize:"small"}):(0,r.jsx)(r.Fragment,{})]}),Ot=(0,r.jsx)(fi.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!p,className:Y()({[ye.closedItemIcon]:!Le}),children:Qe}),Yt=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(je.Z,{"data-testid":"login-button",className:ye.iconContainer,children:Ot}),d&&(0,r.jsx)(b.Z,{variant:"subtitle2",className:ye.label,children:d}),(0,r.jsx)("div",{className:ye.secondaryAction,children:H})]}),nn=Le?Yt:Ot,rn={onClick:Z,className:Y()(N,ye.root,Le?ye.open:ye.closed,ws(e)&&ye.buttonItem,{[ye.highlightable]:!E})};return ws(e)?(0,r.jsx)(V.Z,{role:"button","aria-label":d,...rn,ref:o,children:nn}):(0,r.jsx)(Si,{...rn,activeClassName:ye.selected,to:e.to?e.to:"",ref:o,"aria-label":d||e.to,...ue,children:nn})}),wi=({children:e,...o})=>{const{sidebarConfig:a}=(0,m.useContext)(dr),d=eo(a),[p,v]=(0,m.useState)(!1),E=(0,ee.TH)(),Z=xi(e,E),H=(0,Ze.Z)(ye=>ye.breakpoints.down("sm")),N=()=>{v(!0)},ue=()=>{v(!1)},ie=()=>H?p?(0,r.jsx)(gi.Z,{fontSize:"small",className:d.submenuArrow}):(0,r.jsx)(ua.Z,{fontSize:"small",className:d.submenuArrow}):!p&&(0,r.jsx)(Cs.Z,{fontSize:"small",className:d.submenuArrow});return(0,r.jsx)(Xr.Provider,{value:{isHoveredOn:p,setIsHoveredOn:v},children:(0,r.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:ue,onTouchStart:p?ue:N,onMouseEnter:N,className:Y()(p&&d.highlighted),children:[(0,r.jsx)(Ci,{hasSubmenu:!0,className:Z?d.selected:"",...o,children:ie()}),p&&e]})})},i=(0,m.forwardRef)((e,o)=>{const[a]=(0,F.vJ)(e.children,d=>d.getElements().filter(p=>p.type===bi));return a?(0,r.jsx)(wi,{...e,children:a}):(0,r.jsx)(Ci,{...e,ref:o})});function n(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),[a,d]=useState(""),p=eo(o),v=e.icon?e.icon:SearchIcon,E=()=>{e.onSearch(a),d("")},Z=ie=>{ie.key==="Enter"&&(ie.preventDefault(),E())},H=ie=>{d(ie.target.value)},N=ie=>{ie.preventDefault(),ie.stopPropagation()},ue=ie=>{E(),ie.preventDefault()};return _jsx(Box,{className:p.searchRoot,children:_jsx(i,{icon:v,to:e.to,onClick:ue,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:a,onClick:N,onChange:H,onKeyDown:Z,className:p.searchContainer,InputProps:{disableUnderline:!0,className:p.searchField},inputProps:{className:p.searchFieldHTMLInput}})})})}const s=(0,fo.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),c=(0,fo.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),f=(0,fo.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{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"}}),k=(0,fo.Z)("div")(({theme:e})=>{const o=I(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":o,"&:hover":o}}),z=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),o=eo(e),{isOpen:a,setOpen:d}=useSidebarOpenState();if(useMediaQuery(E=>E.breakpoints.down("md"),{noSsr:!0}))return null;const v=()=>{d(!a)};return _jsx(Button,{role:"button",onClick:v,className:o.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:o.arrows,children:a?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},te=(0,l.Z)(e=>({introCard:o=>({color:"#b5b5b5",fontSize:12,width:o.sidebarConfig.drawerWidthOpen,marginTop:e.spacing(2.25),marginBottom:e.spacing(1.5),paddingLeft:o.sidebarConfig.iconPadding,paddingRight:o.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:e.spacing(1.5)},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:e.spacing(.5),"&:hover":{color:e.palette.linkHover,transition:e.transitions.create("color",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:e.spacing(1.5)}}),{name:"BackstageSidebarIntro"});function De(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),a=te({sidebarConfig:o}),{text:d,onClose:p}=e,v=()=>p();return _jsxs(Box,{className:a.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:d}),_jsx(Box,{className:a.introDismiss,children:_jsxs(IconButton,{onClick:v,className:a.introDismissLink,children:[_jsx(CloseIcon,{className:a.introDismissIcon}),_jsx(Typography,{component:"span",className:a.introDismissText,children:"Dismiss"})]})})]})}const Ee=e=>{const{text:o,onDismiss:a}=e,[d,p]=useState(!1),v=()=>{p(!0)};return _jsx(Collapse,{in:!d,onExited:a,children:_jsx(De,{text:o,onClose:v})})},tt=null,lt="And your recently viewed plugins will pop up here!";function Ct(e){const{isOpen:o}=useSidebarOpenState(),a={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:d,set:p}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:v,recentlyViewedItemsDismissed:E}=d!=null?d:{},Z=()=>{p(N=>({...a,...N,starredItemsDismissed:!0}))},H=()=>{p(N=>({...a,...N,recentlyViewedItemsDismissed:!0}))};return o?_jsxs(_Fragment,{children:[!v&&_jsxs(_Fragment,{children:[_jsx(Ee,{text:tt,onDismiss:Z}),_jsx(SidebarDivider,{})]}),!E&&_jsx(Ee,{text:lt,onDismiss:H})]}):null}const wt=(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 Ft(e){const{className:o,stretch:a,noPadding:d,children:p,...v}=e,{contentRef:E}=li(),Z=wt();return(0,r.jsx)("article",{ref:E,tabIndex:-1,...v,className:Y()(Z.root,o,{[Z.stretch]:a,[Z.noPadding]:d}),children:p})}var Mt=t(6487),Fn=t(99152);const nr=(0,l.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{...e.typography.caption,padding:e.spacing(3,3),textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,color:e.palette.text.secondary},selected:{color:e.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:e.palette.background.default,color:e.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function rr(e){const{tabs:o,onChange:a,selectedIndex:d}=e,[p,v]=(0,m.useState)(d!=null?d:0),E=nr(),Z=(0,m.useCallback)((H,N)=>{d===void 0&&v(N),a&&d!==N&&a(N)},[d,a]);return(0,m.useEffect)(()=>{d!==void 0&&v(d)},[d]),(0,r.jsx)(je.Z,{className:E.tabsWrapper,children:(0,r.jsx)(Fn.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:Z,value:p,children:o.map((H,N)=>(0,m.createElement)(Mt.Z,{...H.tabProps,"data-testid":`header-tab-${N}`,label:H.label,key:H.id,value:N,className:E.defaultTab,classes:{selected:E.selected,root:E.tabRoot}}))})})}function go(e){const o=(0,ee.UO)(),d=e.map(({path:ye,children:Le})=>({caseSensitive:!1,path:`${ye}/*`,element:Le})).sort((ye,Le)=>Le.path.replace(/\/\*$/,"").localeCompare(ye.path.replace(/\/\*$/,"")));var p;const v=(p=(0,ee.V$)(d))!==null&&p!==void 0?p:e[0].children;var E;let Z=(E=o["*"])!==null&&E!==void 0?E:"";Z.startsWith("/")||(Z=`/${Z}`);var H;const[N]=(H=(0,Do.fp)(d,Z))!==null&&H!==void 0?H:[],ue=N?e.findIndex(ye=>`${ye.path}/*`===N.route.path):0;var ie;return{index:ue===-1?0:ue,element:v,route:(ie=e[ue])!==null&&ie!==void 0?ie:e[0]}}function js(e){const{routes:o}=e,a=(0,ee.s0)(),{index:d,route:p,element:v}=go(o),E=(0,m.useMemo)(()=>o.map(H=>({id:H.path,label:H.title,tabProps:H.tabProps})),[o]),Z=H=>{let{path:N}=o[H];N=N.replace(/\/\*$/,""),N=N.replace(/^\//,""),a(N)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rr,{tabs:E,selectedIndex:d,onChange:Z}),(0,r.jsxs)(Ft,{children:[(0,r.jsx)(Zo.q,{title:p.title}),v]})]})}const Ko=()=>null;(0,F.R5)(Ko,"core.gatherMountPoints",!0);function mo(e){const o=(0,r.jsx)(Ko,{path:"",title:"",children:(0,r.jsx)("div",{})}).type;return m.Children.toArray(e).flatMap(a=>{if(!(0,m.isValidElement)(a))return[];if(a.type===m.Fragment)return mo(a.props.children);if(a.type!==o)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:p,children:v,tabProps:E}=a.props;return[{path:d,title:p,children:v,tabProps:E}]})}function ji(e){const o=mo(e.children);return(0,r.jsx)(js,{routes:o})}ji.Route=Ko;const Fr=(0,l.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function ka(e){const{value:o,subvalue:a}=e,d=Fr();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(je.Z,{className:d.value,children:o}),(0,r.jsx)(je.Z,{className:d.subvalue,children:a})]})}var Es=t(67222),Oa=t(21070),Ba=t(90324),$a=t(98281),Za=t(48049),ga=t(51209),ma=t(33375),Da=t(44233),Na=t(27604),Ei=t(36444),Fa=t(37971),Ua=t(59709),Ma=t(17373),za=t(3702),Wa=t(93111);const Va=(0,l.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:e.spacing(7.5),justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),Ha=e=>{var o;const a=Va(),{onChangeFilters:d}=e,[p,v]=(0,m.useState)({...e.selectedFilters}),[E,Z]=(0,m.useState)(!1),H=()=>{v({}),Z(N=>!N)};return(0,m.useEffect)(()=>{d(p)},[p,d]),(0,r.jsxs)(je.Z,{className:a.root,children:[(0,r.jsxs)(je.Z,{className:a.header,children:[(0,r.jsx)(je.Z,{className:a.value,children:"Filters"}),(0,r.jsx)(V.Z,{color:"primary",onClick:H,children:"Clear all"})]}),(0,r.jsx)(je.Z,{className:a.filters,children:((o=e.filters)===null||o===void 0?void 0:o.length)&&e.filters.map(N=>(0,r.jsx)(An,{triggerReset:E,...N.element,selected:p[N.element.label],onChange:ue=>v({...p,[N.element.label]:ue})},N.element.label))})]})},va={Add:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Oa.Z,{...e,ref:o})),Check:(0,m.forwardRef)((e,o)=>(0,r.jsx)($a.Z,{...e,ref:o})),Clear:(0,m.forwardRef)((e,o)=>(0,r.jsx)(ma.Z,{...e,ref:o})),Delete:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Da.Z,{...e,ref:o})),DetailPanel:(0,m.forwardRef)((e,o)=>(0,r.jsx)(ga.Z,{...e,ref:o})),Edit:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Na.Z,{...e,ref:o})),Export:(0,m.forwardRef)((e,o)=>(0,r.jsx)(za.Z,{...e,ref:o})),Filter:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Ei.Z,{...e,ref:o})),FirstPage:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Fa.Z,{...e,ref:o})),LastPage:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Ua.Z,{...e,ref:o})),NextPage:(0,m.forwardRef)((e,o)=>(0,r.jsx)(ga.Z,{...e,ref:o})),PreviousPage:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Za.Z,{...e,ref:o})),ResetSearch:(0,m.forwardRef)((e,o)=>(0,r.jsx)(ma.Z,{...e,ref:o})),Search:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Ei.Z,{...e,ref:o})),SortArrow:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Ba.Z,{...e,ref:o})),ThirdStateCheck:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Ma.Z,{...e,ref:o})),ViewColumn:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Wa.Z,{...e,ref:o}))};function ya(e,o){const a=o.split(".");let d=e[a[0]];for(let p=1;p<a.length;++p){if(d===void 0)return d;const v=a[p];d=d[v]}return d}const Ga=(0,Ln.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"})(Es.W$),xa=(0,Ln.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:e.typography.fontWeightBold}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(Es.UW),Ka=(0,l.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Ya=(0,l.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Ja(e,o){return e.map(a=>{const d={};let p=a.cellStyle||{};if(a.highlight)if(d.color=o.palette.textContrast,typeof p=="object")p.fontWeight=o.typography.fontWeightBold;else{const v=p;p=(E,Z,H)=>({...v(E,Z,H),fontWeight:o.typography.fontWeightBold})}return{...a,headerStyle:d,cellStyle:p}})}function Qa(e,o){return(0,le.transform)(e,(a,d,p)=>{(0,le.isEqual)(d,o[p])||(a[p]=d)})}const ba={search:"",filtersOpen:!1,filters:{}};function Xa(e){const{toolbarRef:o,setSearch:a,hasFilters:d,selectedFiltersLength:p,toggleFilters:v}=e,E=Ka(),Z=(0,m.useCallback)(H=>{e.onSearchChanged(H),a(H)},[e,a]);return d?(0,r.jsxs)(je.Z,{className:E.root,children:[(0,r.jsxs)(je.Z,{className:E.root,children:[(0,r.jsx)(At.Z,{onClick:v,"aria-label":"filter list",children:(0,r.jsx)(Ei.Z,{})}),(0,r.jsxs)(b.Z,{className:E.title,children:["Filters (",p,")"]})]}),(0,r.jsx)(xa,{...e,ref:o,onSearchChanged:Z})]}):(0,r.jsx)(xa,{...e,ref:o,onSearchChanged:Z})}function Sa(e){const{data:o,columns:a,options:d,title:p,subtitle:v,filters:E,initialState:Z,emptyContent:H,onStateChange:N,components:ue,...ie}=e,ye=Ya(),Le=(0,Et.Z)(),Me={...ba,...Z},[Qe,Ot]=(0,m.useState)(Me.filtersOpen),Yt=(0,m.useCallback)(()=>Ot(Un=>!Un),[Ot]),[nn,rn]=(0,m.useState)(0),[Bt,_t]=(0,m.useState)(o),[Jt,Cr]=(0,m.useState)(Me.filters),wr=Ja(a,Le),[jr,Er]=(0,m.useState)(Me.search);(0,m.useEffect)(()=>{if(N){const Un=Qa({search:jr,filtersOpen:Qe,filters:Jt},ba);N(Un)}},[jr,Qe,Jt,N]);const Li={headerStyle:{textTransform:"uppercase"}},Ur=(0,m.useCallback)(Un=>{var vr;return(vr=a.find(to=>to.title===Un))===null||vr===void 0?void 0:vr.field},[a]);(0,m.useEffect)(()=>{if(typeof o=="function")return;if(!Jt){_t(o);return}const Un=Object.values(Jt);if(o&&Un.flat().length){const vr=o.filter(to=>!!Object.entries(Jt).filter(([,no])=>!!no.length).every(([no,un])=>{const Sn=ya(to,Ur(no));return Array.isArray(Sn)&&Array.isArray(un)?Sn.some(yo=>un.includes(yo)):Array.isArray(Sn)?Sn.includes(un):Array.isArray(un)?un.includes(Sn):Sn===un}));_t(vr)}else _t(o);rn(Un.flat().length)},[o,Jt,Ur]);const Pi=(Un,vr)=>{const to=un=>{const Sn=new Set,yo=ro=>{ro!=null&&Sn.add(ro)};return vr&&vr.forEach(ro=>{const Jo=ya(ro,Ur(un));Array.isArray(Jo)?Jo.forEach(yo):yo(Jo)}),Sn},no=un=>({placeholder:"All results",label:un.column,multiple:un.type==="multiple-select",items:[...to(un.column)].sort().map(Sn=>({label:Sn,value:Sn}))});return Un.map(un=>({type:un.type,element:no(un)}))},Qt=!!(E!=null&&E.length),vo=(0,m.useCallback)(Un=>(0,r.jsx)(Xa,{setSearch:Er,hasFilters:Qt,selectedFiltersLength:nn,toggleFilters:Yt,...Un}),[Yt,Qt,nn,Er]),Ts=typeof o!="function"&&o.length===0,Mr=a.length,ki=(0,m.useCallback)(Un=>H&&Ts?(0,r.jsx)("tbody",{children:(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:Mr,children:H})})}):(0,r.jsx)(Es.os,{...Un}),[Ts,H,Mr]);return(0,r.jsxs)(je.Z,{className:ye.root,children:[Qe&&o&&typeof o!="function"&&(E==null?void 0:E.length)&&(0,r.jsx)(Ha,{filters:Pi(E,o),selectedFilters:Jt,onChangeFilters:Cr}),(0,r.jsx)(Es.ZP,{components:{Header:Ga,Toolbar:vo,Body:ki,...ue},options:{...Li,...d},columns:wr,icons:va,title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(b.Z,{variant:"h5",component:"h2",children:p}),v&&(0,r.jsx)(b.Z,{color:"textSecondary",variant:"body1",children:v})]}),data:typeof o=="function"?o:Bt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...ie})]})}Sa.icons=Object.freeze(va);const Xl=e=>{const{children:o,value:a,index:d,...p}=e;return _jsx(Box,{role:"tabpanel",hidden:a!==d,"aria-labelledby":`scrollable-auto-tab-${d}`,...p,children:a===d&&_jsx(Box,{p:3,children:o})})},qa=(0,l.Z)(e=>({root:{color:"#6E6E6E",overflow:"visible",fontSize:e.typography.h5.fontSize,textAlign:"center",borderRadius:"50%",backgroundColor:"#E6E6E6",marginLeft:o=>o.isNext?"auto":"0",marginRight:o=>o.isNext?"0":e.spacing(1.25),"&:hover":{backgroundColor:"#E6E6E6",opacity:"1"}}}),{name:"BackstageTabIcon"}),ql=e=>{const o=qa(e),{ariaLabel:a,onClick:d}=e;return _jsx(IconButton,{onClick:d,className:o.root,size:"small",disableRipple:!0,disableFocusRipple:!0,"aria-label":a,children:e.children})},_a=(e,o)=>o?e?"20px":"0":"40px",el=(0,l.Z)(e=>({root:{textTransform:"none",height:"64px",fontWeight:e.typography.fontWeightBold,fontSize:e.typography.pxToRem(13),color:e.palette.textSubtle,marginLeft:o=>_a(o.isFirstNav,o.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:e.palette.textSubtle}}}),{name:"BackstageTab"}),_l=e=>{const o=el(e),{isFirstNav:a,isFirstIndex:d,...p}=e;return _jsx(Tab,{classes:o,disableRipple:!0,...p})},tl=(0,l.Z)(e=>({indicator:{display:"flex",justifyContent:"center",backgroundColor:e.palette.tabbar.indicator,height:e.spacing(.5)},flexContainer:{alignItems:"center"},root:{"&:last-child":{marginLeft:"auto"}}}),{name:"BackstageTabBar"}),ec=e=>{const o=tl(e);return _jsx(Tabs,{classes:o,...e,TabIndicatorProps:{children:_jsx(Typography,{component:"span"})}})},nl=(0,l.Z)(e=>({root:{flexGrow:1,width:"100%"},styledTabs:{backgroundColor:e.palette.background.paper},appbar:{boxShadow:"none",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(1.25),paddingRight:e.spacing(1.25)}}),{name:"BackstageTabs"});function tc(e){const{tabs:o}=e,a=nl(),[d,p]=useState([0,0]),[v,E]=useState(0),[Z,H]=useState(0),[N,ue]=useState([[]]),ie=useRef(),{width:ye}=useWindowSize(),Le=(nn,rn)=>{p([v,rn])},Me=()=>{E(v-1)},Qe=()=>{E(v+1)},Ot=()=>v+1<N.length;useEffect(()=>{const rn=v===0?1:2,Bt=ie.current.offsetWidth-20-rn*30,_t=d[0]*Z+d[1],Jt=Math.floor(Bt/170);H(Jt),ue(chunkArray(o,Jt)),p([Math.floor(_t/Jt),_t%Jt])},[ye,o]);const Yt=v===d[0]?d[1]:!1;return _jsxs(Box,{className:a.root,children:[_jsx(AppBar,{ref:ie,className:a.appbar,position:"static",children:_jsx(Box,{children:_jsxs(StyledTabs,{value:Yt,onChange:Le,selectionFollowsFocus:!0,children:[v!==0&&_jsx(StyledIcon,{onClick:Me,ariaLabel:"navigate-before",children:_jsx(NavigateBeforeIcon,{})}),N[v].map((nn,rn)=>_jsx(StyledTab,{value:rn,isFirstIndex:rn===0,isFirstNav:v===0,icon:nn.icon||void 0,label:nn.label||void 0},rn)),Ot()&&_jsx(StyledIcon,{isNext:!0,onClick:Qe,ariaLabel:"navigate-next",children:_jsx(NavigateNextIcon,{})})]})})}),Yt!==!1?N[v].map((nn,rn)=>_jsx(TabPanel,{value:rn,index:Yt,children:nn.content},rn)):_jsx(TabPanel,{value:d[1],index:d[1],children:N[d[0]][d[1]].content},"panel_outside_chunked_array")]})}var nc=t(44311);function rl(e,o){const a=e[e.length-1];if(a)return a>=.9?o.palette.status.ok:a>=.5?o.palette.status.warning:o.palette.status.error}function rc(e){const o=useTheme();if(!e.data)return null;var a;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(a=e.color)!==null&&a!==void 0?a:rl(e.data,o)})]})}const ol=e=>(0,l.Z)(o=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:o.spacing(2),textAlign:e.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:o.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),sl=({title:e="Unknown page",className:o})=>(0,r.jsx)(b.Z,{variant:"h4",component:"h2",className:o,"data-testid":"header-title",children:e});function il(e){const{description:o,title:a,titleComponent:d=void 0,children:p,textAlign:v="left"}=e,E=ol({textAlign:v})(),Z=d||(0,r.jsx)(sl,{title:a,className:E.title});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Zo.q,{title:a}),(0,r.jsxs)(je.Z,{className:E.container,children:[(0,r.jsxs)(je.Z,{className:E.leftItemsBox,children:[Z,o&&(0,r.jsx)(b.Z,{className:E.description,variant:"body2",children:o})]}),(0,r.jsx)(je.Z,{className:E.rightItemsBox,children:p})]})]})}var al=t.p+"static/mic-drop.fe3ef4d0..svg";const ll=(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"}),cl=()=>{const e=ll();return(0,r.jsx)("img",{src:al,className:e.micDrop,alt:"Girl dropping mic from her hands"})},dl=(0,l.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:e.typography.h3.fontSize}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function ul(e){const{status:o,statusMessage:a,additionalInfo:d,supportUrl:p}=e,v=dl(),E=(0,ee.s0)(),Z=gs();return(0,r.jsxs)(Ve.Z,{container:!0,spacing:0,className:v.container,children:[(0,r.jsxs)(Ve.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,r.jsxs)(b.Z,{"data-testid":"error",variant:"body1",className:v.subtitle,children:["ERROR ",o,": ",a]}),(0,r.jsx)(b.Z,{variant:"body1",className:v.subtitle,children:d}),(0,r.jsx)(b.Z,{variant:"h2",className:v.title,children:"Looks like someone dropped the mic!"}),(0,r.jsxs)(b.Z,{variant:"h6",children:[(0,r.jsx)(Fe,{to:"#","data-testid":"go-back-link",onClick:()=>E(-1),children:"Go back"}),"... or please"," ",(0,r.jsx)(Fe,{to:p||Z.url,children:"contact support"})," if you think this is a bug."]})]}),(0,r.jsx)(cl,{})]})}var hl=t(16173);const pl=(0,Ln.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(b.Z),Ai=(0,Ln.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(je.Z);function fl(e){const{children:o,...a}=e,[d,p]=m.useState(null),v=m.Children.toArray(o),[E,Z,...H]=v,N=H.length?H.pop():v[v.length-1],ue=v.length>3,ie=Me=>{p(Me.currentTarget)},ye=()=>{p(null)},Le=Boolean(d);return(0,r.jsxs)(m.Fragment,{children:[(0,r.jsxs)(hl.Z,{"aria-label":"breadcrumb",...a,children:[v.length>1&&(0,r.jsx)(Ai,{clone:!0,children:E}),v.length>2&&(0,r.jsx)(Ai,{clone:!0,children:Z}),ue&&(0,r.jsx)(pl,{onClick:ie,children:"..."}),(0,r.jsx)(je.Z,{style:{fontStyle:"italic"},children:N})]}),(0,r.jsx)(Ms.ZP,{open:Le,anchorEl:d,onClose:ye,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,r.jsx)(vt.Z,{children:H.map((Me,Qe)=>(0,r.jsx)(et.Z,{button:!0,children:(0,r.jsx)(Ai,{clone:!0,children:Me})},Qe))})})]})}const gl=(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"}),ml=({type:e,typeLink:o,classes:a,pageTitle:d})=>e?o?(0,r.jsxs)(fl,{className:a.breadcrumb,children:[(0,r.jsx)(Fe,{to:o,children:e}),(0,r.jsx)(b.Z,{children:d})]}):(0,r.jsx)(b.Z,{className:a.type,children:e}):null,vl=({pageTitle:e,classes:o,tooltip:a})=>{const d=(0,r.jsx)(b.Z,{className:o.title,variant:"h1",children:e});return a?(0,r.jsx)(Lt.ZP,{title:a,placement:"top-start",children:d}):d},yl=({classes:e,subtitle:o})=>o?typeof o!="string"?(0,r.jsx)(r.Fragment,{children:o}):(0,r.jsx)(b.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:o}):null;function Ca(e){const{children:o,pageTitleOverride:a,style:d,subtitle:p,title:v,tooltip:E,type:Z,typeLink:H}=e,N=gl(),ie=(0,F.h_)(F.Ds).getOptionalString("app.title")||"Backstage",ye=a||v,Le=v||a,Me=`${ye} | %s | ${ie}`,Qe=`${ye} | ${ie}`;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Zo.q,{titleTemplate:Me,defaultTitle:Qe}),(0,r.jsxs)("header",{style:d,className:N.header,children:[(0,r.jsxs)(je.Z,{className:N.leftItemsBox,children:[(0,r.jsx)(ml,{classes:N,type:Z,typeLink:H,pageTitle:Le}),(0,r.jsx)(vl,{classes:N,pageTitle:Le,tooltip:E}),(0,r.jsx)(yl,{classes:N,subtitle:p})]}),(0,r.jsx)(Ve.Z,{container:!0,className:N.rightItemsBox,spacing:4,children:o})]})]})}const xl=({label:e,secondaryLabel:o,icon:a,disabled:d=!1,onClick:p})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:d,button:!0,onClick:v=>{p&&p(v)},children:[a&&_jsx(ListItemIcon,{children:a}),_jsx(ListItemText,{primary:e,secondary:o})]})});function oc(e){const{palette:{common:{white:o}}}=useTheme(),{actionItems:a}=e,[d,p]=React.useState(!1),v=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>p(!0),"data-testid":"header-action-menu",ref:v,style:{color:o,height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:d,anchorEl:v.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>p(!1),children:_jsx(List,{children:a.map((E,Z)=>_jsx(xl,{...E},`header-action-menu-${Z}`))})})]})}const bl=(0,l.Z)(e=>({root:{textAlign:"left"},label:{color:e.palette.common.white,fontWeight:e.typography.fontWeightBold,letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:"rgba(255, 255, 255, 0.8)",fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),Sl=({value:e,className:o})=>(0,r.jsx)(b.Z,{className:o,children:e});function Cl(e){const{label:o,value:a,url:d}=e,p=bl(),v=(0,r.jsx)(Sl,{className:p.value,value:a||"<Unknown>"});return(0,r.jsx)(Ve.Z,{item:!0,children:(0,r.jsxs)(b.Z,{component:"span",className:p.root,children:[(0,r.jsx)(b.Z,{className:p.label,children:o}),d?(0,r.jsx)(Fe,{to:d,children:v}):v]})})}const wl=e=>(0,Je.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),jl=(0,l.Z)(wl,{name:"BackstageItemCardHeader"});function El(e){const{title:o,subtitle:a,children:d}=e,p=jl(e);return(0,r.jsxs)(je.Z,{className:p.root,children:[a&&(0,r.jsx)(b.Z,{variant:"subtitle2",component:"h3",children:a}),o&&(0,r.jsx)(b.Z,{variant:"h6",component:"h4",children:o}),d]})}function sc(e){const{description:o,tags:a,title:d,type:p,subtitle:v,label:E,onClick:Z,href:H}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:d,subtitle:v||p})}),_jsxs(CardContent,{children:[a!=null&&a.length?_jsx(Box,{children:a.map((N,ue)=>_jsx(Chip,{size:"small",label:N},ue))}):null,o]}),_jsxs(CardActions,{children:[!H&&_jsx(LinkButton,{to:"#",onClick:Z,color:"primary",children:E}),H&&_jsx(LinkButton,{to:H,color:"primary",children:E})]})]})}const Al=e=>(0,Je.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),Tl=(0,l.Z)(Al,{name:"BackstageItemCardGrid"});function Il(e){const{children:o,...a}=e,d=Tl(a);return(0,r.jsx)(je.Z,{className:d.root,...a,children:o})}var Rl=t(41547);const Ll=(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 wa(e){const{themeId:o,children:a}=e,{isMobile:d}=_r(),p=Ll({isMobile:d});return(0,r.jsx)(Rl.Z,{theme:v=>({...v,page:v.getPageTheme({themeId:o})}),children:(0,r.jsx)("main",{className:p.root,children:a})})}function Pl(e){const{themeId:o,children:a,...d}=e;return(0,r.jsxs)(wa,{themeId:o,children:[(0,r.jsx)(Ca,{...d}),a]})}var Qn=t(30195);const ic=Qn.z.object({providerInfo:Qn.z.object({}).catchall(Qn.z.unknown()).optional(),profile:Qn.z.object({email:Qn.z.string().optional(),displayName:Qn.z.string().optional(),picture:Qn.z.string().optional()}),backstageIdentity:Qn.z.object({token:Qn.z.string(),identity:Qn.z.object({type:Qn.z.literal("user"),userEntityRef:Qn.z.string(),ownershipEntityRefs:Qn.z.array(Qn.z.string())})})}),ja={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function kl(e){const o=new Date(Date.now()+ja.defaultTokenExpiryMillis);if(!e)return o;const[a,d,p]=e.split("."),v=JSON.parse(window.atob(d));return typeof v.exp!="number"?o:new Date(v.exp*1e3-ja.tokenExpiryMarginMillis)}class ac{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:o}=this.getSessionSync(),a=o.identity.userEntityRef,d=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(a);if(!d)throw new TypeError(`Invalid user entity reference "${a}"`);return d[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const o=this.state.type==="active"?this.state.session:void 0,a=this.fetchSession().then(d=>(this.state={type:"active",session:d,expiresAt:kl(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:a,previous:o},a}async fetchSession(){const o=await this.options.discoveryApi.getBaseUrl("auth"),a=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,d=new Headers(a);d.set("X-Requested-With","XMLHttpRequest");const p=await fetch(`${o}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:d,credentials:"include"});if(!p.ok)throw await ResponseError.fromResponse(p);return proxiedSessionSchema.parse(await p.json())}constructor(o){this.options=o,this.abortController=new AbortController,this.state={type:"empty"}}}const lc=e=>{const o=useApi(discoveryApiRef),[{status:a,error:d},{execute:p}]=useAsync(async()=>{const v=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:o,headers:e.headers});await v.start(),e.onSignInSuccess(v)});return useMountEffect(p),a==="loading"?_jsx(Progress,{}):d?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},Ol=(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 o=Ol();return(0,r.jsx)(Ve.Z,{component:"li",item:!0,classes:o,children:e})};class Ii{getUserId(){return"guest"}async getIdToken(){}getProfile(){return{email:"guest@example.com",displayName:"Guest"}}async getProfileInfo(){return{email:"guest@example.com",displayName:"Guest"}}async getBackstageIdentity(){const o="user:default/guest";return{type:"user",userEntityRef:o,ownershipEntityRefs:[o]}}async getCredentials(){return{}}async signOut(){}}function Bl(e){const[o,a,d]=e.split(".");return JSON.parse(window.atob(a))}class Ri{getUserId(){return this.result.userId}static fromResult(o){return new Ri(o)}async getIdToken(){var o,a;return(a=(o=this.result).getIdToken)===null||a===void 0?void 0:a.call(o)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const o=await this.getIdToken();if(!o){const p=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:p,ownershipEntityRefs:[p]}}const{sub:a,ent:d}=Bl(o);return{type:"user",userEntityRef:a,ownershipEntityRefs:d!=null?d:[]}}async getCredentials(){var o,a;return{token:await((a=(o=this.result).getIdToken)===null||a===void 0?void 0:a.call(o))}}async signOut(){var o,a;return(a=(o=this.result).signOut)===null||a===void 0?void 0:a.call(o)}constructor(o){this.result=o}}class Yo{static createGuest(){return new Ii}static fromLegacy(o){return Ri.fromResult(o)}static create(o){return new Yo(o.identity,o.authApi,o.profile)}getUserId(){const o=this.identity.userEntityRef,a=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(o);if(!a)throw new TypeError(`Invalid user entity reference "${o}"`);return a[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(o){throw this.profilePromise=void 0,o}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(o,a,d){this.identity=o,this.authApi=a,this.profile=d}}const $l={Component:({config:e,onSignInSuccess:o})=>{const{apiRef:a,title:d,message:p}=e,v=(0,F.h_)(a),E=(0,F.h_)(F.VE),Z=async()=>{try{const H=await v.getBackstageIdentity({instantPopup:!0});if(!H)throw new Error(`The ${d} provider is not configured to support sign-in`);const N=await v.getProfile();o(Yo.create({identity:H.identity,profile:N,authApi:v}))}catch(H){E.post(new jo.SP("Login failed",H))}};return(0,r.jsx)(Ti,{children:(0,r.jsx)(Or,{variant:"fullHeight",title:d,actions:(0,r.jsx)(V.Z,{color:"primary",variant:"outlined",onClick:Z,children:"Sign In"}),children:(0,r.jsx)(b.Z,{variant:"body1",children:p})})})},loader:async(e,o)=>{const a=e.get(o),d=await a.getBackstageIdentity({optional:!0});if(!d)return;const p=await a.getProfile();return Yo.create({identity:d.identity,profile:p,authApi:a})}},Zl={Component:({onSignInSuccess:e})=>(0,r.jsx)(Ti,{children:(0,r.jsx)(Or,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(V.Z,{color:"primary",variant:"outlined",onClick:()=>e(new Ii),children:"Enter"}),children:(0,r.jsxs)(b.Z,{variant:"body1",children:["Enter as a Guest User.",(0,r.jsx)("br",{}),"You will not have a verified identity,",(0,r.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new Ii};var Dl=t(63955),Ea=t(86619),Aa=t(74828),Nl=t(45455),Fl=t.n(Nl);const Ul=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Ml=(0,l.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Ta=e=>{const{ref:o,...a}=e;return{inputRef:o,...a}},zl={Component:({onSignInSuccess:e})=>{const o=Ml(),{register:a,handleSubmit:d,formState:p}=(0,Dl.cI)({mode:"onChange"}),{errors:v}=p,E=({userId:Z,idToken:H})=>{e(Yo.fromLegacy({userId:Z,getIdToken:H!==void 0?async()=>H:void 0,profile:{email:`${Z}@example.com`}}))};return(0,r.jsx)(Ti,{children:(0,r.jsxs)(Or,{title:"Custom User",variant:"fullHeight",children:[(0,r.jsxs)(b.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,r.jsx)("br",{}),"This selection will not be stored."]}),(0,r.jsxs)("form",{className:o.form,onSubmit:d(E),children:[(0,r.jsxs)(Ce.Z,{children:[(0,r.jsx)(Ea.Z,{...Ta(a("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(v.userId)}),v.userId&&(0,r.jsx)(Aa.Z,{error:!0,children:v.userId.message})]}),(0,r.jsxs)(Ce.Z,{children:[(0,r.jsx)(Ea.Z,{...Ta(a("idToken",{required:!1,validate:Z=>!Z||Ul.test(Z)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(v.idToken)}),v.idToken&&(0,r.jsx)(Aa.Z,{error:!0,children:v.idToken.message})]}),(0,r.jsx)(V.Z,{type:"submit",color:"primary",variant:"outlined",className:o.button,disabled:!(p!=null&&p.isDirty)||!Fl()(v),children:"Continue"})]})]})})},loader:async()=>{}},As="@backstage/core:SignInPage:provider",Ia={guest:Zl,custom:zl,common:$l};function Ra(e,o){if(e in o)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function gc(e){return e.reduce((a,d)=>{if(typeof d=="string")return Ra(d,a),a[d]={components:Ia[d],id:d},a;const{id:p}=d;return Ra(p,a),a[p]={components:Ia.common,id:p,config:d},a},{})}const mc=(e,o)=>{const a=useApi(errorApiRef),d=useApiHolder(),[p,v]=useState(!0),E=useCallback(H=>{o(IdentityApiSignOutProxy.from({identityApi:H,signOut:async()=>{var N;localStorage.removeItem(As),await((N=H.signOut)===null||N===void 0?void 0:N.call(H))}}))},[o]);useLayoutEffect(()=>{var H;if(!p)return;const N=localStorage.getItem(As);if(N===null){v(!1);return}const ue=e[N];if(!ue){v(!1);return}let ie=!1;return ue.components.loader(d,(H=ue.config)===null||H===void 0?void 0:H.apiRef).then(ye=>{ie||(ye?E(ye):v(!1))}).catch(ye=>{ie||(localStorage.removeItem(As),a.post(ye),v(!1))}),()=>{ie=!0}},[p,a,o,d,e,E]);const Z=useMemo(()=>Object.keys(e).map(H=>{const N=e[H],{Component:ue}=N.components,ie=ye=>{localStorage.setItem(As,N.id),E(ye)};return _jsx(ue,{config:N.config,onSignInSuccess:ie},N.id)}),[e,E]);return[p,Z]},Wl=({onSignInSuccess:e,providers:o=[],title:a,align:d="left"})=>{const p=useApi(configApiRef),v=useStyles(),E=getSignInProviders(o),[Z,H]=useSignInProviders(E,e);return Z?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:p.getString("app.title")}),_jsxs(Content,{children:[a&&_jsx(ContentHeader,{title:a,textAlign:d}),_jsx(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:v,children:H})]})]})},Vl=({provider:e,auto:o,onSignInSuccess:a})=>{const d=useStyles(),p=useApi(e.apiRef),v=useApi(configApiRef),[E,Z]=useState(),[H,N]=useState(!1),ue=async({checkExisting:ie,showPopup:ye})=>{try{let Le;if(ie&&(Le=await p.getBackstageIdentity({optional:!0})),!Le&&(ye||o)&&(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 Me=await p.getProfile();a(UserIdentity.create({identity:Le.identity,authApi:p,profile:Me}))}catch(Le){Z(Le),N(!0)}};return useMountEffect(()=>ue({checkExisting:!0})),H?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:v.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:d,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{ue({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),E&&E.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:E.message})]})})})})]}):_jsx(Progress,{})};function vc(e){return"provider"in e?_jsx(Vl,{...e}):_jsx(Wl,{...e})}const Hl=(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"}),Gl=(0,Ln.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(Ro.Z);function yc(e){const{slackChannel:o,errorBoundaryProps:a,children:d,title:p,deepLink:v,value:E,onChange:Z}=e,H=Hl(),[N,ue]=useState(0),ie=Z||((Me,Qe)=>ue(Qe));let ye;E?React.Children.map(d,Me=>{if(React.isValidElement(Me)&&(Me==null?void 0:Me.props.value)===E){var Qe;ye=Me==null||(Qe=Me.props)===null||Qe===void 0?void 0:Qe.children}}):React.Children.map(d,(Me,Qe)=>{React.isValidElement(Me)&&Qe===N&&(ye=Me==null?void 0:Me.props.children)});const Le=a||(o?{slackChannel:o}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Le,children:[p&&_jsx(Gl,{title:p}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:H,value:E||N,onChange:ie,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:ye}),v&&_jsx(BottomLink,{...v})]})})}const Kl=(0,l.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:e.typography.fontWeightBold}}),{name:"BackstageCardTab"});function xc(e){const{children:o,...a}=e,d=Kl();return _jsx(Tab,{disableRipple:!0,classes:d,...a})}},60871:function(bt,Be,t){"use strict";t.d(Be,{fC:function(){return y},CL:function(){return st},sM:function(){return Y},$v:function(){return Xe},v_:function(){return _e},hg:function(){return it},uB:function(){return Re},R5:function(){return Ze},bq:function(){return T},Km:function(){return re},Ds:function(){return Fe},ni:function(){return B},T0:function(){return b},CO:function(){return Bn},x8:function(){return Cn},rx:function(){return Gn},YO:function(){return wn},P4:function(){return ct},NT:function(){return mt},NW:function(){return jt},VE:function(){return He},W0:function(){return je},gP:function(){return Et},IY:function(){return rt},F4:function(){return ee},ux:function(){return j},Kp:function(){return le},$4:function(){return St},p_:function(){return P},ZM:function(){return gt},D:function(){return X},gW:function(){return $},E6:function(){return yt},z$:function(){return ze},h_:function(){return be},I_:function(){return M},qD:function(){return xe},vJ:function(){return zn},tg:function(){return an},Oi:function(){return Xn}});var h=t(52322),r=t(51837),F=t(2784);const L=(0,r.CT)("analytics-context"),m=()=>{const ve=(0,F.useContext)(L);if(ve===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const oe=ve.atVersion(1);if(oe===void 0)throw new Error("No context found for version 1.");return oe},y=ve=>{const{attributes:oe,children:Oe}=ve,Ge={...m(),...oe},ft=(0,r.EI)({1:Ge});return(0,h.jsx)(L.Provider,{value:ft,children:Oe})};function l(ve,oe){const Oe=Pe=>_jsx(y,{attributes:oe,children:_jsx(ve,{...Pe})});return Oe.displayName=`WithAnalyticsContext(${ve.displayName||ve.name||"Component"})`,Oe}function M(){const ve=(0,r.Vt)("api-context");if(!ve)throw new Error("API context is not available");const oe=ve.atVersion(1);if(!oe)throw new Error("ApiContext v1 not available");return oe}function be(ve){const Oe=M().get(ve);if(!Oe)throw new Error(`No implementation available for ${ve}`);return Oe}function V(ve){return function(Oe){const Pe=ft=>{const Ht=M(),Rt={};for(const ce in ve)if(ve.hasOwnProperty(ce)){const U=ve[ce],he=Ht.get(U);if(!he)throw new Error(`No implementation available for ${U}`);Rt[ce]=he}return _jsx(Oe,{...ft,...Rt})},Ge=Oe.displayName||Oe.name||"Component";return Pe.displayName=`withApis(${Ge})`,Pe}}class G{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(oe){if(this.config=oe,!oe.id.split(".").flatMap(Pe=>Pe.split("-")).every(Pe=>Pe.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${oe.id}'`)}}function b(ve){return new G(ve)}function B(ve,oe){return"id"in ve?{api:ve,deps:{},factory:()=>oe}:ve}var Y;(function(ve){ve.SignedIn="SignedIn",ve.SignedOut="SignedOut"})(Y||(Y={}));const le=b({id:"core.auth.google"}),ee=b({id:"core.auth.github"}),X=b({id:"core.auth.okta"}),j=b({id:"core.auth.gitlab"}),P=b({id:"core.auth.microsoft"}),$=b({id:"core.auth.onelogin"}),T=b({id:"core.auth.bitbucket"}),re=b({id:"core.auth.bitbucket-server"}),Re=b({id:"core.auth.atlassian"}),Xe=b({id:"core.alert"}),_e=b({id:"core.analytics"}),it=b({id:"core.apptheme"}),Fe=b({id:"core.config"}),jt=b({id:"core.discovery"}),He=b({id:"core.error"});var st;(function(ve){ve[ve.None=0]="None",ve[ve.Active=1]="Active"})(st||(st={}));const je=b({id:"core.featureflags"}),Et=b({id:"core.fetch"}),St=b({id:"core.identity"}),gt=b({id:"core.oauthrequest"}),yt=b({id:"core.storage"});class At{setContext(oe){this.context=oe}captureEvent(oe,Oe,{value:Pe,attributes:Ge}={}){try{this.analyticsApi.captureEvent({action:oe,subject:Oe,value:Pe,attributes:Ge,context:this.context})}catch(ft){console.warn("Error during analytics event capture. %o",ft)}}constructor(oe,Oe={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=oe,this.context=Oe}}function Lt(){try{return be(_e)}catch{return{captureEvent:()=>{}}}}function ze(){const ve=(0,F.useRef)(null),oe=m(),Oe=Lt();function Pe(){return ve.current===null&&(ve.current=new At(Oe)),ve.current}const Ge=Pe();return Ge.setContext(oe),Ge}const xe=()=>{const ve=(0,r.Vt)("app-context");if(!ve)throw new Error("App context is not available");const oe=ve.atVersion(1);if(!oe)throw new Error("AppContext v1 not available");return oe},Te=(0,r.uW)("component-data-store",()=>new WeakMap),Ae="__backstage_data";function Ze(ve,oe,Oe){const Pe=ve;var Ge;let ft=(Ge=Pe[Ae])!==null&&Ge!==void 0?Ge:Te.get(ve);if(ft||(ft={map:new Map},Object.defineProperty(Pe,Ae,{enumerable:!1,configurable:!0,writable:!1,value:ft}),Te.set(ve,ft)),ft.map.has(oe)){const Ht=ve.displayName||ve.name;throw new Error(`Attempted to attach duplicate data "${oe}" to component "${Ht}"`)}ft.map.set(oe,Oe)}function rt(ve,oe){if(!ve)return;const Oe=ve.type;if(!Oe)return;var Pe;const Ge=(Pe=Oe[Ae])!==null&&Pe!==void 0?Pe:Te.get(Oe);if(Ge)return Ge.map.get(oe)}const zt=(0,r.uW)("route-ref-type",()=>Symbol("route-ref-type"));let pt=zt;class Pt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(oe,Oe){this.id=oe,this.params=Oe,this[pt]="absolute"}}function mt(ve){var oe;return new Pt(ve.id,(oe=ve.params)!==null&&oe!==void 0?oe:[])}const It=/^\w+$/;let en=null;class on{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(oe,Oe,Pe,Ge){this.id=oe,this.path=Oe,this.parent=Pe,this.params=Ge,this[en]="sub"}}function vn(ve){const{id:oe,path:Oe,parent:Pe}=ve,Ge=Oe.split("/").filter(Rt=>Rt.startsWith(":")).map(Rt=>Rt.substring(1)),ft=[...Pe.params,...Ge];if(Pe.params.some(Rt=>Ge.includes(Rt)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Oe.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Oe}'`);if(Oe.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Oe}'`);for(const Rt of Ge)if(!It.test(Rt))throw new Error(`SubRouteRef path has invalid param, got '${Rt}'`);return new on(oe,Oe,Pe,ft)}let $t=zt;class pn{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(oe,Oe,Pe){this.id=oe,this.params=Oe,this.optional=Pe,this[$t]="external"}}function Cn(ve){var oe;return new pn(ve.id,(oe=ve.params)!==null&&oe!==void 0?oe:[],Boolean(ve.optional))}var Tn=t(79635);function an(ve){const{pathname:oe}=(0,Tn.TH)(),Oe=(0,r.Vt)("routing-context");if(!Oe)throw new Error("Routing context is not available");const Pe=Oe.atVersion(1),Ge=(0,F.useMemo)(()=>Pe&&Pe.resolve(ve,{pathname:oe}),[Pe,ve,oe]);if(!Oe)throw new Error("useRouteRef used outside of routing context");if(!Pe)throw new Error("RoutingContext v1 not available");const ft="optional"in ve&&ve.optional;if(!Ge&&!ft)throw new Error(`No path for ${ve}`);return Ge}function Xn(ve){return(0,Tn.UO)()}class On extends F.Component{static getDerivedStateFromError(oe){return{error:oe}}render(){const{error:oe}=this.state,{app:Oe,plugin:Pe}=this.props,{ErrorBoundaryFallback:Ge}=Oe.getComponents();return oe?(0,h.jsx)(Ge,{error:oe,resetError:this.handleErrorReset,plugin:Pe}):this.props.children}constructor(...oe){super(...oe),this.state={error:void 0},this.handleErrorReset=()=>{this.setState({error:void 0})}}}var qn=t(64355);function ct(ve){const{component:oe,mountPoint:Oe,name:Pe}=ve;return wn({component:{lazy:()=>oe().then(Ge=>{const ft=Rt=>{try{an(Oe)}catch(ce){if(typeof ce=="object"&&ce!==null){const{message:U}=ce;if(typeof U=="string"&&U.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Oe} was not discovered in the app element tree. Routable extension components may not be rendered by other components and must be directly available as an element within the App provider component.`)}throw ce}return(0,h.jsx)(Ge,{...Rt})},Ht=Pe||Ge.displayName||Ge.name||"LazyComponent";return ft.displayName=`RoutableExtension(${Ht})`,ft},Ge=>Ht=>{const Rt=xe(),{BootErrorPage:ce}=Rt.getComponents();return(0,h.jsx)(ce,{step:"load-chunk",error:Ge})})},data:{"core.mountPoint":Oe},name:Pe})}function Bn(ve){const{component:oe,name:Oe}=ve;return wn({component:oe,name:Oe})}function wn(ve){const{data:oe={},name:Oe}=ve;Oe||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Pe;if("lazy"in ve.component){const ft=ve.component.lazy;Pe=(0,F.lazy)(()=>ft().then(Ht=>({default:Ht})))}else Pe=ve.component.sync;const Ge=Oe||Pe.displayName||Pe.name||"Component";return{expose(ft){const Ht=Rt=>{const ce=xe(),{Progress:U}=ce.getComponents(),he=oe==null?void 0:oe["core.mountPoint"];return(0,h.jsx)(F.Suspense,{fallback:(0,h.jsx)(U,{}),children:(0,h.jsx)(On,{app:ce,plugin:ft,children:(0,h.jsx)(y,{attributes:{pluginId:ft.getId(),...Oe&&{extension:Oe},...he&&{routeRef:he.id}},children:(0,h.jsx)(qn.o,{plugin:ft,children:(0,h.jsx)(Pe,{...Rt})})})})})};Ze(Ht,"core.plugin",ft);for(const[Rt,ce]of Object.entries(oe))Ze(Ht,Rt,ce);return Ht.displayName=`Extension(${Ge})`,Ht}}}function ln(ve,oe,Oe,Pe){return F.Children.toArray(ve).flatMap(Ge=>{if(!(0,F.isValidElement)(Ge))return[];if(Ge.type===F.Fragment)return ln(Ge.props.children,oe,Oe,Pe);if(rt(Ge,"core.featureFlagged")){const ft=Ge.props;return("with"in ft?oe.isActive(ft.with):!oe.isActive(ft.without))?ln(Ge.props.children,oe,Oe,Pe):[]}if(Oe===void 0||Oe(Ge))return[Ge];if(Pe)throw new Error(Pe);return ln(Ge.props.children,oe,Oe,Pe)})}class $n{selectByComponentData(oe){const Oe=ln(this.node,this.featureFlagsApi,Pe=>rt(Pe,oe.key)!==void 0,oe.withStrictError);return new $n(Oe,this.featureFlagsApi)}findComponentData(oe){return ln(this.node,this.featureFlagsApi,Pe=>rt(Pe,oe.key)!==void 0).map(Pe=>rt(Pe,oe.key)).filter(Pe=>Pe!==void 0)}getElements(){return ln(this.node,this.featureFlagsApi)}constructor(oe,Oe){this.node=oe,this.featureFlagsApi=Oe}}function zn(ve,oe,Oe=[]){const Pe=be(je),Ge=new $n(ve,Pe);return(0,F.useMemo)(()=>oe(Ge),[ve,...Oe])}class jn{getId(){return this.config.id}getApis(){var oe;return(oe=this.config.apis)!==null&&oe!==void 0?oe:[]}getFeatureFlags(){var oe,Oe;return(Oe=(oe=this.config.featureFlags)===null||oe===void 0?void 0:oe.slice())!==null&&Oe!==void 0?Oe:[]}get routes(){var oe;return(oe=this.config.routes)!==null&&oe!==void 0?oe:{}}get externalRoutes(){var oe;return(oe=this.config.externalRoutes)!==null&&oe!==void 0?oe:{}}provide(oe){return oe.expose(this)}__experimentalReconfigure(oe){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(oe))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var oe;return(oe=this.options)!==null&&oe!==void 0?oe:{}}toString(){return`plugin{${this.config.id}}`}constructor(oe){this.config=oe,this.options=void 0}}function Gn(ve){return new jn(ve)}},64355:function(bt,Be,t){"use strict";t.d(Be,{o:function(){return m},y:function(){return y}});var h=t(52322),r=t(51837),F=t(2784);const L="plugin-context",m=l=>{const{children:M,plugin:be}=l,{Provider:V}=(0,r.CT)(L);return(0,h.jsx)(V,{value:(0,r.EI)({1:{plugin:be}}),children:M})};function y(){const l=(0,r.Vt)(L);if(!l)throw new Error("Plugin Options context is not available");const M=l.atVersion(1);if(!M)throw new Error("Plugin Options v1 is not available");return M.plugin.getPluginOptions()}},23054:function(bt,Be,t){"use strict";t.d(Be,{SP:function(){return le},dR:function(){return G},VL:function(){return X},BD:function(){return r}});function h(j){if(typeof j!="object"||j===null||Array.isArray(j))return!1;const P=j;return!(typeof P.name!="string"||P.name===""||typeof P.message!="string")}function r(j){if(typeof j!="object"||j===null||Array.isArray(j))throw new Error(`Encountered invalid error, not an object, got '${j}'`);const P=j;if(typeof P.name!="string"||P.name==="")throw new Error(`Encountered error object without a name, got '${j}'`);if(typeof P.message!="string")throw new Error(`Encountered error object without a message, got '${j}'`)}var F=t(24852);function L(j,P){const T={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(j)};return P!=null&&P.includeStack||delete T.stack,T}function m(j){const P=(0,F.deserializeError)(j);return j.stack||(P.stack=void 0),P}function y(j){if(h(j)){const P=String(j);return P!=="[object Object]"?P:`${j.name}: ${j.message}`}return`unknown error '${j}'`}class l extends Error{constructor(P,$){var T;let re=P;if($!==void 0){const Re=y($);re?re+=`; caused by ${Re}`:re=`caused by ${Re}`}super(re),(T=Error.captureStackTrace)===null||T===void 0||T.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=h($)?$:void 0}}class M extends null{}class be extends null{}class V extends null{}class G extends l{}class b extends null{}class B extends null{}class Y extends null{}class le extends l{constructor(P,$){super(P,$),this.name=h($)?$.name:"Error"}}async function ee(j){try{const $=await j.text();if($){var P;if(!((P=j.headers.get("content-type"))===null||P===void 0)&&P.startsWith("application/json"))try{const T=JSON.parse($);if(T.error&&T.response)return T}catch{}return{error:{name:"Error",message:`Request failed with status ${j.status} ${j.statusText}, ${$}`},response:{statusCode:j.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${j.status} ${j.statusText}`},response:{statusCode:j.status}}}class X extends Error{static async fromResponse(P){const $=await ee(P),T=$.response.statusCode||P.status,re=$.error.name||P.statusText,Re=`Request failed with ${T} ${re}`,Xe=m($.error);return new X({message:Re,response:P,data:$,cause:Xe})}constructor(P){super(P.message),this.name="ResponseError",this.response=P.response,this.body=P.data,this.cause=P.cause}}},32838:function(bt,Be,t){"use strict";t.d(Be,{nW:function(){return ee},ae:function(){return G},q3:function(){return b}});var h=t(60871);const r=(0,h.T0)({id:"core.scmauth"});var F=new WeakMap;class L{async getCredentials(j){const P=new URL(j.url),$=_class_private_field_get(this,F).find(T=>T.isUrlSupported(P));if(!$)throw new Error(`No auth provider available for '${j.url}', see https://backstage.io/link?scm-auth`);return $.getCredentials(j)}constructor(j){_class_private_field_init(this,F,{writable:!0,value:void 0}),_class_private_field_set(this,F,j)}}var m=new WeakMap,y=new WeakMap,l=new WeakMap,M=new WeakMap;class be{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:j,gitlab:P,azure:$,bitbucket:T})=>be.merge(be.forGithub(j),be.forGitlab(P),be.forAzure($),be.forBitbucket(T))})}static forAuthApi(j,P){return new be("generic",j,P.host,P.scopeMapping)}static forGithub(j,P){var $;const T=($=P==null?void 0:P.host)!==null&&$!==void 0?$:"github.com";return new be("github",j,T,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(j,P){var $;const T=($=P==null?void 0:P.host)!==null&&$!==void 0?$:"gitlab.com";return new be("gitlab",j,T,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(j,P){var $;const T=($=P==null?void 0:P.host)!==null&&$!==void 0?$:"dev.azure.com";return new be("azure",j,T,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(j,P){var $;const T=($=P==null?void 0:P.host)!==null&&$!==void 0?$:"bitbucket.org";return new be("bitbucket",j,T,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...j){return new L(j)}isUrlSupported(j){return j.host===_class_private_field_get(this,y)}getAdditionalScopesForProvider(j){var P;if(!(j!=null&&j.customScopes)||_class_private_field_get(this,M)==="generic")return[];var $;return($=(P=j.customScopes)===null||P===void 0?void 0:P[_class_private_field_get(this,M)])!==null&&$!==void 0?$:[]}async getCredentials(j){const{url:P,additionalScope:$,...T}=j,re=_class_private_field_get(this,l).default.slice();$!=null&&$.repoWrite&&re.push(..._class_private_field_get(this,l).repoWrite);const Re=this.getAdditionalScopesForProvider($);Re.length&&re.push(...Re);const Xe=[...new Set(re)],_e=await _class_private_field_get(this,m).getAccessToken(Xe,T);return{token:_e,headers:{Authorization:`Bearer ${_e}`}}}constructor(j,P,$,T){_class_private_field_init(this,m,{writable:!0,value:void 0}),_class_private_field_init(this,y,{writable:!0,value:void 0}),_class_private_field_init(this,l,{writable:!0,value:void 0}),_class_private_field_init(this,M,{writable:!0,value:void 0}),_class_private_field_set(this,m,P),_class_private_field_set(this,y,$),_class_private_field_set(this,l,T),_class_private_field_set(this,M,j)}}var V=t(79158);class G{static fromConfig(j){return V.Lx.fromConfig(j)}}const b=(0,h.T0)({id:"integration.scmintegrations"});var B=t(52322),Y=t(73250),le=t(2784);const ee=X=>{const{type:j}=X,P=(0,h.qD)(),$=Y.Z;var T;const re=j&&(T=P.getSystemIcon(j))!==null&&T!==void 0?T:$;return(0,B.jsx)(re,{})}},79158:function(bt,Be,t){"use strict";t.d(Be,{Lx:function(){return bn},BT:function(){return qe}});var h=t(82717),r=t.n(h),F=t(76635);function L(w){const u=new URL("http://example.com");return u.host=w,u.host===w}function m(w){try{return new URL(w),!0}catch{return!1}}function y(w,u){return{list(){return w},byUrl(x){try{const A=typeof x=="string"?new URL(x):x;return w.find(Q=>u(Q)===A.host)}catch{return}},byHost(x){return w.find(A=>u(A)===x)}}}function l(w){const{url:u,base:x,lineNumber:A}=w;try{return new URL(u),u}catch{}let Q;if(u.startsWith("/")){const{filepath:pe}=r()(x);Q=new URL(x);const we=(0,F.trimEnd)(Q.pathname.substring(0,Q.pathname.length-pe.length),"/");Q.pathname=`${we}${u}`}else Q=new URL(u,x);return Q.search=new URL(x).search,A&&(Q.hash=`L${A}`),Q.toString()}const M="amazonaws.com";function be(w){const u=w.getOptionalString("endpoint");var x;const A=(x=w.getOptionalBoolean("s3ForcePathStyle"))!==null&&x!==void 0?x:!1;let Q,pe;if(u){try{const dn=new URL(u);Q=dn.host,pe=dn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${u}' is not a valid URL`)}if(pe!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${u}'`)}else Q=M;const we=w.getOptionalString("accessKeyId"),Se=w.getOptionalString("secretAccessKey"),dt=w.getOptionalString("roleArn"),Vt=w.getOptionalString("externalId");return{host:Q,endpoint:u,s3ForcePathStyle:A,accessKeyId:we,secretAccessKey:Se,roleArn:dt,externalId:Vt}}function V(w){const u=w.map(be);return u.some(x=>x.host===M)||u.push({host:M}),u}class G{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}}G.factory=({config:w})=>{var u;const x=V((u=w.getOptionalConfigArray("integrations.awsS3"))!==null&&u!==void 0?u:[]);return y(x.map(A=>new G(A)),A=>A.config.host)};var b=t(90383),B=t(22504),Y=t(69866);const le="GB";var ee=new WeakMap,X=new WeakMap,j=new WeakMap,P=new WeakMap,$=new WeakMap,T=new WeakMap,re=new WeakMap;class Re{static fromRepoUrl(u){const x=new URL(u);let A,Q,pe;const we=x.pathname.split("/").map(Yn=>decodeURIComponent(Yn));if(we[2]==="_git"?(A=we[1],Q=pe=we[3]):we[3]==="_git"?(A=we[1],Q=we[2],pe=we[4]):we[4]==="_git"&&(A=`${we[1]}/${we[2]}`,Q=we[3],pe=we[5]),!A||!Q||!pe)throw new Error("Azure URL must point to a git repository");var Se;const dt=(Se=x.searchParams.get("path"))!==null&&Se!==void 0?Se:void 0;let Vt;const dn=x.searchParams.get("version");if(dn){if(dn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Vt=dn.slice(2)}return new Re(x.origin,A,Q,pe,dt,Vt)}toRepoUrl(){let u;return(0,b.Z)(this,j)===(0,b.Z)(this,P)?u=(0,b.Z)(this,re).call(this,(0,b.Z)(this,X),"_git",(0,b.Z)(this,P)):u=(0,b.Z)(this,re).call(this,(0,b.Z)(this,X),(0,b.Z)(this,j),"_git",(0,b.Z)(this,P)),(0,b.Z)(this,$)&&u.searchParams.set("path",(0,b.Z)(this,$)),(0,b.Z)(this,T)&&u.searchParams.set("version",le+(0,b.Z)(this,T)),u.toString()}toFileUrl(){if(!(0,b.Z)(this,$))throw new Error("Azure URL must point to a specific path to be able to download a file");const u=(0,b.Z)(this,re).call(this,(0,b.Z)(this,X),(0,b.Z)(this,j),"_apis","git","repositories",(0,b.Z)(this,P),"items");return u.searchParams.set("api-version","6.0"),u.searchParams.set("path",(0,b.Z)(this,$)),(0,b.Z)(this,T)&&u.searchParams.set("version",(0,b.Z)(this,T)),u.toString()}toArchiveUrl(){const u=(0,b.Z)(this,re).call(this,(0,b.Z)(this,X),(0,b.Z)(this,j),"_apis","git","repositories",(0,b.Z)(this,P),"items");return u.searchParams.set("recursionLevel","full"),u.searchParams.set("download","true"),u.searchParams.set("api-version","6.0"),(0,b.Z)(this,$)&&u.searchParams.set("scopePath",(0,b.Z)(this,$)),(0,b.Z)(this,T)&&u.searchParams.set("version",(0,b.Z)(this,T)),u.toString()}toCommitsUrl(){const u=(0,b.Z)(this,re).call(this,(0,b.Z)(this,X),(0,b.Z)(this,j),"_apis","git","repositories",(0,b.Z)(this,P),"commits");return u.searchParams.set("api-version","6.0"),(0,b.Z)(this,T)&&u.searchParams.set("searchCriteria.itemVersion.version",(0,b.Z)(this,T)),u.toString()}getOwner(){return(0,b.Z)(this,X)}getProject(){return(0,b.Z)(this,j)}getRepo(){return(0,b.Z)(this,P)}getPath(){return(0,b.Z)(this,$)}getRef(){return(0,b.Z)(this,T)}constructor(u,x,A,Q,pe,we){(0,B.Z)(this,ee,{writable:!0,value:void 0}),(0,B.Z)(this,X,{writable:!0,value:void 0}),(0,B.Z)(this,j,{writable:!0,value:void 0}),(0,B.Z)(this,P,{writable:!0,value:void 0}),(0,B.Z)(this,$,{writable:!0,value:void 0}),(0,B.Z)(this,T,{writable:!0,value:void 0}),(0,B.Z)(this,re,{writable:!0,value:(...Se)=>{const dt=new URL((0,b.Z)(this,ee));return dt.pathname=Se.map(Vt=>encodeURIComponent(Vt)).join("/"),dt}}),(0,Y.Z)(this,ee,u),(0,Y.Z)(this,X,x),(0,Y.Z)(this,j,A),(0,Y.Z)(this,P,Q),(0,Y.Z)(this,$,pe),(0,Y.Z)(this,T,we)}}const Xe="dev.azure.com";function _e(w){var u;const x=(u=w.getOptionalString("host"))!==null&&u!==void 0?u:Xe,A=w.getOptionalString("token");if(!L(x))throw new Error(`Invalid Azure integration config, '${x}' is not a valid host`);return{host:x,token:A}}function it(w){const u=w.map(_e);return u.some(x=>x.host===Xe)||u.push({host:Xe}),u}class Fe{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:x,base:A}=u;if(m(x))return x;try{const pe=Re.fromRepoUrl(A),we=new URL(A);var Q;const Se=new URL(`https://a.com${(Q=pe.getPath())!==null&&Q!==void 0?Q:""}`),dt=new URL(x,Se).pathname;return we.searchParams.set("path",dt),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,A).toString()}}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}Fe.factory=({config:w})=>{var u;const x=it((u=w.getOptionalConfigArray("integrations.azure"))!==null&&u!==void 0?u:[]);return y(x.map(A=>new Fe(A)),A=>A.config.host)};var jt=t(48834).lW;function He(w){return AzureUrl.fromRepoUrl(w).toFileUrl()}function st(w){return AzureUrl.fromRepoUrl(w).toArchiveUrl()}function je(w){return AzureUrl.fromRepoUrl(w).toCommitsUrl()}function Et(w,u){const x=u?{...u}:{};if(w.token){const A=jt.from(`:${w.token}`,"utf8");x.Authorization=`Basic ${A.toString("base64")}`}return{headers:x}}const St="bitbucket.org",gt="https://api.bitbucket.org/2.0";function yt(w){var u;const x=(u=w.getOptionalString("host"))!==null&&u!==void 0?u:St;let A=w.getOptionalString("apiBaseUrl");const Q=w.getOptionalString("token"),pe=w.getOptionalString("username"),we=w.getOptionalString("appPassword");if(!L(x))throw new Error(`Invalid Bitbucket integration config, '${x}' is not a valid host`);return A?A=(0,F.trimEnd)(A,"/"):x===St?A=gt:A=`https://${x}/rest/api/1.0`,{host:x,apiBaseUrl:A,token:Q,username:pe,appPassword:we}}function At(w){const u=w.map(yt);return u.some(x=>x.host===St)||u.push({host:St,apiBaseUrl:gt}),u}class Lt{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 A=new URL(x);return this.integrationConfig.host==="bitbucket.org"?A.hash=`lines-${u.lineNumber}`:A.hash=`${u.lineNumber}`,A.toString()}resolveEditUrl(u){const x=r()(u),A=new URL(u);return A.searchParams.set("mode","edit"),A.searchParams.set("spa","0"),A.searchParams.set("at",x.ref),A.toString()}constructor(u){this.integrationConfig=u}}Lt.factory=({config:w})=>{var u,x,A;const Q=At((A=w.getOptionalConfigArray("integrations.bitbucket"))!==null&&A!==void 0?A:[...(u=w.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[],...(x=w.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&x!==void 0?x:[]]);return y(Q.map(pe=>new Lt(pe)),pe=>pe.config.host)};var ze=t(96279),xe=t(48834).lW;async function Te(w,u){const{name:x,owner:A,resource:Q}=parseGitUrl(w),pe=Q==="bitbucket.org";let we=pe?`${u.apiBaseUrl}/repositories/${A}/${x}`:`${u.apiBaseUrl}/projects/${A}/repos/${x}/default-branch`,Se=await fetch(we,rt(u));if(Se.status===404&&!pe&&(we=`${u.apiBaseUrl}/projects/${A}/repos/${x}/branches/default`,Se=await fetch(we,rt(u))),!Se.ok){const Vt=`Failed to retrieve default branch from ${we}, ${Se.status} ${Se.statusText}`;throw new Error(Vt)}let dt;if(pe)dt=(await Se.json()).mainbranch.name;else{const{displayId:Vt}=await Se.json();dt=Vt}if(!dt)throw new Error(`Failed to read default branch from ${we}. Response ${Se.status} ${Se.json()}`);return dt}async function Ae(w,u){const{name:x,owner:A,ref:Q,protocol:pe,resource:we,filepath:Se}=parseGitUrl(w),dt=we==="bitbucket.org";let Vt=Q;Vt||(Vt=await Te(w,u));const dn=Se?`&path=${encodeURIComponent(decodeURIComponent(Se))}`:"";return dt?`${pe}://${we}/${A}/${x}/get/${Vt}.tar.gz`:`${u.apiBaseUrl}/projects/${A}/repos/${x}/archive?format=tgz&at=${Vt}&prefix=${A}-${x}${dn}`}function Ze(w,u){try{const{owner:x,name:A,ref:Q,filepathtype:pe,filepath:we}=parseGitUrl(w);if(!x||!A||pe!=="browse"&&pe!=="raw"&&pe!=="src")throw new Error("Invalid Bitbucket URL or file path");const Se=we.replace(/^\//,"");if(u.host==="bitbucket.org"){if(!Q)throw new Error("Invalid Bitbucket URL or file path");return`${u.apiBaseUrl}/repositories/${x}/${A}/src/${Q}/${Se}`}return`${u.apiBaseUrl}/projects/${x}/repos/${A}/raw/${Se}?at=${Q}`}catch(x){throw new Error(`Incorrect URL: ${w}, ${x}`)}}function rt(w){const u={};if(w.token)u.Authorization=`Bearer ${w.token}`;else if(w.username&&w.appPassword){const x=xe.from(`${w.username}:${w.appPassword}`,"utf8");u.Authorization=`Basic ${x.toString("base64")}`}return{headers:u}}const zt="bitbucket.org",pt="https://api.bitbucket.org/2.0";function Pt(w){const u=zt,x=pt,A=w.getString("username"),Q=w.getString("appPassword");return{host:u,apiBaseUrl:x,username:A,appPassword:Q}}function mt(w){const u=w.map(Pt);return u.length===0&&u.push({host:zt,apiBaseUrl:pt}),u}class It{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 A=new URL(x);return A.hash=`lines-${u.lineNumber}`,A.toString()}return x}resolveEditUrl(u){const x=r()(u),A=new URL(u);return A.searchParams.set("mode","edit"),A.searchParams.set("at",x.ref),A.toString()}constructor(u){this.integrationConfig=u}}It.factory=({config:w})=>{var u;const x=mt((u=w.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[]);return y(x.map(A=>new It(A)),A=>A.config.host)};var en=t(48834).lW;async function on(w,u){const{name:x,owner:A}=parseGitUrl(w),Q=`${u.apiBaseUrl}/repositories/${A}/${x}`,pe=await fetch(Q,pn(u));if(!pe.ok){const dt=`Failed to retrieve default branch from ${Q}, ${pe.status} ${pe.statusText}`;throw new Error(dt)}const Se=(await pe.json()).mainbranch.name;if(!Se)throw new Error(`Failed to read default branch from ${Q}. Response ${pe.status} ${pe.json()}`);return Se}async function vn(w,u){const{name:x,owner:A,ref:Q,protocol:pe,resource:we}=parseGitUrl(w);let Se=Q;return Se||(Se=await on(w,u)),`${pe}://${we}/${A}/${x}/get/${Se}.tar.gz`}function $t(w,u){try{const{owner:x,name:A,ref:Q,filepathtype:pe,filepath:we}=parseGitUrl(w);if(!x||!A||pe!=="src"&&pe!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Se=we.replace(/^\//,"");if(!Q)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${u.apiBaseUrl}/repositories/${x}/${A}/src/${Q}/${Se}`}catch(x){throw new Error(`Incorrect URL: ${w}, ${x}`)}}function pn(w){const u={};if(w.username&&w.appPassword){const x=en.from(`${w.username}:${w.appPassword}`,"utf8");u.Authorization=`Basic ${x.toString("base64")}`}return{headers:u}}function Cn(w){const u=w.getString("host");let x=w.getOptionalString("apiBaseUrl");const A=w.getOptionalString("token"),Q=w.getOptionalString("username"),pe=w.getOptionalString("password");if(!L(u))throw new Error(`Invalid Bitbucket Server integration config, '${u}' is not a valid host`);return x?x=(0,F.trimEnd)(x,"/"):x=`https://${u}/rest/api/1.0`,{host:u,apiBaseUrl:x,token:A,username:Q,password:pe}}function Tn(w){return w.map(Cn)}class an{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 A=new URL(x);return A.hash=u.lineNumber.toString(),A.toString()}return x}resolveEditUrl(u){return u.includes("?")?u.substring(0,u.indexOf("?")):u}constructor(u){this.integrationConfig=u}}an.factory=({config:w})=>{var u;const x=Tn((u=w.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&u!==void 0?u:[]);return y(x.map(A=>new an(A)),A=>A.config.host)};var Xn=t(48834).lW;async function On(w,u){const{name:x,owner:A}=parseGitUrl(w);let Q=`${u.apiBaseUrl}/projects/${A}/repos/${x}/default-branch`,pe=await fetch(Q,Bn(u));if(pe.status===404&&(Q=`${u.apiBaseUrl}/projects/${A}/repos/${x}/branches/default`,pe=await fetch(Q,Bn(u))),!pe.ok){const dt=`Failed to retrieve default branch from ${Q}, ${pe.status} ${pe.statusText}`;throw new Error(dt)}const{displayId:we}=await pe.json(),Se=we;if(!Se)throw new Error(`Failed to read default branch from ${Q}. Response ${pe.status} ${pe.json()}`);return Se}async function qn(w,u){const{name:x,owner:A,ref:Q,filepath:pe}=parseGitUrl(w);let we=Q;we||(we=await On(w,u));const Se=pe?`&path=${encodeURIComponent(decodeURIComponent(pe))}`:"";return`${u.apiBaseUrl}/projects/${A}/repos/${x}/archive?format=tgz&at=${we}&prefix=${A}-${x}${Se}`}function ct(w,u){try{const{owner:x,name:A,ref:Q,filepathtype:pe,filepath:we}=parseGitUrl(w);if(!x||!A||pe!=="browse"&&pe!=="raw"&&pe!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Se=we.replace(/^\//,"");return`${u.apiBaseUrl}/projects/${x}/repos/${A}/raw/${Se}?at=${Q}`}catch(x){throw new Error(`Incorrect URL: ${w}, ${x}`)}}function Bn(w){const u={};if(w.token)u.Authorization=`Bearer ${w.token}`;else if(w.username&&w.password){const x=Xn.from(`${w.username}:${w.password}`,"utf8");u.Authorization=`Basic ${x.toString("base64")}`}return{headers:u}}function wn(w){const u=w.getString("host");let x=w.getOptionalString("baseUrl"),A=w.getOptionalString("cloneUrl"),Q=w.getOptionalString("gitilesBaseUrl");const pe=w.getOptionalString("username"),we=w.getOptionalString("password");if(L(u)){if(x&&!m(x))throw new Error(`Invalid Gerrit integration config, '${x}' is not a valid baseUrl`);if(A&&!m(A))throw new Error(`Invalid Gerrit integration config, '${A}' is not a valid cloneUrl`);if(Q&&!m(Q))throw new Error(`Invalid Gerrit integration config, '${Q}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${u}' is not a valid host`);return x?x=(0,F.trimEnd)(x,"/"):x=`https://${u}`,Q?Q=(0,F.trimEnd)(Q,"/"):Q=`https://${u}`,A?A=(0,F.trimEnd)(A,"/"):A=x,{host:u,baseUrl:x,cloneUrl:A,gitilesBaseUrl:Q,username:pe,password:we}}function ln(w){return w.map(wn)}var $n=t(48834).lW;const zn=")]}'";function jn(w,u){const A=u.replace(w.gitilesBaseUrl,"").split("/").filter(Vt=>!!Vt),Q=A.indexOf("+");if(Q<=0)throw new Error(`Unable to parse project from url: ${u}`);const pe=(0,F.trimStart)(A.slice(0,Q).join("/"),"/"),we=A.indexOf("heads");if(we<=0)throw new Error(`Unable to parse branch from url: ${u}`);const Se=A[we+1],dt=A.slice(we+2).join("/");return{branch:Se,filePath:dt===""?"/":dt,project:pe}}function Gn(w,u,x,A){return`${w.gitilesBaseUrl}/${u}/+/refs/heads/${x}/${(0,F.trimStart)(A,"/")}`}function ve(w){return w.password?"/a/":"/"}function oe(w,u){const{branch:x,project:A}=jn(w,u);return`${w.baseUrl}${ve(w)}projects/${encodeURIComponent(A)}/branches/${x}`}function Oe(w,u){const{project:x}=jn(w,u);return`${w.cloneUrl}${ve(w)}${x}`}function Pe(w,u){const{branch:x,filePath:A,project:Q}=jn(w,u);return`${w.baseUrl}${ve(w)}projects/${encodeURIComponent(Q)}/branches/${x}/files/${encodeURIComponent(A)}/content`}function Ge(w){return`${w.baseUrl}${ve(w)}projects/`}function ft(w){const u={};if(!w.password)return u;const x=$n.from(`${w.username}:${w.password}`,"utf8");return u.Authorization=`Basic ${x.toString("base64")}`,{headers:u}}async function Ht(w){const u=await w.text();if(u.startsWith(zn))try{return JSON.parse(u.slice(zn.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 Rt{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:x,base:A,lineNumber:Q}=u;let pe;if(x.startsWith("/")){const{branch:we,project:Se}=jn(this.config,A);return Gn(this.config,Se,we,x)}return x?pe=new URL(x,A):pe=new URL(A),Q&&(pe.hash=Q.toString()),pe.toString()}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}Rt.factory=({config:w})=>{var u;const x=ln((u=w.getOptionalConfigArray("integrations.gerrit"))!==null&&u!==void 0?u:[]);return y(x.map(A=>new Rt(A)),A=>A.config.host)};function ce(w){const u=w.getString("host");let x=w.getOptionalString("baseUrl");const A=w.getOptionalString("username"),Q=w.getOptionalString("password");if(!L(u))throw new Error(`Invalid Gitea integration config, '${u}' is not a valid host`);return x?x=(0,F.trimEnd)(x,"/"):x=`https://${u}`,{host:u,baseUrl:x,username:A,password:Q}}var U=t(48834).lW;function he(w,u){try{var x;const A=(x=w.baseUrl)!==null&&x!==void 0?x:`https://${w.host}`,[Q,pe,we,Se,dt,Vt,...dn]=u.replace(A,"").split("/"),Yn=dn.join("/").replace(/^\//,"");return`${A}/${pe}/${we}/_edit/${Vt}/${Yn}`}catch(A){throw new Error(`Incorrect URL: ${u}, ${A}`)}}function Ke(w,u){try{var x;const A=(x=w.baseUrl)!==null&&x!==void 0?x:`https://${w.host}`,[Q,pe,we,Se,dt,Vt,...dn]=u.replace(A,"").split("/"),Yn=dn.join("/").replace(/^\//,"");return`${A}/api/v1/repos/${pe}/${we}/contents/${Yn}?ref=${Vt}`}catch(A){throw new Error(`Incorrect URL: ${u}, ${A}`)}}function Ve(w){const u={},{username:x,password:A}=w;return A?(x?u.Authorization=`basic ${U.from(`${x}:${A}`).toString("base64")}`:u.Authorization=`token ${A}`,{headers:u}):u}class at{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(u){return l(u)}resolveEditUrl(u){return he(this.config,u)}constructor(u){this.config=u}}at.factory=({config:w})=>{var u;const A=((u=w.getOptionalConfigArray("integrations.gitea"))!==null&&u!==void 0?u:[]).map(Q=>ce(Q));return y(A.map(Q=>new at(Q)),Q=>Q.config.host)};const Tt="github.com",tn="https://api.github.com",Xt="https://raw.githubusercontent.com";function sn(w){var u,x;const A=(x=w.getOptionalString("host"))!==null&&x!==void 0?x:Tt;let Q=w.getOptionalString("apiBaseUrl"),pe=w.getOptionalString("rawBaseUrl");const we=w.getOptionalString("token"),Se=(u=w.getOptionalConfigArray("apps"))===null||u===void 0?void 0:u.map(dt=>({appId:dt.getNumber("appId"),clientId:dt.getString("clientId"),clientSecret:dt.getString("clientSecret"),webhookSecret:dt.getString("webhookSecret"),privateKey:dt.getString("privateKey"),allowedInstallationOwners:dt.getOptionalStringArray("allowedInstallationOwners")}));if(!L(A))throw new Error(`Invalid GitHub integration config, '${A}' is not a valid host`);return Q?Q=(0,F.trimEnd)(Q,"/"):A===Tt&&(Q=tn),pe?pe=(0,F.trimEnd)(pe,"/"):A===Tt&&(pe=Xt),{host:A,apiBaseUrl:Q,rawBaseUrl:pe,token:we,apps:Se}}function q(w){const u=w.map(sn);return u.some(x=>x.host===Tt)||u.push({host:Tt,apiBaseUrl:tn,rawBaseUrl:Xt}),u}function W(w,u,x){try{const{owner:A,name:Q,ref:pe,filepathtype:we,filepath:Se}=parseGitUrl(w);if(!A||!Q||!pe||we!=="blob"&&we!=="raw"&&we!=="tree")throw new Error("Invalid GitHub URL or file path");const dt=Se.replace(/^\//,"");return g(u,x)==="api"?`${u.apiBaseUrl}/repos/${A}/${Q}/contents/${dt}?ref=${pe}`:`${u.rawBaseUrl}/${A}/${Q}/${pe}/${dt}`}catch(A){throw new Error(`Incorrect URL: ${w}, ${A}`)}}function de(w,u){const x={};return g(w,u)==="api"&&(x.Accept="application/vnd.github.v3.raw"),u.token&&(x.Authorization=`token ${u.token}`),{headers:x}}function g(w,u){return w.apiBaseUrl&&(u.token||!w.rawBaseUrl)?"api":"raw"}var R=t(42822),J=t(89393),K=t(26228);class ae{async getOrCreateToken(u,x,A){let Q=this.tokenCache.get(u);if((!Q||this.isExpired(Q.expiresAt))&&(Q=await A(),Q.expiresAt=Q.expiresAt.minus({minutes:10}),this.tokenCache.set(u,Q)),!this.appliesToRepo(Q,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:Q.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=>K.ou.local()>u}}const fe={Accept:"application/vnd.github.machine-man-preview+json"};class Ue{async getInstallationCredentials(u,x){if(this.allowedInstallationOwners){var A;if(!(!((A=this.allowedInstallationOwners)===null||A===void 0)&&A.includes(u)))return{accessToken:void 0}}return this.cache.getOrCreateToken(u,x,async()=>{const{installationId:Q,suspended:pe}=await this.getInstallationData(u);if(pe)throw new Error(`The GitHub application for ${u} is suspended`);const we=await this.appClient.apps.createInstallationAccessToken({installation_id:Q,headers:fe});let Se;if(we.data.repository_selection==="selected"){const Vt=new J.v({baseUrl:this.baseUrl,auth:we.data.token}),dn=await Vt.paginate(Vt.apps.listReposAccessibleToInstallation);var dt;Se=((dt=dn.repositories)!==null&&dt!==void 0?dt:dn).map(er=>er.name)}return{token:we.data.token,expiresAt:K.ou.fromISO(we.data.expires_at),repositories:Se}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(u){const A=(await this.getInstallations()).find(pe=>{var we,Se;return((we=pe.account)===null||we===void 0||(Se=we.login)===null||Se===void 0?void 0:Se.toLocaleLowerCase("en-US"))===u.toLocaleLowerCase("en-US")});if(A)return{installationId:A.id,suspended:Boolean(A.suspended_by)};const Q=new Error(`No app installation found for ${u} in ${this.baseAuthConfig.appId}`);throw Q.name="NotFoundError",Q}constructor(u,x){this.cache=new ae,this.allowedInstallationOwners=u.allowedInstallationOwners,this.baseUrl=x,this.baseAuthConfig={appId:u.appId,privateKey:u.privateKey.replace(/\\n/gm,`
|
|
33
|
-
`)},this.appClient=new J.v({baseUrl:x,headers:fe,authStrategy:R.i,auth:this.baseAuthConfig})}}class Ye{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 A=await Promise.all(this.apps.map(Se=>Se.getInstallationCredentials(u,x).then(dt=>({credentials:dt,error:void 0}),dt=>({credentials:void 0,error:dt})))),Q=A.find(Se=>Se.credentials);if(Q)return Q.credentials.accessToken;const we=A.map(Se=>Se.error).find(Se=>Se.name!=="NotFoundError");if(we)throw we}constructor(u){var x,A;this.apps=(A=(x=u.apps)===null||x===void 0?void 0:x.map(Q=>new Ue(Q,u.apiBaseUrl)))!==null&&A!==void 0?A:[]}}class ut{async getCredentials(u){const x=r()(u.url),A=x.owner||x.name,Q=x.owner?x.name:void 0;let pe="app",we=await this.githubAppCredentialsMux.getAppToken(A,Q);return we||(pe="token",we=this.token),{headers:we?{Authorization:`Bearer ${we}`}:void 0,token:we,type:pe}}constructor(u,x){this.githubAppCredentialsMux=u,this.token=x}}ut.create=w=>new ut(new Ye(w),w.token);class vt{static fromIntegrations(u){const x=new Map;return u.github.list().forEach(A=>{const Q=SingleInstanceGithubCredentialsProvider.create(A.config);x.set(A.config.host,Q)}),new vt(x)}async getCredentials(u){const x=new URL(u.url),A=this.providers.get(x.host);if(!A)throw new Error(`There is no GitHub integration that matches ${u.url}. Please add a configuration for an integration.`);return A.getCredentials(u)}constructor(u){this.providers=u}}class et{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return qe(l(u),"tree")}resolveEditUrl(u){return qe(u,"edit")}constructor(u){this.integrationConfig=u}}et.factory=({config:w})=>{var u;const x=q((u=w.getOptionalConfigArray("integrations.github"))!==null&&u!==void 0?u:[]);return y(x.map(A=>new et(A)),A=>A.config.host)};function qe(w,u){return w.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(x,A,Q,pe)=>`//${A}/${Q}/${pe}/${u}/`)}const Ne=null;class Zt extends et{get config(){return super.config}constructor(u){super(u)}}Zt.factory=et.factory;const Kt=null,kt=null,Dt=null,Wt="gitlab.com",Gt="https://gitlab.com/api/v4";function ht(w){const u=w.getString("host");let x=w.getOptionalString("apiBaseUrl");const A=w.getOptionalString("token");let Q=w.getOptionalString("baseUrl");if(x?x=(0,F.trimEnd)(x,"/"):u===Wt&&(x=Gt),Q?Q=(0,F.trimEnd)(Q,"/"):Q=`https://${u}`,L(u)){if(!x||!m(x))throw new Error(`Invalid GitLab integration config, '${x}' is not a valid apiBaseUrl`);if(!m(Q))throw new Error(`Invalid GitLab integration config, '${Q}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${u}' is not a valid host`);return{host:u,token:A,apiBaseUrl:x,baseUrl:Q}}function We(w){const u=w.map(ht);return u.some(x=>x.host===Wt)||u.push({host:Wt,apiBaseUrl:Gt,baseUrl:`https://${Wt}`}),u}function Ut(w){let u="";return w.host!==Wt&&(u=new URL(w.baseUrl).pathname),trimEnd(u,"/")}async function cn(w,u){const x=await Zn(w,u);return In(w,x,u).toString()}function yn(w){const{token:u=""}=w;return{headers:{"PRIVATE-TOKEN":u}}}function In(w,u,x){try{const A=new URL(w),Q=A.pathname.split("/blob/").slice(1).join("/blob/"),[pe,...we]=Q.split("/"),Se=getGitLabIntegrationRelativePath(x);return A.pathname=[...Se?[Se]:[],"api/v4/projects",u,"repository/files",encodeURIComponent(decodeURIComponent(we.join("/"))),"raw"].join("/"),A.search=`?ref=${pe}`,A}catch(A){throw new Error(`Incorrect url: ${w}, ${A}`)}}async function Zn(w,u){const x=new URL(w);if(!x.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let A=x.pathname.split("/-/blob/")[0].split("/blob/")[0];const Q=getGitLabIntegrationRelativePath(u);Q&&(A=A.replace(Q,""));const pe=new URL(`${x.origin}${Q}/api/v4/projects/${encodeURIComponent(A.replace(/^\//,""))}`),we=await fetch(pe.toString(),yn(u)),Se=await we.json();if(!we.ok)throw new Error(`GitLab Error '${Se.error}', ${Se.error_description}`);return Number(Se.id)}catch(A){throw new Error(`Could not get GitLab project ID for: ${w}, ${A}`)}}class xn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return l(u)}resolveEditUrl(u){return Kn(u,"edit")}constructor(u){this.integrationConfig=u}}xn.factory=({config:w})=>{var u;const x=We((u=w.getOptionalConfigArray("integrations.gitlab"))!==null&&u!==void 0?u:[]);return y(x.map(A=>new xn(A)),A=>A.config.host)};function Kn(w,u){return w.replace(/\/\-\/(blob|tree|edit)\//,`/-/${u}/`)}class bn{static fromConfig(u){return new bn({awsS3:G.factory({config:u}),azure:Fe.factory({config:u}),bitbucket:Lt.factory({config:u}),bitbucketCloud:It.factory({config:u}),bitbucketServer:an.factory({config:u}),gerrit:Rt.factory({config:u}),github:et.factory({config:u}),gitlab:xn.factory({config:u}),gitea:at.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}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(u=>u.list())}byUrl(u){let x=Object.values(this.byType).map(A=>A.byUrl(u)).filter(Boolean);if(x.length>1){const A=x.filter(Q=>!(Q instanceof Lt));A.length!==0&&(x=A)}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}}},6290:function(bt,Be,t){"use strict";var h={};t.r(h),t.d(h,{TechDocsPlugin:function(){return T.s4}});var r=t(52322),F=t(2784),L=t(28316),m=t(79635),y=t(60871);const l=(0,y.T0)({id:"plugin.techdocs.storageservice"}),M=(0,y.T0)({id:"plugin.techdocs.service"});var be=t(92077),V=t(95481),G=t(7476),b=t(93225),B=t(67896),Y=t(65124),le=t(22478),ee=t(85478),X=t(68435),j=t(3482),P=t(42081),$=t(48431),T=t(89258),re=t(52943),Re=t(61886),Xe=t(13980),_e=t.n(Xe);class it{get(n){for(const s of this.holders){const c=s.get(n);if(c)return c}}constructor(...n){this.holders=n}}var Fe=t(51837);const jt=(0,Fe.CT)("api-context"),He=i=>{var n;const{apis:s,children:c}=i,f=(n=(0,F.useContext)(jt))===null||n===void 0?void 0:n.atVersion(1),I=f?new it(s,f):s;return(0,r.jsx)(jt.Provider,{value:(0,Fe.EI)({1:I}),children:c})};He.propTypes={apis:_e().shape({get:_e().func.isRequired}).isRequired,children:_e().node};class st{static validateFactories(n,s){for(const c of s){const f=[c],I=new Set;for(;f.length;){const k=f.shift(),z=n.get(k);if(z)for(const te of Object.values(z.deps)){if(te.id===c.id)throw new Error(`Circular dependency of api factory for ${c}`);I.has(te)||(I.add(te),f.push(te))}}}}get(n){return this.load(n)}load(n,s=[]){const c=this.apis.get(n.id);if(c)return c;const f=this.factories.get(n);if(!f)return;if(s.includes(f.api))throw new Error(`Circular dependency of api factory for ${f.api}`);const I=this.loadDeps(n,f.deps,[...s,f.api]),k=f.factory(I);return this.apis.set(n.id,k),k}loadDeps(n,s,c){const f={};for(const I in s)if(s.hasOwnProperty(I)){const k=s[I],z=this.load(k,c);if(!z)throw new Error(`No API factory available for dependency ${k} of dependent ${n}`);f[I]=z}return f}constructor(n){this.factories=n,this.apis=new Map}}var je;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(je||(je={}));class Et{register(n,s){const c=je[n],f=this.factories.get(s.api.id);return f&&f.priority>=c?!1:(this.factories.set(s.api.id,{priority:c,factory:s}),!0)}get(n){const s=this.factories.get(n.id);if(s)return s.factory}getAllApis(){const n=new Set;for(const{factory:s}of this.factories.values())n.add(s.api);return n}constructor(){this.factories=new Map}}function St(i){return new Promise((n,s)=>{const c=i.width||500,f=i.height||700,I=window.screen.width/2-c/2,k=window.screen.height/2-f/2,z=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${c},height=${f},top=${k},left=${I}`);let te="";if(!z||typeof z.closed=="undefined"||z.closed){const lt=new Error("Failed to open auth popup.");lt.name="PopupRejectedError",s(lt);return}const De=lt=>{if(lt.source!==z||lt.origin!==i.origin)return;const{data:Ct}=lt;if(Ct.type==="config_info"){te=Ct.targetOrigin;return}if(Ct.type!=="authorization_response")return;const wt=Ct;if("error"in wt){const Ft=new Error(wt.error.message);Ft.name=wt.error.name,s(Ft)}else n(wt.response);tt()},Ee=setInterval(()=>{if(z.closed){const lt=`Login failed, ${te&&te!==window.location.origin?`Incorrect app origin, expected ${te}`:"popup was closed"}`,Ct=new Error(lt);Ct.name="PopupClosedError",s(Ct),tt()}},100);function tt(){window.removeEventListener("message",De),clearInterval(Ee)}window.addEventListener("message",De)})}function gt(i){return[...i].join(" ")}class yt{async createSession(n){return n.instantPopup?this.showPopup(n.scopes):this.authRequester(n.scopes)}async refreshSession(){const n=await fetch(await this.buildUrl("/refresh",{optional:!0}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(c=>{throw new Error(`Auth refresh request failed, ${c}`)});if(!n.ok){const c=new Error(`Auth refresh request failed, ${n.statusText}`);throw c.status=n.status,c}const s=await n.json();if(s.error){const c=new Error(s.error.message);throw s.error.name&&(c.name=s.error.name),c}return await this.sessionTransform(s)}async removeSession(){const n=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(s=>{throw new Error(`Logout request failed, ${s}`)});if(!n.ok){const s=new Error(`Logout request failed, ${n.statusText}`);throw s.status=n.status,s}}async showPopup(n){const s=this.joinScopesFunc(n),c=await this.buildUrl("/start",{scope:s,origin:window.location.origin}),f=await St({url:c,name:`${this.provider.title} Login`,origin:new URL(c).origin,width:450,height:730});return await this.sessionTransform(f)}async buildUrl(n,s){const c=await this.discoveryApi.getBaseUrl("auth"),f=this.buildQueryString({...s,env:this.environment});return`${c}/${this.provider.id}${n}${f}`}buildQueryString(n){if(!n)return"";const s=Object.entries(n).map(([c,f])=>{if(typeof f=="string")return`${encodeURIComponent(c)}=${encodeURIComponent(f)}`;if(f)return encodeURIComponent(c)}).filter(Boolean).join("&");return s?`?${s}`:""}constructor(n){const{discoveryApi:s,environment:c,provider:f,joinScopes:I=gt,oauthRequestApi:k,sessionTransform:z=te=>te}=n;this.authRequester=k.createAuthRequester({provider:f,onAuthRequest:te=>this.showPopup(te)}),this.discoveryApi=s,this.environment=c,this.provider=f,this.joinScopesFunc=I,this.sessionTransform=z}}function At(i,n){for(const s of n)if(!i.has(s))return!1;return!0}class Lt{sessionExistsAndHasScope(n,s){if(!n)return!1;if(!s||this.options.sessionScopes===void 0)return!0;const c=this.options.sessionScopes(n);return At(c,s)}getExtendedScope(n,s){const c=new Set(this.options.defaultScopes);if(n&&this.options.sessionScopes!==void 0){const f=this.options.sessionScopes(n);for(const I of f)c.add(I)}if(s)for(const f of s)c.add(f);return c}constructor(n){this.options=n}}var ze=t(82394),xe=t.n(ze);let Te=Symbol.observable;class Ae{[Te](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(s=>s.next(n))}error(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(s=>s.error(n))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,s,c){const f=typeof n=="function"?{next:n,error:s,complete:c}:n;return this.observable.subscribe(f)}constructor(){this.isClosed=!1,this.observable=new(xe())(n=>this.isClosed?(this.terminatingError?n.error(this.terminatingError):n.complete(),()=>{}):(this.subscribers.add(n),()=>{this.subscribers.delete(n)})),this.subscribers=new Set}}let Ze=Symbol.observable;class rt{[Ze](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=n,this.subscribers.forEach(s=>s.next(n))}error(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(s=>s.error(n))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,s,c){const f=typeof n=="function"?{next:n,error:s,complete:c}:n;return this.observable.subscribe(f)}constructor(n){this.subscribers=new Set,this.isClosed=!1,this.currentValue=n,this.terminatingError=void 0,this.observable=new(xe())(s=>this.isClosed?(this.terminatingError?s.error(this.terminatingError):s.complete(),()=>{}):(s.next(this.currentValue),this.subscribers.add(s),()=>{this.subscribers.delete(s)}))}}class zt{setIsSignedIn(n){this.signedIn!==n&&(this.signedIn=n,this.subject.next(this.signedIn?y.sM.SignedIn:y.sM.SignedOut))}sessionState$(){return this.subject}constructor(){this.subject=new rt(y.sM.SignedOut),this.signedIn=!1}}class pt{async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const c=await this.collapsedSessionRefresh(),f=this.sessionScopesFunc(this.currentSession),I=this.sessionScopesFunc(c);return At(I,f)&&(this.currentSession=c),c}catch(c){if(n.optional)return;throw c}}if(!this.currentSession&&!n.instantPopup)try{const s=await this.collapsedSessionRefresh();return this.currentSession=s,this.getSession(n)}catch{}if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession();try{const n=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),n}finally{delete this.refreshPromise}}constructor(n){this.stateTracker=new zt;const{connector:s,defaultScopes:c=new Set,sessionScopes:f,sessionShouldRefresh:I}=n;this.connector=s,this.sessionScopesFunc=f,this.sessionShouldRefreshFunc=I,this.helper=new Lt({sessionScopes:f,defaultScopes:c})}}class Pt{setSession(n){this.currentSession=n,this.stateTracker.setIsSignedIn(Boolean(n))}async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes))return this.currentSession;if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(n){this.stateTracker=new SessionStateTracker;const{connector:s,defaultScopes:c=new Set,sessionScopes:f}=n;this.connector=s,this.helper=new SessionScopeHelper({sessionScopes:f,defaultScopes:c})}}const mt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class It{static create(n){const{discoveryApi:s,environment:c="development",provider:f=mt,oauthRequestApi:I,defaultScopes:k=[],scopeTransform:z=Ee=>Ee}=n,te=new yt({discoveryApi:s,environment:c,provider:f,oauthRequestApi:I,sessionTransform(Ee){return{...Ee,providerInfo:{idToken:Ee.providerInfo.idToken,accessToken:Ee.providerInfo.accessToken,scopes:It.normalizeScopes(z,Ee.providerInfo.scope),expiresAt:new Date(Date.now()+Ee.providerInfo.expiresInSeconds*1e3)}}}}),De=new pt({connector:te,defaultScopes:new Set(k),sessionScopes:Ee=>Ee.providerInfo.scopes,sessionShouldRefresh:Ee=>(Ee.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new It({sessionManager:De,scopeTransform:z})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(n,s){const c=It.normalizeScopes(this.scopeTransform,n),f=await this.sessionManager.getSession({...s,scopes:c});var I;return(I=f==null?void 0:f.providerInfo.accessToken)!==null&&I!==void 0?I:""}async getIdToken(n={}){const s=await this.sessionManager.getSession(n);var c;return(c=s==null?void 0:s.providerInfo.idToken)!==null&&c!==void 0?c:""}async getBackstageIdentity(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.backstageIdentity}async getProfile(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.profile}static normalizeScopes(n,s){if(!s)return new Set;const c=Array.isArray(s)?s:s.split(/[\s|,]/).filter(Boolean);return new Set(n(c))}constructor(n){this.sessionManager=n.sessionManager,this.scopeTransform=n.scopeTransform}}const en={id:"github",title:"GitHub",icon:()=>null};class on{static create(n){const{discoveryApi:s,environment:c="development",provider:f=en,oauthRequestApi:I,defaultScopes:k=["read:user"]}=n;return It.create({discoveryApi:s,oauthRequestApi:I,provider:f,environment:c,defaultScopes:k})}}const vn={id:"gitlab",title:"GitLab",icon:()=>null};class $t{static create(n){const{discoveryApi:s,environment:c="development",provider:f=vn,oauthRequestApi:I,defaultScopes:k=["read_user"]}=n;return It.create({discoveryApi:s,oauthRequestApi:I,provider:f,environment:c,defaultScopes:k})}}const pn={id:"google",title:"Google",icon:()=>null},Cn="https://www.googleapis.com/auth/";class Tn{static create(n){const{discoveryApi:s,oauthRequestApi:c,environment:f="development",provider:I=pn,defaultScopes:k=["openid",`${Cn}userinfo.email`,`${Cn}userinfo.profile`]}=n;return It.create({discoveryApi:s,oauthRequestApi:c,provider:I,environment:f,defaultScopes:k,scopeTransform(z){return z.map(te=>te==="openid"?te:te==="profile"||te==="email"?`${Cn}userinfo.${te}`:te.startsWith(Cn)?te:`${Cn}${te}`)}})}}const an={id:"okta",title:"Okta",icon:()=>null},Xn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),On="okta.";class qn{static create(n){const{discoveryApi:s,environment:c="development",provider:f=an,oauthRequestApi:I,defaultScopes:k=["openid","email","profile","offline_access"]}=n;return It.create({discoveryApi:s,oauthRequestApi:I,provider:f,environment:c,defaultScopes:k,scopeTransform(z){return z.map(te=>Xn.has(te)||te.startsWith(On)?te:`${On}${te}`)}})}}var ct=t(30195);const Bn=ct.z.object({profile:ct.z.object({email:ct.z.string().optional(),displayName:ct.z.string().optional(),picture:ct.z.string().optional()}),backstageIdentity:ct.z.object({token:ct.z.string(),identity:ct.z.object({type:ct.z.literal("user"),userEntityRef:ct.z.string(),ownershipEntityRefs:ct.z.array(ct.z.string())})})}),wn={id:"saml",title:"SAML",icon:()=>null};class ln{static create(n){const{discoveryApi:s,environment:c="development",provider:f=wn}=n,I=new DirectAuthConnector({discoveryApi:s,environment:c,provider:f}),k=new StaticAuthSessionManager({connector:I}),z=new AuthSessionStore({manager:k,storageKey:`${f.id}Session`,schema:samlSessionSchema});return new ln(z)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.backstageIdentity}async getProfile(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.profile}constructor(n){this.sessionManager=n}}const $n={id:"microsoft",title:"Microsoft",icon:()=>null};class zn{static create(n){const{environment:s="development",provider:c=$n,oauthRequestApi:f,discoveryApi:I,defaultScopes:k=["openid","offline_access","profile","email","User.Read"]}=n;return It.create({discoveryApi:I,oauthRequestApi:f,provider:c,environment:s,defaultScopes:k})}}const jn={id:"onelogin",title:"onelogin",icon:()=>null},Gn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),ve="onelogin.";class oe{static create(n){const{discoveryApi:s,environment:c="development",provider:f=jn,oauthRequestApi:I}=n;return It.create({discoveryApi:s,oauthRequestApi:I,provider:f,environment:c,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(k){return k.map(z=>Gn.has(z)||z.startsWith(ve)?z:`${ve}${z}`)}})}}const Oe={id:"bitbucket",title:"Bitbucket",icon:()=>null};class Pe{static create(n){const{discoveryApi:s,environment:c="development",provider:f=Oe,oauthRequestApi:I,defaultScopes:k=["team"]}=n;return It.create({discoveryApi:s,oauthRequestApi:I,provider:f,environment:c,defaultScopes:k})}}const Ge={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class ft{static create(n){const{discoveryApi:s,environment:c="development",provider:f=Ge,oauthRequestApi:I,defaultScopes:k=["PROJECT_ADMIN"]}=n;return It.create({discoveryApi:s,oauthRequestApi:I,provider:f,environment:c,defaultScopes:k})}}const Ht={id:"atlassian",title:"Atlassian",icon:()=>null};class Rt{static create(n){const{discoveryApi:s,environment:c="development",provider:f=Ht,oauthRequestApi:I}=n;return It.create({discoveryApi:s,oauthRequestApi:I,provider:f,environment:c})}}class ce{post(n){this.subject.next(n)}alert$(){return this.subject}constructor(){this.subject=new Ae}}class U{captureEvent(n){}}const he="theme";class Ke{static createWithStorage(n){const s=new Ke(n);if(!window.localStorage)return s;var c;const f=(c=window.localStorage.getItem(he))!==null&&c!==void 0?c:void 0;return s.setActiveThemeId(f),s.activeThemeId$().subscribe(I=>{I?window.localStorage.setItem(he,I):window.localStorage.removeItem(he)}),window.addEventListener("storage",I=>{if(I.key===he){var k;const z=(k=localStorage.getItem(he))!==null&&k!==void 0?k:void 0;s.setActiveThemeId(z)}}),s}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(n){this.activeThemeId=n,this.subject.next(n)}constructor(n){this.themes=n,this.subject=new rt(void 0)}}var Ve=t(9850),at=t.n(Ve),Tt=t(12782),tn=t.n(Tt);const Xt=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function sn(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function q(i){if(i===null)return"null";if(Array.isArray(i))return"array";const n=typeof i;return n==="number"&&isNaN(i)?"nan":n==="string"&&i===""?"empty-string":n}const W={type(i,n,s,c){return`Invalid type in config for key '${i}' in '${n}', got ${s}, wanted ${c}`},missing(i){return`Missing required config value at '${i}'`},convert(i,n,s){return`Unable to convert config value for key '${i}' in '${n}' to a ${s}`}};class de{static fromConfigs(n){return n.length===0?new de(void 0):n.reduce((s,{data:c,context:f,filteredKeys:I,deprecatedKeys:k})=>{const z=new de(c,f,s);if(z.filteredKeys=I,k)for(const{key:te,description:De}of k)console.warn(`The configuration key '${te}' of ${f} is deprecated and may be removed soon. ${De||""}`);return z},void 0)}has(n){var s;if(this.readValue(n)!==void 0)return!0;var f;return(f=(s=this.fallback)===null||s===void 0?void 0:s.has(n))!==null&&f!==void 0?f:!1}keys(){var n;const s=this.data?Object.keys(this.data):[];var c;const f=(c=(n=this.fallback)===null||n===void 0?void 0:n.keys())!==null&&c!==void 0?c:[];return[...new Set([...s,...f])]}get(n){const s=this.getOptional(n);if(s===void 0)throw new Error(W.missing(this.fullKey(n!=null?n:"")));return s}getOptional(n){var s;const c=at()(this.readValue(n)),f=(s=this.fallback)===null||s===void 0?void 0:s.getOptional(n);if(c===void 0){if(!1)var I;return f}else if(f===void 0)return c;return tn()({},{value:f},{value:c},(k,z)=>!sn(z)||!sn(k)?z:void 0).value}getConfig(n){const s=this.getOptionalConfig(n);if(s===void 0)throw new Error(W.missing(this.fullKey(n)));return s}getOptionalConfig(n){var s;const c=this.readValue(n),f=(s=this.fallback)===null||s===void 0?void 0:s.getOptionalConfig(n);if(sn(c))return this.copy(c,n,f);if(c!==void 0)throw new TypeError(W.type(this.fullKey(n),this.context,q(c),"object"));return f}getConfigArray(n){const s=this.getOptionalConfigArray(n);if(s===void 0)throw new Error(W.missing(this.fullKey(n)));return s}getOptionalConfigArray(n){const s=this.readConfigValue(n,f=>{if(!Array.isArray(f))return{expected:"object-array"};for(const[I,k]of f.entries())if(!sn(k))return{expected:"object-array",value:k,key:`${n}[${I}]`};return!0});if(!s){if(!1)var c;return}return s.map((f,I)=>this.copy(f,`${n}[${I}]`))}getNumber(n){const s=this.getOptionalNumber(n);if(s===void 0)throw new Error(W.missing(this.fullKey(n)));return s}getOptionalNumber(n){const s=this.readConfigValue(n,f=>typeof f=="number"||typeof f=="string"||{expected:"number"});if(typeof s=="number"||s===void 0)return s;const c=Number(s);if(!Number.isFinite(c))throw new Error(W.convert(this.fullKey(n),this.context,"number"));return c}getBoolean(n){const s=this.getOptionalBoolean(n);if(s===void 0)throw new Error(W.missing(this.fullKey(n)));return s}getOptionalBoolean(n){const s=this.readConfigValue(n,f=>typeof f=="boolean"||typeof f=="number"||typeof f=="string"||{expected:"boolean"});if(typeof s=="boolean"||s===void 0)return s;const c=String(s).trim();if(/^(?:y|yes|true|1|on)$/i.test(c))return!0;if(/^(?:n|no|false|0|off)$/i.test(c))return!1;throw new Error(W.convert(this.fullKey(n),this.context,"boolean"))}getString(n){const s=this.getOptionalString(n);if(s===void 0)throw new Error(W.missing(this.fullKey(n)));return s}getOptionalString(n){return this.readConfigValue(n,s=>typeof s=="string"&&s!==""||{expected:"string"})}getStringArray(n){const s=this.getOptionalStringArray(n);if(s===void 0)throw new Error(W.missing(this.fullKey(n)));return s}getOptionalStringArray(n){return this.readConfigValue(n,s=>{if(!Array.isArray(s))return{expected:"string-array"};for(const[c,f]of s.entries())if(typeof f!="string"||f==="")return{expected:"string-array",value:f,key:`${n}[${c}]`};return!0})}fullKey(n){return`${this.prefix}${this.prefix?".":""}${n}`}copy(n,s,c){const f=new de(n,this.context,c,this.fullKey(s));return f.filteredKeys=this.filteredKeys,f}readConfigValue(n,s){const c=this.readValue(n);if(c===void 0){var f;if(!1)var I;return(f=this.fallback)===null||f===void 0?void 0:f.readConfigValue(n,s)}const k=s(c);if(k!==!0){const{key:z=n,value:te=c,expected:De}=k;throw new TypeError(W.type(this.fullKey(z),this.context,q(te),De))}return c}readValue(n){const s=n?n.split("."):[];for(const f of s)if(!Xt.test(f))throw new TypeError(`Invalid config key '${n}'`);if(this.data===void 0)return;let c=this.data;for(const[f,I]of s.entries())if(sn(c))c=c[I];else if(c!==void 0){const k=this.fullKey(s.slice(0,f).join("."));throw new TypeError(W.type(k,this.context,q(c),"object"))}return c}constructor(n,s="mock-config",c,f=""){this.data=n,this.context=s,this.fallback=c,this.prefix=f,this.notifiedFilteredKeys=new Set}}const g="Invalid discovery URL pattern,";class R{static compile(n){const s=n.split(/\{\{\s*pluginId\s*\}\}/),c=s.join("pluginId");let f;try{f=new URL(c)}catch{throw new Error(`${g} URL '${c}' is invalid`)}if(f.hash)throw new Error(`${g} URL must not have a hash`);if(f.search)throw new Error(`${g} URL must not have a query`);if(c.endsWith("/"))throw new Error(`${g} URL must not end with a slash`);return new R(s)}async getBaseUrl(n){return this.parts.join(n)}constructor(n){this.parts=n}}class J{post(n,s){return s!=null&&s.hidden||this.alertApi.post({message:n.message,severity:"error"}),this.errorApi.post(n,s)}error$(){return this.errorApi.error$()}constructor(n,s){this.alertApi=n,this.errorApi=s}}class K{post(n,s){this.subject.next({error:n,context:s})}error$(){return this.subject}constructor(){this.subject=new Ae}}class ae{static forward(n,s){window.addEventListener("unhandledrejection",c=>{n.post(c.reason,s)})}}function fe(i){if(i.length<3)throw new Error(`The '${i}' feature flag must have a minimum length of three characters.`);if(i.length>150)throw new Error(`The '${i}' feature flag must not exceed 150 characters.`);if(!i.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${i}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class Ue{registerFlag(n){fe(n.name),this.registeredFeatureFlags.push(n)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(n){return this.flags||(this.flags=this.load()),this.flags.get(n)===y.CL.Active}save(n){this.flags||(this.flags=this.load()),n.merge||this.flags.clear();for(const[c,f]of Object.entries(n.states))this.flags.set(c,f);const s=Array.from(this.flags.entries()).filter(([,c])=>c===y.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(s)))}load(){try{const n=window.localStorage.getItem("featureFlags");if(!n)return new Map;const s=JSON.parse(n);if(typeof s!="object"||s===null||Array.isArray(s))return new Map;const c=Object.entries(s).filter(([f,I])=>(fe(f),I===y.CL.Active));return new Map(c)}catch{return new Map}}constructor(){this.registeredFeatureFlags=[]}}function Ye(i){let n=i.baseImplementation||t.g.fetch;var s;const c=[(s=i.middleware)!==null&&s!==void 0?s:[]].flat().reverse();for(const f of c)n=f.apply(n);return{fetch:n}}class ut{static create(n){var s,c;const f=vt(n),I=((s=n.header)===null||s===void 0?void 0:s.name)||"authorization",k=((c=n.header)===null||c===void 0?void 0:c.value)||(z=>`Bearer ${z}`);return new ut(n.identityApi,f,I,k)}apply(n){return async(s,c)=>{const f=new Request(s,c),{token:I}=await this.identityApi.getCredentials();return f.headers.get(this.headerName)||typeof I!="string"||!I||!this.allowUrl(f.url)?n(s,c):(f.headers.set(this.headerName,this.headerValue(I)),n(f))}}constructor(n,s,c,f){this.identityApi=n,this.allowUrl=s,this.headerName=c,this.headerValue=f}}function vt(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?et(i.urlPrefixAllowlist):i.config?et([i.config.getString("backend.baseUrl")]):()=>!1}function et(i){const n=i.map(s=>s.replace(/\/$/,""));return s=>n.some(c=>s===c||s.startsWith(`${c}/`))}function qe(i,n){return!n||n==="/"?i:`${i.replace(/\/$/,"")}/${n.replace(/^\//,"")}`}class Ne{apply(n){return async(s,c)=>{const f=new Request(s,c),I="plugin://";if(!f.url.startsWith(I))return n(s,c);const{hostname:k,pathname:z,search:te,hash:De,username:Ee,password:tt}=new URL(`http://${f.url.substring(I.length)}`);let lt=await this.discoveryApi.getBaseUrl(k);if(Ee||tt){const wt=new URL(lt),Ft=`${Ee}${tt?`:${tt}`:""}@`;lt=`${wt.protocol}//${Ft}${wt.host}${wt.pathname}`}const Ct=`${qe(lt,z)}${te}${De}`;return n(Ct,typeof s=="string"||Zt(s)?c:s)}}constructor(n){this.discoveryApi=n}}function Zt(i){return typeof i=="object"&&(i==null?void 0:i.constructor)===URL}class Kt{static resolvePluginProtocol(n){return new Ne(n.discoveryApi)}static injectIdentityAuth(n){return ut.create(n)}constructor(){}}function kt(i,n){for(const s of n)if(!i.has(s))return!1;return!0}function Dt(i,...n){const s=new Set(i);for(const c of n)for(const f of c)s.add(f);return s}class Wt{request(n){return new Promise((s,c)=>{this.requests.push({scopes:n,resolve:s,reject:c}),this.subject.next(this.getCurrentPending())})}resolve(n,s){this.requests=this.requests.filter(c=>kt(n,c.scopes)?(c.resolve(s),!1):!0),this.subject.next(this.getCurrentPending())}reject(n){this.requests.forEach(s=>s.reject(n)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const n=this.requests.length===0?void 0:this.requests.slice(1).reduce((s,c)=>Dt(s,c.scopes),this.requests[0].scopes);return{scopes:n,resolve:s=>{n&&this.resolve(n,s)},reject:s=>{n&&this.reject(s)}}}constructor(){this.requests=[],this.subject=new rt(this.getCurrentPending())}}class Gt{createAuthRequester(n){const s=new Wt,c=this.handlerCount;return this.handlerCount++,s.pending().subscribe({next:f=>{const I=this.currentRequests.slice(),k=this.makeAuthRequest(f,n);k?I[c]=k:delete I[c],this.currentRequests=I,this.subject.next(I.filter(Boolean))}}),f=>s.request(f)}makeAuthRequest(n,s){const{scopes:c}=n;if(c)return{provider:s.provider,trigger:async()=>{const f=await s.onAuthRequest(c);n.resolve(f)},reject:()=>{const f=new Error("Login failed, rejected by user");f.name="RejectedError",n.reject(f)}}}authRequest$(){return this.subject}constructor(){this.subject=new rt([]),this.currentRequests=[],this.handlerCount=0}}const ht=new Map;class We{static create(n){var s;return new We((s=n.namespace)!==null&&s!==void 0?s:"",n.errorApi)}static addStorageEventListener(){window.addEventListener("storage",n=>{for(const[c,f]of ht.entries()){var s;!((s=n.key)===null||s===void 0)&&s.startsWith(c)&&f.handleStorageChange(n.key)}})}get(n){return this.snapshot(n).value}snapshot(n){let s,c="absent";try{const f=localStorage.getItem(this.getKeyName(n));f&&(s=JSON.parse(f,(I,k)=>(typeof k=="object"&&k!==null&&Object.freeze(k),k)),c="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${n}`))}return{key:n,value:s,presence:c}}forBucket(n){const s=`${this.namespace}/${n}`;return ht.has(s)||ht.set(s,new We(s,this.errorApi)),ht.get(s)}async set(n,s){localStorage.setItem(this.getKeyName(n),JSON.stringify(s)),this.notifyChanges(n)}async remove(n){localStorage.removeItem(this.getKeyName(n)),this.notifyChanges(n)}observe$(n){return We.hasSubscribed||(We.addStorageEventListener(),We.hasSubscribed=!0),this.observable.filter(({key:s})=>s===n)}handleStorageChange(n){if(!(n!=null&&n.startsWith(this.namespace)))return;const s=n==null?void 0:n.slice(`${this.namespace}/`.length);s.includes("/")||this.notifyChanges(decodeURIComponent(s))}getKeyName(n){return`${this.namespace}/${encodeURIComponent(n)}`}notifyChanges(n){const s=this.snapshot(n);for(const c of this.subscribers)c.next(s)}constructor(n,s){this.namespace=n,this.errorApi=s,this.subscribers=new Set,this.observable=new(xe())(c=>(this.subscribers.add(c),()=>{this.subscribers.delete(c)}))}}We.hasSubscribed=!1;const Ut=(0,F.createContext)(void 0);function cn(){const[i]=(0,m.is)((0,r.jsx)(m.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!i.index}var yn=t(16060);const In=(i,n)=>{try{var s,c;const f=(0,yn.fp)(n,{pathname:i}),I=(s=f==null?void 0:f.filter(z=>{var te;return((te=z==null?void 0:z.route.routeRefs)===null||te===void 0?void 0:te.size)>0}).pop())===null||s===void 0?void 0:s.route;if(!I)return{};let k;return I.routeRefs.size===1&&(k=I.routeRefs.values().next().value),{extension:"App",pluginId:((c=I.plugin)===null||c===void 0?void 0:c.getId())||"root",...k?{routeRef:k.id}:{}}}catch{return{}}},Zn=({pathname:i,search:n,hash:s})=>{const c=(0,y.z$)();return(0,F.useEffect)(()=>{c.captureEvent("navigate",`${i}${n}${s}`)},[c,i,n,s]),null},xn=({routeObjects:i})=>{const{pathname:n,search:s,hash:c}=(0,m.TH)();return(0,r.jsx)(y.fC,{attributes:In(n,i),children:(0,r.jsx)(Zn,{pathname:n,search:s,hash:c})})};function Kn(i){return cn()?bn(i):""}function bn(i){var n;let{pathname:s}=new URL((n=i.getOptionalString("app.baseUrl"))!==null&&n!==void 0?n:"/","http://sample.dev");return s=s.replace(/\/*$/,""),s}function w({component:i,appIdentityProxy:n,children:s}){const[c,f]=(0,F.useState)(),I=(0,y.h_)(y.Ds),k=Kn(I);return c?(n.setTarget(c,{signOutTargetUrl:k||"/"}),(0,r.jsx)(r.Fragment,{children:s})):(0,r.jsx)(i,{onSignInSuccess:f})}function u(i){const{Router:n,SignInPage:s}=(0,y.qD)().getComponents(),c=(0,y.h_)(y.Ds),f=bn(c),I=`${f}/*`,k=(0,F.useContext)(Ut);if(!k)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:z,appIdentityProxy:te}=k;return s?cn()?(0,r.jsxs)(n,{children:[(0,r.jsx)(xn,{routeObjects:z}),(0,r.jsx)(w,{component:s,appIdentityProxy:te,children:(0,r.jsx)(m.Z5,{children:(0,r.jsx)(m.AW,{path:I,element:(0,r.jsx)(r.Fragment,{children:i.children})})})})]}):(0,r.jsxs)(n,{basename:f,children:[(0,r.jsx)(xn,{routeObjects:z}),(0,r.jsx)(w,{component:s,appIdentityProxy:te,children:i.children})]}):(te.setTarget({getUserId:()=>"guest",getIdToken:async()=>{},getProfile:()=>({email:"guest@example.com",displayName:"Guest"}),getProfileInfo:async()=>({email:"guest@example.com",displayName:"Guest"}),getBackstageIdentity:async()=>({type:"user",userEntityRef:"user:default/guest",ownershipEntityRefs:["user:default/guest"]}),getCredentials:async()=>({}),signOut:async()=>{}},{signOutTargetUrl:f||"/"}),cn()?(0,r.jsxs)(n,{children:[(0,r.jsx)(xn,{routeObjects:z}),(0,r.jsx)(m.Z5,{children:(0,r.jsx)(m.AW,{path:I,element:(0,r.jsx)(r.Fragment,{children:i.children})})})]}):(0,r.jsxs)(n,{basename:f,children:[(0,r.jsx)(xn,{routeObjects:z}),i.children]}))}var x=t(90383),A=t(22504),Q=t(69866),pe=t(64279);function we(i){const n={};for(const c in i.collectors)i.collectors.hasOwnProperty(c)&&(n[c]=i.collectors[c]());const s=[{node:F.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;s.length!==0;){const{node:c,parent:f,contexts:I}=s.shift();F.Children.forEach(c,k=>{if(!(0,F.isValidElement)(k))return;const z={};for(const te in n)if(n.hasOwnProperty(te)){const De=n[te];z[te]=De.visit(De.accumulator,k,f,I[te])}for(const te of i.discoverers){const De=te(k);De&&s.push({node:De,parent:k,contexts:z})}})}return Object.fromEntries(Object.entries(n).map(([c,f])=>[c,f.accumulator]))}function Se(i,n){return()=>({accumulator:i(),visit:n})}function dt(i){var n;return(n=i.props)===null||n===void 0?void 0:n.children}function Vt(i){var n,s;if(!((n=i.props)===null||n===void 0)&&n.path&&(!((s=i.props)===null||s===void 0)&&s.element)){var c;return(c=i.props)===null||c===void 0?void 0:c.element}}const dn=Se(()=>new Set,(i,n)=>{const s=(0,y.IY)(n,"core.plugin");s&&i.add(s)}),Yn=i=>{const{children:n}=i,s=(0,y.h_)(y.W0),c="with"in i?s.isActive(i.with):!s.isActive(i.without);return(0,r.jsx)(r.Fragment,{children:c?n:null})};(0,y.R5)(Yn,"core.featureFlagged",!0);const er={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function zr(i){const n=i;if(n!=null&&n.type){var s,c;return(c=(s=n.type.displayName)!==null&&s!==void 0?s:n.type.name)!==null&&c!==void 0?c:String(n.type)}return String(n)}function oo(i,n=new Array){return F.Children.forEach(i,s=>{if(!(0,F.isValidElement)(s))return;const c=(0,y.IY)(s,"core.mountPoint");if(c){const f=(0,y.IY)(s,"core.plugin");n.push({routeRef:c,plugin:f})}oo(s.props.children,n)}),n}const xo=Se(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,s,c)=>{var f,I;if(c!=null&&c.isElementAncestor)return c;if((s==null?void 0:s.props.element)===n)return{...c,isElementAncestor:!0};const k=(f=n.props)===null||f===void 0?void 0:f.path,z=(0,y.IY)(n,"core.mountPoint");if(z&&k)throw new Error(`Path property may not be set directly on a routable extension "${zr(n)}"`);var te;const De=(te=c==null||(I=c.obj)===null||I===void 0?void 0:I.children)!==null&&te!==void 0?te:i.objects;if(k!==void 0){if(typeof k!="string")throw new Error(`Element path must be a string at "${zr(n)}"`);const Ct=k.startsWith("/")?k.slice(1):k,wt=n.props.element;if((0,y.IY)(n,"core.gatherMountPoints")){var Ee;if(wt)throw new Error(`Mount point gatherers may not have an element prop "${zr(n)}"`);const Ft={path:Ct,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Ee=n.props)===null||Ee===void 0?void 0:Ee.caseSensitive),children:[er],plugin:void 0};return De.push(Ft),{obj:Ft,gatherPath:Ct,routeRef:c==null?void 0:c.routeRef,gatherRouteRef:c==null?void 0:c.routeRef}}if(wt){var tt;const[Ft,...Mt]=oo(wt);if(Mt.length>0)throw new Error(`Route element with path "${k}" may not contain multiple routable extensions`);if(!Ft)return c;const{routeRef:Fn,plugin:nr}=Ft,rr={path:Ct,element:"mounted",routeRefs:new Set([Fn]),caseSensitive:Boolean((tt=n.props)===null||tt===void 0?void 0:tt.caseSensitive),children:[er],plugin:nr};return De.push(rr),i.paths.set(Fn,Ct),i.parents.set(Fn,c==null?void 0:c.routeRef),{obj:rr,routeRef:Fn!=null?Fn:c==null?void 0:c.routeRef,gatherPath:Ct,gatherRouteRef:c==null?void 0:c.gatherRouteRef}}}if(z){var lt;if((c==null?void 0:c.gatherPath)===void 0)throw new Error(`Routable extension "${zr(n)}" with mount point "${z}" must be assigned a path`);return c==null||(lt=c.obj)===null||lt===void 0||lt.routeRefs.add(z),i.paths.set(z,c.gatherPath),i.parents.set(z,c==null?void 0:c.gatherRouteRef),{...c,routeRef:z}}return c}),bo=Se(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,s,c)=>{var f,I,k;if((s==null?void 0:s.props.element)===n)return c;let z=c==null?void 0:c.obj,te=c==null?void 0:c.routeRef,De=c==null?void 0:c.sticky;const Ee=(f=n.props)===null||f===void 0?void 0:f.path;var tt;const lt=(tt=z==null?void 0:z.children)!==null&&tt!==void 0?tt:i.objects,Ct=Boolean((I=n.props)===null||I===void 0?void 0:I.caseSensitive);let wt=c==null?void 0:c.path;if((0,y.IY)(n,"core.gatherMountPoints")){if(!Ee)throw new Error("Mount point gatherer must have a path");wt=Ee}const Ft=(k=n.props)===null||k===void 0?void 0:k.element;let Mt=(0,y.IY)(n,"core.mountPoint");if(!Mt&&(0,F.isValidElement)(Ft)&&(Mt=(0,y.IY)(Ft,"core.mountPoint")),Mt){let rr=Ee;if(wt&&(rr?wt=void 0:rr=wt),!rr)throw new Error("Mounted routable extension must have a path");i.paths.set(Mt,rr),te&&De?(i.parents.set(Mt,te),Ee&&(te=Mt,De=!1)):(i.parents.set(Mt,te),te=Mt),Ee?(z={caseSensitive:Ct,path:Ee,element:"mounted",routeRefs:new Set([Mt]),children:[er],plugin:(0,y.IY)(n.props.element,"core.plugin")},lt.push(z)):z==null||z.routeRefs.add(Mt)}if((0,y.IY)(n,"core.gatherMountPoints")&&(De=!0),(0,y.IY)(n,"core.gatherMountPoints")){if(!Ee)throw new Error("Mount point gatherer must have a path");if(!Mt){var nr;z={caseSensitive:Ct,path:Ee,element:"gathered",routeRefs:new Set,children:[er],plugin:c==null||(nr=c.obj)===null||nr===void 0?void 0:nr.plugin},lt.push(z)}}return{obj:z,path:wt,routeRef:te,sticky:De}}),or=Se(()=>new Set,(i,n)=>{if(n.type===Yn){const s=n.props;i.add("with"in s?s.with:s.without)}}),Rn=(0,Fe.uW)("route-ref-type",()=>Symbol("route-ref-type"));function sr(i){return i[Rn]==="absolute"}function yr(i){return i[Rn]==="sub"}function Tr(i){return i[Rn]==="external"}function Ir(...i){const n=i.join("/").replace(/\/\/+/g,"/");return n!=="/"&&n.endsWith("/")?n.slice(0,-1):n}function Wr(i,n,s){let c,f="";if(sr(i))c=i;else if(yr(i))c=i.parent,f=i.path;else if(Tr(i)){const z=s.get(i);if(!z)return[void 0,""];if(sr(z))c=z;else if(yr(z))c=z.parent,f=z.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${z}`)}else throw i[Rn]?new Error(`Unknown or invalid route ref type, ${i[Rn]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!c)return[void 0,""];const I=n.get(c);if(I===void 0)return[void 0,""];const k=Ir(I,f);return[c,k]}function So(i,n,s,c,f){var I;const k=(I=(0,yn.fp)(f,n))!==null&&I!==void 0?I:[],z=Array();let te=-1;for(let tt=i;tt&&(te=k.findIndex(lt=>lt.route.routeRefs.has(tt)),te===-1);tt=c.get(tt))z.unshift(tt);z.length===0&&(te-=1);const De=te===-1?"":k[te].pathname,Ee=z.slice(0,-1).map(tt=>{const lt=s.get(tt);if(lt===void 0)throw new Error(`No path for ${tt}`);if(lt.includes(":"))throw new Error(`Cannot route to ${i} with parent ${tt} as it has parameters`);return lt});return`${Ir(De,...Ee)}/`}class Xo{resolve(n,s){const[c,f]=Wr(n,this.routePaths,this.routeBindings);if(!c)return;let I;typeof s=="string"?I=this.trimPath(s):s.pathname?I={...s,pathname:this.trimPath(s.pathname)}:I=s;const k=this.appBasePath+So(c,I,this.routePaths,this.routeParents,this.routeObjects);return(...[te])=>Ir(k,(0,yn.Gn)(f,te))}trimPath(n){return n&&(n.startsWith(this.appBasePath)?n.slice(this.appBasePath.length):n)}constructor(n,s,c,f,I){this.routePaths=n,this.routeParents=s,this.routeObjects=c,this.routeBindings=f,this.appBasePath=I}}const Vr=(0,Fe.CT)("routing-context"),tr=({routePaths:i,routeParents:n,routeObjects:s,routeBindings:c,basePath:f="",children:I})=>{const k=new Xo(i,n,s,c,f),z=(0,Fe.EI)({1:k});return(0,r.jsx)(Vr.Provider,{value:z,children:I})};function Rr(i,n){const s=new Set(n.values());s.delete(void 0);for(const c of n.keys()){if(s.has(c))continue;let f=c,I="";for(;f;){const z=i.get(f);if(z===void 0)throw new Error(`No path for ${f}`);I=Ir(z,I),f=n.get(f)}const k=I.match(/:(\w+)/g);if(k){for(let z=0;z<k.length;z++)for(let te=z+1;te<k.length;te++)if(k[te]===k[z])throw new Error(`Parameter ${k[te]} is duplicated in path ${I}`)}}}function Lr(i,n){for(const s of n)if(s.externalRoutes){for(const[c,f]of Object.entries(s.externalRoutes))if(!f.optional&&!i.has(f))throw new Error(`External route '${c}' of the '${s.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const Co=(0,Fe.CT)("app-context"),Hr=({appContext:i,children:n})=>{const s=(0,Fe.EI)({1:i});return(0,r.jsx)(Co.Provider,{value:s,children:n})};function Gr(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function Pr(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class fr{setTarget(n,s){this.target=n,this.signOutTargetUrl=s.signOutTargetUrl,this.resolveTarget(n)}getUserId(){if(!this.target)throw Gr("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Pr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw Gr("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Pr("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(n=>n.getProfileInfo())}async getBackstageIdentity(){const n=await this.waitForTarget.then(s=>s.getBackstageIdentity());return n.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${n.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),n}async getCredentials(){return this.waitForTarget.then(n=>n.getCredentials())}async getIdToken(){return this.waitForTarget.then(n=>{if(!n.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return Pr("getIdToken"),n.getIdToken()})}async signOut(){await this.waitForTarget.then(n=>n.signOut()),window.location.href=this.signOutTargetUrl}constructor(){this.resolveTarget=()=>{},this.signOutTargetUrl="/",this.waitForTarget=new Promise(n=>{this.resolveTarget=n})}}var Kr=t(72164);function wo(i,n,s){if(i!==void 0){const f=s.find(I=>I.id===i);if(f)return f}if(n){const f=s.find(I=>I.variant==="dark");if(f)return f}const c=s.find(f=>f.variant==="light");return c||s[0]}const jo=()=>{const i=(0,F.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[n,s]=(0,F.useState)(i.matches);return(0,F.useEffect)(()=>{const c=f=>{s(f.matches)};return i.addListener(c),()=>{i.removeListener(c)}},[i]),n};function Yr({children:i}){const n=(0,y.h_)(y.hg),s=(0,Kr.Z)(n.activeThemeId$(),n.getActiveThemeId()),c=Boolean(window.matchMedia)?jo():!1,f=wo(s,c,n.getInstalledThemes());if(!f)throw new Error("App has no themes");return(0,r.jsx)(f.Provider,{children:i})}const Eo=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const n=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!n)throw new Error("No static configuration provided");if(!Array.isArray(n))throw new Error("Static configuration has invalid format");const s=n.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const f=JSON.parse(i);Array.isArray(f)?s.push(...f):s.push({data:f,context:"env"})}catch(f){throw new Error(`Failed to load runtime configuration, ${f}`)}const c=window.__APP_CONFIG__;return c&&s.push({context:"window",data:c}),s};class qo{add(n,s){return this.apis.push([n.id,s]),s}build(){return new gr(new Map(this.apis))}constructor(){this.apis=[]}}class gr{static builder(){return new qo}static from(n){return new gr(new Map(n.map(([s,c])=>[s.id,c])))}static with(n,s){return new gr(new Map([[n.id,s]]))}with(n,s){return new gr(new Map([...this.apis,[n.id,s]]))}get(n){return this.apis.get(n.id)}constructor(n){this.apis=n}}function _o(i){const n=new Map;return i&&i({bind:(c,f)=>{for(const[I,k]of Object.entries(f)){const z=c[I];if(!z)throw new Error(`Key ${I} is not an existing external route`);if(!k&&!z.optional)throw new Error(`External route ${I} is required but was undefined`);k&&n.set(z,k)}}}),n}function so(i){const n=new URL(i);return n.protocol=document.location.protocol,n.hostname=document.location.hostname,n.port=document.location.port,n.toString().replace(/\/$/,"")}function Ao(i,n,s){var c;const f=Boolean(i),I=(0,pe.default)(i||(()=>Promise.resolve([])));let k;if(f&&I.loading){const{Progress:De}=n;k=(0,r.jsx)(De,{})}else if(I.error){const{BootErrorPage:De}=n;k=(0,r.jsx)(De,{step:"load-config",error:I.error})}const{ThemeProvider:z=Yr}=n;if(k)return{node:(0,r.jsx)(He,{apis:gr.with(y.hg,s),children:(0,r.jsx)(z,{children:k})})};let te;if(!((c=I.value)===null||c===void 0)&&c.length){const De=de.fromConfigs(I.value),Ee=De.getOptionalString("app.baseUrl"),tt=De.getOptionalString("backend.baseUrl");let lt=I.value;const Ct={data:{},context:"relative-resolver"};if(Ee&&tt){const wt=new URL(Ee).origin,Ft=new URL(tt).origin;if(wt===Ft){const Mt=so(tt);tt!==Mt&&(Ct.data.backend={baseUrl:Mt})}}if(Ee){const wt=so(Ee);Ee!==wt&&(Ct.data.app={baseUrl:wt})}Object.keys(Ct.data).length&&(lt=lt.concat([Ct])),te=de.fromConfigs(lt)}else te=de.fromConfigs([]);return{api:te}}class To{getPlugins(){return this.app.getPlugins()}getSystemIcon(n){return this.app.getSystemIcon(n)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(n){this.app=n}}var kr=new WeakMap;class xr{getPlugins(){return Array.from(this.plugins)}getSystemIcon(n){return this.icons[n]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(n){const s=this.getProvider();return()=>(0,r.jsx)(s,{children:n})}getProvider(){if((0,x.Z)(this,kr))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,Q.Z)(this,kr,!0);const n=new To(this);let s=!1;return({children:f})=>{const I=(0,F.useRef)(!0),k=(0,F.useMemo)(()=>Ke.createWithStorage(this.themes),[]),{routing:z,featureFlags:te,routeBindings:De}=(0,F.useMemo)(()=>{const Ct=we({root:f,discoverers:[dt,Vt],collectors:{routing:cn()?bo:xo,collectedPlugins:dn,featureFlags:or}});return Ct.collectedPlugins.forEach(wt=>this.plugins.add(wt)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...Ct,routeBindings:_o(this.bindRoutes)}},[f]);s||(s=!0,Rr(z.paths,z.parents),Lr(De,this.plugins));const Ee=Ao(this.configLoader,this.components,k),tt="api"in Ee;if(tt){const{api:Ct}=Ee;this.configApi=Ct}if("node"in Ee)return Ee.node;if(tt&&I.current){I.current=!1;const Ct=this.getApiHolder().get(y.W0);if(Ct){for(const Mt of this.featureFlags)Ct.registerFlag({...Mt,pluginId:""});for(const Mt of this.plugins.values())if("getFeatureFlags"in Mt)for(const Fn of Mt.getFeatureFlags())Ct.registerFlag({name:Fn.name,pluginId:Mt.getId()});else for(const Fn of Mt.output())Fn.type==="feature-flag"&&Ct.registerFlag({name:Fn.name,pluginId:Mt.getId()});const wt=Ct.getRegisteredFlags(),Ft=new Set(wt.map(Mt=>Mt.name));for(const Mt of te)Ft.has(Mt)||Ct.registerFlag({name:Mt,pluginId:""})}}const{ThemeProvider:lt=Yr}=this.components;return(0,r.jsx)(He,{apis:this.getApiHolder(),children:(0,r.jsx)(Hr,{appContext:n,children:(0,r.jsx)(lt,{children:(0,r.jsx)(tr,{routePaths:z.paths,routeParents:z.parents,routeObjects:z.objects,routeBindings:De,basePath:Kn(Ee.api),children:(0,r.jsx)(Ut.Provider,{value:{routeObjects:z.objects,appIdentityProxy:this.appIdentityProxy},children:f})})})})})}}getRouter(){return u}getApiHolder(){if(this.apiHolder){for(const n of this.plugins)for(const s of n.getApis())this.apiFactoryRegistry.get(s.api)||this.apiFactoryRegistry.register("default",s);return st.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:y.hg,deps:{},factory:()=>Ke.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 Ue});for(const n of this.defaultApis)this.apiFactoryRegistry.register("default",n);for(const n of this.plugins)for(const s of n.getApis())if(!this.apiFactoryRegistry.register("default",s))throw new Error(`Plugin ${n.getId()} tried to register duplicate or forbidden API factory for ${s.api}`);for(const n of this.apis)if(!this.apiFactoryRegistry.register("app",n))throw new Error(`Duplicate or forbidden API factory for ${n.api} in app`);return st.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new st(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(n){const s=new Set;for(const c of n){const f=c.getId();if(s.has(f))throw new Error(`Duplicate plugin found '${f}'`);s.add(f)}}constructor(n){this.appIdentityProxy=new fr,(0,A.Z)(this,kr,{writable:!0,value:!1});var s;this.apis=(s=n.apis)!==null&&s!==void 0?s:[],this.icons=n.icons;var c;this.plugins=new Set((c=n.plugins)!==null&&c!==void 0?c:[]);var f;this.featureFlags=(f=n.featureFlags)!==null&&f!==void 0?f:[],this.components=n.components,this.themes=n.themes;var I;this.configLoader=(I=n.configLoader)!==null&&I!==void 0?I:Eo;var k;this.defaultApis=(k=n.defaultApis)!==null&&k!==void 0?k:[],this.bindRoutes=n.bindRoutes,this.apiFactoryRegistry=new Et}}function br(i){return new xr(i)}let io=!1;const Io=i=>{const n=(0,y.qD)(),{NotFoundErrorPage:s}=n.getComponents(),c=(0,F.useMemo)(()=>cn(),[]),I=[...(0,y.vJ)(i.children,k=>k.getElements().flatMap(z=>{let te=z.props.path;if(te==="")return[];var De;te=(De=te==null?void 0:te.replace(/\/\*$/,""))!==null&&De!==void 0?De:"/";let Ee=c?z:z.props.element;return!c&&!Ee&&(Ee=z,io||(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] />} />."),io=!0)),[{path:te,element:Ee,children:z.props.children?[{path:te==="/"?"/":"*",element:z.props.children}]:void 0}]}).sort((z,te)=>te.path.localeCompare(z.path)).map(z=>({...z,path:z.path==="/"?"/":`${z.path}/*`}))),{path:"*",element:(0,r.jsx)(s,{})}];return(0,m.V$)(I)},Jr=(0,y.T0)({id:"plugin.permission.api"});var Wn;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(Wn||(Wn={}));function Ro(i,n){return i.name===n.name}function Ln(i,n){return"resourceType"in i?!n||i.resourceType===n:!1}function es(i){return i.attributes.action==="create"}function ts(i){return i.attributes.action==="read"}function ns(i){return i.attributes.action==="update"}function rs(i){return i.attributes.action==="delete"}function os(i){return{authorize:async(n,s)=>await i.authorize(n,s),authorizeConditional(n,s){const c=n;return i.authorize(c,s)}}}function ir({name:i,attributes:n,resourceType:s}){return s?{type:"resource",name:i,attributes:n,resourceType:s}:{type:"basic",name:i,attributes:n}}var Lo=t(23054),ao=t(96279),Or=t.n(ao),ss=t(9571);const Br=ct.z.lazy(()=>ct.z.object({rule:ct.z.string(),resourceType:ct.z.string(),params:ct.z.record(ct.z.any()).optional()}).or(ct.z.object({anyOf:ct.z.array(Br).nonempty()})).or(ct.z.object({allOf:ct.z.array(Br).nonempty()})).or(ct.z.object({not:Br}))),Po=ct.z.object({result:ct.z.literal(Wn.ALLOW).or(ct.z.literal(Wn.DENY))}),S=ct.z.union([ct.z.object({result:ct.z.literal(Wn.ALLOW).or(ct.z.literal(Wn.DENY))}),ct.z.object({result:ct.z.literal(Wn.CONDITIONAL),pluginId:ct.z.string(),resourceType:ct.z.string(),conditions:Br})]),C=(i,n)=>ct.z.object({items:ct.z.array(ct.z.intersection(ct.z.object({id:ct.z.string()}),i)).refine(s=>s.length===n.size&&s.every(({id:c})=>n.has(c)),{message:"Items in response do not match request"})});class O{async authorize(n,s){return this.makeRequest(n,Po,s)}async authorizeConditional(n,s){return this.makeRequest(n,S,s)}async makeRequest(n,s,c){if(!this.enabled)return n.map(Ee=>({result:Wn.ALLOW}));const f={items:n.map(Ee=>({id:ss.Z(),...Ee}))},I=await this.discovery.getBaseUrl("permission"),k=await Or()(`${I}/authorize`,{method:"POST",body:JSON.stringify(f),headers:{...this.getAuthorizationHeader(c==null?void 0:c.token),"content-type":"application/json"}});if(!k.ok)throw await Lo.VL.fromResponse(k);const z=await k.json(),De=C(s,new Set(f.items.map(({id:Ee})=>Ee))).parse(z).items.reduce((Ee,tt)=>(Ee[tt.id]=tt,Ee),{});return f.items.map(Ee=>De[Ee.id])}getAuthorizationHeader(n){return n?{Authorization:`Bearer ${n}`}:{}}constructor(n){this.discovery=n.discovery;var s;this.enabled=(s=n.config.getOptionalBoolean("permission.enabled"))!==null&&s!==void 0?s:!1}}class D{static create(n){const{config:s,discovery:c,identity:f}=n,I=new O({discovery:c,config:s});return new D(I,f)}async authorize(n){return(await this.permissionClient.authorize([n],await this.identityApi.getCredentials()))[0]}constructor(n,s){this.permissionClient=n,this.identityApi=s}}var _=t(69984);function se(i){const n=(0,y.h_)(Jr),{data:s,error:c}=(0,_.ZP)(i,async f=>{if(Ln(f.permission)&&!f.resourceRef)return Wn.DENY;const{result:I}=await n.authorize(f);return I});return c?{error:c,loading:!1,allowed:!1}:s===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:s===Wn.ALLOW}}const ne=i=>{const{permission:n,resourceRef:s,errorComponent:c,...f}=i,I=usePermission(isResourcePermission(n)?{permission:n,resourceRef:s}:{permission:n}),k=useApp(),{NotFoundErrorPage:z}=k.getComponents();let te=c===void 0?_jsx(z,{}):c;return I.loading?te=null:I.allowed&&(te=i.element),_jsx(Route,{...f,element:te})};function ge(i){const{permission:n,resourceRef:s}=i,c=usePermission(isResourcePermission(n)?{permission:n,resourceRef:s}:{permission:n}),f=useApp();if(c.loading)return null;if(c.allowed)return _jsx(_Fragment,{children:i.children});if(i.errorPage)return _jsx(_Fragment,{children:i.errorPage});const{NotFoundErrorPage:I}=f.getComponents();return _jsx(I,{})}const Ce=[(0,y.ni)({api:y.NW,deps:{configApi:y.Ds},factory:({configApi:i})=>R.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,y.ni)({api:y.$v,deps:{},factory:()=>new ce}),(0,y.ni)({api:y.v_,deps:{},factory:()=>new U}),(0,y.ni)({api:y.VE,deps:{alertApi:y.$v},factory:({alertApi:i})=>{const n=new J(i,new K);return ae.forward(n,{hidden:!1}),n}}),(0,y.ni)({api:y.E6,deps:{errorApi:y.VE},factory:({errorApi:i})=>We.create({errorApi:i})}),(0,y.ni)({api:y.gP,deps:{configApi:y.Ds,identityApi:y.$4,discoveryApi:y.NW},factory:({configApi:i,identityApi:n,discoveryApi:s})=>Ye({middleware:[Kt.resolvePluginProtocol({discoveryApi:s}),Kt.injectIdentityAuth({identityApi:n,config:i})]})}),(0,y.ni)({api:y.ZM,deps:{},factory:()=>new Gt}),(0,y.ni)({api:y.Kp,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Tn.create({discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.p_,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>zn.create({discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.F4,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>on.create({discoveryApi:i,oauthRequestApi:n,defaultScopes:["read:user"],environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.D,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>qn.create({discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.ux,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>$t.create({discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.gW,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>oe.create({discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.bq,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Pe.create({discoveryApi:i,oauthRequestApi:n,defaultScopes:["team"],environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.Km,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM},factory:({discoveryApi:i,oauthRequestApi:n})=>ft.create({discoveryApi:i,oauthRequestApi:n,defaultScopes:["REPO_READ"]})}),(0,y.ni)({api:y.uB,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Rt.create({discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:Jr,deps:{discovery:y.NW,identity:y.$4,config:y.Ds},factory:({config:i,discovery:n,identity:s})=>D.create({config:i,discovery:n,identity:s})})];var Ie=t(77277),me=t(23196),ke=t(39857);function nt({children:i}){return(0,m.GV)()?(0,r.jsx)(r.Fragment,{children:i}):(0,r.jsx)(m.VA,{children:i})}const Je=()=>(0,r.jsx)(me.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),ot=({step:i,error:n})=>{let s="";return i==="load-config"?s=`The configuration failed to load, someone should have a look at this error: ${n.message}`:i==="load-chunk"&&(s=`Lazy loaded chunk failed to load, try to reload the page: ${n.message}`),(0,r.jsx)(nt,{children:(0,r.jsx)(me.mf,{status:"501",statusMessage:s})})},$e=({error:i,resetError:n,plugin:s})=>(0,r.jsx)(me.yu,{title:`Error in ${s==null?void 0:s.getId()}`,defaultExpanded:!0,error:i,children:(0,r.jsx)(Ie.Z,{variant:"outlined",onClick:n,children:"Retry"})}),xt={Progress:me.Ex,Router:ke.VK,NotFoundErrorPage:Je,BootErrorPage:ot,ErrorBoundaryFallback:$e};var Nt=t(43642),fn=t(80079),qt=t(90941),Pn=t(32915),gn=t(40562),En=t(21853),An=t(60744),mr=t(66569),$r=t(30254),lo=t(13384),kn=t(15933),Dn=t(58838),Sr=t(86737),Rs=t(4989),Ls=t(44407),Oi=t(18628),is=t(84219),Ps=t(98685),Zr=t(39781);const Bi={brokenImage:fn.Z,catalog:Oi.Z,scaffolder:Pn.Z,techdocs:gn.Z,search:En.Z,chat:An.Z,dashboard:mr.Z,docs:$r.Z,email:lo.Z,github:Dn.Z,group:is.Z,help:Sr.Z,"kind:api":kn.Z,"kind:component":Ls.Z,"kind:domain":Nt.Z,"kind:group":is.Z,"kind:location":Rs.Z,"kind:system":qt.Z,"kind:user":Ps.Z,user:Ps.Z,warning:Zr.Z};var $i=t(73689),ks=t(48032);const ar={wave:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='1368' height='401' x='0' y='0' maskUnits='userSpaceOnUse'%3e%3cpath fill='url(%23paint0_linear)' d='M437 116C223 116 112 0 112 0h1256v400c-82 0-225-21-282-109-112-175-436-175-649-175z'/%3e%3cpath fill='url(%23paint1_linear)' d='M1368 400V282C891-29 788 40 711 161 608 324 121 372 0 361v39h1368z'/%3e%3cpath fill='url(%23paint2_linear)' d='M1368 244v156H0V94c92-24 198-46 375 0l135 41c176 51 195 109 858 109z'/%3e%3cpath fill='url(%23paint3_linear)' d='M1252 400h116c-14-7-35-14-116-16-663-14-837-128-1013-258l-85-61C98 28 46 8 0 0v400h1252z'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M-172-98h1671v601H-172z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='602' x2='1093.5' y1='-960.5' y2='272' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='482' x2='480' y1='1058.5' y2='70.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='424' x2='446.1' y1='-587.5' y2='274.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint3_linear' x1='587' x2='349' y1='-1120.5' y2='341' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`,wave2:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='1764' height='479' x='-229' y='-6' maskUnits='userSpaceOnUse'%3e%3cpath fill='url(%23paint0_linear)' d='M0 400h1350C1321 336 525 33 179-2c-345-34-395 236-408 402H0z'/%3e%3cpath fill='url(%23paint1_linear)' d='M1378 177v223H0V217s219 75 327 52C436 246 717-35 965 45s254 144 413 132z'/%3e%3cpath fill='url(%23paint2_linear)' d='M26 400l-78-16c-170 205-44-6-137-30l-4-1 4 1 137 30c37-45 89-110 159-201 399-514-45 238 1176-50 275-65 354-39 91 267H26z'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M0 0h1368v400H0z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='431' x2='397.3' y1='-599' y2='372.8' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='236.5' x2='446.6' y1='-586' y2='381.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='851.8' x2='640.4' y1='-867.2' y2='363.7' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`,round:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='2269' height='1408' x='-610' y='-509' maskUnits='userSpaceOnUse'%3e%3ccircle cx='1212.8' cy='74.8' r='317.5' fill='url(%23paint0_linear)' transform='rotate(-52 1213 75)'/%3e%3ccircle cx='737.8' cy='445.8' r='317.5' fill='url(%23paint1_linear)' transform='rotate(-116 738 446)'/%3e%3ccircle cx='601.8' cy='52.8' r='418.6' fill='url(%23paint2_linear)' transform='rotate(-117 602 53)'/%3e%3ccircle cx='999.8' cy='364' r='389.1' fill='url(%23paint3_linear)' transform='rotate(31 1000 364)'/%3e%3cellipse cx='-109.2' cy='263.5' fill='url(%23paint4_linear)' rx='429.2' ry='465.8' transform='rotate(-85 -109 264)'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M0 0h1368v400H0z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='1301.2' x2='161.4' y1='-1879.7' y2='-969.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='826.2' x2='-313.6' y1='-1508.7' y2='-598.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='718.4' x2='-784.3' y1='-2524' y2='-1324.2' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint3_linear' x1='1108.2' x2='-288.6' y1='-2031.1' y2='-915.9' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint4_linear' x1='10.4' x2='-1626.5' y1='-2603.8' y2='-1399.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`},lr={darkGrey:["#171717","#383838"],marineBlue:["#006D8F","#0049A1"],veryBlue:["#0027AF","#270094"],rubyRed:["#98002B","#8D1134"],toastyOrange:["#BE2200","#A41D00"],purpleSky:["#8912CA","#3E00EA"],eveningSea:["#00FFF2","#035355"],teal:["#005B4B"],pinkSea:["#C8077A","#C2297D"],greens:["#4BB8A5","#187656"]};function cr(i){const{colors:n,shape:s,options:c}=i,I=`linear-gradient(90deg, ${(n.length===1?[n[0],n[0]]:n).join(", ")})`,k=`${s}, ${I}`;var z;const te=(z=c==null?void 0:c.fontColor)!==null&&z!==void 0?z:"#FFFFFF";return{colors:n,shape:s,backgroundImage:k,fontColor:te}}const as={home:cr({colors:lr.teal,shape:ar.wave}),documentation:cr({colors:lr.pinkSea,shape:ar.wave2}),tool:cr({colors:lr.purpleSky,shape:ar.round}),service:cr({colors:lr.marineBlue,shape:ar.wave}),website:cr({colors:lr.veryBlue,shape:ar.wave}),library:cr({colors:lr.rubyRed,shape:ar.wave}),other:cr({colors:lr.darkGrey,shape:ar.wave}),app:cr({colors:lr.toastyOrange,shape:ar.wave}),apis:cr({colors:lr.teal,shape:ar.wave2}),card:cr({colors:lr.greens,shape:ar.wave})},ls=16,Os='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function Bs(i){const{palette:n,htmlFontSize:s=ls,fontFamily:c=Os,defaultPageTheme:f,pageTheme:I=as}=i;if(!I[f])throw new Error(`${f} is not defined in pageTheme.`);var k;return{palette:n,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:s,fontFamily:c,h6:{fontWeight:700,fontSize:20,marginBottom:2},h5:{fontWeight:700,fontSize:24,marginBottom:4},h4:{fontWeight:700,fontSize:28,marginBottom:6},h3:{fontSize:32,fontWeight:700,marginBottom:6},h2:{fontSize:40,fontWeight:700,marginBottom:8},h1:{fontSize:54,fontWeight:700,marginBottom:10}},page:I[f],getPageTheme:({themeId:z})=>(k=I[z])!==null&&k!==void 0?k:I[f]}}function $s(i){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:i.spacing(1.5,2,1.5,2.5)},head:{wordBreak:"break-word",overflow:"hidden",color:i.palette.textSubtle,fontWeight:"normal",lineHeight:"1"}},MuiTabs:{root:{minHeight:24}},MuiTab:{root:{color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,ks.darken)(i.palette.link,.3),background:(0,ks.lighten)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:i.palette.link}},MuiTableSortLabel:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"}},active:{fontWeight:"bold",color:"inherit"}},MuiListItemText:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},MuiButton:{text:{padding:void 0}},MuiChip:{root:{backgroundColor:"#D9D9D9",marginRight:i.spacing(1),marginBottom:i.spacing(1),color:i.palette.grey[900]},outlined:{color:i.palette.text.primary},label:{lineHeight:`${i.spacing(2.5)}px`,fontWeight:i.typography.fontWeightMedium,fontSize:`${i.spacing(1.75)}px`},labelSmall:{fontSize:`${i.spacing(1.5)}px`},deleteIcon:{color:i.palette.grey[500],width:`${i.spacing(3)}px`,height:`${i.spacing(3)}px`,margin:`0 ${i.spacing(.75)}px 0 -${i.spacing(.75)}px`},deleteIconSmall:{width:`${i.spacing(2)}px`,height:`${i.spacing(2)}px`,margin:`0 ${i.spacing(.5)}px 0 -${i.spacing(.5)}px`}},MuiCard:{root:{display:"flex",flexDirection:"column"}},MuiCardHeader:{root:{paddingBottom:0}},MuiCardContent:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}},MuiCardActions:{root:{justifyContent:"flex-end"}}}}function cs(i){const n=Bs(i),s=(0,$i.Z)(n),c=$s(s);return{...s,overrides:c}}var ds=t(34505);const Zs=cs({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:ds.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:as}),Zi=cs({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:ds.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:as});var Di=t(98192),us=t(15222),Ds=t(41547),ko=t(87561);const Ns=[{id:"light",title:"Light Theme",variant:"light",icon:(0,r.jsx)(us.Z,{}),Provider:({children:i})=>(0,r.jsx)(Ds.Z,{theme:Zs,children:(0,r.jsx)(ko.ZP,{children:i})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,r.jsx)(Di.Z,{}),Provider:({children:i})=>(0,r.jsx)(Ds.Z,{theme:Zi,children:(0,r.jsx)(ko.ZP,{children:i})})}];function hs(i){var n,s,c,f;return br({...i,apis:(n=i==null?void 0:i.apis)!==null&&n!==void 0?n:[],bindRoutes:i==null?void 0:i.bindRoutes,components:{...xt,...i==null?void 0:i.components},configLoader:i==null?void 0:i.configLoader,defaultApis:Ce,icons:{...Bi,...i==null?void 0:i.icons},plugins:(s=i==null?void 0:i.plugins)!==null&&s!==void 0?s:[],featureFlags:(c=i==null?void 0:i.featureFlags)!==null&&c!==void 0?c:[],themes:(f=i==null?void 0:i.themes)!==null&&f!==void 0?f:Ns})}var Qr=t(25271),ps=t(76635);async function Fs({storageApi:i}){const n=i.forBucket("settings"),s=i.forBucket("starredEntities"),c=n.snapshot("starredEntities").value;if(!(0,ps.isArray)(c))return;var f;const I=new Set((f=s.snapshot("entityRefs").value)!==null&&f!==void 0?f:[]);c.filter(ps.isString).map(k=>k.split(":")).filter(k=>k.length===4&&k[0]==="entity").map(([k,z,te,De])=>(0,Qr.eE)({kind:z,namespace:te,name:De})).forEach(k=>I.add(k)),await s.set("entityRefs",Array.from(I)),await n.remove("starredEntities")}class Oo{async toggleStarred(n){this.starredEntities.has(n)?this.starredEntities.delete(n):this.starredEntities.add(n),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const n of this.subscribers)n.next(new Set(this.starredEntities))}constructor(n){this.subscribers=new Set,this.observable=new(xe())(c=>(c.next(new Set(this.starredEntities)),this.subscribers.add(c),()=>{this.subscribers.delete(c)})),Fs(n).then(),this.settingsStore=n.storageApi.forBucket("starredEntities");var s;this.starredEntities=new Set((s=this.settingsStore.snapshot("entityRefs").value)!==null&&s!==void 0?s:[]),this.settingsStore.observe$("entityRefs").subscribe({next:c=>{var f;this.starredEntities=new Set((f=c.value)!==null&&f!==void 0?f:[]),this.notifyChanges()}})}}var Ni=t(33414),Dr=t(79692),Us=t(12420),Vn=t(40303),Fi=t(19928);function Ui(){const i=useApi(catalogApiRef),{error:n,loading:s,value:c}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(I=>{var k;return((k=I.facets.kind)===null||k===void 0?void 0:k.map(z=>z.value).sort())||[]}),[i]);return{loading:s,error:n,allKinds:c!=null?c:[]}}function Ms(i,n,s){let c=i;return n&&(c=c.filter(I=>n.some(k=>k.toLocaleLowerCase("en-US")===I.toLocaleLowerCase("en-US")))),s&&!i.some(I=>I.toLocaleLowerCase("en-US")===s.toLocaleLowerCase("en-US"))&&(c=c.concat([s])),c.sort().reduce((I,k)=>(I[k.toLocaleLowerCase("en-US")]=k,I),{})}const zs=(0,Dr.Z)(i=>(0,Us.Z)({root:{...i.typography.h4}}));function Ws(i){var n;const{initialFilter:s="component",allowedKinds:c}=i,f=zs(),{allKinds:I}=useAllKinds(),{filters:k,updateFilters:z,queryParameters:{kind:te}}=useEntityList(),De=useMemo(()=>[te].flat()[0],[te]);var Ee;const[tt,lt]=useState((Ee=De!=null?De:(n=k.kind)===null||n===void 0?void 0:n.value)!==null&&Ee!==void 0?Ee:s);useEffect(()=>{De&<(De)},[De]),useEffect(()=>{var wt;if(!((wt=k.kind)===null||wt===void 0)&&wt.value){var Ft;lt((Ft=k.kind)===null||Ft===void 0?void 0:Ft.value)}},[k.kind]),useEffect(()=>{z({kind:tt?new EntityKindFilter(tt):void 0})},[tt,z]);const Ct=filterKinds(I,c,tt);return _jsx(Select,{input:_jsx(InputBase,{}),value:tt.toLocaleLowerCase("en-US"),onChange:wt=>lt(wt.target.value),classes:f,children:Object.keys(Ct).map(wt=>_jsx(MenuItem,{value:wt,children:`${pluralize(Ct[wt])}`},wt))})}var Mi=t(86359),co=t(95544),fs=t(99688),uo=t(12231),Bo=t(86136),ho=t(49378),gs=t(85256),ms=t(80030),Jn=t(61837),zi=t(79784),Wi=t(50758),Vi=t(31654),Hi=t(43054),Gi=t(65759),Pa=t(49280),Ki=t(96641);function Yi(i){const{entity:n,loading:s,error:c}=(0,Ki.ce)(),{allowed:f,loading:I,error:k}=se({permission:i,resourceRef:n?(0,Qr.eE)(n):void 0});return s||I?{loading:!0,allowed:!1}:c?{loading:!1,allowed:!1,error:c}:{loading:!1,allowed:f,error:k}}const Nr="catalog-entity",Ji=ir({name:"catalog.entity.read",attributes:{action:"read"},resourceType:Nr}),Qi=ir({name:"catalog.entity.create",attributes:{action:"create"}}),vs=ir({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:Nr}),Vs=ir({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:Nr}),$o=ir({name:"catalog.location.read",attributes:{action:"read"}}),Hs=ir({name:"catalog.location.create",attributes:{action:"create"}}),Gs=ir({name:"catalog.location.delete",attributes:{action:"delete"}}),Xi=[Ji,Qi,vs,Vs,$o,Hs,Gs];var Zo=t(49166);function Do(i){const{unregisterEntityOptions:n,isUnregisterAllowed:s,onUnregisterEntity:c,onClose:f}=i,I=typeof(n==null?void 0:n.disableUnregister)=="boolean";var k;const z=(k=!s||(I?!!(n!=null&&n.disableUnregister):(n==null?void 0:n.disableUnregister)==="disable"))!==null&&k!==void 0?k:!1;let te=(0,r.jsx)(r.Fragment,{});return(n==null?void 0:n.disableUnregister)!=="hidden"&&(te=(0,r.jsxs)(uo.Z,{onClick:()=>{f(),c()},disabled:z,children:[(0,r.jsx)(Bo.Z,{children:(0,r.jsx)(Zo.Z,{fontSize:"small"})}),(0,r.jsx)(ho.Z,{primary:"Unregister entity"})]})),(0,r.jsx)(r.Fragment,{children:te})}const po=(0,Dr.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function ys(i){const{UNSTABLE_extraContextMenuItems:n,UNSTABLE_contextMenuOptions:s,onUnregisterEntity:c,onInspectEntity:f}=i,[I,k]=(0,F.useState)(),z=po(),De=Yi(vs).allowed,Ee=Ft=>{k(Ft.currentTarget)},tt=()=>{k(void 0)},lt=(0,y.h_)(y.$v),Ct=(0,F.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>lt.post({message:"Copied!",severity:"info"}))},[lt]),wt=n&&[...n.map(Ft=>(0,r.jsxs)(uo.Z,{onClick:()=>{tt(),Ft.onClick()},children:[(0,r.jsx)(Bo.Z,{children:(0,r.jsx)(Ft.Icon,{fontSize:"small"})}),(0,r.jsx)(ho.Z,{primary:Ft.title})]},Ft.title)),(0,r.jsx)(gs.Z,{},"the divider is here!")];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ms.ZP,{title:"More",arrow:!0,children:(0,r.jsx)(Jn.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!I,role:"button",onClick:Ee,"data-testid":"menu-button",className:z.button,id:"long-menu",children:(0,r.jsx)(Hi.Z,{})})}),(0,r.jsx)(zi.ZP,{open:Boolean(I),onClose:tt,anchorEl:I,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,r.jsxs)(Wi.Z,{children:[wt,(0,r.jsx)(Do,{unregisterEntityOptions:s,isUnregisterAllowed:De,onUnregisterEntity:c,onClose:tt}),(0,r.jsxs)(uo.Z,{onClick:()=>{tt(),f()},children:[(0,r.jsx)(Bo.Z,{children:(0,r.jsx)(Vi.Z,{fontSize:"small"})}),(0,r.jsx)(ho.Z,{primary:"Inspect entity"})]}),(0,r.jsxs)(uo.Z,{onClick:()=>{tt(),Ct()},children:[(0,r.jsx)(Bo.Z,{children:(0,r.jsx)(Gi.Z,{fontSize:"small"})}),(0,r.jsx)(ho.Z,{primary:"Copy entity URL"})]})]})})]})}const No="plugin.catalog.entityLayoutRoute",_n=()=>null;(0,y.R5)(_n,No,!0),(0,y.R5)(_n,"core.gatherMountPoints",!0);function Ks(i){const{entity:n,title:s}=i;return(0,r.jsxs)(co.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,r.jsx)(co.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:s}),n&&(0,r.jsx)(Vn.LH,{entity:n})]})}function xs(i,n,s,c){var f;const I=(f=i!=null?i:c==null?void 0:c.kind)!==null&&f!==void 0?f:"";var k;const z=(k=n!=null?n:c==null?void 0:c.metadata.namespace)!==null&&k!==void 0?k:"";var te,De,Ee;return{headerTitle:`${(Ee=(De=(te=c==null?void 0:c.metadata.title)!==null&&te!==void 0?te:s)!==null&&De!==void 0?De:c==null?void 0:c.metadata.name)!==null&&Ee!==void 0?Ee:""}${z&&z!==Qr.zG?` in ${z}`:""}`,headerType:(()=>{let lt=I.toLocaleLowerCase("en-US");return c&&c.spec&&"type"in c.spec&&(lt+=" \u2014 ",lt+=c.spec.type.toLocaleLowerCase("en-US")),lt})()}}function Ys(i){var n;const{entity:s}=i,c=(0,Vn.hF)(s,Qr.S4);return(0,r.jsxs)(r.Fragment,{children:[c.length>0&&(0,r.jsx)(me.i9,{label:"Owner",value:(0,r.jsx)(Vn.rI,{entityRefs:c,defaultKind:"Group",color:"inherit"})}),((n=s.spec)===null||n===void 0?void 0:n.lifecycle)&&(0,r.jsx)(me.i9,{label:"Lifecycle",value:s.spec.lifecycle})]})}const qi=i=>{var n,s;const{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,children:I,NotFoundComponent:k}=i,{kind:z,namespace:te,name:De}=(0,y.Oi)(Vn.wi),{entity:Ee,loading:tt,error:lt}=(0,Vn.ce)(),Ct=(0,m.TH)(),wt=(0,y.vJ)(I,ji=>ji.selectByComponentData({key:No,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Fr})=>{if(Ee){if(Fr.if&&!Fr.if(Ee))return[]}else return[];return[{path:Fr.path,title:Fr.title,children:Fr.children,tabProps:Fr.tabProps}]}),[Ee]),{headerTitle:Ft,headerType:Mt}=xs(z,te,De,Ee),[Fn,nr]=(0,F.useState)(!1),[rr,go]=(0,F.useState)(!1),js=(0,m.s0)(),Ko=async()=>{nr(!1),go(!1),js("/")};(0,F.useEffect)(()=>{nr(!1),go(!1)},[Ct.pathname]);var mo;return(0,r.jsxs)(me.T3,{themeId:(mo=Ee==null||(n=Ee.spec)===null||n===void 0||(s=n.type)===null||s===void 0?void 0:s.toString())!==null&&mo!==void 0?mo:"home",children:[(0,r.jsx)(me.h4,{title:(0,r.jsx)(Ks,{title:Ft,entity:Ee}),pageTitleOverride:Ft,type:Mt,children:Ee&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ys,{entity:Ee}),(0,r.jsx)(ys,{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,onUnregisterEntity:()=>nr(!0),onInspectEntity:()=>go(!0)})]})}),tt&&(0,r.jsx)(me.Ex,{}),Ee&&(0,r.jsx)(me.tn,{routes:wt}),lt&&(0,r.jsx)(me.VY,{children:(0,r.jsx)(fs.Z,{severity:"error",children:lt.toString()})}),!tt&&!lt&&!Ee&&(0,r.jsx)(me.VY,{children:k||(0,r.jsxs)(me.GB,{title:"Entity not found",children:["There is no ",z," with the requested"," ",(0,r.jsx)(me.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,r.jsx)(Vn.pp,{open:Fn,entity:Ee,onConfirm:Ko,onClose:()=>nr(!1)}),(0,r.jsx)(Vn.U_,{open:rr,entity:Ee,onClose:()=>go(!1)})]})};qi.Route=_n;function dr(i){const{open:n,onClose:s,onConfirm:c,entity:f}=i,[I,k]=useState(!1),z=useApi(catalogApiRef),te=useApi(alertApiRef),De=async()=>{k(!0);try{const Ee=f.metadata.uid;await z.removeEntityByUid(Ee),c()}catch(Ee){assertError(Ee),te.post({message:Ee.message})}finally{k(!1)}};return _jsxs(Dialog,{open:n,onClose:s,children:[_jsx(DialogTitle,{id:"responsive-dialog-title",children:"Are you sure you want to delete this entity?"}),_jsxs(DialogActions,{children:[_jsx(Button,{variant:"contained",color:"secondary",disabled:I,onClick:De,children:"Delete"}),_jsx(Button,{onClick:s,color:"primary",children:"Cancel"})]})]})}var Xr=t(19625);function _i(i){var n,s;return(i==null||(n=i.metadata)===null||n===void 0||(s=n.annotations)===null||s===void 0?void 0:s["backstage.io/orphan"])==="true"}function ea(){const i=useNavigate(),n=useRouteRef(rootRouteRef),[s,c]=useState(!1),{entity:f}=useEntity(),I=async()=>{c(!1),i(n())};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:s,entity:f,onConfirm:I,onClose:()=>c(!1)})]})}var Js=t(4791);const Qs=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function qr(i,n){return{items:(await n.getEntityAncestors({entityRef:i})).items.map(f=>{var I,k;return{errors:((k=(I=f.entity.status)===null||I===void 0?void 0:I.items)!==null&&k!==void 0?k:[]).filter(Qs).map(De=>De.error).filter(De=>Boolean(De)),entity:f.entity}}).filter(f=>f.errors.length>0)}}async function Xs(i,n){const s=n.apis.get(catalogApiRef);if(!s)throw new Error(`No implementation available for ${catalogApiRef}`);return(await qr(stringifyEntityRef(i),s)).items.length>0}function _s(){const{entity:i}=useEntity(),n=stringifyEntityRef(i),s=useApi(catalogApiRef),{loading:c,error:f,value:I}=useAsync(async()=>qr(n,s),[n,s]);return f?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:f})}):c||!I?null:_jsx(_Fragment,{children:I.items.map((k,z)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(k.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:k.entity})]}),k.errors.map((te,De)=>_jsx(ResponseErrorPanel,{error:te},De))]},z))})}const Fo="core.backstage.entitySwitch",Uo=i=>null;(0,y.R5)(Uo,Fo,!0);const Mo=i=>{var n;const{entity:s,loading:c}=(0,Vn.ce)(),f=(0,y.I_)(),I=(0,y.vJ)(i.children,te=>te.selectByComponentData({key:Fo,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(De=>{if(c)return[];const{if:Ee,children:tt}=De.props;if(!s)return[{if:Ee===void 0,children:tt}];var lt;return[{if:(lt=Ee==null?void 0:Ee(s,{apis:f}))!==null&<!==void 0?lt:!0,children:tt}]}),[f,s,c]);if(I.some(te=>typeof te.if=="object"&&"then"in te.if))return(0,r.jsx)(ei,{results:I});var z;return(z=(n=I.find(te=>te.if))===null||n===void 0?void 0:n.children)!==null&&z!==void 0?z:null};function ei({results:i}){const{loading:n,value:s}=(0,pe.default)(async()=>{const c=i.map(async({if:I,children:k})=>{try{if(await I)return k}catch{}return null});var f;return(f=(await Promise.all(c)).find(Boolean))!==null&&f!==void 0?f:null},[i]);return n||!s?null:s}Mo.Case=Uo;const ti=null,ni=Vn._i.Filters,ri=Vn._i.Content;var ta=t(85877),_r=t(15096);const Nn=(0,y.rx)({id:"catalog",apis:[(0,y.ni)({api:Vn.Ah,deps:{discoveryApi:y.NW,fetchApi:y.gP},factory:({discoveryApi:i,fetchApi:n})=>new Js.MS({discoveryApi:i,fetchApi:n})}),(0,y.ni)({api:Vn.p3,deps:{storageApi:y.E6},factory:({storageApi:i})=>new Oo({storageApi:i})})],routes:{catalogIndex:Xr._Z,catalogEntity:Vn.wi},externalRoutes:{createComponent:Xr.yw,viewTechDoc:Xr.jU},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),na=Nn.provide((0,y.P4)({name:"CatalogIndexPage",component:()=>t.e(9323).then(t.bind(t,89323)).then(i=>i.CatalogPage),mountPoint:Xr._Z})),bs=Nn.provide((0,y.P4)({name:"CatalogEntityPage",component:()=>t.e(8951).then(t.bind(t,78951)).then(i=>i.CatalogEntityPage),mountPoint:Vn.wi})),oi=Nn.provide((0,y.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,33414)).then(i=>i.AboutCard)}})),ra=Nn.provide((0,y.CO)({name:"EntityLinksCard",component:{lazy:()=>t.e(7750).then(t.bind(t,17750)).then(i=>i.EntityLinksCard)}})),oa=Nn.provide((0,y.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,85877)).then(i=>i.EntityLabelsCard)}})),sa=Nn.provide((0,y.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>t.e(5458).then(t.bind(t,5458)).then(i=>i.HasSystemsCard)}})),si=Nn.provide((0,y.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>t.e(1105).then(t.bind(t,1105)).then(i=>i.HasComponentsCard)}})),ia=Nn.provide((0,y.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>t.e(2440).then(t.bind(t,82440)).then(i=>i.HasSubcomponentsCard)}})),zo=Nn.provide((0,y.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>t.e(9770).then(t.bind(t,79770)).then(i=>i.HasResourcesCard)}})),ii=Nn.provide((0,y.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>t.e(9545).then(t.bind(t,19545)).then(i=>i.DependsOnComponentsCard)}})),aa=Nn.provide((0,y.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>t.e(184).then(t.bind(t,40184)).then(i=>i.DependencyOfComponentsCard)}})),ai=Nn.provide((0,y.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>t.e(1032).then(t.bind(t,81032)).then(i=>i.DependsOnResourcesCard)}})),la=Nn.provide((0,y.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>t.e(732).then(t.bind(t,732)).then(i=>i.RelatedEntitiesCard)}})),li=Nn.provide((0,_r.E5)({name:"CatalogSearchResultListItem",component:()=>t.e(7670).then(t.bind(t,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var Wo=t(32838);class Hn{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(n,s){const f=`${await this.getApiOrigin()}/${s}`,I=await fetch(`${f.endsWith("/")?f:`${f}/`}index.html`);if(I.status===404)throw new Error("Page not found");return I.text()}async syncEntityDocs(n){return"cached"}async getBaseUrl(n,s,c){const f=await this.getApiOrigin();return new URL(n,`${f}/${c}`).toString()}constructor({configApi:n,discoveryApi:s,identityApi:c}){this.configApi=n,this.discoveryApi=s,this.identityApi=c}}class ci{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(n){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(n){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:n,discoveryApi:s,identityApi:c}){this.configApi=n,this.discoveryApi=s,this.identityApi=c}}const di=[(0,y.ni)({api:Re.Dl,deps:{configApi:y.Ds,discoveryApi:y.NW,identityApi:y.$4},factory:({configApi:i,discoveryApi:n,identityApi:s})=>new Hn({configApi:i,discoveryApi:n,identityApi:s})}),(0,y.ni)({api:Re.gT,deps:{configApi:y.Ds,discoveryApi:y.NW,identityApi:y.$4},factory:({configApi:i,discoveryApi:n,identityApi:s})=>new ci({configApi:i,discoveryApi:n,identityApi:s})}),(0,y.ni)({api:Wo.q3,deps:{configApi:y.Ds},factory:({configApi:i})=>Wo.ae.fromConfig(i)})],ui={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},Ss={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function hi(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function ca(){const i=await Eo(),n=await hi();return[...i,{context:"detected",data:n?ui:Ss}]}var Vo=t(58845);const pi=(0,Dr.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var fi=()=>{const i=pi();return(0,r.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,r.jsx)("path",{className:i.path,d:"M302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Zm241-88.84q7.94,0,17.09.17t18.12,1a139.3,139.3,0,0,1,16.74,2.57,42.78,42.78,0,0,1,13.3,5.14,64.27,64.27,0,0,1,20.54,19.89Q662,168,662,186.54q0,19.54-9.49,33.78t-27.1,21.09v.68q22.78,4.82,34.87,20.58t12.08,38.4a72.62,72.62,0,0,1-4.83,26.06,65.29,65.29,0,0,1-14.33,22.46,71.57,71.57,0,0,1-23.47,15.78q-14,6-32.28,6H478.38V126.54Zm9,105.27q28,0,40.21-9.78t12.26-29.31q0-13-4.14-20.58a29.47,29.47,0,0,0-11.4-11.66A45,45,0,0,0,597,155.17a161.2,161.2,0,0,0-20.19-1.2h-65.6v77.84Zm16.57,112.13q21.74,0,34-11.66T639.59,300q0-12-4.48-19.88a34.85,34.85,0,0,0-11.91-12.52,50.14,50.14,0,0,0-17.09-6.52,105,105,0,0,0-20-1.88H511.17v84.7Zm274.79,26.74q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58A41.19,41.19,0,0,1,705,348.56q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.08-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7T736.6,249.29H707.26q.69-16.46,6.9-27.77a52.21,52.21,0,0,1,16.57-18.35,70,70,0,0,1,23.65-10.11A125.51,125.51,0,0,1,782.86,190a168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7A41.23,41.23,0,0,1,844,213.59q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-18,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.5,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14ZM1002.07,225q-11.05-9.25-29.69-9.26-15.89,0-26.58,5.83A47.29,47.29,0,0,0,928.71,237a64.66,64.66,0,0,0-9.15,22.12A119.83,119.83,0,0,0,916.8,285a98.22,98.22,0,0,0,2.93,24,64.18,64.18,0,0,0,9.15,20.74,46.2,46.2,0,0,0,16.23,14.58q10,5.49,23.82,5.48,21.75,0,34-11.31t15-31.89h30q-4.83,32.91-24.68,50.75t-54,17.83q-20.37,0-36.07-6.52A69.86,69.86,0,0,1,907,350.11a79.92,79.92,0,0,1-15.88-28.63A118.64,118.64,0,0,1,885.73,285a129.41,129.41,0,0,1,5.18-37.21,85.63,85.63,0,0,1,15.71-30.17A73.46,73.46,0,0,1,933,197.35Q948.91,190,970,190a108.54,108.54,0,0,1,28.48,3.6,69.59,69.59,0,0,1,23.48,11.15,61,61,0,0,1,16.74,19q6.55,11.49,8.29,27.26h-30.38Q1013.11,234.21,1002.07,225Zm109.77-98.41v145l81.47-77.49h39.36l-70.77,64.46,75.95,112.82h-37.29l-61.1-92.59-27.62,25.38v67.21H1082.5V126.54Zm170.54,205.22a31.07,31.07,0,0,0,10.87,10.63,49,49,0,0,0,15.19,5.66,87.06,87.06,0,0,0,17.44,1.71,109.18,109.18,0,0,0,14.5-1,53.22,53.22,0,0,0,14-3.78,26.27,26.27,0,0,0,10.53-8q4.14-5.32,4.14-13.55,0-11.31-8.63-17.14a73.69,73.69,0,0,0-21.58-9.43q-12.94-3.6-28.13-6.52a146,146,0,0,1-28.14-8.23A58.16,58.16,0,0,1,1261,267.13q-8.64-9.6-8.63-26.75,0-13.38,6-23a49.26,49.26,0,0,1,15.53-15.61,71.76,71.76,0,0,1,21.4-8.91A99.41,99.41,0,0,1,1319,190a141.31,141.31,0,0,1,28,2.58,64.85,64.85,0,0,1,22.62,8.91,46.16,46.16,0,0,1,15.7,17.15q5.87,10.8,6.91,26.91h-29.35q-.69-8.57-4.48-14.23a29.36,29.36,0,0,0-9.67-9.08,44.16,44.16,0,0,0-12.94-5,67.68,67.68,0,0,0-14.33-1.54,87.29,87.29,0,0,0-13.29,1,45.28,45.28,0,0,0-12.26,3.6,24.49,24.49,0,0,0-9,6.86q-3.46,4.29-3.46,11.14a16.32,16.32,0,0,0,5.36,12.52,42.75,42.75,0,0,0,13.63,8.23,120,120,0,0,0,18.64,5.48q10.37,2.24,20.72,4.63,11,2.4,21.57,5.83A70.74,70.74,0,0,1,1382,284.1a44.55,44.55,0,0,1,13.12,14.23q5,8.58,5,21.26,0,16.13-6.73,26.75a52.5,52.5,0,0,1-17.61,17.14,73.89,73.89,0,0,1-24.51,9.09,146.3,146.3,0,0,1-27.1,2.57,126.24,126.24,0,0,1-28.31-3.09A69.56,69.56,0,0,1,1272,361.94a51.74,51.74,0,0,1-16.57-18.52q-6.21-11.49-6.9-27.95h29.34A32.65,32.65,0,0,0,1282.38,331.76Zm226.46-137.67v25.72h-35.56V329.88a31.37,31.37,0,0,0,.87,8.23,8.42,8.42,0,0,0,3.28,4.8,14.61,14.61,0,0,0,6.73,2.23,99.19,99.19,0,0,0,11.22.51h13.46v25.72H1486.4a105.8,105.8,0,0,1-19.5-1.55,28.65,28.65,0,0,1-13.12-5.65,24.09,24.09,0,0,1-7.42-11.66q-2.43-7.54-2.42-19.89V219.81h-30.38V194.09h30.38V140.94h29.34v53.15ZM1699.4,370.68q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58,41.19,41.19,0,0,1-12.6-15.26q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.07-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7t-13.46,26.57h-29.34q.67-16.46,6.9-27.77A52.21,52.21,0,0,1,1562,203.17a70,70,0,0,1,23.65-10.11,125.51,125.51,0,0,1,28.48-3.09,168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7,41.23,41.23,0,0,1,15.53,14.89q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-17.95,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.51,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14Zm208.85,141.62q-20,21.6-62.83,21.6a122.11,122.11,0,0,1-25.37-2.74,78,78,0,0,1-23.48-8.92,54.41,54.41,0,0,1-17.43-16.11q-6.91-10-7.6-24.35h29.35a21.47,21.47,0,0,0,5,13.38,36.67,36.67,0,0,0,11.4,8.91,55.52,55.52,0,0,0,14.67,5,79.51,79.51,0,0,0,15.19,1.55q14.49,0,24.51-5A46,46,0,0,0,1840.59,401a56.53,56.53,0,0,0,9.49-21.09,117.46,117.46,0,0,0,2.94-27.09V341.19h-.7q-7.59,16.46-23,24.18a71.8,71.8,0,0,1-32.63,7.71q-20,0-34.86-7.2A72.88,72.88,0,0,1,1737,346.51a82.13,82.13,0,0,1-15-28.46,116.62,116.62,0,0,1-5-34.47,133.92,133.92,0,0,1,4.14-32.4A88.17,88.17,0,0,1,1735,221a75.49,75.49,0,0,1,25.55-22.29q15.87-8.75,39-8.75a66.21,66.21,0,0,1,31.07,7.38,52.13,52.13,0,0,1,22.09,22.11h.35V194.09h27.61V356.28Q1880.63,399.83,1860.61,421.43Zm-37.46-79.72a47.94,47.94,0,0,0,16.4-15.78,71.89,71.89,0,0,0,9.15-22.11,106.77,106.77,0,0,0,2.93-24.69,96.71,96.71,0,0,0-2.76-23,64,64,0,0,0-8.8-20.4,45.76,45.76,0,0,0-15.71-14.57q-9.66-5.49-23.47-5.49-14.16,0-24.17,5.32a46.77,46.77,0,0,0-16.4,14.23,60.14,60.14,0,0,0-9.32,20.57,99.69,99.69,0,0,0-2.93,24.35,120.63,120.63,0,0,0,2.42,24,67.5,67.5,0,0,0,8.28,21.77,46.37,46.37,0,0,0,15.54,15.78q9.66,6,24.16,6T1823.15,341.71Zm228,18.34q-20,15.09-50.41,15.09-21.4,0-37.11-6.86a73.16,73.16,0,0,1-26.41-19.2,81.52,81.52,0,0,1-16-29.49,141.12,141.12,0,0,1-6-37.38,106.1,106.1,0,0,1,6.21-37A88.56,88.56,0,0,1,1938.8,216a79.09,79.09,0,0,1,26.58-19.2A81.66,81.66,0,0,1,1999,190q23.82,0,39.53,9.78a78,78,0,0,1,25.2,24.86,98.18,98.18,0,0,1,13.12,32.91,140.6,140.6,0,0,1,2.93,34h-133.6a70,70,0,0,0,2.76,22.12,49.9,49.9,0,0,0,10,18.51A49.1,49.1,0,0,0,1976.6,345q10.7,4.82,25.2,4.8,18.65,0,30.55-8.57t15.71-26.06h29Q2071.18,345,2051.17,360.05Zm-7.08-113.84a50,50,0,0,0-10.7-16,53.1,53.1,0,0,0-56.62-10.63,47.48,47.48,0,0,0-15.71,10.81,51.69,51.69,0,0,0-10.35,15.94,60.18,60.18,0,0,0-4.49,19.37h102.53A59.47,59.47,0,0,0,2044.09,246.21ZM302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Z"})})};const fo=(0,Dr.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var gi=()=>{const i=fo();return(0,r.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,r.jsx)("path",{className:i.path,d:"M303,166.05a80.69,80.69,0,0,0,13.45-10.37c.79-.77,1.55-1.53,2.3-2.3a83.12,83.12,0,0,0,7.93-9.38A63.69,63.69,0,0,0,333,133.23a48.58,48.58,0,0,0,4.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56,0,78.3,115.23,0,190.25l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.22,49.22,0,0,0-6.8-8.87A89.17,89.17,0,0,0,259,178.29h.15a85.08,85.08,0,0,0,31-5.79A80.88,80.88,0,0,0,303,166.05ZM202.45,225.86c-19.32,18.51-50.4,21.23-75.7,5.9L51.61,186.15l67.45-64.64,76.41,46.38C223,184.58,221.49,207.61,202.45,225.86Zm8.93-82.22-70.65-42.89L205.14,39,274.51,81.1c25.94,15.72,29.31,37,10.55,55A60.69,60.69,0,0,1,211.38,143.64Zm29.86,190c-19.57,18.75-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,282.52v24.67L108.6,373.1a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.27,87.27,0,0,1,241.24,333.68Zm0-39c-19.57,18.75-46.17,29.08-74.88,29.08a123.81,123.81,0,0,1-64.1-18.19L0,243.53v24.68l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.5v-1.78A87.27,87.27,0,0,1,241.24,294.7Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.81,123.81,0,0,1-64.1-18.19L0,204.55v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.82A86.09,86.09,0,0,1,241.24,255.71Zm83.7,25.74a94.15,94.15,0,0,1-60.2,25.86h0V334a81.6,81.6,0,0,0,51.74-22.37c14-13.38,21.14-28.11,21-42.64v-2.19A94.92,94.92,0,0,1,324.94,281.45Zm-83.7,91.21c-19.57,18.76-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,321.5v24.68l108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A86.29,86.29,0,0,1,241.24,372.66ZM327,162.45c-.68.69-1.35,1.38-2.05,2.06a94.37,94.37,0,0,1-10.64,8.65,91.35,91.35,0,0,1-11.6,7,94.53,94.53,0,0,1-26.24,8.71,97.69,97.69,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a53.27,53.27,0,0,1,1.14,12V217h.05a84.41,84.41,0,0,0,25.35-5.55,81,81,0,0,0,26.39-16.82c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,172.17a48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08,1.54-2.25,3.09A96.73,96.73,0,0,1,327,162.45Zm0,77.92c-.69.7-1.31,1.41-2,2.1a94.2,94.2,0,0,1-60.2,25.86h0l0,26.67h0a81.6,81.6,0,0,0,51.74-22.37A73.51,73.51,0,0,0,333,250.13a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74,1.07-1.46,2.15-2.27,3.21A95.68,95.68,0,0,1,327,240.37Zm0-39c-.69.7-1.31,1.41-2,2.1a93.18,93.18,0,0,1-10.63,8.65,91.63,91.63,0,0,1-11.63,7,95.47,95.47,0,0,1-37.94,10.18h0V256h0a81.65,81.65,0,0,0,51.74-22.37c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,211.15a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.46,2.16-2.27,3.22A95.68,95.68,0,0,1,327,201.39Z"})})};const Cs=(0,Dr.Z)({root:{width:me.po.drawerWidthClosed,height:3*me.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:me.po.drawerWidthClosed,marginLeft:24}}),mi=()=>{const i=Cs(),{isOpen:n}=(0,me.mZ)();return(0,r.jsx)("div",{className:i.root,children:(0,r.jsx)(me.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:n?(0,r.jsx)(fi,{}):(0,r.jsx)(gi,{})})})},ha=({children:i})=>(0,r.jsxs)(me.tR,{children:[(0,r.jsxs)(me.YE,{children:[(0,r.jsx)(mi,{}),(0,r.jsx)(me.v7,{}),(0,r.jsx)(me.R6,{icon:Vo.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var pa=t(32388),vi=t(4142);const fa=(0,Dr.Z)(i=>({headerIcon:{color:i.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:i.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var ur;(function(i){i.LIGHT="light",i.DARK="dark"})(ur||(ur={}));const Ho=()=>{const i=(0,y.h_)(y.hg),n=fa(),[s,c]=(0,F.useState)(i.getActiveThemeId()===ur.DARK?ur.DARK:ur.LIGHT),f={[ur.LIGHT]:{icon:vi.Z,title:"Dark theme"},[ur.DARK]:{icon:pa.Z,title:"Light theme"}},{title:I,icon:k}=f[s],z=()=>{c(te=>{const De=te===ur.LIGHT?ur.DARK:ur.LIGHT;return i.setActiveThemeId(De),De})};return(0,r.jsx)(co.Z,{display:"flex",alignItems:"center",mr:2,children:(0,r.jsx)(ms.ZP,{title:I,arrow:!0,children:(0,r.jsx)(Jn.Z,{size:"small",onClick:z,children:(0,r.jsx)(k,{className:n.headerIcon})})})})},Go=()=>(0,r.jsxs)(T.I6,{children:[(0,r.jsx)(b.S,{}),(0,r.jsx)(B.F,{withSearch:!1})]}),yi=(0,r.jsx)(Go,{}),eo=hs({apis:di,configLoader:ca,plugins:Object.values(h)}),xi=eo.getProvider(),ws=eo.getRouter(),bi=T.s4.provide((0,Re.KY)({name:"ThemeToggleAddon",component:Ho,location:Re.oZ.Header})),Si=(0,r.jsxs)(Io,{children:[(0,r.jsx)(m.Fg,{to:"/docs/default/component/local/"},"/"),(0,r.jsx)(m.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,r.jsx)(bs,{})}),(0,r.jsx)(m.AW,{path:"/docs",element:(0,r.jsx)(T.Jl,{}),children:(0,r.jsx)(j.u,{})}),(0,r.jsxs)(m.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,r.jsx)(T.I6,{}),children:[yi,(0,r.jsx)(Re.DR,{children:(0,r.jsx)(bi,{})})]})]});var wi=()=>(0,r.jsx)(xi,{children:(0,r.jsx)(ws,{children:(0,r.jsx)(ha,{children:Si})})});L.render((0,r.jsx)(wi,{}),document.getElementById("root"))},51837:function(bt,Be,t){"use strict";t.d(Be,{CT:function(){return y},EI:function(){return be},uW:function(){return L},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 r=h(),F=V=>`__@backstage/${V}__`;function L(V,G){const b=F(V);let B=r[b];return B||(B=G(),r[b]=B,B)}var m=t(2784);function y(V){return L(V,()=>(0,m.createContext)(void 0))}function l(V){return(0,m.useContext)(y(V))}function M(V){return{set(G){globalThis[`__@backstage/${V}__`]=createContext(createVersionedValueMap(G))},reset(){delete globalThis[`__@backstage/${V}__`]}}}function be(V){Object.freeze(V);const G={atVersion(b){return V[b]}};return Object.defineProperty(G,"$map",{configurable:!0,enumerable:!0,get(){return V}}),G}},96641:function(bt,Be,t){"use strict";t.d(Be,{X2:function(){return be},ce:function(){return V},h$:function(){return l}});var h=t(52322),r=t(25271),F=t(60871),L=t(51837),m=t(2784);const y=(0,L.CT)("entity-context"),l=({children:G,entity:b,loading:B,error:Y,refresh:le})=>{const ee={entity:b,loading:B,error:Y,refresh:le};return(0,h.jsx)(y.Provider,{value:(0,L.EI)({1:ee}),children:(0,h.jsx)(F.fC,{attributes:{...b?{entityRef:(0,r.eE)(b)}:void 0},children:G})})},M=G=>_jsx(l,{entity:G.entity,loading:!Boolean(G.entity),error:void 0,refresh:void 0,children:G.children});function be(){const G=(0,L.Vt)("entity-context");if(!G)throw new Error("Entity context is not available");const b=G.atVersion(1);if(!b)throw new Error("EntityContext v1 not available");if(!b.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:b.entity}}function V(){const G=(0,L.Vt)("entity-context");if(!G)throw new Error("Entity context is not available");const b=G.atVersion(1);if(!b)throw new Error("EntityContext v1 not available");const{entity:B,loading:Y,error:le,refresh:ee}=b;return{entity:B,loading:Y,error:le,refresh:ee}}},40303:function(bt,Be,t){"use strict";t.d(Be,{h$:function(){return Ae.h$},n3:function(){return h.n3},_i:function(){return P},tW:function(){return Oe},df:function(){return Tt},UO:function(){return vn},dq:function(){return q},nl:function(){return Br},dx:function(){return Fe},rI:function(){return st},u3:function(){return qe},xE:function(){return cn},sL:function(){return yn},LH:function(){return w},U_:function(){return io},pp:function(){return es},EW:function(){return Lo},Ah:function(){return F},wi:function(){return Re},hF:function(){return je.hF},CV:function(){return je.CV},$3:function(){return _e},p3:function(){return L},ce:function(){return Ae.ce},X2:function(){return Ae.X2},wp:function(){return $t},ZW:function(){return jn},eK:function(){return qn},CR:function(){return wn}});var h=t(4791),r=t(60871);const F=(0,r.T0)({id:"plugin.catalog.service"}),L=(0,r.T0)({id:"catalog-react.starred-entities"});var m=t(82394);class y{async toggleStarred(C){this.starredEntities.delete(C)||this.starredEntities.add(C);for(const O of this.subscribers)O.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){this.starredEntities=new Set,this.subscribers=new Set,this.observable=new ObservableImpl(C=>(C.next(new Set(this.starredEntities)),this.subscribers.add(C),()=>{this.subscribers.delete(C)}))}}var l=t(52322),M=t(2784),be=t(41156),V=t(60364),G=t(77277),b=t(4190),B=t(95544),Y=t(90436),le=t(60905),ee=t(36444);const X=S=>{const C=(0,be.Z)(se=>se.breakpoints.down("md")),O=(0,V.Z)(),[D,_]=(0,M.useState)(!1);return C?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(G.Z,{style:{marginTop:O.spacing(1),marginLeft:O.spacing(1)},onClick:()=>_(!0),startIcon:(0,l.jsx)(ee.Z,{}),children:"Filters"}),(0,l.jsx)(b.ZP,{open:D,onClose:()=>_(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,l.jsxs)(B.Z,{m:2,children:[(0,l.jsx)(Y.Z,{variant:"h6",component:"h2",style:{marginBottom:O.spacing(1)},children:"Filters"}),S.children]})})]}):(0,l.jsx)(le.Z,{item:!0,lg:2,children:S.children})},j=S=>(0,l.jsx)(le.Z,{item:!0,xs:12,lg:10,children:S.children}),P=S=>(0,l.jsx)(le.Z,{container:!0,style:{position:"relative"},children:S.children});P.Filters=X,P.Content=j;var $=t(23196),T=t(25271),re=t(51837);const Re=(0,re.uW)("catalog:entity-route-ref",()=>(0,r.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function Xe(S){var C,O;return{kind:S.kind.toLocaleLowerCase("en-US"),namespace:(O=(C=S.metadata.namespace)===null||C===void 0?void 0:C.toLocaleLowerCase("en-US"))!==null&&O!==void 0?O:DEFAULT_NAMESPACE,name:S.metadata.name}}function _e(S,C){const O=C==null?void 0:C.defaultKind;let D,_,se;return"metadata"in S?(D=S.kind,_=S.metadata.namespace,se=S.metadata.name):(D=S.kind,_=S.namespace,se=S.name),(_===void 0||_==="")&&(_=T.zG),(C==null?void 0:C.defaultNamespace)!==void 0?(C==null?void 0:C.defaultNamespace)===_&&(_=void 0):_===T.zG&&(_=void 0),D=D.toLocaleLowerCase("en-US"),D=O&&O.toLocaleLowerCase("en-US")===D?void 0:D,`${D?`${D}:`:""}${_?`${_}/`:""}${se}`}var it=t(80030);const Fe=(0,M.forwardRef)((S,C)=>{const{entityRef:O,defaultKind:D,title:_,children:se,...ne}=S,ge=(0,r.tg)(Re);let Ce,Ie,me;if(typeof O=="string"){const $e=(0,T.of)(O);Ce=$e.kind,Ie=$e.namespace,me=$e.name}else"metadata"in O?(Ce=O.kind,Ie=O.metadata.namespace,me=O.metadata.name):(Ce=O.kind,Ie=O.namespace,me=O.name);Ce=Ce.toLocaleLowerCase("en-US");var ke;Ie=(ke=Ie==null?void 0:Ie.toLocaleLowerCase("en-US"))!==null&&ke!==void 0?ke:T.zG;const nt={kind:Ce,namespace:Ie,name:me},Je=_e({kind:Ce,namespace:Ie,name:me},{defaultKind:D}),ot=(0,l.jsxs)($.rU,{...ne,ref:C,to:ge(nt),children:[se,!se&&(_!=null?_:Je)]});return _?(0,l.jsx)(it.ZP,{title:Je,children:ot}):ot});var jt=t(64279);function He(S){const{entityRefs:C,defaultKind:O,getTitle:D,..._}=S,se=(0,r.h_)(F),{value:ne=new Array,loading:ge,error:Ce}=(0,jt.default)(async()=>{const Ie=C.reduce((ke,nt)=>"metadata"in nt?ke:[...ke,(0,T.of)(nt)],new Array),me=C.filter(ke=>"metadata"in ke);return Ie.length>0?[...(await se.getEntities({filter:Ie.map(ke=>({kind:ke.kind,"metadata.namespace":ke.namespace,"metadata.name":ke.name}))})).items,...me]:me},[C]);return ge?(0,l.jsx)($.Ex,{}):Ce?(0,l.jsx)($.yu,{error:Ce}):(0,l.jsx)(l.Fragment,{children:ne.map((Ie,me)=>(0,l.jsxs)(M.Fragment,{children:[me>0&&", ",(0,l.jsx)(Fe,{..._,defaultKind:O,entityRef:Ie,title:D(Ie)})]},me))})}function st(S){const{entityRefs:C,defaultKind:O,fetchEntities:D,getTitle:_,...se}=S;return D?(0,l.jsx)(He,{...se,defaultKind:O,entityRefs:C,getTitle:_}):(0,l.jsx)(l.Fragment,{children:C.map((ne,ge)=>(0,l.jsxs)(M.Fragment,{children:[ge>0&&", ",(0,l.jsx)(Fe,{...se,defaultKind:O,entityRef:ne,title:_?_(ne):void 0})]},ge))})}var je=t(49280);class Et{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(C){this.value=C}}class St{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(C){this.value=C}}class gt{filterEntity(C){var O;return this.values.every(D=>((O=C.metadata.tags)!==null&&O!==void 0?O:[]).includes(D))}toQueryValue(){return this.values}constructor(C){this.values=C}}class yt{filterEntity(C){const O=this.toUpperArray(this.value.split(/\s/)),D=this.toUpperArray([C.metadata.tags]),_=this.toUpperArray([C.metadata.name,C.metadata.title]);for(const se of O)if(D.every(ne=>ne!==se)&&_.every(ne=>!ne.includes(se)))return!1;return!0}toUpperArray(C){return C.flat().filter(O=>Boolean(O)).map(O=>O.toLocaleUpperCase("en-US"))}constructor(C){this.value=C}}class At{filterEntity(C){return this.values.some(O=>(0,je.hF)(C,T.S4).some(D=>_e(D,{defaultKind:"group"})===O))}toQueryValue(){return this.values}constructor(C){this.values=C}}class Lt{filterEntity(C){return this.values.some(O=>{var D;return((D=C.spec)===null||D===void 0?void 0:D.lifecycle)===O})}toQueryValue(){return this.values}constructor(C){this.values=C}}class ze{filterEntity(C){switch(this.value){case"owned":return this.isOwnedEntity(C);case"starred":return this.isStarredEntity(C);default:return!0}}toQueryValue(){return this.value}constructor(C,O,D){this.value=C,this.isOwnedEntity=O,this.isStarredEntity=D}}class xe{filterEntity(C){var O;const D=(O=C.metadata.annotations)===null||O===void 0?void 0:O["backstage.io/orphan"];return D!==void 0&&this.value.toString()===D}constructor(C){this.value=C}}class Te{filterEntity(C){var O,D;const _=(C==null||(O=C.status)===null||O===void 0||(D=O.items)===null||D===void 0?void 0:D.length)>0;return _!==void 0&&this.value===_}constructor(C){this.value=C}}var Ae=t(96641),Ze=t(76635),rt=t.n(Ze),zt=t(19126),pt=t.n(zt),Pt=t(79635),mt=t(69294),It=t(48760),en=t(90736);const on=(0,M.createContext)(void 0),vn=({children:S})=>{const C=(0,en.default)(),O=(0,r.h_)(F),[D,_]=(0,M.useState)({}),se=(0,Pt.TH)();var ne;const ge=(0,M.useMemo)(()=>(ne=pt().parse(se.search,{ignoreQueryPrefix:!0}).filters)!==null&&ne!==void 0?ne:{},[se]),[Ce,Ie]=(0,M.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:me,error:ke},nt]=(0,mt.default)(async()=>{const $e=(0,Ze.compact)(Object.values(D)),xt=(0,je.Gz)($e),Nt=(0,je.wq)($e),fn=(0,je.wq)((0,Ze.compact)(Object.values(Ce.appliedFilters))),qt=Object.keys(D).reduce((gn,En)=>{const An=D[En];return An!=null&&An.toQueryValue&&(gn[En]=An.toQueryValue()),gn},{});if((0,Ze.isEqual)(fn,Nt))Ie({appliedFilters:D,backendEntities:Ce.backendEntities,entities:Ce.backendEntities.filter(xt)});else{const gn=await O.getEntities({filter:Nt});Ie({appliedFilters:D,backendEntities:gn.items,entities:gn.items.filter(xt)})}if(C()){var Pn;const gn=pt().parse(se.search,{ignoreQueryPrefix:!0}),En=pt().stringify({...gn,filters:qt},{addQueryPrefix:!0,arrayFormat:"repeat"}),An=`${window.location.pathname}${En}`;(Pn=window.history)===null||Pn===void 0||Pn.replaceState(null,document.title,An)}},[O,ge,D,Ce],{loading:!0});(0,It.Z)(nt,10,[D]);const Je=(0,M.useCallback)($e=>{_(xt=>{const Nt=typeof $e=="function"?$e(xt):$e;return{...xt,...Nt}})},[]),ot=(0,M.useMemo)(()=>({filters:Ce.appliedFilters,entities:Ce.entities,backendEntities:Ce.backendEntities,updateFilters:Je,queryParameters:ge,loading:me,error:ke}),[Ce,Je,ge,me,ke]);return(0,l.jsx)(on.Provider,{value:ot,children:S})};function $t(){const S=(0,M.useContext)(on);if(!S)throw new Error("useEntityList must be used within EntityListProvider");return S}var pn=t(18149),Cn=t.n(pn),Tn=t(829),an=t.n(Tn);function Xn(){const S=(0,r.h_)(F),{filters:{kind:C,type:O},queryParameters:{type:D},updateFilters:_}=$t(),se=(0,M.useMemo)(()=>[D].flat().filter(Boolean),[D]);var ne;const[ge,Ce]=(0,M.useState)(se.length?se:(ne=O==null?void 0:O.getTypes())!==null&&ne!==void 0?ne:[]);(0,M.useEffect)(()=>{se.length&&Ce(se)},[se]);const[Ie,me]=(0,M.useState)([]),ke=(0,M.useMemo)(()=>C==null?void 0:C.value,[C]),{error:nt,loading:Je,value:ot}=(0,jt.default)(async()=>ke?await S.getEntityFacets({filter:{kind:ke},facets:["spec.type"]}).then(Nt=>Nt.facets["spec.type"]||[]):[],[ke,S]),$e=(0,M.useRef)(ot);return(0,M.useEffect)(()=>{const xt=$e.current;if($e.current=ot,Je||!ke||xt===ot||!ot)return;const Nt=[...new Set(an()(ot,qt=>-qt.count).map(qt=>qt.value.toLocaleLowerCase("en-US")))];me(Nt);const fn=ge.filter(qt=>Nt.includes(qt));Cn()(ge,fn)||Ce(fn)},[Je,ke,ge,Ce,ot]),(0,M.useEffect)(()=>{_({type:ge.length?new St(ge):void 0})},[ge,_]),{loading:Je,error:nt,availableTypes:Ie,selectedTypes:ge,setSelectedTypes:Ce}}const On=20;function qn(S,C){var O,D;const _=C==null||(O=C.type)===null||O===void 0?void 0:O.toLocaleLowerCase("en-US"),se=C==null||(D=C.kind)===null||D===void 0?void 0:D.toLocaleLowerCase("en-US"),ne=(0,r.h_)(F),{loading:ge,value:Ce,error:Ie}=(0,jt.default)(async()=>{var me;const ke=(me=S.relations)===null||me===void 0?void 0:me.map($e=>({type:$e.type,target:(0,T.of)($e.targetRef)})).filter($e=>(!_||$e.type.toLocaleLowerCase("en-US")===_)&&(!se||$e.target.kind===se));if(!ke)return[];const nt=Object.values((0,Ze.groupBy)(ke,({target:$e})=>`${$e.kind}:${$e.namespace}`.toLocaleLowerCase("en-US"))),Je=[];for(const $e of nt)Je.push({kind:$e[0].target.kind,namespace:$e[0].target.namespace,nameBatches:(0,Ze.chunk)($e.map(xt=>xt.target.name),On)});return(await Promise.all(Je.flatMap($e=>$e.nameBatches.map(xt=>ne.getEntities({filter:{kind:$e.kind,"metadata.namespace":$e.namespace,"metadata.name":xt}}))))).flatMap($e=>$e.items)},[S,_,se]);return{entities:Ce,loading:ge,error:Ie}}var ct=t(72164);function Bn(S){return typeof S=="string"?S:(0,T.eE)(S)}function wn(){const S=(0,r.h_)(L),C=(0,ct.Z)(S.starredEntitie$(),new Set),O=(0,M.useCallback)(_=>C.has(Bn(_)),[C]),D=(0,M.useCallback)(_=>S.toggleStarred(Bn(_)).then(),[S]);return{starredEntities:C,toggleStarredEntity:D,isStarredEntity:O}}function ln(S){return typeof S=="string"?S:(0,T.eE)(S)}function $n(S){const C=(0,r.h_)(L),[O,D]=(0,M.useState)(!1);return(0,M.useEffect)(()=>{const se=C.starredEntitie$().subscribe({next(ne){D(ne.has(ln(S)))}});return()=>{se.unsubscribe()}},[S,C]),{toggleStarredEntity:(0,M.useCallback)(()=>C.toggleStarred(ln(S)).then(),[S,C]),isStarredEntity:O}}var zn=t(75435);function jn(){const S=(0,r.h_)(r.$4),{loading:C,value:O}=(0,jt.default)(async()=>{const{ownershipEntityRefs:_}=await S.getBackstageIdentity();return _},[]),D=(0,M.useMemo)(()=>{const _=new Set(O!=null?O:[]);return se=>{const ne=(0,zn.h)(se,T.S4).map(T.eE);for(const ge of ne)if(_.has(ge))return!0;return!1}},[O]);return(0,M.useMemo)(()=>({loading:C,isOwnedEntity:D}),[C,D])}function Gn(){const S=(0,r.h_)(F),{error:C,loading:O,value:D}=(0,jt.default)(async()=>await S.getEntityFacets({facets:["kind"]}).then(se=>{var ne;return((ne=se.facets.kind)===null||ne===void 0?void 0:ne.map(ge=>ge.value).sort())||[]}),[S]);return{loading:O,error:C,allKinds:D!=null?D:[]}}function ve(S,C,O){let D=S;return C&&(D=D.filter(se=>C.some(ne=>ne.toLocaleLowerCase("en-US")===se.toLocaleLowerCase("en-US")))),O&&!S.some(se=>se.toLocaleLowerCase("en-US")===O.toLocaleLowerCase("en-US"))&&(D=D.concat([O])),D.sort().reduce((se,ne)=>(se[ne.toLocaleLowerCase("en-US")]=ne,se),{})}function oe(S){var C;const{filters:O,queryParameters:{kind:D},updateFilters:_}=$t(),se=(0,M.useMemo)(()=>[D].flat()[0],[D]);var ne;const[ge,Ce]=(0,M.useState)((ne=se!=null?se:(C=O.kind)===null||C===void 0?void 0:C.value)!==null&&ne!==void 0?ne:S.initialFilter);(0,M.useEffect)(()=>{se&&Ce(se)},[se]),(0,M.useEffect)(()=>{var nt;if(!((nt=O.kind)===null||nt===void 0)&&nt.value){var Je;Ce((Je=O.kind)===null||Je===void 0?void 0:Je.value)}},[O.kind]),(0,M.useEffect)(()=>{_({kind:ge?new Et(ge):void 0})},[ge,_]);const{allKinds:Ie,loading:me,error:ke}=Gn();return{loading:me,error:ke,allKinds:Ie!=null?Ie:[],selectedKind:ge,setSelectedKind:Ce}}const Oe=S=>{const{allowedKinds:C,hidden:O,initialFilter:D="component"}=S,_=(0,r.h_)(r.$v),{error:se,allKinds:ne,selectedKind:ge,setSelectedKind:Ce}=oe({initialFilter:D});if((0,M.useEffect)(()=>{se&&_.post({message:"Failed to load entity kinds",severity:"error"})},[se,_]),se)return null;const Ie=ve(ne,C,ge),me=Object.keys(Ie).map(ke=>({value:ke,label:Ie[ke]}));return O?null:(0,l.jsx)(B.Z,{pb:1,pt:1,children:(0,l.jsx)($.Ph,{label:"Kind",items:me,selected:ge.toLocaleLowerCase("en-US"),onChange:ke=>Ce(String(ke))})})};var Pe=t(79692),Ge=t(5806),ft=t(21324),Ht=t(86619),Rt=t(19996),ce=t(25505),U=t(38016),he=t(88013);const Ke=(0,Pe.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),Ve=(0,l.jsx)(ce.Z,{fontSize:"small"}),at=(0,l.jsx)(Rt.Z,{fontSize:"small"}),Tt=S=>{var C;const{initialFilter:O=[]}=S,D=Ke(),{updateFilters:_,backendEntities:se,filters:ne,queryParameters:{lifecycles:ge}}=$t(),Ce=(0,M.useMemo)(()=>[ge].flat().filter(Boolean),[ge]);var Ie;const[me,ke]=(0,M.useState)(Ce.length?Ce:(Ie=(C=ne.lifecycles)===null||C===void 0?void 0:C.values)!==null&&Ie!==void 0?Ie:O);(0,M.useEffect)(()=>{Ce.length&&ke(Ce)},[Ce]);const nt=(0,M.useMemo)(()=>[...new Set(se.map(Je=>{var ot;return(ot=Je.spec)===null||ot===void 0?void 0:ot.lifecycle}).filter(Boolean))].sort(),[se]);return(0,M.useEffect)(()=>{_({lifecycles:me.length&&nt.length?new Lt(me):void 0})},[me,_,nt]),nt.length?(0,l.jsx)(B.Z,{pb:1,pt:1,children:(0,l.jsxs)(Y.Z,{variant:"button",component:"label",children:["Lifecycle",(0,l.jsx)(he.ZP,{multiple:!0,disableCloseOnSelect:!0,options:nt,value:me,onChange:(Je,ot)=>ke(ot),renderOption:(Je,{selected:ot})=>(0,l.jsx)(Ge.Z,{control:(0,l.jsx)(ft.Z,{icon:Ve,checkedIcon:at,checked:ot}),label:Je}),size:"small",popupIcon:(0,l.jsx)(U.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:Je=>(0,l.jsx)(Ht.Z,{...Je,className:D.input,variant:"outlined"})})]})}):null},tn=(0,Pe.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),Xt=(0,l.jsx)(ce.Z,{fontSize:"small"}),sn=(0,l.jsx)(Rt.Z,{fontSize:"small"}),q=()=>{var S;const C=tn(),{updateFilters:O,backendEntities:D,filters:_,queryParameters:{owners:se}}=$t(),ne=(0,M.useMemo)(()=>[se].flat().filter(Boolean),[se]);var ge;const[Ce,Ie]=(0,M.useState)(ne.length?ne:(ge=(S=_.owners)===null||S===void 0?void 0:S.values)!==null&&ge!==void 0?ge:[]);(0,M.useEffect)(()=>{ne.length&&Ie(ne)},[ne]);const me=(0,M.useMemo)(()=>[...new Set(D.flatMap(ke=>(0,je.hF)(ke,T.S4).map(nt=>_e(nt,{defaultKind:"group"}))).filter(Boolean))].sort(),[D]);return(0,M.useEffect)(()=>{O({owners:Ce.length&&me.length?new At(Ce):void 0})},[Ce,O,me]),me.length?(0,l.jsx)(B.Z,{pb:1,pt:1,children:(0,l.jsxs)(Y.Z,{variant:"button",component:"label",children:["Owner",(0,l.jsx)(he.ZP,{multiple:!0,disableCloseOnSelect:!0,options:me,value:Ce,onChange:(ke,nt)=>Ie(nt),renderOption:(ke,{selected:nt})=>(0,l.jsx)(Ge.Z,{control:(0,l.jsx)(ft.Z,{icon:Xt,checkedIcon:sn,checked:nt}),label:ke}),size:"small",popupIcon:(0,l.jsx)(U.Z,{"data-testid":"owner-picker-expand"}),renderInput:ke=>(0,l.jsx)(Ht.Z,{...ke,className:C.input,variant:"outlined"})})]})}):null},W=S=>{const C=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:C(getCompoundEntityRef(S.entity)),children:_jsx(InfoIcon,{})})},de=S=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${S.email}`,to:`mailto:${S.email}`,children:_jsx(EmailIcon,{})}),g=S=>{var C;const O=(C=S.entity.spec.profile)===null||C===void 0?void 0:C.email;return O?_jsx(EmailCardAction,{email:O}):null},R=S=>{var C;const O=(C=S.entity.spec.profile)===null||C===void 0?void 0:C.email;return O?_jsx(EmailCardAction,{email:O}):null},J=(0,Pe.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),K=4,ae=S=>{var C,O,D;const{entityRef:_,children:se,delayTime:ne=500}=S,ge=J(),Ce=useApiHolder(),Ie=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[me,ke]=useState(!1),nt=useMemo(()=>debounce(()=>ke(!0),ne),[ne]),[{loading:Je,error:ot,value:$e},xt]=useAsyncFn(async()=>{const fn=Ce.get(catalogApiRef);if(fn){const qt=await fn.getEntityByRef(_);if(!qt)throw new Error(`${_} not found`);return qt}},[Ce,_]),Nt=()=>{ke(!1),nt.cancel()};return useEffect(()=>{Ie.isOpen&&!$e&&!ot&&!Je&&xt()},[Ie.isOpen,xt,$e,ot,Je]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:nt,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Ie),children:se})}),me&&_jsx(HoverPopover,{PaperProps:{className:ge.popoverPaper},...bindPopover(Ie),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:Nt,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[ot&&_jsx(ResponseErrorPanel,{error:ot}),Je&&_jsx(Progress,{}),$e&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:$e.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:$e.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:$e.kind}),$e.metadata.description&&_jsx(Typography,{className:ge.descriptionTypography,paragraph:!0,children:$e.metadata.description}),_jsx(Typography,{children:(C=$e.spec)===null||C===void 0?void 0:C.type}),_jsxs(Box,{marginTop:"0.5em",children:[($e.metadata.tags||[]).slice(0,K).map(fn=>_jsx(Chip,{size:"small",label:fn},fn)),((O=$e.metadata.tags)===null||O===void 0?void 0:O.length)&&((D=$e.metadata.tags)===null||D===void 0?void 0:D.length)>K&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!ot&&$e&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity($e)&&_jsx(UserCardActions,{entity:$e}),isGroupEntity($e)&&_jsx(GroupCardActions,{entity:$e}),_jsx(EntityCardActions,{entity:$e})]})})]})})]})},fe=(0,Pe.Z)(S=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),Ue=()=>{var S;const C=fe(),{filters:O,updateFilters:D}=useEntityList();var _;const[se,ne]=useState((_=(S=O.text)===null||S===void 0?void 0:S.value)!==null&&_!==void 0?_:"");return useDebounce(()=>{D({text:se.length?new EntityTextFilter(se):void 0})},250,[se,D]),_jsx(Toolbar,{className:C.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:C.input,placeholder:"Search",autoComplete:"off",onChange:ge=>ne(ge.target.value),value:se,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>ne(""),edge:"end",disabled:se.length===0,children:_jsx(Clear,{})})})})})})},Ye=Object.freeze({createEntityRefColumn(S){const{defaultKind:C}=S;function O(D){var _;return((_=D.metadata)===null||_===void 0?void 0:_.title)||_e(D,{defaultKind:C})}return{title:"Name",highlight:!0,customFilterAndSearch(D,_){return O(_).includes(D)},customSort(D,_){return O(D).localeCompare(O(_))},render:D=>{var _;return(0,l.jsx)(Fe,{entityRef:D,defaultKind:C,title:(_=D.metadata)===null||_===void 0?void 0:_.title})}}},createEntityRelationColumn(S){const{title:C,relation:O,defaultKind:D,filter:_}=S;function se(ge){return(0,je.hF)(ge,O,_)}function ne(ge){return se(ge).map(Ce=>_e(Ce,{defaultKind:D})).join(", ")}return{title:C,customFilterAndSearch(ge,Ce){return ne(Ce).includes(ge)},customSort(ge,Ce){return ne(ge).localeCompare(ne(Ce))},render:ge=>(0,l.jsx)(st,{entityRefs:se(ge),defaultKind:D})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:T.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:T.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:T.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:S=>(0,l.jsx)($.Or,{text:S.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),ut=[Ye.createEntityRefColumn({defaultKind:"system"}),Ye.createDomainColumn(),Ye.createOwnerColumn(),Ye.createMetadataDescriptionColumn()],vt=[Ye.createEntityRefColumn({defaultKind:"component"}),Ye.createSystemColumn(),Ye.createOwnerColumn(),Ye.createSpecTypeColumn(),Ye.createSpecLifecycleColumn(),Ye.createMetadataDescriptionColumn()],et=(0,Pe.Z)(S=>({empty:{padding:S.spacing(2),display:"flex",justifyContent:"center"}})),qe=S=>{const{entities:C,title:O,emptyContent:D,variant:_="gridItem",columns:se}=S,ne=et(),ge={minWidth:"0",width:"100%"};return _==="gridItem"&&(ge.height="calc(100% - 10px)"),(0,l.jsx)($.iA,{columns:se,title:O,style:ge,emptyContent:D&&(0,l.jsx)("div",{className:ne.empty,children:D}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:C})};qe.columns=Ye,qe.systemEntityColumns=ut,qe.componentEntityColumns=vt;const Ne=(0,l.jsx)(ce.Z,{fontSize:"small"}),Zt=(0,l.jsx)(Rt.Z,{fontSize:"small"});function Kt({selected:S}){return(0,l.jsx)(ft.Z,{icon:Ne,checkedIcon:Zt,checked:S})}const kt=(0,M.memo)(S=>{const{selected:C,value:O,availableOptions:D,showCounts:_}=S,se=_?`${O} (${D==null?void 0:D[O]})`:O;return(0,l.jsx)(Ge.Z,{control:(0,l.jsx)(Kt,{selected:C}),label:se})});var Dt=t(72779),Wt=t.n(Dt);const Gt=(0,Pe.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function ht(S){const C=Gt();return(0,l.jsx)(Ht.Z,{variant:"outlined",...S,className:Wt()(C.input,S.className)})}function We(S){var C;const{label:O,name:D,path:_,showCounts:se,Filter:ne,InputProps:ge}=S,{updateFilters:Ce,filters:Ie,queryParameters:{[D]:me}}=$t(),ke=(0,r.h_)(F),{value:nt}=(0,jt.default)(async()=>{var qt;const Pn=_,{facets:gn}=await ke.getEntityFacets({facets:[Pn],filter:(qt=Ie.kind)===null||qt===void 0?void 0:qt.getCatalogFilters()});return Object.fromEntries(gn[Pn].map(({value:En,count:An})=>[En,An]))},[Ie.kind]),Je=(0,M.useMemo)(()=>[me].flat().filter(Boolean),[me]);var ot;const[$e,xt]=(0,M.useState)(Je.length?Je:(ot=(C=Ie[D])===null||C===void 0?void 0:C.values)!==null&&ot!==void 0?ot:[]);(0,M.useEffect)(()=>{Je.length&&!rt().isEqual($e,Je)&&xt(Je)},[$e,Je]);const Nt=Object.keys(nt!=null?nt:{}),fn=$e.length&&Nt.length;return(0,M.useEffect)(()=>{Ce({[D]:fn?new ne($e):void 0})},[D,fn,$e,ne,Ce]),Ie[D]&&!("values"in Ie[D])||!Nt.length?null:(0,l.jsx)(B.Z,{pb:1,pt:1,children:(0,l.jsxs)(Y.Z,{variant:"button",component:"label",children:[O,(0,l.jsx)(he.ZP,{multiple:!0,disableCloseOnSelect:!0,options:Nt,value:$e,onChange:(qt,Pn)=>xt(Pn),renderOption:(qt,{selected:Pn})=>(0,l.jsx)(kt,{selected:Pn,value:qt,availableOptions:nt,showCounts:!!se}),size:"small",popupIcon:(0,l.jsx)(U.Z,{"data-testid":`${String(D)}-picker-expand`}),renderInput:qt=>(0,l.jsx)(ht,{...qt,...ge})})]})})}const Ut=(0,Pe.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),cn=S=>{const C=Ut();return(0,l.jsx)(We,{label:"Tags",name:"tags",path:"metadata.tags",Filter:gt,showCounts:S.showCounts,InputProps:{className:C.input}})},yn=S=>{const{hidden:C,initialFilter:O}=S,D=(0,r.h_)(r.$v),{error:_,availableTypes:se,selectedTypes:ne,setSelectedTypes:ge}=Xn();if((0,M.useEffect)(()=>{_&&D.post({message:"Failed to load entity types",severity:"error"}),O&&ge([O])},[_,D,O,ge]),se.length===0||_)return null;const Ce=[{value:"all",label:"all"},...se.map(me=>({value:me,label:me}))];var Ie;return C?null:(0,l.jsx)(B.Z,{pb:1,pt:1,children:(0,l.jsx)($.Ph,{label:"Type",items:Ce,selected:(Ie=Ce.length>1?ne[0]:void 0)!==null&&Ie!==void 0?Ie:"all",onChange:me=>ge(me==="all"?[]:[String(me)])})})};var In=t(15459),Zn=t(61837),xn=t(11640),Kn=t(28347);const bn=(0,In.Z)({root:{color:"#f3ba37"}})(xn.Z),w=S=>{const{toggleStarredEntity:C,isStarredEntity:O}=$n(S.entity);return(0,l.jsx)(Zn.Z,{"aria-label":"favorite",color:"inherit",...S,onClick:()=>C(),children:(0,l.jsx)(it.ZP,{title:O?"Remove from favorites":"Add to favorites",children:O?(0,l.jsx)(bn,{}):(0,l.jsx)(Kn.Z,{})})})};var u=t(8629),x=t(79249),A=t(38724),Q=t(99152),pe=t(6487),we=t(49429),Se=t(55999),dt=t(39412);const Vt=dt.Z;function dn(S,C){if(S)return S.toLocaleLowerCase("en-US");if(C)try{return(0,T.of)(C).kind.toLocaleLowerCase("en-US")}catch{return}}function Yn(S,C){const O=(0,r.qD)(),D=dn(S,C);return D&&O.getSystemIcon(`kind:${D}`)||Vt}function er(S){const{kind:C,entityRef:O,...D}=S,_=Yn(C,O);return(0,l.jsx)(_,{...D})}const zr=(0,Pe.Z)(S=>({node:{fill:S.palette.grey[300],stroke:S.palette.grey[300],"&.primary":{fill:S.palette.primary.light,stroke:S.palette.primary.light},"&.secondary":{fill:S.palette.secondary.light,stroke:S.palette.secondary.light}},text:{fill:S.palette.getContrastText(S.palette.grey[300]),"&.primary":{fill:S.palette.primary.contrastText},"&.secondary":{fill:S.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function oo(S){const C=(0,r.h_)(F),O=(0,T.eE)(S),{loading:D,error:_,value:se}=(0,jt.default)(async()=>{const ne=await C.getEntityAncestors({entityRef:O}),ge=new Array,Ce=new Array;for(const Ie of ne.items){const me=(0,T.eE)(Ie.entity),ke=me===ne.rootEntityRef;ge.push({id:me,root:ke,...Ie.entity});for(const nt of Ie.parentEntityRefs)Ce.push({from:me,to:nt})}return{nodes:ge,edges:Ce}},[O]);return{loading:D,error:_,nodes:(se==null?void 0:se.nodes)||[],edges:(se==null?void 0:se.edges)||[]}}function xo({node:S}){const C=zr(),O=(0,Pt.s0)(),D=(0,r.tg)(Re),[_,se]=(0,M.useState)(0),[ne,ge]=(0,M.useState)(0),Ce=(0,M.useRef)(null);(0,M.useLayoutEffect)(()=>{if(Ce.current){let{height:xt,width:Nt}=Ce.current.getBBox();xt=Math.round(xt),Nt=Math.round(Nt),(xt!==ne||Nt!==_)&&(se(Nt),ge(xt))}},[_,ne]);const Ie=10,me=ne,ke=me+Ie,nt=ke+_+Ie*2,Je=ne+Ie*2,ot=S.metadata.title||(S.kind&&S.metadata.name&&S.metadata.namespace?_e({kind:S.kind,name:S.metadata.name,namespace:S.metadata.namespace||""}):S.id),$e=()=>{O(D({kind:S.kind,namespace:S.metadata.namespace||T.zG,name:S.metadata.name}))};return(0,l.jsxs)("g",{onClick:$e,className:C.clickable,children:[(0,l.jsx)("rect",{className:Wt()(C.node,S.root?"secondary":"primary"),width:nt,height:Je,rx:10}),(0,l.jsx)(er,{kind:S.kind,y:Ie,x:Ie,width:me,height:me,className:Wt()(C.text,S.root?"secondary":"primary")}),(0,l.jsx)("text",{ref:Ce,className:Wt()(C.text,S.root?"secondary":"primary"),y:Je/2,x:ke+(_+Ie*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:ot})]})}function bo(S){const{loading:C,error:O,nodes:D,edges:_}=oo(S.entity);return C?(0,l.jsx)($.Ex,{}):O?(0,l.jsx)($.Gk,{error:O}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Se.Z,{variant:"h2",children:"Ancestry"}),(0,l.jsxs)(Se.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)($.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)(B.Z,{mt:4,children:(0,l.jsx)($.mn,{nodes:D,edges:_,renderNode:xo,direction:$.NX.Nm.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var or=t(11776),Rn=t(38402),sr=t(86136),yr=t(99688),Tr=t(49378),Ir=t(54506),Wr=t(94339),So=t(24579),Xo=t(27685);const Vr=(0,Pe.Z)(S=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:S.spacing(2)},helpIcon:{marginLeft:S.spacing(1),color:S.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function tr(S){const C=Vr();return(0,l.jsx)(Tr.Z,{...S,primaryTypographyProps:{className:C.monospace},secondaryTypographyProps:{className:C.monospace}})}function Rr(S){const C=Vr();return(0,l.jsx)(Ir.Z,{className:C.monospace,children:S.children})}function Lr(S){return(0,l.jsx)(B.Z,{mt:2,children:(0,l.jsx)(Wr.Z,{variant:"outlined",children:(0,l.jsxs)(So.Z,{children:[(0,l.jsxs)(Y.Z,{variant:"h6",gutterBottom:!0,children:[S.title,S.helpLink&&(0,l.jsx)(Gr,{to:S.helpLink})]}),S.children]})})})}function Co(S){if(S.match(/^url:https?:\/\//))return S.slice(4);if(S.match(/^https?:\/\//))return S}function Hr(S){const[C,O]=S.entry,D=Co(O);return(0,l.jsxs)(Rn.Z,{children:[S.indent&&(0,l.jsx)(sr.Z,{}),(0,l.jsx)(tr,{primary:C,secondary:D?(0,l.jsx)($.rU,{to:D,children:O}):O})]})}function Gr(S){const C=Vr();return(0,l.jsx)($.rU,{to:S.to,className:C.helpIcon,children:(0,l.jsx)(Xo.Z,{fontSize:"inherit"})})}const Pr=(0,Pe.Z)({root:{display:"flex",flexDirection:"column"}});function fr(S){var C,O;const D=(0,r.h_)(F),_=(0,T.eE)(S),se=(C=S.metadata.annotations)===null||C===void 0?void 0:C[T.P1],ne=(O=S.metadata.annotations)===null||O===void 0?void 0:O[T.q1],{loading:ge,error:Ce,value:Ie}=(0,jt.default)(async()=>!se&&!ne?[]:(await D.getEntities({filter:[...se?[{[`metadata.annotations.${T.P1}`]:se}]:[],...ne?[{[`metadata.annotations.${T.q1}`]:ne}]:[]]})).items,[se,ne]);return{loading:ge,error:Ce,location:se,originLocation:ne,colocatedEntities:Ie==null?void 0:Ie.filter(me=>(0,T.eE)(me)!==_)}}function Kr(S){return(0,l.jsxs)(or.Z,{dense:!0,children:[S.header&&(0,l.jsx)(Hr,{entry:S.header},"header"),S.entities.map(C=>(0,l.jsxs)(Rn.Z,{children:[(0,l.jsx)(sr.Z,{children:(0,l.jsx)(er,{kind:C.kind})}),(0,l.jsx)(tr,{primary:(0,l.jsx)(Fe,{entityRef:C})})]},(0,T.eE)(C)))]})}function wo(S){const{entity:C}=S,{loading:O,error:D,location:_,originLocation:se,colocatedEntities:ne}=fr(C);if(O)return(0,l.jsx)($.Ex,{});if(D)return(0,l.jsx)($.Gk,{error:D});if(!_&&!se)return(0,l.jsx)(yr.Z,{severity:"warning",children:"Entity had no location information."});if(!(ne!=null&&ne.length))return(0,l.jsx)(yr.Z,{severity:"info",children:"There were no other entities on this location."});if(_===se)return(0,l.jsx)(Kr,{entities:ne});const ge=ne.filter(Ie=>{var me;return((me=Ie.metadata.annotations)===null||me===void 0?void 0:me[T.P1])===_}),Ce=ne.filter(Ie=>{var me;return((me=Ie.metadata.annotations)===null||me===void 0?void 0:me[T.q1])===se});return(0,l.jsxs)(l.Fragment,{children:[ge.length>0&&(0,l.jsx)(Kr,{entities:ge,header:["At the same location",_]}),Ce.length>0&&(0,l.jsx)(Kr,{entities:Ce,header:["At the same origin",se]})]})}function jo(S){const C=Pr();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Se.Z,{variant:"h2",children:"Colocated"}),(0,l.jsx)(Se.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:C.root,children:(0,l.jsx)(wo,{entity:S.entity})})]})}function Yr(S){return Object.fromEntries([...Object.entries(S)].sort((C,O)=>C[0]<O[0]?-1:1))}function Eo(S){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Se.Z,{variant:"h2",children:"Entity as JSON"}),(0,l.jsx)(Se.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,l.jsx)(Se.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)($.Oi,{text:JSON.stringify(Yr(S.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var qo=t(3440),gr=t.n(qo);const _o=(0,Pe.Z)({root:{display:"flex",flexDirection:"column"}});function so(S){var C,O;const D=_o(),{apiVersion:_,kind:se,metadata:ne,spec:ge,relations:Ce=[],status:Ie={}}=S.entity,me=gr()(an()(Ce,ke=>ke.targetRef),"type");return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Se.Z,{variant:"h2",children:"Overview"}),(0,l.jsxs)("div",{className:D.root,children:[(0,l.jsx)(Lr,{title:"Identity",children:(0,l.jsxs)(or.Z,{dense:!0,children:[(0,l.jsx)(Rn.Z,{children:(0,l.jsx)(tr,{primary:"apiVersion",secondary:_})}),(0,l.jsx)(Rn.Z,{children:(0,l.jsx)(tr,{primary:"kind",secondary:se})}),(ge==null?void 0:ge.type)&&(0,l.jsx)(Rn.Z,{children:(0,l.jsx)(tr,{primary:"spec.type",secondary:ge.type})}),ne.uid&&(0,l.jsx)(Rn.Z,{children:(0,l.jsx)(tr,{primary:"uid",secondary:ne.uid})}),ne.etag&&(0,l.jsx)(Rn.Z,{children:(0,l.jsx)(tr,{primary:"etag",secondary:ne.etag})})]})}),(0,l.jsxs)(Lr,{title:"Metadata",children:[!!Object.keys(ne.annotations||{}).length&&(0,l.jsx)(or.Z,{dense:!0,subheader:(0,l.jsxs)(Rr,{children:["Annotations",(0,l.jsx)(Gr,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(ne.annotations).map(ke=>(0,l.jsx)(Hr,{indent:!0,entry:ke},ke[0]))}),!!Object.keys(ne.labels||{}).length&&(0,l.jsx)(or.Z,{dense:!0,subheader:(0,l.jsx)(Rr,{children:"Labels"}),children:Object.entries(ne.labels).map(ke=>(0,l.jsx)(Hr,{indent:!0,entry:ke},ke[0]))}),!!(!((C=ne.tags)===null||C===void 0)&&C.length)&&(0,l.jsx)(or.Z,{dense:!0,subheader:(0,l.jsx)(Rr,{children:"Tags"}),children:ne.tags.map((ke,nt)=>(0,l.jsxs)(Rn.Z,{children:[(0,l.jsx)(sr.Z,{}),(0,l.jsx)(tr,{primary:ke})]},`${ke}-${nt}`))})]}),!!Ce.length&&(0,l.jsx)(Lr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(me).map(([ke,nt],Je)=>(0,l.jsx)("div",{children:(0,l.jsx)(or.Z,{dense:!0,subheader:(0,l.jsx)(Rr,{children:ke}),children:nt.map(ot=>(0,l.jsxs)(Rn.Z,{children:[(0,l.jsx)(sr.Z,{children:(0,l.jsx)(er,{entityRef:ot.targetRef})}),(0,l.jsx)(tr,{primary:(0,l.jsx)(Fe,{entityRef:ot.targetRef})})]},ot.targetRef))})},Je))}),!!(!((O=Ie.items)===null||O===void 0)&&O.length)&&(0,l.jsx)(Lr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Ie.items.map((ke,nt)=>(0,l.jsxs)("div",{children:[(0,l.jsxs)(Y.Z,{children:[ke.level,": ",ke.type]}),(0,l.jsx)(B.Z,{ml:2,children:ke.message})]},nt))})]})]})}var Ao=t(72847);function To(S){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Se.Z,{variant:"h2",children:"Entity as YAML"}),(0,l.jsx)(Se.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,l.jsx)(Se.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)($.Oi,{text:Ao.ZP.stringify(Yr(S.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const kr=(0,Pe.Z)(S=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:S.palette.background.paper},tabs:{borderRight:`1px solid ${S.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function xr(S){const{children:C,value:O,index:D,..._}=S,se=kr();return(0,l.jsx)("div",{role:"tabpanel",hidden:O!==D,id:`vertical-tabpanel-${D}`,"aria-labelledby":`vertical-tab-${D}`,className:se.tabContents,..._,children:O===D&&(0,l.jsx)(B.Z,{pl:3,pr:3,children:C})})}function br(S){return{id:`vertical-tab-${S}`,"aria-controls":`vertical-tabpanel-${S}`}}function io(S){const C=kr(),[O,D]=M.useState(0);return(0,M.useEffect)(()=>{D(0)},[S.open]),S.entity?(0,l.jsxs)(u.Z,{fullWidth:!0,maxWidth:"xl",open:S.open,onClose:S.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:C.fullHeightDialog},children:[(0,l.jsx)(x.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,l.jsx)(A.Z,{dividers:!0,children:(0,l.jsxs)("div",{className:C.root,children:[(0,l.jsxs)(Q.Z,{orientation:"vertical",variant:"scrollable",value:O,onChange:(_,se)=>D(se),"aria-label":"Inspector options",className:C.tabs,children:[(0,l.jsx)(pe.Z,{label:"Overview",...br(0)}),(0,l.jsx)(pe.Z,{label:"Ancestry",...br(1)}),(0,l.jsx)(pe.Z,{label:"Colocated",...br(2)}),(0,l.jsx)(pe.Z,{label:"Raw JSON",...br(3)}),(0,l.jsx)(pe.Z,{label:"Raw YAML",...br(4)})]}),(0,l.jsx)(xr,{value:O,index:0,children:(0,l.jsx)(so,{entity:S.entity})}),(0,l.jsx)(xr,{value:O,index:1,children:(0,l.jsx)(bo,{entity:S.entity})}),(0,l.jsx)(xr,{value:O,index:2,children:(0,l.jsx)(jo,{entity:S.entity})}),(0,l.jsx)(xr,{value:O,index:3,children:(0,l.jsx)(Eo,{entity:S.entity})}),(0,l.jsx)(xr,{value:O,index:4,children:(0,l.jsx)(To,{entity:S.entity})})]})}),(0,l.jsx)(we.Z,{children:(0,l.jsx)(G.Z,{onClick:S.onClose,color:"primary",children:"Close"})})]}):null}var Io=t(85256);function Jr(S){var C;const O=(0,r.h_)(F),D=(C=S.metadata.annotations)===null||C===void 0?void 0:C[T.q1],_=S.metadata.uid,se=D==="bootstrap:bootstrap",ne=(0,jt.default)(async()=>{const ot=O.getLocationByRef(D);let $e;if(!D)$e=Promise.resolve([]);else{const xt=`metadata.annotations.${T.q1}`;$e=O.getEntities({filter:{[xt]:D},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Nt=>Nt.items)}return Promise.all([ot,$e]).then(([xt,Nt])=>({location:xt,colocatedEntities:Nt}))},[O,S]),ge=(0,M.useCallback)(async function(){const{location:$e}=ne.value;await O.removeLocationById($e.id)},[O,ne]),Ce=(0,M.useCallback)(async function(){await O.removeEntityByUid(_)},[O,_]);if(se)return{type:"bootstrap",location:D,deleteEntity:Ce};const{loading:Ie,error:me,value:ke}=ne;if(Ie)return{type:"loading"};if(me)return{type:"error",error:me};const{location:nt,colocatedEntities:Je}=ke;return nt?{type:"unregister",location:D,colocatedEntities:Je.map(T.iB),unregisterLocation:ge,deleteEntity:Ce}:{type:"only-delete",deleteEntity:Ce}}var Wn=t(23054);const Ro=(0,Pe.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),Ln=({entity:S,onConfirm:C,onClose:O})=>{const D=(0,r.h_)(r.$v),_=(0,r.h_)(r.Ds),se=Ro(),ne=Jr(S),[ge,Ce]=(0,M.useState)(!1),[Ie,me]=(0,M.useState)(!1);var ke;const nt=(ke=_.getOptionalString("app.title"))!==null&&ke!==void 0?ke:"Backstage",Je=(0,M.useCallback)(async function(){if("unregisterLocation"in ne){me(!0);try{await ne.unregisterLocation(),C()}catch(Nt){(0,Wn.BD)(Nt),D.post({message:Nt.message})}finally{me(!1)}}},[D,C,ne]),ot=(0,M.useCallback)(async function(){if("deleteEntity"in ne){me(!0);try{await ne.deleteEntity(),C()}catch(Nt){(0,Wn.BD)(Nt),D.post({message:Nt.message})}finally{me(!1)}}},[D,C,ne]),$e=()=>(0,l.jsx)(we.Z,{className:se.dialogActions,children:(0,l.jsx)(G.Z,{onClick:O,color:"primary",children:"Cancel"})});return ne.type==="loading"?(0,l.jsx)($.Ex,{}):ne.type==="error"?(0,l.jsx)($.Gk,{error:ne.error}):ne.type==="bootstrap"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(yr.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',ne.location,'"). If you believe this is in error, please contact the ',nt," ","integrator."]}),(0,l.jsxs)(B.Z,{marginTop:2,children:[!ge&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(G.Z,{variant:"text",size:"small",color:"primary",className:se.advancedButton,onClick:()=>Ce(!0),children:"Advanced Options"}),(0,l.jsx)($e,{})]}),ge&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Se.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)(G.Z,{variant:"contained",color:"secondary",disabled:Ie,onClick:ot,children:"Delete Entity"}),(0,l.jsx)($e,{})]})]})]}):ne.type==="only-delete"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Se.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)(G.Z,{variant:"contained",color:"secondary",disabled:Ie,onClick:ot,children:"Delete Entity"}),(0,l.jsx)($e,{})]}):ne.type==="unregister"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Se.Z,{children:"This action will unregister the following entities:"}),(0,l.jsx)(Se.Z,{component:"ul",children:ne.colocatedEntities.map(xt=>(0,l.jsx)("li",{children:(0,l.jsx)(Fe,{entityRef:xt})},`${xt.kind}:${xt.namespace}/${xt.name}`))}),(0,l.jsx)(Se.Z,{children:"Located at the following location:"}),(0,l.jsx)(Se.Z,{component:"ul",children:(0,l.jsx)("li",{children:ne.location})}),(0,l.jsxs)(Se.Z,{children:["To undo, just re-register the entity in ",nt,"."]}),(0,l.jsxs)(B.Z,{marginTop:2,children:[(0,l.jsx)(G.Z,{variant:"contained",color:"secondary",disabled:Ie,onClick:Je,children:"Unregister Location"}),!ge&&(0,l.jsx)(B.Z,{component:"span",marginLeft:2,children:(0,l.jsx)(G.Z,{variant:"text",size:"small",color:"primary",className:se.advancedButton,onClick:()=>Ce(!0),children:"Advanced Options"})})]}),ge&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(B.Z,{paddingTop:4,paddingBottom:4,children:(0,l.jsx)(Io.Z,{})}),(0,l.jsx)(Se.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)(G.Z,{variant:"contained",color:"secondary",disabled:Ie,onClick:ot,children:"Delete Entity"})]})]}):(0,l.jsx)(yr.Z,{severity:"error",children:"Internal error: Unknown state"})},es=S=>{const{open:C,onConfirm:O,onClose:D,entity:_}=S;return(0,l.jsxs)(u.Z,{open:C,onClose:D,children:[(0,l.jsx)(x.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,l.jsx)(A.Z,{children:(0,l.jsx)(Ln,{entity:_,onConfirm:O,onClose:D})})]})};var ts=t(12231),ns=t(9520),rs=t(47603);const os=(0,Pe.Z)(S=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:S.spacing(1,0,1,0)},title:{margin:S.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:S.palette.text.primary},menuItem:{minHeight:S.spacing(6)},groupWrapper:{margin:S.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function ir(S){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:rs.Z},{id:"starred",label:"Starred",icon:xn.Z}]},{name:S!=null?S:"Company",items:[{id:"all",label:"All"}]}]}const Lo=S=>{const{initialFilter:C,availableFilters:O}=S,D=os(),_=(0,r.h_)(r.Ds);var se;const ne=(se=_.getOptionalString("organization.name"))!==null&&se!==void 0?se:"Company",{filters:ge,updateFilters:Ce,backendEntities:Ie,queryParameters:{kind:me,user:ke},loading:nt}=$t(),Je=["starred","all"],ot=ir(ne).map(kn=>({...kn,items:kn.items.filter(({id:Dn})=>["group","user"].some(Sr=>Sr===me)?Je.includes(Dn):!O||O.includes(Dn))})).filter(({items:kn})=>!!kn.length),{isStarredEntity:$e}=wn(),{isOwnedEntity:xt,loading:Nt}=jn(),fn=nt||Nt,qt=(0,M.useMemo)(()=>new ze("owned",xt,$e),[xt,$e]),Pn=(0,M.useMemo)(()=>new ze("starred",xt,$e),[xt,$e]),gn=(0,M.useMemo)(()=>[ke].flat()[0],[ke]),[En,An]=(0,M.useState)(gn!=null?gn:C),mr=(0,M.useMemo)(()=>Ie.filter((0,je.Gz)((0,Ze.compact)(Object.values({...ge,user:void 0})))),[ge,Ie]),$r=(0,M.useMemo)(()=>({all:mr.length,starred:mr.filter(kn=>Pn.filterEntity(kn)).length,owned:mr.filter(kn=>qt.filterEntity(kn)).length}),[mr,Pn,qt]);(0,M.useEffect)(()=>{gn&&An(gn)},[gn]),(0,M.useEffect)(()=>{!fn&&En&&En!=="all"&&$r[En]===0&&An("all")},[fn,$r,En,An]),(0,M.useEffect)(()=>{Ce({user:En?new ze(En,xt,$e):void 0})},[En,xt,$e,Ce]);var lo;return(0,l.jsx)(Wr.Z,{className:D.root,children:ot.map(kn=>(0,l.jsxs)(M.Fragment,{children:[(0,l.jsx)(Y.Z,{variant:"subtitle2",component:"span",className:D.title,children:kn.name}),(0,l.jsx)(Wr.Z,{className:D.groupWrapper,children:(0,l.jsx)(or.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":kn.name,children:kn.items.map(Dn=>{var Sr;return(0,l.jsxs)(ts.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>An(Dn.id),selected:Dn.id===((Sr=ge.user)===null||Sr===void 0?void 0:Sr.value),className:D.menuItem,disabled:$r[Dn.id]===0,"data-testid":`user-picker-${Dn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Dn.icon&&(0,l.jsx)(sr.Z,{className:D.listIcon,children:(0,l.jsx)(Dn.icon,{fontSize:"small"})}),(0,l.jsx)(Tr.Z,{children:(0,l.jsxs)(Y.Z,{variant:"body1",children:[Dn.label," "]})}),(0,l.jsx)(ns.Z,{children:(lo=$r[Dn.id])!==null&&lo!==void 0?lo:"-"})]},Dn.id)})})})]},kn.name))})},ao=(0,Pe.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Or=(0,l.jsx)(ce.Z,{fontSize:"small"}),ss=(0,l.jsx)(Rt.Z,{fontSize:"small"}),Br=()=>{const S=ao(),{updateFilters:C}=$t(),[O,D]=(0,M.useState)([]);function _(ge){C({orphan:ge?new xe(ge):void 0})}function se(ge){C({error:ge?new Te(ge):void 0})}const ne=["Is Orphan","Has Error"];return(0,l.jsx)(B.Z,{pb:1,pt:1,children:(0,l.jsxs)(Y.Z,{variant:"button",component:"label",children:["Processing Status",(0,l.jsx)(he.ZP,{multiple:!0,disableCloseOnSelect:!0,options:ne,value:O,onChange:(ge,Ce)=>{D(Ce),_(Ce.includes("Is Orphan")),se(Ce.includes("Has Error"))},renderOption:(ge,{selected:Ce})=>(0,l.jsx)(Ge.Z,{control:(0,l.jsx)(ft.Z,{icon:Or,checkedIcon:ss,checked:Ce}),label:ge}),size:"small",popupIcon:(0,l.jsx)(U.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:ge=>(0,l.jsx)(Ht.Z,{...ge,className:S.input,variant:"outlined"})})]})})};function Po({children:S,value:C}){var O;const[D,_]=useState((O=C==null?void 0:C.filters)!==null&&O!==void 0?O:{}),se=useCallback(Je=>{_(ot=>{const $e=typeof Je=="function"?Je(ot):Je;return{...ot,...$e}})},[]),ne=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var ge,Ce,Ie,me,ke;const nt=useMemo(()=>({entities:(ge=C==null?void 0:C.entities)!==null&&ge!==void 0?ge:ne.entities,backendEntities:(Ce=C==null?void 0:C.backendEntities)!==null&&Ce!==void 0?Ce:ne.backendEntities,updateFilters:(Ie=C==null?void 0:C.updateFilters)!==null&&Ie!==void 0?Ie:se,filters:D,loading:(me=C==null?void 0:C.loading)!==null&&me!==void 0?me:!1,queryParameters:(ke=C==null?void 0:C.queryParameters)!==null&&ke!==void 0?ke:ne.queryParameters,error:C==null?void 0:C.error}),[C,ne,D,se]);return _jsx(EntityListContext.Provider,{value:nt,children:S})}},75435:function(bt,Be,t){"use strict";t.d(Be,{h:function(){return r}});var h=t(25271);function r(F,L,m){var y;let l=(F==null||(y=F.relations)===null||y===void 0?void 0:y.filter(M=>M.type===L).map(M=>(0,h.of)(M.targetRef)))||[];return m!=null&&m.kind&&(l=l.filter(M=>M.kind.toLocaleLowerCase("en-US")===m.kind.toLocaleLowerCase("en-US"))),l}},49280:function(bt,Be,t){"use strict";t.d(Be,{hF:function(){return F.h},CV:function(){return m},wq:function(){return h},Gz:function(){return r}});function h(l){return l.reduce((M,be)=>({...M,...be.getCatalogFilters?be.getCatalogFilters():{}}),{})}function r(l){return M=>l.every(be=>!be.filterEntity||be.filterEntity(M))}var F=t(75435),L=t(25271);function m(l,M){var be;const V=(be=l.metadata.annotations)===null||be===void 0?void 0:be[L.M6];if(V)try{const G=(0,L.Ou)(V),b=M.byUrl(G.target);return{locationTargetUrl:G.target,integrationType:b==null?void 0:b.type}}catch{return}}function y(l,M){const be=new Set([...getEntityRelations(l,RELATION_MEMBER_OF,{kind:"group"}),...l?[getCompoundEntityRef(l)]:[]].map(stringifyEntityRef)),V=getEntityRelations(M,RELATION_OWNED_BY).map(stringifyEntityRef);for(const G of V)if(be.has(G))return!0;return!1}},33414:function(bt,Be,t){"use strict";t.r(Be),t.d(Be,{AboutCard:function(){return jt},AboutContent:function(){return it},AboutField:function(){return re}});var h=t(52322),r=t(25271),F=t(23196),L=t(60871),m=t(32838),y=t(40303),l=t(79692),M=t(94339),be=t(32552),V=t(61837),G=t(85256),b=t(24579),B=t(52866),Y=t(30254),le=t(27604),ee=t(2784),X=t(19625),j=t(60905),P=t(7089),$=t(90436);const T=(0,l.Z)(He=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:He.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function re(He){const{label:st,value:je,gridSizes:Et,children:St}=He,gt=T(),yt=(0,L.vJ)(St,Lt=>Lt.getElements()),At=yt.length>0?yt:(0,h.jsx)($.Z,{variant:"body2",className:gt.value,children:je||"unknown"});return(0,h.jsxs)(j.Z,{item:!0,...Et,children:[(0,h.jsx)($.Z,{variant:"h2",className:gt.label,children:st}),At]})}var Re=t(24851);const Xe=(0,l.Z)({description:{wordBreak:"break-word"}});function _e(He,st,je){if(st==="url"||He.includes("://"))return He;const Et=je.type==="file"?`file://${je.target}`:je.target;return st==="file"||je.type==="file"?new URL(He,Et).href:Et}function it(He){var st,je,Et,St,gt,yt,At,Lt;const{entity:ze}=He,xe=Xe(),Te=ze.kind.toLocaleLowerCase("en-US")==="system",Ae=ze.kind.toLocaleLowerCase("en-US")==="resource",Ze=ze.kind.toLocaleLowerCase("en-US")==="component",rt=ze.kind.toLocaleLowerCase("en-US")==="api",zt=ze.kind.toLocaleLowerCase("en-US")==="template",pt=ze.kind.toLocaleLowerCase("en-US")==="location",Pt=ze.kind.toLocaleLowerCase("en-US")==="group",mt=(0,y.hF)(ze,r.cz,{kind:"system"}),It=(0,y.hF)(ze,r.cz,{kind:"component"}),en=(0,y.hF)(ze,r.cz,{kind:"domain"}),on=(0,y.hF)(ze,r.S4);let vn;try{vn=(0,r.CV)(ze)}catch{vn=void 0}return(0,h.jsxs)(j.Z,{container:!0,children:[(0,h.jsx)(re,{label:"Description",gridSizes:{xs:12},children:(0,h.jsx)(F.SA,{className:xe.description,content:(ze==null||(st=ze.metadata)===null||st===void 0?void 0:st.description)||"No description"})}),(0,h.jsx)(re,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:on.length>0&&(0,h.jsx)(y.rI,{entityRefs:on,defaultKind:"group"})}),(Te||en.length>0)&&(0,h.jsx)(re,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:en.length>0&&(0,h.jsx)(y.rI,{entityRefs:en,defaultKind:"domain"})}),(rt||Ze||Ae||mt.length>0)&&(0,h.jsx)(re,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:mt.length>0&&(0,h.jsx)(y.rI,{entityRefs:mt,defaultKind:"system"})}),Ze&&It.length>0&&(0,h.jsx)(re,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,h.jsx)(y.rI,{entityRefs:It,defaultKind:"component"})}),(rt||Ze||Ae||zt||Pt||pt||typeof(ze==null||(je=ze.spec)===null||je===void 0?void 0:je.type)=="string")&&(0,h.jsx)(re,{label:"Type",value:ze==null||(Et=ze.spec)===null||Et===void 0?void 0:Et.type,gridSizes:{xs:12,sm:6,lg:4}}),(rt||Ze||typeof(ze==null||(St=ze.spec)===null||St===void 0?void 0:St.lifecycle)=="string")&&(0,h.jsx)(re,{label:"Lifecycle",value:ze==null||(gt=ze.spec)===null||gt===void 0?void 0:gt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,h.jsx)(re,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((ze==null||(yt=ze.metadata)===null||yt===void 0?void 0:yt.tags)||[]).map($t=>(0,h.jsx)(P.Z,{size:"small",label:$t},$t))}),pt&&((ze==null||(At=ze.spec)===null||At===void 0?void 0:At.targets)||(ze==null||(Lt=ze.spec)===null||Lt===void 0?void 0:Lt.target))&&(0,h.jsx)(re,{label:"Targets",gridSizes:{xs:12},children:(0,h.jsx)(Re.s,{cols:1,items:(ze.spec.targets||[ze.spec.target]).map($t=>$t).map($t=>{var pn;return{text:$t,href:_e($t,(ze==null||(pn=ze.spec)===null||pn===void 0?void 0:pn.type)||"unknown",vn)}})})})]})}const Fe=(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 jt(He){var st,je,Et;const{variant:St}=He,gt=Fe(),{entity:yt}=(0,y.X2)(),At=(0,L.h_)(m.q3),Lt=(0,L.h_)(y.Ah),ze=(0,L.h_)(L.$v),xe=(0,L.h_)(L.VE),Te=(0,L.tg)(X.jU),Ae=(0,y.CV)(yt,At),Ze=(st=yt.metadata.annotations)===null||st===void 0?void 0:st[r.Tf],rt={label:"View Source",disabled:!Ae,icon:(0,h.jsx)(m.nW,{type:Ae==null?void 0:Ae.integrationType}),href:Ae==null?void 0:Ae.locationTargetUrl},zt={label:"View TechDocs",disabled:!(!((je=yt.metadata.annotations)===null||je===void 0)&&je["backstage.io/techdocs-ref"])||!Te,icon:(0,h.jsx)(Y.Z,{}),href:Te&&Te({namespace:yt.metadata.namespace||r.zG,kind:yt.kind,name:yt.metadata.name})};let pt="";St==="gridItem"?pt=gt.gridItemCard:St==="fullHeight"&&(pt=gt.fullHeightCard);let Pt="";St==="gridItem"?Pt=gt.gridItemCardContent:St==="fullHeight"&&(Pt=gt.fullHeightCardContent);const mt=(Et=yt.metadata.annotations)===null||Et===void 0?void 0:Et[r.P1],It=(mt==null?void 0:mt.startsWith("url:"))||(mt==null?void 0:mt.startsWith("file:")),en=(0,ee.useCallback)(async()=>{try{await Lt.refreshEntity((0,r.eE)(yt)),ze.post({message:"Refresh scheduled",severity:"info"})}catch(on){xe.post(on)}},[Lt,ze,xe,yt]);return(0,h.jsxs)(M.Z,{className:pt,children:[(0,h.jsx)(be.Z,{title:"About",action:(0,h.jsxs)(h.Fragment,{children:[It&&(0,h.jsx)(V.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:en,children:(0,h.jsx)(B.Z,{})}),(0,h.jsx)(V.Z,{component:F.rU,"aria-label":"Edit",disabled:!Ze,title:"Edit Metadata",to:Ze!=null?Ze:"#",children:(0,h.jsx)(le.Z,{})})]}),subheader:(0,h.jsx)(F.M6,{links:[rt,zt]})}),(0,h.jsx)(G.Z,{}),(0,h.jsx)(b.Z,{className:Pt,children:(0,h.jsx)(it,{entity:yt})})]})}},86359:function(bt,Be,t){"use strict";t.d(Be,{E:function(){return X}});var h=t(52322),r=t(25271),F=t(23196),L=t(40303),m=t(90436),y=t(15459),l=t(27604),M=t(2997),be=t(11640),V=t(28347),G=t(76635),b=t(2784),B=t(7089);const Y=Object.freeze({createNameColumn(j){function P($){var T;return((T=$.metadata)===null||T===void 0?void 0:T.title)||(0,L.$3)($,{defaultKind:j==null?void 0:j.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:$},{entity:T}){return P($).localeCompare(P(T))},render:({entity:$})=>{var T;return(0,h.jsx)(L.dx,{entityRef:$,defaultKind:(j==null?void 0:j.defaultKind)||"Component",title:(T=$.metadata)===null||T===void 0?void 0:T.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:j})=>(0,h.jsx)(L.rI,{entityRefs:j.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:j})=>(0,h.jsx)(L.rI,{entityRefs:j.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:j})=>{var P,$;return(0,h.jsx)(h.Fragment,{children:((j==null||(P=j.spec)===null||P===void 0?void 0:P.targets)||(j==null||($=j.spec)===null||$===void 0?void 0:$.target))&&(0,h.jsx)(F.Or,{text:(j.spec.targets||[j.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:j})=>(0,h.jsx)(F.Or,{text:j.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:j})=>(0,h.jsx)(h.Fragment,{children:j.metadata.tags&&j.metadata.tags.map(P=>(0,h.jsx)(B.Z,{label:P,size:"small",variant:"outlined",style:{marginBottom:"0px"}},P))}),width:"auto"}},createTitleColumn(j){return{title:"Title",field:"entity.metadata.title",hidden:j==null?void 0:j.hidden,searchable:!0}},createLabelColumn(j,P){return{title:(P==null?void 0:P.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:$})=>{var T;const re=(T=$.metadata)===null||T===void 0?void 0:T.labels,Re=re&&re[j]||(P==null?void 0:P.defaultValue);return(0,h.jsx)(h.Fragment,{children:Re&&(0,h.jsx)(B.Z,{label:Re,size:"small",variant:"outlined"},Re)})},width:"auto"}}}),le=(0,y.Z)({root:{color:"#f3ba37"}})(be.Z),ee=(j,P)=>{const $=T=>T.metadata.title||(0,L.$3)(T,{defaultKind:"Component"});return $(j).localeCompare($(P))},X=j=>{var P,$;const{columns:T,actions:re,tableOptions:Re,subtitle:Xe,emptyContent:_e}=j,{isStarredEntity:it,toggleStarredEntity:Fe}=(0,L.CR)(),{loading:jt,error:He,entities:st,filters:je}=(0,L.wp)(),Et=(0,b.useMemo)(()=>{var Te;return[Y.createTitleColumn({hidden:!0}),Y.createNameColumn({defaultKind:(Te=je.kind)===null||Te===void 0?void 0:Te.value}),...Ae(),Y.createMetadataDescriptionColumn(),Y.createTagsColumn()];function Ae(){var Ze;switch((Ze=je.kind)===null||Ze===void 0?void 0:Ze.value){case"user":return[];case"domain":case"system":return[Y.createOwnerColumn()];case"group":case"template":return[Y.createSpecTypeColumn()];case"location":return[Y.createSpecTypeColumn(),Y.createSpecTargetsColumn()];default:return[Y.createSystemColumn(),Y.createOwnerColumn(),Y.createSpecTypeColumn(),Y.createSpecLifecycleColumn()]}}},[(P=je.kind)===null||P===void 0?void 0:P.value]),St=je.type===void 0;var gt;const yt=(0,G.capitalize)((gt=($=je.user)===null||$===void 0?void 0:$.value)!==null&>!==void 0?gt:"all");if(He)return(0,h.jsx)("div",{children:(0,h.jsx)(F.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,h.jsx)(F.Oi,{language:"text",text:He.toString()})})});const At=[({entity:Te})=>{var Ae;const Ze=(Ae=Te.metadata.annotations)===null||Ae===void 0?void 0:Ae[r.l2],rt="View";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(m.Z,{variant:"srOnly",children:rt}),(0,h.jsx)(M.Z,{fontSize:"small"})]}),tooltip:rt,disabled:!Ze,onClick:()=>{Ze&&window.open(Ze,"_blank")}}},({entity:Te})=>{var Ae;const Ze=(Ae=Te.metadata.annotations)===null||Ae===void 0?void 0:Ae[r.Tf],rt="Edit";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(m.Z,{variant:"srOnly",children:rt}),(0,h.jsx)(l.Z,{fontSize:"small"})]}),tooltip:rt,disabled:!Ze,onClick:()=>{Ze&&window.open(Ze,"_blank")}}},({entity:Te})=>{const Ae=it(Te),Ze=Ae?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(m.Z,{variant:"srOnly",children:Ze}),Ae?(0,h.jsx)(le,{}):(0,h.jsx)(V.Z,{})]}),tooltip:Ze,onClick:()=>Fe(Te)}}],Lt=st.sort(ee).map(Te=>{const Ae=(0,L.hF)(Te,r.cz,{kind:"system"}),Ze=(0,L.hF)(Te,r.S4);return{entity:Te,resolved:{name:(0,L.$3)(Te,{defaultKind:"Component"}),ownedByRelationsTitle:Ze.map(rt=>(0,L.$3)(rt,{defaultKind:"group"})).join(", "),ownedByRelations:Ze,partOfSystemRelationTitle:Ae.map(rt=>(0,L.$3)(rt,{defaultKind:"system"})).join(", "),partOfSystemRelations:Ae}}}),ze=(T||Et).find(Te=>Te.title==="Type");ze&&(ze.hidden=!St);const xe=Lt.length>20;return(0,h.jsx)(F.iA,{isLoading:jt,columns:T||Et,options:{paging:xe,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!jt,padding:"dense",pageSizeOptions:[20,50,100],...Re},title:`${yt} (${st.length})`,data:Lt,actions:re||At,subtitle:Xe,emptyContent:_e})};X.columns=Y},85877:function(bt,Be,t){"use strict";t.r(Be),t.d(Be,{EntityLabelsCard:function(){return b},hasLabels:function(){return B}});var h=t(52322),r=t(40303),F=t(2784),L=t(23196),m=t(79692),y=t(90436),l=t(77277);const M=`metadata:
|
|
34
|
-
name: example
|
|
35
|
-
labels:
|
|
36
|
-
javaVersion: 1.2.3`,be=(0,m.Z)(Y=>({code:{borderRadius:6,margin:`${Y.spacing(2)}px 0px`,background:Y.palette.type==="dark"?"#444":Y.palette.common.white}}),{name:"PluginCatalogEntityLabelsEmptyState"});function V(){const Y=be();return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(y.Z,{variant:"body1",children:"No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:"}),(0,h.jsx)("div",{className:Y.code,children:(0,h.jsx)(L.Oi,{text:M,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,h.jsx)(l.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:"Read more"})]})}const G=(0,m.Z)(Y=>({key:{fontWeight:"bold"}})),b=Y=>{var le;const{variant:ee,title:X}=Y,{entity:j}=(0,r.X2)(),P=G(),$=[{render:re=>(0,h.jsx)(y.Z,{className:P.key,variant:"body2",children:re.key})},{field:"value"}],T=j==null||(le=j.metadata)===null||le===void 0?void 0:le.labels;return(0,h.jsx)(L.rJ,{title:X||"Labels",variant:ee,children:!T||Object.keys(T).length===0?(0,h.jsx)(V,{}):(0,h.jsx)(L.iA,{columns:$,data:Object.keys(T).map(re=>({key:re,value:T[re]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(T).length>5}})})};function B(Y){var le,ee;return!(Y==null||(le=Y.metadata)===null||le===void 0)&&le.labels?Object.keys(Y==null||(ee=Y.metadata)===null||ee===void 0?void 0:ee.labels).some(Boolean):!1}},24851:function(bt,Be,t){"use strict";t.d(Be,{s:function(){return le}});var h=t(52322),r=t(90348),F=t(11861),L=t(2784),m=t(79692),y=t(95544),l=t(90436),M=t(52160),be=t(23196);const V=(0,m.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function G(ee){const{href:X,text:j,Icon:P}=ee,$=V();return(0,h.jsxs)(y.Z,{display:"flex",children:[(0,h.jsx)(y.Z,{mr:1,className:$.svgIcon,children:(0,h.jsx)(l.Z,{component:"div",children:P?(0,h.jsx)(P,{}):(0,h.jsx)(M.Z,{})})}),(0,h.jsx)(y.Z,{flexGrow:"1",children:(0,h.jsx)(be.rU,{to:X,target:"_blank",rel:"noopener",children:j||X})})]})}var b=t(41156);const B={xs:1,sm:1,md:1,lg:2,xl:3};function Y(ee){const X=[(0,b.Z)(T=>T.breakpoints.up("xl"))?"xl":null,(0,b.Z)(T=>T.breakpoints.up("lg"))?"lg":null,(0,b.Z)(T=>T.breakpoints.up("md"))?"md":null,(0,b.Z)(T=>T.breakpoints.up("sm"))?"sm":null,(0,b.Z)(T=>T.breakpoints.up("xs"))?"xs":null];let j=1;if(typeof ee=="number")j=ee;else{var P;const T=(P=X.find(re=>re!==null))!==null&&P!==void 0?P:"xs";var $;j=($=ee==null?void 0:ee[T])!==null&&$!==void 0?$:B[T]}return j}function le(ee){const{items:X,cols:j=void 0}=ee,P=Y(j);return(0,h.jsx)(r.Z,{rowHeight:"auto",cols:P,children:X.map(({text:$,href:T,Icon:re},Re)=>(0,h.jsx)(F.Z,{children:(0,h.jsx)(G,{href:T,text:$!=null?$:T,Icon:re})},Re))})}},19625:function(bt,Be,t){"use strict";t.d(Be,{_Z:function(){return L},jU:function(){return F},yw:function(){return r}});var h=t(60871);const r=(0,h.x8)({id:"create-component",optional:!0}),F=(0,h.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),L=(0,h.NT)({id:"catalog"})},15096:function(bt,Be,t){"use strict";t.d(Be,{FA:function(){return be},qO:function(){return gt},Nd:function(){return it},E5:function(){return tn},Rx:function(){return T}});var h=t(60871);const r=(0,h.T0)({id:"plugin.search.queryservice"});class F{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(W){this.mockedResults=W}}var L=t(52322),m=t(2784),y=t(38402),l=t(79692);const M=(0,l.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),be=({text:q,preTag:W,postTag:de})=>{const g=M(),R=(0,m.useMemo)(()=>q.split(new RegExp(`(${W}.+?${de})`)),[de,W,q]);return(0,L.jsx)(L.Fragment,{children:R.map((J,K)=>J.includes(W)?(0,L.jsx)("mark",{className:g.highlight,children:J.replace(new RegExp(`${W}|${de}`,"g"),"")},K):J)})};var V=t(48760),G=t(50581),b=t(61837),B=t(74603),Y=t(21853),le=t(33375),ee=t(76635),X=t(64279),j=t(1849),P=t(51837);const $=(0,P.CT)("search-context"),T=()=>{const q=(0,m.useContext)($);if(!q)throw new Error("useSearch must be used within a SearchContextProvider");const W=q.atVersion(1);if(!W)throw new Error("No SearchContext v1 found");return W},re=()=>(0,m.useContext)($)!==void 0,Re={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},Xe=(q=Re)=>{var W,de,g,R;const J=(0,h.h_)(r),[K,ae]=(0,m.useState)(q.term),[fe,Ue]=(0,m.useState)(q.types),[Ye,ut]=(0,m.useState)(q.filters),[vt,et]=(0,m.useState)(q.pageLimit),[qe,Ne]=(0,m.useState)(q.pageCursor),Zt=(0,j.Z)(K),Kt=(0,j.Z)(Ye),kt=(0,X.default)(()=>J.query({term:K,types:fe,filters:Ye,pageLimit:vt,pageCursor:qe}),[K,fe,Ye,vt,qe]),Dt=!kt.loading&&!kt.error&&((W=kt.value)===null||W===void 0?void 0:W.nextPageCursor),Wt=!kt.loading&&!kt.error&&((de=kt.value)===null||de===void 0?void 0:de.previousPageCursor),Gt=(0,m.useCallback)(()=>{var Ut;Ne((Ut=kt.value)===null||Ut===void 0?void 0:Ut.nextPageCursor)},[(g=kt.value)===null||g===void 0?void 0:g.nextPageCursor]),ht=(0,m.useCallback)(()=>{var Ut;Ne((Ut=kt.value)===null||Ut===void 0?void 0:Ut.previousPageCursor)},[(R=kt.value)===null||R===void 0?void 0:R.previousPageCursor]);return(0,m.useEffect)(()=>{Zt!==void 0&&K!==Zt&&Ne(void 0)},[K,Zt,Ne]),(0,m.useEffect)(()=>{Kt!==void 0&&!(0,ee.isEqual)(Ye,Kt)&&Ne(void 0)},[Ye,Kt,Ne]),{result:kt,term:K,setTerm:ae,types:fe,setTypes:Ue,filters:Ye,setFilters:ut,pageLimit:vt,setPageLimit:et,pageCursor:qe,setPageCursor:Ne,fetchNextPage:Dt?Gt:void 0,fetchPreviousPage:Wt?ht:void 0}},_e=q=>{const{initialState:W,children:de}=q,g=Xe(W);return(0,L.jsx)(h.fC,{attributes:{searchTypes:g.types.sort().join(",")},children:(0,L.jsx)($.Provider,{value:(0,P.EI)({1:g}),children:de})})},it=q=>{const{initialState:W,inheritParentContextIfAvailable:de,children:g}=q;return re()&&de?(0,L.jsx)(L.Fragment,{children:g}):(0,L.jsx)(_e,{initialState:W,children:g})},Fe=({children:q})=>{var W;const de=Ye=>(0,j.Z)(Ye)!==Ye,g=(0,h.z$)(),{term:R,result:J}=T();var K;const ae=(K=(W=J.value)===null||W===void 0?void 0:W.numberOfResults)!==null&&K!==void 0?K:void 0,Ue=de(J.loading)&&!J.loading;return(0,m.useEffect)(()=>{R&&Ue&&g.captureEvent("search",R,{value:ae})},[g,R,ae,Ue]),(0,L.jsx)(L.Fragment,{children:q})};function jt(q){return(0,m.forwardRef)((W,de)=>(0,L.jsx)(it,{inheritParentContextIfAvailable:!0,children:(0,L.jsx)(q,{...W,ref:de})}))}const He=jt((0,m.forwardRef)((q,W)=>{const{onChange:de,onKeyDown:g=()=>{},onClear:R=()=>{},onSubmit:J=()=>{},debounceTime:K=200,clearButton:ae=!0,fullWidth:fe=!0,value:Ue,placeholder:Ye,inputProps:ut={},endAdornment:vt,...et}=q,qe=(0,h.h_)(h.Ds),[Ne,Zt]=(0,m.useState)("");(0,m.useEffect)(()=>{Zt(We=>We!==Ue?String(Ue):We)},[Ue]),(0,V.Z)(()=>de(Ne),K,[Ne]);const Kt=(0,m.useCallback)(We=>{Zt(We.target.value)},[Zt]),kt=(0,m.useCallback)(We=>{g&&g(We),J&&We.key==="Enter"&&J()},[g,J]),Dt=(0,m.useCallback)(()=>{de(""),R&&R()},[de,R]),Wt=Ye!=null?Ye:`Search in ${qe.getOptionalString("app.title")||"Backstage"}`,Gt=(0,L.jsx)(G.Z,{position:"start",children:(0,L.jsx)(b.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,L.jsx)(Y.Z,{})})}),ht=(0,L.jsx)(G.Z,{position:"end",children:(0,L.jsx)(b.Z,{"aria-label":"Clear",size:"small",onClick:Dt,children:(0,L.jsx)(le.Z,{})})});return(0,L.jsx)(Fe,{children:(0,L.jsx)(B.Z,{"data-testid":"search-bar-next",ref:W,value:Ne,placeholder:Wt,startAdornment:Gt,endAdornment:ae?ht:vt,inputProps:{"aria-label":"Search",...ut},fullWidth:fe,onChange:Kt,onKeyDown:kt,...et})})})),st=jt((0,m.forwardRef)((q,W)=>{const{value:de="",onChange:g,...R}=q,{term:J,setTerm:K}=T();(0,m.useEffect)(()=>{de&&K(String(de))},[de,K]);const ae=(0,m.useCallback)(fe=>{g?g(fe):K(fe)},[g,K]);return(0,L.jsx)(h.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,L.jsx)(He,{...R,ref:W,value:J,onChange:ae})})}));var je=t(4614),Et=t(88013);const gt=(q=>W=>(0,L.jsx)(it,{inheritParentContextIfAvailable:!0,children:(0,L.jsx)(q,{...W})}))(function(W){const{loading:de,value:g,onChange:R=()=>{},options:J=[],getOptionLabel:K=Dt=>String(Dt),inputPlaceholder:ae,inputDebounceTime:fe,freeSolo:Ue=!0,fullWidth:Ye=!0,clearOnBlur:ut=!1,"data-testid":vt="search-autocomplete",...et}=W,{setTerm:qe}=T(),Ne=(0,m.useCallback)(Dt=>Dt?typeof Dt=="string"?Dt:K(Dt):"",[K]),Zt=(0,m.useMemo)(()=>Ne(g),[g,Ne]),Kt=(0,m.useCallback)((Dt,Wt,Gt,ht)=>{qe(Ne(Wt)),R(Dt,Wt,Gt,ht)},[Ne,qe,R]),kt=(0,m.useCallback)(({InputProps:{ref:Dt,endAdornment:Wt},InputLabelProps:Gt,...ht})=>(0,L.jsx)(st,{...ht,ref:Dt,clearButton:!1,value:Zt,placeholder:ae,debounceTime:fe,endAdornment:de?(0,L.jsx)(je.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):Wt}),[de,Zt,ae,fe]);return(0,L.jsx)(Et.ZP,{...et,"data-testid":vt,value:g,onChange:Kt,options:J,getOptionLabel:K,renderInput:kt,freeSolo:Ue,fullWidth:Ye,clearOnBlur:ut})}),yt=({icon:q,primaryText:W,primaryTextTypographyProps:de,secondaryText:g,secondaryTextTypographyProps:R,disableTextTypography:J})=>_jsxs(_Fragment,{children:[q?_jsx(ListItemIcon,{children:q}):null,_jsx(ListItemText,{primary:W,primaryTypographyProps:de,secondary:g,secondaryTypographyProps:R,disableTypography:J})]});var At=t(42494),Lt=t(84899),ze=t(5806),xe=t(21324),Te=t(56939),Ae=t(73698),Ze=t(12231),rt=t(86619),zt=t(7089),pt=t(69294);const Pt=(q,W,de=[],g=250)=>{const R=(0,m.useRef)({}),J=q||(()=>Promise.resolve([])),[K,ae]=(0,pt.default)(J,[W],{loading:!0});if((0,V.Z)(()=>{R.current[W]===void 0&&(R.current[W]=ae(W).then(Ue=>(R.current[W]=Ue,Ue)))},g,[ae,W]),de.length)return{loading:!1,value:de};const fe=R.current[W];return Array.isArray(fe)?{loading:!1,value:fe}:K},mt=(q,W)=>{const{setFilters:de}=T();(0,m.useEffect)(()=>{W&&[W].flat().length>0&&de(g=>({...g,[q]:W}))},[])},It=q=>{const{className:W,defaultValue:de,name:g,values:R,valuesDebounceMs:J,label:K,filterSelectedOptions:ae,limitTags:fe,multiple:Ue}=q,[Ye,ut]=(0,m.useState)("");mt(g,de);const vt=typeof R=="function"?R:void 0,et=typeof R=="function"?void 0:R,{value:qe,loading:Ne}=Pt(vt,Ye,et,J),{filters:Zt,setFilters:Kt}=T(),kt=Zt[g]||(Ue?[]:null),Dt=(ht,We)=>{Kt(Ut=>{const{[g]:cn,...yn}=Ut;return We?{...yn,[g]:We}:{...yn}})},Wt=ht=>(0,L.jsx)(rt.Z,{...ht,name:"search",variant:"outlined",label:K,fullWidth:!0}),Gt=(ht,We)=>ht.map((Ut,cn)=>(0,L.jsx)(zt.Z,{label:Ut,color:"primary",...We({index:cn})}));return(0,L.jsx)(Et.ZP,{filterSelectedOptions:ae,limitTags:fe,multiple:Ue,className:W,id:`${Ue?"multi-":""}select-filter-${g}--select`,options:qe||[],loading:Ne,value:kt,onChange:Dt,onInputChange:(ht,We)=>ut(We),renderInput:Wt,renderTags:Gt})},en=(0,l.Z)({label:{textTransform:"capitalize"}}),on=q=>{const{className:W,defaultValue:de,label:g,name:R,values:J=[],valuesDebounceMs:K}=q,ae=en(),{filters:fe,setFilters:Ue}=T();mt(R,de);const Ye=typeof J=="function"?J:void 0,ut=typeof J=="function"?void 0:J,{value:vt=[],loading:et}=Pt(Ye,"",ut,K),qe=Zt=>{const{target:{value:Kt,checked:kt}}=Zt;Ue(Dt=>{const{[R]:Wt,...Gt}=Dt,ht=(Wt||[]).filter(Ut=>Ut!==Kt),We=kt?[...ht,Kt]:ht;return We.length?{...Gt,[R]:We}:Gt})};var Ne;return(0,L.jsxs)(At.Z,{className:W,disabled:et,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[g?(0,L.jsx)(Lt.Z,{className:ae.label,children:g}):null,vt.map(Zt=>(0,L.jsx)(ze.Z,{control:(0,L.jsx)(xe.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":Zt},value:Zt,name:Zt,onChange:qe,checked:((Ne=fe[R])!==null&&Ne!==void 0?Ne:[]).includes(Zt)}),label:Zt},Zt))]})},vn=q=>{const{className:W,defaultValue:de,label:g,name:R,values:J,valuesDebounceMs:K}=q,ae=en();mt(R,de);const fe=typeof J=="function"?J:void 0,Ue=typeof J=="function"?void 0:J,{value:Ye=[],loading:ut}=Pt(fe,"",Ue,K),{filters:vt,setFilters:et}=T(),qe=Ne=>{const{target:{value:Zt}}=Ne;et(Kt=>{const{[R]:kt,...Dt}=Kt;return Zt?{...Dt,[R]:Zt}:Dt})};return(0,L.jsxs)(At.Z,{disabled:ut,className:W,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[g?(0,L.jsx)(Te.Z,{className:ae.label,margin:"dense",children:g}):null,(0,L.jsxs)(Ae.Z,{variant:"outlined",value:vt[R]||"",onChange:qe,children:[(0,L.jsx)(Ze.Z,{value:"",children:(0,L.jsx)("em",{children:"All"})}),Ye.map(Ne=>(0,L.jsx)(Ze.Z,{value:Ne,children:Ne},Ne))]})]})},$t=({component:q,...W})=>(0,L.jsx)(q,{...W});$t.Checkbox=q=>(0,L.jsx)($t,{...q,component:on}),$t.Select=q=>(0,L.jsx)($t,{...q,component:vn}),$t.Autocomplete=q=>(0,L.jsx)($t,{...q,component:It});var pn=t(48834).lW;const Cn=q=>pn.from(q.toString(),"utf-8").toString("base64"),Tn=q=>q?Number(pn.from(q,"base64").toString("utf-8")):0,an=q=>{const{total:W=-1,cursor:de,onCursorChange:g,limit:R=25,limitLabel:J="Results per page:",limitText:K=({from:et,to:qe})=>W>0?`of ${W}`:`${et}-${qe}`,limitOptions:ae,onLimitChange:fe,...Ue}=q,Ye=useMemo(()=>Tn(de),[de]),ut=useCallback((et,qe)=>{g==null||g(Cn(qe))},[g]),vt=useCallback(et=>{const qe=et.target.value;fe==null||fe(parseInt(qe,10))},[fe]);return _jsx(TablePagination,{...Ue,component:"div",count:W,page:Ye,onPageChange:ut,rowsPerPage:R,labelRowsPerPage:J,labelDisplayedRows:K,rowsPerPageOptions:ae,onRowsPerPageChange:vt})},Xn=q=>{const{pageLimit:W,setPageLimit:de,pageCursor:g,setPageCursor:R}=useSearch();return _jsx(an,{...q,limit:W,onLimitChange:de,cursor:g,onCursorChange:R})};var On=t(23196);const qn=q=>{const{children:W}=q,de=useSearch(),{result:g,...R}=de;return W(g,R)},ct=q=>{const{query:W,children:de}=q,g=useApi(searchApiRef),R=useAsync(()=>{const{term:J="",types:K=[],filters:ae={},...fe}=W;return g.query({...fe,term:J,types:K,filters:ae})},[W]);return de(R,W)},Bn=q=>{const{query:W,children:de}=q;return W?_jsx(ct,{query:W,children:de}):_jsx(qn,{children:de})},wn=q=>{const{query:W,children:de,noResultsComponent:g=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...R}=q;return _jsx(Bn,{query:W,children:({loading:J,error:K,value:ae})=>J?_jsx(Progress,{}):K?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:K}):ae!=null&&ae.results.length?isFunction(de)?de(ae):_jsx(SearchResultListItemExtensions,{...R,results:ae.results,children:de}):g})},ln=q=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(wn,{...q})}),$n=({result:q,highlight:W,icon:de,secondaryAction:g,lineClamp:R=5})=>q?_jsxs(_Fragment,{children:[de&&_jsx(ListItemIcon,{children:de}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:q.location,children:W!=null&&W.fields.title?_jsx(HighlightedSearchResultText,{text:(W==null?void 0:W.fields.title)||"",preTag:(W==null?void 0:W.preTag)||"",postTag:(W==null?void 0:W.postTag)||""}):q.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:R,overflow:"hidden"},children:W!=null&&W.fields.text?_jsx(HighlightedSearchResultText,{text:W.fields.text,preTag:W.preTag,postTag:W.postTag}):q.text})}),g&&_jsx(Box,{alignItems:"flex-end",children:g})]}):null,zn=q=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx($n,{...q})}),jn=q=>{const{error:W,loading:de,resultItems:g,renderResultItem:R=fe=>_jsx(DefaultResultListItem,{result:fe.document},fe.document.location),disableRenderingWithNoResults:J,noResultsComponent:K=J?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...ae}=q;return de?_jsx(Progress,{}):W?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:W}):g!=null&&g.length?_jsx(List,{...ae,children:g.map(R)}):_jsx(_Fragment,{children:K})},Gn=q=>{const{query:W,renderResultItem:de,children:g,...R}=q,J=useSearchResultListItemExtensions(g);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:W,children:({loading:K,error:ae,value:fe})=>_jsx(jn,{...R,error:ae,loading:K,resultItems:fe==null?void 0:fe.results,renderResultItem:de!=null?de:J})})})};var ve=t(19126);const oe=(0,l.Z)(q=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:q.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:q.palette.text.secondary,margin:q.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:q.palette.text.secondary,margin:q.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:q.spacing(.5)}})),Oe=q=>{const W=oe(),{label:de,children:g,...R}=q;return _jsx(Chip,{...R,className:W.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[de,": ",g]})})},Pe=()=>null,Ge=(0,l.Z)(q=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:q.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:q.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),ft=q=>{const W=Ge(),{label:de,value:g="None",onChange:R,onDelete:J}=q,K=useCallback(ae=>{R(ae.target.value)},[R]);return _jsx(Oe,{label:de,onDelete:J,children:_jsx(Typography,{role:"textbox",component:"span",className:W.root,onChange:K,contentEditable:!0,suppressContentEditableWarning:!0,children:g})})},Ht=(0,l.Z)(q=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:q.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),Rt=q=>{const W=Ht(),{label:de,value:g="none",onChange:R,onDelete:J,children:K}=q,ae=useCallback(fe=>{R(fe.target.value)},[R]);return _jsx(Oe,{label:de,onDelete:J,children:_jsxs(Select,{className:W.root,value:g,onChange:ae,input:_jsx(InputBase,{}),IconComponent:Pe,children:[_jsx(MenuItem,{value:"none",children:"None"}),K]})})};function ce(q){const W=oe(),[de,g]=useState(null),{error:R,loading:J,icon:K,title:ae,titleProps:fe={},link:Ue=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:W.listSubheaderLinkIcon})]}),linkProps:Ye={},filterOptions:ut,renderFilterOption:vt=We=>_jsx(MenuItem,{value:String(We),children:We},String(We)),filterFields:et,renderFilterField:qe,resultItems:Ne,renderResultItem:Zt=We=>_jsx(DefaultResultListItem,{result:We.document},We.document.location),disableRenderingWithNoResults:Kt,noResultsComponent:kt=Kt?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Dt}=q,Wt=useCallback(We=>{g(We.currentTarget)},[]),Gt=useCallback(()=>{g(null)},[]);if(J)return _jsx(Progress,{});if(R)return _jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:R});if(!(Ne!=null&&Ne.length))return _jsx(_Fragment,{children:kt});var ht;return _jsxs(List,{...Dt,children:[_jsxs(ListSubheader,{className:W.listSubheader,children:[K,_jsx(Typography,{className:W.listSubheaderName,component:"strong",...fe,children:ae}),ut?_jsx(Chip,{className:W.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:Wt}):null,ut?_jsx(Menu,{id:"filters-menu",anchorEl:de,open:Boolean(de),onClose:Gt,onClick:Gt,keepMounted:!0,children:ut.map(vt)}):null,et==null?void 0:et.map(We=>(ht=qe==null?void 0:qe(We))!==null&&ht!==void 0?ht:null),_jsx(Link,{className:W.listSubheaderLink,to:"/search",...Ye,children:Ue})]}),Ne.map(Zt)]})}function U(q){const{query:W,children:de,renderResultItem:g,linkProps:R={},...J}=q,K=useSearchResultListItemExtensions(de);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:W,children:({loading:ae,error:fe,value:Ue},{term:Ye,types:ut,pageCursor:vt,filters:et={}})=>{const qe=`/search?${qs.stringify({term:Ye,types:ut,filters:et,pageCursor:vt,query:Ye},{arrayFormat:"brackets"})}`;return _jsx(ce,{...J,error:fe,loading:ae,linkProps:{to:qe,...R},filterFields:Object.keys(et),resultItems:Ue==null?void 0:Ue.results,renderResultItem:g!=null?g:K})}})})}const he=(0,l.Z)(q=>({root:{display:"flex",justifyContent:"space-between",gap:q.spacing(2),margin:q.spacing(2,0)}})),Ke=()=>{const{fetchNextPage:q,fetchPreviousPage:W}=useSearch(),de=he();return!q&&!W?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:de.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!W,onClick:W,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!q,onClick:q,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},Ve="search.results.list.items.extensions.v1",at=(q,W)=>{for(const de of q){if(!isValidElement(de))continue;const g=getComponentData(de,Ve);if(g!=null&&g(W))return cloneElement(de,{rank:W.rank,highlight:W.highlight,result:W.document,...de.props})}return null},Tt=q=>{const{rank:W,result:de,noTrack:g,children:R,alignItems:J="flex-start",...K}=q,ae=(0,h.z$)(),fe=(0,m.useCallback)(()=>{g||de&&ae.captureEvent("discover",de.title,{attributes:{to:de.location},value:W})},[W,de,g,ae]);return(0,L.jsx)(y.Z,{divider:!0,alignItems:J,onClickCapture:fe,...K,children:R})},tn=q=>{const{name:W,component:de,predicate:g=()=>!0}=q;return(0,h.YO)({name:W,component:{lazy:()=>de().then(R=>J=>(0,L.jsx)(Tt,{rank:J.rank,result:J.result,noTrack:J.noTrack,children:(0,m.createElement)(R,J)}))},data:{[Ve]:g}})},Xt=q=>{const W=useElementFilter(q,de=>de.selectByComponentData({key:Ve}).getElements(),[q]);return useCallback((de,g)=>{const R=at(W,de);return _jsx(Fragment,{children:R!=null?R:_jsx(Tt,{rank:de.rank,result:de.document,children:_jsx(DefaultResultListItem,{rank:de.rank,highlight:de.highlight,result:de.document})})},g)},[W])},sn=q=>{const{results:W,children:de,...g}=q,R=Xt(de);return _jsx(List,{...g,children:W.map(R)})}},61886:function(bt,Be,t){"use strict";t.d(Be,{Ox:function(){return st},jM:function(){return m},Zz:function(){return y},oZ:function(){return _e},DR:function(){return l},ZS:function(){return Re},VA:function(){return St},KY:function(){return be},gT:function(){return Y},Dl:function(){return le},ux:function(){return Et},$L:function(){return B},x1:function(){return Xe}});var h=t(52322),r=t(2784),F=t(79635),L=t(60871);const m="techdocs.addons.addon.v1",y="techdocs.addons.wrapper.v1",l=()=>null;(0,L.R5)(l,y,!0);const M=xe=>`${m}.${xe.toLocaleLowerCase("en-US")}`;function be(xe){const{name:Te,component:Ae}=xe;return(0,L.YO)({name:Te,component:{sync:Ze=>(0,h.jsx)(Ae,{...Ze})},data:{[m]:xe,[M(Te)]:!0}})}const V=(xe,Te)=>xe.selectByComponentData({key:Te}).getElements()[0],G=xe=>xe.selectByComponentData({key:y}).selectByComponentData({key:m}),b=xe=>xe.selectByComponentData({key:y}).findComponentData({key:m}),B=()=>{const xe=(0,F.pC)(),Te=(0,L.vJ)(xe,G),Ae=(0,L.vJ)(xe,b),Ze=(0,r.useCallback)(pt=>{if(!Te||!pt)return null;const Pt=M(pt.name);var mt;return(mt=V(Te,Pt))!==null&&mt!==void 0?mt:null},[Te]),rt=(0,r.useCallback)(pt=>{const Pt=Ae.find(mt=>mt.name===pt);return Pt?Ze(Pt):null},[Ae,Ze]),zt=(0,r.useCallback)(pt=>{const Pt=Ae.filter(mt=>mt.location===pt);return Pt.length?Pt.map(Ze):null},[Ae,Ze]);return{renderComponentByName:rt,renderComponentsByLocation:zt}},Y=(0,L.T0)({id:"plugin.techdocs.service"}),le=(0,L.T0)({id:"plugin.techdocs.storageservice"});var ee=t(64279),X=t(25271),j=t(51837);function P(xe,Te){return Te.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(xe.kind=xe.kind.toLocaleLowerCase(),xe.name=xe.name.toLocaleLowerCase(),xe.namespace=xe.namespace.toLocaleLowerCase()),xe}const $=(xe,Te)=>(0,X.eE)(xe)===(0,X.eE)(Te),T={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},re=(0,j.CT)("techdocs-reader-page-context"),Re=(0,r.memo)(({entityRef:xe,children:Te})=>{const Ae=(0,L.h_)(Y),Ze=(0,L.h_)(L.Ds),rt=(0,ee.default)(async()=>Ae.getTechDocsMetadata(xe),[xe]),zt=(0,ee.default)(async()=>Ae.getEntityMetadata(xe),[xe]),[pt,Pt]=(0,r.useState)(T.title),[mt,It]=(0,r.useState)(T.subtitle),[en,on]=(0,r.useState)(T.shadowRoot),vn={metadata:rt,entityRef:P(xe,Ze),entityMetadata:zt,shadowRoot:en,setShadowRoot:on,title:pt,setTitle:Pt,subtitle:mt,setSubtitle:It},$t=(0,j.EI)({1:vn});return(0,h.jsx)(L.fC,{attributes:{entityRef:(0,X.eE)(xe)},children:(0,h.jsx)(re.Provider,{value:$t,children:Te instanceof Function?Te(vn):Te})})},(xe,Te)=>$(xe.entityRef,Te.entityRef)),Xe=()=>{const xe=(0,r.useContext)(re);if(xe===void 0)return T;const Te=xe.atVersion(1);if(Te===void 0)throw new Error("No context found for version 1.");return Te},_e=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var it=t(70882),Fe=t(50236),jt=t(19219),He=t(23196);const st="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",je=xe=>{(0,r.useEffect)(()=>{if(!xe)return()=>{};const Te=xe.querySelectorAll('head > link[rel="stylesheet"]');var Ae;let Ze=(Ae=Te==null?void 0:Te.length)!==null&&Ae!==void 0?Ae:0;const rt=new CustomEvent(st);if(!Ze)return xe.dispatchEvent(rt),()=>{};const zt=()=>{--Ze===0&&xe.dispatchEvent(rt)};return Te==null||Te.forEach(pt=>{pt.addEventListener("load",zt)}),()=>{Te==null||Te.forEach(pt=>{pt.removeEventListener("load",zt)})}},[xe])},Et=xe=>{const[Te,Ae]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(!xe)return()=>{};Ae(!0);const Ze=xe.style;Ze.setProperty("opacity","0");const rt=()=>{Ae(!1),Ze.setProperty("opacity","1")};return xe.addEventListener(st,rt),()=>{xe.removeEventListener(st,rt)}},[xe]),Te},St=({element:xe,onAppend:Te,children:Ae})=>{const[Ze,rt]=(0,r.useState)((0,it.Ue)({...(0,Fe.Z)(),insertionPoint:void 0}));je(xe);const zt=Et(xe),pt=(0,r.useCallback)(Pt=>{if(!xe||!Pt)return;rt((0,it.Ue)({...(0,Fe.Z)(),insertionPoint:xe.querySelector("head")||void 0}));let mt=Pt.shadowRoot;mt||(mt=Pt.attachShadow({mode:"open"})),mt.replaceChildren(xe),typeof Te=="function"&&Te(mt)},[xe,Te]);return(0,h.jsxs)(h.Fragment,{children:[zt&&(0,h.jsx)(He.Ex,{}),(0,h.jsxs)(jt.ZP,{jss:Ze,sheetsManager:new Map,children:[(0,h.jsx)("div",{ref:pt,"data-testid":"techdocs-native-shadowroot"}),Ae]})]})};var gt=t(54073);const yt=()=>{const{shadowRoot:xe}=useTechDocsReaderPage();return xe},At=xe=>{const Te=yt();return Te?xe.map(Ae=>Te==null?void 0:Te.querySelectorAll(Ae)).filter(Ae=>Ae.length).map(Ae=>Array.from(Ae)).flat():[]},Lt=xe=>xe.toString()&&xe.rangeCount&&xe.getRangeAt(0).getBoundingClientRect().top,ze=(xe=0)=>{const Te=yt(),[Ae,Ze]=useState(null),rt=useMemo(()=>debounce(()=>{const zt=Te,pt=zt.getSelection?zt.getSelection():document.getSelection();pt&&Lt(pt)?Ze(pt):Ze(null)},xe),[Te,Ze,xe]);return useEffect(()=>(window.document.addEventListener("selectionchange",rt),()=>window.document.removeEventListener("selectionchange",rt)),[rt]),Ae}},52943:function(bt,Be,t){"use strict";t.r(Be),t.d(Be,{EmbeddedDocsRouter:function(){return ee},Router:function(){return le},isTechDocsAvailable:function(){return Y}});var h=t(52322),r=t(2784),F=t(79635),L=t(40303),m=t(23196),y=t(25271),l=t(89258),M=t(65124),be=t(67896);const V=({entity:X})=>{const j=(0,y.iB)(X);return(0,h.jsxs)(l.I6,{entityRef:j,children:[(0,h.jsx)(M.b,{}),(0,h.jsx)(be.F,{withSearch:!1})]})};var G=t(18662),b=t(7476);const B="backstage.io/techdocs-ref",Y=X=>{var j,P;return Boolean(X==null||(j=X.metadata)===null||j===void 0||(P=j.annotations)===null||P===void 0?void 0:P[B])},le=()=>(0,h.jsxs)(F.Z5,{children:[(0,h.jsx)(F.AW,{path:"/",element:(0,h.jsx)(G.TechDocsIndexPage,{})}),(0,h.jsx)(F.AW,{path:"/:namespace/:kind/:name/*",element:(0,h.jsx)(b.TechDocsReaderPage,{})})]}),ee=X=>{var j;const{children:P}=X,{entity:$}=(0,L.X2)(),T=(0,F.V$)([{path:"/*",element:(0,h.jsx)(V,{entity:$}),children:[{path:"*",element:P}]}]);return((j=$.metadata.annotations)===null||j===void 0?void 0:j[B])?T:(0,h.jsx)(m.sk,{annotation:B})}},92077:function(bt,Be,t){"use strict";t.d(Be,{k:function(){return m},p:function(){return L}});var h=t(23054),r=t(76372),F=t.n(r);class L{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(l){const{kind:M,namespace:be,name:V}=l,b=`${await this.getApiOrigin()}/metadata/techdocs/${be}/${M}/${V}`,B=await this.fetchApi.fetch(`${b}`);if(!B.ok)throw await h.VL.fromResponse(B);return await B.json()}async getEntityMetadata(l){const{kind:M,namespace:be,name:V}=l,b=`${await this.getApiOrigin()}/metadata/entity/${be}/${M}/${V}`,B=await this.fetchApi.fetch(`${b}`);if(!B.ok)throw await h.VL.fromResponse(B);return await B.json()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.fetchApi=l.fetchApi}}class m{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,M){const{kind:be,namespace:V,name:G}=l,B=`${await this.getStorageUrl()}/${V}/${be}/${G}/${M}`,Y=await this.fetchApi.fetch(`${B.endsWith("/")?B:`${B}/`}index.html`);let le="";switch(Y.status){case 404:throw le="Page not found. ",M||(le+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(le);case 500:throw le="Could not generate documentation or an error in the TechDocs backend. ",new Error(le);default:break}return Y.text()}async syncEntityDocs(l,M=()=>{}){const{kind:be,namespace:V,name:G}=l,B=`${await this.getApiOrigin()}/sync/${V}/${be}/${G}`,{token:Y}=await this.identityApi.getCredentials();return new Promise((le,ee)=>{const X=new r.EventSourcePolyfill(B,{withCredentials:!0,headers:Y?{Authorization:`Bearer ${Y}`}:{}});X.addEventListener("log",j=>{j.data&&M(JSON.parse(j.data))}),X.addEventListener("finish",j=>{let P=!1;j.data&&({updated:P}=JSON.parse(j.data)),le(P?"updated":"cached")}),X.onerror=j=>{switch(X.close(),j.status){case 404:ee(new h.dR(j.message));return;default:ee(new Error(j.data));return}}})}async getBaseUrl(l,M,be){const{kind:V,namespace:G,name:b}=M,Y=`${await this.getApiOrigin()}/static/docs/${G}/${V}/${b}/${be}`;return new URL(l,Y.endsWith("/")?Y:`${Y}/`).toString()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.identityApi=l.identityApi,this.fetchApi=l.fetchApi}}},51953:function(bt,Be,t){"use strict";t.d(Be,{D:function(){return h}});function h(r,F){return F.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?r:r.toLocaleLowerCase("en-US")}},3482:function(bt,Be,t){"use strict";t.d(Be,{u:function(){return M}});var h=t(52322),r=t(2784),F=t(23196),L=t(40303),m=t(42081),y=t(48431),l=t(68435);const M=be=>{const{initialFilter:V="owned",columns:G,actions:b}=be;return(0,h.jsx)(m.j,{children:(0,h.jsxs)(F.VY,{children:[(0,h.jsx)(F.yW,{title:"",children:(0,h.jsx)(F.qt,{children:"Discover documentation in your ecosystem."})}),(0,h.jsx)(L.UO,{children:(0,h.jsxs)(L._i,{children:[(0,h.jsxs)(L._i.Filters,{children:[(0,h.jsx)(y.f,{}),(0,h.jsx)(L.EW,{initialFilter:V}),(0,h.jsx)(L.dq,{}),(0,h.jsx)(L.xE,{})]}),(0,h.jsx)(L._i.Content,{children:(0,h.jsx)(l.n,{actions:b,columns:G})})]})})]})})}},85478:function(bt,Be,t){"use strict";t.d(Be,{f:function(){return G}});var h=t(52322),r=t(95573),F=t(51953),L=t(60871),m=t(23196),y=t(94339),l=t(16111),M=t(24579),be=t(14503),V=t(2784);const G=ee=>{const{entities:X}=ee,j=(0,L.tg)(r.Fw),P=(0,L.h_)(L.Ds);if(!X)return null;var $,T;return(0,h.jsx)(m.Oh,{"data-testid":"docs-explore",children:X!=null&&X.length?X.map((re,Re)=>(0,h.jsxs)(y.Z,{children:[(0,h.jsx)(l.Z,{children:(0,h.jsx)(m.hu,{title:($=re.metadata.title)!==null&&$!==void 0?$:re.metadata.name})}),(0,h.jsx)(M.Z,{children:re.metadata.description}),(0,h.jsx)(be.Z,{children:(0,h.jsx)(m.Qj,{to:j({namespace:(0,F.D)((T=re.metadata.namespace)!==null&&T!==void 0?T:"default",P),kind:(0,F.D)(re.kind,P),name:(0,F.D)(re.metadata.name,P)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},Re)):null})};var b=t(40303);const B={title:"All Documentation",filterPredicate:()=>!0},Y=({entities:ee,group:X})=>{const{loading:j,isOwnedEntity:P}=useEntityOwnership(),$=ee.filter(re=>X.filterPredicate==="ownedByUser"?j?!1:P(re):typeof X.filterPredicate=="function"&&X.filterPredicate(re)),T=(()=>typeof X.title=="string"?_jsx(ContentHeader,{title:X.title}):X.title)();return $.length===0?null:_jsxs(Content,{children:[T,_jsx(DocsCardGrid,{entities:$})]})},le=({groups:ee})=>{const{loading:X,error:j,entities:P}=useEntityList();if(j)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:j.toString()})});if(X)return _jsx(Progress,{});if(P.length===0)return _jsx("div",{"data-testid":"doc-not-found",children:_jsxs(Typography,{variant:"body2",children:["No documentation found that match your filter. Learn more about"," ",_jsx(Link,{to:"https://backstage.io/docs/features/techdocs/creating-and-publishing",children:"publishing documentation"}),"."]})});var $,T;return P.sort((re,Re)=>(($=re.metadata.title)!==null&&$!==void 0?$:re.metadata.name).localeCompare((T=Re.metadata.title)!==null&&T!==void 0?T:Re.metadata.name)),_jsx(Content,{children:(ee||[B]).map((re,Re)=>_jsx(Y,{entities:P,group:re},`${re.title}-${Re}`))})}},68435:function(bt,Be,t){"use strict";t.d(Be,{H:function(){return P},n:function(){return $}});var h=t(52322),r=t(2784),F=t(95074),L=t(76635),m=t(23196),y=t(40303),l=t(60871),M=t(25271),be=t(95573),V=t(39981),G=t(2337),b=t(11640),B=t(28347);const Y=(0,G.Z)({root:{color:"#f3ba37"}})(b.Z),le={createCopyDocsUrlAction(T){return re=>({icon:()=>(0,h.jsx)(V.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>T(`${window.location.origin}${re.resolved.docsUrl}`)})},createStarEntityAction(T,re){return({entity:Re})=>{const Xe=T(Re);return{cellStyle:{paddingLeft:"1em"},icon:()=>Xe?(0,h.jsx)(Y,{}):(0,h.jsx)(B.Z,{}),tooltip:Xe?"Remove from favorites":"Add to favorites",onClick:()=>re(Re)}}}};function ee(T){return T.metadata.title||T.metadata.name}const X={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:T=>(0,h.jsx)(m.uw,{value:(0,h.jsx)(m.rU,{to:T.resolved.docsUrl,children:ee(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 j=t(51953);const P=T=>{const{entities:re,title:Re,loading:Xe,columns:_e,actions:it,options:Fe}=T,[,jt]=(0,F.Z)(),He=(0,l.tg)(be.Fw),st=(0,l.h_)(l.Ds);if(!re)return null;const je=re.map(gt=>{const yt=(0,y.hF)(gt,M.S4);var At;return{entity:gt,resolved:{docsUrl:He({namespace:(0,j.D)((At=gt.metadata.namespace)!==null&&At!==void 0?At:"default",st),kind:(0,j.D)(gt.kind,st),name:(0,j.D)(gt.metadata.name,st)}),ownedByRelations:yt,ownedByRelationsTitle:yt.map(Lt=>(0,y.$3)(Lt,{defaultKind:"group"})).join(", ")}}}),Et=[X.createNameColumn(),X.createOwnerColumn(),X.createTypeColumn()],St=[le.createCopyDocsUrlAction(jt)];return(0,h.jsx)(h.Fragment,{children:Xe||je&&je.length>0?(0,h.jsx)(m.iA,{isLoading:Xe,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1,...Fe},data:je,columns:_e||Et,actions:it||St,title:Re?`${Re} (${je.length})`:`All (${je.length})`}):(0,h.jsx)(m.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,h.jsx)(m.Qj,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};P.columns=X,P.actions=le;const $=T=>{var re;const{columns:Re,actions:Xe,options:_e}=T,{loading:it,error:Fe,entities:jt,filters:He}=(0,y.wp)(),{isStarredEntity:st,toggleStarredEntity:je}=(0,y.CR)(),[,Et]=(0,F.Z)();var St;const gt=(0,L.capitalize)((St=(re=He.user)===null||re===void 0?void 0:re.value)!==null&&St!==void 0?St:"all"),yt=[le.createCopyDocsUrlAction(Et),le.createStarEntityAction(st,je)];return Fe?(0,h.jsx)(m.GB,{severity:"error",title:"Could not load available documentation.",children:(0,h.jsx)(m.Oi,{language:"text",text:Fe.toString()})}):(0,h.jsx)(P,{title:gt,entities:jt,loading:it,actions:Xe||yt,columns:Re,options:_e})};$.columns=X,$.actions=le},18662:function(bt,Be,t){"use strict";t.r(Be),t.d(Be,{TechDocsIndexPage:function(){return m}});var h=t(52322),r=t(2784),F=t(79635),L=t(3482);const m=y=>(0,F.pC)()||(0,h.jsx)(L.u,{...y})},42081:function(bt,Be,t){"use strict";t.d(Be,{j:function(){return m}});var h=t(52322),r=t(2784),F=t(23196),L=t(60871);const m=y=>{const{children:l}=y,M=(0,L.h_)(L.Ds);var be;const V=`Documentation available in ${(be=M.getOptionalString("organization.name"))!==null&&be!==void 0?be:"Backstage"}`;return(0,h.jsx)(F.g9,{title:"Documentation",subtitle:V,themeId:"documentation",children:l})}},48431:function(bt,Be,t){"use strict";t.d(Be,{f:function(){return L}});var h=t(2784),r=t(40303);class F{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":r.n3}}}const L=()=>{const{updateFilters:m}=(0,r.wp)();return(0,h.useEffect)(()=>{m({techdocs:new F})},[m]),null}},89258:function(bt,Be,t){"use strict";t.d(Be,{I6:function(){return G},Jl:function(){return V},s4:function(){return y}});var h=t(61886),r=t(92077),F=t(95573),L=t(60871),m=t(15096);const y=(0,L.rx)({id:"techdocs",apis:[(0,L.ni)({api:h.Dl,deps:{configApi:L.Ds,discoveryApi:L.NW,identityApi:L.$4,fetchApi:L.gP},factory:({configApi:B,discoveryApi:Y,identityApi:le,fetchApi:ee})=>new r.k({configApi:B,discoveryApi:Y,identityApi:le,fetchApi:ee})}),(0,L.ni)({api:h.gT,deps:{configApi:L.Ds,discoveryApi:L.NW,fetchApi:L.gP},factory:({configApi:B,discoveryApi:Y,fetchApi:le})=>new r.p({configApi:B,discoveryApi:Y,fetchApi:le})})],routes:{root:F._Z,docRoot:F.Fw,entityContent:F.pd}}),l=y.provide((0,L.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(t.bind(t,52943)).then(B=>B.Router),mountPoint:F._Z})),M=y.provide((0,L.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(t.bind(t,52943)).then(B=>B.EmbeddedDocsRouter),mountPoint:F.pd})),be=y.provide((0,L.P4)({name:"TechDocsCustomHome",component:()=>t.e(7560).then(t.bind(t,27560)).then(B=>B.TechDocsCustomHome),mountPoint:F._Z})),V=y.provide((0,L.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(t.bind(t,18662)).then(B=>B.TechDocsIndexPage),mountPoint:F._Z})),G=y.provide((0,L.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(t.bind(t,7476)).then(B=>B.TechDocsReaderPage),mountPoint:F.Fw})),b=y.provide((0,m.E5)({name:"TechDocsSearchResultListItem",component:()=>Promise.resolve().then(t.bind(t,55511)).then(B=>B.TechDocsSearchResultListItem),predicate:B=>B.type==="techdocs"}))},7476:function(bt,Be,t){"use strict";t.r(Be),t.d(Be,{TechDocsReaderLayout:function(){return G},TechDocsReaderPage:function(){return b}});var h=t(52322),r=t(2784),F=t(79635),L=t(23196),m=t(61886),y=t(67896),l=t(93225),M=t(65124),be=t(95573),V=t(60871);const G=({withSearch:B,withHeader:Y=!0})=>(0,h.jsxs)(L.T3,{themeId:"documentation",children:[Y&&(0,h.jsx)(l.S,{}),(0,h.jsx)(M.b,{}),(0,h.jsx)(y.F,{withSearch:B})]}),b=B=>{const{kind:Y,name:le,namespace:ee}=(0,V.Oi)(be.Fw),{children:X,entityRef:j={kind:Y,name:le,namespace:ee}}=B,P=(0,F.pC)();if(!X){const T=P?r.Children.toArray(P.props.children):[];var $;const Re=T.flatMap(Xe=>{var _e;return($=Xe==null||(_e=Xe.props)===null||_e===void 0?void 0:_e.children)!==null&&$!==void 0?$:[]}).find(Xe=>!(0,V.IY)(Xe,m.Zz)&&!(0,V.IY)(Xe,m.jM));return(0,h.jsx)(m.ZS,{entityRef:j,children:Re||(0,h.jsx)(G,{})})}return(0,h.jsx)(m.ZS,{entityRef:j,children:({metadata:T,entityMetadata:re,onReady:Re})=>(0,h.jsx)("div",{className:"techdocs-reader-page",children:(0,h.jsx)(L.T3,{themeId:"documentation",children:X instanceof Function?X({entityRef:j,techdocsMetadataValue:T.value,entityMetadataValue:re.value,onReady:Re}):X})})})}},67896:function(bt,Be,t){"use strict";t.d(Be,{F:function(){return W}});var h=t(52322),r=t(2784),F=t(79692),L=t(60905),m=t(61886),y=t(23196),l=t(22478),M=t(4614),be=t(77277),V=t(99688),G=t(12420),b=t(90436),B=t(61837),Y=t(4190),le=t(87685);const ee=(0,F.Z)(g=>(0,G.Z)({paper:{width:"100%",[g.breakpoints.up("sm")]:{width:"75%"},[g.breakpoints.up("md")]:{width:"50%"},padding:g.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:g.palette.background.default}})),X=({buildLog:g,onClose:R})=>{const J=ee(),K=g.length===0?"Waiting for logs...":g.join(`
|
|
37
|
-
`);return(0,h.jsxs)(L.Z,{container:!0,direction:"column",className:J.root,spacing:0,wrap:"nowrap",children:[(0,h.jsxs)(L.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,h.jsx)(b.Z,{variant:"h5",children:"Build Details"}),(0,h.jsx)(B.Z,{title:"Close the drawer",onClick:R,color:"inherit",children:(0,h.jsx)(le.Z,{})},"dismiss")]}),(0,h.jsx)(L.Z,{item:!0,xs:!0,children:(0,h.jsx)(y.nU,{text:K,classes:{root:J.logs}})})]})},j=({buildLog:g})=>{const R=ee(),[J,K]=(0,r.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(be.Z,{color:"inherit",onClick:()=>K(!0),children:"Show Build Logs"}),(0,h.jsx)(Y.ZP,{classes:{paper:R.paper},anchor:"right",open:J,onClose:()=>K(!1),children:(0,h.jsx)(X,{buildLog:g,onClose:()=>K(!1)})})]})};var P=t(60871);const $=({errorMessage:g})=>{const R=(0,P.h_)(P.Ds).getOptionalString("techdocs.builder");let J="";return R!=="local"&&(J="Note that techdocs.builder is not set to 'local' in your config, which means this Backstage app will not generate docs if they are not found. Make sure the project's docs are generated and published by some external process (e.g. CI/CD pipeline). Or change techdocs.builder to 'local' to generate docs from this Backstage instance."),(0,h.jsx)(y.mf,{status:"404",statusMessage:g||"Documentation not found",additionalInfo:J})};var T=t(95481);const re=(0,F.Z)(g=>({root:{marginBottom:g.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),Re=()=>{let g=null;const R=re(),{state:J,contentReload:K,contentErrorMessage:ae,syncErrorMessage:fe,buildLog:Ue}=(0,T.DK)();return J==="INITIAL_BUILD"&&(g=(0,h.jsx)(V.Z,{classes:{root:R.root},variant:"outlined",severity:"info",icon:(0,h.jsx)(M.Z,{size:"24px"}),action:(0,h.jsx)(j,{buildLog:Ue}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),J==="CONTENT_STALE_REFRESHING"&&(g=(0,h.jsx)(V.Z,{variant:"outlined",severity:"info",icon:(0,h.jsx)(M.Z,{size:"24px"}),action:(0,h.jsx)(j,{buildLog:Ue}),classes:{root:R.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),J==="CONTENT_STALE_READY"&&(g=(0,h.jsx)(V.Z,{variant:"outlined",severity:"success",action:(0,h.jsx)(be.Z,{color:"inherit",onClick:()=>K(),children:"Refresh"}),classes:{root:R.root},children:"A newer version of this documentation is now available, please refresh to view."})),J==="CONTENT_STALE_ERROR"&&(g=(0,h.jsxs)(V.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(j,{buildLog:Ue}),classes:{root:R.root,message:R.message},children:["Building a newer version of this documentation failed."," ",fe]})),J==="CONTENT_NOT_FOUND"&&(g=(0,h.jsxs)(h.Fragment,{children:[fe&&(0,h.jsxs)(V.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(j,{buildLog:Ue}),classes:{root:R.root,message:R.message},children:["Building a newer version of this documentation failed."," ",fe]}),(0,h.jsx)($,{errorMessage:ae})]})),g};var Xe=t(79635),_e=t(60364),it=t(41156),Fe=t(32838),jt=t(35368),He=t.n(jt);const st=/main\.[A-Fa-f0-9]{8}\.min\.css$/,je=/^https:\/\/fonts\.googleapis\.com/,Et=/^https:\/\/fonts\.gstatic\.com/,St=g=>g.nodeName==="LINK",gt=g=>{const R=(g==null?void 0:g.getAttribute("href"))||"",J=R.match(st),K=R.match(je),ae=R.match(Et);return J||K||ae},yt=g=>(St(g)&&!gt(g)&&g.remove(),g),At=g=>g.nodeName==="IFRAME",Lt=(g,R)=>{const J=g.getAttribute("src")||"";try{const{host:K}=new URL(J);return R.includes(K)}catch{return!1}},ze=g=>R=>(At(R)&&!Lt(R,g)&&R.remove(),R),xe=()=>{const g=(0,P.h_)(P.Ds);return(0,r.useMemo)(()=>g.getOptionalConfig("techdocs.sanitizer"),[g])},Te=()=>{const g=xe();return(0,r.useCallback)(async R=>{const J=g==null?void 0:g.getOptionalStringArray("allowedIframeHosts");He().addHook("beforeSanitizeElements",yt);const K=["link"];return J&&(K.push("iframe"),He().addHook("beforeSanitizeElements",ze(J))),He().sanitize(R.outerHTML,{ADD_TAGS:K,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[g])};var Ae=t(41128),Ze=({theme:g})=>`
|
|
38
|
-
/*================== Variables ==================*/
|
|
39
|
-
/*
|
|
40
|
-
As the MkDocs output is rendered in shadow DOM, the CSS variable definitions on the root selector are not applied. Instead, they have to be applied on :host.
|
|
41
|
-
As there is no way to transform the served main*.css yet (for example in the backend), we have to copy from main*.css and modify them.
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
:host {
|
|
45
|
-
/* FONT */
|
|
46
|
-
--md-default-fg-color: ${g.palette.text.primary};
|
|
47
|
-
--md-default-fg-color--light: ${g.palette.text.secondary};
|
|
48
|
-
--md-default-fg-color--lighter: ${(0,Ae.$n)(g.palette.text.secondary,.7)};
|
|
49
|
-
--md-default-fg-color--lightest: ${(0,Ae.$n)(g.palette.text.secondary,.3)};
|
|
50
|
-
|
|
51
|
-
/* BACKGROUND */
|
|
52
|
-
--md-default-bg-color:${g.palette.background.default};
|
|
53
|
-
--md-default-bg-color--light: ${g.palette.background.paper};
|
|
54
|
-
--md-default-bg-color--lighter: ${(0,Ae.$n)(g.palette.background.paper,.7)};
|
|
55
|
-
--md-default-bg-color--lightest: ${(0,Ae.$n)(g.palette.background.paper,.3)};
|
|
56
|
-
|
|
57
|
-
/* PRIMARY */
|
|
58
|
-
--md-primary-fg-color: ${g.palette.primary.main};
|
|
59
|
-
--md-primary-fg-color--light: ${g.palette.primary.light};
|
|
60
|
-
--md-primary-fg-color--dark: ${g.palette.primary.dark};
|
|
61
|
-
--md-primary-bg-color: ${g.palette.primary.contrastText};
|
|
62
|
-
--md-primary-bg-color--light: ${(0,Ae.$n)(g.palette.primary.contrastText,.7)};
|
|
63
|
-
|
|
64
|
-
/* ACCENT */
|
|
65
|
-
--md-accent-fg-color: var(--md-primary-fg-color);
|
|
66
|
-
|
|
67
|
-
/* SHADOW */
|
|
68
|
-
--md-shadow-z1: ${g.shadows[1]};
|
|
69
|
-
--md-shadow-z2: ${g.shadows[2]};
|
|
70
|
-
--md-shadow-z3: ${g.shadows[3]};
|
|
71
|
-
|
|
72
|
-
/* EXTENSIONS */
|
|
73
|
-
--md-admonition-fg-color: var(--md-default-fg-color);
|
|
74
|
-
--md-admonition-bg-color: var(--md-default-bg-color);
|
|
75
|
-
/* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */
|
|
76
|
-
--md-admonition-icon--note: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>');
|
|
77
|
-
--md-admonition-icon--abstract: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 5h16v2H4V5m0 4h16v2H4V9m0 4h16v2H4v-2m0 4h10v2H4v-2z"/></svg>');
|
|
78
|
-
--md-admonition-icon--info: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10A10 10 0 0012 2z"/></svg>');
|
|
79
|
-
--md-admonition-icon--tip: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.55 11.2c-.23-.3-.5-.56-.76-.82-.65-.6-1.4-1.03-2.03-1.66C13.3 7.26 13 4.85 13.91 3c-.91.23-1.75.75-2.45 1.32-2.54 2.08-3.54 5.75-2.34 8.9.04.1.08.2.08.33 0 .22-.15.42-.35.5-.22.1-.46.04-.64-.12a.83.83 0 01-.15-.17c-1.1-1.43-1.28-3.48-.53-5.12C5.89 10 5 12.3 5.14 14.47c.04.5.1 1 .27 1.5.14.6.4 1.2.72 1.73 1.04 1.73 2.87 2.97 4.84 3.22 2.1.27 4.35-.12 5.96-1.6 1.8-1.66 2.45-4.32 1.5-6.6l-.13-.26c-.2-.46-.47-.87-.8-1.25l.05-.01m-3.1 6.3c-.28.24-.73.5-1.08.6-1.1.4-2.2-.16-2.87-.82 1.19-.28 1.89-1.16 2.09-2.05.17-.8-.14-1.46-.27-2.23-.12-.74-.1-1.37.18-2.06.17.38.37.76.6 1.06.76 1 1.95 1.44 2.2 2.8.04.14.06.28.06.43.03.82-.32 1.72-.92 2.27h.01z"/></svg>');
|
|
80
|
-
--md-admonition-icon--success: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
|
|
81
|
-
--md-admonition-icon--question: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.07 11.25l-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 00-2-2 2 2 0 00-2 2H8a4 4 0 014-4 4 4 0 014 4 3.2 3.2 0 01-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10c0-5.53-4.5-10-10-10z"/></svg>');
|
|
82
|
-
--md-admonition-icon--warning: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 14h-2v-4h2m0 8h-2v-2h2M1 21h22L12 2 1 21z"/></svg>');
|
|
83
|
-
--md-admonition-icon--failure: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12 6.47 2 12 2m3.59 5L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41 15.59 7z"/></svg>');
|
|
84
|
-
--md-admonition-icon--danger: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.5 20l4.86-9.73H13V4l-5 9.73h3.5V20M12 2c2.75 0 5.1 1 7.05 2.95C21 6.9 22 9.25 22 12s-1 5.1-2.95 7.05C17.1 21 14.75 22 12 22s-5.1-1-7.05-2.95C3 17.1 2 14.75 2 12s1-5.1 2.95-7.05C6.9 3 9.25 2 12 2z"/></svg>');
|
|
85
|
-
--md-admonition-icon--bug: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 12h-4v-2h4m0 6h-4v-2h4m6-6h-2.81a5.985 5.985 0 00-1.82-1.96L17 4.41 15.59 3l-2.17 2.17a6.002 6.002 0 00-2.83 0L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8z"/></svg>');
|
|
86
|
-
--md-admonition-icon--example: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 13v-2h14v2H7m0 6v-2h14v2H7M7 7V5h14v2H7M3 8V5H2V4h2v4H3m-1 9v-1h3v4H2v-1h2v-.5H3v-1h1V17H2m2.25-7a.75.75 0 01.75.75c0 .2-.08.39-.21.52L3.12 13H5v1H2v-.92L4 11H2v-1h2.25z"/></svg>');
|
|
87
|
-
--md-admonition-icon--quote: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 17h3l2-4V7h-6v6h3M6 17h3l2-4V7H5v6h3l-2 4z"/></svg>');
|
|
88
|
-
--md-footnotes-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.42L5.83 13H21V7h-2z"/></svg>');
|
|
89
|
-
--md-details-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
|
|
90
|
-
--md-tasklist-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/></svg>');
|
|
91
|
-
--md-tasklist-icon--checked: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
|
|
92
|
-
--md-nav-icon--prev: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>');
|
|
93
|
-
--md-nav-icon--next: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
|
|
94
|
-
--md-toc-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 9h14V7H3v2m0 4h14v-2H3v2m0 4h14v-2H3v2m16 0h2v-2h-2v2m0-10v2h2V7h-2m0 6h2v-2h-2v2z"/></svg>');
|
|
95
|
-
--md-clipboard-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1z"/></svg>');
|
|
96
|
-
--md-search-result-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h7c-.41-.25-.8-.56-1.14-.9-.33-.33-.61-.7-.86-1.1H6V4h7v5h5v1.18c.71.16 1.39.43 2 .82V8l-6-6m6.31 16.9c1.33-2.11.69-4.9-1.4-6.22-2.11-1.33-4.91-.68-6.22 1.4-1.34 2.11-.69 4.89 1.4 6.22 1.46.93 3.32.93 4.79.02L22 23.39 23.39 22l-3.08-3.1m-3.81.1a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5z"/></svg>');
|
|
97
|
-
--md-source-forks-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 2.122a2.25 2.25 0 1 0-1.5 0v.878A2.25 2.25 0 0 0 5.75 8.5h1.5v2.128a2.251 2.251 0 1 0 1.5 0V8.5h1.5a2.25 2.25 0 0 0 2.25-2.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75h-4.5A.75.75 0 0 1 5 6.25v-.878zm3.75 7.378a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm3-8.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5z"/></svg>');
|
|
98
|
-
--md-source-repositories-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 1 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 0 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 0 1 1-1h8zM5 12.25v3.25a.25.25 0 0 0 .4.2l1.45-1.087a.25.25 0 0 1 .3 0L8.6 15.7a.25.25 0 0 0 .4-.2v-3.25a.25.25 0 0 0-.25-.25h-3.5a.25.25 0 0 0-.25.25z"/></svg>');
|
|
99
|
-
--md-source-stars-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694v.001z"/></svg>');
|
|
100
|
-
--md-source-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2.5 7.775V2.75a.25.25 0 0 1 .25-.25h5.025a.25.25 0 0 1 .177.073l6.25 6.25a.25.25 0 0 1 0 .354l-5.025 5.025a.25.25 0 0 1-.354 0l-6.25-6.25a.25.25 0 0 1-.073-.177zm-1.5 0V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.75 1.75 0 0 1 1 7.775zM6 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>');
|
|
101
|
-
--md-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="m310.6 246.6-127.1 128c-7.1 6.3-15.3 9.4-23.5 9.4s-16.38-3.125-22.63-9.375l-127.1-128C.224 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75s3.12 25.75-6.08 34.85z"/></svg>');
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
:host > * {
|
|
105
|
-
/* CODE */
|
|
106
|
-
--md-code-fg-color: ${g.palette.text.primary};
|
|
107
|
-
--md-code-bg-color: ${g.palette.background.paper};
|
|
108
|
-
--md-code-hl-color: ${(0,Ae.Fq)(g.palette.warning.main,.5)};
|
|
109
|
-
--md-code-hl-keyword-color: ${g.palette.type==="dark"?g.palette.primary.light:g.palette.primary.dark};
|
|
110
|
-
--md-code-hl-function-color: ${g.palette.type==="dark"?g.palette.secondary.light:g.palette.secondary.dark};
|
|
111
|
-
--md-code-hl-string-color: ${g.palette.type==="dark"?g.palette.success.light:g.palette.success.dark};
|
|
112
|
-
--md-code-hl-number-color: ${g.palette.type==="dark"?g.palette.error.light:g.palette.error.dark};
|
|
113
|
-
--md-code-hl-constant-color: var(--md-code-hl-function-color);
|
|
114
|
-
--md-code-hl-special-color: var(--md-code-hl-function-color);
|
|
115
|
-
--md-code-hl-name-color: var(--md-code-fg-color);
|
|
116
|
-
--md-code-hl-comment-color: var(--md-default-fg-color--light);
|
|
117
|
-
--md-code-hl-generic-color: var(--md-default-fg-color--light);
|
|
118
|
-
--md-code-hl-variable-color: var(--md-default-fg-color--light);
|
|
119
|
-
--md-code-hl-operator-color: var(--md-default-fg-color--light);
|
|
120
|
-
--md-code-hl-punctuation-color: var(--md-default-fg-color--light);
|
|
121
|
-
|
|
122
|
-
/* TYPESET */
|
|
123
|
-
--md-typeset-font-size: 1rem;
|
|
124
|
-
--md-typeset-color: var(--md-default-fg-color);
|
|
125
|
-
--md-typeset-a-color: var(--md-accent-fg-color);
|
|
126
|
-
--md-typeset-table-color: ${g.palette.text.primary};
|
|
127
|
-
--md-typeset-del-color: ${g.palette.type==="dark"?(0,Ae.Fq)(g.palette.error.dark,.5):(0,Ae.Fq)(g.palette.error.light,.5)};
|
|
128
|
-
--md-typeset-ins-color: ${g.palette.type==="dark"?(0,Ae.Fq)(g.palette.success.dark,.5):(0,Ae.Fq)(g.palette.success.light,.5)};
|
|
129
|
-
--md-typeset-mark-color: ${g.palette.type==="dark"?(0,Ae.Fq)(g.palette.warning.dark,.5):(0,Ae.Fq)(g.palette.warning.light,.5)};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
@media screen and (max-width: 76.1875em) {
|
|
133
|
-
:host > * {
|
|
134
|
-
/* TYPESET */
|
|
135
|
-
--md-typeset-font-size: .9rem;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
@media screen and (max-width: 600px) {
|
|
140
|
-
:host > * {
|
|
141
|
-
/* TYPESET */
|
|
142
|
-
--md-typeset-font-size: .7rem;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
`,rt=({theme:g})=>`
|
|
146
|
-
/*================== Reset ==================*/
|
|
147
|
-
|
|
148
|
-
body {
|
|
149
|
-
--md-text-color: var(--md-default-fg-color);
|
|
150
|
-
--md-text-link-color: var(--md-accent-fg-color);
|
|
151
|
-
--md-text-font-family: ${g.typography.fontFamily};
|
|
152
|
-
font-family: var(--md-text-font-family);
|
|
153
|
-
background-color: unset;
|
|
154
|
-
}
|
|
155
|
-
`;const zt="224px";var pt=({theme:g,sidebar:R})=>`
|
|
156
|
-
/*================== Layout ==================*/
|
|
157
|
-
|
|
158
|
-
.md-grid {
|
|
159
|
-
max-width: 100%;
|
|
160
|
-
margin: 0;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.md-nav {
|
|
164
|
-
font-size: calc(var(--md-typeset-font-size) * 0.9);
|
|
165
|
-
}
|
|
166
|
-
.md-nav__link {
|
|
167
|
-
display: flex;
|
|
168
|
-
align-items: center;
|
|
169
|
-
justify-content: space-between;
|
|
170
|
-
}
|
|
171
|
-
.md-nav__icon {
|
|
172
|
-
height: 20px !important;
|
|
173
|
-
width: 20px !important;
|
|
174
|
-
margin-left:${g.spacing(1)}px;
|
|
175
|
-
}
|
|
176
|
-
.md-nav__icon svg {
|
|
177
|
-
margin: 0;
|
|
178
|
-
width: 20px !important;
|
|
179
|
-
height: 20px !important;
|
|
180
|
-
}
|
|
181
|
-
.md-nav__icon:after {
|
|
182
|
-
width: 20px !important;
|
|
183
|
-
height: 20px !important;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.md-nav__item--active > .md-nav__link, a.md-nav__link--active {
|
|
187
|
-
text-decoration: underline;
|
|
188
|
-
color: var(--md-typeset-a-color);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.md-main__inner {
|
|
192
|
-
margin-top: 0;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.md-sidebar {
|
|
196
|
-
bottom: 75px;
|
|
197
|
-
position: fixed;
|
|
198
|
-
width: 16rem;
|
|
199
|
-
overflow-y: auto;
|
|
200
|
-
overflow-x: hidden;
|
|
201
|
-
scrollbar-color: rgb(193, 193, 193) #eee;
|
|
202
|
-
scrollbar-width: thin;
|
|
203
|
-
}
|
|
204
|
-
.md-sidebar .md-sidebar__scrollwrap {
|
|
205
|
-
width: calc(12.1rem);
|
|
206
|
-
}
|
|
207
|
-
.md-sidebar--secondary {
|
|
208
|
-
right: ${g.spacing(3)}px;
|
|
209
|
-
}
|
|
210
|
-
.md-sidebar::-webkit-scrollbar {
|
|
211
|
-
width: 5px;
|
|
212
|
-
}
|
|
213
|
-
.md-sidebar::-webkit-scrollbar-button {
|
|
214
|
-
width: 5px;
|
|
215
|
-
height: 5px;
|
|
216
|
-
}
|
|
217
|
-
.md-sidebar::-webkit-scrollbar-track {
|
|
218
|
-
background: #eee;
|
|
219
|
-
border: 1 px solid rgb(250, 250, 250);
|
|
220
|
-
box-shadow: 0px 0px 3px #dfdfdf inset;
|
|
221
|
-
border-radius: 3px;
|
|
222
|
-
}
|
|
223
|
-
.md-sidebar::-webkit-scrollbar-thumb {
|
|
224
|
-
width: 5px;
|
|
225
|
-
background: rgb(193, 193, 193);
|
|
226
|
-
border: transparent;
|
|
227
|
-
border-radius: 3px;
|
|
228
|
-
}
|
|
229
|
-
.md-sidebar::-webkit-scrollbar-thumb:hover {
|
|
230
|
-
background: rgb(125, 125, 125);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
.md-content {
|
|
234
|
-
max-width: calc(100% - 16rem * 2);
|
|
235
|
-
margin-left: 16rem;
|
|
236
|
-
margin-bottom: 50px;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
.md-footer {
|
|
240
|
-
position: fixed;
|
|
241
|
-
bottom: 0px;
|
|
242
|
-
pointer-events: none;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
.md-footer-nav__link, .md-footer__link {
|
|
246
|
-
pointer-events: all;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
.md-footer__title {
|
|
250
|
-
background-color: unset;
|
|
251
|
-
}
|
|
252
|
-
.md-footer-nav__link {
|
|
253
|
-
width: 16rem;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
.md-dialog {
|
|
257
|
-
background-color: unset;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
@media screen and (min-width: 76.25em) {
|
|
261
|
-
.md-sidebar {
|
|
262
|
-
height: auto;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
@media screen and (max-width: 76.1875em) {
|
|
267
|
-
.md-nav {
|
|
268
|
-
transition: none !important;
|
|
269
|
-
background-color: var(--md-default-bg-color)
|
|
270
|
-
}
|
|
271
|
-
.md-nav--primary .md-nav__title {
|
|
272
|
-
cursor: auto;
|
|
273
|
-
color: var(--md-default-fg-color);
|
|
274
|
-
font-weight: 700;
|
|
275
|
-
white-space: normal;
|
|
276
|
-
line-height: 1rem;
|
|
277
|
-
height: auto;
|
|
278
|
-
display: flex;
|
|
279
|
-
flex-flow: column;
|
|
280
|
-
row-gap: 1.6rem;
|
|
281
|
-
padding: 1.2rem .8rem .8rem;
|
|
282
|
-
background-color: var(--md-default-bg-color);
|
|
283
|
-
}
|
|
284
|
-
.md-nav--primary .md-nav__title~.md-nav__list {
|
|
285
|
-
box-shadow: none;
|
|
286
|
-
}
|
|
287
|
-
.md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
|
|
288
|
-
border-top: none;
|
|
289
|
-
}
|
|
290
|
-
.md-nav--primary .md-nav__title .md-nav__button {
|
|
291
|
-
display: none;
|
|
292
|
-
}
|
|
293
|
-
.md-nav--primary .md-nav__title .md-nav__icon {
|
|
294
|
-
color: var(--md-default-fg-color);
|
|
295
|
-
position: static;
|
|
296
|
-
height: auto;
|
|
297
|
-
margin: 0 0 0 -0.2rem;
|
|
298
|
-
}
|
|
299
|
-
.md-nav--primary > .md-nav__title [for="none"] {
|
|
300
|
-
padding-top: 0;
|
|
301
|
-
}
|
|
302
|
-
.md-nav--primary .md-nav__item {
|
|
303
|
-
border-top: none;
|
|
304
|
-
}
|
|
305
|
-
.md-nav--primary :is(.md-nav__title,.md-nav__item) {
|
|
306
|
-
font-size : var(--md-typeset-font-size);
|
|
307
|
-
}
|
|
308
|
-
.md-nav .md-source {
|
|
309
|
-
display: none;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
.md-sidebar {
|
|
313
|
-
height: 100%;
|
|
314
|
-
}
|
|
315
|
-
.md-sidebar--primary {
|
|
316
|
-
width: 12.1rem !important;
|
|
317
|
-
z-index: 200;
|
|
318
|
-
left: ${R.isPinned?`calc(-12.1rem + ${zt})`:"calc(-12.1rem + 72px)"} !important;
|
|
319
|
-
}
|
|
320
|
-
.md-sidebar--secondary:not([hidden]) {
|
|
321
|
-
display: none;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
.md-content {
|
|
325
|
-
max-width: 100%;
|
|
326
|
-
margin-left: 0;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
.md-header__button {
|
|
330
|
-
margin: 0.4rem 0;
|
|
331
|
-
margin-left: 0.4rem;
|
|
332
|
-
padding: 0;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
.md-overlay {
|
|
336
|
-
left: 0;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
.md-footer {
|
|
340
|
-
position: static;
|
|
341
|
-
padding-left: 0;
|
|
342
|
-
}
|
|
343
|
-
.md-footer-nav__link {
|
|
344
|
-
/* footer links begin to overlap at small sizes without setting width */
|
|
345
|
-
width: 50%;
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
@media screen and (max-width: 600px) {
|
|
350
|
-
.md-sidebar--primary {
|
|
351
|
-
left: -12.1rem !important;
|
|
352
|
-
width: 12.1rem;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
`;const Pt=["h1","h2","h3","h4","h5","h6"];var mt=({theme:g})=>`
|
|
356
|
-
/*================== Typeset ==================*/
|
|
357
|
-
|
|
358
|
-
.md-typeset {
|
|
359
|
-
font-size: var(--md-typeset-font-size);
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
${Pt.reduce((R,J)=>{var K;const ae=(K=g.typography.htmlFontSize)!==null&&K!==void 0?K:16,fe=g.typography[J],{lineHeight:Ue,fontFamily:Ye,fontWeight:ut,fontSize:vt}=fe,et=qe=>{let Ne=1;return typeof qe=="number"&&(Ne=qe/ae*.6),typeof qe=="string"&&(Ne=qe.replace("rem","")),`calc(${Ne} * var(--md-typeset-font-size))`};return R.concat(`
|
|
363
|
-
.md-typeset ${J} {
|
|
364
|
-
color: var(--md-default-fg-color);
|
|
365
|
-
line-height: ${Ue};
|
|
366
|
-
font-family: ${Ye};
|
|
367
|
-
font-weight: ${ut};
|
|
368
|
-
font-size: ${et(vt)};
|
|
369
|
-
}
|
|
370
|
-
`)},"")}
|
|
371
|
-
|
|
372
|
-
.md-typeset .md-content__button {
|
|
373
|
-
color: var(--md-default-fg-color);
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
.md-typeset hr {
|
|
377
|
-
border-bottom: 0.05rem dotted ${g.palette.divider};
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
.md-typeset details {
|
|
381
|
-
font-size: var(--md-typeset-font-size) !important;
|
|
382
|
-
}
|
|
383
|
-
.md-typeset details summary {
|
|
384
|
-
padding-left: 2.5rem !important;
|
|
385
|
-
}
|
|
386
|
-
.md-typeset details summary:before,
|
|
387
|
-
.md-typeset details summary:after {
|
|
388
|
-
top: 50% !important;
|
|
389
|
-
width: 20px !important;
|
|
390
|
-
height: 20px !important;
|
|
391
|
-
transform: rotate(0deg) translateY(-50%) !important;
|
|
392
|
-
}
|
|
393
|
-
.md-typeset details[open] > summary:after {
|
|
394
|
-
transform: rotate(90deg) translateX(-50%) !important;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
.md-typeset blockquote {
|
|
398
|
-
color: var(--md-default-fg-color--light);
|
|
399
|
-
border-left: 0.2rem solid var(--md-default-fg-color--light);
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
.md-typeset table:not([class]) {
|
|
403
|
-
font-size: var(--md-typeset-font-size);
|
|
404
|
-
border: 1px solid var(--md-default-fg-color);
|
|
405
|
-
border-bottom: none;
|
|
406
|
-
border-collapse: collapse;
|
|
407
|
-
}
|
|
408
|
-
.md-typeset table:not([class]) th {
|
|
409
|
-
font-weight: bold;
|
|
410
|
-
}
|
|
411
|
-
.md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
|
|
412
|
-
border-bottom: 1px solid var(--md-default-fg-color);
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
.md-typeset pre > code::-webkit-scrollbar-thumb {
|
|
416
|
-
background-color: hsla(0, 0%, 0%, 0.32);
|
|
417
|
-
}
|
|
418
|
-
.md-typeset pre > code::-webkit-scrollbar-thumb:hover {
|
|
419
|
-
background-color: hsla(0, 0%, 0%, 0.87);
|
|
420
|
-
}
|
|
421
|
-
`,It=()=>`
|
|
422
|
-
/*================== Animations ==================*/
|
|
423
|
-
/*
|
|
424
|
-
Disable CSS animations on link colors as they lead to issues in dark mode.
|
|
425
|
-
The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
|
|
426
|
-
*/
|
|
427
|
-
.md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
|
|
428
|
-
transition: none;
|
|
429
|
-
}
|
|
430
|
-
`,en=({theme:g})=>`
|
|
431
|
-
/*================== Extensions ==================*/
|
|
432
|
-
|
|
433
|
-
/* HIGHLIGHT */
|
|
434
|
-
.highlight .md-clipboard:after {
|
|
435
|
-
content: unset;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
.highlight .nx {
|
|
439
|
-
color: ${g.palette.type==="dark"?"#ff53a3":"#ec407a"};
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
/* CODE HILITE */
|
|
443
|
-
.codehilite .gd {
|
|
444
|
-
background-color: ${g.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
.codehilite .gi {
|
|
448
|
-
background-color: ${g.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
/* TABBED */
|
|
452
|
-
.tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
|
|
453
|
-
.tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
|
|
454
|
-
.tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
|
|
455
|
-
.tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
|
|
456
|
-
.tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
|
|
457
|
-
.tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
|
|
458
|
-
.tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
|
|
459
|
-
.tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
|
|
460
|
-
.tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
|
|
461
|
-
.tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
|
|
462
|
-
.tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
|
|
463
|
-
.tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
|
|
464
|
-
.tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
|
|
465
|
-
.tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
|
|
466
|
-
.tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
|
|
467
|
-
.tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
|
|
468
|
-
.tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
|
|
469
|
-
.tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
|
|
470
|
-
.tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
|
|
471
|
-
.tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
|
|
472
|
-
color: var(--md-accent-fg-color);
|
|
473
|
-
border-color: var(--md-accent-fg-color);
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
/* TASK-LIST */
|
|
477
|
-
.task-list-control .task-list-indicator::before {
|
|
478
|
-
background-color: ${g.palette.action.disabledBackground};
|
|
479
|
-
}
|
|
480
|
-
.task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
|
|
481
|
-
background-color: ${g.palette.success.main};
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
/* ADMONITION */
|
|
485
|
-
.admonition {
|
|
486
|
-
font-size: var(--md-typeset-font-size) !important;
|
|
487
|
-
}
|
|
488
|
-
.admonition .admonition-title {
|
|
489
|
-
padding-left: 2.5rem !important;
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
.admonition .admonition-title:before {
|
|
493
|
-
top: 50% !important;
|
|
494
|
-
width: 20px !important;
|
|
495
|
-
height: 20px !important;
|
|
496
|
-
transform: translateY(-50%) !important;
|
|
497
|
-
}
|
|
498
|
-
`;const on=[Ze,rt,pt,mt,It,en],vn=()=>(0,y.Pf)(),$t=()=>{const g=vn(),R=(0,_e.Z)();return(0,r.useMemo)(()=>{const J={theme:R,sidebar:g};return on.reduce((K,ae)=>K+ae(J),"")},[R,g])},pn=()=>{const g=$t();return(0,r.useCallback)(R=>(R.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${g}</style>`),R),[g])},Cn=(g,R,J)=>{const K=g==="src"&&R.endsWith(".svg"),ae=!R.match(/^([a-z]*:)?\/\//i),fe=R.startsWith(J);return K&&(ae||fe)},Tn=({techdocsStorageApi:g,entityId:R,path:J})=>async K=>{const ae=await g.getApiOrigin(),fe=async(Ue,Ye)=>{for(const ut of Ue)if(ut.hasAttribute(Ye)){const vt=ut.getAttribute(Ye);if(!vt)return;const et=await g.getBaseUrl(vt,R,J);if(Cn(Ye,vt,ae))try{const Ne=await(await fetch(et,{credentials:"include"})).text();ut.setAttribute(Ye,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(Ne)))}`)}catch{ut.setAttribute("alt",`Error: ${vt}`)}else ut.setAttribute(Ye,et)}};return await Promise.all([fe(K.querySelectorAll("img"),"src"),fe(K.querySelectorAll("script"),"src"),fe(K.querySelectorAll("source"),"src"),fe(K.querySelectorAll("link"),"href"),fe(K.querySelectorAll("a[download]"),"href")]),K};var an=t(79158),Xn=t(67097),On=t(28316),qn=t(82717),ct=t.n(qn);const Bn=g=>R=>{var J;const K=R.querySelector('[title="Edit this page"]');if(!K||!K.href)return R;const ae=new URL(K.href),fe=g.byUrl(ae);if((fe==null?void 0:fe.type)!=="github"&&(fe==null?void 0:fe.type)!=="gitlab")return R;const Ue=((J=R.querySelector("article>h1"))===null||J===void 0?void 0:J.childNodes[0].textContent)||"",Ye=encodeURIComponent(`Documentation Feedback: ${Ue}`),ut=encodeURIComponent(`Page source:
|
|
499
|
-
${K.href}
|
|
500
|
-
|
|
501
|
-
Feedback:`),vt=(fe==null?void 0:fe.type)==="github"?(0,an.BT)(ae.href,"blob"):ae.href,et=ct()(vt),qe=`/${et.organization}/${et.name}`,Ne=K.cloneNode();switch(fe==null?void 0:fe.type){case"gitlab":Ne.href=`${ae.origin}${qe}/issues/new?issue[title]=${Ye}&issue[description]=${ut}`;break;case"github":Ne.href=`${ae.origin}${qe}/issues/new?title=${Ye}&body=${ut}`;break;default:return R}return On.render(r.createElement(Xn.Z),Ne),Ne.style.paddingLeft="5px",Ne.title="Leave feedback for this page",Ne.id="git-feedback-link",K==null||K.insertAdjacentElement("beforebegin",Ne),R};var wn=t(44882);const ln=()=>g=>{const R=g.querySelector('.md-header label[for="__drawer"]'),J=g.querySelector("article");if(!R||!J)return g;const K=R.cloneNode();return On.render(r.createElement(wn.Z),K),K.id="toggle-sidebar",K.title="Toggle Sidebar",K.classList.add("md-content__button"),K.style.setProperty("padding","0 0 0 5px"),K.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),J==null||J.prepend(K),g},$n=()=>g=>(((J,K)=>{Array.from(J).filter(ae=>ae.hasAttribute(K)).forEach(ae=>{const fe=ae.getAttribute(K);if(fe){fe.match(/^https?:\/\//i)&&ae.setAttribute("target","_blank");try{const Ue=zn(window.location.href);ae.setAttribute(K,new URL(fe,Ue).toString())}catch{ae.replaceWith(ae.textContent||fe)}}})})(Array.from(g.getElementsByTagName("a")),"href"),g);function zn(g){const R=new URL(g);return!R.pathname.endsWith("/")&&!R.pathname.endsWith(".html")&&(R.pathname+="/"),R.toString()}const jn=({baseUrl:g,onClick:R})=>J=>(Array.from(J.getElementsByTagName("a")).forEach(K=>{K.addEventListener("click",ae=>{const Ue=K.getAttribute("href");Ue&&Ue.startsWith(g)&&!K.hasAttribute("download")&&(ae.preventDefault(),R(ae,Ue))})}),J);var Gn=t(15459),ve=t(80030),oe=t(72379),Oe=t(41547),Pe=t(95074);const Ge=(0,Gn.Z)(g=>({tooltip:{fontSize:"inherit",color:g.palette.text.primary,margin:0,padding:g.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(ve.ZP),ft=()=>(0,h.jsx)(oe.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"})}),Ht=({text:g})=>{const[R,J]=(0,r.useState)(!1),[,K]=(0,Pe.Z)(),ae=(0,r.useCallback)(()=>{K(g),J(!0)},[g,K]),fe=(0,r.useCallback)(()=>{J(!1)},[J]);return(0,h.jsx)(Ge,{title:"Copied to clipboard",placement:"left",open:R,onClose:fe,leaveDelay:1e3,children:(0,h.jsx)(be.Z,{className:"md-clipboard md-icon",onClick:ae,children:(0,h.jsx)(ft,{})})})},Rt=g=>R=>{const J=R.querySelectorAll("pre > code");for(const ae of J){var K;const fe=ae.textContent||"",Ue=document.createElement("div");ae==null||(K=ae.parentElement)===null||K===void 0||K.prepend(Ue),On.render((0,h.jsx)(Oe.Z,{theme:g,children:(0,h.jsx)(Ht,{text:fe})}),Ue)}return R},ce=()=>g=>{var R;return(R=g.querySelector(".md-header"))===null||R===void 0||R.remove(),g},U=()=>g=>{var R,J;return(R=g.querySelector(".md-footer .md-copyright"))===null||R===void 0||R.remove(),(J=g.querySelector(".md-footer-copyright"))===null||J===void 0||J.remove(),g},he=({onLoading:g,onLoaded:R})=>J=>(g(),J.addEventListener(m.Ox,function K(){R(),J.removeEventListener(m.Ox,K)}),J),Ke=()=>g=>(g.addEventListener(m.Ox,function R(){if(window.location.hash){var J;const K=window.location.hash.slice(1);(J=g==null?void 0:g.querySelector(`[id="${K}"]`))===null||J===void 0||J.scrollIntoView()}g.removeEventListener(m.Ox,R)}),g),Ve=()=>g=>(setTimeout(()=>{const R=g==null?void 0:g.querySelectorAll("li.md-nav__item--active");R.length!==0&&(R.forEach(K=>{const ae=K==null?void 0:K.querySelector("input");ae!=null&&ae.checked||ae==null||ae.click()}),R[R.length-1].scrollIntoView())},200),g),at=async(g,R)=>{let J;if(typeof g=="string")J=new DOMParser().parseFromString(g,"text/html").documentElement;else if(g instanceof Element)J=g;else throw new Error("dom is not a recognized type");for(const K of R)J=await K(J);return J},Tt="screen and (max-width: 76.1875em)",tn=g=>{const R=(0,Xe.s0)(),J=(0,_e.Z)(),K=(0,it.Z)(Tt),ae=Te(),fe=pn(),Ue=(0,P.z$)(),Ye=(0,P.h_)(m.Dl),ut=(0,P.h_)(Fe.q3),{state:vt,path:et,content:qe}=(0,T.DK)(),[Ne,Zt]=(0,r.useState)(null),Kt=(0,m.ux)(Ne),kt=(0,r.useCallback)(()=>{if(!Ne)return;Ne.querySelectorAll(".md-sidebar").forEach(We=>{if(K)We.style.top="0px";else{const In=document==null?void 0:document.querySelector(".techdocs-reader-page");var Ut;const Zn=(Ut=In==null?void 0:In.getBoundingClientRect().top)!==null&&Ut!==void 0?Ut:0;var cn;let xn=(cn=Ne.getBoundingClientRect().top)!==null&&cn!==void 0?cn:0;const Kn=Ne.querySelector(".md-container > .md-tabs");var yn;const bn=(yn=Kn==null?void 0:Kn.getBoundingClientRect().height)!==null&&yn!==void 0?yn:0;xn<Zn&&(xn=Zn),We.style.top=`${Math.max(xn,0)+bn}px`}We.style.setProperty("opacity","1")})},[Ne,K]);(0,r.useEffect)(()=>(window.addEventListener("resize",kt),window.addEventListener("scroll",kt,!0),()=>{window.removeEventListener("resize",kt),window.removeEventListener("scroll",kt,!0)}),[Ne,kt]);const Dt=(0,r.useCallback)(()=>{if(!Ne)return;const ht=Ne.querySelector(".md-footer");ht&&(ht.style.width=`${Ne.getBoundingClientRect().width}px`)},[Ne]);(0,r.useEffect)(()=>(window.addEventListener("resize",Dt),()=>{window.removeEventListener("resize",Dt)}),[Ne,Dt]),(0,r.useEffect)(()=>{Kt||(Dt(),kt())},[vt,Kt,Dt,kt]);const Wt=(0,r.useCallback)((ht,We)=>at(ht,[ae,Tn({techdocsStorageApi:Ye,entityId:g,path:We}),$n(),ln(),ce(),U(),Bn(ut),fe]),[g,ut,Ye,ae,fe]),Gt=(0,r.useCallback)(async ht=>at(ht,[Ke(),Ve(),Rt(J),jn({baseUrl:window.location.origin,onClick:(We,Ut)=>{var cn;const yn=We.ctrlKey||We.metaKey,In=new URL(Ut),Zn=`${In.pathname}${In.search}${In.hash}`,xn=((cn=We.target)===null||cn===void 0?void 0:cn.innerText)||Ut,Kn=Ut.replace(window.location.origin,"");if(Ue.captureEvent("click",xn,{attributes:{to:Kn}}),In.hash)if(yn)window.open(Zn,"_blank");else{var bn;R(Zn),(bn=ht==null?void 0:ht.querySelector(`[id="${In.hash.slice(1)}"]`))===null||bn===void 0||bn.scrollIntoView()}else yn?window.open(Zn,"_blank"):R(Zn)}}),he({onLoading:()=>{},onLoaded:()=>{var We;(We=ht.querySelector(".md-nav__title"))===null||We===void 0||We.removeAttribute("for")}}),he({onLoading:()=>{Array.from(ht.querySelectorAll(".md-sidebar")).forEach(Ut=>{Ut.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[J,R,Ue]);return(0,r.useEffect)(()=>{if(!qe)return()=>{};let ht=!0;return Wt(qe,et).then(async We=>{if(!(We!=null&&We.innerHTML)||!ht)return;window.scroll({top:0});const Ut=await Gt(We);Zt(Ut)}),()=>{ht=!1}},[qe,et,Wt,Gt]),Ne};var Xt=t(8560);const sn=()=>{const g=(0,m.$L)(),{shadowRoot:R}=(0,m.x1)(),J=R==null?void 0:R.querySelector('[data-md-component="content"]'),K=R==null?void 0:R.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let ae=K==null?void 0:K.querySelector('[data-techdocs-addons-location="primary sidebar"]');ae||(ae=document.createElement("div"),ae.setAttribute("data-techdocs-addons-location","primary sidebar"),K==null||K.prepend(ae));const fe=R==null?void 0:R.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Ue=fe==null?void 0:fe.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Ue||(Ue=document.createElement("div"),Ue.setAttribute("data-techdocs-addons-location","secondary sidebar"),fe==null||fe.prepend(Ue)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Xt.Z,{container:ae,children:g.renderComponentsByLocation(m.oZ.PrimarySidebar)}),(0,h.jsx)(Xt.Z,{container:J,children:g.renderComponentsByLocation(m.oZ.Content)}),(0,h.jsx)(Xt.Z,{container:Ue,children:g.renderComponentsByLocation(m.oZ.SecondarySidebar)})]})},q=(0,F.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),W=(0,T.m1)(g=>{var R;const{withSearch:J=!0,onReady:K}=g,ae=q(),{entityMetadata:{value:fe,loading:Ue},entityRef:Ye,setShadowRoot:ut}=(0,m.x1)(),vt=tn(Ye),et=(0,r.useCallback)(qe=>{ut(qe),K instanceof Function&&K()},[ut,K]);return Ue===!1&&!fe?(0,h.jsx)(y.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):vt?(0,h.jsx)(y.VY,{children:(0,h.jsxs)(L.Z,{container:!0,children:[(0,h.jsx)(L.Z,{xs:12,item:!0,children:(0,h.jsx)(Re,{})}),J&&(0,h.jsx)(L.Z,{className:ae.search,xs:"auto",item:!0,children:(0,h.jsx)(l.S,{entityId:Ye,entityTitle:fe==null||(R=fe.metadata)===null||R===void 0?void 0:R.title})}),(0,h.jsx)(L.Z,{xs:12,item:!0,children:(0,h.jsx)(m.VA,{element:vt,onAppend:et,children:(0,h.jsx)(sn,{})})})]})}):(0,h.jsx)(y.VY,{children:(0,h.jsx)(L.Z,{container:!0,children:(0,h.jsx)(L.Z,{xs:12,item:!0,children:(0,h.jsx)(Re,{})})})})}),de=null},93225:function(bt,Be,t){"use strict";t.d(Be,{S:function(){return ee}});var h=t(52322),r=t(2784),F=t(18671),L=t(60905),m=t(98069),y=t(60364),l=t(73250),M=t(61886),be=t(40303),V=t(25271),G=t(23196),b=t(60871),B=t(76635),Y=t(95573);const le=(0,h.jsx)(m.Z,{animation:"wave",variant:"text",height:40}),ee=X=>{const{palette:{common:{white:j}}}=(0,y.Z)(),{children:P}=X,$=(0,M.$L)(),T=(0,b.h_)(b.Ds),{title:re,setTitle:Re,subtitle:Xe,setSubtitle:_e,entityRef:it,metadata:{value:Fe,loading:jt},entityMetadata:{value:He,loading:st}}=(0,M.x1)();(0,r.useEffect)(()=>{Fe&&(Re(Fe.site_name),_e(()=>{let{site_description:Ae}=Fe;return(!Ae||Ae==="None")&&(Ae=""),Ae}))},[Fe,Re,_e]);const je=T.getOptional("app.title")||"Backstage",Et=[re,Xe,je].filter(Boolean).join(" | "),{locationMetadata:St,spec:gt}=He||{},yt=gt==null?void 0:gt.lifecycle,At=He?(0,be.hF)(He,V.S4):[],Lt=(0,b.tg)(Y._Z)(),ze=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(G.i9,{label:(0,B.capitalize)((He==null?void 0:He.kind)||"entity"),value:(0,h.jsx)(be.dx,{color:"inherit",entityRef:it,title:He==null?void 0:He.metadata.title,defaultKind:"Component"})}),At.length>0&&(0,h.jsx)(G.i9,{label:"Owner",value:(0,h.jsx)(be.rI,{color:"inherit",entityRefs:At,defaultKind:"group"})}),yt?(0,h.jsx)(G.i9,{label:"Lifecycle",value:yt}):null,St&&St.type!=="dir"&&St.type!=="file"?(0,h.jsx)(G.i9,{label:"",value:(0,h.jsxs)(L.Z,{container:!0,direction:"column",alignItems:"center",style:{color:j},children:[(0,h.jsx)(L.Z,{style:{padding:0},item:!0,children:(0,h.jsx)(l.Z,{style:{marginTop:"-25px"}})}),(0,h.jsx)(L.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:St.target}):null]});return!st&&He===void 0||!jt&&Fe===void 0?null:(0,h.jsxs)(G.h4,{type:"Documentation",typeLink:Lt,title:re||le,subtitle:Xe===""?void 0:Xe||le,children:[(0,h.jsx)(F.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:Et})}),ze,P,$.renderComponentsByLocation(M.oZ.Header)]})}},65124:function(bt,Be,t){"use strict";t.d(Be,{b:function(){return b}});var h=t(52322),r=t(2784),F=t(79692),L=t(15223),m=t(95544),y=t(80030),l=t(61837),M=t(48348),be=t(47603),V=t(61886);const G=(0,F.Z)(B=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:B.spacing(3,3,0)}})),b=B=>{const Y=G(),[le,ee]=(0,r.useState)(null),X=(0,r.useCallback)(Xe=>{ee(Xe.currentTarget)},[]),j=(0,r.useCallback)(()=>{ee(null)},[]),{entityMetadata:{value:P,loading:$}}=(0,V.x1)(),T=(0,V.$L)(),re=T.renderComponentsByLocation(V.oZ.Subheader),Re=T.renderComponentsByLocation(V.oZ.Settings);return!re&&!Re||$===!1&&!P?null:(0,h.jsx)(L.Z,{classes:Y,...B.toolbarProps,children:(0,h.jsxs)(m.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[re,Re?(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:X,children:(0,h.jsx)(be.Z,{})})}),(0,h.jsx)(M.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:le,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(le),onClose:j,keepMounted:!0,children:Re})]}):null]})})}},95481:function(bt,Be,t){"use strict";t.d(Be,{DK:function(){return b},m1:function(){return Y}});var h=t(52322),r=t(2784),F=t(79635),L=t(61886),m=t(60871),y=t(64279),l=t(77446);function M({contentLoading:le,content:ee,activeSyncState:X}){return le||X==="BUILD_READY_RELOAD"||!ee&&X==="CHECKING"?"CHECKING":!ee&&X==="BUILDING"?"INITIAL_BUILD":ee?X==="BUILDING"?"CONTENT_STALE_REFRESHING":X==="BUILD_READY"?"CONTENT_STALE_READY":X==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function be(le,ee){const X={...le};switch(ee.type){case"sync":ee.state==="CHECKING"&&(X.buildLog=[]),X.activeSyncState=ee.state,X.syncError=ee.syncError;break;case"contentLoading":X.contentLoading=!0,X.contentError=void 0;break;case"content":typeof ee.path=="string"&&(X.path=ee.path),X.contentLoading=!1,X.content=ee.content,X.contentError=ee.contentError;break;case"buildLog":X.buildLog=X.buildLog.concat(ee.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(X.activeSyncState)&&["contentLoading","content"].includes(ee.type)&&(X.activeSyncState="UP_TO_DATE",X.buildLog=[]),X}function V(le,ee,X,j){var P,$;const[T,re]=(0,r.useReducer)(be,{activeSyncState:"CHECKING",path:j,contentLoading:!0,buildLog:[]}),Re=(0,m.h_)(L.Dl),{retry:Xe}=(0,l.Z)(async()=>{re({type:"contentLoading"});try{const Fe=await Re.getEntityDocs({kind:le,namespace:ee,name:X},j);return re({type:"content",content:Fe,path:j}),Fe}catch(Fe){re({type:"content",contentError:Fe,path:j})}},[Re,le,ee,X,j]),_e=(0,r.useRef)({content:void 0,reload:()=>{}});return _e.current={content:T.content,reload:Xe},(0,y.default)(async()=>{re({type:"sync",state:"CHECKING"});const Fe=setTimeout(()=>{re({type:"sync",state:"BUILDING"})},1e3);try{switch(await Re.syncEntityDocs({kind:le,namespace:ee,name:X},He=>{re({type:"buildLog",log:He})})){case"updated":_e.current.content?re({type:"sync",state:"BUILD_READY"}):(_e.current.reload(),re({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":re({type:"sync",state:"UP_TO_DATE"});break;default:re({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(jt){re({type:"sync",state:"ERROR",syncError:jt})}finally{clearTimeout(Fe)}},[le,X,ee,Re,re,_e]),{state:(0,r.useMemo)(()=>M({activeSyncState:T.activeSyncState,contentLoading:T.contentLoading,content:T.content}),[T.activeSyncState,T.content,T.contentLoading]),contentReload:Xe,path:T.path,content:T.content,contentErrorMessage:(P=T.contentError)===null||P===void 0?void 0:P.toString(),syncErrorMessage:($=T.syncError)===null||$===void 0?void 0:$.toString(),buildLog:T.buildLog}}const G=(0,r.createContext)({}),b=()=>(0,r.useContext)(G),B=({children:le})=>{const{"*":ee=""}=(0,F.UO)(),{entityRef:X}=(0,L.x1)(),{kind:j,namespace:P,name:$}=X,T=V(j,P,$,ee);return(0,h.jsx)(G.Provider,{value:T,children:le instanceof Function?le(T):le})},Y=le=>ee=>(0,h.jsx)(B,{children:(0,h.jsx)(le,{...ee})})},95573:function(bt,Be,t){"use strict";t.d(Be,{Fw:function(){return F},_Z:function(){return r},pd:function(){return L}});var h=t(60871);const r=(0,h.NT)({id:"techdocs:index-page"}),F=(0,h.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),L=(0,h.NT)({id:"techdocs:catalog-reader-view"})},55511:function(bt,Be,t){"use strict";t.r(Be),t.d(Be,{TechDocsSearchResultListItem:function(){return V}});var h=t(52322),r=t(2784),F=t(79692),L=t(49378),m=t(86136),y=t(90436),l=t(23196),M=t(15096);const be=(0,F.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),V=G=>{const{result:b,highlight:B,lineClamp:Y=5,asListItem:le=!0,asLink:ee=!0,title:X,icon:j}=G,P=be(),$=({children:Re})=>ee?(0,h.jsx)(l.rU,{noTrack:!0,to:b.location,children:Re}):(0,h.jsx)(h.Fragment,{children:Re}),T=()=>{const Re=B!=null&&B.fields.title?(0,h.jsx)(M.FA,{text:B.fields.title,preTag:B.preTag,postTag:B.postTag}):b.title,Xe=B!=null&&B.fields.entityTitle?(0,h.jsx)(M.FA,{text:B.fields.entityTitle,preTag:B.preTag,postTag:B.postTag}):b.entityTitle,_e=B!=null&&B.fields.name?(0,h.jsx)(M.FA,{text:B.fields.name,preTag:B.preTag,postTag:B.postTag}):b.name;return b?(0,h.jsx)(L.Z,{className:P.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,h.jsx)($,{children:X||(0,h.jsxs)(h.Fragment,{children:[Re," | ",Xe!=null?Xe:_e," docs"]})}),secondary:(0,h.jsx)(y.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Y,overflow:"hidden"},children:B!=null&&B.fields.text?(0,h.jsx)(M.FA,{text:B.fields.text,preTag:B.preTag,postTag:B.postTag}):b.text})}):null},re=({children:Re})=>le?(0,h.jsxs)(h.Fragment,{children:[j&&(0,h.jsx)(m.Z,{children:typeof j=="function"?j(b):j}),(0,h.jsx)("div",{className:P.flexContainer,children:Re})]}):(0,h.jsx)(h.Fragment,{children:Re});return(0,h.jsx)(re,{children:(0,h.jsx)(T,{})})}},22478:function(bt,Be,t){"use strict";t.d(Be,{S:function(){return G}});var h=t(52322),r=t(15096),F=t(79692),L=t(27556),m=t(2784),y=t(79635),l=t(55511);const M=(0,F.Z)(b=>({root:{width:"100%"},bar:{padding:b.spacing(1)}})),be=b=>b==null?void 0:b.document,V=b=>{const{entityId:B,entityTitle:Y,debounceTime:le=150}=b,[ee,X]=(0,m.useState)(!1),j=(0,y.s0)(),{setFilters:P,result:{loading:$,value:T}}=(0,r.Rx)(),re=M(),[Re,Xe]=(0,m.useState)([]);(0,m.useEffect)(()=>{let He=!0;if(He&&T){const st=T.results.slice(0,10);Xe(st)}return()=>{He=!1}},[$,T]);const{kind:_e,name:it,namespace:Fe}=B;(0,m.useEffect)(()=>{P(He=>({...He,kind:_e,namespace:Fe,name:it}))},[_e,Fe,it,P]);const jt=(He,st)=>{if(be(st)){const{location:je}=st.document;j(je)}};return(0,h.jsx)(L.Z,{className:re.bar,variant:"outlined",children:(0,h.jsx)(r.qO,{classes:{root:re.root},"data-testid":"techdocs-search-bar",size:"small",open:ee,getOptionLabel:()=>"",filterOptions:He=>He,onClose:()=>{X(!1)},onFocus:()=>{X(!0)},onChange:jt,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Re,renderOption:({document:He,highlight:st})=>(0,h.jsx)(l.TechDocsSearchResultListItem,{result:He,lineClamp:3,asListItem:!1,asLink:!1,title:He.title,highlight:st}),loading:$,inputDebounceTime:le,inputPlaceholder:`Search ${Y||B.name} docs`,freeSolo:!1})})},G=b=>{const B={term:"",types:["techdocs"],pageCursor:"",filters:b.entityId};return(0,h.jsx)(r.Nd,{initialState:B,children:(0,h.jsx)(V,{...b})})}},53260:function(){}},function(bt){var Be=function(h){return bt(bt.s=h)};bt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,5924,4736],function(){return Be(6290)});var t=bt.O()}]);})();
|
|
502
|
-
|
|
503
|
-
//# sourceMappingURL=main.f29d79fc.js.map
|