"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[3795],{27786:(J,$,s)=>{s.d($,{Z:()=>V});var o=s(68404),t=s(39904),y=s(31403);function p({dashboards:D,onImport:P,onRemove:N}){function x(g){return g.revision!==g.importedRevision?"Update":"Re-import"}return o.createElement("table",{className:"filter-table"},o.createElement("tbody",null,D.map((g,W)=>o.createElement("tr",{key:`${g.dashboardId}-${W}`},o.createElement("td",{className:"width-1"},o.createElement(t.J,{name:"apps"})),o.createElement("td",null,g.imported?o.createElement("a",{href:g.importedUrl},g.title):o.createElement("span",null,g.title)),o.createElement("td",{style:{textAlign:"right"}},g.imported?o.createElement(y.zx,{variant:"secondary",size:"sm",onClick:()=>P(g,!0)},x(g)):o.createElement(y.zx,{variant:"secondary",size:"sm",onClick:()=>P(g,!1)},"Import"),g.imported&&o.createElement(y.zx,{"aria-label":"Delete dashboard",icon:"trash-alt",variant:"destructive",size:"sm",onClick:()=>N(g)}))))))}const V=p},75260:(J,$,s)=>{s.d($,{SX:()=>p,IF:()=>H,oZ:()=>x,xh:()=>Z});var o=s(68404),t=s(24699),y=s(19985);function p({error:u}){const I=V(u);return o.createElement(y.C,{icon:"exclamation-triangle",text:"Disabled",color:"red",tooltip:I})}function V(u){switch(u){case t.w2.modifiedSignature:return"Plugin disabled due to modified content";case t.w2.invalidSignature:return"Plugin disabled due to invalid plugin signature";case t.w2.missingSignature:return"Plugin disabled due to missing plugin signature";case null:case void 0:return"Plugin disabled";default:return`Plugin disabled due to unknown error${u?`: ${u}`:""}`}}var D=s(72648),P=s(52423);const N=u=>P.css`
  background: ${u.colors.background.primary};
  border-color: ${u.colors.border.strong};
  color: ${u.colors.text.secondary};
