@techdocs/cli 1.14.1-next.1 → 1.14.1
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 +6 -19
- package/dist/commands/generate/generate.cjs.js +3 -1
- package/dist/commands/generate/generate.cjs.js.map +1 -1
- package/dist/commands/index.cjs.js +4 -0
- package/dist/commands/index.cjs.js.map +1 -1
- package/dist/embedded-app/.config-schema.json +26 -2
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/index.html.tmpl +1 -1
- package/dist/embedded-app/static/123.b7794a0eee64.chunk.js +2 -0
- package/dist/embedded-app/static/123.b7794a0eee64.chunk.js.map +1 -0
- package/dist/embedded-app/static/1435.8322a7d8da03.chunk.js +2 -0
- package/dist/embedded-app/static/1435.8322a7d8da03.chunk.js.map +1 -0
- package/dist/embedded-app/static/1659.b8b0e908d038.chunk.js +2 -0
- package/dist/embedded-app/static/1659.b8b0e908d038.chunk.js.map +1 -0
- package/dist/embedded-app/static/1749.682df5396a43.chunk.js +2 -0
- package/dist/embedded-app/static/1749.682df5396a43.chunk.js.map +1 -0
- package/dist/embedded-app/static/1767.9f5e3fa87f62.chunk.js +2 -0
- package/dist/embedded-app/static/1767.9f5e3fa87f62.chunk.js.map +1 -0
- package/dist/embedded-app/static/1994.e9f61042da84.chunk.js +2 -0
- package/dist/embedded-app/static/1994.e9f61042da84.chunk.js.map +1 -0
- package/dist/embedded-app/static/2295.6b18a59669de.chunk.js +5 -0
- package/dist/embedded-app/static/2295.6b18a59669de.chunk.js.map +1 -0
- package/dist/embedded-app/static/2360.c15ceaf7a336.chunk.js +2 -0
- package/dist/embedded-app/static/2360.c15ceaf7a336.chunk.js.map +1 -0
- package/dist/embedded-app/static/{2668.420a5986c298.chunk.js → 2668.70ce80bd9574.chunk.js} +2 -2
- package/dist/embedded-app/static/{2668.420a5986c298.chunk.js.map → 2668.70ce80bd9574.chunk.js.map} +1 -1
- package/dist/embedded-app/static/3031.a64485c78a5e.chunk.js +2 -0
- package/dist/embedded-app/static/{3031.3ad03b75f7d6.chunk.js.map → 3031.a64485c78a5e.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{3554.3dc8d75e4b1f.chunk.js → 3554.43b3a3c60b33.chunk.js} +2 -2
- package/dist/embedded-app/static/{3554.3dc8d75e4b1f.chunk.js.map → 3554.43b3a3c60b33.chunk.js.map} +1 -1
- package/dist/embedded-app/static/4587.fa2bf602f965.chunk.js +2 -0
- package/dist/embedded-app/static/4587.fa2bf602f965.chunk.js.map +1 -0
- package/dist/embedded-app/static/{4591.47a06af79fef.chunk.js → 4591.d741c025cb8a.chunk.js} +2 -2
- package/dist/embedded-app/static/{4591.47a06af79fef.chunk.js.map → 4591.d741c025cb8a.chunk.js.map} +1 -1
- package/dist/embedded-app/static/4609.afdaf67e3d37.chunk.js +531 -0
- package/dist/embedded-app/static/4609.afdaf67e3d37.chunk.js.map +1 -0
- package/dist/embedded-app/static/4648.0de68968e5e2.chunk.js +2 -0
- package/dist/embedded-app/static/4648.0de68968e5e2.chunk.js.map +1 -0
- package/dist/embedded-app/static/{5124.7da4bbeaafd0.chunk.js → 5124.bf809bc06c78.chunk.js} +2 -2
- package/dist/embedded-app/static/{5124.7da4bbeaafd0.chunk.js.map → 5124.bf809bc06c78.chunk.js.map} +1 -1
- package/dist/embedded-app/static/5877.a2e28865fc9e.chunk.js +2 -0
- package/dist/embedded-app/static/5877.a2e28865fc9e.chunk.js.map +1 -0
- package/dist/embedded-app/static/6138.3678d771bc61.chunk.js +2 -0
- package/dist/embedded-app/static/6138.3678d771bc61.chunk.js.map +1 -0
- package/dist/embedded-app/static/{6206.a6dc0414494f.chunk.js → 6206.69309b586b93.chunk.js} +2 -2
- package/dist/embedded-app/static/{6206.a6dc0414494f.chunk.js.map → 6206.69309b586b93.chunk.js.map} +1 -1
- package/dist/embedded-app/static/6718.89aeb24410af.chunk.js +22 -0
- package/dist/embedded-app/static/{6718.245b95228170.chunk.js.map → 6718.89aeb24410af.chunk.js.map} +1 -1
- package/dist/embedded-app/static/6949.7ed9d7a91fab.chunk.js +4 -0
- package/dist/embedded-app/static/6949.7ed9d7a91fab.chunk.js.map +1 -0
- package/dist/embedded-app/static/7203.80b9f341a5e8.chunk.js +2 -0
- package/dist/embedded-app/static/7203.80b9f341a5e8.chunk.js.map +1 -0
- package/dist/embedded-app/static/{7226.cd9be3586445.chunk.js → 7226.21b332b45923.chunk.js} +2 -2
- package/dist/embedded-app/static/{7226.cd9be3586445.chunk.js.map → 7226.21b332b45923.chunk.js.map} +1 -1
- package/dist/embedded-app/static/7632.3917bed33d55.chunk.js +2 -0
- package/dist/embedded-app/static/{7632.79234b81e968.chunk.js.map → 7632.3917bed33d55.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{8125.84952fcec739.chunk.js → 8125.d349a79d61b4.chunk.js} +2 -2
- package/dist/embedded-app/static/{8125.84952fcec739.chunk.js.map → 8125.d349a79d61b4.chunk.js.map} +1 -1
- package/dist/embedded-app/static/8877.eae6a09dd4f9.chunk.js +2 -0
- package/dist/embedded-app/static/{8877.cdb190e598d5.chunk.js.map → 8877.eae6a09dd4f9.chunk.js.map} +1 -1
- package/dist/embedded-app/static/9050.ea90466f10f3.chunk.js +2 -0
- package/dist/embedded-app/static/9050.ea90466f10f3.chunk.js.map +1 -0
- package/dist/embedded-app/static/9230.53ff1aa23058.chunk.js +2 -0
- package/dist/embedded-app/static/9230.53ff1aa23058.chunk.js.map +1 -0
- package/dist/embedded-app/static/main.7dc68125121e.js +2 -0
- package/dist/embedded-app/static/main.7dc68125121e.js.map +1 -0
- package/dist/embedded-app/static/module-micromark-core-commonmark.d049c8fc059e.js +2 -0
- package/dist/embedded-app/static/module-micromark-core-commonmark.d049c8fc059e.js.map +1 -0
- package/dist/embedded-app/static/module-parse5.94980036c2b0.js +2 -0
- package/dist/embedded-app/static/module-parse5.94980036c2b0.js.map +1 -0
- package/dist/embedded-app/static/module-react-aria-components.27a8b47829ea.js +2 -0
- package/dist/embedded-app/static/module-react-aria-components.27a8b47829ea.js.map +1 -0
- package/dist/embedded-app/static/{runtime.3d9231da678d.js → runtime.fa776ba09ef1.js} +2 -2
- package/dist/embedded-app/static/{runtime.3d9231da678d.js.map → runtime.fa776ba09ef1.js.map} +1 -1
- package/dist/embedded-app/static/vendor.e2d917c57ed9.js +2 -0
- package/dist/embedded-app/static/vendor.e2d917c57ed9.js.map +1 -0
- package/dist/packages/techdocs-cli/package.json.cjs.js +1 -1
- package/dist/plugins/techdocs-zensical-internal/src/TechdocsZensicalGenerator.cjs.js +5 -1
- package/dist/plugins/techdocs-zensical-internal/src/TechdocsZensicalGenerator.cjs.js.map +1 -1
- package/package.json +10 -10
- package/dist/embedded-app/static/123.45e40c5d70dc.chunk.js +0 -2
- package/dist/embedded-app/static/123.45e40c5d70dc.chunk.js.map +0 -1
- package/dist/embedded-app/static/1659.865be4aaaafb.chunk.js +0 -2
- package/dist/embedded-app/static/1659.865be4aaaafb.chunk.js.map +0 -1
- package/dist/embedded-app/static/1749.b4483b4e2bb6.chunk.js +0 -2
- package/dist/embedded-app/static/1749.b4483b4e2bb6.chunk.js.map +0 -1
- package/dist/embedded-app/static/1767.6e4cbc9c9d27.chunk.js +0 -2
- package/dist/embedded-app/static/1767.6e4cbc9c9d27.chunk.js.map +0 -1
- package/dist/embedded-app/static/1994.38d3dd466d30.chunk.js +0 -2
- package/dist/embedded-app/static/1994.38d3dd466d30.chunk.js.map +0 -1
- package/dist/embedded-app/static/2295.dda08612a0e4.chunk.js +0 -5
- package/dist/embedded-app/static/2295.dda08612a0e4.chunk.js.map +0 -1
- package/dist/embedded-app/static/2339.4b6211cd2e17.chunk.js +0 -2
- package/dist/embedded-app/static/2339.4b6211cd2e17.chunk.js.map +0 -1
- package/dist/embedded-app/static/2360.e30d0a827f1b.chunk.js +0 -2
- package/dist/embedded-app/static/2360.e30d0a827f1b.chunk.js.map +0 -1
- package/dist/embedded-app/static/3031.3ad03b75f7d6.chunk.js +0 -2
- package/dist/embedded-app/static/3306.ebe1d57e1ee8.chunk.js +0 -2
- package/dist/embedded-app/static/3306.ebe1d57e1ee8.chunk.js.map +0 -1
- package/dist/embedded-app/static/4587.51c2cef24263.chunk.js +0 -2
- package/dist/embedded-app/static/4587.51c2cef24263.chunk.js.map +0 -1
- package/dist/embedded-app/static/4609.59cdb7eef90d.chunk.js +0 -531
- package/dist/embedded-app/static/4609.59cdb7eef90d.chunk.js.map +0 -1
- package/dist/embedded-app/static/4648.71cc1dd433d0.chunk.js +0 -2
- package/dist/embedded-app/static/4648.71cc1dd433d0.chunk.js.map +0 -1
- package/dist/embedded-app/static/5877.dcbb54defb88.chunk.js +0 -2
- package/dist/embedded-app/static/5877.dcbb54defb88.chunk.js.map +0 -1
- package/dist/embedded-app/static/6138.4babe9cc6492.chunk.js +0 -2
- package/dist/embedded-app/static/6138.4babe9cc6492.chunk.js.map +0 -1
- package/dist/embedded-app/static/6718.245b95228170.chunk.js +0 -22
- package/dist/embedded-app/static/6949.d6860e77e10c.chunk.js +0 -4
- package/dist/embedded-app/static/6949.d6860e77e10c.chunk.js.map +0 -1
- package/dist/embedded-app/static/698.6389c3faa0bb.chunk.js +0 -2
- package/dist/embedded-app/static/698.6389c3faa0bb.chunk.js.map +0 -1
- package/dist/embedded-app/static/7203.a37705ededb5.chunk.js +0 -2
- package/dist/embedded-app/static/7203.a37705ededb5.chunk.js.map +0 -1
- package/dist/embedded-app/static/7632.79234b81e968.chunk.js +0 -2
- package/dist/embedded-app/static/8877.cdb190e598d5.chunk.js +0 -2
- package/dist/embedded-app/static/9050.d056f544fb11.chunk.js +0 -2
- package/dist/embedded-app/static/9050.d056f544fb11.chunk.js.map +0 -1
- package/dist/embedded-app/static/9230.cf54b232ffd4.chunk.js +0 -2
- package/dist/embedded-app/static/9230.cf54b232ffd4.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.4513a8956ce8.js +0 -2
- package/dist/embedded-app/static/main.4513a8956ce8.js.map +0 -1
- package/dist/embedded-app/static/module-react-aria-components.ad458624f76c.js +0 -2
- package/dist/embedded-app/static/module-react-aria-components.ad458624f76c.js.map +0 -1
- package/dist/embedded-app/static/vendor.9c2d9a0c65bd.js +0 -2
- package/dist/embedded-app/static/vendor.9c2d9a0c65bd.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["8125"],{23127(e,t,r){var a=r(4293),l=r(78920);t.default=void 0;var s=l(r(14041));t.default=(0,a(r(74044)).default)(s.createElement("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"}),"Language")},26438(e,t,r){r.d(t,{wL:()=>x,aR:()=>f,Zp:()=>b,bw:()=>g});var a=r(31085),l=r(14041),s=r(57873),i=r(
|
|
1
|
+
"use strict";(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["8125"],{23127(e,t,r){var a=r(4293),l=r(78920);t.default=void 0;var s=l(r(14041));t.default=(0,a(r(74044)).default)(s.createElement("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"}),"Language")},26438(e,t,r){r.d(t,{wL:()=>x,aR:()=>f,Zp:()=>b,bw:()=>g});var a=r(31085),l=r(14041),s=r(57873),i=r(63878),n=r(48119);let o={"bui-Card":"vwbKbDh04mMaiBi3","bui-CardHeader":"XFUmGkj6WID_JnEz","bui-CardBody":"bDKBEHaUGVdvGxpS","bui-CardFooter":"htqU_uAkxL89C8of","bui-CardTrigger":"YH9iVtgxrw5b0cYJ","bui-card-body-shadow":"bJ7HlUi_25Q2Dxr7"},d=(0,n.p)()({styles:o,classNames:{root:"bui-Card",trigger:"bui-CardTrigger"},propDefs:{children:{},className:{},onPress:{},href:{},label:{},target:{},rel:{},download:{},style:{}},utilityProps:["grow","shrink","basis"]}),c=(0,n.p)()({styles:o,classNames:{root:"bui-CardHeader"},propDefs:{children:{},className:{}}}),m=(0,n.p)()({styles:o,classNames:{root:"bui-CardBody"},propDefs:{children:{},className:{}}}),u=(0,n.p)()({styles:o,classNames:{root:"bui-CardFooter"},propDefs:{children:{},className:{}}});var p=r(13408),h=r(12860);let b=(0,l.forwardRef)((e,t)=>{let{ownProps:r,restProps:n,dataAttributes:o,utilityStyle:c}=(0,i.Z)(d,e),{classes:m,children:u,onPress:b,href:f,label:g,target:x,rel:y,download:v}=r,j=!!(b||f),N=(0,l.useRef)(null),k=(0,l.useCallback)(e=>{if(!j||!N.current||N.current.contains(e.target))return;let t=e.target,r=t instanceof Element?t:t?.parentElement;r?.closest('a[href],button,input,select,textarea,[role="button"],[role="link"],[tabindex]:not([tabindex="-1"])')||window.getSelection()?.toString()||N.current.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,altKey:e.altKey}))},[j]);return(0,a.jsxs)(p.a,{as:"article",bg:"neutral",ref:t,className:m.root,"data-interactive":j||void 0,...o,...n,onClick:j?k:void 0,style:{...c,...r.style},children:[f&&(0,a.jsx)(h.N,{ref:N,className:m.trigger,href:f,target:x,rel:y,download:v,"aria-label":g}),b&&!f&&(0,a.jsx)(s.$,{ref:N,className:m.trigger,onPress:b,"aria-label":g}),u]})});b.displayName="Card";let f=(0,l.forwardRef)((e,t)=>{let{ownProps:r,restProps:l}=(0,i.Z)(c,e),{classes:s,children:n}=r;return(0,a.jsx)("div",{ref:t,className:s.root,...l,children:n})});f.displayName="CardHeader";let g=(0,l.forwardRef)((e,t)=>{let{ownProps:r,restProps:l}=(0,i.Z)(m,e),{classes:s,children:n}=r;return(0,a.jsx)("div",{ref:t,className:s.root,...l,children:n})});g.displayName="CardBody";let x=(0,l.forwardRef)((e,t)=>{let{ownProps:r,restProps:l}=(0,i.Z)(u,e),{classes:s,children:n}=r;return(0,a.jsx)("div",{ref:t,className:s.root,...l,children:n})});x.displayName="CardFooter"},32386(e,t,r){r.d(t,{x:()=>c});var a=r(31085),l=r(14041),s=r(63878),i=r(48119);let n={"bui-Grid":"lOUUwZ1G_vYgdngG"},o=(0,i.p)()({styles:n,classNames:{root:"bui-Grid"},bg:"provider",propDefs:{bg:{dataAttribute:!0},children:{},className:{},style:{}},utilityProps:["columns","gap","m","mb","ml","mr","mt","mx","my","p","pb","pl","pr","pt","px","py","grow","shrink","basis"]}),d=(0,i.p)()({styles:n,classNames:{root:"bui-GridItem"},bg:"provider",propDefs:{bg:{dataAttribute:!0},children:{},className:{},style:{}},utilityProps:["colSpan","colEnd","colStart","rowSpan"]}),c={Root:(0,l.forwardRef)((e,t)=>{let{ownProps:r,dataAttributes:l,utilityStyle:i,restProps:n}=(0,s.Z)(o,{columns:"auto",gap:"4",...e}),{classes:d,childrenWithBgProvider:c}=r;return(0,a.jsx)("div",{ref:t,className:d.root,style:{...i,...r.style},...l,...n,children:c})}),Item:(0,l.forwardRef)((e,t)=>{let{ownProps:r,dataAttributes:l,utilityStyle:i,restProps:n}=(0,s.Z)(d,e),{classes:o,childrenWithBgProvider:c}=r;return(0,a.jsx)("div",{ref:t,className:o.root,style:{...i,...r.style},...l,...n,children:c})})}},25390(e,t,r){r.d(t,{o:()=>m});var a=r(31085),l=r(26438),s=r(73880),i=r(69749),n=r(58837),o=r(53373),d=r.n(o);let c=(0,n.A)({root:{height:"100%"},title:{minWidth:0,overflow:"hidden"},footer:{display:"flex",justifyContent:"flex-end"}});function m(e){let{title:t,headerActions:r,footerActions:n,children:o,className:m}=e,u=c();return(0,a.jsxs)(l.Zp,{className:d()(u.root,m),children:[t&&(0,a.jsx)(l.aR,{children:(0,a.jsxs)(s.s,{justify:"between",align:"center",children:[(0,a.jsx)(i.E,{as:"h3",variant:"title-x-small",weight:"bold",className:u.title,children:t}),r&&(0,a.jsx)(s.s,{align:"center",gap:"1",children:r})]})}),(0,a.jsx)(l.bw,{children:o}),n&&(0,a.jsx)(l.wL,{className:u.footer,children:n})]})}},75836(e,t,r){r.d(t,{m:()=>h});var a=r(31085),l=r(32386),s=r(77125),i=r(72501),n=r(58837),o=r(23127),d=r(60603);let c=(0,n.A)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function m(e){let{href:t,text:r,Icon:l}=e,n=c();return(0,a.jsxs)(s.A,{display:"flex",children:[(0,a.jsx)(s.A,{mr:1,className:n.svgIcon,children:(0,a.jsx)(i.A,{component:"div",children:l?(0,a.jsx)(l,{}):(0,a.jsx)(o.default,{})})}),(0,a.jsx)(s.A,{flexGrow:"1",children:(0,a.jsx)(d.N_,{to:t,target:"_blank",rel:"noopener",children:r||t})})]})}var u=r(5893);let p={xs:1,sm:1,md:1,lg:2,xl:3};function h(e){let{items:t,cols:r}=e,s=function(e){let t=[(0,u.A)(e=>e.breakpoints.up("xl"))?"xl":null,(0,u.A)(e=>e.breakpoints.up("lg"))?"lg":null,(0,u.A)(e=>e.breakpoints.up("md"))?"md":null,(0,u.A)(e=>e.breakpoints.up("sm"))?"sm":null,(0,u.A)(e=>e.breakpoints.up("xs"))?"xs":null],r=1;if("number"==typeof e)r=e;else{let a=t.find(e=>null!==e)??"xs";r=e?.[a]??p[a]}return r}(r);return(0,a.jsx)(l.x.Root,{columns:String(Math.min(Math.max(s,1),12)),gap:"2",children:t.map(({text:e,href:t,Icon:r},l)=>(0,a.jsx)(m,{href:t,text:e??t,Icon:r},l))})}},27516(e,t,r){r.d(t,{EntityLinksCard:()=>x});var a=r(31085),l=r(22845),s=r(25390),i=r(23127),n=r(64947),o=r(72501),d=r(58837),c=r(4809),m=r(89595),u=r(50010);let p=`metadata:
|
|
2
2
|
name: example
|
|
3
3
|
links:
|
|
4
4
|
- url: https://dashboard.example.com
|
|
5
5
|
title: My Dashboard
|
|
6
6
|
icon: dashboard`,h=(0,d.A)(e=>({code:{borderRadius:6,margin:e.spacing(2,0),background:"dark"===e.palette.type?"#444":e.palette.common.white}}),{name:"PluginCatalogEntityLinksEmptyState"});function b(){let e=h(),{t}=(0,m.i)(u.W);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.A,{variant:"body1",children:t("entityLinksCard.emptyDescription")}),(0,a.jsx)("div",{className:e.code,children:(0,a.jsx)(c.z,{text:p,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,a.jsx)(n.A,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#links-optional",children:t("entityLinksCard.readMoreButtonTitle")})]})}var f=r(75836),g=r(91189);let x=e=>{let{cols:t}=e,{entity:r}=(0,l.tN)(),n=(0,g.n)(),{t:o}=(0,m.i)(u.W),d=r?.metadata?.links;return(0,a.jsx)(s.o,{title:o("entityLinksCard.title"),children:d&&0!==d.length?(0,a.jsx)(f.m,{cols:t,items:d.map(({url:e,title:t,icon:r})=>({text:t??e,href:e,Icon:r?n.getSystemIcon(r)??i.default:i.default}))}):(0,a.jsx)(b,{})})}}}]);
|
|
7
|
-
//# sourceMappingURL=8125.
|
|
7
|
+
//# sourceMappingURL=8125.d349a79d61b4.chunk.js.map
|
package/dist/embedded-app/static/{8125.84952fcec739.chunk.js.map → 8125.d349a79d61b4.chunk.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static/8125.84952fcec739.chunk.js","sources":["webpack://techdocs-cli-embedded-app/../../node_modules/@material-ui/icons/Language.js","webpack://techdocs-cli-embedded-app/../ui/src/components/Card/Card.module.css?7524","webpack://techdocs-cli-embedded-app/../ui/src/components/Card/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Card/Card.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Grid/Grid.module.css?1013","webpack://techdocs-cli-embedded-app/../ui/src/components/Grid/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Grid/Grid.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityInfoCard/EntityInfoCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/IconLink.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/useDynamicColumns.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/LinksGridList.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/EntityLinksEmptyState.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/EntityLinksCard.tsx"],"sourcesContent":["\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar React = _interopRequireWildcard(require(\"react\"));\n\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\n\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z\"\n}), 'Language');\n\nexports.default = _default;","// extracted by css-extract-rspack-plugin\nexport default {\"bui-Card\":\"vwbKbDh04mMaiBi3\",\"bui-CardHeader\":\"XFUmGkj6WID_JnEz\",\"bui-CardBody\":\"bDKBEHaUGVdvGxpS\",\"bui-CardFooter\":\"htqU_uAkxL89C8of\",\"bui-CardTrigger\":\"YH9iVtgxrw5b0cYJ\",\"bui-card-body-shadow\":\"bJ7HlUi_25Q2Dxr7\"};","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type {\n CardOwnProps,\n CardHeaderOwnProps,\n CardBodyOwnProps,\n CardFooterOwnProps,\n} from './types';\nimport styles from './Card.module.css';\n\n/**\n * Component definition for Card\n * @public\n */\nexport const CardDefinition = defineComponent<CardOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Card',\n trigger: 'bui-CardTrigger',\n },\n propDefs: {\n children: {},\n className: {},\n onPress: {},\n href: {},\n label: {},\n target: {},\n rel: {},\n download: {},\n style: {},\n },\n utilityProps: ['grow', 'shrink', 'basis'],\n});\n\n/**\n * Component definition for CardHeader\n * @public\n */\nexport const CardHeaderDefinition = defineComponent<CardHeaderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-CardHeader',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for CardBody\n * @public\n */\nexport const CardBodyDefinition = defineComponent<CardBodyOwnProps>()({\n styles,\n classNames: {\n root: 'bui-CardBody',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for CardFooter\n * @public\n */\nexport const CardFooterDefinition = defineComponent<CardFooterOwnProps>()({\n styles,\n classNames: {\n root: 'bui-CardFooter',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useCallback, useRef } from 'react';\nimport { Button as RAButton } from 'react-aria-components';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport {\n CardDefinition,\n CardHeaderDefinition,\n CardBodyDefinition,\n CardFooterDefinition,\n} from './definition';\nimport type {\n CardProps,\n CardHeaderProps,\n CardBodyProps,\n CardFooterProps,\n} from './types';\nimport { Box } from '../Box/Box';\nimport { Link } from '../Link';\n\nconst INTERACTIVE_ELEMENT_SELECTOR =\n 'a[href],button,input,select,textarea,[role=\"button\"],[role=\"link\"],[tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * Card component.\n *\n * @public\n */\nexport const Card = forwardRef<HTMLDivElement, CardProps>((props, ref) => {\n const { ownProps, restProps, dataAttributes, utilityStyle } = useDefinition(\n CardDefinition,\n props,\n );\n const {\n classes,\n children,\n onPress,\n href,\n label,\n target: linkTarget,\n rel,\n download,\n } = ownProps;\n const isInteractive = !!(onPress || href);\n\n const triggerRef = useRef<HTMLAnchorElement | HTMLButtonElement>(null);\n\n const handleClick = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (!isInteractive || !triggerRef.current) return;\n\n // Don't delegate if the click target is the trigger itself\n if (triggerRef.current.contains(e.target as Node)) return;\n\n // Don't delegate if the user clicked a nested interactive element\n const targetNode = e.target as Node | null;\n const targetElement =\n targetNode instanceof Element ? targetNode : targetNode?.parentElement;\n if (targetElement?.closest(INTERACTIVE_ELEMENT_SELECTOR)) return;\n\n // Don't delegate if the user is selecting text\n if (window.getSelection()?.toString()) return;\n\n triggerRef.current.dispatchEvent(\n new MouseEvent('click', {\n bubbles: true,\n cancelable: true,\n ctrlKey: e.ctrlKey,\n metaKey: e.metaKey,\n shiftKey: e.shiftKey,\n altKey: e.altKey,\n }),\n );\n },\n [isInteractive],\n );\n\n return (\n <Box\n as=\"article\"\n bg=\"neutral\"\n ref={ref}\n className={classes.root}\n data-interactive={isInteractive || undefined}\n {...dataAttributes}\n {...restProps}\n onClick={isInteractive ? handleClick : undefined}\n style={{ ...utilityStyle, ...ownProps.style }}\n >\n {href && (\n <Link\n ref={triggerRef as React.Ref<HTMLAnchorElement>}\n className={classes.trigger}\n href={href}\n target={linkTarget}\n rel={rel}\n download={download}\n aria-label={label}\n />\n )}\n {onPress && !href && (\n <RAButton\n ref={triggerRef as React.Ref<HTMLButtonElement>}\n className={classes.trigger}\n onPress={onPress}\n aria-label={label}\n />\n )}\n {children}\n </Box>\n );\n});\n\nCard.displayName = 'Card';\n\n/**\n * CardHeader component.\n *\n * @public\n */\nexport const CardHeader = forwardRef<HTMLDivElement, CardHeaderProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(CardHeaderDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div ref={ref} className={classes.root} {...restProps}>\n {children}\n </div>\n );\n },\n);\n\nCardHeader.displayName = 'CardHeader';\n\n/**\n * CardBody component.\n *\n * @public\n */\nexport const CardBody = forwardRef<HTMLDivElement, CardBodyProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(CardBodyDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div ref={ref} className={classes.root} {...restProps}>\n {children}\n </div>\n );\n },\n);\n\nCardBody.displayName = 'CardBody';\n\n/**\n * CardFooter component.\n *\n * @public\n */\nexport const CardFooter = forwardRef<HTMLDivElement, CardFooterProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(CardFooterDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div ref={ref} className={classes.root} {...restProps}>\n {children}\n </div>\n );\n },\n);\n\nCardFooter.displayName = 'CardFooter';\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-Grid\":\"lOUUwZ1G_vYgdngG\"};","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { GridOwnProps, GridItemOwnProps } from './types';\nimport styles from './Grid.module.css';\n\n/**\n * Component definition for Grid\n * @public\n */\nexport const GridDefinition = defineComponent<GridOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Grid',\n },\n bg: 'provider',\n propDefs: {\n bg: { dataAttribute: true },\n children: {},\n className: {},\n style: {},\n },\n utilityProps: [\n 'columns',\n 'gap',\n 'm',\n 'mb',\n 'ml',\n 'mr',\n 'mt',\n 'mx',\n 'my',\n 'p',\n 'pb',\n 'pl',\n 'pr',\n 'pt',\n 'px',\n 'py',\n 'grow',\n 'shrink',\n 'basis',\n ],\n});\n\n/**\n * Component definition for GridItem\n * @public\n */\nexport const GridItemDefinition = defineComponent<GridItemOwnProps>()({\n styles,\n classNames: {\n root: 'bui-GridItem',\n },\n bg: 'provider',\n propDefs: {\n bg: { dataAttribute: true },\n children: {},\n className: {},\n style: {},\n },\n utilityProps: ['colSpan', 'colEnd', 'colStart', 'rowSpan'],\n});\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport type { GridItemProps, GridProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { GridDefinition, GridItemDefinition } from './definition';\n\nconst GridRoot = forwardRef<HTMLDivElement, GridProps>((props, ref) => {\n const { ownProps, dataAttributes, utilityStyle, restProps } = useDefinition(\n GridDefinition,\n { columns: 'auto', gap: '4', ...props },\n );\n const { classes, childrenWithBgProvider } = ownProps;\n\n return (\n <div\n ref={ref}\n className={classes.root}\n style={{ ...utilityStyle, ...ownProps.style }}\n {...dataAttributes}\n {...restProps}\n >\n {childrenWithBgProvider}\n </div>\n );\n});\n\nconst GridItem = forwardRef<HTMLDivElement, GridItemProps>((props, ref) => {\n const { ownProps, dataAttributes, utilityStyle, restProps } = useDefinition(\n GridItemDefinition,\n props,\n );\n const { classes, childrenWithBgProvider } = ownProps;\n\n return (\n <div\n ref={ref}\n className={classes.root}\n style={{ ...utilityStyle, ...ownProps.style }}\n {...dataAttributes}\n {...restProps}\n >\n {childrenWithBgProvider}\n </div>\n );\n});\n\n/** @public */\nexport const Grid = {\n Root: GridRoot,\n Item: GridItem,\n};\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ReactNode } from 'react';\nimport {\n Card,\n CardHeader,\n CardBody,\n CardFooter,\n Text,\n Flex,\n} from '@backstage/ui';\nimport { makeStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\n\nconst useStyles = makeStyles({\n root: {\n height: '100%',\n },\n title: {\n minWidth: 0,\n overflow: 'hidden',\n },\n footer: {\n display: 'flex',\n justifyContent: 'flex-end',\n },\n});\n\n/** @public */\nexport interface EntityInfoCardProps {\n title?: ReactNode;\n headerActions?: ReactNode;\n footerActions?: ReactNode;\n children?: ReactNode;\n className?: string;\n}\n\n/** @public */\nexport function EntityInfoCard(props: EntityInfoCardProps) {\n const { title, headerActions, footerActions, children, className } = props;\n const classes = useStyles();\n\n return (\n <Card className={classNames(classes.root, className)}>\n {title && (\n <CardHeader>\n <Flex justify=\"between\" align=\"center\">\n <Text\n as=\"h3\"\n variant=\"title-x-small\"\n weight=\"bold\"\n className={classes.title}\n >\n {title}\n </Text>\n {headerActions && (\n <Flex align=\"center\" gap=\"1\">\n {headerActions}\n </Flex>\n )}\n </Flex>\n </CardHeader>\n )}\n <CardBody>{children}</CardBody>\n {footerActions && (\n <CardFooter className={classes.footer}>{footerActions}</CardFooter>\n )}\n </Card>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Box from '@material-ui/core/Box';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport { Link } from '@backstage/core-components';\nimport { IconComponent } from '@backstage/core-plugin-api';\n\nconst useStyles = makeStyles({\n svgIcon: {\n display: 'inline-block',\n '& svg': {\n display: 'inline-block',\n fontSize: 'inherit',\n verticalAlign: 'baseline',\n },\n },\n});\n\nexport function IconLink(props: {\n href: string;\n text?: string;\n Icon?: IconComponent;\n}) {\n const { href, text, Icon } = props;\n const classes = useStyles();\n\n return (\n <Box display=\"flex\">\n <Box mr={1} className={classes.svgIcon}>\n <Typography component=\"div\">\n {Icon ? <Icon /> : <LanguageIcon />}\n </Typography>\n </Box>\n <Box flexGrow=\"1\">\n <Link to={href} target=\"_blank\" rel=\"noopener\">\n {text || href}\n </Link>\n </Box>\n </Box>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\nimport { Theme } from '@material-ui/core/styles';\nimport { Breakpoint, ColumnBreakpoints } from './types';\n\nconst colDefaults: ColumnBreakpoints = {\n xs: 1,\n sm: 1,\n md: 1,\n lg: 2,\n xl: 3,\n};\n\nexport function useDynamicColumns(\n cols: ColumnBreakpoints | number | undefined,\n): number {\n const matches: (Breakpoint | null)[] = [\n useMediaQuery((theme: Theme) => theme.breakpoints.up('xl')) ? 'xl' : null,\n useMediaQuery((theme: Theme) => theme.breakpoints.up('lg')) ? 'lg' : null,\n useMediaQuery((theme: Theme) => theme.breakpoints.up('md')) ? 'md' : null,\n useMediaQuery((theme: Theme) => theme.breakpoints.up('sm')) ? 'sm' : null,\n useMediaQuery((theme: Theme) => theme.breakpoints.up('xs')) ? 'xs' : null,\n ];\n\n let numOfCols = 1;\n\n if (typeof cols === 'number') {\n numOfCols = cols;\n } else {\n const breakpoint = matches.find(k => k !== null) ?? 'xs';\n numOfCols = cols?.[breakpoint] ?? colDefaults[breakpoint];\n }\n\n return numOfCols;\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Grid, type Columns } from '@backstage/ui';\nimport { IconLink } from './IconLink';\nimport { ColumnBreakpoints } from './types';\nimport { useDynamicColumns } from './useDynamicColumns';\nimport { IconComponent } from '@backstage/core-plugin-api';\n\nexport interface LinksGridListItem {\n href: string;\n text?: string;\n Icon?: IconComponent;\n}\n\ninterface LinksGridListProps {\n items: LinksGridListItem[];\n cols?: ColumnBreakpoints | number;\n}\n\nexport function LinksGridList(props: LinksGridListProps) {\n const { items, cols = undefined } = props;\n const numOfCols = useDynamicColumns(cols);\n\n return (\n <Grid.Root\n columns={String(Math.min(Math.max(numOfCols, 1), 12)) as Columns}\n gap=\"2\"\n >\n {items.map(({ text, href, Icon }, i) => (\n <IconLink key={i} href={href} text={text ?? href} Icon={Icon} />\n ))}\n </Grid.Root>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Button from '@material-ui/core/Button';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { CodeSnippet } from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { catalogTranslationRef } from '../../alpha/translation';\n\nconst ENTITY_YAML = `metadata:\n name: example\n links:\n - url: https://dashboard.example.com\n title: My Dashboard\n icon: dashboard`;\n\n/** @public */\nexport type EntityLinksEmptyStateClassKey = 'code';\n\nconst useStyles = makeStyles(\n theme => ({\n code: {\n borderRadius: 6,\n margin: theme.spacing(2, 0),\n background:\n theme.palette.type === 'dark' ? '#444' : theme.palette.common.white,\n },\n }),\n { name: 'PluginCatalogEntityLinksEmptyState' },\n);\n\nexport function EntityLinksEmptyState() {\n const classes = useStyles();\n const { t } = useTranslationRef(catalogTranslationRef);\n\n return (\n <>\n <Typography variant=\"body1\">\n {t('entityLinksCard.emptyDescription')}\n </Typography>\n <div className={classes.code}>\n <CodeSnippet\n text={ENTITY_YAML}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={[3, 4, 5, 6]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n </div>\n <Button\n variant=\"contained\"\n color=\"primary\"\n target=\"_blank\"\n href=\"https://backstage.io/docs/features/software-catalog/descriptor-format#links-optional\"\n >\n {t('entityLinksCard.readMoreButtonTitle')}\n </Button>\n </>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEntity, EntityInfoCard } from '@backstage/plugin-catalog-react';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport { EntityLinksEmptyState } from './EntityLinksEmptyState';\nimport { LinksGridList } from './LinksGridList';\nimport { ColumnBreakpoints } from './types';\nimport { IconComponent, useApp } from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { catalogTranslationRef } from '../../alpha/translation';\n\n/** @public */\nexport interface EntityLinksCardProps {\n cols?: ColumnBreakpoints | number;\n}\n\nexport const EntityLinksCard = (props: EntityLinksCardProps) => {\n const { cols = undefined } = props;\n const { entity } = useEntity();\n const app = useApp();\n const { t } = useTranslationRef(catalogTranslationRef);\n\n const iconResolver = (key?: string): IconComponent =>\n key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon;\n\n const links = entity?.metadata?.links;\n\n return (\n <EntityInfoCard title={t('entityLinksCard.title')}>\n {!links || links.length === 0 ? (\n <EntityLinksEmptyState />\n ) : (\n <LinksGridList\n cols={cols}\n items={links.map(({ url, title, icon }) => ({\n text: title ?? url,\n href: url,\n Icon: iconResolver(icon),\n }))}\n />\n )}\n </EntityInfoCard>\n );\n};\n"],"names":["r","CardDefinition","defineComponent","styles","CardHeaderDefinition","CardBodyDefinition","CardFooterDefinition","Card","forwardRef","props","ref","ownProps","restProps","dataAttributes","utilityStyle","useDefinition","classes","children","onPress","href","label","linkTarget","rel","download","isInteractive","triggerRef","useRef","handleClick","useCallback","e","targetNode","targetElement","Element","window","MouseEvent","Box","undefined","Link","RAButton","CardHeader","CardBody","CardFooter","GridDefinition","GridItemDefinition","Grid","childrenWithBgProvider","useStyles","makeStyles","EntityInfoCard","title","headerActions","footerActions","className","classNames","Flex","Text","IconLink","text","Icon","Typography","LanguageIcon","colDefaults","LinksGridList","items","cols","numOfCols","useDynamicColumns","matches","useMediaQuery","theme","breakpoint","k","String","Math","i","ENTITY_YAML","EntityLinksEmptyState","t","useTranslationRef","catalogTranslationRef","CodeSnippet","Button","EntityLinksCard","entity","useEntity","app","useApp","links","url","icon","key"],"mappings":"sIAEA,IAAI,EAAyBA,EAAQ,MAEjC,EAA0BA,EAAQ,MAKtC,UAAe,CAAG,KAAK,EAEvB,IAAI,EAAQ,EAAwBA,EAAQ,OAQ5C,UAAe,CAJA,AAAC,GAAG,AAFE,EAAuBA,EAAQ,QAElB,OAAO,AAAD,EAAiB,EAAM,aAAa,CAAC,OAAQ,CACnF,EAAG,2yBACL,GAAI,W,uHChBJ,MAAe,CAAC,WAAW,mBAAmB,iBAAiB,mBAAmB,eAAe,mBAAmB,iBAAiB,mBAAmB,kBAAkB,mBAAmB,uBAAuB,kBAAkB,EC4BzNC,EAAiBC,AAAAA,GAAAA,EAAAA,CAAAA,AAAAA,IAAgC,CAC5DC,OAAMA,EACN,WAAY,CACV,KAAM,WACN,QAAS,iBACX,EACA,SAAU,CACR,SAAU,CAAC,EACX,UAAW,CAAC,EACZ,QAAS,CAAC,EACV,KAAM,CAAC,EACP,MAAO,CAAC,EACR,OAAQ,CAAC,EACT,IAAK,CAAC,EACN,SAAU,CAAC,EACX,MAAO,CAAC,CACV,EACA,aAAc,CAAC,OAAQ,SAAU,QAAQ,AAC3C,GAMaC,EAAuBF,AAAAA,GAAAA,EAAAA,CAAAA,AAAAA,IAAsC,CACxEC,OAAMA,EACN,WAAY,CACV,KAAM,gBACR,EACA,SAAU,CACR,SAAU,CAAC,EACX,UAAW,CAAC,CACd,CACF,GAMaE,EAAqBH,AAAAA,GAAAA,EAAAA,CAAAA,AAAAA,IAAoC,CACpEC,OAAMA,EACN,WAAY,CACV,KAAM,c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AA,CAAAA,AAAAA,EAAkBC,EAAAA,CAAqBA,EAK/CQ,EAAQJ,GAAQ,UAAU,MAEhC,MACE,UAACnC,EAAAA,CAAcA,CAAAA,CAAC,MAAO6B,EAAE,yB,SACtB,AAACU,GAASA,AAAiB,IAAjBA,EAAM,MAAM,CAGrB,UAACzB,EAAAA,CAAaA,CAAAA,CACZ,KAAME,EACN,MAAOuB,EAAM,GAAG,CAAC,CAAC,CAAEC,IAAAA,CAAG,CAAEvC,MAAAA,CAAK,CAAEwC,KAAAA,CAAI,CAAE,GAAM,EAC1C,KAAMxC,GAASuC,EACf,KAAMA,EACN,KAdRE,AAc2BD,EAdrBJ,EAAI,aAAa,CAcII,IAdK7B,EAAAA,OAAYA,CAAGA,EAAAA,OAAYA,AAerD,G,GARF,UAACgB,EAAqBA,CAAAA,E,EAa9B,C"}
|
|
1
|
+
{"version":3,"file":"static/8125.d349a79d61b4.chunk.js","sources":["webpack://techdocs-cli-embedded-app/../../node_modules/@material-ui/icons/Language.js","webpack://techdocs-cli-embedded-app/../ui/src/components/Card/Card.module.css?7524","webpack://techdocs-cli-embedded-app/../ui/src/components/Card/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Card/Card.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Grid/Grid.module.css?1013","webpack://techdocs-cli-embedded-app/../ui/src/components/Grid/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Grid/Grid.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityInfoCard/EntityInfoCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/IconLink.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/useDynamicColumns.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/LinksGridList.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/EntityLinksEmptyState.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/EntityLinksCard.tsx"],"sourcesContent":["\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar React = _interopRequireWildcard(require(\"react\"));\n\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\n\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z\"\n}), 'Language');\n\nexports.default = _default;","// extracted by css-extract-rspack-plugin\nexport default {\"bui-Card\":\"vwbKbDh04mMaiBi3\",\"bui-CardHeader\":\"XFUmGkj6WID_JnEz\",\"bui-CardBody\":\"bDKBEHaUGVdvGxpS\",\"bui-CardFooter\":\"htqU_uAkxL89C8of\",\"bui-CardTrigger\":\"YH9iVtgxrw5b0cYJ\",\"bui-card-body-shadow\":\"bJ7HlUi_25Q2Dxr7\"};","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type {\n CardOwnProps,\n CardHeaderOwnProps,\n CardBodyOwnProps,\n CardFooterOwnProps,\n} from './types';\nimport styles from './Card.module.css';\n\n/**\n * Component definition for Card\n * @public\n */\nexport const CardDefinition = defineComponent<CardOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Card',\n trigger: 'bui-CardTrigger',\n },\n propDefs: {\n children: {},\n className: {},\n onPress: {},\n href: {},\n label: {},\n target: {},\n rel: {},\n download: {},\n style: {},\n },\n utilityProps: ['grow', 'shrink', 'basis'],\n});\n\n/**\n * Component definition for CardHeader\n * @public\n */\nexport const CardHeaderDefinition = defineComponent<CardHeaderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-CardHeader',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for CardBody\n * @public\n */\nexport const CardBodyDefinition = defineComponent<CardBodyOwnProps>()({\n styles,\n classNames: {\n root: 'bui-CardBody',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for CardFooter\n * @public\n */\nexport const CardFooterDefinition = defineComponent<CardFooterOwnProps>()({\n styles,\n classNames: {\n root: 'bui-CardFooter',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useCallback, useRef } from 'react';\nimport { Button as RAButton } from 'react-aria-components';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport {\n CardDefinition,\n CardHeaderDefinition,\n CardBodyDefinition,\n CardFooterDefinition,\n} from './definition';\nimport type {\n CardProps,\n CardHeaderProps,\n CardBodyProps,\n CardFooterProps,\n} from './types';\nimport { Box } from '../Box/Box';\nimport { Link } from '../Link';\n\nconst INTERACTIVE_ELEMENT_SELECTOR =\n 'a[href],button,input,select,textarea,[role=\"button\"],[role=\"link\"],[tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * Card component.\n *\n * @public\n */\nexport const Card = forwardRef<HTMLDivElement, CardProps>((props, ref) => {\n const { ownProps, restProps, dataAttributes, utilityStyle } = useDefinition(\n CardDefinition,\n props,\n );\n const {\n classes,\n children,\n onPress,\n href,\n label,\n target: linkTarget,\n rel,\n download,\n } = ownProps;\n const isInteractive = !!(onPress || href);\n\n const triggerRef = useRef<HTMLAnchorElement | HTMLButtonElement>(null);\n\n const handleClick = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (!isInteractive || !triggerRef.current) return;\n\n // Don't delegate if the click target is the trigger itself\n if (triggerRef.current.contains(e.target as Node)) return;\n\n // Don't delegate if the user clicked a nested interactive element\n const targetNode = e.target as Node | null;\n const targetElement =\n targetNode instanceof Element ? targetNode : targetNode?.parentElement;\n if (targetElement?.closest(INTERACTIVE_ELEMENT_SELECTOR)) return;\n\n // Don't delegate if the user is selecting text\n if (window.getSelection()?.toString()) return;\n\n triggerRef.current.dispatchEvent(\n new MouseEvent('click', {\n bubbles: true,\n cancelable: true,\n ctrlKey: e.ctrlKey,\n metaKey: e.metaKey,\n shiftKey: e.shiftKey,\n altKey: e.altKey,\n }),\n );\n },\n [isInteractive],\n );\n\n return (\n <Box\n as=\"article\"\n bg=\"neutral\"\n ref={ref}\n className={classes.root}\n data-interactive={isInteractive || undefined}\n {...dataAttributes}\n {...restProps}\n onClick={isInteractive ? handleClick : undefined}\n style={{ ...utilityStyle, ...ownProps.style }}\n >\n {href && (\n <Link\n ref={triggerRef as React.Ref<HTMLAnchorElement>}\n className={classes.trigger}\n href={href}\n target={linkTarget}\n rel={rel}\n download={download}\n aria-label={label}\n />\n )}\n {onPress && !href && (\n <RAButton\n ref={triggerRef as React.Ref<HTMLButtonElement>}\n className={classes.trigger}\n onPress={onPress}\n aria-label={label}\n />\n )}\n {children}\n </Box>\n );\n});\n\nCard.displayName = 'Card';\n\n/**\n * CardHeader component.\n *\n * @public\n */\nexport const CardHeader = forwardRef<HTMLDivElement, CardHeaderProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(CardHeaderDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div ref={ref} className={classes.root} {...restProps}>\n {children}\n </div>\n );\n },\n);\n\nCardHeader.displayName = 'CardHeader';\n\n/**\n * CardBody component.\n *\n * @public\n */\nexport const CardBody = forwardRef<HTMLDivElement, CardBodyProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(CardBodyDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div ref={ref} className={classes.root} {...restProps}>\n {children}\n </div>\n );\n },\n);\n\nCardBody.displayName = 'CardBody';\n\n/**\n * CardFooter component.\n *\n * @public\n */\nexport const CardFooter = forwardRef<HTMLDivElement, CardFooterProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(CardFooterDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div ref={ref} className={classes.root} {...restProps}>\n {children}\n </div>\n );\n },\n);\n\nCardFooter.displayName = 'CardFooter';\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-Grid\":\"lOUUwZ1G_vYgdngG\"};","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { GridOwnProps, GridItemOwnProps } from './types';\nimport styles from './Grid.module.css';\n\n/**\n * Component definition for Grid\n * @public\n */\nexport const GridDefinition = defineComponent<GridOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Grid',\n },\n bg: 'provider',\n propDefs: {\n bg: { dataAttribute: true },\n children: {},\n className: {},\n style: {},\n },\n utilityProps: [\n 'columns',\n 'gap',\n 'm',\n 'mb',\n 'ml',\n 'mr',\n 'mt',\n 'mx',\n 'my',\n 'p',\n 'pb',\n 'pl',\n 'pr',\n 'pt',\n 'px',\n 'py',\n 'grow',\n 'shrink',\n 'basis',\n ],\n});\n\n/**\n * Component definition for GridItem\n * @public\n */\nexport const GridItemDefinition = defineComponent<GridItemOwnProps>()({\n styles,\n classNames: {\n root: 'bui-GridItem',\n },\n bg: 'provider',\n propDefs: {\n bg: { dataAttribute: true },\n children: {},\n className: {},\n style: {},\n },\n utilityProps: ['colSpan', 'colEnd', 'colStart', 'rowSpan'],\n});\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport type { GridItemProps, GridProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { GridDefinition, GridItemDefinition } from './definition';\n\nconst GridRoot = forwardRef<HTMLDivElement, GridProps>((props, ref) => {\n const { ownProps, dataAttributes, utilityStyle, restProps } = useDefinition(\n GridDefinition,\n { columns: 'auto', gap: '4', ...props },\n );\n const { classes, childrenWithBgProvider } = ownProps;\n\n return (\n <div\n ref={ref}\n className={classes.root}\n style={{ ...utilityStyle, ...ownProps.style }}\n {...dataAttributes}\n {...restProps}\n >\n {childrenWithBgProvider}\n </div>\n );\n});\n\nconst GridItem = forwardRef<HTMLDivElement, GridItemProps>((props, ref) => {\n const { ownProps, dataAttributes, utilityStyle, restProps } = useDefinition(\n GridItemDefinition,\n props,\n );\n const { classes, childrenWithBgProvider } = ownProps;\n\n return (\n <div\n ref={ref}\n className={classes.root}\n style={{ ...utilityStyle, ...ownProps.style }}\n {...dataAttributes}\n {...restProps}\n >\n {childrenWithBgProvider}\n </div>\n );\n});\n\n/** @public */\nexport const Grid = {\n Root: GridRoot,\n Item: GridItem,\n};\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ReactNode } from 'react';\nimport {\n Card,\n CardHeader,\n CardBody,\n CardFooter,\n Text,\n Flex,\n} from '@backstage/ui';\nimport { makeStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\n\nconst useStyles = makeStyles({\n root: {\n height: '100%',\n },\n title: {\n minWidth: 0,\n overflow: 'hidden',\n },\n footer: {\n display: 'flex',\n justifyContent: 'flex-end',\n },\n});\n\n/** @public */\nexport interface EntityInfoCardProps {\n title?: ReactNode;\n headerActions?: ReactNode;\n footerActions?: ReactNode;\n children?: ReactNode;\n className?: string;\n}\n\n/** @public */\nexport function EntityInfoCard(props: EntityInfoCardProps) {\n const { title, headerActions, footerActions, children, className } = props;\n const classes = useStyles();\n\n return (\n <Card className={classNames(classes.root, className)}>\n {title && (\n <CardHeader>\n <Flex justify=\"between\" align=\"center\">\n <Text\n as=\"h3\"\n variant=\"title-x-small\"\n weight=\"bold\"\n className={classes.title}\n >\n {title}\n </Text>\n {headerActions && (\n <Flex align=\"center\" gap=\"1\">\n {headerActions}\n </Flex>\n )}\n </Flex>\n </CardHeader>\n )}\n <CardBody>{children}</CardBody>\n {footerActions && (\n <CardFooter className={classes.footer}>{footerActions}</CardFooter>\n )}\n </Card>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Box from '@material-ui/core/Box';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport { Link } from '@backstage/core-components';\nimport { IconComponent } from '@backstage/core-plugin-api';\n\nconst useStyles = makeStyles({\n svgIcon: {\n display: 'inline-block',\n '& svg': {\n display: 'inline-block',\n fontSize: 'inherit',\n verticalAlign: 'baseline',\n },\n },\n});\n\nexport function IconLink(props: {\n href: string;\n text?: string;\n Icon?: IconComponent;\n}) {\n const { href, text, Icon } = props;\n const classes = useStyles();\n\n return (\n <Box display=\"flex\">\n <Box mr={1} className={classes.svgIcon}>\n <Typography component=\"div\">\n {Icon ? <Icon /> : <LanguageIcon />}\n </Typography>\n </Box>\n <Box flexGrow=\"1\">\n <Link to={href} target=\"_blank\" rel=\"noopener\">\n {text || href}\n </Link>\n </Box>\n </Box>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\nimport { Theme } from '@material-ui/core/styles';\nimport { Breakpoint, ColumnBreakpoints } from './types';\n\nconst colDefaults: ColumnBreakpoints = {\n xs: 1,\n sm: 1,\n md: 1,\n lg: 2,\n xl: 3,\n};\n\nexport function useDynamicColumns(\n cols: ColumnBreakpoints | number | undefined,\n): number {\n const matches: (Breakpoint | null)[] = [\n useMediaQuery((theme: Theme) => theme.breakpoints.up('xl')) ? 'xl' : null,\n useMediaQuery((theme: Theme) => theme.breakpoints.up('lg')) ? 'lg' : null,\n useMediaQuery((theme: Theme) => theme.breakpoints.up('md')) ? 'md' : null,\n useMediaQuery((theme: Theme) => theme.breakpoints.up('sm')) ? 'sm' : null,\n useMediaQuery((theme: Theme) => theme.breakpoints.up('xs')) ? 'xs' : null,\n ];\n\n let numOfCols = 1;\n\n if (typeof cols === 'number') {\n numOfCols = cols;\n } else {\n const breakpoint = matches.find(k => k !== null) ?? 'xs';\n numOfCols = cols?.[breakpoint] ?? colDefaults[breakpoint];\n }\n\n return numOfCols;\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Grid, type Columns } from '@backstage/ui';\nimport { IconLink } from './IconLink';\nimport { ColumnBreakpoints } from './types';\nimport { useDynamicColumns } from './useDynamicColumns';\nimport { IconComponent } from '@backstage/core-plugin-api';\n\nexport interface LinksGridListItem {\n href: string;\n text?: string;\n Icon?: IconComponent;\n}\n\ninterface LinksGridListProps {\n items: LinksGridListItem[];\n cols?: ColumnBreakpoints | number;\n}\n\nexport function LinksGridList(props: LinksGridListProps) {\n const { items, cols = undefined } = props;\n const numOfCols = useDynamicColumns(cols);\n\n return (\n <Grid.Root\n columns={String(Math.min(Math.max(numOfCols, 1), 12)) as Columns}\n gap=\"2\"\n >\n {items.map(({ text, href, Icon }, i) => (\n <IconLink key={i} href={href} text={text ?? href} Icon={Icon} />\n ))}\n </Grid.Root>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Button from '@material-ui/core/Button';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { CodeSnippet } from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { catalogTranslationRef } from '../../alpha/translation';\n\nconst ENTITY_YAML = `metadata:\n name: example\n links:\n - url: https://dashboard.example.com\n title: My Dashboard\n icon: dashboard`;\n\n/** @public */\nexport type EntityLinksEmptyStateClassKey = 'code';\n\nconst useStyles = makeStyles(\n theme => ({\n code: {\n borderRadius: 6,\n margin: theme.spacing(2, 0),\n background:\n theme.palette.type === 'dark' ? '#444' : theme.palette.common.white,\n },\n }),\n { name: 'PluginCatalogEntityLinksEmptyState' },\n);\n\nexport function EntityLinksEmptyState() {\n const classes = useStyles();\n const { t } = useTranslationRef(catalogTranslationRef);\n\n return (\n <>\n <Typography variant=\"body1\">\n {t('entityLinksCard.emptyDescription')}\n </Typography>\n <div className={classes.code}>\n <CodeSnippet\n text={ENTITY_YAML}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={[3, 4, 5, 6]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n </div>\n <Button\n variant=\"contained\"\n color=\"primary\"\n target=\"_blank\"\n href=\"https://backstage.io/docs/features/software-catalog/descriptor-format#links-optional\"\n >\n {t('entityLinksCard.readMoreButtonTitle')}\n </Button>\n </>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEntity, EntityInfoCard } from '@backstage/plugin-catalog-react';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport { EntityLinksEmptyState } from './EntityLinksEmptyState';\nimport { LinksGridList } from './LinksGridList';\nimport { ColumnBreakpoints } from './types';\nimport { IconComponent, useApp } from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { catalogTranslationRef } from '../../alpha/translation';\n\n/** @public */\nexport interface EntityLinksCardProps {\n cols?: ColumnBreakpoints | number;\n}\n\nexport const EntityLinksCard = (props: EntityLinksCardProps) => {\n const { cols = undefined } = props;\n const { entity } = useEntity();\n const app = useApp();\n const { t } = useTranslationRef(catalogTranslationRef);\n\n const iconResolver = (key?: string): IconComponent =>\n key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon;\n\n const links = entity?.metadata?.links;\n\n return (\n <EntityInfoCard title={t('entityLinksCard.title')}>\n {!links || links.length === 0 ? (\n <EntityLinksEmptyState />\n ) : (\n <LinksGridList\n cols={cols}\n items={links.map(({ url, title, icon }) => ({\n text: title ?? url,\n href: url,\n Icon: iconResolver(icon),\n }))}\n />\n )}\n </EntityInfoCard>\n );\n};\n"],"names":["r","CardDefinition","defineComponent","styles","CardHeaderDefinition","CardBodyDefinition","CardFooterDefinition","Card","forwardRef","props","ref","ownProps","restProps","dataAttributes","utilityStyle","useDefinition","classes","children","onPress","href","label","linkTarget","rel","download","isInteractive","triggerRef","useRef","handleClick","useCallback","e","targetNode","targetElement","Element","window","MouseEvent","Box","undefined","Link","RAButton","CardHeader","CardBody","CardFooter","GridDefinition","GridItemDefinition","Grid","childrenWithBgProvider","useStyles","makeStyles","EntityInfoCard","title","headerActions","footerActions","className","classNames","Flex","Text","IconLink","text","Icon","Typography","LanguageIcon","colDefaults","LinksGridList","items","cols","numOfCols","useDynamicColumns","matches","useMediaQuery","theme","breakpoint","k","String","Math","i","ENTITY_YAML","EntityLinksEmptyState","t","useTranslationRef","catalogTranslationRef","CodeSnippet","Button","EntityLinksCard","entity","useEntity","app","useApp","links","url","icon","key"],"mappings":"sIAEA,IAAI,EAAyBA,EAAQ,MAEjC,EAA0BA,EAAQ,MAKtC,UAAe,CAAG,KAAK,EAEvB,IAAI,EAAQ,EAAwBA,EAAQ,OAQ5C,UAAe,CAJA,AAAC,GAAG,AAFE,EAAuBA,EAAQ,QAElB,OAAO,AAAD,EAAiB,EAAM,aAA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B,EAAqBA,CAAAA,E,EAa9B,C"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["8877"],{86912(e){e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},84570(e,t,r){var a=r(47170);e.exports=r(45770)(a)},90313(e,t,r){var a=r(11129),n=r(20714);e.exports=function e(t,r,i,o,s){var l=-1,u=t.length;for(i||(i=n),s||(s=[]);++l<u;){var c=t[l];r>0&&i(c)?r>1?e(c,r-1,i,o,s):a(s,c):o||(s[s.length]=c)}return s}},41393(e,t,r){var a=r(84570),n=r(36529);e.exports=function(e,t){var r=-1,i=n(e)?Array(e.length):[];return a(e,function(e,a,n){i[++r]=t(e,a,n)}),i}},70310(e,t,r){var a=r(65111),n=r(57923),i=r(3334),o=r(41393),s=r(50642),l=r(49460),u=r(46775),c=r(22053),p=r(53142);e.exports=function(e,t,r){t=t.length?a(t,function(e){return p(e)?function(t){return n(t,1===e.length?e[0]:e)}:e}):[c];var d=-1;return t=a(t,l(i)),s(o(e,function(e,r,n){return{criteria:a(t,function(t){return t(e)}),index:++d,value:e}}),function(e,t){return u(e,t,r)})}},23945(e,t,r){var a=r(22053),n=r(75234),i=r(80796);e.exports=function(e,t){return i(n(e,t,a),e+"")}},47403(e,t,r){var a=r(82619),n=r(72532),i=r(22053);e.exports=n?function(e,t){return n(e,"toString",{configurable:!0,enumerable:!1,value:a(t),writable:!0})}:i},50642(e){e.exports=function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}},63521(e,t,r){var a=r(51187);e.exports=function(e,t){if(e!==t){var r=void 0!==e,n=null===e,i=e==e,o=a(e),s=void 0!==t,l=null===t,u=t==t,c=a(t);if(!l&&!c&&!o&&e>t||o&&s&&u&&!l&&!c||n&&s&&u||!r&&u||!i)return 1;if(!n&&!o&&!c&&e<t||c&&r&&i&&!n&&!o||l&&r&&i||!s&&i||!u)return -1}return 0}},46775(e,t,r){var a=r(63521);e.exports=function(e,t,r){for(var n=-1,i=e.criteria,o=t.criteria,s=i.length,l=r.length;++n<s;){var u=a(i[n],o[n]);if(u){if(n>=l)return u;return u*("desc"==r[n]?-1:1)}}return e.index-t.index}},45770(e,t,r){var a=r(36529);e.exports=function(e,t){return function(r,n){if(null==r)return r;if(!a(r))return e(r,n);for(var i=r.length,o=t?i:-1,s=Object(r);(t?o--:++o<i)&&!1!==n(s[o],o,s););return r}}},20714(e,t,r){var a=r(65650),n=r(3283),i=r(53142),o=a?a.isConcatSpreadable:void 0;e.exports=function(e){return i(e)||n(e)||!!(o&&e&&e[o])}},74535(e,t,r){var a=r(46285),n=r(36529),i=r(69632),o=r(41580);e.exports=function(e,t,r){if(!o(r))return!1;var s=typeof t;return("number"==s?!!(n(r)&&i(t,r.length)):"string"==s&&t in r)&&a(r[t],e)}},75234(e,t,r){var a=r(86912),n=Math.max;e.exports=function(e,t,r){return t=n(void 0===t?e.length-1:t,0),function(){for(var i=arguments,o=-1,s=n(i.length-t,0),l=Array(s);++o<s;)l[o]=i[t+o];o=-1;for(var u=Array(t+1);++o<t;)u[o]=i[o];return u[t]=r(l),a(e,this,u)}}},80796(e,t,r){var a=r(47403);e.exports=r(3316)(a)},3316(e){var t=Date.now;e.exports=function(e){var r=0,a=0;return function(){var n=t(),i=16-(n-a);if(a=n,i>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},82619(e){e.exports=function(e){return function(){return e}}},46343(e,t,r){var a=r(94687);e.exports=function(e,t){return a(e,t)}},40074(e,t,r){var a=r(90313),n=r(70310),i=r(23945),o=r(74535);e.exports=i(function(e,t){if(null==e)return[];var r=t.length;return r>1&&o(e,t[0],t[1])?t=[]:r>2&&o(t[0],t[1],t[2])&&(t=[t[0]]),n(e,a(t,1),[])})},49185(e,t,r){"use strict";let a,n;r.d(t,{sA:()=>_,jn:()=>J,vv:()=>W,nC:()=>D});var i,o=r(55963);function s(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function l(e){if(!s(e))return!1;let t=new Set([e]);return Object.values(e).every(e=>(function e(t,r){if(null===t||"string"==typeof t||"number"==typeof t||"boolean"==typeof t)return!0;if("object"!=typeof t||r.has(t))return!1;r.add(t);let a=Array.isArray(t)?t.every(t=>e(t,r)):Object.values(t).every(t=>e(t,r));return r.delete(t),a})(e,t))}var u=r(11601),c=r.n(u),p=r(67156),d=r.n(p);function f(e){if(!s(e)||"function"==typeof e.then)throw new o.dz("Invalid JSON schema: must be an object");let t=(a||(a=new(c())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0}),d()(a)),a);try{let r=t.validateSchema(e);if("boolean"!=typeof r)throw new o.dz("Expected synchronous validation result")}catch(e){throw new o.dz(`Invalid JSON schema: ${e}`)}let r=t.errors?.[0];if(r){let e=r.message;throw Array.isArray(r?.params?.allowedValues)&&(e+=`, expected one of: ${r.params.allowedValues.join(", ")}`),new o.dz(`Invalid JSON schema, error at path ${r.instancePath}: ${e}`)}return!0}var m=r(74404),h=r(51700),v=r(17328);let y=m.g1P(m.YjP(),m.L5J()).refine(e=>l(e),{message:"Invalid JSON schema"}),g=m.g1P(m.YjP(),m.L5J()).superRefine((e,t)=>{try{f(e)}catch(e){t.addIssue({code:v.eq.custom,message:(0,h.bJ)(e)?e.message:"Invalid JSON schema"})}}).transform(e=>e),j=m.rej({op:m.euz("declareAnnotation.v1"),name:m.YjP(),properties:m.rej({title:m.YjP().optional(),description:m.YjP(),schema:m.rej({jsonSchema:g}).optional()})}),b=m.rej({op:m.euz("declareKind.v1"),kind:m.YjP(),group:m.YjP(),properties:m.rej({singular:m.YjP(),plural:m.YjP(),description:m.YjP()})}),w=m.Ikc({allOf:m.PVZ([m.Ikc({$ref:m.euz("Entity")}),m.Ikc({type:m.euz("object"),properties:m.Ikc({apiVersion:m.g1P(m.YjP(),m.L5J()).optional(),kind:m.g1P(m.YjP(),m.L5J()).optional()}).passthrough()}).passthrough()])}).passthrough();function x(e){let t=w.safeParse(e);if(!t.success)return e;let{allOf:r,...a}=t.data,{type:n,properties:i,...o}=r[1],{apiVersion:s,kind:l,...u}=i;return{...a,type:n,...o,properties:u}}let P=["kind","apiVersion","metadata","$ref"],A=["allOf","oneOf","anyOf","if","else","then","not","$ref"],k=m.rej({selector:m.rej({path:m.YjP()}),relation:m.YjP(),defaultKind:m.YjP().optional(),defaultNamespace:m.k5n(["default","inherit"]).optional(),allowedKinds:m.YOg(m.YjP()).optional()}),S=m.rej({op:m.euz("declareKindVersion.v1"),kind:m.YjP(),name:m.YjP(),specType:m.YjP().optional(),properties:m.rej({description:m.YjP().optional(),relationFields:m.YOg(k).optional(),schema:m.rej({jsonSchema:g})})});function C(e){let t=[];for(let a of e.versions){let n=x(a.schema.jsonSchema);for(let i of(f(n),!function(e){if(!l(e))throw new o.dz("Schema must be an object");if(void 0!==e.type&&"object"!==e.type)throw new o.dz('Schema root type must be "object"');for(let t of A)if(t in e)throw new o.dz(`Schema must not use "${t}" keyword in the root`);let t=e.properties;if(!s(t))throw new o.dz('Schema must have a "properties" field that is an object');for(let e of P)if(e in t)throw new o.dz(`Schema must not try to declare the reserved root field "${e}"`);for(let[e,r]of Object.entries(t)){if(!s(r))throw new o.dz(`Schema for root field "${e}" must be an object`);for(let t of A)if(t in r)throw new o.dz(`Schema for root field "${e}" must not use "${t}" keyword`)}}(n),Array.isArray(a.name)?a.name:[a.name]))for(let o of a.specType?[a.specType].flat():[void 0]){var r;t.push((r={kind:e.kind,name:i,specType:o,properties:{description:a.description,relationFields:a.relationFields,schema:{jsonSchema:n}}},S.parse({...r,op:"declareKindVersion.v1"})))}}return t}let E=m.rej({op:m.euz("declareLabel.v1"),name:m.YjP(),properties:m.rej({title:m.YjP().optional(),description:m.YjP(),schema:m.rej({jsonSchema:g}).optional()})}),I=m.rej({op:m.euz("declareRelation.v1"),fromKind:m.YjP(),type:m.YjP(),toKind:m.YjP(),properties:m.rej({reverseType:m.YjP(),title:m.YjP(),description:m.YjP()})});function K(e){return I.parse({...e,op:"declareRelation.v1"})}let O=m.rej({op:m.euz("removeAnnotation.v1"),name:m.YjP()}),L=m.rej({op:m.euz("removeKind.v1"),kind:m.YjP()}),Y=m.rej({op:m.euz("removeLabel.v1"),name:m.YjP()}),z=m.rej({op:m.euz("removeTag.v1"),name:m.YjP()}),N=m.rej({op:m.euz("declareTag.v1"),name:m.YjP(),properties:m.rej({title:m.YjP().optional(),description:m.YjP()})}),T=m.rej({op:m.euz("updateAnnotation.v1"),name:m.YjP(),properties:m.rej({title:m.YjP().optional(),description:m.YjP().optional(),schema:m.rej({jsonSchema:g}).optional()})}),$=m.rej({op:m.euz("updateKind.v1"),kind:m.YjP(),properties:m.rej({singular:m.YjP().optional(),plural:m.YjP().optional(),description:m.YjP().optional()})}),F=m.rej({selector:m.rej({path:m.YjP()}),relation:m.YjP(),defaultKind:m.YjP().optional(),defaultNamespace:m.k5n(["default","inherit"]).optional(),allowedKinds:m.YOg(m.YjP()).optional()}),R=m.rej({op:m.euz("updateKindVersion.v1"),kind:m.YjP(),name:m.YjP(),specType:m.YjP().optional(),properties:m.rej({description:m.YjP().optional(),relationFields:m.YOg(F).optional(),schema:m.rej({jsonSchema:y}).optional()})}),M=m.rej({op:m.euz("updateLabel.v1"),name:m.YjP(),properties:m.rej({title:m.YjP().optional(),description:m.YjP().optional(),schema:m.rej({jsonSchema:g}).optional()})}),U=m.rej({op:m.euz("updateRelation.v1"),fromKind:m.YjP(),type:m.YjP(),toKind:m.YjP(),properties:m.rej({reverseType:m.YjP().optional(),reverseTitle:m.YjP().optional(),title:m.YjP().optional(),description:m.YjP().optional()})});function Q(e){return U.parse({...e,op:"updateRelation.v1"})}let q=m.rej({op:m.euz("updateTag.v1"),name:m.YjP(),properties:m.rej({title:m.YjP().optional(),description:m.YjP().optional()})}),V=r(59855).Y.create({type:"@backstage/CatalogModelLayer",versions:["v1"]});class B{#e;#t;constructor(e){this.#e=e.layerId,this.#t=[]}addKind(e){var t;let r,a=((r=[]).push((t={kind:e.names.kind,group:e.group,properties:{singular:e.names.singular,plural:e.names.plural,description:e.description}},b.parse({...t,op:"declareKind.v1"}))),r.push(...C({kind:e.names.kind,versions:e.versions??[]})),r);this.#t.push(...a)}addKindVersion(e){let t=C(e);this.#t.push(...t)}updateKind(e){let t=function(e){var t,r;let a=[];for(let n of((void 0!==e.names.singular||void 0!==e.names.plural||void 0!==e.description)&&a.push((t={kind:e.names.kind,properties:{singular:e.names.singular,plural:e.names.plural,description:e.description}},$.parse({...t,op:"updateKind.v1"}))),e.versions??[])){let t=n.schema?x(n.schema.jsonSchema):void 0;for(let i of Array.isArray(n.name)?n.name:[n.name])for(let o of n.specType?.length?[n.specType].flat():[void 0])a.push((r={kind:e.names.kind,name:i,specType:o,properties:{description:n.description,relationFields:n.relationFields,schema:t?{jsonSchema:t}:void 0}},R.parse({...r,op:"updateKindVersion.v1"})))}return a}(e);this.#t.push(...t)}removeKind(e){var t;let r=[(t={kind:e.kind},L.parse({...t,op:"removeKind.v1"}))];this.#t.push(...r)}addRelationPair(e){let t=function(e){let t=[];for(let r of[e.fromKind].flat())for(let a of[e.toKind].flat())t.push(K({fromKind:r,type:e.forward.type,toKind:a,properties:{reverseType:e.reverse.type,title:e.forward.title,description:e.description}})),t.push(K({fromKind:a,type:e.reverse.type,toKind:r,properties:{reverseType:e.forward.type,title:e.reverse.title,description:e.description}}));return t}(e);this.#t.push(...t)}updateRelationPair(e){let t=function(e){let t=[];for(let r of[e.fromKind].flat())for(let a of[e.toKind].flat())t.push(Q({fromKind:r,type:e.forward.type,toKind:a,properties:{reverseType:e.reverse.type,reverseTitle:e.reverse.type?void 0:e.reverse.title,title:e.forward.title,description:e.description}})),e.reverse.type&&t.push(Q({fromKind:a,type:e.reverse.type,toKind:r,properties:{reverseType:e.forward.type,title:e.reverse.title,description:e.description}}));return t}(e);this.#t.push(...t)}addAnnotation(e){let t=function(e){var t;if(e.schema?.jsonSchema&&(f(e.schema.jsonSchema),"string"!==e.schema.jsonSchema.type))throw new o.dz(`Annotation "${e.name}" schema must have "type": "string" at the root, only string values are supported`);return[(t={name:e.name,properties:{title:e.title,description:e.description,schema:e.schema}},j.parse({...t,op:"declareAnnotation.v1"}))]}(e);this.#t.push(...t)}updateAnnotation(e){let t=function(e){var t;if(e.schema&&(f(e.schema.jsonSchema),"string"!==e.schema.jsonSchema.type))throw new o.dz(`Annotation "${e.name}" schema must have "type": "string" at the root, only string values are supported`);return[(t={name:e.name,properties:{title:e.title,description:e.description,schema:e.schema}},T.parse({...t,op:"updateAnnotation.v1"}))]}(e);this.#t.push(...t)}removeAnnotation(e){var t;let r=[(t={name:e.name},O.parse({...t,op:"removeAnnotation.v1"}))];this.#t.push(...r)}addLabel(e){let t=function(e){var t;if(e.schema?.jsonSchema&&(f(e.schema.jsonSchema),"string"!==e.schema.jsonSchema.type))throw new o.dz(`Label "${e.name}" schema must have "type": "string" at the root, only string values are supported`);return[(t={name:e.name,properties:{title:e.title,description:e.description,schema:e.schema}},E.parse({...t,op:"declareLabel.v1"}))]}(e);this.#t.push(...t)}updateLabel(e){let t=function(e){var t;if(e.schema&&(f(e.schema.jsonSchema),"string"!==e.schema.jsonSchema.type))throw new o.dz(`Label "${e.name}" schema must have "type": "string" at the root, only string values are supported`);return[(t={name:e.name,properties:{title:e.title,description:e.description,schema:e.schema}},M.parse({...t,op:"updateLabel.v1"}))]}(e);this.#t.push(...t)}removeLabel(e){var t;let r=[(t={name:e.name},Y.parse({...t,op:"removeLabel.v1"}))];this.#t.push(...r)}addTag(e){var t;let r=[(t={name:e.name,properties:{title:e.title,description:e.description}},N.parse({...t,op:"declareTag.v1"}))];this.#t.push(...r)}updateTag(e){var t;let r=[(t={name:e.name,properties:{title:e.title,description:e.description}},q.parse({...t,op:"updateTag.v1"}))];this.#t.push(...r)}removeTag(e){var t;let r=[(t={name:e.name},z.parse({...t,op:"removeTag.v1"}))];this.#t.push(...r)}import(e){let t=V.toInternal(e);this.#t.push(...t.ops)}build(){return V.createInstance("v1",{layerId:this.#e,ops:this.#t.slice()})}}let W="ownedBy",D="dependsOn",J="partOf",_="hasPart";n=new B({layerId:(i={layerId:"catalog.backstage.io/well-known-relations",builder:e=>{e.addRelationPair({fromKind:["API","Component","Domain","Group","Location","Resource","System","User"],toKind:["Group","User"],description:"An ownership relation where the owner is usually an organizational entity (user or group), and the other entity can be anything.",forward:{type:"ownedBy",title:"owned by"},reverse:{type:"ownerOf",title:"owner of"}}),e.addRelationPair({fromKind:"Component",toKind:"API",description:"A relation from a component to an API it provides for consumption by others.",forward:{type:"providesApi",title:"provides API"},reverse:{type:"apiProvidedBy",title:"API provided by"}}),e.addRelationPair({fromKind:"Component",toKind:"API",description:"A relation from a component to an API it consumes.",forward:{type:"consumesApi",title:"consumes API"},reverse:{type:"apiConsumedBy",title:"API consumed by"}}),e.addRelationPair({fromKind:["Component","Resource"],toKind:["Component","Resource"],description:"A dependency relation expressing that an entity needs another entity to function.",forward:{type:"dependsOn",title:"depends on"},reverse:{type:"dependencyOf",title:"dependency of"}}),e.addRelationPair({fromKind:"Group",toKind:"Group",description:"A parent/child relation to build up a tree, used for example to describe the organizational structure between groups.",forward:{type:"parentOf",title:"parent of"},reverse:{type:"childOf",title:"child of"}}),e.addRelationPair({fromKind:"User",toKind:"Group",description:"A membership relation, typically for users in a group.",forward:{type:"memberOf",title:"member of"},reverse:{type:"hasMember",title:"has member"}}),e.addRelationPair({fromKind:["Component","API","Resource"],toKind:["Component","System"],description:"A part/whole relation where a component, API, or resource belongs to a system or a component is a subcomponent of another.",forward:{type:"partOf",title:"part of"},reverse:{type:"hasPart",title:"has part"}}),e.addRelationPair({fromKind:"System",toKind:"Domain",description:"A part/whole relation where a system belongs to a domain.",forward:{type:"partOf",title:"part of"},reverse:{type:"hasPart",title:"has part"}}),e.addRelationPair({fromKind:"Domain",toKind:"Domain",description:"A part/whole relation where a domain is a subdomain of another domain.",forward:{type:"partOf",title:"part of"},reverse:{type:"hasPart",title:"has part"}})}}).layerId}),i.builder(n),n.build()},48266(e,t,r){"use strict";r.d(t,{w:()=>k});var a=r(31085),n=r(77125),i=r(98552),o=r(94390),s=r(95061),l=r(41857),u=r(48543),c=r(26343),p=r(99489),d=r(7031),f=r(99703),m=r(58837),h=r(72501),v=r(92399),y=r(14041),g=r(10437);let j=(0,m.A)(e=>(0,f.A)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none",color:"#616161"}}),{name:"BackstageClosedDropdown"}),b=()=>{let e=j();return(0,a.jsx)(g.A,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"currentColor"})})},w=(0,m.A)(e=>(0,f.A)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none",color:"#616161"}}),{name:"BackstageOpenedDropdown"}),x=()=>{let e=w();return(0,a.jsx)(g.A,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"currentColor"})})},P=(0,d.A)(e=>(0,f.A)({root:{"label + &":{marginTop:e.spacing(3)},"&.Mui-focused > div[role=button]":{borderColor:e.palette.primary.main}},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"]),"&:focus":{background:e.palette.background.paper,borderRadius:e.shape.borderRadius}}}),{name:"BackstageSelectInputBase"})(l.A),A=(0,m.A)(e=>(0,f.A)({formControl:{margin:e.spacing(1,0)},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 k(e){let{multiple:t,items:r,label:l,placeholder:d,selected:f,onChange:m,triggerReset:g,native:j=!1,disabled:w=!1,margin:k,"data-testid":S="select"}=e,C=A(),[E,I]=(0,y.useState)(f||(t?[]:"")),[K,O]=(0,y.useState)(!1);return(0,y.useEffect)(()=>{I(t?[]:"")},[g,t]),(0,y.useEffect)(()=>{I(f||(t?[]:""))},[f,t]),(0,a.jsx)(n.A,{className:C.root,children:(0,a.jsxs)(s.A,{className:C.formControl,children:[(0,a.jsx)(u.A,{className:C.formLabel,children:l}),(0,a.jsxs)(p.A,{"aria-label":l,value:E,native:j,disabled:w,"data-testid":S,displayEmpty:!0,multiple:t,margin:k,onChange:e=>{I(e.target.value),m(e.target.value)},open:K,onOpen:e=>{w?e.preventDefault():O(r=>!(!t||e.target instanceof HTMLElement)||!r)},onClose:()=>{O(!1)},input:(0,a.jsx)(P,{}),label:l,renderValue:e=>t&&0!==E.length?(0,a.jsx)(n.A,{className:C.chips,children:e.map(e=>{let t=r.find(t=>t.value===e);return!!t&&(0,a.jsx)(o.A,{"data-testid":"chip",label:t?.label,clickable:!0,deleteIcon:(0,a.jsx)(v.default,{"data-testid":"cancel-icon",onMouseDown:e=>e.stopPropagation()}),onDelete:()=>{let t=E.filter(t=>t!==e);I(t),m(t)},className:C.chip},t?.value)})}):(0,a.jsx)(h.A,{children:0===E.length?d||"":r.find(t=>t.value===e)?.label}),IconComponent:()=>K?(0,a.jsx)(x,{}):(0,a.jsx)(b,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[!!d&&!t&&(0,a.jsx)(c.A,{value:[],children:d}),j?r&&r.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value)):r&&r.map(e=>(0,a.jsxs)(c.A,{value:e.value,children:[t&&(0,a.jsx)(i.A,{color:"primary",checked:E.includes(e.value)||!1,className:C.checkbox}),e.label]},e.value))]})]})})}},43311(e,t,r){"use strict";r.d(t,{E:()=>i});var a=r(58077),n=r(47196);function i(e,t,r){if(r){let n="string"==typeof e||"metadata"in e?e:(0,a.U2)(e);return r.forEntity(n,t).snapshot}return(0,n.T)(e,t)}},80018(e,t,r){"use strict";r.d(t,{Q:()=>P});var a=r(31085),n=r(77125),i=r(72501),o=r(4321),s=r(87263),l=r(16249),u=r(33145),c=r(58837),p=r(7031),d=r(99703),f=r(6924),m=r(62683),h=r(14041),v=r(45250),y=r(53373),g=r.n(y);let j=(0,c.A)(e=>({root:{margin:e.spacing(1,0)},label:{position:"relative",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"& > span":{top:0,left:0,position:"absolute"}}}),{name:"BackstageAutocomplete"}),b=(0,p.A)(e=>(0,d.A)({root:{},paper:{margin:0},hasClearIcon:{},hasPopupIcon:{},focused:{},inputRoot:{marginTop:24,backgroundColor:e.palette.background.paper,"$root$hasClearIcon$hasPopupIcon &":{paddingBlock:e.spacing(.75),paddingInlineStart:e.spacing(.75)},"$root$focused &":{outline:"none"},"$root &:hover > fieldset":{borderColor:"#ced4da"},"$root$focused & > fieldset":{borderWidth:1,borderColor:e.palette.primary.main}},popupIndicator:{padding:0,margin:0,color:"#616161","&:hover":{backgroundColor:"unset"},'& [class*="MuiTouchRipple-root"]':{display:"none"}},endAdornment:{"$root$hasClearIcon$hasPopupIcon &":{right:4}},input:{"$root$hasClearIcon$hasPopupIcon &":{fontSize:e.typography.body1.fontSize,paddingBlock:e.spacing(.8125)}}}),{name:"BackstageAutocompleteBase"})(m.Ay),w=e=>(0,a.jsx)(s.A,{...e,transition:!0,placement:"bottom-start",children:({TransitionProps:t})=>(0,a.jsx)(u.A,{...t,style:{transformOrigin:"0 0 0"},children:(0,a.jsx)(n.A,{children:e.children})})}),x=e=>(0,a.jsx)(o.A,{...e,elevation:8});function P(e){let{label:t,name:r,LabelProps:o,TextFieldProps:s,...u}=e,c=j(),p=(0,h.useCallback)(e=>(0,a.jsx)(l.A,{...(0,v.merge)(e,s),variant:"outlined"}),[s]),d=(0,a.jsx)(b,{size:"small",...u,renderInput:u.renderInput??p,popupIcon:(0,a.jsx)(f.default,{"data-testid":`${r}-expand`}),PaperComponent:x,PopperComponent:w});return(0,a.jsx)(n.A,{className:c.root,children:t?(0,a.jsxs)(i.A,{...o,className:g()(c.label,o?.className),component:"label",children:[(0,a.jsx)(n.A,{component:"span",children:t}),d]}):d})}},19030(e,t,r){"use strict";r.d(t,{y:()=>P});var a=r(31085),n=r(77125),i=r(58837),o=r(14041),s=r(50509),l=r(73466),u=r(76272),c=r(98552),p=r(86901),d=r(44148),f=r(41260);let m=(0,a.jsx)(f.default,{fontSize:"small"}),h=(0,a.jsx)(d.default,{fontSize:"small"});function v({selected:e}){return(0,a.jsx)(c.A,{icon:m,checkedIcon:h,checked:e})}let y=(0,o.memo)(e=>{let{selected:t,value:r,availableOptions:n,showCounts:i}=e,o=i?`${r} (${n?.[r]})`:r;return(0,a.jsx)(p.A,{control:(0,a.jsx)(v,{selected:t}),label:o,onClick:e=>e.preventDefault()})});var g=r(59378),j=r(89729),b=r(80018),w=r(45250);let x=(0,i.A)({root:{},label:{textTransform:"none",fontWeight:"bold"}},{name:"CatalogReactEntityAutocompletePicker"});function P(e){let{label:t,name:r,path:i,showCounts:c,Filter:p,InputProps:d,initialSelectedOptions:f=[],filtersForAvailableValues:m=["kind"],hidden:h,getOptionLabel:v,renderOption:P}=e,A=x(),{updateFilters:k,filters:S,queryParameters:{[r]:C}}=(0,g.nK)(),E=(0,s.gf)(u.v),I=m.map(e=>S[e]),{value:K}=(0,l.A)(async()=>{let{facets:e}=await E.getEntityFacets({facets:[i],...(0,j.Rr)(I.filter(Boolean))});return Object.fromEntries(e[i].map(({value:e,count:t})=>[e,t]))},[...I]),O=(0,o.useMemo)(()=>[C].flat().filter(Boolean),[C]),L=S[r]?.values,[Y,z]=(0,o.useState)(O.length?O:L??f);(0,o.useEffect)(()=>{O.length&&z(O)},[O]);let N=Object.keys(K??{}),T=Y.length&&N.length;(0,o.useEffect)(()=>{k({[r]:T?new p(Y):void 0})},[r,T,Y,p,k]),(0,o.useEffect)(()=>{if(!T)return;let e=L??[];(0,w.isEqual)(e,Y)||z(e)},[L]);let $=S[r];return(!$||"object"!=typeof $||"values"in $)&&N.length?h?null:(0,a.jsx)(n.A,{className:A.root,pb:1,pt:1,children:(0,a.jsx)(b.Q,{multiple:!0,disableCloseOnSelect:!0,label:t,name:`${String(r)}-picker`,options:N,value:Y,TextFieldProps:d,onChange:(e,t)=>z(t),...v&&{getOptionLabel:v},renderOption:P??((e,{selected:t})=>(0,a.jsx)(y,{selected:t,value:e,availableOptions:K,showCounts:!!c}))})}):null}},42289(e,t,r){"use strict";r.d(t,{m:()=>h});var a=r(31085),n=r(48266),i=r(50509),o=r(50375),s=r(77125),l=r(14041),u=r(47195),c=r(59378),p=r(73466),d=r(76272),f=r(79811),m=r(89595);let h=e=>{let t,r,{allowedKinds:h,hidden:v,initialFilter:y="component"}=e,{t:g}=(0,m.i)(f.j),j=(0,i.gf)(o.k),{error:b,allKinds:w,selectedKind:x,setSelectedKind:P}=function(e){let{filters:t,queryParameters:{kind:r},updateFilters:a}=(0,c.nK)(),n=(0,l.useMemo)(()=>[r].flat()[0],[r]),[o,s]=(0,l.useState)(n??t.kind?.value??e.initialFilter);(0,l.useEffect)(()=>{n&&s(n)},[n]),(0,l.useEffect)(()=>{t.kind?.value&&s(t.kind?.value)},[t.kind]);let{allKinds:f,loading:m,error:h}=function(){let e=(0,i.gf)(d.v),{error:t,loading:r,value:a}=(0,p.A)(async()=>{let{facets:t}=await e.getEntityFacets({facets:["kind"]});return new Map((t.kind??[]).map(e=>e.value).map(e=>[e.toLowerCase(),e]))},[e]);return{loading:r,error:t,allKinds:a??new Map}}(),v=f.get(o)||o;return(0,l.useEffect)(()=>{a({kind:o?new u.gM(o,v):void 0})},[o,v,a]),{loading:m,error:h,allKinds:f,selectedKind:o,setSelectedKind:s}}({initialFilter:y});if((0,l.useEffect)(()=>{b&&j.post({message:g("entityKindPicker.errorMessage"),severity:"error"})},[b,j,g]),b)return null;let A=[...(t=Array.from(w.keys()),h&&(t=h.map(e=>e.toLowerCase()).filter(e=>w.has(e))),r=new Map(t.map(e=>[e,w.get(e)||e])),x&&!r.has(x)&&r.set(x.toLowerCase(),x),r).entries()].map(([e,t])=>({label:t,value:e}));return v?null:(0,a.jsx)(s.A,{pb:1,pt:1,children:(0,a.jsx)(n.w,{label:g("entityKindPicker.title"),items:A,selected:x.toLowerCase(),onChange:e=>P(String(e))})})}},42858(e,t,r){"use strict";r.d(t,{W:()=>c});var a=r(31085),n=r(58837),i=r(47195),o=r(19030),s=r(79811),l=r(89595);let u=(0,n.A)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),c=e=>{let{initialFilter:t=[]}=e,r=u(),{t:n}=(0,l.i)(s.j);return(0,a.jsx)(o.y,{label:n("entityLifecyclePicker.title"),name:"lifecycles",path:"spec.lifecycle",Filter:i.I5,InputProps:{className:r.input},initialSelectedOptions:t})}},29314(e,t,r){"use strict";r.d(t,{V:()=>c});var a=r(31085),n=r(58837),i=r(47195),o=r(19030),s=r(79811),l=r(89595);let u=(0,n.A)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),c=e=>{let{initiallySelectedNamespaces:t}=e,r=u(),{t:n}=(0,l.i)(s.j);return(0,a.jsx)(o.y,{label:n("entityNamespacePicker.title"),name:"namespace",path:"metadata.namespace",Filter:i.z,InputProps:{className:r.input},initialSelectedOptions:t})}},8918(e,t,r){"use strict";r.d(t,{t:()=>M});var a=r(31085),n=r(58077),i=r(77125),o=r(98552),s=r(86901),l=r(72501),u=r(71677),c=r(58837),p=r(44148),d=r(41260),f=r(14041),m=r(59378),h=r(47195),v=r(1497),y=r(48108),g=r(47966),j=r(87623),b=r(43311),w=r(50509),x=r(87290),P=r(76272),A=r(76842),k=r(84392);let S=e=>{let{data:t,index:r,style:a}=e;return(0,f.cloneElement)(t[r],{style:a})},C=(0,f.createContext)({}),E=(0,f.forwardRef)(({onScroll:e,...t},r)=>{let{onScroll:n,...i}=(0,f.useContext)(C);return(0,a.jsx)("div",{ref:r,onScroll:t=>{e?.(t),n?.(t)},...t,...i})}),I=(0,f.forwardRef)((e,t)=>{let{children:r,...n}=e,i=f.Children.toArray(r),o=i.length,s=Math.min(10,o)+.5;return(0,a.jsx)("div",{ref:t,children:(0,a.jsx)(C.Provider,{value:n,children:(0,a.jsx)(k.Y1,{height:36*s,itemData:i,itemCount:o,itemSize:36,outerElementType:E,width:"100%",children:S})})})});var K=r(7031),O=r(76355),L=r(79811),Y=r(89595),z=r(80018);let N=(0,c.A)({root:{},label:{},input:{},fullWidth:{width:"100%"},boxLabel:{width:"100%",textOverflow:"ellipsis",overflow:"hidden"}},{name:"CatalogReactEntityOwnerPicker"}),T=(0,K.A)(e=>({label:{width:"100%"},root:{width:"90%"}}),{name:"FixedWidthFormControlLabel"})(s.A),$=(0,a.jsx)(d.default,{fontSize:"small"}),F=(0,a.jsx)(p.default,{fontSize:"small"});function R(e){let t=N(),r="group"===e.entity.kind.toLowerCase(),s="owners-only"===e.mode?(0,n.U2)(e.entity):e.entity,{primaryTitle:c}=(0,O.f)(s);return(0,a.jsx)(i.A,{className:t.fullWidth,children:(0,a.jsx)(T,{className:t.fullWidth,control:(0,a.jsx)(o.A,{icon:$,checkedIcon:F,checked:e.isSelected}),onClick:e=>e.preventDefault(),label:(0,a.jsx)(u.Ay,{title:c,children:(0,a.jsxs)(i.A,{display:"flex",alignItems:"center",children:[r?(0,a.jsx)(g.default,{fontSize:"small"}):(0,a.jsx)(y.default,{fontSize:"small"}),"\xa0",(0,a.jsx)(i.A,{className:t.boxLabel,children:(0,a.jsx)(l.A,{noWrap:!0,children:c})})]})})})})}let M=e=>{let t=N(),{mode:r="owners-only"}=e||{},o=(0,w.Q2)().get(j.n),{updateFilters:s,filters:l,queryParameters:{owners:u}}=(0,m.nK)(),[c,p]=(0,f.useState)(""),{t:d}=(0,Y.i)(L.j),y=(0,f.useMemo)(()=>[u].flat().filter(Boolean),[u]),[g,k]=(0,f.useState)(y.length?new h.N9(y).values:l.owners?.values??[]),[{value:S,loading:C},E,K]=function({mode:e,initialSelectedOwnersRefs:t}){let r,a="owners-only"===e,i=(r=(0,w.gf)(P.v),(0,x.A)(async(e,t)=>{let a=t?.limit??20;if(e.cursor){let t=await r.queryEntities({cursor:e.cursor,limit:a});return{cursor:t.pageInfo.nextCursor,items:[...e.items,...t.items]}}let n=await r.queryEntities({fullTextFilter:{term:e.text||"",fields:["metadata.name","kind","spec.profile.displayname","metadata.title"]},filter:{kind:["User","Group"]},orderFields:[{field:"metadata.name",order:"asc"}],limit:a});return{cursor:n.pageInfo.nextCursor,items:n.items}},[],{loading:!0})),o=function({enabled:e}){let t=(0,w.gf)(P.v),[r]=(0,f.useState)(async()=>{if(!e)return[];let r="relations.ownedBy";return t.getEntityFacets({facets:[r]}).then(e=>e.facets[r].map(e=>e.value).map(e=>{let{kind:t,name:r,namespace:a}=(0,n.KU)(e);return{apiVersion:"backstage.io/v1beta1",kind:t,metadata:{name:r,namespace:a}}}).sort((e,t)=>e.kind.localeCompare(t.kind,"en-US")||e.metadata.namespace.localeCompare(t.metadata.namespace,"en-US")||e.metadata.name.localeCompare(t.metadata.name,"en-US"))).catch(()=>[])});return(0,x.A)(async(e,t)=>{var a;let n=await r;if(!n)return{items:[]};let i=t?.limit??20,{text:o,start:s}=(a=e).cursor&&a.cursor?JSON.parse(atob(a.cursor)):{text:a.text||"",start:0},l=n.filter(e=>{var t,r;let a;return t=o,r=e,a=t.trim(),r.kind.includes(a)||r.metadata.namespace?.includes(a)||r.metadata.name.includes(a)}),u=s+i;return{items:l.slice(0,u),...function({entities:e,limit:t,payload:r}){return e.length>t?{cursor:btoa(JSON.stringify(r))}:{}}({entities:l,limit:u,payload:{text:o,start:u}})}},[r],{loading:!0,value:{items:[]}})}({enabled:a}),[s,l]=a?o:i;return[s,l,function({enabled:e,initialSelectedOwnersRefs:t}){let r=(0,f.useRef)({}),a=(0,w.gf)(P.v),[,i]=(0,x.A)(async()=>{(await a.getEntitiesByRefs({entityRefs:t})).items.forEach(e=>{e&&(r.current[(0,n.U2)(e)]=e)})},[]);return(0,A.u)(()=>{e&&t.length>0&&i()}),{getEntity:e=>r.current[e],setEntity:e=>{r.current[(0,n.U2)(e)]=e}}}({enabled:!a,initialSelectedOwnersRefs:t})]}({mode:r,initialSelectedOwnersRefs:g});(0,v.s)(()=>E({text:c.toLowerCase()}),[c,E],250);let O=S?.items||[];return((0,f.useEffect)(()=>{y.length&&k(new h.N9(y).values)},[y]),(0,f.useEffect)(()=>{s({owners:g.length?new h.N9(g):void 0})},[g,s]),["user","group"].includes(l.kind?.value.toLowerCase()||""))?null:(0,a.jsx)(i.A,{className:t.root,pb:1,pt:1,children:(0,a.jsx)(z.Q,{label:d("entityOwnerPicker.title"),multiple:!0,disableCloseOnSelect:!0,loading:C,options:O,value:g,getOptionSelected:(e,t)=>"string"==typeof t?(0,n.U2)(e)===t:e===t,getOptionLabel:e=>{if("owners-only"===r){let t="string"==typeof e?e:(0,n.U2)(e);return(0,b.E)(t,void 0,o).primaryTitle}let t="string"==typeof e?K.getEntity(e)||(0,n.KU)(e,{defaultKind:"group",defaultNamespace:"default"}):e;return(0,b.E)(t,void 0,o).primaryTitle},onChange:(e,t)=>{p(""),k(t.map(e=>{let t="string"==typeof e?e:(0,n.U2)(e);return"string"!=typeof e&&K.setEntity(e),t}))},filterOptions:e=>e,renderOption:(e,{selected:t})=>(0,a.jsx)(R,{entity:e,isSelected:t,mode:r}),name:"owner-picker",onInputChange:(e,t)=>{p(t)},ListboxComponent:I,ListboxProps:{onScroll:e=>{let t=e.currentTarget;1>Math.abs(t.scrollHeight-t.clientHeight-t.scrollTop)&&S?.cursor&&E({items:S.items,cursor:S.cursor})},"data-testid":"owner-picker-listbox"},LabelProps:{className:t.label},TextFieldProps:{className:t.input}})})}},53776(e,t,r){"use strict";r.d(t,{n:()=>j});var a=r(31085),n=r(47195),i=r(77125),o=r(98552),s=r(86901),l=r(58837),u=r(44148),c=r(41260),p=r(14041),d=r(59378),f=r(79811),m=r(89595),h=r(80018);let v=(0,l.A)({root:{},input:{},label:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),y=(0,a.jsx)(c.default,{fontSize:"small"}),g=(0,a.jsx)(u.default,{fontSize:"small"}),j=()=>{let e=v(),{updateFilters:t}=(0,d.nK)(),{t:r}=(0,m.i)(f.j),[l,u]=(0,p.useState)([]);return(0,a.jsx)(i.A,{className:e.root,pb:1,pt:1,children:(0,a.jsx)(h.Q,{label:r("entityProcessingStatusPicker.title"),multiple:!0,disableCloseOnSelect:!0,options:["Is Orphan","Has Error"],value:l,onChange:(e,r)=>{var a,i;u(r),t({orphan:(a=r.includes("Is Orphan"))?new n.Kf(a):void 0}),t({error:(i=r.includes("Has Error"))?new n.mT(i):void 0})},renderOption:(e,{selected:t})=>(0,a.jsx)(s.A,{control:(0,a.jsx)(o.A,{icon:y,checkedIcon:g,checked:t}),onClick:e=>e.preventDefault(),label:e}),name:"processing-status-picker",LabelProps:{className:e.label},TextFieldProps:{className:e.input}})})}},67762(e,t,r){"use strict";r.d(t,{m:()=>c});var a=r(31085),n=r(58837),i=r(47195),o=r(19030),s=r(79811),l=r(89595);let u=(0,n.A)({input:{}},{name:"CatalogReactEntityTagPicker"}),c=e=>{let t=u(),{t:r}=(0,l.i)(s.j);return(0,a.jsx)(o.y,{label:r("entityTagPicker.title"),name:"tags",path:"metadata.tags",Filter:i.q_,showCounts:e.showCounts,InputProps:{className:t.input},initialSelectedOptions:e.initialFilter?e.initialFilter:[],hidden:e.hidden})}},68996(e,t,r){"use strict";r.d(t,{Q:()=>j});var a=r(31085),n=r(14041),i=r(77125),o=r(73466),s=r(46343),l=r.n(s),u=r(40074),c=r.n(u),p=r(50509),d=r(76272),f=r(59378),m=r(47195),h=r(50375),v=r(48266),y=r(79811),g=r(89595);let j=e=>{let{hidden:t,initialFilter:r}=e,s=(0,p.gf)(h.k),{error:u,availableTypes:j,selectedTypes:b,setSelectedTypes:w}=function(){let e=(0,p.gf)(d.v),{filters:{kind:t,type:r},queryParameters:{type:a},updateFilters:i}=(0,f.nK)(),s=(0,n.useMemo)(()=>[a].flat().filter(Boolean),[a]),[u,h]=(0,n.useState)(s.length?s:r?.getTypes()??[]);(0,n.useEffect)(()=>{s.length&&h(s)},[s]);let[v,y]=(0,n.useState)([]),g=(0,n.useMemo)(()=>t?.value,[t]),{error:j,loading:b,value:w}=(0,o.A)(async()=>{if(g)return await e.getEntityFacets({filter:{kind:g},facets:["spec.type"]}).then(e=>e.facets["spec.type"]||[])},[g,e]),x=(0,n.useRef)(w);return(0,n.useEffect)(()=>{let e=x.current;if(x.current=w,b||!g||e===w||!w)return;let t=[...new Set(c()(w,e=>-e.count).map(e=>e.value.toLowerCase()))];y(t);let r=u.filter(e=>t.includes(e));l()(u,r)||h(r)},[b,g,u,h,w]),(0,n.useEffect)(()=>{i({type:u.length?new m.qA(u):void 0})},[u,i]),{loading:b,error:j,availableTypes:v,selectedTypes:u,setSelectedTypes:h}}(),{t:x}=(0,g.i)(y.j);if((0,n.useEffect)(()=>{u&&s.post({message:x("entityTypePicker.errorMessage"),severity:"error"}),r&&w([r])},[u,s,r,w,x]),0===j.length||u)return null;j.sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase()));let P=[{value:"all",label:x("entityTypePicker.optionAllTitle")},...j.map(e=>({value:e,label:e}))];return t?null:(0,a.jsx)(i.A,{pb:1,pt:1,children:(0,a.jsx)(v.w,{label:x("entityTypePicker.title"),items:P,selected:(P.length>1?b[0]:void 0)??"all",onChange:e=>w("all"===e?[]:[String(e)])})})}},59302(e,t,r){"use strict";r.d(t,{y:()=>K});var a=r(31085),n=r(50509),i=r(19735),o=r(40703),s=r(58007),l=r(68804),u=r(65569),c=r(5951),p=r(26343),d=r(72501),f=r(58837),m=r(9684),h=r(55940),v=r(14041),y=r(47195),g=r(59378),j=r(48203),b=r(45250),w=r(73466),x=r(76272),P=r(89729),A=r(87290),k=r(17855),S=r(75710),C=r(89595),E=r(79811);let I=(0,f.A)(e=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:e.spacing(1,0,1,0)},title:{margin:e.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:e.palette.text.primary},menuItem:{minHeight:e.spacing(6)},groupWrapper:{margin:e.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"}),K=e=>{let{initialFilter:t,availableFilters:r,hidden:f,alwaysKeepFilters:K}=e,O=I(),L=(0,n.gf)(i.U),{t:Y}=(0,C.i)(E.j),z=L.getOptionalString("organization.name")??Y("userListPicker.defaultOrgName"),{filters:N,updateFilters:T,queryParameters:{user:$}}=(0,g.nK)(),F=N.kind?.value?.toLowerCase(),R=["starred","all"],M=[{name:Y("userListPicker.personalFilter.title"),items:[{id:"owned",label:Y("userListPicker.personalFilter.ownedLabel"),icon:m.default},{id:"starred",label:Y("userListPicker.personalFilter.starredLabel"),icon:h.Gg}]},{name:z,items:[{id:"all",label:Y("userListPicker.orgFilterAllLabel")}]}].map(e=>({...e,items:e.items.filter(({id:e})=>["group","user"].some(e=>e===F)?R.includes(e):!r||r.includes(e))})).filter(({items:e})=>!!e.length),{count:U,loading:Q,filter:q}=function(){let e=(0,n.gf)(j.K),t=(0,n.gf)(x.v),{filters:r}=(0,g.nK)(),{value:a,loading:i}=(0,w.A)(async()=>(await e.getBackstageIdentity()).ownershipEntityRefs,[]),{user:o,owners:s,...l}=r,{orderFields:u,...c}=(0,P.$3)((0,b.compact)(Object.values(l))),[{value:p,loading:d},f]=(0,A.A)(async e=>{let r=function(e,t){if(!t?.length)return;let r=e?.values??[];if(r.length){let e=(0,b.intersection)(r,t);if(0===e.length)return;return e}return t}(e.owners,e.ownershipEntityRefs);if(void 0===r)return 0;let{totalItems:a}=await t.queryEntities({...e.filter,query:(0,P.Il)([e.filter.query,y.tN.owned(r).getCatalogQuery()]),limit:0});return a},[],{loading:!0});return(0,k.A)(()=>{(c.filter||c.query)&&void 0!==a&&f({ownershipEntityRefs:a,owners:s,filter:c})},[a,s,c]),{count:p,loading:i||d,filter:(0,v.useMemo)(()=>y.tN.owned(a??[]),[a]),ownershipEntityRefs:a}}(),{count:V}=function(){let e=(0,n.gf)(x.v),{filters:t}=(0,g.nK)(),r=(0,v.useRef)(),a=(0,v.useMemo)(()=>{let{user:e,...a}=t,n=(0,b.compact)(Object.values(a)),{orderFields:i,...o}=(0,P.$3)(n),s={...o,limit:0};return o.filter||o.query?(0,b.isEqual)(s,r.current)?r.current:(r.current=s,s):(r.current=void 0,r.current)},[t]),{value:i,loading:o}=(0,w.A)(async()=>{if(void 0===a)return 0;let{totalItems:t}=await e.queryEntities(a);return t},[a]);return{count:i,loading:o}}(),{count:B,filter:W,loading:D}=function(){let e=(0,n.gf)(x.v),{filters:t}=(0,g.nK)(),{starredEntities:r}=(0,S.I)(),a=(0,v.useRef)(),i=(0,v.useMemo)(()=>{let{user:e,...n}=t,i=(0,b.compact)(Object.values(n)),{orderFields:o,...s}=(0,P.$3)(i),l={...s,query:(0,P.Il)([s.query,y.tN.starred(Array.from(r)).getCatalogQuery()]),limit:0};return(0,b.isEqual)(l,a.current)?a.current:(a.current=l,l)},[t,r]),{value:o,loading:s}=(0,w.A)(async()=>{if(!r.size)return 0;let{totalItems:t}=await e.queryEntities(i);return t},[i,r]);return{count:o,loading:s,filter:(0,v.useMemo)(()=>y.tN.starred(Array.from(r)),[r])}}(),J=(0,v.useMemo)(()=>[$].flat()[0],[$]),[_,G]=(0,v.useState)(J??t),H=(0,v.useMemo)(()=>({all:V,starred:B,owned:U}),[B,U,V]);(0,v.useEffect)(()=>{J&&G(J)},[J]);let Z=Q||D;return(0,v.useEffect)(()=>{Z||!_||"all"===_||0!==H[_]||K||G("all")},[Z,H,_,G,K]),(0,v.useEffect)(()=>{!_||Z||T({user:"owned"===_?q:"starred"===_?W:y.tN.all()})},[_,W,q,T,Z]),f?null:(0,a.jsx)(o.A,{className:O.root,children:M.map(e=>(0,a.jsxs)(v.Fragment,{children:[(0,a.jsx)(d.A,{variant:"subtitle2",component:"span",className:O.title,children:e.name}),(0,a.jsx)(o.A,{className:O.groupWrapper,children:(0,a.jsx)(s.A,{disablePadding:!0,dense:!0,role:"menu","aria-label":e.name,children:e.items.map((t,r)=>(0,a.jsxs)(p.A,{role:"none presentation",divider:r!==e.items.length-1,onClick:()=>G(t.id),selected:t.id===N.user?.value,className:O.menuItem,disabled:0===H[t.id],"data-testid":`user-picker-${t.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[t.icon&&(0,a.jsx)(l.A,{className:O.listIcon,children:(0,a.jsx)(t.icon,{fontSize:"small"})}),(0,a.jsx)(c.A,{children:(0,a.jsxs)(d.A,{variant:"body1",children:[t.label," "]})}),(0,a.jsx)(u.A,{children:H[t.id]??"-"})]},t.id))})})]},e.name))})}},47195(e,t,r){"use strict";r.d(t,{I5:()=>f,Kf:()=>y,N9:()=>d,V3:()=>p,gM:()=>l,gZ:()=>v,mT:()=>g,qA:()=>u,q_:()=>c,tN:()=>h,z:()=>m});var a=r(49185),n=r(58077),i=r(53320);function o(e){return 0===e.length?{$any:[]}:{relations:{$contains:{type:a.vv,targetRef:1===e.length?e[0]:{$in:e}}}}}function s(e,t){return 0===t.length?{$any:[]}:1===t.length?{[e]:t[0]}:{[e]:{$in:t}}}class l{value;label;constructor(e,t){this.value=e,this.label=t}getCatalogQuery(){return{kind:this.value}}getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}}class u{value;constructor(e){this.value=e}getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogQuery(){let e=this.getTypes();if(0!==e.length)return s("spec.type",e)}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}}class c{values;constructor(e){this.values=e}filterEntity(e){return this.values.every(t=>(e.metadata.tags??[]).includes(t))}getCatalogQuery(){if(0!==this.values.length)return 1===this.values.length?{"metadata.tags":{$contains:this.values[0]}}:{$all:this.values.map(e=>({"metadata.tags":{$contains:e}}))}}getCatalogFilters(){return{"metadata.tags":this.values}}toQueryValue(){return this.values}}class p{value;constructor(e){this.value=e}filterEntity(e){let t=this.toUpperArray(this.value.split(/\s/)),r=this.toUpperArray([e.metadata.tags]),a=e.spec?.targets,n=this.toUpperArray([e.metadata.name,e.metadata.title,e.spec?.profile?.displayName,e.spec?.target,...Array.isArray(a)?a:[]]);for(let e of t)if(r.every(t=>t!==e)&&n.every(t=>!t.includes(e)))return!1;return!0}getFullTextFilters(){return{term:this.value,fields:["metadata.name","metadata.title","spec.profile.displayName","spec.target","spec.targets"]}}toQueryValue(){return this.value}toUpperArray(e){return e.flat().filter(e=>!!e&&"string"==typeof e).map(e=>e.toUpperCase())}}class d{values;constructor(e){this.values=e.reduce((e,t)=>{try{return e.push((0,n.U2)((0,n.KU)(t,{defaultKind:"Group"}))),e}catch(t){return e}},[])}getCatalogQuery(){return o(this.values)}getCatalogFilters(){return{"relations.ownedBy":this.values}}filterEntity(e){return this.values.some(t=>(0,i.t)(e,a.vv).some(e=>(0,n.U2)(e)===t))}toQueryValue(){return this.values}}class f{values;constructor(e){this.values=e}getCatalogQuery(){return s("spec.lifecycle",this.values)}getCatalogFilters(){return{"spec.lifecycle":this.values}}filterEntity(e){return this.values.some(t=>e.spec?.lifecycle===t)}toQueryValue(){return this.values}}class m{values;constructor(e){this.values=e}getCatalogQuery(){return s("metadata.namespace",this.values)}getCatalogFilters(){return{"metadata.namespace":this.values}}filterEntity(e){return this.values.some(t=>e.metadata.namespace===t)}toQueryValue(){return this.values}}class h{value;refs;constructor(e,t){this.value=e,this.refs=t}static owned(e){return new h("owned",e)}static all(){return new h("all")}static starred(e){return new h("starred",e)}getCatalogQuery(){return"owned"===this.value?o(this.refs??[]):"starred"===this.value?{$any:(this.refs??[]).map(e=>{let{kind:t,namespace:r,name:a}=(0,n.KU)(e);return{kind:t,"metadata.namespace":r,"metadata.name":a}})}:void 0}getCatalogFilters(){return"owned"===this.value?{"relations.ownedBy":this.refs??[]}:"starred"===this.value?{"metadata.name":this.refs?.map(e=>(0,n.KU)(e).name)??[]}:{}}filterEntity(e){if("starred"===this.value)return this.refs?.includes((0,n.U2)(e))??!0;if("owned"===this.value){let t=(0,i.t)(e,a.vv);return this.refs?.some(e=>t.some(t=>(0,n.U2)(t)===e))??!1}return!0}toQueryValue(){return this.value}}class v{value;isOwnedEntity;isStarredEntity;constructor(e,t,r){this.value=e,this.isOwnedEntity=t,this.isStarredEntity=r}filterEntity(e){switch(this.value){case"owned":return this.isOwnedEntity(e);case"starred":return this.isStarredEntity(e);default:return!0}}toQueryValue(){return this.value}}class y{value;constructor(e){this.value=e}getCatalogQuery(){if(this.value)return{"metadata.annotations.backstage.io/orphan":"true"}}getCatalogFilters(){return this.value?{"metadata.annotations.backstage.io/orphan":String(this.value)}:{}}filterEntity(e){let t=e.metadata.annotations?.["backstage.io/orphan"];return void 0!==t&&this.value.toString()===t}}class g{value;constructor(e){this.value=e}filterEntity(e){let t=e?.status?.items?.length>0;return void 0!==t&&this.value===t}}},59378(e,t,r){"use strict";r.d(t,{B9:()=>j,nK:()=>b});var a=r(31085),n=r(50509),i=r(9135),o=r(20549),s=r(45250),l=r(45810),u=r.n(l),c=r(14041),p=r(18690),d=r(87290),f=r(48240),m=r(71581),h=r(76272),v=r(89729);let y=(0,i.tK)("entity-list-context"),g=(0,c.createContext)(void 0),j=e=>{let t=(0,m.A)(),r=(0,n.gf)(h.v),[i,l]=(0,c.useState)({}),j=(0,p.useLocation)(),b="none";!0===e.pagination?b="cursor":"object"==typeof e.pagination&&(b=e.pagination.mode??"cursor");let w="object"==typeof e.pagination?e.pagination.limit??20:20,{queryParameters:x,cursor:P,offset:A,limit:k}=(0,c.useMemo)(()=>{let e=u().parse(j.search,{ignoreQueryPrefix:!0,arrayLimit:1e4}),t=w;if("string"==typeof e.limit){let r=Number.parseInt(e.limit,10);isNaN(r)||(t=r)}let r="string"==typeof e.offset&&"offset"===b?Number.parseInt(e.offset,10):void 0;return{queryParameters:e.filters??{},cursor:"string"==typeof e.cursor&&"cursor"===b?e.cursor:void 0,offset:"offset"===b&&r&&!isNaN(r)?r:void 0,limit:t}},[b,j.search,w]),[S,C]=(0,c.useState)(P),[E,I]=(0,c.useState)(A),[K,O]=(0,c.useState)(k),[L,Y]=(0,c.useState)({backendEntities:[]}),[z,N]=(0,c.useState)(!0),[T,$]=(0,c.useState)(),[F,R]=(0,c.useState)(0),M=(0,c.useRef)(void 0),U=(0,c.useRef)(0),Q=(0,c.useMemo)(()=>{let e=i.kind?.value?.toLowerCase();return"user"===e||"group"===e?{...i,owners:void 0}:i},[i]),q=async()=>{let e,t,a=(0,s.compact)(Object.values(Q));if("none"!==b)if(S)e={cursor:S,limit:K},t=async()=>{let e=await r.queryEntities({cursor:S,limit:K,totalItems:"exclude"});return{backendEntities:e.items,pageInfo:e.pageInfo}};else{let n=(0,v.$3)(a);e={...n,limit:K,offset:E},t=async()=>{let e=await r.queryEntities({...n,limit:K,offset:E,totalItems:"exclude"});return{backendEntities:e.items,pageInfo:e.pageInfo}}}else{let n=(0,v.Rr)(a),{orderFields:i}=(0,v.$3)(a);e={...n,orderFields:i},t=async e=>{let t=[];for await(let a of r.streamEntities({...n,orderFields:i,totalItems:"exclude"})){if(e())break;t.push(...a)}return{backendEntities:t}}}if(0===a.length&&void 0===M.current&&!S)return void N(!1);if((0,s.isEqual)(e,M.current))return;M.current=e;let n=++U.current;N(!0),$(void 0);try{let e=await t(()=>n!==U.current);n===U.current&&Y(e)}catch(e){n===U.current&&(M.current=void 0,$(e))}finally{n===U.current&&N(!1)}};(0,f.A)(q,10,[Q,S,K,E,F]);let[{value:V,loading:B},W]=(0,d.A)(async()=>{if("none"===b)return;let e=(0,s.compact)(Object.values(Q));if(0===e.length)return;let t=(0,v.$3)(e);try{return(await r.queryEntities({...t,limit:0})).totalItems}catch{return}},[r,b,Q]);(0,f.A)(W,10,[Q,F]);let D=(0,c.useMemo)(()=>{let e=(0,s.compact)(Object.values(Q)),t=(0,v.be)(e);return L.backendEntities.filter(t)},[Q,L.backendEntities]);(0,c.useEffect)(()=>{if(!t()||0===Object.keys(i).length)return;let e=Object.keys(i).reduce((e,t)=>{let r=i[t];return r?.toQueryValue&&(e[t]=r.toQueryValue()),e},{}),r=u().parse(j.search,{ignoreQueryPrefix:!0,arrayLimit:1e4}),a=u().stringify({...r,filters:e,..."none"===b?{}:{cursor:S,limit:K,offset:E}},{addQueryPrefix:!0,arrayFormat:"repeat"}),n=`${window.location.pathname}${a}`;n!==`${window.location.pathname}${window.location.search}`&&window.history?.replaceState(null,document.title,n)},[S,t,K,j.search,E,i,b]);let J=(0,c.useCallback)(e=>{"cursor"===b?C(void 0):"offset"===b&&I(0),l(t=>{let r="function"==typeof e?e(t):e;return{...t,...r}})},[b]),_=(0,c.useCallback)(()=>{M.current=void 0,R(e=>e+1)},[]),G=(0,c.useMemo)(()=>{if("cursor"!==b)return;let e=L.pageInfo?.prevCursor,t=L.pageInfo?.nextCursor;return{prev:e?()=>C(e):void 0,next:t?()=>C(t):void 0}},[b,L.pageInfo]),H=(0,c.useMemo)(()=>({filters:i,entities:D,backendEntities:L.backendEntities,updateFilters:J,queryParameters:x,loading:z,error:T,pageInfo:G,totalItems:"none"===b?D.length:V??L.totalItems,totalItemsLoading:"none"!==b&&B,limit:K,offset:E,setLimit:O,setOffset:I,paginationMode:b,refresh:_}),[i,D,L,V,B,J,x,z,T,G,b,K,E,O,I,_]);return(0,a.jsx)(g.Provider,{value:H,children:(0,a.jsx)(y.Provider,{value:(0,o.B)({1:H}),children:e.children})})};function b(){let e=(0,i.qO)("entity-list-context"),t=(0,c.useContext)(g);if(e){let t=e.atVersion(1);if(!t)throw Error("EntityListContext v1 not available");return t}if(t)return t;throw Error("useEntityList must be used within EntityListProvider")}},75710(e,t,r){"use strict";r.d(t,{I:()=>u});var a=r(58077),n=r(50509),i=r(14041),o=r(10581),s=r(769);function l(e){return"string"==typeof e?e:(0,a.U2)(e)}function u(){let e=(0,n.gf)(s.a),t=(0,o.A)((0,i.useMemo)(()=>e.starredEntitie$(),[e]),new Set),r=(0,i.useCallback)(e=>t.has(l(e)),[t]);return{starredEntities:t,toggleStarredEntity:(0,i.useCallback)(t=>e.toggleStarred(l(t)).then(),[e]),isStarredEntity:r}}},236(e,t,r){"use strict";r.d(t,{EntityProcessingStatusPicker:()=>u.n,EntityTypePicker:()=>s.Q,EntityLifecyclePicker:()=>n.W,EntityTagPicker:()=>o.m,EntityOwnerPicker:()=>i.t,UserListPicker:()=>l.y,EntityKindPicker:()=>a.m,EntityNamespacePicker:()=>c.V});var a=r(42289),n=r(42858),i=r(8918),o=r(67762),s=r(68996),l=r(59302),u=r(53776),c=r(29314)},89729(e,t,r){"use strict";r.d(t,{$3:()=>l,Il:()=>o,Rr:()=>u,be:()=>c});var a=r(47195);function n(e){return!!e.getFullTextFilters}function i(e){return!!e.getOrderFilters}function o(e){let t=e.filter(e=>void 0!==e);if(0!==t.length)return 1===t.length?t[0]:{$all:t}}function s(e){let t={},r=[];for(let a of e)a.getCatalogQuery?r.push(a.getCatalogQuery()):a.getCatalogFilters&&Object.assign(t,a.getCatalogFilters());let a=o(r);return{...Object.keys(t).length>0&&{filter:t},...void 0!==a&&{query:a}}}function l(e){let t=s(e),r=e.find(n)?.getFullTextFilters(),a=e.find(i)?.getOrderFilters()||[{field:"metadata.name",order:"asc"}];return{...t,fullTextFilter:r,orderFields:a}}function u(e){return s(e.filter(e=>!(e instanceof a.q_||e instanceof a.N9||e instanceof a.I5||e instanceof a.z||e instanceof a.tN||e instanceof a.Kf||e instanceof a.V3||e instanceof a.gZ)))}function c(e){return t=>e.every(e=>!e.filterEntity||e.filterEntity(t))}},53320(e,t,r){"use strict";r.d(t,{t:()=>n});var a=r(58077);function n(e,t,r){let n=e?.relations?.filter(e=>e.type===t).map(e=>(0,a.KU)(e.targetRef))||[];return r?.kind&&(n=n.filter(e=>e.kind.toLowerCase()===r.kind.toLowerCase())),n}}}]);
|
|
2
|
+
//# sourceMappingURL=8877.eae6a09dd4f9.chunk.js.map
|