!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"95b7c22eb8a2502481fe65c08f3bb8d7c317f943"};var r=(new e.Error).stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="c965806f-ee80-4ce0-adc9-eaa3bab364e3",e._sentryDebugIdIdentifier="sentry-dbid-c965806f-ee80-4ce0-adc9-eaa3bab364e3")}catch(e){}}(),(globalThis.webpackChunkcloud_frontend=globalThis.webpackChunkcloud_frontend||[]).push([[247],{25059(e,r,t){t.d(r,{A:()=>d});var o=t(96540),l=t(882),n=t(22337),a=t(66188),i=t(11759),s=t(53450),c=t(74848);const d=e=>{let{onClose:r,provider:t,setProvider:d,setGoogleApiKey:g}=e;const u=(0,l.useTheme)(),f=(0,s.Pq)(),[p,b]=(0,o.useState)(t),[y,h]=(0,o.useState)(f.googleApiKey||""),[x,m]=(0,o.useState)(!1),S=e=>(0,i.getColor)(e)({theme:u}),v=(0,o.useCallback)(()=>{p===s.mK.google&&g(y.trim()),d(p),r()},[p,y,d,g,r]),j=p===s.mK.google&&!y.trim(),k=e=>{return{flex:1,border:`1px solid ${S(e?"primary":"borderSecondary")}`,background:e?(r="primary",t=.1,(0,i.getRgbColor)(r,t)({theme:u})):"transparent"};var r,t};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(i.Box,{position:"fixed",style:{inset:0,zIndex:9},onClick:r}),(0,c.jsxs)(i.Flex,{column:!0,padding:[3],gap:3,round:2,background:"mainBackground",border:{color:"borderSecondary"},position:"absolute",width:"280px",zIndex:10,style:{top:44,right:10,boxShadow:"0 4px 16px rgba(0,0,0,0.15)"},children:[(0,c.jsx)(i.TextMicro,{strong:!0,color:"textLite",children:"MAP PROVIDER"}),(0,c.jsxs)(i.Flex,{gap:1,children:[(0,c.jsx)(i.Button,{flavour:"borderless",small:!0,onClick:()=>b(s.mK.libre),"aria-label":"Select OpenStreetMap provider",style:k(p===s.mK.libre),children:"OpenStreetMap (Free)"}),(0,c.jsx)(i.Button,{flavour:"borderless",small:!0,onClick:()=>b(s.mK.google),"aria-label":"Select Google Maps provider",style:k(p===s.mK.google),children:"Google Maps"})]}),p===s.mK.google&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(i.TextMicro,{strong:!0,color:"textLite",children:"GOOGLE MAPS API KEY"}),(0,c.jsx)(i.TextInput,{type:x?"text":"password",value:y,onChange:e=>h(e.target.value),placeholder:"AIzaSy...","aria-label":"Google Maps API key",size:"small",iconRight:(0,c.jsx)(i.Button,{flavour:"borderless",onClick:()=>m(e=>!e),"aria-label":x?"Hide API key":"Show API key",style:{padding:2,minWidth:"auto",height:"auto"},children:(0,c.jsx)(n.gc,{icon:x?a.pS3:a.k6j,size:"sm"})})}),(0,c.jsx)(i.TextMicro,{color:"textLite",children:"Required for Google Maps. Get a key from the Google Cloud Console."})]}),(0,c.jsx)(i.Button,{onClick:v,disabled:j,"aria-label":"Save map settings",children:j?"API key required":"Save"})]})]})}},53450(e,r,t){t.d(r,{DQ:()=>a,DT:()=>u,Ez:()=>s,FU:()=>O,Ii:()=>l,KC:()=>d,Pq:()=>y,RN:()=>h,Sz:()=>x,_s:()=>S,aM:()=>n,ap:()=>I,cE:()=>j,cF:()=>v,dD:()=>m,e9:()=>A,fK:()=>C,jf:()=>K,l6:()=>w,mK:()=>p,nD:()=>i,p9:()=>g,s2:()=>c,z1:()=>k,zc:()=>f});t(33110),t(98992),t(81454);var o=t(81395);const l={lat:30,lng:10},n=2,a=2,i=20,s={live:"#00ab44",stale:"#c59c12",offline:"#8c8c8c",unseen:"#b3b3b3"},c={critical:"#ff4136",warning:"#ffc300"},d=10,g=12,u=18,f=40,p={libre:"libre",google:"google"},b="netdata-geomap-settings",y=()=>{try{const e=localStorage.getItem(b);if(e)return JSON.parse(e)}catch{}return{provider:p.libre,googleApiKey:""}},h=e=>{try{localStorage.setItem(b,JSON.stringify(e))}catch{}},x=()=>{const{googleApiKey:e}=y();return window.NETDATA_GOOGLE_MAPS_API_KEY||e||""},m=()=>!!x(),S=()=>{const{provider:e}=y();return e===p.google&&m()?p.google:p.libre},v=60,j=16,k=.8,A=.5,O=.2,I=1.2,K=1.8,w=300,C=e=>{const r=e?1:0;return{mixed:o.default[2][r],mostOffline:o.default[9][r]}}},32017(e){e.exports=function e(r,t){if(r===t)return!0;if(r&&t&&"object"==typeof r&&"object"==typeof t){if(r.constructor!==t.constructor)return!1;var o,l,n;if(Array.isArray(r)){if((o=r.length)!=t.length)return!1;for(l=o;0!==l--;)if(!e(r[l],t[l]))return!1;return!0}if(r.constructor===RegExp)return r.source===t.source&&r.flags===t.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===t.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===t.toString();if((o=(n=Object.keys(r)).length)!==Object.keys(t).length)return!1;for(l=o;0!==l--;)if(!Object.prototype.hasOwnProperty.call(t,n[l]))return!1;for(l=o;0!==l--;){var a=n[l];if(!e(r[a],t[a]))return!1}return!0}return r!==r&&t!==t}}}]);