"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[9605,5788],{70048:function(K,c,t){t.d(c,{K:function(){return _}});var n=t(18690);function _(l){return(0,n.g)()}},99538:function(K,c,t){t.d(c,{T7:function(){return O},TY:function(){return x},tN:function(){return T}});var n=t(31085),_=t(6820),l=t(25862),u=t(43836),D=t(10602),M=t(14041);const A=(0,u.tK)("entity-context"),O=s=>{const{children:r,entity:m,loading:E,error:g,refresh:v}=s,y={entity:m,loading:E,error:g,refresh:v};return(0,n.jsx)(A.Provider,{value:(0,D.B)({1:y}),children:(0,n.jsx)(l.Ig,{attributes:{...m?{entityRef:(0,_.U2)(m)}:void 0},children:r})})},I=s=>_jsx(O,{entity:s.entity,loading:!s.entity,error:void 0,refresh:void 0,children:s.children});function T(){const s=(0,u.qO)("entity-context");if(!s)throw new Error("Entity context is not available");const r=s.atVersion(1);if(!r)throw new Error("EntityContext v1 not available");if(!r.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:r.entity}}function x(){const s=(0,u.qO)("entity-context");if(!s)throw new Error("Entity context is not available");const r=s.atVersion(1);if(!r)throw new Error("EntityContext v1 not available");const{entity:m,loading:E,error:g,refresh:v}=r;return{entity:m,loading:E,error:g,refresh:v}}},29605:function(K,c,t){t.r(c),t.d(c,{EmbeddedDocsRouter:function(){return V},Router:function(){return p},isTechDocsAvailable:function(){return j}});var n=t(31085),_=t(14041),l=t(18690),u=t(6820),D=t(39278),M=t(16203),A=t(39299);const O="backstage.io/techdocs-entity",I=({entity:o})=>{var e;let a=(0,u.sM)(o);if(!((e=o.metadata.annotations)===null||e===void 0)&&e[O])try{var i;a=(0,u.KU)((i=o.metadata.annotations)===null||i===void 0?void 0:i[O])}catch{}return(0,n.jsxs)(D.Wj,{entityRef:a,children:[(0,n.jsx)(A.Z,{}),(0,n.jsx)(M.p,{withSearch:!1})]})};var T=t(85788),x=t(57315),s=t(99538),r=t(10394),m=t(64947),E=t(58837),g=t(72501),v=t(44186),y=t(77310),f=t(72072);const C=(0,E.A)(o=>({code:{borderRadius:6,margin:o.spacing(2,0),background:o.palette.type==="dark"?"#444":o.palette.common.white}}),{name:"BackstageMissingAnnotationEmptyState"});function L(o,e){var a,i;const d=(e==null?void 0:e.kind)||"Component",W=(e==null?void 0:e.metadata.name)||"example",U=(e==null||(a=e.spec)===null||a===void 0?void 0:a.type)||"website",S=(e==null||(i=e.spec)===null||i===void 0?void 0:i.owner)||"user:default/guest",Y=`apiVersion: backstage.io/v1alpha1
kind: ${d}
metadata:
  name: ${W}
  annotations:${o.map(b=>`
    ${b}: value`).join("")}
