File: //proc/self/root/opt/netdata/netdata-web-files/v3/2117.0bb7a6f0b9bc3fad2a89.chunk.js
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"924951b7e9646327aedf6a644e4ade24c230a2be"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3e2c65d0-6fb0-498f-86c1-8e1febd64d65",e._sentryDebugIdIdentifier="sentry-dbid-3e2c65d0-6fb0-498f-86c1-8e1febd64d65")}catch(e){}}(),(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[2117,5187],{72117(e,t,n){n.r(t),n.d(t,{default:()=>b});n(27495);var o=n(96540),r=n(46587),c=n(26276),l=n(45187),a=(n(98992),n(54520),n(3949),n(64467)),d=n(89942);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){(0,a.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const f=()=>{const e=(0,d.PP)(),{referralModalOpen:t}=e,{isInitialized:n}=(0,l.R)();(0,o.useEffect)((()=>{"true"==t&&n&&"function"===typeof window.Cello&&(window.Cello("open"),(0,d.Z8)(s(s({},e),{},{referralModalOpen:"false"})))}),[n,t])};var u=n(3319),p=n(78152);const b=()=>{const e=(0,r.uW)(),{init:t}=(0,l.R)(),{sendLog:n}=(0,u.A)(),a=(0,o.useMemo)((()=>p.GW&&e&&!e.isAnonymous),[e]);return f(),(0,o.useEffect)((()=>{let e=null;return a&&(window.cello=window.cello||{cmd:[]},e=(0,c._D)(),document.head.appendChild(e)),()=>{e&&document.head.removeChild(e)}}),[a]),(0,o.useEffect)((()=>{const{token:o,productId:r}=(0,c.sA)();if(a&&o&&r&&e.name){var l,d;const c=(null===(l=e.name)||void 0===l||null===(d=l.split)||void 0===d?void 0:d.call(l," "))||[],a=c.length>0?c[0]:"";window.cello.cmd.push((async function(c){try{await c.boot({productId:r,token:o,language:"en",productUserDetails:{firstName:a,fullName:e.name,email:e.email}}),t()}catch(l){n({feature:"ReferralComponent",error:l.message||"Failed to boot cello referral component"})}}))}}),[a,e,t]),null}},45187(e,t,n){n.d(t,{R:()=>d,H:()=>i});n(62953);var o=n(34843),r=n(52035);const c=(0,r.eU)(!1),l=(0,r.eU)(!1);var a=n(96540);const d=()=>{const[e,t]=(0,o.fp)(c);return{isInitialized:e,init:(0,a.useCallback)((()=>t(!0)),[t])}},i=()=>{const[e,t]=(0,o.fp)(l);return{isActive:e,activate:(0,a.useCallback)((()=>t(!0)),[t]),deactivate:(0,a.useCallback)((()=>t(!1)),[t])}}}}]);