`;function x(){const u=(0,D.wW)(N);return o.createElement(y.C,{text:"Installed",color:"orange",className:u})}var g=s(66121),W=s(52081),k=s(51613),S=s(31403);function H({plugin:u}){const I=(0,D.wW)(N),c=T=>{T.preventDefault(),window.open(`https://grafana.com/grafana/plugins/${u.id}?utm_source=grafana_catalog_learn_more`,"_blank","noopener,noreferrer")};return(0,g.v)("enterprise.plugins")?o.createElement(y.C,{text:"Enterprise",color:"blue"}):o.createElement(W.Lh,null,o.createElement(k.o,{status:u.signature}),o.createElement(y.C,{icon:"lock","aria-label":"lock icon",text:"Enterprise",color:"blue",className:I}),o.createElement(S.zx,{size:"sm",fill:"text",icon:"external-link-alt",onClick:c},"Learn more"))}function Z({plugin:u}){const I=(0,D.wW)(z);return u.hasUpdate&&!u.isCore&&u.type!==t.zV.renderer?o.createElement("p",{className:I.hasUpdate},"Update available!"):null}const z=u=>({hasUpdate:P.css`
      color: ${u.colors.text.secondary};
      font-size: ${u.typography.bodySmall.fontSize};
      margin-bottom: 0;
    `})},43795:(J,$,s)=>{s.d($,{Q:()=>Ke});var o=s(52423),t=s(68404),y=s(70356),p=s(72648),V=s(94893),D=s(45253),P=s(52081),N=s(79396),x=s(81168),g=s(39229),W=s(20231),k=s(38849),S=s(59210);const H=({versions:e=[],installedVersion:a})=>{const n=(0,p.wW)(Z),r=(0,S.RU)(e);return e.length===0?t.createElement("p",null,"No version history was found."):t.createElement("table",{className:n.table},t.createElement("thead",null,t.createElement("tr",null,t.createElement("th",null,"Version"),t.createElement("th",null,"Last updated"))),t.createElement("tbody",null,e.map(l=>{const i=a===l.version;return t.createElement("tr",{key:l.version},i?t.createElement("td",{className:n.currentVersion},l.version," (installed version)"):l.version===r?.version?t.createElement("td",null,l.version," (latest compatible version)"):t.createElement("td",null,l.version),t.createElement("td",{className:i?n.currentVersion:""},(0,k.E8)(l.createdAt)))})))},Z=e=>({container:o.css`
    padding: ${e.spacing(2,4,3)};
  `,table:o.css`
    table-layout: fixed;
    width: 100%;
    td,
    th {
      padding: ${e.spacing()} 0;
    }
    th {
      font-size: ${e.typography.h5.fontSize};
    }
  `,currentVersion:o.css`
    font-weight: ${e.typography.fontWeightBold};
  `});var z=s(22350),u=s(55111);const I=e=>(0,z.Z)(async()=>e&&e.isInstalled&&!e.isDisabled?(0,u.O)(e.id):null,[e?.id,e?.isInstalled,e?.isDisabled]);var c=s(48996),T=s(82897),ne=s(99227),F=s(54899),ae=s(11484),h=s(31403);class se extends t.PureComponent{constructor(a){super(a),this.element=null,this.preUpdateHook=()=>Promise.resolve(),this.postUpdateHook=()=>Promise.resolve(),this.update=()=>{const n=this.model.id;this.preUpdateHook().then(()=>{const r=(0,T.extend)({enabled:this.model.enabled,pinned:this.model.pinned,jsonData:this.model.jsonData,secureJsonData:this.model.secureJsonData},{});return(0,F.i)().post(`/api/plugins/${n}/settings`,r)}).then(this.postUpdateHook).then(r=>{window.location.href=window.location.href})},this.setPreUpdateHook=n=>{this.preUpdateHook=n},this.setPostUpdateHook=n=>{this.postUpdateHook=n},this.importDashboards=()=>((0,ne.d)("AppConfig","importDashboards()"),Promise.resolve()),this.enable=()=>{this.model.enabled=!0,this.model.pinned=!0,this.update()},this.disable=()=>{this.model.enabled=!1,this.model.pinned=!1,this.update()},this.state={angularCtrl:null,refresh:0}}componentDidMount(){setTimeout(()=>{this.setState({refresh:this.state.refresh+1})},5)}componentDidUpdate(a){if(!this.element||this.state.angularCtrl)return;this.model=(0,T.cloneDeep)(this.props.app.meta);const n=(0,ae.w)(),r='<plugin-component type="app-config-ctrl"></plugin-component>',l={ctrl:this,isAppConfigCtrl:!0},i=n.load(this.element,l,r);this.setState({angularCtrl:i})}render(){const a=this.model,n=(0,o.css)({marginRight:"8px"});return t.createElement("div",null,t.createElement("div",{ref:r=>this.element=r}),t.createElement("br",null),t.createElement("br",null),a&&t.createElement("div",{className:"gf-form"},!a.enabled&&t.createElement(h.zx,{variant:"primary",onClick:this.enable,className:n},"Enable"),a.enabled&&t.createElement(h.zx,{variant:"primary",onClick:this.update,className:n},"Update"),a.enabled&&t.createElement(h.zx,{variant:"destructive",onClick:this.disable,className:n},"Disable")))}}var M=s(25318),L=s(77582),re=s(27786);class le extends t.PureComponent{constructor(a){super(a),this.importAll=()=>{this.importNext(0)},this.importNext=n=>{const{dashboards:r}=this.state;return this.import(r[n],!0).then(()=>n+1<r.length?new Promise(l=>{setTimeout(()=>{this.importNext(n+1).then(()=>{l()})},500)}):Promise.resolve())},this.import=(n,r)=>{const{plugin:l,datasource:i}=this.props,d={pluginId:l.id,path:n.path,overwrite:r,inputs:[]};return i&&d.inputs.push({name:"*",type:"datasource",pluginId:i.meta.id,value:i.name}),(0,F.i)().post("/api/dashboards/import",d).then(f=>{L.h$.emit(M.SI.alertSuccess,["Dashboard Imported",n.title]),(0,T.extend)(n,f),this.setState({dashboards:[...this.state.dashboards]})})},this.remove=n=>{(0,F.i)().delete("/api/dashboards/uid/"+n.uid).then(()=>{n.imported=!1,this.setState({dashboards:[...this.state.dashboards]})})},this.state={loading:!0,dashboards:[]}}async componentDidMount(){const a=this.props.plugin.id;(0,F.i)().get(`/api/plugins/${a}/dashboards`).then(n=>{this.setState({dashboards:n,loading:!1})})}render(){const{loading:a,dashboards:n}=this.state;return a?t.createElement("div",null,"loading..."):!n||!n.length?t.createElement("div",null,"No dashboards are included with this plugin"):t.createElement("div",{className:"gf-form-group"},t.createElement(re.Z,{dashboards:n,onImport:this.import,onRemove:this.remove}))}}var ie=s(89050),oe=s(53786),G=s(35645),ce=s(67487),de=s(69142),ue=s(16526),me=s(64823);function ge({plugin:e}){const a=(0,p.wW)(fe),n=(0,t.useMemo)(()=>({query:"*",panel_type:e.id,kind:["panel"]}),[e]),r=(0,z.Z)(()=>(0,me.getGrafanaSearcher)().search(n),[n]),l=r.value;return l?.totalRows?t.createElement("div",{className:a.wrap},t.createElement("div",{className:a.info},e.name," is used ",t.createElement("b",null,l.totalRows)," times."),t.createElement(ie.Z,null,({width:i,height:d})=>t.createElement(ue.Q,{response:l,width:i,height:d,clearSelection:()=>{},keyboardEvents:(0,oe.of)(),onTagSelected:()=>{}}))):r.loading?t.createElement(ce.$,null):G.v.featureToggles.panelTitleSearch?t.createElement(de.Z,{title:`${e.name} is not used in any dashboards yet`,buttonIcon:"plus",buttonTitle:"Create Dashboard",buttonLink:`dashboard/new?panelType=${e.id}&editPanel=1`}):t.createElement(D.b,{title:"Missing feature toggle: panelTitleSearch"},"Plugin usage requires the new search index to find usage across dashboards")}const fe=e=>({wrap:o.css`
      width: 100%;
      height: 100%;
    `,info:o.css`
      padding-bottom: 30px;
    `});function he({plugin:e,queryParams:a,pageId:n}){const r=(0,p.wW)(pe),{value:l}=I(e);if(n===c.tu.OVERVIEW)return t.createElement("div",{className:(0,o.cx)(r.readme,r.container),dangerouslySetInnerHTML:{__html:e.details?.readme??"No plugin help or readme markdown file was found"}});if(n===c.tu.VERSIONS)return t.createElement("div",{className:r.container},t.createElement(H,{versions:e.details?.versions,installedVersion:e.installedVersion}));if(n===c.tu.CONFIG&&l?.angularConfigCtrl)return t.createElement("div",{className:r.container},t.createElement(se,{app:l}));if(l?.configPages){for(const i of l.configPages)if(n===i.id)return t.createElement("div",{className:r.container},t.createElement(W.b,{meta:l.meta},t.createElement(i.body,{plugin:l,query:a})))}return n===c.tu.USAGE&&l?t.createElement("div",{className:r.container},t.createElement(ge,{plugin:l?.meta})):n===c.tu.DASHBOARDS&&l?t.createElement("div",{className:r.container},t.createElement(le,{plugin:l?.meta})):t.createElement("div",{className:r.container},t.createElement("p",null,"Page not found."))}const pe=e=>({container:o.css``,readme:o.css`
    & img {
      max-width: 100%;
    }

    h1,
    h2,
    h3 {
      margin-top: ${e.spacing(3)};
      margin-bottom: ${e.spacing(2)};
    }

    *:first-child {
      margin-top: 0;
    }

    li {
      margin-left: ${e.spacing(2)};
      & > p {
        margin: ${e.spacing()} 0;
      }
    }

    a {
      color: ${e.colors.text.link};

      &:hover {
        color: ${e.colors.text.link};
        text-decoration: underline;
      }
    }
  `});var m=s(24699),Q=s(68183);function ve({className:e,plugin:a}){return a.isDisabled?t.createElement(D.b,{severity:"error",title:"Plugin disabled",className:e,"aria-label":Q.wl.pages.PluginPage.disabledInfo},Ee(a.error),t.createElement("p",null,"Please contact your server administrator to get this resolved."),t.createElement("a",{href:"https://grafana.com/docs/grafana/latest/administration/cli/#plugins-commands",className:"external-link",target:"_blank",rel:"noreferrer"},"Read more about managing plugins")):null}function Ee(e){switch(e){case m.w2.modifiedSignature:return t.createElement("p",null,"Grafana Labs checks each plugin to verify that it has a valid digital signature. While doing this, we discovered that the content of this plugin does not match its signature. We can not guarantee the trustworthy of this plugin and have therefore disabled it. We recommend you to reinstall the plugin to make sure you are running a verified version of this plugin.");case m.w2.invalidSignature:return t.createElement("p",null,"Grafana Labs checks each plugin to verify that it has a valid digital signature. While doing this, we discovered that it was invalid. We can not guarantee the trustworthy of this plugin and have therefore disabled it. We recommend you to reinstall the plugin to make sure you are running a verified version of this plugin.");case m.w2.missingSignature:return t.createElement("p",null,"Grafana Labs checks each plugin to verify that it has a valid digital signature. While doing this, we discovered that there is no signature for this plugin. We can not guarantee the trustworthy of this plugin and have therefore disabled it. We recommend you to reinstall the plugin to make sure you are running a verified version of this plugin.");default:return t.createElement("p",null,"We failed to run this plugin due to an unkown reason and have therefore disabled it. We recommend you to reinstall the plugin to make sure you are running a working version of this plugin.")}}function ye({className:e,plugin:a}){const n=a.signature===m.Xy.valid,r=a.signature===m.Xy.internal,l=a.isDisabled&&be(a.error);return n||r||l?null:t.createElement(D.b,{severity:"warning",title:"Invalid plugin signature","aria-label":Q.wl.pages.PluginPage.signatureInfo,className:e},t.createElement("p",null,"Grafana Labs checks each plugin to verify that it has a valid digital signature. Plugin signature verification is part of our security measures to ensure plugins are safe and trustworthy. Grafana Labs can\u2019t guarantee the integrity of this unsigned plugin. Ask the plugin author to request it to be signed."),t.createElement("a",{href:"https://grafana.com/docs/grafana/latest/plugins/plugin-signatures/",className:"external-link",target:"_blank",rel:"noreferrer"},"Read more about plugins signing."))}function be(e){switch(e){case m.w2.invalidSignature:case m.w2.missingSignature:case m.w2.modifiedSignature:return!0;default:return!1}}var R=s(84532);const Pe=(e,a)=>{const{loading:n,error:r,value:l}=I(e),{pathname:i}=(0,y.TH)(),d=Se(e,l),f=i.substring(0,i.lastIndexOf("/")),A=Boolean(e?.isPublished),E=a||d,B=(0,t.useMemo)(()=>{const U=e&&L.Vt.hasAccessInMetadata(x.AccessControlAction.PluginsWrite,e,(0,R.RN)()),b=[];if(A&&b.push({text:c.xc.VERSIONS,id:c.tu.VERSIONS,icon:"history",url:`${i}?page=${c.tu.VERSIONS}`,active:c.tu.VERSIONS===E}),!l||(G.v.featureToggles.panelTitleSearch&&l.meta.type===m.zV.panel&&b.push({text:c.xc.USAGE,icon:"list-ul",id:c.tu.USAGE,url:`${i}?page=${c.tu.USAGE}`,active:c.tu.USAGE===E}),!U))return b;if(l.meta.type===m.zV.app){if(l.angularConfigCtrl&&b.push({text:"Config",icon:"cog",id:c.tu.CONFIG,url:`${i}?page=${c.tu.CONFIG}`,active:c.tu.CONFIG===E}),l.configPages)for(const v of l.configPages)b.push({text:v.title,icon:v.icon,id:v.id,url:`${i}?page=${v.id}`,active:v.id===E});l.meta.includes?.find(v=>v.type===m.$_.dashboard)&&b.push({text:"Dashboards",icon:"apps",id:c.tu.DASHBOARDS,url:`${i}?page=${c.tu.DASHBOARDS}`,active:c.tu.DASHBOARDS===E})}return b},[e,l,i,A,E]),O={text:e?.name??"",img:e?.info.logos.small,breadcrumbs:[{title:"Plugins",url:f}],children:[{text:c.xc.OVERVIEW,icon:"file-alt",id:c.tu.OVERVIEW,url:`${i}?page=${c.tu.OVERVIEW}`,active:c.tu.OVERVIEW===E},...B]};return{error:r,loading:n,navModel:O,activePageId:E}};function Se(e,a){return!e||!a||!L.Vt.hasAccessInMetadata(x.AccessControlAction.PluginsWrite,e,(0,R.RN)())||a.meta.type!==m.zV.app?c.tu.OVERVIEW:a.angularConfigCtrl?c.tu.CONFIG:a.configPages?.length?a.configPages[0].id:c.tu.OVERVIEW}var De=s(73354);function xe({plugin:e}){const{value:a}=I(e);if(!a||!L.Vt.hasAccessInMetadata(x.AccessControlAction.PluginsWrite,e,(0,R.RN)()))return null;const{enabled:n,jsonData:r}=a?.meta,l=()=>X(e.id,{enabled:!0,pinned:!0,jsonData:r}),i=()=>{X(e.id,{enabled:!1,pinned:!1,jsonData:r})};return t.createElement(t.Fragment,null,!n&&t.createElement(h.zx,{variant:"primary",onClick:l},"Enable"),n&&t.createElement(h.zx,{variant:"destructive",onClick:i},"Disable"))}const X=async(e,a)=>{try{await(0,De.P6)(e,a),window.location.reload()}catch(n){console.error("Error while updating the plugin",n)}};var Ce=s(40897);function Ne({plugin:e}){const a=(0,x.useDispatch)(),n=(0,t.useCallback)(()=>{const r={name:e.name,id:e.id};a((0,Ce.J_)(r))},[a,e]);return(0,R.Gg)()?t.createElement(h.zx,{variant:"primary",onClick:n},"Create a ",e.name," data source"):null}function Ie({plugin:e}){if(!e.isInstalled||e.isDisabled)return null;switch(e.type){case m.zV.datasource:return t.createElement(Ne,{plugin:e});case m.zV.app:return t.createElement(xe,{plugin:e});default:return null}}var Ae=s(66121),w=s(39904),C=s(74509);const Te=({plugin:e,pluginStatus:a,latestCompatibleVersion:n})=>{const r=(0,p.wW)(Ue),l=G.v.pluginAdminExternalManageEnabled,i=L.Vt.hasAccess(x.AccessControlAction.PluginsInstall,(0,R.bO)()),d=(0,C.y9)(),f=Boolean(n);if(e.type===m.zV.renderer)return t.createElement("div",{className:r.message},"Renderer plugins cannot be managed by the Plugin Catalog.");if(e.type===m.zV.secretsmanager)return t.createElement("div",{className:r.message},"Secrets manager plugins cannot be managed by the Plugin Catalog.");if(e.isEnterprise&&!(0,Ae.v)("enterprise.plugins"))return t.createElement(P.Lh,{height:"auto",align:"center"},t.createElement("span",{className:r.message},"No valid Grafana Enterprise license detected."),t.createElement(h.Qj,{href:`${(0,S.Uj)(e.id)}?utm_source=grafana_catalog_learn_more`,target:"_blank",rel:"noopener noreferrer",size:"sm",fill:"text",icon:"external-link-alt"},"Learn more"));if(e.isDev)return t.createElement("div",{className:r.message},"This is a development build of the plugin and can't be uninstalled.");if(!i&&!l){const A=`You do not have permission to ${a} this plugin.`;return t.createElement("div",{className:r.message},A)}return e.isPublished?f?d?null:t.createElement("div",{className:r.message},"The install controls have been disabled because the Grafana server cannot access grafana.com."):t.createElement("div",{className:r.message},t.createElement(w.J,{name:"exclamation-triangle"}),"\xA0This plugin doesn't support your version of Grafana."):t.createElement("div",{className:r.message},t.createElement(w.J,{name:"exclamation-triangle"})," This plugin is not published to"," ",t.createElement("a",{href:"https://www.grafana.com/plugins",target:"__blank",rel:"noreferrer"},"grafana.com/plugins")," ","and can't be managed via the catalog.")},Ue=e=>({message:o.css`
      color: ${e.colors.text.secondary};
    `});var $e=s(37932),Ve=s(98102),j=s(97063),We=s(96044);function Le({plugin:e,pluginStatus:a,latestCompatibleVersion:n}){const[r]=(0,We.K)(),l=(0,y.TH)(),{isInstalling:i,error:d}=(0,C.IS)(),{isUninstalling:f,error:A}=(0,C.wq)(),E=(0,C.x3)(),B=(0,C.S1)(),[O,U]=(0,t.useState)(!1),b=()=>U(!0),v=()=>U(!1),_=f?"Uninstalling":"Uninstall",_e=async()=>{await E(e.id,n?.version),d||j.Z.emit(M.SI.alertSuccess,[`Installed ${e.name}`])},ee=async()=>{if(v(),await B(e.id),!A){const te=r.page;te!==c.tu.OVERVIEW&&te!==c.tu.VERSIONS&&$e.E1.replace(`${l.pathname}?page=${c.tu.OVERVIEW}`),j.Z.emit(M.SI.alertSuccess,[`Uninstalled ${e.name}`])}},et=async()=>{await E(e.id,n?.version,!0),d||j.Z.emit(M.SI.alertSuccess,[`Updated ${e.name}`])};return a===c.vF.UNINSTALL?t.createElement(t.Fragment,null,t.createElement(Ve.s,{isOpen:O,title:`Uninstall ${e.name}`,body:"Are you sure you want to uninstall this plugin?",confirmText:"Confirm",icon:"exclamation-triangle",onConfirm:ee,onDismiss:v}),t.createElement(P.Lh,{align:"flex-start",width:"auto",height:"auto"},t.createElement(h.zx,{variant:"destructive",disabled:f,onClick:b},_))):a===c.vF.UPDATE?t.createElement(P.Lh,{align:"flex-start",width:"auto",height:"auto"},t.createElement(h.zx,{disabled:i,onClick:et},i?"Updating":"Update"),t.createElement(h.zx,{variant:"destructive",disabled:f,onClick:ee},_)):t.createElement(h.zx,{disabled:i,onClick:_e},i?"Installing":"Install")}function Re({pluginId:e,pluginStatus:a}){const n=`${(0,S.Uj)(e)}/?tab=installation`;return a===c.vF.UPDATE?t.createElement(P.Lh,{height:"auto"},t.createElement(h.Qj,{href:n,target:"_blank",rel:"noopener noreferrer"},"Update via grafana.com"),t.createElement(h.Qj,{variant:"destructive",href:n,target:"_blank",rel:"noopener noreferrer"},"Uninstall via grafana.com")):a===c.vF.UNINSTALL?t.createElement(h.Qj,{variant:"destructive",href:n,target:"_blank",rel:"noopener noreferrer"},"Uninstall via grafana.com"):t.createElement(h.Qj,{href:n,target:"_blank",rel:"noopener noreferrer"},"Install via grafana.com")}const we=({plugin:e})=>{const a=(0,C.y9)(),n=(0,S.RU)(e?.details?.versions);if(!e)return null;const r=(0,S.HT)(e,a,n),l=G.v.pluginAdminExternalManageEnabled,i=e.isInstalled?e.hasUpdate?c.vF.UPDATE:c.vF.UNINSTALL:c.vF.INSTALL,d=e.isCore||e.isDisabled||!(0,S.fG)()||r;return t.createElement(t.Fragment,null,!d&&t.createElement(t.Fragment,null,l?t.createElement(Re,{pluginId:e.id,pluginStatus:i}):t.createElement(Le,{plugin:e,latestCompatibleVersion:n,pluginStatus:i})),t.createElement(Ie,{plugin:e}))},Be=({plugin:e})=>{const a=(0,C.y9)(),n=(0,p.wW)(Oe);if(!e)return null;const r=(0,S.RU)(e.details?.versions),l=e.isInstalled?e.hasUpdate?c.vF.UPDATE:c.vF.UNINSTALL:c.vF.INSTALL;return t.createElement("div",{className:n.subtitle},e?.description&&t.createElement("div",null,e?.description),e?.details?.links&&e.details.links.length>0&&t.createElement("span",null,e.details.links.map((i,d)=>t.createElement(t.Fragment,{key:d},d>0&&" | ",t.createElement("a",{href:i.url,className:"external-link"},i.name)))),(0,S.HT)(e,a,r)&&t.createElement(Te,{plugin:e,pluginStatus:l,latestCompatibleVersion:r}))},Oe=e=>({subtitle:o.css`
      display: flex;
      flex-direction: column;
      gap: ${e.spacing(1)};
    `});var ze=s(75260),Fe=s(26418);function Me({plugin:e,latestCompatibleVersion:a,className:n}){const r=(0,p.wW)(Ge),l=e.details?.pluginDependencies,i=e.isInstalled?e.details?.grafanaDependency:a?.grafanaDependency||e.details?.grafanaDependency;return!i&&(!l||!l.length)?null:t.createElement(Fe.Stack,{gap:1},Boolean(i)&&t.createElement("div",{className:r.depBadge},t.createElement(w.J,{name:"grafana",className:r.icon}),"Grafana ",i),l&&l.length>0&&t.createElement("div",null,l.map(f=>t.createElement("span",{className:r.depBadge,key:f.name},t.createElement(w.J,{name:c.Co[f.type],className:r.icon}),f.name," ",f.version))))}const Ge=e=>({dependencyTitle:o.css`
      margin-right: ${e.spacing(.5)};

      &::after {
        content: '';
        padding: 0;
      }
    `,depBadge:(0,o.css)({display:"flex",alignItems:"flex-start"}),icon:o.css`
      color: ${e.colors.text.secondary};
      margin-right: ${e.spacing(.5)};
    `});var ke=s(51613),He=s(19985);const K={[m._Z.grafana]:"grafana",[m._Z.commercial]:"shield",[m._Z.community]:"shield",DEFAULT:"shield-exclamation"};function Ze({signatureType:e,signatureOrg:a=""}){const n=(0,p.wW)(q);if(!e&&!a)return null;const r=e===m._Z.grafana?"Grafana Labs":(0,T.capitalize)(e),l=K[e||""]||K.DEFAULT;return t.createElement(t.Fragment,null,t.createElement(Y,null,t.createElement("div",{className:n.detailsWrapper},t.createElement("strong",{className:n.strong},"Level:\xA0"),t.createElement(w.J,{size:"xs",name:l}),"\xA0",r)),t.createElement(Y,null,t.createElement("strong",{className:n.strong},"Signed by:")," ",a))}const Y=({children:e})=>{const a=(0,p.wW)(q);return t.createElement(He.C,{color:"green",className:a.badge,text:e})},q=e=>({badge:o.css`
    background-color: ${e.colors.background.canvas};
    border-color: ${e.colors.border.strong};
    color: ${e.colors.text.secondary};
    white-space: nowrap;
  `,detailsWrapper:o.css`
    align-items: center;
    display: flex;
  `,strong:o.css`
    color: ${e.colors.text.primary};
  `,icon:o.css`
    margin-right: ${e.spacing(.5)};
  `});function je({plugin:e}){const a=(0,p.wW)(Je),n=e.signature===m.Xy.valid;return t.createElement("div",{className:a.container},t.createElement("a",{href:"https://grafana.com/docs/grafana/latest/plugins/plugin-signatures/",target:"_blank",rel:"noreferrer",className:a.link},t.createElement(ke.o,{status:e.signature})),n&&t.createElement(Ze,{signatureType:e.signatureType,signatureOrg:e.signatureOrg}))}const Je=e=>({container:o.css`
      display: flex;
      flex-wrap: wrap;
      gap: ${e.spacing(.5)};
    `,link:o.css`
      display: inline-flex;
      align-items: center;
    `}),Qe=e=>{const a=[];if(!e)return a;const n=(0,S.RU)(e.details?.versions),r=e.installedVersion||n?.version;Boolean(r)&&a.push({label:"Version",value:r}),Boolean(e.orgName)&&a.push({label:"From",value:e.orgName}),(!e.signatureType||e.signatureType===m._Z.community||e.signatureType===m._Z.commercial)&&Boolean(e.downloads>0)&&a.push({label:"Downloads",value:new Intl.NumberFormat().format(e.downloads)});const i=e.details?.pluginDependencies;return!(e.isInstalled?e.details?.grafanaDependency:n?.grafanaDependency||e.details?.grafanaDependency)&&(!i||!i.length)||a.push({label:"Dependencies",value:t.createElement(Me,{plugin:e,latestCompatibleVersion:n})}),e.isDisabled&&a.push({label:"Status",value:t.createElement(ze.SX,{error:e.error})}),a.push({label:"Signature",value:t.createElement(je,{plugin:e})}),a},tt=e=>({subtitle:css`
      display: flex;
      flex-direction: column;
      gap: ${e.spacing(1)};
    `}),Xe=e=>{const a=Qe(e);return{actions:t.createElement(we,{plugin:e}),info:a,subtitle:t.createElement(Be,{plugin:e})}};function Ke({pluginId:e,navId:a="plugins",notFoundComponent:n=t.createElement(qe,null),notFoundNavModel:r={text:"Unknown plugin",subTitle:"The requested ID does not belong to any plugin",active:!0}}){const l=(0,y.TH)(),i=new URLSearchParams(l.search),d=(0,C.bJ)(e),{navModel:f,activePageId:A}=Pe(d,i.get("page")),{actions:E,info:B,subtitle:O}=Xe(d),{isLoading:U}=(0,C.ZV)(),{isLoading:b}=(0,C.bt)(),v=(0,p.wW)(Ye);return U||b?t.createElement(N.T,{navId:a,pageNav:{text:"",active:!0}},t.createElement(g.a,null)):d?t.createElement(N.T,{navId:a,pageNav:f,actions:E,subTitle:O,info:B},t.createElement(N.T.Contents,null,t.createElement(V.I,{className:v.tabContent},t.createElement(ye,{plugin:d,className:v.alert}),t.createElement(ve,{plugin:d,className:v.alert}),t.createElement(he,{queryParams:Object.fromEntries(i),plugin:d,pageId:A})))):t.createElement(N.T,{navId:a,pageNav:r},n)}const Ye=e=>({alert:o.css`
      margin-bottom: ${e.spacing(2)};
    `,subtitle:o.css`
      display: flex;
      flex-direction: column;
      gap: ${e.spacing(1)};
    `,tabContent:o.css`
      overflow: auto;
      height: 100%;
    `});function qe(){return t.createElement(P.Ar,{justify:"center",align:"center"},t.createElement(D.b,{severity:x.AppNotificationSeverity.Warning,title:"Plugin not found"},"That plugin cannot be found. Please check the url is correct or ",t.createElement("br",null),"go to the ",t.createElement("a",{href:"/plugins"},"plugin catalog"),"."))}}}]);

//# sourceMappingURL=3795.6c3815d0985f4e7b99c0.js.map