"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[8644],{512:(Q,V,r)=>{r.d(V,{Z:()=>W});var i=r(65237),t=r(6335),P=r(48389);function p({dashboards:D,onImport:E,onRemove:C}){function I(f){return f.revision!==f.importedRevision?"Update":"Re-import"}return i.createElement("table",{className:"filter-table"},i.createElement("tbody",null,D.map((f,L)=>i.createElement("tr",{key:`${f.dashboardId}-${L}`},i.createElement("td",{className:"width-1"},i.createElement(t.J,{name:"apps"})),i.createElement("td",null,f.imported?i.createElement("a",{href:f.importedUrl},f.title):i.createElement("span",null,f.title)),i.createElement("td",{style:{textAlign:"right"}},f.imported?i.createElement(P.zx,{variant:"secondary",size:"sm",onClick:()=>E(f,!0)},I(f)):i.createElement(P.zx,{variant:"secondary",size:"sm",onClick:()=>E(f,!1)},"Import"),f.imported&&i.createElement(P.zx,{"aria-label":"Delete dashboard",icon:"trash-alt",variant:"destructive",size:"sm",onClick:()=>C(f)}))))))}const W=p},22861:(Q,V,r)=>{r.d(V,{SX:()=>p,IF:()=>Z,oZ:()=>I,xh:()=>j});var i=r(65237),t=r(80610),P=r(66434);function p({error:u}){const A=W(u);return i.createElement(P.C,{icon:"exclamation-triangle",text:"Disabled",color:"red",tooltip:A})}function W(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=r(93048),E=r(60234);const C=u=>E.css`
  background: ${u.colors.background.primary};
  border-color: ${u.colors.border.strong};
  color: ${u.colors.text.secondary};
