"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[53],{27214:(t,e,i)=>{i.r(e),i.d(e,{plugin:()=>c});var s=i(19177),n=i(62709),o=i(55498),a=i(76687),d=i(90614),r=i(17292),h=i(71980),p=i(52010);function l(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class u extends a.Component{constructor(t){super(t),l(this,"element",void 0),l(this,"initElement",(t=>(this.element=new r.f(n.e,t.options.root),this.updateSize(t),this.element.updateData(this.dims),this.element))),l(this,"updateSize",(t=>{const{width:e,height:i}=t;this.element.options.constraint={vertical:d.fJ.Top,horizontal:d._5.Left},this.element.options.placement={left:0,top:0,width:e,height:i}})),l(this,"dims",{getColor:t=>(0,h.FP)(this.props.data,t),getScale:t=>(0,h.pb)(this.props.data,t),getScalar:t=>(0,h.z2)(this.props.data,t),getText:t=>(0,h.WO)(this.props.data,t),getResource:t=>(0,h.Qz)(this.props.data,t)}),this.element=this.initElement(t)}shouldComponentUpdate(t){var e,i;const{width:s,height:n,data:o}=this.props;let a=!1;return s===t.width&&n===t.height||(this.updateSize(t),a=!0),o!==t.data&&(this.element.updateData(this.dims),a=!0),(null===(e=this.props.options)||void 0===e?void 0:e.root)!==(null===(i=t.options)||void 0===i?void 0:i.root)&&(this.initElement(t),a=!0),a}render(){const{width:t,height:e}=this.props;return(0,p.jsx)("div",{style:{width:t,height:e,overflow:"hidden",position:"relative"},children:this.element.render()})}}const g={root:{config:{path:{mode:h.Q8.Fixed,fixed:"img/icons/unicons/analysis.svg"},fill:{fixed:"green"}}}},c=new s.PanelPlugin(u).setNoPadding().useFieldConfig({standardOptions:{[s.FieldConfigProperty.Mappings]:{settings:{icon:!0}}}}).setPanelOptions((t=>{t.addNestedOptions({category:["Icon"],path:"root",build:(t,e)=>{n.e.registerOptionsUI(t,e),o.I.addBackground(t,e),o.I.addBorder(t,e)},defaultValue:g.root})}))}}]);
//# sourceMappingURL=iconPanel.825951b339dd07780b21.js.map