"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[2417],{88983:(e,n,a)=>{a.d(n,{Z:()=>l});a(76687);var t,i=a(39756),s=a(55312),r=a(52010);const l=function(e){let{dashboards:n,onImport:a,onRemove:l}=e;function o(e){return e.revision!==e.importedRevision?"Update":"Re-import"}return(0,r.jsx)("table",{className:"filter-table",children:(0,r.jsx)("tbody",{children:n.map(((e,n)=>(0,r.jsxs)("tr",{children:[t||(t=(0,r.jsx)("td",{className:"width-1",children:(0,r.jsx)(i.J,{name:"apps"})})),(0,r.jsx)("td",{children:e.imported?(0,r.jsx)("a",{href:e.importedUrl,children:e.title}):(0,r.jsx)("span",{children:e.title})}),(0,r.jsxs)("td",{style:{textAlign:"right"},children:[e.imported?(0,r.jsx)(s.zx,{variant:"secondary",size:"sm",onClick:()=>a(e,!0),children:o(e)}):(0,r.jsx)(s.zx,{variant:"secondary",size:"sm",onClick:()=>a(e,!1),children:"Import"}),e.imported&&(0,r.jsx)(s.zx,{"aria-label":"Delete dashboard",icon:"trash-alt",variant:"destructive",size:"sm",onClick:()=>l(e)})]})]},`${e.dashboardId}-${n}`)))})})}},1523:(e,n,a)=>{a.d(n,{SX:()=>r,IF:()=>f,oZ:()=>c,xh:()=>x});a(76687);var t=a(37729),i=a(94903),s=a(52010);function r(e){let{error:n}=e;const a=function(e){switch(e){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"+(e?`: ${e}`:"")}}(n);return(0,s.jsx)(i.C,{icon:"exclamation-triangle",text:"Disabled",color:"red",tooltip:a})}var l=a(27668),o=a(77813);const d=e=>o.css`
  background: ${e.colors.background.primary};
  border-color: ${e.colors.border.strong};
  color: ${e.colors.text.secondary};
`;function c(){const e=(0,l.wW)(d);return(0,s.jsx)(i.C,{text:"Installed",color:"orange",className:e})}var u,h=a(79460),g=a(7053),p=a(9197),m=a(55312);function f(e){let{plugin:n}=e;const a=(0,l.wW)(d);return(0,h.v)("enterprise.plugins")?u||(u=(0,s.jsx)(i.C,{text:"Enterprise",color:"blue"})):(0,s.jsxs)(g.Lh,{children:[(0,s.jsx)(p.o,{status:n.signature}),(0,s.jsx)(i.C,{icon:"lock","aria-label":"lock icon",text:"Enterprise",color:"blue",className:a}),(0,s.jsx)(m.zx,{size:"sm",fill:"text",icon:"external-link-alt",onClick:e=>{e.preventDefault(),window.open(`https://grafana.com/grafana/plugins/${n.id}?utm_source=grafana_catalog_learn_more`,"_blank","noopener,noreferrer")},children:"Learn more"})]})}function x(e){let{plugin:n}=e;const a=(0,l.wW)(v);return n.hasUpdate&&!n.isCore&&n.type!==t.zV.renderer?(0,s.jsx)("p",{className:a.hasUpdate,children:"Update available!"}):null}const v=e=>({hasUpdate:o.css`
      color: ${e.colors.text.secondary};
      font-size: ${e.typography.bodySmall.fontSize};
      margin-bottom: 0;
    `})},62988:(e,n,a)=>{a.d(n,{a:()=>s});a(76687);var t=a(42384),i=a(52010);const s=e=>{let{text:n="Loading..."}=e;return(0,i.jsx)("div",{className:"page-loader-wrapper",children:(0,i.jsx)(t.u,{text:n})})}},84309:(e,n,a)=>{a.d(n,{E:()=>i});a(76687);var t=a(52010);function i(e){let{alt:n,className:a,src:i,height:s}=e;return(0,t.jsx)("img",{src:i,className:a,alt:n,loading:"lazy",height:s})}},87845:(e,n,a)=>{a.r(n),a.d(n,{default:()=>nn,getStyles:()=>an});var t,i,s=a(77813),r=a(76687),l=a(90033),o=a(49622),d=a(27668),c=a(35562),u=a(88018),h=a(69187),g=a(93080),p=a(6102),m=a(7053),f=a(28781),x=a(352),v=a(62988),b=a(84738),j=a(75829),y=a(52010);const w=e=>{let{versions:n=[],installedVersion:a}=e;const s=(0,d.wW)(N),r=(0,j.RU)(n);return 0===n.length?t||(t=(0,y.jsx)("p",{children:"No version history was found."})):(0,y.jsxs)("table",{className:s.table,children:[i||(i=(0,y.jsx)("thead",{children:(0,y.jsxs)("tr",{children:[(0,y.jsx)("th",{children:"Version"}),(0,y.jsx)("th",{children:"Last updated"})]})})),(0,y.jsx)("tbody",{children:n.map((e=>{const n=a===e.version;return(0,y.jsxs)("tr",{children:[n?(0,y.jsxs)("td",{className:s.currentVersion,children:[e.version," (installed version)"]}):e.version===(null==r?void 0:r.version)?(0,y.jsxs)("td",{children:[e.version," (latest compatible version)"]}):(0,y.jsx)("td",{children:e.version}),(0,y.jsx)("td",{className:n?s.currentVersion:"",children:(0,b.E8)(e.createdAt)})]},e.version)}))})]})},N=e=>({container:s.css`
    padding: ${e.spacing(2,4,3)};
  `,table:s.css`
    table-layout: fixed;
    width: 100%;
    td,
    th {
      padding: ${e.spacing()} 0;
    }
    th {
      font-size: ${e.typography.h5.fontSize};
    }
  `,currentVersion:s.css`
    font-weight: ${e.typography.fontWeightBold};
  `});var I=a(68021),S=a(62619);const $=e=>(0,I.Z)((async()=>e&&e.isInstalled&&!e.isDisabled?(0,S.O)(e.id):null),[null==e?void 0:e.id,null==e?void 0:e.isInstalled,null==e?void 0:e.isDisabled]);var k,P,C=a(34324),D=a(86832),U=a(52019),E=a(5205),V=a(51926),z=a(55312);function W(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}class T extends r.PureComponent{constructor(e){super(e),W(this,"element",null),W(this,"model",void 0),W(this,"preUpdateHook",(()=>Promise.resolve())),W(this,"postUpdateHook",(()=>Promise.resolve())),W(this,"update",(()=>{const e=this.model.id;this.preUpdateHook().then((()=>{const n=(0,D.extend)({enabled:this.model.enabled,pinned:this.model.pinned,jsonData:this.model.jsonData,secureJsonData:this.model.secureJsonData},{});return(0,E.i)().post(`/api/plugins/${e}/settings`,n)})).then(this.postUpdateHook).then((e=>{window.location.href=window.location.href}))})),W(this,"setPreUpdateHook",(e=>{this.preUpdateHook=e})),W(this,"setPostUpdateHook",(e=>{this.postUpdateHook=e})),W(this,"importDashboards",(()=>((0,U.d)("AppConfig","importDashboards()"),Promise.resolve()))),W(this,"enable",(()=>{this.model.enabled=!0,this.model.pinned=!0,this.update()})),W(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(e){if(!this.element||this.state.angularCtrl)return;this.model=(0,D.cloneDeep)(this.props.app.meta);const n={ctrl:this,isAppConfigCtrl:!0},a=(0,V.w)().load(this.element,n,'<plugin-component type="app-config-ctrl"></plugin-component>');this.setState({angularCtrl:a})}render(){const e=this.model,n=(0,s.css)({marginRight:"8px"});return(0,y.jsxs)("div",{children:[(0,y.jsx)("div",{ref:e=>this.element=e}),k||(k=(0,y.jsx)("br",{})),P||(P=(0,y.jsx)("br",{})),e&&(0,y.jsxs)("div",{className:"gf-form",children:[!e.enabled&&(0,y.jsx)(z.zx,{variant:"primary",onClick:this.enable,className:n,children:"Enable"}),e.enabled&&(0,y.jsx)(z.zx,{variant:"primary",onClick:this.update,className:n,children:"Update"}),e.enabled&&(0,y.jsx)(z.zx,{variant:"destructive",onClick:this.disable,className:n,children:"Disable"})]})]})}}var L,A,O=a(54017),R=a(31271),_=a(88983);function G(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}class F extends r.PureComponent{constructor(e){super(e),G(this,"importAll",(()=>{this.importNext(0)})),G(this,"importNext",(e=>{const{dashboards:n}=this.state;return this.import(n[e],!0).then((()=>e+1<n.length?new Promise((n=>{setTimeout((()=>{this.importNext(e+1).then((()=>{n()}))}),500)})):Promise.resolve()))})),G(this,"import",((e,n)=>{const{plugin:a,datasource:t}=this.props,i={pluginId:a.id,path:e.path,overwrite:n,inputs:[]};return t&&i.inputs.push({name:"*",type:"datasource",pluginId:t.meta.id,value:t.name}),(0,E.i)().post("/api/dashboards/import",i).then((n=>{R.h$.emit(O.SI.alertSuccess,["Dashboard Imported",e.title]),(0,D.extend)(e,n),this.setState({dashboards:[...this.state.dashboards]})}))})),G(this,"remove",(e=>{(0,E.i)().delete("/api/dashboards/uid/"+e.uid).then((()=>{e.imported=!1,this.setState({dashboards:[...this.state.dashboards]})}))})),this.state={loading:!0,dashboards:[]}}async componentDidMount(){const e=this.props.plugin.id;(0,E.i)().get(`/api/plugins/${e}/dashboards`).then((e=>{this.setState({dashboards:e,loading:!1})}))}render(){const{loading:e,dashboards:n}=this.state;return e?L||(L=(0,y.jsx)("div",{children:"loading..."})):n&&n.length?(0,y.jsx)("div",{className:"gf-form-group",children:(0,y.jsx)(_.Z,{dashboards:n,onImport:this.import,onRemove:this.remove})}):A||(A=(0,y.jsx)("div",{children:"No dashboards are included with this plugin"}))}}var Z,B,J=a(65677),H=a(98800),M=a(67273),Q=a(55816),q=a(97726),X=a(10768),Y=a(27556);function K(e){let{plugin:n}=e;const a=(0,d.wW)(ee),t=(0,r.useMemo)((()=>({query:"*",panel_type:n.id,kind:["panel"]})),[n]),i=(0,I.Z)((()=>(0,Y.O)().search(t)),[t]),s=i.value;return null!=s&&s.totalRows?(0,y.jsxs)("div",{className:a.wrap,children:[(0,y.jsxs)("div",{className:a.info,children:[n.name," is used ",(0,y.jsx)("b",{children:s.totalRows})," times."]}),(0,y.jsx)(J.Z,{children:e=>{let{width:n,height:a}=e;return(0,y.jsx)(X.Q,{response:s,width:n,height:a,clearSelection:()=>{},keyboardEvents:(0,H.of)(),onTagSelected:()=>{}})}})]}):i.loading?Z||(Z=(0,y.jsx)(Q.$,{})):M.v.featureToggles.panelTitleSearch?(0,y.jsx)(q.Z,{title:`${n.name} is not used in any dashboards yet`,buttonIcon:"plus",buttonTitle:"Create Dashboard",buttonLink:`dashboard/new?panelType=${n.id}&editPanel=1`}):B||(B=(0,y.jsx)(c.b,{title:"Missing feature toggle: panelTitleSearch",children:"Plugin usage requires the new search index to find usage across dashboards"}))}const ee=e=>({wrap:s.css`
      width: 100%;
      height: 100%;
    `,info:s.css`
      padding-bottom: 30px;
    `});var ne;function ae(e){let{plugin:n,queryParams:a,pageId:t}=e;const i=(0,d.wW)(te),{value:r}=$(n);var l,o,c;if(t===C.tu.OVERVIEW)return(0,y.jsx)("div",{className:(0,s.cx)(i.readme,i.container),dangerouslySetInnerHTML:{__html:null!==(l=null===(o=n.details)||void 0===o?void 0:o.readme)&&void 0!==l?l:"No plugin help or readme markdown file was found"}});if(t===C.tu.VERSIONS)return(0,y.jsx)("div",{className:i.container,children:(0,y.jsx)(w,{versions:null===(c=n.details)||void 0===c?void 0:c.versions,installedVersion:n.installedVersion})});if(t===C.tu.CONFIG&&null!=r&&r.angularConfigCtrl)return(0,y.jsx)("div",{className:i.container,children:(0,y.jsx)(T,{app:r})});if(null!=r&&r.configPages)for(const e of r.configPages)if(t===e.id)return(0,y.jsx)("div",{className:i.container,children:(0,y.jsx)(e.body,{plugin:r,query:a})});return t===C.tu.USAGE&&r?(0,y.jsx)("div",{className:i.container,children:(0,y.jsx)(K,{plugin:null==r?void 0:r.meta})}):t===C.tu.DASHBOARDS&&r?(0,y.jsx)("div",{className:i.container,children:(0,y.jsx)(F,{plugin:null==r?void 0:r.meta})}):(0,y.jsx)("div",{className:i.container,children:ne||(ne=(0,y.jsx)("p",{children:"Page not found."}))})}const te=e=>({container:s.css`
    padding: ${e.spacing(3,4)};
    height: 100%;
  `,readme:s.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 ie,se,re,le,oe,de,ce=a(37729),ue=a(28441);function he(e){let{className:n,plugin:a}=e;return a.isDisabled?(0,y.jsxs)(c.b,{severity:"error",title:"Plugin disabled",className:n,"aria-label":ue.wl.pages.PluginPage.disabledInfo,children:[ge(a.error),ie||(ie=(0,y.jsx)("p",{children:"Please contact your server administrator to get this resolved."})),se||(se=(0,y.jsx)("a",{href:"https://grafana.com/docs/grafana/latest/administration/cli/#plugins-commands",className:"external-link",target:"_blank",rel:"noreferrer",children:"Read more about managing plugins"}))]}):null}function ge(e){switch(e){case ce.w2.modifiedSignature:return re||(re=(0,y.jsx)("p",{children:"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 ce.w2.invalidSignature:return le||(le=(0,y.jsx)("p",{children:"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 ce.w2.missingSignature:return oe||(oe=(0,y.jsx)("p",{children:"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 de||(de=(0,y.jsx)("p",{children:"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."}))}}var pe=a(39756),me=a(1523),fe=a(86079),xe=a(68631);function ve(e){let{plugin:n}=e;const{value:a}=$(n);if(!a)return null;if(!R.Vt.hasAccessInMetadata(x.bW.PluginsWrite,n,(0,xe.RN)()))return null;const{enabled:t,jsonData:i}=null==a?void 0:a.meta;return(0,y.jsxs)(y.Fragment,{children:[!t&&(0,y.jsx)(z.zx,{variant:"primary",onClick:()=>be(n.id,{enabled:!0,pinned:!0,jsonData:i}),children:"Enable"}),t&&(0,y.jsx)(z.zx,{variant:"destructive",onClick:()=>{be(n.id,{enabled:!1,pinned:!1,jsonData:i})},children:"Disable"})]})}const be=async(e,n)=>{try{await(0,fe.P6)(e,n),window.location.reload()}catch(e){console.error("Error while updating the plugin",e)}};var je=a(54533);function ye(e){let{plugin:n}=e;const a=(0,x.I0)(),t=(0,r.useCallback)((()=>{const e={name:n.name,id:n.id};a((0,je.J_)(e))}),[a,n]);return(0,xe.Gg)()?(0,y.jsxs)(z.zx,{variant:"primary",onClick:t,children:["Create a ",n.name," data source"]}):null}function we(e){let{plugin:n}=e;if(!n.isInstalled||n.isDisabled)return null;switch(n.type){case ce.zV.datasource:return(0,y.jsx)(ye,{plugin:n});case ce.zV.app:return(0,y.jsx)(ve,{plugin:n});default:return null}}var Ne=a(79460),Ie=a(31317);function Se(e){let{pluginId:n,pluginStatus:a}=e;const t=`${(0,j.Uj)(n)}/?tab=installation`;return a===C.vF.UPDATE?(0,y.jsxs)(m.Lh,{height:"auto",children:[(0,y.jsx)(z.Qj,{href:t,target:"_blank",rel:"noopener noreferrer",children:"Update via grafana.com"}),(0,y.jsx)(z.Qj,{variant:"destructive",href:t,target:"_blank",rel:"noopener noreferrer",children:"Uninstall via grafana.com"})]}):a===C.vF.UNINSTALL?(0,y.jsx)(z.Qj,{variant:"destructive",href:t,target:"_blank",rel:"noopener noreferrer",children:"Uninstall via grafana.com"}):(0,y.jsx)(z.Qj,{href:t,target:"_blank",rel:"noopener noreferrer",children:"Install via grafana.com"})}var $e,ke,Pe,Ce=a(97867),De=a(33225);function Ue(e){let{plugin:n,pluginStatus:a,latestCompatibleVersion:t}=e;const{isInstalling:i,error:s}=(0,Ie.IS)(),{isUninstalling:l,error:o}=(0,Ie.wq)(),d=(0,Ie.x3)(),c=(0,Ie.S1)(),[u,h]=(0,r.useState)(!1),g=()=>h(!0),p=()=>h(!1),f=l?"Uninstalling":"Uninstall",x=async()=>{p(),await c(n.id),o||De.Z.emit(O.SI.alertSuccess,[`Uninstalled ${n.name}`])},v=async()=>{await d(n.id,null==t?void 0:t.version,!0),s||De.Z.emit(O.SI.alertSuccess,[`Updated ${n.name}`])};return a===C.vF.UNINSTALL?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(Ce.s,{isOpen:u,title:`Uninstall ${n.name}`,body:"Are you sure you want to uninstall this plugin?",confirmText:"Confirm",icon:"exclamation-triangle",onConfirm:x,onDismiss:p}),(0,y.jsx)(m.Lh,{height:"auto",children:(0,y.jsx)(z.zx,{variant:"destructive",disabled:l,onClick:g,children:f})})]}):a===C.vF.UPDATE?(0,y.jsxs)(m.Lh,{height:"auto",children:[(0,y.jsx)(z.zx,{disabled:i,onClick:v,children:i?"Updating":"Update"}),(0,y.jsx)(z.zx,{variant:"destructive",disabled:l,onClick:x,children:f})]}):(0,y.jsx)(z.zx,{disabled:i,onClick:async()=>{await d(n.id,null==t?void 0:t.version),s||De.Z.emit(O.SI.alertSuccess,[`Installed ${n.name}`])},children:i?"Installing":"Install"})}const Ee=e=>{let{plugin:n,latestCompatibleVersion:a}=e;const t=(0,d.wW)(Ve),i=M.v.pluginAdminExternalManageEnabled,s=R.Vt.hasAccess(x.bW.PluginsInstall,(0,xe.bO)()),r=(0,Ie.y9)(),l=Boolean(a),o=n.isCore||n.isDisabled||!(0,j.fG)(),c=n.isInstalled?n.hasUpdate?C.vF.UPDATE:C.vF.UNINSTALL:C.vF.INSTALL;if(o)return null;if(n.type===ce.zV.renderer)return(0,y.jsx)("div",{className:t.message,children:"Renderer plugins cannot be managed by the Plugin Catalog."});if(n.type===ce.zV.secretsmanager)return(0,y.jsx)("div",{className:t.message,children:"Secrets manager plugins cannot be managed by the Plugin Catalog."});if(n.isEnterprise&&!(0,Ne.v)("enterprise.plugins"))return(0,y.jsxs)(m.Lh,{height:"auto",align:"center",children:[(0,y.jsx)("span",{className:t.message,children:"No valid Grafana Enterprise license detected."}),(0,y.jsx)(z.Qj,{href:`${(0,j.Uj)(n.id)}?utm_source=grafana_catalog_learn_more`,target:"_blank",rel:"noopener noreferrer",size:"sm",fill:"text",icon:"external-link-alt",children:"Learn more"})]});if(n.isDev)return(0,y.jsx)("div",{className:t.message,children:"This is a development build of the plugin and can't be uninstalled."});if(!s&&!i){const e=`You do not have permission to ${c} this plugin.`;return(0,y.jsx)("div",{className:t.message,children:e})}return n.isPublished?l?i?(0,y.jsx)(Se,{pluginId:n.id,pluginStatus:c}):r?(0,y.jsx)(Ue,{plugin:n,pluginStatus:c,latestCompatibleVersion:a}):(0,y.jsx)("div",{className:t.message,children:"The install controls have been disabled because the Grafana server cannot access grafana.com."}):(0,y.jsxs)("div",{className:t.message,children:[Pe||(Pe=(0,y.jsx)(pe.J,{name:"exclamation-triangle"}))," This plugin doesn't support your version of Grafana."]}):(0,y.jsxs)("div",{className:t.message,children:[$e||($e=(0,y.jsx)(pe.J,{name:"exclamation-triangle"}))," This plugin is not published to"," ",ke||(ke=(0,y.jsx)("a",{href:"https://www.grafana.com/plugins",target:"__blank",rel:"noreferrer",children:"grafana.com/plugins"}))," ","and can't be managed via the catalog."]})},Ve=e=>({message:s.css`
      color: ${e.colors.text.secondary};
    `});function ze(e){var n,a,t;let{plugin:i,latestCompatibleVersion:s,className:r}=e;const l=(0,d.wW)(We),o=null===(n=i.details)||void 0===n?void 0:n.pluginDependencies,c=i.isInstalled?null===(a=i.details)||void 0===a?void 0:a.grafanaDependency:(null==s?void 0:s.grafanaDependency)||(null===(t=i.details)||void 0===t?void 0:t.grafanaDependency);return!(c||o&&o.length)?null:(0,y.jsxs)("div",{className:r,children:[(0,y.jsx)("div",{className:l.dependencyTitle,children:"Dependencies:"}),Boolean(c)&&(0,y.jsxs)("div",{children:[(0,y.jsx)(pe.J,{name:"grafana",className:l.icon}),"Grafana ",c]}),o&&o.length>0&&(0,y.jsx)("div",{children:o.map((e=>(0,y.jsxs)("span",{children:[(0,y.jsx)(pe.J,{name:C.Co[e.type],className:l.icon}),e.name," ",e.version]},e.name)))})]})}const We=e=>({dependencyTitle:s.css`
      font-weight: ${e.typography.fontWeightBold};
      margin-right: ${e.spacing(.5)};

      &::after {
        content: '';
        padding: 0;
      }
    `,icon:s.css`
      color: ${e.colors.text.secondary};
      margin-right: ${e.spacing(.5)};
    `});var Te=a(9197),Le=a(94903);const Ae={[ce._Z.grafana]:"grafana",[ce._Z.commercial]:"shield",[ce._Z.community]:"shield",DEFAULT:"shield-exclamation"};function Oe(e){let{signatureType:n,signatureOrg:a=""}=e;const t=(0,d.wW)(_e);if(!n&&!a)return null;const i=n===ce._Z.grafana?"Grafana Labs":(0,D.capitalize)(n),s=Ae[n||""]||Ae.DEFAULT;return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(Re,{children:[(0,y.jsx)("strong",{className:t.strong,children:"Level: "}),(0,y.jsx)(pe.J,{size:"xs",name:s})," ",i]}),(0,y.jsxs)(Re,{children:[(0,y.jsx)("strong",{className:t.strong,children:"Signed by:"})," ",a]})]})}const Re=e=>{let{children:n}=e;const a=(0,d.wW)(_e);return(0,y.jsx)(Le.C,{color:"green",className:a.badge,text:(0,y.jsx)(y.Fragment,{children:n})})},_e=e=>({badge:s.css`
    background-color: ${e.colors.background.canvas};
    border-color: ${e.colors.border.strong};
    color: ${e.colors.text.secondary};
    margin-left: ${e.spacing()};
  `,strong:s.css`
    color: ${e.colors.text.primary};
  `,icon:s.css`
    margin-right: ${e.spacing(.5)};
  `});function Ge(e){let{plugin:n}=e;const a=(0,d.wW)(Fe),t=n.signature===ce.Xy.valid;return(0,y.jsxs)("div",{className:a.container,children:[(0,y.jsx)("a",{href:"https://grafana.com/docs/grafana/latest/plugins/plugin-signatures/",target:"_blank",rel:"noreferrer",className:a.link,children:(0,y.jsx)(Te.o,{status:n.signature})}),t&&(0,y.jsx)(Oe,{signatureType:n.signatureType,signatureOrg:n.signatureOrg})]})}const Fe=e=>({container:s.css`
      display: flex;
    `,link:s.css`
      display: inline-flex;
      align-items: center;
    `});var Ze,Be,Je=a(84309);function He(e){var n,a;let{plugin:t,currentUrl:i,parentUrl:r}=e;const l=(0,d.wW)(Me),o=(0,j.RU)(null===(n=t.details)||void 0===n?void 0:n.versions),c=t.installedVersion||(null==o?void 0:o.version);return(0,y.jsx)("div",{children:(0,y.jsx)("div",{className:"page-container",children:(0,y.jsxs)("div",{className:l.headerContainer,children:[(0,y.jsx)(Je.E,{alt:`${t.name} logo`,src:t.info.logos.small,className:s.css`
              object-fit: contain;
              width: 100%;
              height: 68px;
              max-width: 68px;
            `}),(0,y.jsxs)("div",{className:l.headerWrapper,children:[(0,y.jsx)("nav",{className:l.breadcrumb,"aria-label":"Breadcrumb",children:(0,y.jsxs)("ol",{children:[(0,y.jsx)("li",{children:(0,y.jsx)("a",{className:l.textUnderline,href:r,children:"Plugins"})}),(0,y.jsx)("li",{children:(0,y.jsx)("a",{href:i,"aria-current":"page",children:t.name})})]})}),(0,y.jsxs)("div",{className:l.headerInformationRow,children:[(0,y.jsx)("span",{children:t.orgName}),null===(a=t.details)||void 0===a?void 0:a.links.map((e=>(0,y.jsxs)("a",{href:e.url,children:[Ze||(Ze=(0,y.jsx)(pe.J,{name:"external-link-alt",size:"sm"}))," ",e.name]},e.name))),t.downloads>0&&(0,y.jsxs)("span",{children:[Be||(Be=(0,y.jsx)(pe.J,{name:"cloud-download"})),` ${(new Intl.NumberFormat).format(t.downloads)}`," "]}),Boolean(c)&&(0,y.jsx)("span",{children:c}),(0,y.jsx)(Ge,{plugin:t}),t.isDisabled&&(0,y.jsx)(me.SX,{error:t.error})]}),(0,y.jsx)(ze,{plugin:t,latestCompatibleVersion:o,className:(0,s.cx)(l.headerInformationRow,l.headerInformationRowSecondary)}),(0,y.jsx)("p",{children:t.description}),(0,y.jsxs)(m.Lh,{height:"auto",children:[(0,y.jsx)(Ee,{plugin:t,latestCompatibleVersion:o}),(0,y.jsx)(we,{plugin:t})]})]})]})})})}const Me=e=>({headerContainer:s.css`
      display: flex;
      margin-bottom: ${e.spacing(3)};
      margin-top: ${e.spacing(3)};
      min-height: 120px;
    `,headerWrapper:s.css`
      margin-left: ${e.spacing(3)};
    `,breadcrumb:s.css`
      font-size: ${e.typography.h2.fontSize};
      li {
        display: inline;
        list-style: none;
        &::after {
          content: '/';
          padding: 0 0.25ch;
        }
        &:last-child::after {
          content: '';
        }
      }
    `,headerInformationRow:s.css`
      display: flex;
      align-items: center;
      margin-top: ${e.spacing()};
      margin-bottom: ${e.spacing()};
      flex-flow: wrap;
      & > * {
        &::after {
          content: '|';
          padding: 0 ${e.spacing()};
        }
        &:last-child::after {
          content: '';
          padding-right: 0;
        }
      }
      font-size: ${e.typography.h4.fontSize};

      a {
        &:hover {
          text-decoration: underline;
        }
      }
    `,headerInformationRowSecondary:s.css`
      font-size: ${e.typography.body.fontSize};
    `,headerOrgName:s.css`
      font-size: ${e.typography.h4.fontSize};
    `,signature:s.css`
      margin: ${e.spacing(3)};
      margin-bottom: 0;
    `,textUnderline:s.css`
      text-decoration: underline;
    `});var Qe,qe;function Xe(e){let{className:n,plugin:a}=e;const t=a.signature===ce.Xy.valid,i=a.signature===ce.Xy.internal,s=a.isDisabled&&function(e){switch(e){case ce.w2.invalidSignature:case ce.w2.missingSignature:case ce.w2.modifiedSignature:return!0;default:return!1}}(a.error);return t||i||s?null:(0,y.jsxs)(c.b,{severity:"warning",title:"Invalid plugin signature","aria-label":ue.wl.pages.PluginPage.signatureInfo,className:n,children:[Qe||(Qe=(0,y.jsx)("p",{children:"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’t guarantee the integrity of this unsigned plugin. Ask the plugin author to request it to be signed."})),qe||(qe=(0,y.jsx)("a",{href:"https://grafana.com/docs/grafana/latest/plugins/plugin-signatures/",className:"external-link",target:"_blank",rel:"noreferrer",children:"Read more about plugins signing."}))]})}var Ye=a(63322);var Ke,en;function nn(e){let{match:n,queryParams:a}=e;const{params:{pluginId:t=""},url:i}=n,s=i.substring(0,i.lastIndexOf("/")),b=[{label:C.xc.OVERVIEW,icon:"file-alt",id:C.tu.OVERVIEW,href:`${i}?page=${C.tu.OVERVIEW}`}],j=(0,Ie.bJ)(t),{tabs:w,defaultTab:N}=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const{loading:a,error:t,value:i}=$(e),s=Boolean(null==e?void 0:e.isPublished),{pathname:l}=(0,Ye.TH)(),[o,d]=(0,r.useMemo)((()=>{const a=e&&R.Vt.hasAccessInMetadata(x.bW.PluginsWrite,e,(0,xe.RN)()),t=[...n];let r;if(s&&t.push({label:C.xc.VERSIONS,icon:"history",id:C.tu.VERSIONS,href:`${l}?page=${C.tu.VERSIONS}`}),!i)return r=C.tu.OVERVIEW,[t,r];if(M.v.featureToggles.panelTitleSearch&&i.meta.type===ce.zV.panel&&t.push({label:C.xc.USAGE,icon:"list-ul",id:C.tu.USAGE,href:`${l}?page=${C.tu.USAGE}`}),a&&i.meta.type===ce.zV.app){var o;if(i.angularConfigCtrl&&(t.push({label:"Config",icon:"cog",id:C.tu.CONFIG,href:`${l}?page=${C.tu.CONFIG}`}),r=C.tu.CONFIG),i.configPages)for(const e of i.configPages)t.push({label:e.title,icon:e.icon,id:e.id,href:`${l}?page=${e.id}`}),r||(r=e.id);null!==(o=i.meta.includes)&&void 0!==o&&o.find((e=>e.type===ce.$_.dashboard))&&t.push({label:"Dashboards",icon:"apps",id:C.tu.DASHBOARDS,href:`${l}?page=${C.tu.DASHBOARDS}`})}return r||(r=C.tu.OVERVIEW),[t,r]}),[e,i,n,l,s]);return{error:t,loading:a,tabs:o,defaultTab:d}}(j,b),{isLoading:I}=(0,Ie.ZV)(),{isLoading:S}=(0,Ie.bt)(),k=(0,d.wW)(an),P=(0,l.Z)(w),D=a.page||N;return(0,r.useEffect)((()=>{const e=P&&P.length>w.length,n=D!==C.tu.OVERVIEW&&D!==C.tu.VERSIONS;e&&n&&o.E1.replace(`${i}?page=${C.tu.OVERVIEW}`)}),[D,i,w,P]),I||S?Ke||(Ke=(0,y.jsx)(f.T,{children:(0,y.jsx)(v.a,{})})):j?(0,y.jsxs)(f.T,{children:[(0,y.jsx)(He,{currentUrl:`${i}?page=${D}`,parentUrl:s,plugin:j}),(0,y.jsx)("div",{children:(0,y.jsx)("div",{className:"page-container",children:(0,y.jsx)(u.J,{hideBorder:!0,children:w.map((e=>{var n;return(0,y.jsx)(h.O,{label:e.label,href:e.href,icon:(0,g.iJ)(null!==(n=e.icon)&&void 0!==n?n:""),active:e.id===D},e.label)}))})})}),(0,y.jsx)(f.T.Contents,{children:(0,y.jsxs)(p.I,{className:k.tabContent,children:[(0,y.jsx)(Xe,{plugin:j,className:k.alert}),(0,y.jsx)(he,{plugin:j,className:k.alert}),(0,y.jsx)(ae,{queryParams:a,plugin:j,pageId:D})]})})]}):(0,y.jsx)(m.Ar,{justify:"center",align:"center",children:(0,y.jsxs)(c.b,{severity:x.F1.Warning,title:"Plugin not found",children:["That plugin cannot be found. Please check the url is correct or ",en||(en=(0,y.jsx)("br",{})),"go to the ",(0,y.jsx)("a",{href:s,children:"plugin catalog"}),"."]})})}const an=e=>({alert:s.css`
      margin: ${e.spacing(3)};
      margin-bottom: 0;
    `,tabContent:s.css`
      overflow: auto;
      height: 100%;
    `})},31317:(e,n,a)=>{a.d(n,{iY:()=>z,bt:()=>C,ZV:()=>P,GE:()=>w,UQ:()=>I,bJ:()=>N,x3:()=>S,IS:()=>D,y9:()=>k,S1:()=>$,wq:()=>U});var t=a(76687),i=a(352),s=a(75829),r=a(82458),l=a(57433),o=a(8973),d=a(32397),c=a(34324);const u=e=>e.plugins,h=(0,o.P1)(u,(e=>{let{items:n}=e;return n})),g=(0,o.P1)(u,(e=>{let{settings:n}=e;return n.displayMode})),{selectAll:p,selectById:m}=l.CD.getSelectors(h),f=(e,n)=>(0,o.P1)((e=>(0,o.P1)(p,(n=>n.filter((n=>"installed"===e?n.isInstalled:!n.isCore)))))(e),(e=>e.filter((e=>"all"===n||e.type===n)))),x=(e,n,a)=>(0,o.P1)(f(n,a),(e=>(0,o.P1)(p,(n=>""===e?[]:n.filter((n=>{const a=[];return n.name&&a.push(n.name.toLowerCase()),n.orgName&&a.push(n.orgName.toLowerCase()),a.some((n=>n.includes((0,d.x6)(e).toLowerCase())))})))))(e),((n,a)=>""===e?n:a)),v=(0,o.P1)(p,(e=>e?e.filter((e=>Boolean(e.error))).map((e=>({pluginId:e.id,errorCode:e.error}))):[])),b=e=>(0,o.P1)(u,(n=>{let{requests:a={}}=n;return a[e]})),j=e=>(0,o.P1)(b(e),(e=>(null==e?void 0:e.status)===c.eE.Pending)),y=e=>(0,o.P1)(b(e),(e=>(null==e?void 0:e.status)===c.eE.Rejected?null==e?void 0:e.error:null)),w=e=>{let{query:n="",filterBy:a="installed",filterByType:t="all",sortBy:r=s.Nh.nameAsc}=e;E();const l=(0,i.v9)(x(n,a,t)),{isLoading:o,error:d}=P();return{isLoading:o,error:d,plugins:(0,s.AA)(l,r)}},N=e=>(E(),V(e),(0,i.v9)((n=>m(n,e)))),I=()=>(E(),(0,i.v9)(v)),S=()=>{const e=(0,i.I0)();return(n,a,t)=>e((0,r.N9)({id:n,version:a,isUpdating:t}))},$=()=>{const e=(0,i.I0)();return n=>e((0,r.Tz)(n))},k=()=>null===(0,i.v9)(y(r.tQ.typePrefix)),P=()=>({isLoading:(0,i.v9)(j(r.Qd.typePrefix)),error:(0,i.v9)(y(r.Qd.typePrefix))}),C=()=>({isLoading:(0,i.v9)(j(r.DD.typePrefix)),error:(0,i.v9)(y(r.DD.typePrefix))}),D=()=>({isInstalling:(0,i.v9)(j(r.N9.typePrefix)),error:(0,i.v9)(y(r.N9.typePrefix))}),U=()=>({isUninstalling:(0,i.v9)(j(r.Tz.typePrefix)),error:(0,i.v9)(y(r.Tz.typePrefix))}),E=()=>{const e=(0,i.I0)(),n=(0,i.v9)((a=r.Qd.typePrefix,(0,o.P1)(b(a),(e=>void 0===e))));var a;(0,t.useEffect)((()=>{n&&e((0,r.Qd)())}),[])},V=e=>{const n=(0,i.I0)(),a=(0,i.v9)((n=>m(n,e))),s=!(0,i.v9)(j(r.DD.typePrefix))&&a&&!a.details;(0,t.useEffect)((()=>{s&&n((0,r.DD)(e))}),[a])},z=()=>{const e=(0,i.I0)();return{displayMode:(0,i.v9)(g),setDisplayMode:n=>e((0,l.UC)(n))}}},62619:(e,n,a)=>{a.d(n,{O:()=>d,d:()=>c});var t=a(37729),i=a(67273),s=a(3276),r=a(32738),l=a(1714),o=a(66240);async function d(e){const n=await(0,l.a)(e);let a;if(n.type===t.zV.app&&(a=await(0,o.Av)(n)),n.type===t.zV.datasource&&(a=await(0,o.nL)(n)),n.type===t.zV.panel){a=await(0,r._2)(n)}if(n.type===t.zV.renderer&&(a={meta:n}),!a)throw new Error("Unknown Plugin type: "+n.type);return a}function c(e,n,a){var t,r;if(!i.v.featureToggles.topnav)return n;const l=(0,s.h)(a,"apps").main,o=Object.assign({},l),d=i.v.appSubUrl+e.pathname+e.search;let c;return o.children=(null!==(t=null==o?void 0:o.children)&&void 0!==t?t:[]).map((e=>e.children?Object.assign({},e,{children:e.children.map((e=>{var n;return d.startsWith(null!==(n=e.url)&&void 0!==n?n:"")?(c=Object.assign({},e,{active:!0}),c):e}))}):e)),{main:o,node:null!==(r=c)&&void 0!==r?r:o}}}}]);
//# sourceMappingURL=PluginPage.44233a55a31ec78216e0.js.map