`;function I(){const u=(0,D.wW)(C);return i.createElement(P.C,{text:"Installed",color:"orange",className:u})}var f=r(75764),L=r(6741),H=r(16291),N=r(48389);function Z({plugin:u}){const A=(0,D.wW)(C),o=T=>{T.preventDefault(),window.open(`https://grafana.com/grafana/plugins/${u.id}?utm_source=grafana_catalog_learn_more`,"_blank","noopener,noreferrer")};return(0,f.v)("enterprise.plugins")?i.createElement(P.C,{text:"Enterprise",color:"blue"}):i.createElement(L.Lh,null,i.createElement(H.o,{status:u.signature}),i.createElement(P.C,{icon:"lock","aria-label":"lock icon",text:"Enterprise",color:"blue",className:A}),i.createElement(N.zx,{size:"sm",fill:"text",icon:"external-link-alt",onClick:o},"Learn more"))}function j({plugin:u}){const A=(0,D.wW)(z);return u.hasUpdate&&!u.isCore&&u.type!==t.zV.renderer?i.createElement("p",{className:A.hasUpdate},"Update available!"):null}const z=u=>({hasUpdate:E.css`
      color: ${u.colors.text.secondary};
      font-size: ${u.typography.bodySmall.fontSize};
      margin-bottom: 0;
    `})},48644:(Q,V,r)=>{r.d(V,{Q:()=>st});var i=r(60234),t=r(65237),P=r(60894),p=r(93048),W=r(5565),D=r(88347),E=r(6741),C=r(38992),I=r(3315),f=r(20219),L=r(84262),H=r(25641),N=r(78993);const Z=({versions:e=[],installedVersion:a})=>{const n=(0,p.wW)(j),s=(0,N.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 c=a===l.version;return t.createElement("tr",{key:l.version},c?t.createElement("td",{className:n.currentVersion},l.version," (installed version)"):l.version===s?.version?t.createElement("td",null,l.version," (latest compatible version)"):t.createElement("td",null,l.version),t.createElement("td",{className:c?n.currentVersion:""},(0,H.E8)(l.createdAt)))})))},j=e=>({container:i.css`
    padding: ${e.spacing(2,4,3)};
  `,table:i.css`
    table-layout: fixed;
    width: 100%;
    td,
    th {
      padding: ${e.spacing()} 0;
    }
    th {
      font-size: ${e.typography.h5.fontSize};
    }
  `,currentVersion:i.css`
    font-weight: ${e.typography.fontWeightBold};
  `});var z=r(15804),u=r(77430);const A=e=>(0,z.Z)(async()=>e&&e.isInstalled&&!e.isDisabled?(0,u.O)(e.id):null,[e?.id,e?.isInstalled,e?.isDisabled]);var o=r(54081),T=r(89949),ie=r(90806),M=r(55041),oe=r(41227),v=r(48389);class ce 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 s=(0,T.extend)({enabled:this.model.enabled,pinned:this.model.pinned,jsonData:this.model.jsonData,secureJsonData:this.model.secureJsonData},{});return(0,M.i)().post(`/api/plugins/${n}/settings`,s)}).then(this.postUpdateHook).then(s=>{window.location.href=window.location.href})},this.setPreUpdateHook=n=>{this.preUpdateHook=n},this.setPostUpdateHook=n=>{this.postUpdateHook=n},this.importDashboards=()=>((0,ie.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,oe.w)(),s='<plugin-component type="app-config-ctrl"></plugin-component>',l={ctrl:this,isAppConfigCtrl:!0},c=n.load(this.element,l,s);this.setState({angularCtrl:c})}render(){const a=this.model,n=(0,i.css)({marginRight:"8px"});return t.createElement("div",null,t.createElement("div",{ref:s=>this.element=s}),t.createElement("br",null),t.createElement("br",null),a&&t.createElement("div",{className:"gf-form"},!a.enabled&&t.createElement(v.zx,{variant:"primary",onClick:this.enable,className:n},"Enable"),a.enabled&&t.createElement(v.zx,{variant:"primary",onClick:this.update,className:n},"Update"),a.enabled&&t.createElement(v.zx,{variant:"destructive",onClick:this.disable,className:n},"Disable")))}}var F=r(74154),R=r(63969),de=r(512);class ue extends t.PureComponent{constructor(a){super(a),this.importAll=()=>{this.importNext(0)},this.importNext=n=>{const{dashboards:s}=this.state;return this.import(s[n],!0).then(()=>n+1<s.length?new Promise(l=>{setTimeout(()=>{this.importNext(n+1).then(()=>{l()})},500)}):Promise.resolve())},this.import=(n,s)=>{const{plugin:l,datasource:c}=this.props,d={pluginId:l.id,path:n.path,overwrite:s,inputs:[]};return c&&d.inputs.push({name:"*",type:"datasource",pluginId:c.meta.id,value:c.name}),(0,M.i)().post("/api/dashboards/import",d).then(g=>{R.h$.emit(F.SI.alertSuccess,["Dashboard Imported",n.title]),(0,T.extend)(n,g),this.setState({dashboards:[...this.state.dashboards]})})},this.remove=n=>{(0,M.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,M.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(de.Z,{dashboards:n,onImport:this.import,onRemove:this.remove}))}}var me=r(55925),ge=r(45383),k=r(49784),fe=r(44380),he=r(76044),pe=r(56540),ve=r(5294);function Ee({plugin:e}){const a=(0,p.wW)(ye),n=(0,t.useMemo)(()=>({query:"*",panel_type:e.id,kind:["panel"]}),[e]),s=(0,z.Z)(()=>(0,ve.getGrafanaSearcher)().search(n),[n]),l=s.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(me.Z,null,({width:c,height:d})=>t.createElement(pe.Q,{response:l,width:c,height:d,clearSelection:()=>{},keyboardEvents:(0,ge.of)(),onTagSelected:()=>{}}))):s.loading?t.createElement(fe.$,null):k.v.featureToggles.panelTitleSearch?t.createElement(he.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 ye=e=>({wrap:i.css`
      width: 100%;
      height: 100%;
    `,info:i.css`
      padding-bottom: 30px;
    `});function be({plugin:e,queryParams:a,pageId:n}){const s=(0,p.wW)(Pe),{value:l}=A(e);if(n===o.tu.OVERVIEW)return t.createElement("div",{className:(0,i.cx)(s.readme,s.container),dangerouslySetInnerHTML:{__html:e.details?.readme??"No plugin help or readme markdown file was found"}});if(n===o.tu.VERSIONS)return t.createElement("div",{className:s.container},t.createElement(Z,{versions:e.details?.versions,installedVersion:e.installedVersion}));if(n===o.tu.CONFIG&&l?.angularConfigCtrl)return t.createElement("div",{className:s.container},t.createElement(ce,{app:l}));if(l?.configPages){for(const c of l.configPages)if(n===c.id)return t.createElement("div",{className:s.container},t.createElement(L.b,{meta:l.meta},t.createElement(c.body,{plugin:l,query:a})))}return n===o.tu.USAGE&&l?t.createElement("div",{className:s.container},t.createElement(Ee,{plugin:l?.meta})):n===o.tu.DASHBOARDS&&l?t.createElement("div",{className:s.container},t.createElement(ue,{plugin:l?.meta})):t.createElement("div",{className:s.container},t.createElement("p",null,"Page not found."))}const Pe=e=>({container:i.css``,readme:i.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;
      }
    }

    table {
      table-layout: fixed;
      width: 100%;

      td,
      th {
        overflow-x: auto;
        padding: ${e.spacing(.5)} ${e.spacing(1)};
      }

      table,
      th,
      td {
        border: 1px solid ${e.colors.border.medium};
        border-collapse: collapse;
      }
    }
  `});var m=r(80610),X=r(92917);function Se({className:e,plugin:a}){return a.isDisabled?t.createElement(D.b,{severity:"error",title:"Plugin disabled",className:e,"aria-label":X.wl.pages.PluginPage.disabledInfo},xe(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 xe(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 De({className:e,plugin:a}){const n=a.signature===m.Xy.valid,s=a.signature===m.Xy.internal,l=a.isDisabled&&Ie(a.error);return n||s||l?null:t.createElement(D.b,{severity:"warning",title:"Invalid plugin signature","aria-label":X.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 Ie(e){switch(e){case m.w2.invalidSignature:case m.w2.missingSignature:case m.w2.modifiedSignature:return!0;default:return!1}}var w=r(34138);const Ne=(e,a)=>{const{loading:n,error:s,value:l}=A(e),{pathname:c}=(0,P.TH)(),d=Ce(e,l),g=c.substring(0,c.lastIndexOf("/")),y=Boolean(e?.isPublished),h=a||d,B=(0,t.useMemo)(()=>{const O=e&&R.Vt.hasAccessInMetadata(I.AccessControlAction.PluginsWrite,e,(0,w.RN)()),x=[];if(y&&x.push({text:o.xc.VERSIONS,id:o.tu.VERSIONS,icon:"history",url:`${c}?page=${o.tu.VERSIONS}`,active:o.tu.VERSIONS===h}),!l||(k.v.featureToggles.panelTitleSearch&&l.meta.type===m.zV.panel&&x.push({text:o.xc.USAGE,icon:"list-ul",id:o.tu.USAGE,url:`${c}?page=${o.tu.USAGE}`,active:o.tu.USAGE===h}),!O))return x;if(l.meta.type===m.zV.app){if(l.angularConfigCtrl&&x.push({text:"Config",icon:"cog",id:o.tu.CONFIG,url:`${c}?page=${o.tu.CONFIG}`,active:o.tu.CONFIG===h}),l.configPages)for(const b of l.configPages)x.push({text:b.title,icon:b.icon,id:b.id,url:`${c}?page=${b.id}`,active:b.id===h});l.meta.includes?.find(b=>b.type===m.$_.dashboard)&&x.push({text:"Dashboards",icon:"apps",id:o.tu.DASHBOARDS,url:`${c}?page=${o.tu.DASHBOARDS}`,active:o.tu.DASHBOARDS===h})}return x},[e,l,c,y,h]),U={text:e?.name??"",img:e?.info.logos.small,breadcrumbs:[{title:"Plugins",url:g}],children:[{text:o.xc.OVERVIEW,icon:"file-alt",id:o.tu.OVERVIEW,url:`${c}?page=${o.tu.OVERVIEW}`,active:o.tu.OVERVIEW===h},...B]};return{error:s,loading:n,navModel:U,activePageId:h}};function Ce(e,a){return!e||!a||!R.Vt.hasAccessInMetadata(I.AccessControlAction.PluginsWrite,e,(0,w.RN)())||a.meta.type!==m.zV.app?o.tu.OVERVIEW:a.angularConfigCtrl?o.tu.CONFIG:a.configPages?.length?a.configPages[0].id:o.tu.OVERVIEW}var $=r(6335),Ae=r(67327);function Te({plugin:e}){const{value:a}=A(e);if(!a||!R.Vt.hasAccessInMetadata(I.AccessControlAction.PluginsWrite,e,(0,w.RN)()))return null;const{enabled:n,jsonData:s}=a?.meta,l=()=>K(e.id,{enabled:!0,pinned:!0,jsonData:s}),c=()=>{K(e.id,{enabled:!1,pinned:!1,jsonData:s})};return t.createElement(t.Fragment,null,!n&&t.createElement(v.zx,{variant:"primary",onClick:l},"Enable"),n&&t.createElement(v.zx,{variant:"destructive",onClick:c},"Disable"))}const K=async(e,a)=>{try{await(0,Ae.P6)(e,a),window.location.reload()}catch(n){console.error("Error while updating the plugin",n)}};var Y=r(66116);function $e({plugin:e}){const a=(0,I.useDispatch)(),n=(0,Y.d7)(),s=(0,t.useCallback)(()=>{const l={name:e.name,id:e.id};a((0,Y.J_)(l,n.Edit))},[a,e,n]);return(0,w.Gg)()?t.createElement(v.zx,{variant:"primary",onClick:s},"Create a ",e.name," data source"):null}function Ue({plugin:e}){if(!e.isInstalled||e.isDisabled)return null;switch(e.type){case m.zV.datasource:return t.createElement($e,{plugin:e});case m.zV.app:return t.createElement(Te,{plugin:e});default:return null}}var Ve=r(75764),S=r(96263);const We=({plugin:e,pluginStatus:a,latestCompatibleVersion:n})=>{const s=(0,p.wW)(Le),l=k.v.pluginAdminExternalManageEnabled,c=R.Vt.hasAccess(I.AccessControlAction.PluginsInstall,(0,w.bO)()),d=(0,S.y9)(),g=Boolean(n);if(e.type===m.zV.renderer)return t.createElement("div",{className:s.message},"Renderer plugins cannot be managed by the Plugin Catalog.");if(e.type===m.zV.secretsmanager)return t.createElement("div",{className:s.message},"Secrets manager plugins cannot be managed by the Plugin Catalog.");if(e.isEnterprise&&!(0,Ve.v)("enterprise.plugins"))return t.createElement(E.Lh,{height:"auto",align:"center"},t.createElement("span",{className:s.message},"No valid Grafana Enterprise license detected."),t.createElement(v.Qj,{href:`${(0,N.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:s.message},"This is a development build of the plugin and can't be uninstalled.");if(!c&&!l){const y=`You do not have permission to ${a} this plugin.`;return t.createElement("div",{className:s.message},y)}return e.isPublished?g?d?null:t.createElement("div",{className:s.message},"The install controls have been disabled because the Grafana server cannot access grafana.com."):t.createElement("div",{className:s.message},t.createElement($.J,{name:"exclamation-triangle"}),"\xA0This plugin doesn't support your version of Grafana."):t.createElement("div",{className:s.message},t.createElement($.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.")},Le=e=>({message:i.css`
      color: ${e.colors.text.secondary};
    `});var Re=r(38002),we=r(22324),J=r(24901),Be=r(68532),Oe=r(15037),q=r(28704);const ze=e=>{(0,q.ff)("grafana_plugin_install_clicked",e)},Me=e=>{(0,q.ff)("grafana_plugin_uninstall_clicked",e)};function Fe({plugin:e,pluginStatus:a,latestCompatibleVersion:n,setNeedReload:s}){const l=(0,I.useDispatch)(),[c]=(0,Be.K)(),d=(0,P.TH)(),{isInstalling:g,error:y}=(0,S.IS)(),{isUninstalling:h,error:B}=(0,S.wq)(),U=(0,S.x3)(),O=(0,S.S1)(),x=(0,S.kH)(),[b,ne]=(0,t.useState)(!1),it=()=>ne(!0),ae=()=>ne(!1),se=h?"Uninstalling":"Uninstall",re={plugin_id:e.id,plugin_type:e.type,path:d.pathname};(0,t.useEffect)(()=>()=>{x()},[]);const ot=async()=>{ze(re);const G=await U(e.id,n?.version);!y&&!("error"in G)&&(J.Z.emit(F.SI.alertSuccess,[`Installed ${e.name}`]),e.type==="app"&&s(!0))},le=async()=>{if(ae(),Me(re),await O(e.id),!B){const G=c.page;G!==o.tu.OVERVIEW&&G!==o.tu.VERSIONS&&Re.E1.replace(`${d.pathname}?page=${o.tu.OVERVIEW}`),J.Z.emit(F.SI.alertSuccess,[`Uninstalled ${e.name}`]),e.type==="app"&&(l((0,Oe.Lk)({pluginID:e.id})),s(!1))}},ct=async()=>{await U(e.id,n?.version,!0),y||J.Z.emit(F.SI.alertSuccess,[`Updated ${e.name}`])};return a===o.vF.UNINSTALL?t.createElement(t.Fragment,null,t.createElement(we.s,{isOpen:b,title:`Uninstall ${e.name}`,body:"Are you sure you want to uninstall this plugin?",confirmText:"Confirm",icon:"exclamation-triangle",onConfirm:le,onDismiss:ae}),t.createElement(E.Lh,{align:"flex-start",width:"auto",height:"auto"},t.createElement(v.zx,{variant:"destructive",disabled:h,onClick:it},se))):a===o.vF.UPDATE?t.createElement(E.Lh,{align:"flex-start",width:"auto",height:"auto"},t.createElement(v.zx,{disabled:g,onClick:ct},g?"Updating":"Update"),t.createElement(v.zx,{variant:"destructive",disabled:h,onClick:le},se)):t.createElement(v.zx,{disabled:g||y,onClick:ot},g?"Installing":"Install")}function ke({pluginId:e,pluginStatus:a}){const n=`${(0,N.Uj)(e)}/?tab=installation`;return a===o.vF.UPDATE?t.createElement(E.Lh,{height:"auto"},t.createElement(v.Qj,{href:n,target:"_blank",rel:"noopener noreferrer"},"Update via grafana.com"),t.createElement(v.Qj,{variant:"destructive",href:n,target:"_blank",rel:"noopener noreferrer"},"Uninstall via grafana.com")):a===o.vF.UNINSTALL?t.createElement(v.Qj,{variant:"destructive",href:n,target:"_blank",rel:"noopener noreferrer"},"Uninstall via grafana.com"):t.createElement(v.Qj,{href:n,target:"_blank",rel:"noopener noreferrer"},"Install via grafana.com")}const Ge=({plugin:e})=>{const a=(0,p.wW)(He),n=(0,S.y9)(),s=(0,N.RU)(e?.details?.versions),[l,c]=(0,t.useState)(!1);if(!e)return null;const d=(0,N.HT)(e,n,s),g=k.v.pluginAdminExternalManageEnabled,y=e.isInstalled?e.hasUpdate?o.vF.UPDATE:o.vF.UNINSTALL:o.vF.INSTALL,h=e.isCore||e.isDisabled||!(0,N.fG)()||d;return t.createElement(E.wc,null,t.createElement(E.Lh,null,!h&&t.createElement(t.Fragment,null,g?t.createElement(ke,{pluginId:e.id,pluginStatus:y}):t.createElement(Fe,{plugin:e,latestCompatibleVersion:s,pluginStatus:y,setNeedReload:c})),t.createElement(Ue,{plugin:e})),l&&t.createElement(E.Lh,null,t.createElement($.J,{name:"exclamation-triangle"}),t.createElement("span",{className:a.message},"Refresh the page to see the changes")))},He=e=>({message:i.css`
      color: ${e.colors.text.secondary};
    `}),Ze=({plugin:e})=>{const a=(0,S.y9)(),n=(0,p.wW)(je),{error:s}=(0,S.IS)();if(!e)return null;const l=(0,N.RU)(e.details?.versions),c=e.isInstalled?e.hasUpdate?o.vF.UPDATE:o.vF.UNINSTALL:o.vF.INSTALL;return t.createElement("div",{className:n.subtitle},s&&t.createElement(D.b,{title:"message"in s?s.message:""},typeof s=="string"?s:s.error),e?.description&&t.createElement("div",null,e?.description),e?.details?.links&&e.details.links.length>0&&t.createElement("span",null,e.details.links.map((d,g)=>t.createElement(t.Fragment,{key:g},g>0&&" | ",t.createElement("a",{href:d.url,className:"external-link"},d.name)))),(0,N.HT)(e,a,l)&&t.createElement(We,{plugin:e,pluginStatus:c,latestCompatibleVersion:l}))},je=e=>({subtitle:i.css`
      display: flex;
      flex-direction: column;
      gap: ${e.spacing(1)};
    `});var Je=r(22861),Qe=r(66917);function Xe({plugin:e,latestCompatibleVersion:a,className:n}){const s=(0,p.wW)(Ke),l=e.details?.pluginDependencies,c=e.isInstalled?e.details?.grafanaDependency:a?.grafanaDependency||e.details?.grafanaDependency;return!c&&(!l||!l.length)?null:t.createElement(Qe.Stack,{gap:1},Boolean(c)&&t.createElement("div",{className:s.depBadge},t.createElement($.J,{name:"grafana",className:s.icon}),"Grafana ",c),l&&l.length>0&&t.createElement("div",null,l.map(g=>t.createElement("span",{className:s.depBadge,key:g.name},t.createElement($.J,{name:o.Co[g.type],className:s.icon}),g.name," ",g.version))))}const Ke=e=>({dependencyTitle:i.css`
      margin-right: ${e.spacing(.5)};

      &::after {
        content: '';
        padding: 0;
      }
    `,depBadge:(0,i.css)({display:"flex",alignItems:"flex-start"}),icon:i.css`
      color: ${e.colors.text.secondary};
      margin-right: ${e.spacing(.5)};
    `});var Ye=r(16291),qe=r(66434);const _={[m._Z.grafana]:"grafana",[m._Z.commercial]:"shield",[m._Z.community]:"shield",DEFAULT:"shield-exclamation"};function _e({signatureType:e,signatureOrg:a=""}){const n=(0,p.wW)(te);if(!e&&!a)return null;const s=e===m._Z.grafana?"Grafana Labs":(0,T.capitalize)(e),l=_[e||""]||_.DEFAULT;return t.createElement(t.Fragment,null,t.createElement(ee,null,t.createElement("div",{className:n.detailsWrapper},t.createElement("strong",{className:n.strong},"Level:\xA0"),t.createElement($.J,{size:"xs",name:l}),"\xA0",s)),t.createElement(ee,null,t.createElement("strong",{className:n.strong},"Signed by:")," ",a))}const ee=({children:e})=>{const a=(0,p.wW)(te);return t.createElement(qe.C,{color:"green",className:a.badge,text:e})},te=e=>({badge:i.css`
    background-color: ${e.colors.background.canvas};
    border-color: ${e.colors.border.strong};
    color: ${e.colors.text.secondary};
    white-space: nowrap;
  `,detailsWrapper:i.css`
    align-items: center;
    display: flex;
  `,strong:i.css`
    color: ${e.colors.text.primary};
  `,icon:i.css`
    margin-right: ${e.spacing(.5)};
  `});function et({plugin:e}){const a=(0,p.wW)(tt),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(Ye.o,{status:e.signature})),n&&t.createElement(_e,{signatureType:e.signatureType,signatureOrg:e.signatureOrg}))}const tt=e=>({container:i.css`
      display: flex;
      flex-wrap: wrap;
      gap: ${e.spacing(.5)};
    `,link:i.css`
      display: inline-flex;
      align-items: center;
    `}),nt=e=>{const a=[];if(!e)return a;const n=(0,N.RU)(e.details?.versions),s=e.installedVersion||n?.version;Boolean(s)&&a.push({label:"Version",value:s}),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 c=e.details?.pluginDependencies;return!(e.isInstalled?e.details?.grafanaDependency:n?.grafanaDependency||e.details?.grafanaDependency)&&(!c||!c.length)||a.push({label:"Dependencies",value:t.createElement(Xe,{plugin:e,latestCompatibleVersion:n})}),e.isDisabled&&a.push({label:"Status",value:t.createElement(Je.SX,{error:e.error})}),a.push({label:"Signature",value:t.createElement(et,{plugin:e})}),a},dt=e=>({subtitle:css`
      display: flex;
      flex-direction: column;
      gap: ${e.spacing(1)};
    `}),at=e=>{const a=nt(e);return{actions:t.createElement(Ge,{plugin:e}),info:a,subtitle:t.createElement(Ze,{plugin:e})}};function st({pluginId:e,navId:a="plugins",notFoundComponent:n=t.createElement(lt,null),notFoundNavModel:s={text:"Unknown plugin",subTitle:"The requested ID does not belong to any plugin",active:!0}}){const l=(0,P.TH)(),c=new URLSearchParams(l.search),d=(0,S.bJ)(e),{navModel:g,activePageId:y}=Ne(d,c.get("page")),{actions:h,info:B,subtitle:U}=at(d),{isLoading:O}=(0,S.ZV)(),{isLoading:x}=(0,S.bt)(),b=(0,p.wW)(rt);return O||x?t.createElement(C.T,{navId:a,pageNav:{text:"",active:!0}},t.createElement(f.a,null)):d?t.createElement(C.T,{navId:a,pageNav:g,actions:h,subTitle:U,info:B},t.createElement(C.T.Contents,null,t.createElement(W.I,{className:b.tabContent},t.createElement(De,{plugin:d,className:b.alert}),t.createElement(Se,{plugin:d,className:b.alert}),t.createElement(be,{queryParams:Object.fromEntries(c),plugin:d,pageId:y})))):t.createElement(C.T,{navId:a,pageNav:s},n)}const rt=e=>({alert:i.css`
      margin-bottom: ${e.spacing(2)};
    `,subtitle:i.css`
      display: flex;
      flex-direction: column;
      gap: ${e.spacing(1)};
    `,tabContent:i.css`
      overflow: auto;
      height: 100%;
    `});function lt(){return t.createElement(E.Ar,{justify:"center",align:"center"},t.createElement(D.b,{severity:I.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=8644.fe12fc15f500ce88e34d.js.map