spec:
  type: ${U}
  owner: ${S}`;let N=6;const H=[];return o.forEach(()=>{H.push(N),N++}),{yamlText:Y,lineNumbers:H}}function B(o,e="Component"){const a=o.length<=1;return(0,n.jsxs)(n.Fragment,{children:["The ",a?"annotation":"annotations"," ",o.map(i=>(0,n.jsx)("code",{children:i})).reduce((i,d)=>(0,n.jsxs)(n.Fragment,{children:[i,", ",d]}))," ",a?"is":"are"," missing. You need to add the"," ",a?"annotation":"annotations"," to your ",e," if you want to enable this tool."]})}function R(o){let e;try{e=(0,s.tN)().entity}catch{}const{annotation:a,readMoreUrl:i}=o,d=Array.isArray(a)?a:[a],W=i||"https://backstage.io/docs/features/software-catalog/well-known-annotations",U=C(),S=(e==null?void 0:e.kind)||"Component",{yamlText:Y,lineNumbers:N}=L(d,e);return(0,n.jsx)(v.p,{missing:"field",title:"Missing Annotation",description:B(d,S),action:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(g.A,{variant:"body1",children:["Add the annotation to your ",S," YAML as shown in the highlighted example below:"]}),(0,n.jsx)(r.A,{className:U.code,children:(0,n.jsx)(y.z,{text:Y,language:"yaml",showLineNumbers:!0,highlightedNumbers:N,customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(m.A,{color:"primary",component:f.N_,to:W,children:"Read more"})]})})}const P="backstage.io/techdocs-ref",h="backstage.io/techdocs-entity",j=o=>{var e,a,i,d;return!!(!(o==null||(a=o.metadata)===null||a===void 0||(e=a.annotations)===null||e===void 0)&&e[P])||!!(!(o==null||(d=o.metadata)===null||d===void 0||(i=d.annotations)===null||i===void 0)&&i[h])},p=()=>(0,n.jsxs)(l.BV,{children:[(0,n.jsx)(l.qh,{path:"/",element:(0,n.jsx)(T.TechDocsIndexPage,{})}),(0,n.jsx)(l.qh,{path:"/:namespace/:kind/:name/*",element:(0,n.jsx)(x.W,{})})]}),V=o=>{var e,a;const{children:i}=o,{entity:d}=(0,s.tN)(),W=(0,l.Ye)([{path:"/*",element:(0,n.jsx)(I,{entity:d}),children:[{path:"*",element:i}]}]);return((e=d.metadata.annotations)===null||e===void 0?void 0:e[P])||((a=d.metadata.annotations)===null||a===void 0?void 0:a[h])?W:(0,n.jsx)(R,{annotation:[P]})}},85788:function(K,c,t){t.r(c),t.d(c,{TechDocsIndexPage:function(){return D}});var n=t(31085),_=t(14041),l=t(18690),u=t(85920);const D=M=>(0,l.P1)()||(0,n.jsx)(u.K,{...M})},57315:function(K,c,t){t.d(c,{W:function(){return m},b:function(){return r}});var n=t(31085),_=t(14041),l=t(18690),u=t(24504),D=t(72020),M=t(86892),A=t(16203),O=t(45061),I=t(39299),T=t(82779),x=t(70048),s=t(19402);const r=E=>{const{withSearch:g,withHeader:v=!0}=E;return(0,n.jsxs)(u.Y,{themeId:"documentation",children:[v&&(0,n.jsx)(O.T,{}),(0,n.jsx)(I.Z,{}),(0,n.jsx)(A.p,{withSearch:g})]})},m=E=>{const{kind:g,name:v,namespace:y}=(0,x.K)(T.Oc),{children:f,entityRef:C={kind:g,name:v,namespace:y}}=E,L=(0,l.P1)();if(!f){const P=(L?_.Children.toArray(L.props.children):[]).flatMap(h=>{var j,p;return(p=h==null||(j=h.props)===null||j===void 0?void 0:j.children)!==null&&p!==void 0?p:[]}).find(h=>!(0,s.E)(h,D.AF)&&!(0,s.E)(h,D.Wm));return(0,n.jsx)(M.R,{entityRef:C,children:P||(0,n.jsx)(r,{})})}return(0,n.jsx)(M.R,{entityRef:C,children:({metadata:B,entityMetadata:R,onReady:P})=>(0,n.jsx)("div",{className:"techdocs-reader-page",children:(0,n.jsx)(u.Y,{themeId:"documentation",children:f instanceof Function?f({entityRef:C,techdocsMetadataValue:B.value,entityMetadataValue:R.value,onReady:P}):f})})})}},39299:function(K,c,t){t.d(c,{Z:function(){return m}});var n=t(31085),_=t(14041),l=t(58837),u=t(75173),D=t(10394),M=t(71677),A=t(29365),O=t(37757),I=t(9684),T=t(86892),x=t(72020),s=t(99730);const r=(0,l.A)(E=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:E.spacing(3,3,0),"@media print":{display:"none"}}})),m=E=>{const g=r(),[v,y]=(0,_.useState)(null),f=(0,_.useCallback)(j=>{y(j.currentTarget)},[]),C=(0,_.useCallback)(()=>{y(null)},[]),{entityMetadata:{value:L,loading:B}}=(0,T.V)(),R=(0,x.YR)(),P=R.renderComponentsByLocation(s.e.Subheader),h=R.renderComponentsByLocation(s.e.Settings);return!P&&!h||B===!1&&!L?null:(0,n.jsx)(u.A,{classes:g,...E.toolbarProps,children:(0,n.jsxs)(D.A,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[P,h?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(M.Ay,{title:"Settings",children:(0,n.jsx)(A.A,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:f,children:(0,n.jsx)(I.A,{})})}),(0,n.jsx)(O.A,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:v,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:!!v,onClose:C,keepMounted:!0,children:(0,n.jsx)("div",{children:h})})]}):null]})})}}}]);})();

//# sourceMappingURL=9605.333ca2de.chunk.js.map