You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
1.0 MiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

!function(i){function webpackJsonpCallback(s){for(var v,y,_=s[0],T=s[1],x=s[2],R=0,P=[];R<_.length;R++)y=_[R],Object.prototype.hasOwnProperty.call(o,y)&&o[y]&&P.push(o[y][0]),o[y]=0;for(v in T)Object.prototype.hasOwnProperty.call(T,v)&&(i[v]=T[v]);for(S&&S(s);P.length;)P.shift()();return h.push.apply(h,x||[]),checkDeferredModules()}function checkDeferredModules(){for(var i,s=0;s<h.length;s++){for(var v=h[s],y=!0,_=1;_<v.length;_++){var S=v[_];0!==o[S]&&(y=!1)}y&&(h.splice(s--,1),i=__webpack_require__(__webpack_require__.s=v[0]))}return i}var s={},o={28:0},h=[];function __webpack_require__(o){if(s[o])return s[o].exports;var h=s[o]={i:o,l:!1,exports:{}};return i[o].call(h.exports,h,h.exports,__webpack_require__),h.l=!0,h.exports}__webpack_require__.e=function requireEnsure(){return Promise.resolve()},__webpack_require__.m=i,__webpack_require__.c=s,__webpack_require__.d=function(i,s,o){__webpack_require__.o(i,s)||Object.defineProperty(i,s,{enumerable:!0,get:o})},__webpack_require__.r=function(i){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},__webpack_require__.t=function(i,s){if(1&s&&(i=__webpack_require__(i)),8&s)return i;if(4&s&&"object"==typeof i&&i&&i.__esModule)return i;var o=Object.create(null);if(__webpack_require__.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:i}),2&s&&"string"!=typeof i)for(var h in i)__webpack_require__.d(o,h,function(s){return i[s]}.bind(null,h));return o},__webpack_require__.n=function(i){var s=i&&i.__esModule?function getDefault(){return i.default}:function getModuleExports(){return i};return __webpack_require__.d(s,"a",s),s},__webpack_require__.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},__webpack_require__.p="";var v=window.webpackJsonp=window.webpackJsonp||[],y=v.push.bind(v);v.push=webpackJsonpCallback,v=v.slice();for(var _=0;_<v.length;_++)webpackJsonpCallback(v[_]);var S=y;h.push([8267,1,0]),checkDeferredModules()}({1134:function(i,s,o){var h;!function(v,y){i.exports?(y.default=y,i.exports=v.document?y(v):y):void 0===(h=function(){return y(v)}.call(s,o,s,i))||(i.exports=h)}("undefined"!=typeof window?window:this,(function(i){function O(i,s,o,h){i.hasOwnProperty(s)||(i[s]=h.apply(null,o))}var s={};return O(s,"Core/Globals.js",[],(function(){var s=void 0!==i?i:"undefined"!=typeof window?window:{},o=s.document,h=s.navigator&&s.navigator.userAgent||"",v=o&&o.createElementNS&&!!o.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,y=/(edge|msie|trident)/i.test(h)&&!s.opera,_=-1!==h.indexOf("Firefox"),S=-1!==h.indexOf("Chrome"),T=_&&4>parseInt(h.split("Firefox/")[1],10),r=function(){};return{product:"Highcharts",version:"9.0.0",deg2rad:2*Math.PI/360,doc:o,hasBidiBug:T,hasTouch:!!s.TouchEvent,isMS:y,isWebKit:-1!==h.indexOf("AppleWebKit"),isFirefox:_,isChrome:S,isSafari:!S&&-1!==h.indexOf("Safari"),isTouchDevice:/(Mobile|Android|Windows Phone)/.test(h),SVG_NS:"http://www.w3.org/2000/svg",chartCount:0,seriesTypes:{},supportsPassiveEvents:function(){var i=!1;if(!y){var o=Object.defineProperty({},"passive",{get:function(){i=!0}});s.addEventListener&&s.removeEventListener&&(s.addEventListener("testPassive",r,o),s.removeEventListener("testPassive",r,o))}return i}(),symbolSizes:{},svg:v,win:s,marginNames:["plotTop","marginRight","marginBottom","plotLeft"],noop:r,charts:[],dateFormats:{}}})),O(s,"Core/Utilities.js",[s["Core/Globals.js"]],(function(i){function b(i,s,o,h){var y=s?"Highcharts error":"Highcharts warning";32===i&&(i=y+": Deprecated member");var _=k(i),S=_?y+" #"+i+": www.highcharts.com/errors/"+i+"/":i.toString();if(y=function(){if(s)throw Error(S);v.console&&-1===b.messages.indexOf(S)&&console.warn(S)},void 0!==h){var T="";_&&(S+="?"),m(h,(function(i,s){T+="\n - "+s+": "+i,_&&(S+=encodeURI(s)+"="+encodeURI(i))})),S+=T}o?d(o,"displayError",{code:i,message:S,params:h},y):y(),b.messages.push(S)}function l(){var i,s=arguments,o={},d=function(i,s){return"object"!=typeof i&&(i={}),m(s,(function(o,h){"__proto__"!==h&&"constructor"!==h&&(!H(o,!0)||A(o)||r(o)?i[h]=s[h]:i[h]=d(i[h]||{},o))})),i};!0===s[0]&&(o=s[1],s=Array.prototype.slice.call(s,2));var h=s.length;for(i=0;i<h;i++)o=d(o,s[i]);return o}function D(i,s){return parseInt(i,s||10)}function F(i){return"string"==typeof i}function E(i){return"[object Array]"===(i=Object.prototype.toString.call(i))||"[object Array Iterator]"===i}function H(i,s){return!(!i||"object"!=typeof i||s&&E(i))}function r(i){return H(i)&&"number"==typeof i.nodeType}function A(i){var s=i&&i.constructor;return!(!H(i,!0)||r(i)||!s||!s.name||"Object"===s.name)}function k(i){return"number"==typeof i&&!isNaN(i)&&1/0>i&&-1/0<i}function C(i){return null!=i}function g(i,s,o){var h;return F(s)?C(o)?i.setAttribute(s,o):i&&i.getAttribute&&((h=i.getAttribute(s))||"class"!==s||(h=i.getAttribute(s+"Name"))):m(s,(function(s,o){i.setAttribute(o,s)})),h}function q(i,s){var o;for(o in i||(i={}),s)i[o]=s[o];return i}function f(){for(var i=arguments,s=i.length,o=0;o<s;o++){var h=i[o];if(null!=h)return h}}function p(s,o){i.isMS&&!i.svg&&o&&void 0!==o.opacity&&(o.filter="alpha(opacity="+100*o.opacity+")"),q(s.style,o)}function B(i,s,o,v,y){return i=h.createElement(i),s&&q(i,s),y&&p(i,{padding:"0",border:"none",margin:"0"}),o&&p(i,o),v&&v.appendChild(i),i}function I(i,s){return parseFloat(i.toPrecision(s||14))}function Q(s,o,h,v){s=+s||0,o=+o;var y=i.defaultOptions.lang,_=(s.toString().split(".")[1]||"").split("e")[0].length,S=s.toString().split("e"),T=o;if(-1===o)o=Math.min(_,20);else if(k(o)){if(o&&S[1]&&0>S[1]){var x=o+ +S[1];0<=x?(S[0]=(+S[0]).toExponential(x).split("e")[0],o=x):(S[0]=S[0].split(".")[0]||0,s=20>o?(S[0]*Math.pow(10,S[1])).toFixed(o):0,S[1]=0)}}else o=2;var R=(Math.abs(S[1]?S[0]:s)+Math.pow(10,-Math.max(o,_)-1)).toFixed(o);return x=3<(_=String(D(R))).length?_.length%3:0,h=f(h,y.decimalPoint),v=f(v,y.thousandsSep),s=(0>s?"-":"")+(x?_.substr(0,x)+v:""),s=0>+S[1]&&!T?"0":s+_.substr(x).replace(/(\d{3})(?=\d)/g,"$1"+v),o&&(s+=h+R.slice(-o)),S[1]&&0!=+s&&(s+="e"+S[1]),s}function z(i,s){if(!i)return s;var o=i.split(".").reverse();if(1===o.length)return s[i];for(i=o.pop();void 0!==i&&null!=s;)s=s[i],i=o.pop();return s}function m(i,s,o){for(var h in i)Object.hasOwnProperty.call(i,h)&&s.call(o||i[h],i[h],h,i)}function t(s,o,h){function d(o,h){var v=s.removeEventListener||i.removeEventListenerPolyfill;v&&v.call(s,o,h,!1)}function n(i){var h;if(s.nodeName){if(o){var v={};v[o]=!0}else v=i;m(v,(function(s,o){if(i[o])for(h=i[o].length;h--;)d(o,i[o][h].fn)}))}}var v="function"==typeof s&&s.prototype||s;if(Object.hasOwnProperty.call(v,"hcEvents")){var y=v.hcEvents;o?(v=y[o]||[],h?(y[o]=v.filter((function(i){return h!==i.fn})),d(o,h)):(n(y),y[o]=[])):(n(y),delete v.hcEvents)}}function d(i,s,o,v){if(o=o||{},h.createEvent&&(i.dispatchEvent||i.fireEvent)){var y=h.createEvent("Events");y.initEvent(s,!0,!0),q(y,o),i.dispatchEvent?i.dispatchEvent(y):i.fireEvent(s,y)}else if(i.hcEvents){o.target||q(o,{preventDefault:function(){o.defaultPrevented=!0},target:i,type:s}),y=[];for(var _=i,S=!1;_.hcEvents;)Object.hasOwnProperty.call(_,"hcEvents")&&_.hcEvents[s]&&(y.length&&(S=!0),y.unshift.apply(y,_.hcEvents[s])),_=Object.getPrototypeOf(_);S&&y.sort((function(i,s){return i.order-s.order})),y.forEach((function(s){!1===s.fn.call(i,o)&&o.preventDefault()}))}v&&!o.defaultPrevented&&v.call(i,o)}var s,o=i.charts,h=i.doc,v=i.win;(b||(b={})).messages=[],Math.easeInOutSine=function(i){return-.5*(Math.cos(Math.PI*i)-1)};var y=Array.prototype.find?function(i,s){return i.find(s)}:function(i,s){var o,h=i.length;for(o=0;o<h;o++)if(s(i[o],o))return i[o]};m({map:"map",each:"forEach",grep:"filter",reduce:"reduce",some:"some"},(function(s,o){i[o]=function(i){var h;return b(32,!1,void 0,((h={})["Highcharts."+o]="use Array."+s,h)),Array.prototype[s].apply(i,[].slice.call(arguments,1))}}));var _,S=function(){var i=Math.random().toString(36).substring(2,9)+"-",s=0;return function(){return"highcharts-"+(_?"":i)+s++}}(),T=i.getOptions=function(){return i.defaultOptions},x=i.setOptions=function(s){return i.defaultOptions=l(!0,i.defaultOptions,s),(s.time||s.global)&&i.time.update(l(i.defaultOptions.global,i.defaultOptions.time,s.global,s.time)),i.defaultOptions};return v.jQuery&&(v.jQuery.fn.highcharts=function(){var s=[].slice.call(arguments);if(this[0])return s[0]?(new(i[F(s[0])?s.shift():"Chart"])(this[0],s[0],s[1]),this):o[g(this[0],"data-highcharts-chart")]}),{addEvent:function(s,o,h,v){void 0===v&&(v={});var y="function"==typeof s&&s.prototype||s;Object.hasOwnProperty.call(y,"hcEvents")||(y.hcEvents={}),y=y.hcEvents,i.Point&&s instanceof i.Point&&s.series&&s.series.chart&&(s.series.chart.runTrackerClick=!0);var _=s.addEventListener||i.addEventListenerPolyfill;return _&&_.call(s,o,h,!!i.supportsPassiveEvents&&{passive:void 0===v.passive?-1!==o.indexOf("touch"):v.passive,capture:!1}),y[o]||(y[o]=[]),y[o].push({fn:h,order:"number"==typeof v.order?v.order:1/0}),y[o].sort((function(i,s){return i.order-s.order})),function(){t(s,o,h)}},arrayMax:function(i){for(var s=i.length,o=i[0];s--;)i[s]>o&&(o=i[s]);return o},arrayMin:function(i){for(var s=i.length,o=i[0];s--;)i[s]<o&&(o=i[s]);return o},attr:g,clamp:function(i,s,o){return i>s?i<o?i:o:s},cleanRecursively:function w(i,s){var o={};return m(i,(function(h,v){H(i[v],!0)&&!i.nodeType&&s[v]?(h=w(i[v],s[v]),Object.keys(h).length&&(o[v]=h)):(H(i[v])||i[v]!==s[v])&&(o[v]=i[v])})),o},clearTimeout:function(i){C(i)&&clearTimeout(i)},correctFloat:I,createElement:B,css:p,defined:C,destroyObjectProperties:function(i,s){m(i,(function(o,h){o&&o!==s&&o.destroy&&o.destroy(),delete i[h]}))},discardElement:function(i){s||(s=B("div")),i&&s.appendChild(i),s.innerHTML=""},erase:function(i,s){for(var o=i.length;o--;)if(i[o]===s){i.splice(o,1);break}},error:b,extend:q,extendClass:function(i,s){var u=function(){};return q(u.prototype=new i,s),u},find:y,fireEvent:d,format:function(s,o,h){var v="{",y=!1,_=[],S=/f$/,T=/\.([0-9])/,x=i.defaultOptions.lang,R=h&&h.time||i.time;for(h=h&&h.numberFormatter||Q;s;){var P=s.indexOf(v);if(-1===P)break;var L=s.slice(0,P);if(y){if(v=z((L=L.split(":")).shift()||"",o),L.length&&"number"==typeof v)if(L=L.join(":"),S.test(L)){var N=parseInt((L.match(T)||["","-1"])[1],10);null!==v&&(v=h(v,N,x.decimalPoint,-1<L.indexOf(",")?x.thousandsSep:""))}else v=R.dateFormat(L,v);_.push(v)}else _.push(L);s=s.slice(P+1),v=(y=!y)?"}":"{"}return _.push(s),_.join("")},getMagnitude:function(i){return Math.pow(10,Math.floor(Math.log(i)/Math.LN10))},getNestedProperty:z,getOptions:T,getStyle:function(s,o,h){return"width"===o?(o=Math.min(s.offsetWidth,s.scrollWidth),(h=s.getBoundingClientRect&&s.getBoundingClientRect().width)<o&&h>=o-1&&(o=Math.floor(h)),Math.max(0,o-i.getStyle(s,"padding-left")-i.getStyle(s,"padding-right"))):"height"===o?Math.max(0,Math.min(s.offsetHeight,s.scrollHeight)-i.getStyle(s,"padding-top")-i.getStyle(s,"padding-bottom")):(v.getComputedStyle||b(27,!0),(s=v.getComputedStyle(s,void 0))&&(s=s.getPropertyValue(o),f(h,"opacity"!==o)&&(s=D(s))),s)},inArray:function(i,s,o){return b(32,!1,void 0,{"Highcharts.inArray":"use Array.indexOf"}),s.indexOf(i,o)},isArray:E,isClass:A,isDOMElement:r,isFunction:function(i){return"function"==typeof i},isNumber:k,isObject:H,isString:F,keys:function(i){return b(32,!1,void 0,{"Highcharts.keys":"use Object.keys"}),Object.keys(i)},merge:l,normalizeTickInterval:function(i,s,o,h,v){var y=i,_=i/(o=f(o,1));for(s||(s=v?[1,1.2,1.5,2,2.5,3,4,5,6,8,10]:[1,2,2.5,5,10],!1===h&&(1===o?s=s.filter((function(i){return 0==i%1})):.1>=o&&(s=[1/o]))),h=0;h<s.length&&(y=s[h],!(v&&y*o>=i||!v&&_<=(s[h]+(s[h+1]||s[h]))/2));h++);return I(y*o,-Math.round(Math.log(.001)/Math.LN10))},numberFormat:Q,objectEach:m,offset:function(i){var s=h.documentElement;return{top:(i=i.parentElement||i.parentNode?i.getBoundingClientRect():{top:0,left:0}).top+(v.pageYOffset||s.scrollTop)-(s.clientTop||0),left:i.left+(v.pageXOffset||s.scrollLeft)-(s.clientLeft||0)}},pad:function(i,s,o){return Array((s||2)+1-String(i).replace("-","").length).join(o||"0")+i},pick:f,pInt:D,relativeLength:function(i,s,o){return/%$/.test(i)?s*parseFloat(i)/100+(o||0):parseFloat(i)},removeEvent:t,setOptions:x,splat:function(i){return E(i)?i:[i]},stableSort:function(i,s){var o,h,v=i.length;for(h=0;h<v;h++)i[h].safeI=h;for(i.sort((function(i,h){return 0===(o=s(i,h))?i.safeI-h.safeI:o})),h=0;h<v;h++)delete i[h].safeI},syncTimeout:function(i,s,o){return 0<s?setTimeout(i,s,o):(i.call(0,o),-1)},timeUnits:{millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:24192e5,year:314496e5},uniqueKey:S,useSerialIds:function(i){return _=f(i,_)},wrap:function(i,s,o){var h=i[s];i[s]=function(){var i=Array.prototype.slice.call(arguments),s=arguments,v=this;return v.proceed=function(){h.apply(v,arguments.length?arguments:s)},i.unshift(h),i=o.apply(this,i),v.proceed=null,i}}}})),O(s,"Core/Color/Color.js",[s["Core/Globals.js"],s["Core/Utilities.js"]],(function(i,s){var o=s.isNumber,h=s.merge,v=s.pInt;return s=function(){function b(s){return this.parsers=[{regex:/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,parse:function(i){return[v(i[1]),v(i[2]),v(i[3]),parseFloat(i[4],10)]}},{regex:/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,parse:function(i){return[v(i[1]),v(i[2]),v(i[3]),1]}}],this.rgba=[],i.Color!==b?new i.Color(s):this instanceof b?void this.init(s):new b(s)}return b.parse=function(i){return new b(i)},b.prototype.init=function(i){var s,o;if((this.input=i=b.names[i&&i.toLowerCase?i.toLowerCase():""]||i)&&i.stops)this.stops=i.stops.map((function(i){return new b(i[1])}));else{if(i&&i.charAt&&"#"===i.charAt()){var h=i.length;i=parseInt(i.substr(1),16),7===h?s=[(16711680&i)>>16,(65280&i)>>8,255&i,1]:4===h&&(s=[(3840&i)>>4|(3840&i)>>8,(240&i)>>4|240&i,(15&i)<<4|15&i,1])}if(!s)for(o=this.parsers.length;o--&&!s;){var v=this.parsers[o];(h=v.regex.exec(i))&&(s=v.parse(h))}}this.rgba=s||[]},b.prototype.get=function(i){var s=this.input,v=this.rgba;if(void 0!==this.stops){var y=h(s);y.stops=[].concat(y.stops),this.stops.forEach((function(s,o){y.stops[o]=[y.stops[o][0],s.get(i)]}))}else y=v&&o(v[0])?"rgb"===i||!i&&1===v[3]?"rgb("+v[0]+","+v[1]+","+v[2]+")":"a"===i?v[3]:"rgba("+v.join(",")+")":s;return y},b.prototype.brighten=function(i){var s,h=this.rgba;if(this.stops)this.stops.forEach((function(s){s.brighten(i)}));else if(o(i)&&0!==i)for(s=0;3>s;s++)h[s]+=v(255*i),0>h[s]&&(h[s]=0),255<h[s]&&(h[s]=255);return this},b.prototype.setOpacity=function(i){return this.rgba[3]=i,this},b.prototype.tweenTo=function(i,s){var o=this.rgba,h=i.rgba;return h.length&&o&&o.length?s=((i=1!==h[3]||1!==o[3])?"rgba(":"rgb(")+Math.round(h[0]+(o[0]-h[0])*(1-s))+","+Math.round(h[1]+(o[1]-h[1])*(1-s))+","+Math.round(h[2]+(o[2]-h[2])*(1-s))+(i?","+(h[3]+(o[3]-h[3])*(1-s)):"")+")":s=i.input||"none",s},b.names={white:"#ffffff",black:"#000000"},b}(),i.Color=s,i.color=s.parse,s})),O(s,"Core/Color/Palette.js",[],(function(){return{colors:"#7cb5ec #434348 #90ed7d #f7a35c #8085e9 #f15c80 #e4d354 #2b908f #f45b5b #91e8e1".split(" "),backgroundColor:"#ffffff",neutralColor100:"#000000",neutralColor80:"#333333",neutralColor60:"#666666",neutralColor40:"#999999",neutralColor20:"#cccccc",neutralColor10:"#e6e6e6",neutralColor5:"#f2f2f2",neutralColor3:"#f7f7f7",highlightColor100:"#003399",highlightColor80:"#335cad",highlightColor60:"#6685c2",highlightColor20:"#ccd6eb",highlightColor10:"#e6ebf5",indicatorPositiveLine:"#06b535",indicatorNegativeLine:"#f21313"}})),O(s,"Core/Animation/Fx.js",[s["Core/Globals.js"],s["Core/Utilities.js"]],(function(i,s){var o=i.win,h=s.isNumber,v=s.objectEach;return s=function(){function b(i,s,o){this.pos=NaN,this.options=s,this.elem=i,this.prop=o}return b.prototype.dSetter=function(){var i=this.paths,s=i&&i[0];i=i&&i[1];var o=[],v=this.now||0;if(1!==v&&s&&i)if(s.length===i.length&&1>v)for(var y=0;y<i.length;y++){for(var _=s[y],S=i[y],T=[],x=0;x<S.length;x++){var R=_[x],P=S[x];h(R)&&h(P)&&("A"!==S[0]||4!==x&&5!==x)?T[x]=R+v*(P-R):T[x]=P}o.push(T)}else o=i;else o=this.toD||[];this.elem.attr("d",o,void 0,!0)},b.prototype.update=function(){var i=this.elem,s=this.prop,o=this.now,h=this.options.step;this[s+"Setter"]?this[s+"Setter"]():i.attr?i.element&&i.attr(s,o,null,!0):i.style[s]=o+this.unit,h&&h.call(i,o,this)},b.prototype.run=function(i,s,h){var v=this,y=v.options,C=function(i){return!C.stopped&&v.step(i)},_=o.requestAnimationFrame||function(i){setTimeout(i,13)},q=function(){for(var i=0;i<b.timers.length;i++)b.timers[i]()||b.timers.splice(i--,1);b.timers.length&&_(q)};i!==s||this.elem["forceAnimate:"+this.prop]?(this.startTime=+new Date,this.start=i,this.end=s,this.unit=h,this.now=this.start,this.pos=0,C.elem=this.elem,C.prop=this.prop,C()&&1===b.timers.push(C)&&_(q)):(delete y.curAnim[this.prop],y.complete&&0===Object.keys(y.curAnim).length&&y.complete.call(this.elem))},b.prototype.step=function(i){var s=+new Date,o=this.options,h=this.elem,y=o.complete,_=o.duration,S=o.curAnim;if(h.attr&&!h.element)i=!1;else if(i||s>=_+this.startTime){this.now=this.end,this.pos=1,this.update();var T=S[this.prop]=!0;v(S,(function(i){!0!==i&&(T=!1)})),T&&y&&y.call(h),i=!1}else this.pos=o.easing((s-this.startTime)/_),this.now=this.start+(this.end-this.start)*this.pos,this.update(),i=!0;return i},b.prototype.initPath=function(i,s,o){function A(i,s){for(;i.length<R;){var o=i[0],h=s[R-i.length];h&&"M"===o[0]&&(i[0]="C"===h[0]?["C",o[1],o[2],o[1],o[2],o[1],o[2]]:["L",o[1],o[2]]),i.unshift(o),_&&i.push(i[i.length-1])}}function k(i,s){for(;i.length<R;)if("C"===(s=i[i.length/S-1].slice())[0]&&(s[1]=s[5],s[2]=s[6]),_){var o=i[i.length/S].slice();i.splice(i.length/2,0,s,o)}else i.push(s)}var v=i.startX,y=i.endX;s=s&&s.slice(),o=o.slice();var _=i.isArea,S=_?2:1;if(!s)return[o,o];if(v&&y){for(i=0;i<v.length;i++){if(v[i]===y[0]){var T=i;break}if(v[0]===y[y.length-v.length+i]){T=i;var x=!0;break}if(v[v.length-1]===y[y.length-v.length+i]){T=v.length-i;break}}void 0===T&&(s=[])}if(s.length&&h(T)){var R=o.length+T*S;x?(A(s,o),k(o,s)):(A(o,s),k(s,o))}return[s,o]},b.prototype.fillSetter=function(){b.prototype.strokeSetter.apply(this,arguments)},b.prototype.strokeSetter=function(){this.elem.attr(this.prop,i.color(this.start).tweenTo(i.color(this.end),this.pos),null,!0)},b.timers=[],b}(),i.Fx=s,i.timers=s.timers,s})),O(s,"Core/Animation/AnimationUtilities.js",[s["Core/Animation/Fx.js"],s["Core/Globals.js"],s["Core/Utilities.js"]],(function(i,s,o){var h=o.defined,v=o.getStyle,y=o.isArray,_=o.isNumber,S=o.isObject,T=o.merge,x=o.objectEach,R=o.pick;o=s.setAnimation=function(i,s){s.renderer.globalAnimation=R(i,s.options.chart.animation,!0)};var P=s.animObject=function(i){return S(i)?T({duration:500,defer:0},i):{duration:i?500:0,defer:0}},L=s.getDeferredAnimation=function(i,s,o){var v=P(s),y=0,_=0;return(o?[o]:i.series).forEach((function(i){i=P(i.options.animation),y=s&&h(s.defer)?v.defer:Math.max(y,i.duration+i.defer),_=Math.min(v.duration,i.duration)})),i.renderer.forExport&&(y=0),{defer:Math.max(0,y-_),duration:Math.min(y,_)}},N=s.stop=function(s,o){for(var h=i.timers.length;h--;)i.timers[h].elem!==s||o&&o!==i.timers[h].prop||(i.timers[h].stopped=!0)};return{animate:function(s,o,h){var R,P,L,V="";if(!S(h)){var j=arguments;h={duration:j[2],easing:j[3],complete:j[4]}}_(h.duration)||(h.duration=400),h.easing="function"==typeof h.easing?h.easing:Math[h.easing]||Math.easeInOutSine,h.curAnim=T(o),x(o,(function(_,S){N(s,S),L=new i(s,h,S),P=null,"d"===S&&y(o.d)?(L.paths=L.initPath(s,s.pathArray,o.d),L.toD=o.d,R=0,P=1):s.attr?R=s.attr(S):(R=parseFloat(v(s,S))||0,"opacity"!==S&&(V="px")),P||(P=_),P&&P.match&&P.match("px")&&(P=P.replace(/px/g,"")),L.run(R,P,V)}))},animObject:P,getDeferredAnimation:L,setAnimation:o,stop:N}})),O(s,"Core/Renderer/HTML/AST.js",[s["Core/Globals.js"],s["Core/Utilities.js"]],(function(i,s){var o=s.attr,h=s.createElement,v=s.discardElement,y=s.error,_=s.objectEach,S=s.splat;return function(){function b(i){this.nodes="string"==typeof i?this.parseMarkup(i):i}return b.filterUserAttributes=function(i){return _(i,(function(s,o){var h=!0;-1===b.allowedAttributes.indexOf(o)&&(h=!1),-1!==["background","dynsrc","href","lowsrc","src"].indexOf(o)&&(h=/^(http|\/)/.test(s)),h||(y("Highcharts warning: Invalid attribute '"+o+"' in config"),delete i[o])})),i},b.setElementHTML=function(i,s){i.innerHTML="",s&&new b(s).addToDOM(i)},b.prototype.addToDOM=function(s){var h=s.namespaceURI||i.SVG_NS;return function k(s,v){var T;return S(s).forEach((function(s){var S=s.tagName,x=s.textContent?i.doc.createTextNode(s.textContent):void 0;if(S)if("#text"===S)var R=x;else if(-1!==b.allowedTags.indexOf(S)){S=i.doc.createElementNS(h,S);var P=s.attributes||{};_(s,(function(i,s){"tagName"!==s&&"attributes"!==s&&"children"!==s&&"textContent"!==s&&(P[s]=i)})),o(S,b.filterUserAttributes(P)),x&&S.appendChild(x),k(s.children||[],S),R=S}else y("Highcharts warning: Invalid tagName '"+S+"' in config");R&&v.appendChild(R),T=R})),T}(this.nodes,s)},b.prototype.parseMarkup=function(i){var s=[];if(/MSIE 9.0/.test(navigator.userAgent)||"undefined"==typeof DOMParser){var o=h("div");o.innerHTML=i,i={body:o}}else i=(new DOMParser).parseFromString(i,"text/html");var g=function(i,s){var o=i.nodeName.toLowerCase(),h={tagName:o};if("#text"===o){if(o=i.textContent||"",/^[\s]*$/.test(o))return;h.textContent=o}if(o=i.attributes){var v={};[].forEach.call(o,(function(i){v[i.name]=i.value})),h.attributes=v}if(i.childNodes.length){var y=[];[].forEach.call(i.childNodes,(function(i){g(i,y)})),y.length&&(h.children=y)}s.push(h)};return[].forEach.call(i.body.childNodes,(function(i){return g(i,s)})),o&&v(o),s},b.allowedTags="a b br button caption circle code div em feComponentTransfer feFuncA feFuncB feFuncG feFuncR feGaussianBlur feOffset feMerge feMergeNode filter h1 h2 h3 h4 h5 h6 hr i img li linearGradient marker ol p path pattern pre rect small span stop strong style sub sup table text thead tbody tspan td th tr ul #text".split(" "),b.allowedAttributes="aria-controls aria-describedby aria-expanded aria-haspopup aria-hidden aria-label aria-labelledby aria-live aria-pressed aria-readonly aria-roledescription aria-selected class color colspan cx cy d dx dy disabled fill height href id in markerHeight markerWidth offset opacity orient padding paddingLeft patternUnits r refX refY role scope slope src startOffset stdDeviation stroke stroke-linecap stroke-width style result rowspan summary tabindex text-align textAnchor textLength type valign width x x1 xy y y1 y2 zIndex".split(" "),b}()})),O(s,"Core/Renderer/SVG/SVGElement.js",[s["Core/Animation/AnimationUtilities.js"],s["Core/Renderer/HTML/AST.js"],s["Core/Color/Color.js"],s["Core/Globals.js"],s["Core/Color/Palette.js"],s["Core/Utilities.js"]],(function(i,s,o,h,v,y){var _=i.animate,S=i.animObject,T=i.stop,x=h.deg2rad,R=h.doc,P=h.hasTouch,L=h.noop,N=h.svg,V=h.SVG_NS,j=h.win,W=y.attr,K=y.createElement,U=y.css,Y=y.defined,$=y.erase,X=y.extend,Z=y.fireEvent,ee=y.isArray,te=y.isFunction,ie=y.isNumber,ae=y.isString,ne=y.merge,re=y.objectEach,se=y.pick,le=y.pInt,oe=y.syncTimeout,de=y.uniqueKey;return(i=function(){function G(){this.height=this.element=void 0,this.opacity=1,this.renderer=void 0,this.SVG_NS=V,this.symbolCustomAttribs="x y width height r start end innerR anchorX anchorY rounded".split(" "),this.width=void 0}return G.prototype._defaultGetter=function(i){return i=se(this[i+"Value"],this[i],this.element?this.element.getAttribute(i):null,0),/^[\-0-9\.]+$/.test(i)&&(i=parseFloat(i)),i},G.prototype._defaultSetter=function(i,s,o){o.setAttribute(s,i)},G.prototype.add=function(i){var s=this.renderer,o=this.element;if(i&&(this.parentGroup=i),this.parentInverted=i&&i.inverted,void 0!==this.textStr&&"text"===this.element.nodeName&&s.buildText(this),this.added=!0,!i||i.handleZ||this.zIndex)var h=this.zIndexSetter();return h||(i?i.element:s.box).appendChild(o),this.onAdd&&this.onAdd(),this},G.prototype.addClass=function(i,s){var o=s?"":this.attr("class")||"";return(i=(i||"").split(/ /g).reduce((function(i,s){return-1===o.indexOf(s)&&i.push(s),i}),o?[o]:[]).join(" "))!==o&&this.attr("class",i),this},G.prototype.afterSetters=function(){this.doTransform&&(this.updateTransform(),this.doTransform=!1)},G.prototype.align=function(i,s,o){var h,v,y,_={},S=this.renderer,T=S.alignedObjects;i?(this.alignOptions=i,this.alignByTranslate=s,(!o||ae(o))&&(this.alignTo=h=o||"renderer",$(T,this),T.push(this),o=void 0)):(i=this.alignOptions,s=this.alignByTranslate,h=this.alignTo),o=se(o,S[h],S),h=i.align,S=i.verticalAlign,T=(o.x||0)+(i.x||0);var x=(o.y||0)+(i.y||0);return"right"===h?v=1:"center"===h&&(v=2),v&&(T+=(o.width-(i.width||0))/v),_[s?"translateX":"x"]=Math.round(T),"bottom"===S?y=1:"middle"===S&&(y=2),y&&(x+=(o.height-(i.height||0))/y),_[s?"translateY":"y"]=Math.round(x),this[this.placed?"animate":"attr"](_),this.placed=!0,this.alignAttr=_,this},G.prototype.alignSetter=function(i){var s={left:"start",center:"middle",right:"end"};s[i]&&(this.alignValue=i,this.element.setAttribute("text-anchor",s[i]))},G.prototype.animate=function(i,s,o){var h=this,v=S(se(s,this.renderer.globalAnimation,!0));return s=v.defer,se(R.hidden,R.msHidden,R.webkitHidden,!1)&&(v.duration=0),0!==v.duration?(o&&(v.complete=o),oe((function(){h.element&&_(h,i,v)}),s)):(this.attr(i,void 0,o),re(i,(function(i,s){v.step&&v.step.call(this,i,{prop:s,pos:1,elem:this})}),this)),this},G.prototype.applyTextOutline=function(i){var s=this.element;-1!==i.indexOf("contrast")&&(i=i.replace(/contrast/g,this.renderer.getContrast(s.style.fill)));var o=i.split(" ");if(i=o[o.length-1],(o=o[0])&&"none"!==o&&h.svg){this.fakeTS=!0,this.ySetter=this.xSetter,o=o.replace(/(^[\d\.]+)(.*?)$/g,(function(i,s,o){return 2*Number(s)+o})),this.removeTextOutline();var v=R.createElementNS(V,"tspan");W(v,{class:"highcharts-text-outline",fill:i,stroke:i,"stroke-width":o,"stroke-linejoin":"round"}),[].forEach.call(s.childNodes,(function(i){var s=i.cloneNode(!0);s.removeAttribute&&["fill","stroke","stroke-width","stroke"].forEach((function(i){return s.removeAttribute(i)})),v.appendChild(s)})),(i=R.createElementNS(V,"tspan")).textContent="",W(i,{x:s.getAttribute("x"),y:s.getAttribute("y")}),v.appendChild(i),s.insertBefore(v,s.firstChild)}},G.prototype.attr=function(i,s,o,h){var v,y,_,S=this.element,x=this,R=this.symbolCustomAttribs;if("string"==typeof i&&void 0!==s){var P=i;(i={})[P]=s}return"string"==typeof i?x=(this[i+"Getter"]||this._defaultGetter).call(this,i,S):(re(i,(function(s,o){y=!1,h||T(this,o),this.symbolName&&-1!==R.indexOf(o)&&(v||(this.symbolAttr(i),v=!0),y=!0),!this.rotation||"x"!==o&&"y"!==o||(this.doTransform=!0),y||((_=this[o+"Setter"]||this._defaultSetter).call(this,s,o,S),!this.styledMode&&this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(o)&&this.updateShadows(o,s,_))}),this),this.afterSetters()),o&&o.call(this),x},G.prototype.clip=function(i){return this.attr("clip-path",i?"url("+this.renderer.url+"#"+i.id+")":"none")},G.prototype.crisp=function(i,s){s=s||i.strokeWidth||0;var o=Math.round(s)%2/2;return i.x=Math.floor(i.x||this.x||0)+o,i.y=Math.floor(i.y||this.y||0)+o,i.width=Math.floor((i.width||this.width||0)-2*o),i.height=Math.floor((i.height||this.height||0)-2*o),Y(i.strokeWidth)&&(i.strokeWidth=s),i},G.prototype.complexColor=function(i,s,h){var v,y,_,S,T,x,R,P,L,N,V,j=this.renderer,W=[];Z(this.renderer,"complexColor",{args:arguments},(function(){if(i.radialGradient?y="radialGradient":i.linearGradient&&(y="linearGradient"),y){if(_=i[y],T=j.gradients,x=i.stops,L=h.radialReference,ee(_)&&(i[y]=_={x1:_[0],y1:_[1],x2:_[2],y2:_[3],gradientUnits:"userSpaceOnUse"}),"radialGradient"===y&&L&&!Y(_.gradientUnits)&&(S=_,_=ne(_,j.getRadialAttr(L,S),{gradientUnits:"userSpaceOnUse"})),re(_,(function(i,s){"id"!==s&&W.push(s,i)})),re(x,(function(i){W.push(i)})),W=W.join(","),T[W])N=T[W].attr("id");else{_.id=N=de();var K=T[W]=j.createElement(y).attr(_).add(j.defs);K.radAttr=S,K.stops=[],x.forEach((function(i){0===i[1].indexOf("rgba")?(v=o.parse(i[1]),R=v.get("rgb"),P=v.get("a")):(R=i[1],P=1),i=j.createElement("stop").attr({offset:i[0],"stop-color":R,"stop-opacity":P}).add(K),K.stops.push(i)}))}V="url("+j.url+"#"+N+")",h.setAttribute(s,V),h.gradient=W,i.toString=function(){return V}}}))},G.prototype.css=function(i){var s=this.styles,o={},h=this.element,v="",y=!s,_=["textOutline","textOverflow","width"];if(i&&i.color&&(i.fill=i.color),s&&re(i,(function(i,h){s&&s[h]!==i&&(o[h]=i,y=!0)})),y){if(s&&(i=X(s,o)),i)if(null===i.width||"auto"===i.width)delete this.textWidth;else if("text"===h.nodeName.toLowerCase()&&i.width)var S=this.textWidth=le(i.width);if(this.styles=i,S&&!N&&this.renderer.forExport&&delete i.width,h.namespaceURI===this.SVG_NS){var J=function(i,s){return"-"+s.toLowerCase()};re(i,(function(i,s){-1===_.indexOf(s)&&(v+=s.replace(/([A-Z])/g,J)+":"+i+";")})),v&&W(h,"style",v)}else U(h,i);this.added&&("text"===this.element.nodeName&&this.renderer.buildText(this),i&&i.textOutline&&this.applyTextOutline(i.textOutline))}return this},G.prototype.dashstyleSetter=function(i){var s=this["stroke-width"];if("inherit"===s&&(s=1),i=i&&i.toLowerCase()){var o=i.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",");for(i=o.length;i--;)o[i]=""+le(o[i])*se(s,NaN);i=o.join(",").replace(/NaN/g,"none"),this.element.setAttribute("stroke-dasharray",i)}},G.prototype.destroy=function(){var i=this,s=i.element||{},o=i.renderer,h=o.isSVG&&"SPAN"===s.nodeName&&i.parentGroup||void 0,v=s.ownerSVGElement;if(s.onclick=s.onmouseout=s.onmouseover=s.onmousemove=s.point=null,T(i),i.clipPath&&v){var y=i.clipPath;[].forEach.call(v.querySelectorAll("[clip-path],[CLIP-PATH]"),(function(i){-1<i.getAttribute("clip-path").indexOf(y.element.id)&&i.removeAttribute("clip-path")})),i.clipPath=y.destroy()}if(i.stops){for(v=0;v<i.stops.length;v++)i.stops[v].destroy();i.stops.length=0,i.stops=void 0}for(i.safeRemoveChild(s),o.styledMode||i.destroyShadows();h&&h.div&&0===h.div.childNodes.length;)s=h.parentGroup,i.safeRemoveChild(h.div),delete h.div,h=s;i.alignTo&&$(o.alignedObjects,i),re(i,(function(s,o){i[o]&&i[o].parentGroup===i&&i[o].destroy&&i[o].destroy(),delete i[o]}))},G.prototype.destroyShadows=function(){(this.shadows||[]).forEach((function(i){this.safeRemoveChild(i)}),this),this.shadows=void 0},G.prototype.destroyTextPath=function(i,s){var o=i.getElementsByTagName("text")[0];if(o){if(o.removeAttribute("dx"),o.removeAttribute("dy"),s.element.setAttribute("id",""),this.textPathWrapper&&o.getElementsByTagName("textPath").length){for(i=this.textPathWrapper.element.childNodes;i.length;)o.appendChild(i[0]);o.removeChild(this.textPathWrapper.element)}}else(i.getAttribute("dx")||i.getAttribute("dy"))&&(i.removeAttribute("dx"),i.removeAttribute("dy"));this.textPathWrapper&&(this.textPathWrapper=this.textPathWrapper.destroy())},G.prototype.dSetter=function(i,s,o){ee(i)&&("string"==typeof i[0]&&(i=this.renderer.pathToSegments(i)),this.pathArray=i,i=i.reduce((function(i,s,o){return s&&s.join?(o?i+" ":"")+s.join(" "):(s||"").toString()}),"")),/(NaN| {2}|^$)/.test(i)&&(i="M 0 0"),this[s]!==i&&(o.setAttribute(s,i),this[s]=i)},G.prototype.fadeOut=function(i){var s=this;s.animate({opacity:0},{duration:se(i,150),complete:function(){s.attr({y:-9999}).hide()}})},G.prototype.fillSetter=function(i,s,o){"string"==typeof i?o.setAttribute(s,i):i&&this.complexColor(i,s,o)},G.prototype.getBBox=function(i,s){var o,h=this.renderer,v=this.element,y=this.styles,_=this.textStr,S=h.cache,T=h.cacheKeys,R=v.namespaceURI===this.SVG_NS;s=se(s,this.rotation,0);var P=h.styledMode?v&&G.prototype.getStyle.call(v,"font-size"):y&&y.fontSize;if(Y(_)){var L=_.toString();-1===L.indexOf("<")&&(L=L.replace(/[0-9]/g,"0")),L+=["",s,P,this.textWidth,y&&y.textOverflow,y&&y.fontWeight].join()}if(L&&!i&&(o=S[L]),!o){if(R||h.forExport){try{var N=this.fakeTS&&function(i){var s=v.querySelector(".highcharts-text-outline");s&&U(s,{display:i})};te(N)&&N("none"),o=v.getBBox?X({},v.getBBox()):{width:v.offsetWidth,height:v.offsetHeight},te(N)&&N("")}catch(i){}(!o||0>o.width)&&(o={width:0,height:0})}else o=this.htmlGetBBox();if(h.isSVG&&(i=o.width,h=o.height,R&&(o.height=h={"11px,17":14,"13px,20":16}[y&&y.fontSize+","+Math.round(h)]||h),s&&(y=s*x,o.width=Math.abs(h*Math.sin(y))+Math.abs(i*Math.cos(y)),o.height=Math.abs(h*Math.cos(y))+Math.abs(i*Math.sin(y)))),L&&0<o.height){for(;250<T.length;)delete S[T.shift()];S[L]||T.push(L),S[L]=o}}return o},G.prototype.getStyle=function(i){return j.getComputedStyle(this.element||this,"").getPropertyValue(i)},G.prototype.hasClass=function(i){return-1!==(""+this.attr("class")).split(" ").indexOf(i)},G.prototype.hide=function(i){return i?this.attr({y:-9999}):this.attr({visibility:"hidden"}),this},G.prototype.htmlGetBBox=function(){return{height:0,width:0,x:0,y:0}},G.prototype.init=function(i,s){this.element="span"===s?K(s):R.createElementNS(this.SVG_NS,s),this.renderer=i,Z(this,"afterInit")},G.prototype.invert=function(i){return this.inverted=i,this.updateTransform(),this},G.prototype.on=function(i,s){var o,h,v,y=this.element;return P&&"click"===i?(y.ontouchstart=function(i){o=i.touches[0].clientX,h=i.touches[0].clientY},y.ontouchend=function(i){o&&4<=Math.sqrt(Math.pow(o-i.changedTouches[0].clientX,2)+Math.pow(h-i.changedTouches[0].clientY,2))||s.call(y,i),v=!0,!1!==i.cancelable&&i.preventDefault()},y.onclick=function(i){v||s.call(y,i)}):y["on"+i]=s,this},G.prototype.opacitySetter=function(i,s,o){this.opacity=i=Number(Number(i).toFixed(3)),o.setAttribute(s,i)},G.prototype.removeClass=function(i){return this.attr("class",(""+this.attr("class")).replace(ae(i)?new RegExp("(^| )"+i+"( |$)"):i," ").replace(/ +/g," ").trim())},G.prototype.removeTextOutline=function(){var i=this.element.querySelector("tspan.highcharts-text-outline");i&&this.safeRemoveChild(i)},G.prototype.safeRemoveChild=function(i){var s=i.parentNode;s&&s.removeChild(i)},G.prototype.setRadialReference=function(i){var s=this.element.gradient&&this.renderer.gradients[this.element.gradient];return this.element.radialReference=i,s&&s.radAttr&&s.animate(this.renderer.getRadialAttr(i,s.radAttr)),this},G.prototype.setTextPath=function(i,o){var h=this.element,v=this.text?this.text.element:h,y={textAnchor:"text-anchor"},_=!1,S=this.textPathWrapper,T=!S;o=ne(!0,{enabled:!0,attributes:{dy:-5,startOffset:"50%",textAnchor:"middle"}},o);var x=s.filterUserAttributes(o.attributes);if(i&&o&&o.enabled){S&&null===S.element.parentNode?(T=!0,S=S.destroy()):S&&this.removeTextOutline.call(S.parentGroup),this.options&&this.options.padding&&(x.dx=-this.options.padding),S||(this.textPathWrapper=S=this.renderer.createElement("textPath"),_=!0);var R=S.element;if((o=i.element.getAttribute("id"))||i.element.setAttribute("id",o=de()),T)for(v.setAttribute("y",0),ie(x.dx)&&v.setAttribute("x",-x.dx),i=[].slice.call(v.childNodes),T=0;T<i.length;T++){var P=i[T];P.nodeType!==Node.TEXT_NODE&&"tspan"!==P.nodeName||R.appendChild(P)}_&&S&&S.add({element:v}),R.setAttributeNS("http://www.w3.org/1999/xlink","href",this.renderer.url+"#"+o),Y(x.dy)&&(R.parentNode.setAttribute("dy",x.dy),delete x.dy),Y(x.dx)&&(R.parentNode.setAttribute("dx",x.dx),delete x.dx),re(x,(function(i,s){R.setAttribute(y[s]||s,i)})),h.removeAttribute("transform"),this.removeTextOutline.call(S),this.text&&!this.renderer.styledMode&&this.attr({fill:"none","stroke-width":0}),this.applyTextOutline=this.updateTransform=L}else S&&(delete this.updateTransform,delete this.applyTextOutline,this.destroyTextPath(h,i),this.updateTransform(),this.options&&this.options.rotation&&this.applyTextOutline(this.options.style.textOutline));return this},G.prototype.shadow=function(i,s,o){var h,y=[],_=this.element,S=!1,T=this.oldShadowOptions,x={color:v.neutralColor100,offsetX:1,offsetY:1,opacity:.15,width:3};if(!0===i?h=x:"object"==typeof i&&(h=X(x,i)),h&&(h&&T&&re(h,(function(i,s){i!==T[s]&&(S=!0)})),S&&this.destroyShadows(),this.oldShadowOptions=h),h){if(!this.shadows){var R=h.opacity/h.width,P=this.parentInverted?"translate(-1,-1)":"translate("+h.offsetX+", "+h.offsetY+")";for(x=1;x<=h.width;x++){var L=_.cloneNode(!1),N=2*h.width+1-2*x;W(L,{stroke:i.color||v.neutralColor100,"stroke-opacity":R*x,"stroke-width":N,transform:P,fill:"none"}),L.setAttribute("class",(L.getAttribute("class")||"")+" highcharts-shadow"),o&&(W(L,"height",Math.max(W(L,"height")-N,0)),L.cutHeight=N),s?s.element.appendChild(L):_.parentNode&&_.parentNode.insertBefore(L,_),y.push(L)}this.shadows=y}}else this.destroyShadows();return this},G.prototype.show=function(i){return this.attr({visibility:i?"inherit":"visible"})},G.prototype.strokeSetter=function(i,s,o){this[s]=i,this.stroke&&this["stroke-width"]?(G.prototype.fillSetter.call(this,this.stroke,"stroke",o),o.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0):"stroke-width"===s&&0===i&&this.hasStroke?(o.removeAttribute("stroke"),this.hasStroke=!1):this.renderer.styledMode&&this["stroke-width"]&&(o.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0)},G.prototype.strokeWidth=function(){if(!this.renderer.styledMode)return this["stroke-width"]||0;var i=this.getStyle("stroke-width"),s=0;if(i.indexOf("px")===i.length-2)s=le(i);else if(""!==i){var o=R.createElementNS(V,"rect");W(o,{width:i,"stroke-width":0}),this.element.parentNode.appendChild(o),s=o.getBBox().width,o.parentNode.removeChild(o)}return s},G.prototype.symbolAttr=function(i){var s=this;"x y r start end width height innerR anchorX anchorY clockwise".split(" ").forEach((function(o){s[o]=se(i[o],s[o])})),s.attr({d:s.renderer.symbols[s.symbolName](s.x,s.y,s.width,s.height,s)})},G.prototype.textSetter=function(i){i!==this.textStr&&(delete this.textPxLength,this.textStr=i,this.added&&this.renderer.buildText(this))},G.prototype.titleSetter=function(i){var s=this.element,o=s.getElementsByTagName("title")[0]||R.createElementNS(this.SVG_NS,"title");s.insertBefore?s.insertBefore(o,s.firstChild):s.appendChild(o),o.textContent=String(se(i,"")).replace(/<[^>]*>/g,"").replace(/&lt;/g,"<").replace(/&gt;/g,">")},G.prototype.toFront=function(){var i=this.element;return i.parentNode.appendChild(i),this},G.prototype.translate=function(i,s){return this.attr({translateX:i,translateY:s})},G.prototype.updateShadows=function(i,s,o){var h=this.shadows;if(h)for(var v=h.length;v--;)o.call(h[v],"height"===i?Math.max(s-(h[v].cutHeight||0),0):"d"===i?this.d:s,i,h[v])},G.prototype.updateTransform=function(){var i=this.translateX||0,s=this.translateY||0,o=this.scaleX,h=this.scaleY,v=this.inverted,y=this.rotation,_=this.matrix,S=this.element;v&&(i+=this.width,s+=this.height),i=["translate("+i+","+s+")"],Y(_)&&i.push("matrix("+_.join(",")+")"),v?i.push("rotate(90) scale(-1,1)"):y&&i.push("rotate("+y+" "+se(this.rotationOriginX,S.getAttribute("x"),0)+" "+se(this.rotationOriginY,S.getAttribute("y")||0)+")"),(Y(o)||Y(h))&&i.push("scale("+se(o,1)+" "+se(h,1)+")"),i.length&&S.setAttribute("transform",i.join(" "))},G.prototype.visibilitySetter=function(i,s,o){"inherit"===i?o.removeAttribute(s):this[s]!==i&&o.setAttribute(s,i),this[s]=i},G.prototype.xGetter=function(i){return"circle"===this.element.nodeName&&("x"===i?i="cx":"y"===i&&(i="cy")),this._defaultGetter(i)},G.prototype.zIndexSetter=function(i,s){var o=this.renderer,h=this.parentGroup,v=(h||o).element||o.box,y=this.element,_=!1;o=v===o.box;var S,T=this.added;if(Y(i)?(y.setAttribute("data-z-index",i),i=+i,this[s]===i&&(T=!1)):Y(this[s])&&y.removeAttribute("data-z-index"),this[s]=i,T){for((i=this.zIndex)&&h&&(h.handleZ=!0),S=(s=v.childNodes).length-1;0<=S&&!_;S--){T=(h=s[S]).getAttribute("data-z-index");var x=!Y(T);h!==y&&(0>i&&x&&!o&&!S?(v.insertBefore(y,s[S]),_=!0):(le(T)<=i||x&&(!Y(i)||0<=i))&&(v.insertBefore(y,s[S+1]||null),_=!0))}_||(v.insertBefore(y,s[o?3:0]||null),_=!0)}return _},G}()).prototype["stroke-widthSetter"]=i.prototype.strokeSetter,i.prototype.yGetter=i.prototype.xGetter,i.prototype.matrixSetter=i.prototype.rotationOriginXSetter=i.prototype.rotationOriginYSetter=i.prototype.rotationSetter=i.prototype.scaleXSetter=i.prototype.scaleYSetter=i.prototype.translateXSetter=i.prototype.translateYSetter=i.prototype.verticalAlignSetter=function(i,s){this[s]=i,this.doTransform=!0},h.SVGElement=i,h.SVGElement})),O(s,"Core/Renderer/SVG/SVGLabel.js",[s["Core/Renderer/SVG/SVGElement.js"],s["Core/Utilities.js"]],(function(i,s){function l(i,s){_(i)?i!==this[s]&&(this[s]=i,this.updateTextPadding()):this[s]=void 0}var o,h=this&&this.__extends||(o=function(i,s){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var o in s)s.hasOwnProperty(o)&&(i[o]=s[o])})(i,s)},function(i,s){function q(){this.constructor=i}o(i,s),i.prototype=null===s?Object.create(s):(q.prototype=s.prototype,new q)}),v=s.defined,y=s.extend,_=s.isNumber,S=s.merge,T=s.pick,x=s.removeEvent;return function(s){function b(i,o,h,v,y,_,S,T,x,R){var P=s.call(this)||this;if(P.paddingSetter=l,P.paddingLeftSetter=l,P.paddingRightSetter=l,P.init(i,"g"),P.textStr=o,P.x=h,P.y=v,P.anchorX=_,P.anchorY=S,P.baseline=x,P.className=R,"button"!==R&&P.addClass("highcharts-label"),R&&P.addClass("highcharts-"+R),P.text=i.text("",0,0,T).attr({zIndex:1}),"string"==typeof y){var L=/^url\((.*?)\)$/.test(y);(P.renderer.symbols[y]||L)&&(P.symbolKey=y)}return P.bBox=b.emptyBBox,P.padding=3,P.baselineOffset=0,P.needsBox=i.styledMode||L,P.deferredAttr={},P.alignFactor=0,P}return h(b,s),b.prototype.alignSetter=function(i){(i={left:0,center:.5,right:1}[i])!==this.alignFactor&&(this.alignFactor=i,this.bBox&&_(this.xSetting)&&this.attr({x:this.xSetting}))},b.prototype.anchorXSetter=function(i,s){this.anchorX=i,this.boxAttr(s,Math.round(i)-this.getCrispAdjust()-this.xSetting)},b.prototype.anchorYSetter=function(i,s){this.anchorY=i,this.boxAttr(s,i-this.ySetting)},b.prototype.boxAttr=function(i,s){this.box?this.box.attr(i,s):this.deferredAttr[i]=s},b.prototype.css=function(s){if(s){var o={};s=S(s),b.textProps.forEach((function(i){void 0!==s[i]&&(o[i]=s[i],delete s[i])})),this.text.css(o);var h="width"in o;"fontSize"in o||"fontWeight"in o?this.updateTextPadding():h&&this.updateBoxSize()}return i.prototype.css.call(this,s)},b.prototype.destroy=function(){x(this.element,"mouseenter"),x(this.element,"mouseleave"),this.text&&this.text.destroy(),this.box&&(this.box=this.box.destroy()),i.prototype.destroy.call(this)},b.prototype.fillSetter=function(i,s){i&&(this.needsBox=!0),this.fill=i,this.boxAttr(s,i)},b.prototype.getBBox=function(){var i=this.bBox,s=this.padding,o=T(this.paddingLeft,s);return{width:this.width,height:this.height,x:i.x-o,y:i.y-s}},b.prototype.getCrispAdjust=function(){return this.renderer.styledMode&&this.box?this.box.strokeWidth()%2/2:(this["stroke-width"]?parseInt(this["stroke-width"],10):0)%2/2},b.prototype.heightSetter=function(i){this.heightSetting=i},b.prototype.on=function(s,o){var h=this,v=h.text,y=v&&"SPAN"===v.element.tagName?v:void 0;if(y){var q=function(i){("mouseenter"===s||"mouseleave"===s)&&i.relatedTarget instanceof Element&&(h.element.contains(i.relatedTarget)||y.element.contains(i.relatedTarget))||o.call(h.element,i)};y.on(s,q)}return i.prototype.on.call(h,s,q||o),h},b.prototype.onAdd=function(){var i=this.textStr;this.text.add(this),this.attr({text:v(i)?i:"",x:this.x,y:this.y}),this.box&&v(this.anchorX)&&this.attr({anchorX:this.anchorX,anchorY:this.anchorY})},b.prototype.rSetter=function(i,s){this.boxAttr(s,i)},b.prototype.shadow=function(i){return i&&!this.renderer.styledMode&&(this.updateBoxSize(),this.box&&this.box.shadow(i)),this},b.prototype.strokeSetter=function(i,s){this.stroke=i,this.boxAttr(s,i)},b.prototype["stroke-widthSetter"]=function(i,s){i&&(this.needsBox=!0),this["stroke-width"]=i,this.boxAttr(s,i)},b.prototype["text-alignSetter"]=function(i){this.textAlign=i},b.prototype.textSetter=function(i){void 0!==i&&this.text.attr({text:i}),this.updateTextPadding()},b.prototype.updateBoxSize=function(){var i=this.text.element.style,s={},o=this.padding,h=this.bBox=_(this.widthSetting)&&_(this.heightSetting)&&!this.textAlign||!v(this.text.textStr)?b.emptyBBox:this.text.getBBox();this.width=this.getPaddedWidth(),this.height=(this.heightSetting||h.height||0)+2*o,this.baselineOffset=o+Math.min(this.renderer.fontMetrics(i&&i.fontSize,this.text).b,h.height||1/0),this.needsBox&&(this.box||((i=this.box=this.symbolKey?this.renderer.symbol(this.symbolKey):this.renderer.rect()).addClass(("button"===this.className?"":"highcharts-label-box")+(this.className?" highcharts-"+this.className+"-box":"")),i.add(this)),i=this.getCrispAdjust(),s.x=i,s.y=(this.baseline?-this.baselineOffset:0)+i,s.width=Math.round(this.width),s.height=Math.round(this.height),this.box.attr(y(s,this.deferredAttr)),this.deferredAttr={})},b.prototype.updateTextPadding=function(){var i=this.text;this.updateBoxSize();var s=this.baseline?0:this.baselineOffset,o=T(this.paddingLeft,this.padding);v(this.widthSetting)&&this.bBox&&("center"===this.textAlign||"right"===this.textAlign)&&(o+={center:.5,right:1}[this.textAlign]*(this.widthSetting-this.bBox.width)),o===i.x&&s===i.y||(i.attr("x",o),i.hasBoxWidthChanged&&(this.bBox=i.getBBox(!0)),void 0!==s&&i.attr("y",s)),i.x=o,i.y=s},b.prototype.widthSetter=function(i){this.widthSetting=_(i)?i:void 0},b.prototype.getPaddedWidth=function(){var i=this.padding,s=T(this.paddingLeft,i);return i=T(this.paddingRight,i),(this.widthSetting||this.bBox.width||0)+s+i},b.prototype.xSetter=function(i){this.x=i,this.alignFactor&&(i-=this.alignFactor*this.getPaddedWidth(),this["forceAnimate:x"]=!0),this.xSetting=Math.round(i),this.attr("translateX",this.xSetting)},b.prototype.ySetter=function(i){this.ySetting=this.y=Math.round(i),this.attr("translateY",this.ySetting)},b.emptyBBox={width:0,height:0,x:0,y:0},b.textProps="color direction fontFamily fontSize fontStyle fontWeight lineHeight textAlign textDecoration textOutline textOverflow width".split(" "),b}(i)})),O(s,"Core/Renderer/SVG/TextBuilder.js",[s["Core/Globals.js"],s["Core/Utilities.js"],s["Core/Renderer/HTML/AST.js"]],(function(i,s,o){var h=i.doc,v=i.SVG_NS,y=s.attr,_=s.isString,S=s.objectEach,T=s.pick;return function(){function b(i){var s=i.styles;this.renderer=i.renderer,this.svgElement=i,this.width=i.textWidth,this.textLineHeight=s&&s.lineHeight,this.textOutline=s&&s.textOutline,this.ellipsis=!(!s||"ellipsis"!==s.textOverflow),this.noWrap=!(!s||"nowrap"!==s.whiteSpace),this.fontSize=s&&s.fontSize}return b.prototype.buildSVG=function(){var i=this.svgElement,s=i.element,v=i.renderer,y=T(i.textStr,"").toString(),S=-1!==y.indexOf("<"),x=s.childNodes,R=x.length;v=this.width&&!i.added&&v.box;var P=[y,this.ellipsis,this.noWrap,this.textLineHeight,this.textOutline,this.fontSize,this.width].join();if(P!==i.textCache){for(i.textCache=P,delete i.actualWidth;R--;)s.removeChild(x[R]);S||this.ellipsis||this.width||-1!==y.indexOf(" ")&&(!this.noWrap||/<br.*?>/g.test(y))?""!==y&&(v&&v.appendChild(s),y=new o(y),this.modifyTree(y.nodes),y.addToDOM(i.element),this.modifyDOM(),this.ellipsis&&-1!==(s.textContent||"").indexOf("…")&&i.attr("title",this.unescapeEntities(i.textStr||"",["&lt;","&gt;"])),v&&v.removeChild(s)):s.appendChild(h.createTextNode(this.unescapeEntities(y))),_(this.textOutline)&&i.applyTextOutline&&i.applyTextOutline(this.textOutline)}},b.prototype.modifyDOM=function(){var i=this,s=this.svgElement,o=y(s.element,"x");[].forEach.call(s.element.querySelectorAll("tspan.highcharts-br"),(function(s){s.nextSibling&&s.previousSibling&&y(s,{dy:i.getLineHeight(s.nextSibling),x:o})}));var _=this.width||0;if(_){var f=function(S,T){var x=S.textContent||"",R=x.replace(/([^\^])-/g,"$1- ").split(" "),P=!i.noWrap&&(1<R.length||1<s.element.childNodes.length),L=i.getLineHeight(T),N=0,V=s.actualWidth;if(i.ellipsis)x&&i.truncate(S,x,void 0,0,Math.max(0,_-parseInt(i.fontSize||12,10)),(function(i,s){return i.substring(0,s)+"…"}));else if(P){for(x=[],P=[];T.firstChild&&T.firstChild!==S;)P.push(T.firstChild),T.removeChild(T.firstChild);for(;R.length;)R.length&&!i.noWrap&&0<N&&(x.push(S.textContent||""),S.textContent=R.join(" ").replace(/- /g,"-")),i.truncate(S,void 0,R,0===N&&V||0,_,(function(i,s){return R.slice(0,s).join(" ").replace(/- /g,"-")})),V=s.actualWidth,N++;P.forEach((function(i){T.insertBefore(i,S)})),x.forEach((function(i){T.insertBefore(h.createTextNode(i),S),(i=h.createElementNS(v,"tspan")).textContent="",y(i,{dy:L,x:o}),T.insertBefore(i,S)}))}},p=function(i){[].slice.call(i.childNodes).forEach((function(o){o.nodeType===Node.TEXT_NODE?f(o,i):(-1!==o.className.baseVal.indexOf("highcharts-br")&&(s.actualWidth=0),p(o))}))};p(s.element)}},b.prototype.getLineHeight=function(i){var s;return i=i.nodeType===Node.TEXT_NODE?i.parentElement:i,this.renderer.styledMode||(s=i&&/(px|em)$/.test(i.style.fontSize)?i.style.fontSize:this.fontSize||this.renderer.style.fontSize||12),this.textLineHeight?parseInt(this.textLineHeight.toString(),10):this.renderer.fontMetrics(s,i||this.svgElement.element).h},b.prototype.modifyTree=function(i){var s=this,g=function(o,h){var v=o.tagName,y=s.renderer.styledMode,S=o.attributes||{};"b"===v||"strong"===v?y?S.class="highcharts-strong":S.style="font-weight:bold;"+(S.style||""):"i"!==v&&"em"!==v||(y?S.class="highcharts-emphasized":S.style="font-style:italic;"+(S.style||"")),_(S.style)&&(S.style=S.style.replace(/(;| |^)color([ :])/,"$1fill$2")),"br"===v&&(S.class="highcharts-br",o.textContent="",(h=i[h+1])&&h.textContent&&(h.textContent=h.textContent.replace(/^ +/gm,""))),"#text"!==v&&"a"!==v&&(o.tagName="tspan"),o.attributes=S,o.children&&o.children.filter((function(i){return"#text"!==i.tagName})).forEach(g)};for(i.forEach(g);i[0]&&"tspan"===i[0].tagName&&!i[0].children;)i.splice(0,1)},b.prototype.truncate=function(i,s,o,h,v,y){var _,S=this.svgElement,T=S.renderer,x=S.rotation,R=[],P=o?1:0,L=(s||o||"").length,N=L,a=function(v,_){_=_||v;var x=i.parentNode;if(x&&void 0===R[_])if(x.getSubStringLength)try{R[_]=h+x.getSubStringLength(0,o?_+1:_)}catch(i){}else T.getSpanWidth&&(i.textContent=y(s||o,v),R[_]=h+T.getSpanWidth(S,i));return R[_]};S.rotation=0;var V=a(i.textContent.length);if(h+V>v){for(;P<=L;)N=Math.ceil((P+L)/2),o&&(_=y(o,N)),V=a(N,_&&_.length-1),P===L?P=L+1:V>v?L=N-1:P=N;0===L?i.textContent="":s&&L===s.length-1||(i.textContent=_||y(s||o,N))}o&&o.splice(0,N),S.actualWidth=V,S.rotation=x},b.prototype.unescapeEntities=function(i,s){return S(this.renderer.escapes,(function(o,h){s&&-1!==s.indexOf(o)||(i=i.toString().replace(new RegExp(o,"g"),h))})),i},b}()})),O(s,"Core/Renderer/SVG/SVGRenderer.js",[s["Core/Color/Color.js"],s["Core/Globals.js"],s["Core/Color/Palette.js"],s["Core/Renderer/SVG/SVGElement.js"],s["Core/Renderer/SVG/SVGLabel.js"],s["Core/Renderer/HTML/AST.js"],s["Core/Renderer/SVG/TextBuilder.js"],s["Core/Utilities.js"]],(function(i,s,o,h,v,y,_,S){var T=S.addEvent,x=S.attr,R=S.createElement,P=S.css,L=S.defined,N=S.destroyObjectProperties,V=S.extend,j=S.isArray,W=S.isNumber,K=S.isObject,U=S.isString,Y=S.merge,$=S.pick,X=S.pInt,Z=S.uniqueKey,ee=s.charts,te=s.deg2rad,ie=s.doc,ae=s.isFirefox,ne=s.isMS,re=s.isWebKit;S=s.noop;var se=s.SVG_NS,le=s.symbolSizes,oe=s.win,de=function(){function b(i,s,o,h,v,y,_){this.width=this.url=this.style=this.isSVG=this.imgCount=this.height=this.gradients=this.globalAnimation=this.defs=this.chartIndex=this.cacheKeys=this.cache=this.boxWrapper=this.box=this.alignedObjects=void 0,this.init(i,s,o,h,v,y,_)}return b.prototype.init=function(i,s,o,h,v,y,_){var S,R=this.createElement("svg").attr({version:"1.1",class:"highcharts-root"});_||R.css(this.getStyle(h)),h=R.element,i.appendChild(h),x(i,"dir","ltr"),-1===i.innerHTML.indexOf("xmlns")&&x(h,"xmlns",this.SVG_NS),this.isSVG=!0,this.box=h,this.boxWrapper=R,this.alignedObjects=[],this.url=(ae||re)&&ie.getElementsByTagName("base").length?oe.location.href.split("#")[0].replace(/<[^>]*>/g,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"",this.createElement("desc").add().element.appendChild(ie.createTextNode("Created with Highcharts 9.0.0")),this.defs=this.createElement("defs").add(),this.allowHTML=y,this.forExport=v,this.styledMode=_,this.gradients={},this.cache={},this.cacheKeys=[],this.imgCount=0,this.setSize(s,o,!1),ae&&i.getBoundingClientRect&&((s=function(){P(i,{left:0,top:0}),S=i.getBoundingClientRect(),P(i,{left:Math.ceil(S.left)-S.left+"px",top:Math.ceil(S.top)-S.top+"px"})})(),this.unSubPixelFix=T(oe,"resize",s))},b.prototype.definition=function(i){return new y([i]).addToDOM(this.defs.element)},b.prototype.getStyle=function(i){return this.style=V({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},i)},b.prototype.setStyle=function(i){this.boxWrapper.css(this.getStyle(i))},b.prototype.isHidden=function(){return!this.boxWrapper.getBBox().width},b.prototype.destroy=function(){var i=this.defs;return this.box=null,this.boxWrapper=this.boxWrapper.destroy(),N(this.gradients||{}),this.gradients=null,i&&(this.defs=i.destroy()),this.unSubPixelFix&&this.unSubPixelFix(),this.alignedObjects=null},b.prototype.createElement=function(i){var s=new this.Element;return s.init(this,i),s},b.prototype.getRadialAttr=function(i,s){return{cx:i[0]-i[2]/2+s.cx*i[2],cy:i[1]-i[2]/2+s.cy*i[2],r:s.r*i[2]}},b.prototype.buildText=function(i){new _(i).buildSVG()},b.prototype.getContrast=function(s){return(s=i.parse(s).rgba)[0]*=1,s[1]*=1.2,s[2]*=.5,459<s[0]+s[1]+s[2]?"#000000":"#FFFFFF"},b.prototype.button=function(i,s,h,v,_,S,x,R,P,L){var N=this.label(i,s,h,P,void 0,void 0,L,void 0,"button"),j=0,W=this.styledMode,K=_?Y(_):{};if(i=K&&K.style||{},K=y.filterUserAttributes(K),N.attr(Y({padding:8,r:2},K)),!W){var U=(K=Y({fill:o.neutralColor3,stroke:o.neutralColor20,"stroke-width":1,style:{color:o.neutralColor80,cursor:"pointer",fontWeight:"normal"}},{style:i},K)).style;delete K.style;var $=(S=Y(K,{fill:o.neutralColor10},y.filterUserAttributes(S||{}))).style;delete S.style;var X=(x=Y(K,{fill:o.highlightColor10,style:{color:o.neutralColor100,fontWeight:"bold"}},y.filterUserAttributes(x||{}))).style;delete x.style;var Z=(R=Y(K,{style:{color:o.neutralColor20}},y.filterUserAttributes(R||{}))).style;delete R.style}return T(N.element,ne?"mouseover":"mouseenter",(function(){3!==j&&N.setState(1)})),T(N.element,ne?"mouseout":"mouseleave",(function(){3!==j&&N.setState(j)})),N.setState=function(i){1!==i&&(N.state=j=i),N.removeClass(/highcharts-button-(normal|hover|pressed|disabled)/).addClass("highcharts-button-"+["normal","hover","pressed","disabled"][i||0]),W||N.attr([K,S,x,R][i||0]).css([U,$,X,Z][i||0])},W||N.attr(K).css(V({cursor:"default"},U)),N.on("click",(function(i){3!==j&&v.call(N,i)}))},b.prototype.crispLine=function(i,s,o){void 0===o&&(o="round");var h=i[0],v=i[1];return h[1]===v[1]&&(h[1]=v[1]=Math[o](h[1])-s%2/2),h[2]===v[2]&&(h[2]=v[2]=Math[o](h[2])+s%2/2),i},b.prototype.path=function(i){var s=this.styledMode?{}:{fill:"none"};return j(i)?s.d=i:K(i)&&V(s,i),this.createElement("path").attr(s)},b.prototype.circle=function(i,s,o){return i=K(i)?i:void 0===i?{}:{x:i,y:s,r:o},(s=this.createElement("circle")).xSetter=s.ySetter=function(i,s,o){o.setAttribute("c"+s,i)},s.attr(i)},b.prototype.arc=function(i,s,o,h,v,y){return K(i)?(s=(h=i).y,o=h.r,i=h.x):h={innerR:h,start:v,end:y},(i=this.symbol("arc",i,s,o,o,h)).r=o,i},b.prototype.rect=function(i,s,o,h,v,y){v=K(i)?i.r:v;var _=this.createElement("rect");return i=K(i)?i:void 0===i?{}:{x:i,y:s,width:Math.max(o,0),height:Math.max(h,0)},this.styledMode||(void 0!==y&&(i.strokeWidth=y,i=_.crisp(i)),i.fill="none"),v&&(i.r=v),_.rSetter=function(i,s,o){_.r=i,x(o,{rx:i,ry:i})},_.rGetter=function(){return _.r},_.attr(i)},b.prototype.setSize=function(i,s,o){var h=this.alignedObjects,v=h.length;for(this.width=i,this.height=s,this.boxWrapper.animate({width:i,height:s},{step:function(){this.attr({viewBox:"0 0 "+this.attr("width")+" "+this.attr("height")})},duration:$(o,!0)?void 0:0});v--;)h[v].align()},b.prototype.g=function(i){var s=this.createElement("g");return i?s.attr({class:"highcharts-"+i}):s},b.prototype.image=function(i,s,o,h,v,y){var _={preserveAspectRatio:"none"},g=function(i,s){i.setAttributeNS?i.setAttributeNS("http://www.w3.org/1999/xlink","href",s):i.setAttribute("hc-svg-href",s)},M=function(s){g(S.element,i),y.call(S,s)};1<arguments.length&&V(_,{x:s,y:o,width:h,height:v});var S=this.createElement("image").attr(_);return y?(g(S.element,"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),_=new oe.Image,T(_,"load",M),_.src=i,_.complete&&M({})):g(S.element,i),S},b.prototype.symbol=function(i,s,o,h,v,y){var _,S=this,T=/^url\((.*?)\)$/,x=T.test(i),N=!x&&(this.symbols[i]?i:"circle"),j=N&&this.symbols[N];if(j){"number"==typeof s&&(_=j.call(this.symbols,Math.round(s||0),Math.round(o||0),h||0,v||0,y));var W=this.path(_);S.styledMode||W.attr("fill","none"),V(W,{symbolName:N,x:s,y:o,width:h,height:v}),y&&V(W,y)}else if(x){var K=i.match(T)[1];(W=this.image(K)).imgwidth=$(le[K]&&le[K].width,y&&y.width),W.imgheight=$(le[K]&&le[K].height,y&&y.height);var q=function(){W.attr({width:W.width,height:W.height})};["width","height"].forEach((function(i){W[i+"Setter"]=function(i,s){var o={},h=this["img"+s],v="width"===s?"translateX":"translateY";this[s]=i,L(h)&&(y&&"within"===y.backgroundSize&&this.width&&this.height&&(h=Math.round(h*Math.min(this.width/this.imgwidth,this.height/this.imgheight))),this.element&&this.element.setAttribute(s,h),this.alignByTranslate||(o[v]=((this[s]||0)-h)/2,this.attr(o)))}})),L(s)&&W.attr({x:s,y:o}),W.isImg=!0,L(W.imgwidth)&&L(W.imgheight)?q():(W.attr({width:0,height:0}),R("img",{onload:function(){var i=ee[S.chartIndex];0===this.width&&(P(this,{position:"absolute",top:"-999em"}),ie.body.appendChild(this)),le[K]={width:this.width,height:this.height},W.imgwidth=this.width,W.imgheight=this.height,W.element&&q(),this.parentNode&&this.parentNode.removeChild(this),S.imgCount--,S.imgCount||!i||i.hasLoaded||i.onload()},src:K}),this.imgCount++)}return W},b.prototype.clipRect=function(i,s,o,h){var v=Z()+"-",y=this.createElement("clipPath").attr({id:v}).add(this.defs);return(i=this.rect(i,s,o,h,0).add(y)).id=v,i.clipPath=y,i.count=0,i},b.prototype.text=function(i,s,o,h){var v={};return!h||!this.allowHTML&&this.forExport?(v.x=Math.round(s||0),o&&(v.y=Math.round(o)),L(i)&&(v.text=i),i=this.createElement("text").attr(v),h||(i.xSetter=function(i,s,o){var h,v=o.getElementsByTagName("tspan"),y=o.getAttribute(s);for(h=0;h<v.length;h++){var _=v[h];_.getAttribute(s)===y&&_.setAttribute(s,i)}o.setAttribute(s,i)}),i):this.html(i,s,o)},b.prototype.fontMetrics=function(i,s){return i=!this.styledMode&&/px/.test(i)||!oe.getComputedStyle?i||s&&s.style&&s.style.fontSize||this.style&&this.style.fontSize:s&&h.prototype.getStyle.call(s,"font-size"),{h:s=24>(i=/px/.test(i)?X(i):12)?i+3:Math.round(1.2*i),b:Math.round(.8*s),f:i}},b.prototype.rotCorr=function(i,s,o){var h=i;return s&&o&&(h=Math.max(h*Math.cos(s*te),4)),{x:-i/3*Math.sin(s*te),y:h}},b.prototype.pathToSegments=function(i){for(var s=[],o=[],h={A:8,C:7,H:2,L:3,M:3,Q:5,S:5,T:3,V:2},v=0;v<i.length;v++)U(o[0])&&W(i[v])&&o.length===h[o[0].toUpperCase()]&&i.splice(v,0,o[0].replace("M","L").replace("m","l")),"string"==typeof i[v]&&(o.length&&s.push(o.slice(0)),o.length=0),o.push(i[v]);return s.push(o.slice(0)),s},b.prototype.label=function(i,s,o,h,y,_,S,T,x){return new v(this,i,s,o,h,y,_,S,T,x)},b}();return de.prototype.Element=h,de.prototype.SVG_NS=se,de.prototype.draw=S,de.prototype.escapes={"&":"&amp;","<":"&lt;",">":"&gt;","'":"&#39;",'"':"&quot;"},de.prototype.symbols={circle:function(i,s,o,h){return this.arc(i+o/2,s+h/2,o/2,h/2,{start:.5*Math.PI,end:2.5*Math.PI,open:!1})},square:function(i,s,o,h){return[["M",i,s],["L",i+o,s],["L",i+o,s+h],["L",i,s+h],["Z"]]},triangle:function(i,s,o,h){return[["M",i+o/2,s],["L",i+o,s+h],["L",i,s+h],["Z"]]},"triangle-down":function(i,s,o,h){return[["M",i,s],["L",i+o,s],["L",i+o/2,s+h],["Z"]]},diamond:function(i,s,o,h){return[["M",i+o/2,s],["L",i+o,s+h/2],["L",i+o/2,s+h],["L",i,s+h/2],["Z"]]},arc:function(i,s,o,h,v){var y=[];if(v){var _=v.start||0,S=v.end||0,T=v.r||o;o=v.r||h||o;var x=.001>Math.abs(S-_-2*Math.PI);S-=.001,h=v.innerR,x=$(v.open,x);var R=Math.cos(_),P=Math.sin(_),N=Math.cos(S),V=Math.sin(S);_=$(v.longArc,.001>S-_-Math.PI?0:1),y.push(["M",i+T*R,s+o*P],["A",T,o,0,_,$(v.clockwise,1),i+T*N,s+o*V]),L(h)&&y.push(x?["M",i+h*N,s+h*V]:["L",i+h*N,s+h*V],["A",h,h,0,_,L(v.clockwise)?1-v.clockwise:0,i+h*R,s+h*P]),x||y.push(["Z"])}return y},callout:function(i,s,o,h,v){var y=Math.min(v&&v.r||0,o,h),_=y+6,S=v&&v.anchorX;v=v&&v.anchorY||0;var T=[["M",i+y,s],["L",i+o-y,s],["C",i+o,s,i+o,s,i+o,s+y],["L",i+o,s+h-y],["C",i+o,s+h,i+o,s+h,i+o-y,s+h],["L",i+y,s+h],["C",i,s+h,i,s+h,i,s+h-y],["L",i,s+y],["C",i,s,i,s,i+y,s]];return W(S)?(i+S>=o?v>s+_&&v<s+h-_?T.splice(3,1,["L",i+o,v-6],["L",i+o+6,v],["L",i+o,v+6],["L",i+o,s+h-y]):T.splice(3,1,["L",i+o,h/2],["L",S,v],["L",i+o,h/2],["L",i+o,s+h-y]):0>=i+S?v>s+_&&v<s+h-_?T.splice(7,1,["L",i,v+6],["L",i-6,v],["L",i,v-6],["L",i,s+y]):T.splice(7,1,["L",i,h/2],["L",S,v],["L",i,h/2],["L",i,s+y]):v&&v>h&&S>i+_&&S<i+o-_?T.splice(5,1,["L",S+6,s+h],["L",S,s+h+6],["L",S-6,s+h],["L",i+y,s+h]):v&&0>v&&S>i+_&&S<i+o-_&&T.splice(1,1,["L",S-6,s],["L",S,s-6],["L",S+6,s],["L",o-y,s]),T):T}},s.SVGRenderer=de,s.Renderer=s.SVGRenderer,s.Renderer})),O(s,"Core/Renderer/HTML/HTMLElement.js",[s["Core/Globals.js"],s["Core/Renderer/SVG/SVGElement.js"],s["Core/Utilities.js"]],(function(i,s,o){var h=o.css,v=o.defined,y=o.extend,_=o.pick,S=o.pInt,T=i.isFirefox;return y(s.prototype,{htmlCss:function(i){var s="SPAN"===this.element.tagName&&i&&"width"in i,o=_(s&&i.width,void 0);if(s){delete i.width,this.textWidth=o;var v=!0}return i&&"ellipsis"===i.textOverflow&&(i.whiteSpace="nowrap",i.overflow="hidden"),this.styles=y(this.styles,i),h(this.element,i),v&&this.htmlUpdateTransform(),this},htmlGetBBox:function(){var i=this.element;return{x:i.offsetLeft,y:i.offsetTop,width:i.offsetWidth,height:i.offsetHeight}},htmlUpdateTransform:function(){if(this.added){var i=this.renderer,s=this.element,o=this.translateX||0,y=this.translateY||0,_=this.x||0,T=this.y||0,x=this.textAlign||"left",R={left:0,center:.5,right:1}[x],P=this.styles,L=P&&P.whiteSpace;if(h(s,{marginLeft:o,marginTop:y}),!i.styledMode&&this.shadows&&this.shadows.forEach((function(i){h(i,{marginLeft:o+1,marginTop:y+1})})),this.inverted&&[].forEach.call(s.childNodes,(function(o){i.invertChild(o,s)})),"SPAN"===s.tagName){P=this.rotation;var N,V=this.textWidth&&S(this.textWidth),j=[P,x,s.innerHTML,this.textWidth,this.textAlign].join();(N=V!==this.oldTextWidth)&&!(N=V>this.oldTextWidth)&&((N=this.textPxLength)||(h(s,{width:"",whiteSpace:L||"nowrap"}),N=s.offsetWidth),N=N>V),N&&(/[ \-]/.test(s.textContent||s.innerText)||"ellipsis"===s.style.textOverflow)?(h(s,{width:V+"px",display:"block",whiteSpace:L||"normal"}),this.oldTextWidth=V,this.hasBoxWidthChanged=!0):this.hasBoxWidthChanged=!1,j!==this.cTT&&(L=i.fontMetrics(s.style.fontSize,s).b,!v(P)||P===(this.oldRotation||0)&&x===this.oldAlign||this.setSpanRotation(P,R,L),this.getSpanCorrection(!v(P)&&this.textPxLength||s.offsetWidth,L,R,P,x)),h(s,{left:_+(this.xCorr||0)+"px",top:T+(this.yCorr||0)+"px"}),this.cTT=j,this.oldRotation=P,this.oldAlign=x}}else this.alignOnAdd=!0},setSpanRotation:function(i,s,o){var v={},y=this.renderer.getTransformKey();v[y]=v.transform="rotate("+i+"deg)",v[y+(T?"Origin":"-origin")]=v.transformOrigin=100*s+"% "+o+"px",h(this.element,v)},getSpanCorrection:function(i,s,o){this.xCorr=-i*o,this.yCorr=-s}}),s})),O(s,"Core/Renderer/HTML/HTMLRenderer.js",[s["Core/Globals.js"],s["Core/Renderer/HTML/AST.js"],s["Core/Renderer/SVG/SVGElement.js"],s["Core/Renderer/SVG/SVGRenderer.js"],s["Core/Utilities.js"]],(function(i,s,o,h,v){var y=i.isFirefox,_=i.isMS,S=i.isWebKit,T=i.win,x=v.attr,R=v.createElement,P=v.extend,L=v.pick;return P(h.prototype,{getTransformKey:function(){return _&&!/Edge/.test(T.navigator.userAgent)?"-ms-transform":S?"-webkit-transform":y?"MozTransform":T.opera?"-o-transform":""},html:function(i,h,v){var y=this.createElement("span"),_=y.element,S=y.renderer,T=S.isSVG,m=function(i,s){["opacity","visibility"].forEach((function(h){i[h+"Setter"]=function(v,y,_){var S=i.div?i.div.style:s;o.prototype[h+"Setter"].call(this,v,y,_),S&&(S[y]=v)}})),i.addedSetters=!0};return y.textSetter=function(i){i!==this.textStr&&(delete this.bBox,delete this.oldTextWidth,s.setElementHTML(this.element,L(i,"")),this.textStr=i,y.doTransform=!0)},T&&m(y,y.element.style),y.xSetter=y.ySetter=y.alignSetter=y.rotationSetter=function(i,s){"align"===s?y.alignValue=y.textAlign=i:y[s]=i,y.doTransform=!0},y.afterSetters=function(){this.doTransform&&(this.htmlUpdateTransform(),this.doTransform=!1)},y.attr({text:i,x:Math.round(h),y:Math.round(v)}).css({position:"absolute"}),S.styledMode||y.css({fontFamily:this.style.fontFamily,fontSize:this.style.fontSize}),_.style.whiteSpace="nowrap",y.css=y.htmlCss,T&&(y.add=function(i){var s=S.box.parentNode,o=[];if(this.parentGroup=i){var h=i.div;if(!h){for(;i;)o.push(i),i=i.parentGroup;o.reverse().forEach((function(i){function f(s,o){i[o]=s,"translateX"===o?S.left=s+"px":S.top=s+"px",i.doTransform=!0}var v=x(i.element,"class"),_=i.styles||{},S=(h=i.div=i.div||R("div",v?{className:v}:void 0,{position:"absolute",left:(i.translateX||0)+"px",top:(i.translateY||0)+"px",display:i.display,opacity:i.opacity,cursor:_.cursor,pointerEvents:_.pointerEvents},h||s)).style;P(i,{classSetter:function(i){return function(s){this.element.setAttribute("class",s),i.className=s}}(h),on:function(){return o[0].div&&y.on.apply({element:o[0].div},arguments),i},translateXSetter:f,translateYSetter:f}),i.addedSetters||m(i)}))}}else h=s;return h.appendChild(_),y.added=!0,y.alignOnAdd&&y.htmlUpdateTransform(),y}),y}}),h})),O(s,"Core/Time.js",[s["Core/Globals.js"],s["Core/Utilities.js"]],(function(i,s){var o=i.win,h=s.defined,v=s.error,y=s.extend,_=s.isObject,S=s.merge,T=s.objectEach,x=s.pad,R=s.pick,P=s.splat,L=s.timeUnits;return s=function(){function b(i){this.options={},this.variableTimezone=this.useUTC=!1,this.Date=o.Date,this.getTimezoneOffset=this.timezoneOffsetFunction(),this.update(i)}return b.prototype.get=function(i,s){if(this.variableTimezone||this.timezoneOffset){var o=s.getTime(),h=o-this.getTimezoneOffset(s);return s.setTime(h),i=s["getUTC"+i](),s.setTime(o),i}return this.useUTC?s["getUTC"+i]():s["get"+i]()},b.prototype.set=function(i,s,o){if(this.variableTimezone||this.timezoneOffset){if("Milliseconds"===i||"Seconds"===i||"Minutes"===i&&0==this.getTimezoneOffset(s)%36e5)return s["setUTC"+i](o);var h=this.getTimezoneOffset(s);return h=s.getTime()-h,s.setTime(h),s["setUTC"+i](o),i=this.getTimezoneOffset(s),h=s.getTime()+i,s.setTime(h)}return this.useUTC?s["setUTC"+i](o):s["set"+i](o)},b.prototype.update=function(i){var s=R(i&&i.useUTC,!0);this.options=i=S(!0,this.options||{},i),this.Date=i.Date||o.Date||Date,this.timezoneOffset=(this.useUTC=s)&&i.timezoneOffset,this.getTimezoneOffset=this.timezoneOffsetFunction(),this.variableTimezone=s&&!(!i.getTimezoneOffset&&!i.timezone)},b.prototype.makeTime=function(s,o,h,v,y,_){if(this.useUTC){var S=this.Date.UTC.apply(0,arguments),T=this.getTimezoneOffset(S);S+=T;var x=this.getTimezoneOffset(S);T!==x?S+=x-T:T-36e5!==this.getTimezoneOffset(S-36e5)||i.isSafari||(S-=36e5)}else S=new this.Date(s,o,R(h,1),R(v,0),R(y,0),R(_,0)).getTime();return S},b.prototype.timezoneOffsetFunction=function(){var i=this,s=this.options,h=s.moment||o.moment;if(!this.useUTC)return function(i){return 6e4*new Date(i.toString()).getTimezoneOffset()};if(s.timezone){if(h)return function(i){return 6e4*-h.tz(i,s.timezone).utcOffset()};v(25)}return this.useUTC&&s.getTimezoneOffset?function(i){return 6e4*s.getTimezoneOffset(i.valueOf())}:function(){return 6e4*(i.timezoneOffset||0)}},b.prototype.dateFormat=function(s,o,v){var _;if(!h(o)||isNaN(o))return(null===(_=i.defaultOptions.lang)||void 0===_?void 0:_.invalidDate)||"";s=R(s,"%Y-%m-%d %H:%M:%S");var S=this;_=new this.Date(o);var P=this.get("Hours",_),L=this.get("Day",_),N=this.get("Date",_),V=this.get("Month",_),j=this.get("FullYear",_),W=i.defaultOptions.lang,K=null==W?void 0:W.weekdays,U=null==W?void 0:W.shortWeekdays;return _=y({a:U?U[L]:K[L].substr(0,3),A:K[L],d:x(N),e:x(N,2," "),w:L,b:W.shortMonths[V],B:W.months[V],m:x(V+1),o:V+1,y:j.toString().substr(2,2),Y:j,H:x(P),k:P,I:x(P%12||12),l:P%12||12,M:x(this.get("Minutes",_)),p:12>P?"AM":"PM",P:12>P?"am":"pm",S:x(_.getSeconds()),L:x(Math.floor(o%1e3),3)},i.dateFormats),T(_,(function(i,h){for(;-1!==s.indexOf("%"+h);)s=s.replace("%"+h,"function"==typeof i?i.call(S,o):i)})),v?s.substr(0,1).toUpperCase()+s.substr(1):s},b.prototype.resolveDTLFormat=function(i){return _(i,!0)?i:{main:(i=P(i))[0],from:i[1],to:i[2]}},b.prototype.getTimeTicks=function(i,s,o,v){var _,S=this,T=[],x={},P=new S.Date(s),N=i.unitRange,V=i.count||1;if(v=R(v,1),h(s)){if(S.set("Milliseconds",P,N>=L.second?0:V*Math.floor(S.get("Milliseconds",P)/V)),N>=L.second&&S.set("Seconds",P,N>=L.minute?0:V*Math.floor(S.get("Seconds",P)/V)),N>=L.minute&&S.set("Minutes",P,N>=L.hour?0:V*Math.floor(S.get("Minutes",P)/V)),N>=L.hour&&S.set("Hours",P,N>=L.day?0:V*Math.floor(S.get("Hours",P)/V)),N>=L.day&&S.set("Date",P,N>=L.month?1:Math.max(1,V*Math.floor(S.get("Date",P)/V))),N>=L.month){S.set("Month",P,N>=L.year?0:V*Math.floor(S.get("Month",P)/V));var j=S.get("FullYear",P)}N>=L.year&&S.set("FullYear",P,j-j%V),N===L.week&&(j=S.get("Day",P),S.set("Date",P,S.get("Date",P)-j+v+(j<v?-7:0))),j=S.get("FullYear",P),v=S.get("Month",P);var W=S.get("Date",P),K=S.get("Hours",P);for(s=P.getTime(),!S.variableTimezone&&S.useUTC||!h(o)||(_=o-s>4*L.month||S.getTimezoneOffset(s)!==S.getTimezoneOffset(o)),s=P.getTime(),P=1;s<o;)T.push(s),s=N===L.year?S.makeTime(j+P*V,0):N===L.month?S.makeTime(j,v+P*V):!_||N!==L.day&&N!==L.week?_&&N===L.hour&&1<V?S.makeTime(j,v,W,K+P*V):s+N*V:S.makeTime(j,v,W+P*V*(N===L.day?1:7)),P++;T.push(s),N<=L.hour&&1e4>T.length&&T.forEach((function(i){0==i%18e5&&"000000000"===S.dateFormat("%H%M%S%L",i)&&(x[i]="day")}))}return T.info=y(i,{higherRanks:x,totalRange:N*V}),T},b}(),i.Time=s,i.Time})),O(s,"Core/Options.js",[s["Core/Globals.js"],s["Core/Color/Color.js"],s["Core/Color/Palette.js"],s["Core/Time.js"],s["Core/Utilities.js"]],(function(i,s,o,h,v){var y=i.isTouchDevice,_=i.svg;return s=s.parse,v=v.merge,i.defaultOptions={colors:o.colors,symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),decimalPoint:".",numericSymbols:"kMGTPE".split(""),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:" "},global:{},time:{Date:void 0,getTimezoneOffset:void 0,timezone:void 0,timezoneOffset:0,useUTC:!0},chart:{styledMode:!1,borderRadius:0,colorCount:10,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,10],resetZoomButton:{theme:{zIndex:6},position:{align:"right",x:-10,y:10}},zoomBySingleTouch:!1,width:null,height:null,borderColor:o.highlightColor80,backgroundColor:o.backgroundColor,plotBorderColor:o.neutralColor20},title:{text:"Chart title",align:"center",margin:15,widthAdjust:-44},subtitle:{text:"",align:"center",widthAdjust:-44},caption:{margin:15,text:"",align:"left",verticalAlign:"bottom"},plotOptions:{},labels:{style:{position:"absolute",color:o.neutralColor80}},legend:{enabled:!0,align:"center",alignColumns:!0,layout:"horizontal",labelFormatter:function(){return this.name},borderColor:o.neutralColor40,borderRadius:0,navigation:{activeColor:o.highlightColor100,inactiveColor:o.neutralColor20},itemStyle:{color:o.neutralColor80,cursor:"pointer",fontSize:"12px",fontWeight:"bold",textOverflow:"ellipsis"},itemHoverStyle:{color:o.neutralColor100},itemHiddenStyle:{color:o.neutralColor20},shadow:!1,itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},squareSymbol:!0,symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:o.backgroundColor,opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:_,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L",second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},footerFormat:"",padding:8,snap:y?25:10,headerFormat:'<span style="font-size: 10px">{point.key}</span><br/>',pointFormat:'<span style="color:{point.color}">●</span> {series.name}: <b>{point.y}</b><br/>',backgroundColor:s(o.neutralColor3).setOpacity(.85).get(),borderWidth:1,shadow:!0,style:{color:o.neutralColor80,cursor:"default",fontSize:"12px",whiteSpace:"nowrap"}},credits:{enabled:!0,href:"https://www.highcharts.com?credits",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:o.neutralColor40,fontSize:"9px"},text:"Highcharts.com"}},i.defaultOptions.chart.styledMode=!1,i.time=new h(v(i.defaultOptions.global,i.defaultOptions.time)),i.dateFormat=function(s,o,h){return i.time.dateFormat(s,o,h)},{dateFormat:i.dateFormat,defaultOptions:i.defaultOptions,time:i.time}})),O(s,"Core/Axis/Tick.js",[s["Core/Globals.js"],s["Core/Utilities.js"]],(function(i,s){var o=i.deg2rad,h=s.clamp,v=s.correctFloat,y=s.defined,_=s.destroyObjectProperties,S=s.extend,T=s.fireEvent,x=s.isNumber,R=s.merge,P=s.objectEach,L=s.pick;return s=function(){function b(i,s,o,h,v){this.isNewLabel=this.isNew=!0,this.axis=i,this.pos=s,this.type=o||"",this.parameters=v||{},this.tickmarkOffset=this.parameters.tickmarkOffset,this.options=this.parameters.options,T(this,"init"),o||h||this.addLabel()}return b.prototype.addLabel=function(){var i=this,s=i.axis,o=s.options,h=s.chart,_=s.categories,T=s.logarithmic,x=s.names,R=i.pos,P=L(i.options&&i.options.labels,o.labels),N=s.tickPositions,V=R===N[0],j=R===N[N.length-1];x=this.parameters.category||(_?L(_[R],x[R],R):R);var W,K,U=i.label;if(_=(!P.step||1===P.step)&&1===s.tickInterval,N=N.info,s.dateTime&&N)var Y=h.time.resolveDTLFormat(o.dateTimeLabelFormats[!o.grid&&N.higherRanks[R]||N.unitName]),$=Y.main;i.isFirst=V,i.isLast=j,i.formatCtx={axis:s,chart:h,isFirst:V,isLast:j,dateTimeLabelFormat:$,tickPositionInfo:N,value:T?v(T.lin2log(x)):x,pos:R},o=s.labelFormatter.call(i.formatCtx,this.formatCtx),(K=Y&&Y.list)&&(i.shortenLabel=function(){for(W=0;W<K.length;W++)if(U.attr({text:s.labelFormatter.call(S(i.formatCtx,{dateTimeLabelFormat:K[W]}))}),U.getBBox().width<s.getSlotWidth(i)-2*L(P.padding,5))return;U.attr({text:""})}),_&&s._addedPlotLB&&i.moveLabel(o,P),y(U)||i.movedLabel?U&&U.textStr!==o&&!_&&(!U.textWidth||P.style&&P.style.width||U.styles.width||U.css({width:null}),U.attr({text:o}),U.textPxLength=U.getBBox().width):(i.label=U=i.createLabel({x:0,y:0},o,P),i.rotation=0)},b.prototype.createLabel=function(i,s,o){var h=this.axis,v=h.chart;return(i=y(s)&&o.enabled?v.renderer.text(s,i.x,i.y,o.useHTML).add(h.labelGroup):null)&&(v.styledMode||i.css(R(o.style)),i.textPxLength=i.getBBox().width),i},b.prototype.destroy=function(){_(this,this.axis)},b.prototype.getPosition=function(i,s,o,y){var _=this.axis,S=_.chart,x=y&&S.oldChartHeight||S.chartHeight;return(i={x:i?v(_.translate(s+o,null,null,y)+_.transB):_.left+_.offset+(_.opposite?(y&&S.oldChartWidth||S.chartWidth)-_.right-_.left:0),y:i?x-_.bottom+_.offset-(_.opposite?_.height:0):v(x-_.translate(s+o,null,null,y)-_.transB)}).y=h(i.y,-1e5,1e5),T(this,"afterGetPosition",{pos:i}),i},b.prototype.getLabelPosition=function(i,s,h,v,_,S,x,R){var P=this.axis,L=P.transA,N=P.isLinked&&P.linkedParent?P.linkedParent.reversed:P.reversed,V=P.staggerLines,j=P.tickRotCorr||{x:0,y:0},W=_.y,K=v||P.reserveSpaceDefault?0:-P.labelOffset*("center"===P.labelAlign?.5:1),U={};return y(W)||(W=0===P.side?h.rotation?-8:-h.getBBox().height:2===P.side?j.y+8:Math.cos(h.rotation*o)*(j.y-h.getBBox(!1,0).height/2)),i=i+_.x+K+j.x-(S&&v?S*L*(N?-1:1):0),s=s+W-(S&&!v?S*L*(N?1:-1):0),V&&(h=x/(R||1)%V,P.opposite&&(h=V-h-1),s+=P.labelOffset/V*h),U.x=i,U.y=Math.round(s),T(this,"afterGetLabelPosition",{pos:U,tickmarkOffset:S,index:x}),U},b.prototype.getLabelSize=function(){return this.label?this.label.getBBox()[this.axis.horiz?"height":"width"]:0},b.prototype.getMarkPath=function(i,s,o,h,v,y){return y.crispLine([["M",i,s],["L",i+(v?0:-o),s+(v?o:0)]],h)},b.prototype.handleOverflow=function(i){var s=this.axis,h=s.options.labels,v=i.x,y=s.chart.chartWidth,_=s.chart.spacing,S=L(s.labelLeft,Math.min(s.pos,_[3]));_=L(s.labelRight,Math.max(s.isRadial?0:s.pos+s.len,y-_[1]));var T,x=this.label,R=this.rotation,P={left:0,center:.5,right:1}[s.labelAlign||x.attr("align")],N=x.getBBox().width,V=s.getSlotWidth(this),j=V,W=1,K={};R||"justify"!==L(h.overflow,"justify")?0>R&&v-P*N<S?T=Math.round(v/Math.cos(R*o)-S):0<R&&v+P*N>_&&(T=Math.round((y-v)/Math.cos(R*o))):(y=v+(1-P)*N,v-P*N<S?j=i.x+j*(1-P)-S:y>_&&(j=_-i.x+j*P,W=-1),(j=Math.min(V,j))<V&&"center"===s.labelAlign&&(i.x+=W*(V-j-P*(V-Math.min(N,j)))),(N>j||s.autoRotation&&(x.styles||{}).width)&&(T=j)),T&&(this.shortenLabel?this.shortenLabel():(K.width=Math.floor(T)+"px",(h.style||{}).textOverflow||(K.textOverflow="ellipsis"),x.css(K)))},b.prototype.moveLabel=function(i,s){var o=this,h=o.label,v=!1,y=o.axis,_=y.reversed;if(h&&h.textStr===i?(o.movedLabel=h,v=!0,delete o.label):P(y.ticks,(function(s){v||s.isNew||s===o||!s.label||s.label.textStr!==i||(o.movedLabel=s.label,v=!0,s.labelPos=o.movedLabel.xy,delete s.label)})),!v&&(o.labelPos||h)){var S=o.labelPos||h.xy;h=y.horiz?_?0:y.width+y.left:S.x,y=y.horiz?S.y:_?y.width+y.left:0,o.movedLabel=o.createLabel({x:h,y:y},i,s),o.movedLabel&&o.movedLabel.attr({opacity:0})}},b.prototype.render=function(i,s,o){var h=this.axis,v=h.horiz,y=this.pos,_=L(this.tickmarkOffset,h.tickmarkOffset);_=(y=this.getPosition(v,y,_,s)).x;var S=y.y;h=v&&_===h.pos+h.len||!v&&S===h.pos?-1:1,o=L(o,1),this.isActive=!0,this.renderGridLine(s,o,h),this.renderMark(y,o,h),this.renderLabel(y,s,o,i),this.isNew=!1,T(this,"afterRender")},b.prototype.renderGridLine=function(i,s,o){var h=this.axis,v=h.options,y=this.gridLine,_={},S=this.pos,T=this.type,x=L(this.tickmarkOffset,h.tickmarkOffset),R=h.chart.renderer,P=T?T+"Grid":"grid",N=v[P+"LineWidth"],V=v[P+"LineColor"];v=v[P+"LineDashStyle"],y||(h.chart.styledMode||(_.stroke=V,_["stroke-width"]=N,v&&(_.dashstyle=v)),T||(_.zIndex=1),i&&(s=0),this.gridLine=y=R.path().attr(_).addClass("highcharts-"+(T?T+"-":"")+"grid-line").add(h.gridGroup)),y&&(o=h.getPlotLinePath({value:S+x,lineWidth:y.strokeWidth()*o,force:"pass",old:i}))&&y[i||this.isNew?"attr":"animate"]({d:o,opacity:s})},b.prototype.renderMark=function(i,s,o){var h=this.axis,v=h.options,y=h.chart.renderer,_=this.type,S=_?_+"Tick":"tick",T=h.tickSize(S),x=this.mark,R=!x,P=i.x;i=i.y;var N=L(v[S+"Width"],!_&&h.isXAxis?1:0);v=v[S+"Color"],T&&(h.opposite&&(T[0]=-T[0]),R&&(this.mark=x=y.path().addClass("highcharts-"+(_?_+"-":"")+"tick").add(h.axisGroup),h.chart.styledMode||x.attr({stroke:v,"stroke-width":N})),x[R?"attr":"animate"]({d:this.getMarkPath(P,i,T[0],x.strokeWidth()*o,h.horiz,y),opacity:s}))},b.prototype.renderLabel=function(i,s,o,h){var v=this.axis,y=v.horiz,_=v.options,S=this.label,T=_.labels,R=T.step;v=L(this.tickmarkOffset,v.tickmarkOffset);var P=!0,N=i.x;i=i.y,S&&x(N)&&(S.xy=i=this.getLabelPosition(N,i,S,y,T,v,h,R),this.isFirst&&!this.isLast&&!L(_.showFirstLabel,1)||this.isLast&&!this.isFirst&&!L(_.showLastLabel,1)?P=!1:!y||T.step||T.rotation||s||0===o||this.handleOverflow(i),R&&h%R&&(P=!1),P&&x(i.y)?(i.opacity=o,S[this.isNewLabel?"attr":"animate"](i),this.isNewLabel=!1):(S.attr("y",-9999),this.isNewLabel=!0))},b.prototype.replaceMovedLabel=function(){var i=this.label,s=this.axis,o=s.reversed;if(i&&!this.isNew){var h=s.horiz?o?s.left:s.width+s.left:i.xy.x;o=s.horiz?i.xy.y:o?s.width+s.top:s.top,i.animate({x:h,y:o,opacity:0},void 0,i.destroy),delete this.label}s.isDirty=!0,this.label=this.movedLabel,delete this.movedLabel},b}(),i.Tick=s,i.Tick})),O(s,"Core/Axis/Axis.js",[s["Core/Animation/AnimationUtilities.js"],s["Core/Color/Color.js"],s["Core/Globals.js"],s["Core/Color/Palette.js"],s["Core/Options.js"],s["Core/Axis/Tick.js"],s["Core/Utilities.js"]],(function(i,s,o,h,v,y,_){var S=i.animObject,T=v.defaultOptions,x=_.addEvent,R=_.arrayMax,P=_.arrayMin,L=_.clamp,N=_.correctFloat,V=_.defined,j=_.destroyObjectProperties,W=_.erase,K=_.error,U=_.extend,Y=_.fireEvent,$=_.format,X=_.getMagnitude,Z=_.isArray,ee=_.isFunction,te=_.isNumber,ie=_.isString,ae=_.merge,ne=_.normalizeTickInterval,re=_.objectEach,se=_.pick,le=_.relativeLength,oe=_.removeEvent,de=_.splat,ce=_.syncTimeout,he=o.deg2rad;return i=function(){function e(i,s){this.zoomEnabled=this.width=this.visible=this.userOptions=this.translationSlope=this.transB=this.transA=this.top=this.ticks=this.tickRotCorr=this.tickPositions=this.tickmarkOffset=this.tickInterval=this.tickAmount=this.side=this.series=this.right=this.positiveValuesOnly=this.pos=this.pointRangePadding=this.pointRange=this.plotLinesAndBandsGroups=this.plotLinesAndBands=this.paddedTicks=this.overlap=this.options=this.offset=this.names=this.minPixelPadding=this.minorTicks=this.minorTickInterval=this.min=this.maxLabelLength=this.max=this.len=this.left=this.labelFormatter=this.labelEdge=this.isLinked=this.height=this.hasVisibleSeries=this.hasNames=this.coll=this.closestPointRange=this.chart=this.categories=this.bottom=this.alternateBands=void 0,this.init(i,s)}return e.prototype.init=function(i,s){var o=s.isX,h=this;h.chart=i,h.horiz=i.inverted&&!h.isZAxis?!o:o,h.isXAxis=o,h.coll=h.coll||(o?"xAxis":"yAxis"),Y(this,"init",{userOptions:s}),h.opposite=se(s.opposite,h.opposite),h.side=se(s.side,h.side,h.horiz?h.opposite?0:2:h.opposite?1:3),h.setOptions(s);var v=this.options,y=v.type;h.labelFormatter=v.labels.formatter||h.defaultLabelFormatter,h.userOptions=s,h.minPixelPadding=0,h.reversed=se(v.reversed,h.reversed),h.visible=!1!==v.visible,h.zoomEnabled=!1!==v.zoomEnabled,h.hasNames="category"===y||!0===v.categories,h.categories=v.categories||h.hasNames,h.names||(h.names=[],h.names.keys={}),h.plotLinesAndBandsGroups={},h.positiveValuesOnly=!!h.logarithmic,h.isLinked=V(v.linkedTo),h.ticks={},h.labelEdge=[],h.minorTicks={},h.plotLinesAndBands=[],h.alternateBands={},h.len=0,h.minRange=h.userMinRange=v.minRange||v.maxZoom,h.range=v.range,h.offset=v.offset||0,h.max=null,h.min=null,h.crosshair=se(v.crosshair,de(i.options.tooltip.crosshairs)[o?0:1],!1),s=h.options.events,-1===i.axes.indexOf(h)&&(o?i.axes.splice(i.xAxis.length,0,h):i.axes.push(h),i[h.coll].push(h)),h.series=h.series||[],i.inverted&&!h.isZAxis&&o&&void 0===h.reversed&&(h.reversed=!0),h.labelRotation=h.options.labels.rotation,re(s,(function(i,s){ee(i)&&x(h,s,i)})),Y(this,"afterInit")},e.prototype.setOptions=function(i){this.options=ae(e.defaultOptions,"yAxis"===this.coll&&e.defaultYAxisOptions,[e.defaultTopAxisOptions,e.defaultRightAxisOptions,e.defaultBottomAxisOptions,e.defaultLeftAxisOptions][this.side],ae(T[this.coll],i)),Y(this,"afterSetOptions",{userOptions:i})},e.prototype.defaultLabelFormatter=function(){var i=this.axis,s=te(this.value)?this.value:NaN,o=i.chart.time,h=i.categories,v=this.dateTimeLabelFormat,y=T.lang,_=y.numericSymbols;y=y.numericSymbolMagnitude||1e3;var S=_&&_.length,x=i.options.labels.format;i=i.logarithmic?Math.abs(s):i.tickInterval;var R=this.chart,P=R.numberFormatter;if(x)var L=$(x,this,R);else if(h)L=""+this.value;else if(v)L=o.dateFormat(v,s);else if(S&&1e3<=i)for(;S--&&void 0===L;)i>=(o=Math.pow(y,S+1))&&0==10*s%o&&null!==_[S]&&0!==s&&(L=P(s/o,-1)+_[S]);return void 0===L&&(L=1e4<=Math.abs(s)?P(s,-1):P(s,-1,void 0,"")),L},e.prototype.getSeriesExtremes=function(){var i,s=this,o=s.chart;Y(this,"getSeriesExtremes",null,(function(){s.hasVisibleSeries=!1,s.dataMin=s.dataMax=s.threshold=null,s.softThreshold=!s.isXAxis,s.stacking&&s.stacking.buildStacks(),s.series.forEach((function(h){if(h.visible||!o.options.chart.ignoreHiddenSeries){var v=h.options,y=v.threshold;if(s.hasVisibleSeries=!0,s.positiveValuesOnly&&0>=y&&(y=null),s.isXAxis){if((v=h.xData).length){v=s.logarithmic?v.filter(s.validatePositiveValue):v;var _=(i=h.getXExtremes(v)).min,S=i.max;te(_)||_ instanceof Date||(v=v.filter(te),_=(i=h.getXExtremes(v)).min,S=i.max),v.length&&(s.dataMin=Math.min(se(s.dataMin,_),_),s.dataMax=Math.max(se(s.dataMax,S),S))}}else h=h.applyExtremes(),te(h.dataMin)&&(_=h.dataMin,s.dataMin=Math.min(se(s.dataMin,_),_)),te(h.dataMax)&&(S=h.dataMax,s.dataMax=Math.max(se(s.dataMax,S),S)),V(y)&&(s.threshold=y),(!v.softThreshold||s.positiveValuesOnly)&&(s.softThreshold=!1)}}))})),Y(this,"afterGetSeriesExtremes")},e.prototype.translate=function(i,s,o,h,v,y){var _=this.linkedParent||this,S=1,T=0,x=h&&_.old?_.old.transA:_.transA;h=h&&_.old?_.old.min:_.min;var R=_.minPixelPadding;return v=(_.isOrdinal||_.brokenAxis&&_.brokenAxis.hasBreaks||_.logarithmic&&v)&&_.lin2val,x||(x=_.transA),o&&(S*=-1,T=_.len),_.reversed&&(T-=(S*=-1)*(_.sector||_.len)),s?(i=(i*S+T-R)/x+h,v&&(i=_.lin2val(i))):(v&&(i=_.val2lin(i)),i=te(h)?S*(i-h)*x+T+S*R+(te(y)?x*y:0):void 0),i},e.prototype.toPixels=function(i,s){return this.translate(i,!1,!this.horiz,null,!0)+(s?0:this.pos)},e.prototype.toValue=function(i,s){return this.translate(i-(s?0:this.pos),!0,!this.horiz,null,!0)},e.prototype.getPlotLinePath=function(i){function d(i,s,o){return("pass"!==j&&i<s||i>o)&&(j?i=L(i,s,o):y=!0),i}var s,o,h,v,y,_=this,S=_.chart,T=_.left,x=_.top,R=i.old,P=i.value,N=i.translatedValue,V=i.lineWidth,j=i.force,W=R&&S.oldChartHeight||S.chartHeight,K=R&&S.oldChartWidth||S.chartWidth,U=_.transB;return i={value:P,lineWidth:V,old:R,force:j,acrossPanes:i.acrossPanes,translatedValue:N},Y(this,"getPlotLinePath",i,(function(i){N=se(N,_.translate(P,null,null,R)),N=L(N,-1e5,1e5),s=h=Math.round(N+U),o=v=Math.round(W-N-U),te(N)?_.horiz?(o=x,v=W-_.bottom,s=h=d(s,T,T+_.width)):(s=T,h=K-_.right,o=v=d(o,x,x+_.height)):(y=!0,j=!1),i.path=y&&!j?null:S.renderer.crispLine([["M",s,o],["L",h,v]],V||1)})),i.path},e.prototype.getLinearTickPositions=function(i,s,o){var h=N(Math.floor(s/i)*i);o=N(Math.ceil(o/i)*i);var v,y=[];if(N(h+i)===h&&(v=20),this.single)return[s];for(s=h;s<=o&&(y.push(s),(s=N(s+i,v))!==_);)var _=s;return y},e.prototype.getMinorTickInterval=function(){var i=this.options;return!0===i.minorTicks?se(i.minorTickInterval,"auto"):!1===i.minorTicks?null:i.minorTickInterval},e.prototype.getMinorTickPositions=function(){var i=this.options,s=this.tickPositions,o=this.minorTickInterval,h=[],v=this.pointRangePadding||0,y=this.min-v,_=(v=this.max+v)-y;if(_&&_/o<this.len/3){var S=this.logarithmic;if(S)this.paddedTicks.forEach((function(i,s,v){s&&h.push.apply(h,S.getLogTickPositions(o,v[s-1],v[s],!0))}));else if(this.dateTime&&"auto"===this.getMinorTickInterval())h=h.concat(this.getTimeTicks(this.dateTime.normalizeTimeTickInterval(o),y,v,i.startOfWeek));else for(i=y+(s[0]-y)%o;i<=v&&i!==h[0];i+=o)h.push(i)}return 0!==h.length&&this.trimTicks(h),h},e.prototype.adjustForMinRange=function(){var i,s,o,h,v=this.options,y=this.min,_=this.max,S=this.logarithmic,T=0;if(this.isXAxis&&void 0===this.minRange&&!S&&(V(v.min)||V(v.max)?this.minRange=null:(this.series.forEach((function(v){if(o=v.xData,h=v.xIncrement?1:o.length-1,1<o.length)for(i=h;0<i;i--)s=o[i]-o[i-1],(!T||s<T)&&(T=s)})),this.minRange=Math.min(5*T,this.dataMax-this.dataMin))),_-y<this.minRange){var x=this.dataMax-this.dataMin>=this.minRange,L=this.minRange,N=(L-_+y)/2;N=[y-N,se(v.min,y-N)],x&&(N[2]=this.logarithmic?this.logarithmic.log2lin(this.dataMin):this.dataMin),_=[(y=R(N))+L,se(v.max,y+L)],x&&(_[2]=S?S.log2lin(this.dataMax):this.dataMax),(_=P(_))-y<L&&(N[0]=_-L,N[1]=se(v.min,_-L),y=R(N))}this.min=y,this.max=_},e.prototype.getClosest=function(){var i;return this.categories?i=1:this.series.forEach((function(s){var o=s.closestPointRange,h=s.visible||!s.chart.options.chart.ignoreHiddenSeries;!s.noSharedTooltip&&V(o)&&h&&(i=V(i)?Math.min(i,o):o)})),i},e.prototype.nameToX=function(i){var s=Z(this.categories),o=s?this.categories:this.names,h=i.options.x;if(i.series.requireSorting=!1,V(h)||(h=!1===this.options.uniqueNames?i.series.autoIncrement():s?o.indexOf(i.name):se(o.keys[i.name],-1)),-1===h){if(!s)var v=o.length}else v=h;return void 0!==v&&(this.names[v]=i.name,this.names.keys[i.name]=v),v},e.prototype.updateNames=function(){var i=this,s=this.names;0<s.length&&(Object.keys(s.keys).forEach((function(i){delete s.keys[i]})),s.length=0,this.minRange=this.userMinRange,(this.series||[]).forEach((function(s){s.xIncrement=null,s.points&&!s.isDirtyData||(i.max=Math.max(i.max,s.xData.length-1),s.processData(),s.generatePoints()),s.data.forEach((function(o,h){if(o&&o.options&&void 0!==o.name){var v=i.nameToX(o);void 0!==v&&v!==o.x&&(o.x=v,s.xData[h]=v)}}))})))},e.prototype.setAxisTranslation=function(){var i=this,s=i.max-i.min,o=i.axisPointRange||0,h=0,v=0,y=i.linkedParent,_=!!i.categories,S=i.transA,T=i.isXAxis;if(T||_||o){var x=i.getClosest();y?(h=y.minPointOffset,v=y.pointRangePadding):i.series.forEach((function(s){var y=_?1:T?se(s.options.pointRange,x,0):i.axisPointRange||0,S=s.options.pointPlacement;o=Math.max(o,y),i.single&&!_||(s=s.is("xrange")?!T:T,h=Math.max(h,s&&ie(S)?0:y/2),v=Math.max(v,s&&"on"===S?0:y))})),y=i.ordinal&&i.ordinal.slope&&x?i.ordinal.slope/x:1,i.minPointOffset=h*=y,i.pointRangePadding=v*=y,i.pointRange=Math.min(o,i.single&&_?1:s),T&&(i.closestPointRange=x)}i.translationSlope=i.transA=S=i.staticScale||i.len/(s+v||1),i.transB=i.horiz?i.left:i.bottom,i.minPixelPadding=S*h,Y(this,"afterSetAxisTranslation")},e.prototype.minFromRange=function(){return this.max-this.range},e.prototype.setTickInterval=function(i){var s=this,o=s.chart,h=s.logarithmic,v=s.options,y=s.isXAxis,_=s.isLinked,S=v.maxPadding,T=v.minPadding,x=v.tickInterval,R=v.tickPixelInterval,P=s.categories,L=te(s.threshold)?s.threshold:null,j=s.softThreshold;s.dateTime||P||_||this.getTickAmount();var W=se(s.userMin,v.min),U=se(s.userMax,v.max);if(_){s.linkedParent=o[s.coll][v.linkedTo];var $=s.linkedParent.getExtremes();s.min=se($.min,$.dataMin),s.max=se($.max,$.dataMax),v.type!==s.linkedParent.options.type&&K(11,1,o)}else{if(j&&V(L))if(s.dataMin>=L)$=L,T=0;else if(s.dataMax<=L){var Z=L;S=0}s.min=se(W,$,s.dataMin),s.max=se(U,Z,s.dataMax)}h&&(s.positiveValuesOnly&&!i&&0>=Math.min(s.min,se(s.dataMin,s.min))&&K(10,1,o),s.min=N(h.log2lin(s.min),16),s.max=N(h.log2lin(s.max),16)),s.range&&V(s.max)&&(s.userMin=s.min=W=Math.max(s.dataMin,s.minFromRange()),s.userMax=U=s.max,s.range=null),Y(s,"foundExtremes"),s.beforePadding&&s.beforePadding(),s.adjustForMinRange(),!(P||s.axisPointRange||s.stacking&&s.stacking.usePercentage||_)&&V(s.min)&&V(s.max)&&(o=s.max-s.min)&&(!V(W)&&T&&(s.min-=o*T),!V(U)&&S&&(s.max+=o*S)),te(s.userMin)||(te(v.softMin)&&v.softMin<s.min&&(s.min=W=v.softMin),te(v.floor)&&(s.min=Math.max(s.min,v.floor))),te(s.userMax)||(te(v.softMax)&&v.softMax>s.max&&(s.max=U=v.softMax),te(v.ceiling)&&(s.max=Math.min(s.max,v.ceiling))),j&&V(s.dataMin)&&(L=L||0,!V(W)&&s.min<L&&s.dataMin>=L?s.min=s.options.minRange?Math.min(L,s.max-s.minRange):L:!V(U)&&s.max>L&&s.dataMax<=L&&(s.max=s.options.minRange?Math.max(L,s.min+s.minRange):L)),te(s.min)&&te(s.max)&&!this.chart.polar&&s.min>s.max&&(V(s.options.min)?s.max=s.min:V(s.options.max)&&(s.min=s.max)),s.tickInterval=s.min===s.max||void 0===s.min||void 0===s.max?1:_&&!x&&R===s.linkedParent.options.tickPixelInterval?x=s.linkedParent.tickInterval:se(x,this.tickAmount?(s.max-s.min)/Math.max(this.tickAmount-1,1):void 0,P?1:(s.max-s.min)*R/Math.max(s.len,R)),y&&!i&&s.series.forEach((function(i){var o,h;i.processData(s.min!==(null===(o=s.old)||void 0===o?void 0:o.min)||s.max!==(null===(h=s.old)||void 0===h?void 0:h.max))})),s.setAxisTranslation(),Y(this,"initialAxisTranslation"),s.pointRange&&!x&&(s.tickInterval=Math.max(s.pointRange,s.tickInterval)),i=se(v.minTickInterval,s.dateTime&&!s.series.some((function(i){return i.noSharedTooltip}))?s.closestPointRange:0),!x&&s.tickInterval<i&&(s.tickInterval=i),s.dateTime||s.logarithmic||x||(s.tickInterval=ne(s.tickInterval,void 0,X(s.tickInterval),se(v.allowDecimals,.5>s.tickInterval||void 0!==this.tickAmount),!!this.tickAmount)),this.tickAmount||(s.tickInterval=s.unsquish()),this.setTickPositions()},e.prototype.setTickPositions=function(){var i=this.options,s=i.tickPositions,o=this.getMinorTickInterval(),h=i.tickPositioner,v=this.hasVerticalPanning(),y="colorAxis"===this.coll,_=(y||!v)&&i.startOnTick;v=(y||!v)&&i.endOnTick,this.tickmarkOffset=this.categories&&"between"===i.tickmarkPlacement&&1===this.tickInterval?.5:0,this.minorTickInterval="auto"===o&&this.tickInterval?this.tickInterval/5:o,this.single=this.min===this.max&&V(this.min)&&!this.tickAmount&&(parseInt(this.min,10)===this.min||!1!==i.allowDecimals),this.tickPositions=o=s&&s.slice(),!o&&(this.ordinal&&this.ordinal.positions||!((this.max-this.min)/this.tickInterval>Math.max(2*this.len,200))?o=this.dateTime?this.getTimeTicks(this.dateTime.normalizeTimeTickInterval(this.tickInterval,i.units),this.min,this.max,i.startOfWeek,this.ordinal&&this.ordinal.positions,this.closestPointRange,!0):this.logarithmic?this.logarithmic.getLogTickPositions(this.tickInterval,this.min,this.max):this.getLinearTickPositions(this.tickInterval,this.min,this.max):(o=[this.min,this.max],K(19,!1,this.chart)),o.length>this.len&&((o=[o[0],o.pop()])[0]===o[1]&&(o.length=1)),this.tickPositions=o,h&&(h=h.apply(this,[this.min,this.max])))&&(this.tickPositions=o=h),this.paddedTicks=o.slice(0),this.trimTicks(o,_,v),this.isLinked||(this.single&&2>o.length&&!this.categories&&!this.series.some((function(i){return i.is("heatmap")&&"between"===i.options.pointPlacement}))&&(this.min-=.5,this.max+=.5),s||h||this.adjustTickAmount()),Y(this,"afterSetTickPositions")},e.prototype.trimTicks=function(i,s,o){var h=i[0],v=i[i.length-1],y=!this.isOrdinal&&this.minPointOffset||0;if(Y(this,"trimTicks"),!this.isLinked){if(s&&-1/0!==h)this.min=h;else for(;this.min-y>i[0];)i.shift();if(o)this.max=v;else for(;this.max+y<i[i.length-1];)i.pop();0===i.length&&V(h)&&!this.options.tickPositions&&i.push((v+h)/2)}},e.prototype.alignToOthers=function(){var i,s={},o=this.options;return!1===this.chart.options.chart.alignTicks||!1===o.alignTicks||!1===o.startOnTick||!1===o.endOnTick||this.logarithmic||this.chart[this.coll].forEach((function(o){var h=o.options;h=[o.horiz?h.left:h.top,h.width,h.height,h.pane].join(),o.series.length&&(s[h]?i=!0:s[h]=1)})),i},e.prototype.getTickAmount=function(){var i=this.options,s=i.tickAmount,o=i.tickPixelInterval;!V(i.tickInterval)&&!s&&this.len<o&&!this.isRadial&&!this.logarithmic&&i.startOnTick&&i.endOnTick&&(s=2),!s&&this.alignToOthers()&&(s=Math.ceil(this.len/o)+1),4>s&&(this.finalTickAmt=s,s=5),this.tickAmount=s},e.prototype.adjustTickAmount=function(){var i=this.options,s=this.tickInterval,o=this.tickPositions,h=this.tickAmount,v=this.finalTickAmt,y=o&&o.length,_=se(this.threshold,this.softThreshold?0:null);if(this.hasData()&&te(this.min)&&te(this.max)){if(y<h){for(;o.length<h;)o.length%2||this.min===_?o.push(N(o[o.length-1]+s)):o.unshift(N(o[0]-s));this.transA*=(y-1)/(h-1),this.min=i.startOnTick?o[0]:Math.min(this.min,o[0]),this.max=i.endOnTick?o[o.length-1]:Math.max(this.max,o[o.length-1])}else y>h&&(this.tickInterval*=2,this.setTickPositions());if(V(v)){for(s=i=o.length;s--;)(3===v&&1==s%2||2>=v&&0<s&&s<i-1)&&o.splice(s,1);this.finalTickAmt=void 0}}},e.prototype.setScale=function(){var i,s,o,h,v,y,_=!1,S=!1;this.series.forEach((function(i){var s;_=_||i.isDirtyData||i.isDirty,S=S||(null===(s=i.xAxis)||void 0===s?void 0:s.isDirty)||!1})),this.setAxisSize(),(y=this.len!==(null===(i=this.old)||void 0===i?void 0:i.len))||_||S||this.isLinked||this.forceRedraw||this.userMin!==(null===(s=this.old)||void 0===s?void 0:s.userMin)||this.userMax!==(null===(o=this.old)||void 0===o?void 0:o.userMax)||this.alignToOthers()?(this.stacking&&this.stacking.resetStacks(),this.forceRedraw=!1,this.getSeriesExtremes(),this.setTickInterval(),this.isDirty||(this.isDirty=y||this.min!==(null===(h=this.old)||void 0===h?void 0:h.min)||this.max!==(null===(v=this.old)||void 0===v?void 0:v.max))):this.stacking&&this.stacking.cleanStacks(),_&&this.panningState&&(this.panningState.isDirty=!0),Y(this,"afterSetScale")},e.prototype.setExtremes=function(i,s,o,h,v){var y=this,_=y.chart;o=se(o,!0),y.series.forEach((function(i){delete i.kdTree})),v=U(v,{min:i,max:s}),Y(y,"setExtremes",v,(function(){y.userMin=i,y.userMax=s,y.eventArgs=v,o&&_.redraw(h)}))},e.prototype.zoom=function(i,s){var o=this,h=this.dataMin,v=this.dataMax,y=this.options,_=Math.min(h,se(y.min,h)),S=Math.max(v,se(y.max,v));return Y(this,"zoom",i={newMin:i,newMax:s},(function(i){var s=i.newMin,y=i.newMax;s===o.min&&y===o.max||(o.allowZoomOutside||(V(h)&&(s<_&&(s=_),s>S&&(s=S)),V(v)&&(y<_&&(y=_),y>S&&(y=S))),o.displayBtn=void 0!==s||void 0!==y,o.setExtremes(s,y,!1,void 0,{trigger:"zoom"})),i.zoomed=!0})),i.zoomed},e.prototype.setAxisSize=function(){var i=this.chart,s=this.options,o=s.offsets||[0,0,0,0],h=this.horiz,v=this.width=Math.round(le(se(s.width,i.plotWidth-o[3]+o[1]),i.plotWidth)),y=this.height=Math.round(le(se(s.height,i.plotHeight-o[0]+o[2]),i.plotHeight)),_=this.top=Math.round(le(se(s.top,i.plotTop+o[0]),i.plotHeight,i.plotTop));s=this.left=Math.round(le(se(s.left,i.plotLeft+o[3]),i.plotWidth,i.plotLeft)),this.bottom=i.chartHeight-y-_,this.right=i.chartWidth-v-s,this.len=Math.max(h?v:y,0),this.pos=h?s:_},e.prototype.getExtremes=function(){var i=this.logarithmic;return{min:i?N(i.lin2log(this.min)):this.min,max:i?N(i.lin2log(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},e.prototype.getThreshold=function(i){var s=this.logarithmic,o=s?s.lin2log(this.min):this.min;return s=s?s.lin2log(this.max):this.max,null===i||-1/0===i?i=o:1/0===i?i=s:o>i?i=o:s<i&&(i=s),this.translate(i,0,1,0,1)},e.prototype.autoLabelAlign=function(i){var s=(se(i,0)-90*this.side+720)%360;return Y(this,"autoLabelAlign",i={align:"center"},(function(i){15<s&&165>s?i.align="right":195<s&&345>s&&(i.align="left")})),i.align},e.prototype.tickSize=function(i){var s=this.options,o=s["tick"===i?"tickLength":"minorTickLength"],h=se(s["tick"===i?"tickWidth":"minorTickWidth"],"tick"===i&&this.isXAxis&&!this.categories?1:0);if(h&&o){"inside"===s[i+"Position"]&&(o=-o);var v=[o,h]}return Y(this,"afterTickSize",i={tickSize:v}),i.tickSize},e.prototype.labelMetrics=function(){var i=this.tickPositions&&this.tickPositions[0]||0;return this.chart.renderer.fontMetrics(this.options.labels.style&&this.options.labels.style.fontSize,this.ticks[i]&&this.ticks[i].label)},e.prototype.unsquish=function(){var i,s,o,h=this.options.labels,v=this.horiz,y=this.tickInterval,_=y,S=this.len/(((this.categories?1:0)+this.max-this.min)/y),T=h.rotation,x=this.labelMetrics(),R=Number.MAX_VALUE,P=Math.max(this.max-this.min,0),t=function(i){var s=i/(S||1);return(s=1<s?Math.ceil(s):1)*y>P&&1/0!==i&&1/0!==S&&P&&(s=Math.ceil(P/y)),N(s*y)};return v?(o=!h.staggerLines&&!h.step&&(V(T)?[T]:S<se(h.autoRotationLimit,80)&&h.autoRotation))&&o.forEach((function(o){if(o===T||o&&-90<=o&&90>=o){var h=(s=t(Math.abs(x.h/Math.sin(he*o))))+Math.abs(o/360);h<R&&(R=h,i=o,_=s)}})):h.step||(_=t(x.h)),this.autoRotation=o,this.labelRotation=se(i,T),_},e.prototype.getSlotWidth=function(i){var s,o=this.chart,h=this.horiz,v=this.options.labels,y=Math.max(this.tickPositions.length-(this.categories?0:1),1),_=o.margin[3];if(i&&te(i.slotWidth))return i.slotWidth;if(h&&v&&2>(v.step||0))return v.rotation?0:(this.staggerLines||1)*this.len/y;if(!h){if(void 0!==(i=null===(s=null==v?void 0:v.style)||void 0===s?void 0:s.width))return parseInt(i,10);if(_)return _-o.spacing[3]}return.33*o.chartWidth},e.prototype.renderUnsquish=function(){var i=this.chart,s=i.renderer,o=this.tickPositions,h=this.ticks,v=this.options.labels,y=v&&v.style||{},_=this.horiz,S=this.getSlotWidth(),T=Math.max(1,Math.round(S-2*(v.padding||5))),x={},R=this.labelMetrics(),P=v.style&&v.style.textOverflow,L=0;if(ie(v.rotation)||(x.rotation=v.rotation||0),o.forEach((function(i){(i=h[i]).movedLabel&&i.replaceMovedLabel(),i&&i.label&&i.label.textPxLength>L&&(L=i.label.textPxLength)})),this.maxLabelLength=L,this.autoRotation)L>T&&L>R.h?x.rotation=this.labelRotation:this.labelRotation=0;else if(S){var N=T;if(!P){var V="clip";for(T=o.length;!_&&T--;){var j=o[T];(j=h[j].label)&&(j.styles&&"ellipsis"===j.styles.textOverflow?j.css({textOverflow:"clip"}):j.textPxLength>S&&j.css({width:S+"px"}),j.getBBox().height>this.len/o.length-(R.h-R.f)&&(j.specificTextOverflow="ellipsis"))}}}x.rotation&&(N=L>.5*i.chartHeight?.33*i.chartHeight:L,P||(V="ellipsis")),(this.labelAlign=v.align||this.autoLabelAlign(this.labelRotation))&&(x.align=this.labelAlign),o.forEach((function(i){var s=(i=h[i])&&i.label,o=y.width,v={};s&&(s.attr(x),i.shortenLabel?i.shortenLabel():N&&!o&&"nowrap"!==y.whiteSpace&&(N<s.textPxLength||"SPAN"===s.element.tagName)?(v.width=N+"px",P||(v.textOverflow=s.specificTextOverflow||V),s.css(v)):s.styles&&s.styles.width&&!v.width&&!o&&s.css({width:null}),delete s.specificTextOverflow,i.rotation=x.rotation)}),this),this.tickRotCorr=s.rotCorr(R.b,this.labelRotation||0,0!==this.side)},e.prototype.hasData=function(){return this.series.some((function(i){return i.hasData()}))||this.options.showEmpty&&V(this.min)&&V(this.max)},e.prototype.addTitle=function(i){var s,o=this.chart.renderer,h=this.horiz,v=this.opposite,y=this.options.title,_=this.chart.styledMode;this.axisTitle||((s=y.textAlign)||(s=(h?{low:"left",middle:"center",high:"right"}:{low:v?"right":"left",middle:"center",high:v?"left":"right"})[y.align]),this.axisTitle=o.text(y.text,0,0,y.useHTML).attr({zIndex:7,rotation:y.rotation||0,align:s}).addClass("highcharts-axis-title"),_||this.axisTitle.css(ae(y.style)),this.axisTitle.add(this.axisGroup),this.axisTitle.isNew=!0),_||y.style.width||this.isRadial||this.axisTitle.css({width:this.len+"px"}),this.axisTitle[i?"show":"hide"](i)},e.prototype.generateTick=function(i){var s=this.ticks;s[i]?s[i].addLabel():s[i]=new y(this,i)},e.prototype.getOffset=function(){var i,s=this,o=this,h=o.chart,v=h.renderer,y=o.options,_=o.tickPositions,S=o.ticks,T=o.horiz,x=o.side,R=h.inverted&&!o.isZAxis?[1,0,3,2][x]:x,P=0,L=0,N=y.title,j=y.labels,W=0,K=h.axisOffset;h=h.clipOffset;var U=[-1,1,1,-1][x],$=y.className,X=o.axisParent,Z=o.hasData();if(o.showAxis=i=Z||se(y.showEmpty,!0),o.staggerLines=o.horiz&&j.staggerLines,!o.axisGroup){var C=function(i,o,h){return v.g(i).attr({zIndex:h}).addClass("highcharts-"+s.coll.toLowerCase()+o+" "+(s.isRadial?"highcharts-radial-axis"+o+" ":"")+($||"")).add(X)};o.gridGroup=C("grid","-grid",y.gridZIndex||1),o.axisGroup=C("axis","",y.zIndex||2),o.labelGroup=C("axis-labels","-labels",j.zIndex||7)}if(Z||o.isLinked?(_.forEach((function(i,s){o.generateTick(i,s)})),o.renderUnsquish(),o.reserveSpaceDefault=0===x||2===x||{1:"left",3:"right"}[x]===o.labelAlign,se(j.reserveSpace,"center"===o.labelAlign||null,o.reserveSpaceDefault)&&_.forEach((function(i){W=Math.max(S[i].getLabelSize(),W)})),o.staggerLines&&(W*=o.staggerLines),o.labelOffset=W*(o.opposite?-1:1)):re(S,(function(i,s){i.destroy(),delete S[s]})),N&&N.text&&!1!==N.enabled&&(o.addTitle(i),i&&!1!==N.reserveSpace)){o.titleOffset=P=o.axisTitle.getBBox()[T?"height":"width"];var ee=N.offset;L=V(ee)?0:se(N.margin,T?5:10)}o.renderLine(),o.offset=U*se(y.offset,K[x]?K[x]+(y.margin||0):0),o.tickRotCorr=o.tickRotCorr||{x:0,y:0},N=0===x?-o.labelMetrics().h:2===x?o.tickRotCorr.y:0,L=Math.abs(W)+L,W&&(L=L-N+U*(T?se(j.y,o.tickRotCorr.y+8*U):j.x)),o.axisTitleMargin=se(ee,L),o.getMaxLabelDimensions&&(o.maxLabelDimensions=o.getMaxLabelDimensions(S,_)),T=this.tickSize("tick"),K[x]=Math.max(K[x],o.axisTitleMargin+P+U*o.offset,L,_&&_.length&&T?T[0]+U*o.offset:0),y=y.offset?0:2*Math.floor(o.axisLine.strokeWidth()/2),h[R]=Math.max(h[R],y),Y(this,"afterGetOffset")},e.prototype.getLinePath=function(i){var s=this.chart,o=this.opposite,h=this.offset,v=this.horiz,y=this.left+(o?this.width:0)+h;return h=s.chartHeight-this.bottom-(o?this.height:0)+h,o&&(i*=-1),s.renderer.crispLine([["M",v?this.left:y,v?h:this.top],["L",v?s.chartWidth-this.right:y,v?h:s.chartHeight-this.bottom]],i)},e.prototype.renderLine=function(){this.axisLine||(this.axisLine=this.chart.renderer.path().addClass("highcharts-axis-line").add(this.axisGroup),this.chart.styledMode||this.axisLine.attr({stroke:this.options.lineColor,"stroke-width":this.options.lineWidth,zIndex:7}))},e.prototype.getTitlePosition=function(){var i=this.horiz,s=this.left,o=this.top,h=this.len,v=this.options.title,y=i?s:o,_=this.opposite,S=this.offset,T=v.x||0,x=v.y||0,R=this.axisTitle,P=this.chart.renderer.fontMetrics(v.style&&v.style.fontSize,R);return R=Math.max(R.getBBox(null,0).height-P.h-1,0),h={low:y+(i?0:h),middle:y+h/2,high:y+(i?h:0)}[v.align],s=(i?o+this.height:s)+(i?1:-1)*(_?-1:1)*this.axisTitleMargin+[-R,R,P.f,-R][this.side],i={x:i?h+T:s+(_?this.width:0)+S+T,y:i?s+x-(_?this.height:0)+S:h+x},Y(this,"afterGetTitlePosition",{titlePosition:i}),i},e.prototype.renderMinorTick=function(i){var s=this.chart.hasRendered&&this.old,o=this.minorTicks;o[i]||(o[i]=new y(this,i,"minor")),s&&o[i].isNew&&o[i].render(null,!0),o[i].render(null,!1,1)},e.prototype.renderTick=function(i,s){var o,h=this.ticks,v=this.chart.hasRendered&&this.old;(!this.isLinked||i>=this.min&&i<=this.max||null!==(o=this.grid)&&void 0!==o&&o.isColumn)&&(h[i]||(h[i]=new y(this,i)),v&&h[i].isNew&&h[i].render(s,!0,-1),h[i].render(s))},e.prototype.render=function(){var i,s,h=this,v=h.chart,_=h.logarithmic,T=h.options,x=h.isLinked,R=h.tickPositions,P=h.axisTitle,L=h.ticks,N=h.minorTicks,V=h.alternateBands,j=T.stackLabels,W=T.alternateGridColor,K=h.tickmarkOffset,U=h.axisLine,$=h.showAxis,X=S(v.renderer.globalAnimation);h.labelEdge.length=0,h.overlap=!1,[L,N,V].forEach((function(i){re(i,(function(i){i.isActive=!1}))})),(h.hasData()||x)&&(h.minorTickInterval&&!h.categories&&h.getMinorTickPositions().forEach((function(i){h.renderMinorTick(i)})),R.length&&(R.forEach((function(i,s){h.renderTick(i,s)})),K&&(0===h.min||h.single)&&(L[-1]||(L[-1]=new y(h,-1,null,!0)),L[-1].render(-1))),W&&R.forEach((function(y,S){s=void 0!==R[S+1]?R[S+1]+K:h.max-K,0==S%2&&y<h.max&&s<=h.max+(v.polar?-K:K)&&(V[y]||(V[y]=new o.PlotLineOrBand(h)),i=y+K,V[y].options={from:_?_.lin2log(i):i,to:_?_.lin2log(s):s,color:W,className:"highcharts-alternate-grid"},V[y].render(),V[y].isActive=!0)})),h._addedPlotLB||(h._addedPlotLB=!0,(T.plotLines||[]).concat(T.plotBands||[]).forEach((function(i){h.addPlotBandOrLine(i)})))),[L,N,V].forEach((function(i){var s,o=[],h=X.duration;re(i,(function(i,s){i.isActive||(i.render(s,!1,0),i.isActive=!1,o.push(s))})),ce((function(){for(s=o.length;s--;)i[o[s]]&&!i[o[s]].isActive&&(i[o[s]].destroy(),delete i[o[s]])}),i!==V&&v.hasRendered&&h?h:0)})),U&&(U[U.isPlaced?"animate":"attr"]({d:this.getLinePath(U.strokeWidth())}),U.isPlaced=!0,U[$?"show":"hide"]($)),P&&$&&(T=h.getTitlePosition(),te(T.y)?(P[P.isNew?"attr":"animate"](T),P.isNew=!1):(P.attr("y",-9999),P.isNew=!0)),j&&j.enabled&&h.stacking&&h.stacking.renderStackTotals(),h.old={len:h.len,max:h.max,min:h.min,transA:h.transA,userMax:h.userMax,userMin:h.userMin},h.isDirty=!1,Y(this,"afterRender")},e.prototype.redraw=function(){this.visible&&(this.render(),this.plotLinesAndBands.forEach((function(i){i.render()}))),this.series.forEach((function(i){i.isDirty=!0}))},e.prototype.getKeepProps=function(){return this.keepProps||e.keepProps},e.prototype.destroy=function(i){var s,o=this,h=o.plotLinesAndBands;if(Y(this,"destroy",{keepEvents:i}),i||oe(o),[o.ticks,o.minorTicks,o.alternateBands].forEach((function(i){j(i)})),h)for(i=h.length;i--;)h[i].destroy();for(s in"axisLine axisTitle axisGroup gridGroup labelGroup cross scrollbar".split(" ").forEach((function(i){o[i]&&(o[i]=o[i].destroy())})),o.plotLinesAndBandsGroups)o.plotLinesAndBandsGroups[s]=o.plotLinesAndBandsGroups[s].destroy();re(o,(function(i,s){-1===o.getKeepProps().indexOf(s)&&delete o[s]}))},e.prototype.drawCrosshair=function(i,o){var v,y=this.crosshair,_=se(y.snap,!0),S=this.cross,T=this.chart;if(Y(this,"drawCrosshair",{e:i,point:o}),i||(i=this.cross&&this.cross.e),this.crosshair&&!1!==(V(o)||!_)){if(_?V(o)&&(v=se("colorAxis"!==this.coll?o.crosshairPos:null,this.isXAxis?o.plotX:this.len-o.plotY)):v=i&&(this.horiz?i.chartX-this.pos:this.len-i.chartY+this.pos),V(v)){var x={value:o&&(this.isXAxis?o.x:se(o.stackY,o.y)),translatedValue:v};T.polar&&U(x,{isCrosshair:!0,chartX:i&&i.chartX,chartY:i&&i.chartY,point:o}),x=this.getPlotLinePath(x)||null}if(!V(x))return void this.hideCrosshair();_=this.categories&&!this.isRadial,S||(this.cross=S=T.renderer.path().addClass("highcharts-crosshair highcharts-crosshair-"+(_?"category ":"thin ")+y.className).attr({zIndex:se(y.zIndex,2)}).add(),T.styledMode||(S.attr({stroke:y.color||(_?s.parse(h.highlightColor20).setOpacity(.25).get():h.neutralColor20),"stroke-width":se(y.width,1)}).css({"pointer-events":"none"}),y.dashStyle&&S.attr({dashstyle:y.dashStyle}))),S.show().attr({d:x}),_&&!y.width&&S.attr({"stroke-width":this.transA}),this.cross.e=i}else this.hideCrosshair();Y(this,"afterDrawCrosshair",{e:i,point:o})},e.prototype.hideCrosshair=function(){this.cross&&this.cross.hide(),Y(this,"afterHideCrosshair")},e.prototype.hasVerticalPanning=function(){var i,s=null===(i=this.chart.options.chart)||void 0===i?void 0:i.panning;return!!(s&&s.enabled&&/y/.test(s.type))},e.prototype.validatePositiveValue=function(i){return te(i)&&0<i},e.prototype.update=function(i,s){var o=this.chart,h=i&&i.events||{};i=ae(this.userOptions,i),o.options[this.coll].indexOf&&(o.options[this.coll][o.options[this.coll].indexOf(this.userOptions)]=i),re(o.options[this.coll].events,(function(i,s){void 0===h[s]&&(h[s]=void 0)})),this.destroy(!0),this.init(o,U(i,{events:h})),o.isDirtyBox=!0,se(s,!0)&&o.redraw()},e.prototype.remove=function(i){for(var s=this.chart,o=this.coll,h=this.series,v=h.length;v--;)h[v]&&h[v].remove(!1);W(s.axes,this),W(s[o],this),Z(s.options[o])?s.options[o].splice(this.options.index,1):delete s.options[o],s[o].forEach((function(i,s){i.options.index=i.userOptions.index=s})),this.destroy(),s.isDirtyBox=!0,se(i,!0)&&s.redraw()},e.prototype.setTitle=function(i,s){this.update({title:i},s)},e.prototype.setCategories=function(i,s){this.update({categories:i},s)},e.defaultOptions={dateTimeLabelFormats:{millisecond:{main:"%H:%M:%S.%L",range:!1},second:{main:"%H:%M:%S",range:!1},minute:{main:"%H:%M",range:!1},hour:{main:"%H:%M",range:!1},day:{main:"%e. %b"},week:{main:"%e. %b"},month:{main:"%b '%y"},year:{main:"%Y"}},endOnTick:!1,labels:{enabled:!0,indentation:10,x:0,style:{color:h.neutralColor60,cursor:"default",fontSize:"11px"}},maxPadding:.01,minorTickLength:2,minorTickPosition:"outside",minPadding:.01,showEmpty:!0,startOfWeek:1,startOnTick:!1,tickLength:10,tickPixelInterval:100,tickmarkPlacement:"between",tickPosition:"outside",title:{align:"middle",style:{color:h.neutralColor60}},type:"linear",minorGridLineColor:h.neutralColor5,minorGridLineWidth:1,minorTickColor:h.neutralColor40,lineColor:h.highlightColor20,lineWidth:1,gridLineColor:h.neutralColor10,tickColor:h.highlightColor20},e.defaultYAxisOptions={endOnTick:!0,maxPadding:.05,minPadding:.05,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8},startOnTick:!0,title:{rotation:270,text:"Values"},stackLabels:{animation:{},allowOverlap:!1,enabled:!1,crop:!0,overflow:"justify",formatter:function(){return(0,this.axis.chart.numberFormatter)(this.total,-1)},style:{color:h.neutralColor100,fontSize:"11px",fontWeight:"bold",textOutline:"1px contrast"}},gridLineWidth:1,lineWidth:0},e.defaultLeftAxisOptions={labels:{x:-15},title:{rotation:270}},e.defaultRightAxisOptions={labels:{x:15},title:{rotation:90}},e.defaultBottomAxisOptions={labels:{autoRotation:[-45],x:0},margin:15,title:{rotation:0}},e.defaultTopAxisOptions={labels:{autoRotation:[-45],x:0},margin:15,title:{rotation:0}},e.keepProps="extKey hcEvents names series userMax userMin".split(" "),e}(),o.Axis=i,o.Axis})),O(s,"Core/Axis/DateTimeAxis.js",[s["Core/Axis/Axis.js"],s["Core/Utilities.js"]],(function(i,s){var o=s.addEvent,h=s.getMagnitude,v=s.normalizeTickInterval,y=s.timeUnits,_=function(){function b(i){this.axis=i}return b.prototype.normalizeTimeTickInterval=function(i,s){var o=s||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]];s=o[o.length-1];var _,S=y[s[0]],T=s[1];for(_=0;_<o.length&&(s=o[_],S=y[s[0]],T=s[1],!(o[_+1]&&i<=(S*T[T.length-1]+y[o[_+1][0]])/2));_++);return S===y.year&&i<5*S&&(T=[1,2,5]),{unitRange:S,count:i=v(i/S,T,"year"===s[0]?Math.max(h(i/S),1):1),unitName:s[0]}},b}();return(s=function(){function b(){}return b.compose=function(i){i.keepProps.push("dateTime"),i.prototype.getTimeTicks=function(){return this.chart.time.getTimeTicks.apply(this.chart.time,arguments)},o(i,"init",(function(i){"datetime"!==i.userOptions.type?this.dateTime=void 0:this.dateTime||(this.dateTime=new _(this))}))},b.AdditionsClass=_,b}()).compose(i),s})),O(s,"Core/Axis/LogarithmicAxis.js",[s["Core/Axis/Axis.js"],s["Core/Utilities.js"]],(function(i,s){var o=s.addEvent,h=s.getMagnitude,v=s.normalizeTickInterval,y=s.pick,_=function(){function b(i){this.axis=i}return b.prototype.getLogTickPositions=function(i,s,o,_){var S=this.axis,T=S.len,x=S.options,R=[];if(_||(this.minorAutoInterval=void 0),.5<=i)i=Math.round(i),R=S.getLinearTickPositions(i,s,o);else if(.08<=i){var P,L;for(x=Math.floor(s),T=.3<i?[1,2,4]:.15<i?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];x<o+1&&!L;x++){var N=T.length;for(P=0;P<N&&!L;P++){var V=this.log2lin(this.lin2log(x)*T[P]);V>s&&(!_||j<=o)&&void 0!==j&&R.push(j),j>o&&(L=!0);var j=V}}}else s=this.lin2log(s),o=this.lin2log(o),i=_?S.getMinorTickInterval():x.tickInterval,i=y("auto"===i?null:i,this.minorAutoInterval,x.tickPixelInterval/(_?5:1)*(o-s)/((_?T/S.tickPositions.length:T)||1)),i=v(i,void 0,h(i)),R=S.getLinearTickPositions(i,s,o).map(this.log2lin),_||(this.minorAutoInterval=i/5);return _||(S.tickInterval=i),R},b.prototype.lin2log=function(i){return Math.pow(10,i)},b.prototype.log2lin=function(i){return Math.log(i)/Math.LN10},b}();return(s=function(){function b(){}return b.compose=function(i){i.keepProps.push("logarithmic"),o(i,"init",(function(i){var s=this.logarithmic;"logarithmic"!==i.userOptions.type?this.logarithmic=void 0:s||(this.logarithmic=new _(this))})),o(i,"afterInit",(function(){var i=this.logarithmic;i&&(this.lin2val=function(s){return i.lin2log(s)},this.val2lin=function(s){return i.log2lin(s)})}))},b}()).compose(i),s})),O(s,"Core/Axis/PlotLineOrBand.js",[s["Core/Axis/Axis.js"],s["Core/Globals.js"],s["Core/Color/Palette.js"],s["Core/Utilities.js"]],(function(i,s,o,h){var v=h.arrayMax,y=h.arrayMin,_=h.defined,S=h.destroyObjectProperties,T=h.erase,x=h.extend,R=h.fireEvent,P=h.merge,L=h.objectEach,N=h.pick;return h=function(){function b(i,s){this.axis=i,s&&(this.options=s,this.id=s.id)}return b.prototype.render=function(){R(this,"render");var i=this,s=i.axis,h=s.horiz,v=s.logarithmic,y=i.options,S=y.label,T=i.label,x=y.to,V=y.from,j=y.value,W=_(V)&&_(x),K=_(j),U=i.svgElem,Y=!U,$=[],X=y.color,Z=N(y.zIndex,0),ee=y.events;$={class:"highcharts-plot-"+(W?"band ":"line ")+(y.className||"")};var te={},ie=s.chart.renderer,ae=W?"bands":"lines";if(v&&(V=v.log2lin(V),x=v.log2lin(x),j=v.log2lin(j)),s.chart.styledMode||(K?($.stroke=X||o.neutralColor40,$["stroke-width"]=N(y.width,1),y.dashStyle&&($.dashstyle=y.dashStyle)):W&&($.fill=X||o.highlightColor10,y.borderWidth&&($.stroke=y.borderColor,$["stroke-width"]=y.borderWidth))),te.zIndex=Z,ae+="-"+Z,(v=s.plotLinesAndBandsGroups[ae])||(s.plotLinesAndBandsGroups[ae]=v=ie.g("plot-"+ae).attr(te).add()),Y&&(i.svgElem=U=ie.path().attr($).add(v)),K)$=s.getPlotLinePath({value:j,lineWidth:U.strokeWidth(),acrossPanes:y.acrossPanes});else{if(!W)return;$=s.getPlotBandPath(V,x,y)}return!i.eventsAdded&&ee&&(L(ee,(function(s,o){U.on(o,(function(s){ee[o].apply(i,[s])}))})),i.eventsAdded=!0),(Y||!U.d)&&$&&$.length?U.attr({d:$}):U&&($?(U.show(!0),U.animate({d:$})):U.d&&(U.hide(),T&&(i.label=T=T.destroy()))),S&&(_(S.text)||_(S.formatter))&&$&&$.length&&0<s.width&&0<s.height&&!$.isFlat?(S=P({align:h&&W&&"center",x:h?!W&&4:10,verticalAlign:!h&&W&&"middle",y:h?W?16:10:W?6:-4,rotation:h&&!W&&90},S),this.renderLabel(S,$,W,Z)):T&&T.hide(),i},b.prototype.renderLabel=function(i,s,o,h){var _=this.label,S=this.axis.chart.renderer;_||((_={align:i.textAlign||i.align,rotation:i.rotation,class:"highcharts-plot-"+(o?"band":"line")+"-label "+(i.className||"")}).zIndex=h,h=this.getLabelText(i),this.label=_=S.text(h,0,0,i.useHTML).attr(_).add(),this.axis.chart.styledMode||_.css(i.style)),S=s.xBounds||[s[0][1],s[1][1],o?s[2][1]:s[0][1]],s=s.yBounds||[s[0][2],s[1][2],o?s[2][2]:s[0][2]],o=y(S),h=y(s),_.align(i,!1,{x:o,y:h,width:v(S)-o,height:v(s)-h}),_.show(!0)},b.prototype.getLabelText=function(i){return _(i.formatter)?i.formatter.call(this):i.text},b.prototype.destroy=function(){T(this.axis.plotLinesAndBands,this),delete this.axis,S(this)},b}(),x(i.prototype,{getPlotBandPath:function(i,s,o){void 0===o&&(o=this.options);var h=this.getPlotLinePath({value:s,force:!0,acrossPanes:o.acrossPanes});o=this.getPlotLinePath({value:i,force:!0,acrossPanes:o.acrossPanes});var v=[],y=this.horiz,_=1;if(i=i<this.min&&s<this.min||i>this.max&&s>this.max,o&&h){if(i){var S=o.toString()===h.toString();_=0}for(i=0;i<o.length;i+=2){s=o[i];var T=o[i+1],x=h[i],R=h[i+1];"M"!==s[0]&&"L"!==s[0]||"M"!==T[0]&&"L"!==T[0]||"M"!==x[0]&&"L"!==x[0]||"M"!==R[0]&&"L"!==R[0]||(y&&x[1]===s[1]?(x[1]+=_,R[1]+=_):y||x[2]!==s[2]||(x[2]+=_,R[2]+=_),v.push(["M",s[1],s[2]],["L",T[1],T[2]],["L",R[1],R[2]],["L",x[1],x[2]],["Z"])),v.isFlat=S}}return v},addPlotBand:function(i){return this.addPlotBandOrLine(i,"plotBands")},addPlotLine:function(i){return this.addPlotBandOrLine(i,"plotLines")},addPlotBandOrLine:function(i,o){var h=this,v=new s.PlotLineOrBand(this,i),y=this.userOptions;if(this.visible&&(v=v.render()),v){if(this._addedPlotLB||(this._addedPlotLB=!0,(y.plotLines||[]).concat(y.plotBands||[]).forEach((function(i){h.addPlotBandOrLine(i)}))),o){var _=y[o]||[];_.push(i),y[o]=_}this.plotLinesAndBands.push(v)}return v},removePlotBandOrLine:function(i){for(var s=this.plotLinesAndBands,o=this.options,h=this.userOptions,v=s.length;v--;)s[v].id===i&&s[v].destroy();[o.plotLines||[],h.plotLines||[],o.plotBands||[],h.plotBands||[]].forEach((function(s){for(v=s.length;v--;)(s[v]||{}).id===i&&T(s,s[v])}))},removePlotBand:function(i){this.removePlotBandOrLine(i)},removePlotLine:function(i){this.removePlotBandOrLine(i)}}),s.PlotLineOrBand=h,s.PlotLineOrBand})),O(s,"Core/Tooltip.js",[s["Core/Globals.js"],s["Core/Color/Palette.js"],s["Core/Utilities.js"]],(function(i,s,o){var h=i.doc,v=o.clamp,y=o.css,_=o.defined,S=o.discardElement,T=o.extend,x=o.fireEvent,R=o.format,P=o.isNumber,L=o.isString,N=o.merge,V=o.pick,j=o.splat,W=o.syncTimeout,K=o.timeUnits,U=function(){function z(i,s){this.container=void 0,this.crosshairs=[],this.distance=0,this.isHidden=!0,this.isSticky=!1,this.now={},this.options={},this.outside=!1,this.chart=i,this.init(i,s)}return z.prototype.applyFilter=function(){var i=this.chart;i.renderer.definition({tagName:"filter",attributes:{id:"drop-shadow-"+i.index,opacity:.5},children:[{tagName:"feGaussianBlur",attributes:{in:"SourceAlpha",stdDeviation:1}},{tagName:"feOffset",attributes:{dx:1,dy:1}},{tagName:"feComponentTransfer",children:[{tagName:"feFuncA",attributes:{type:"linear",slope:.3}}]},{tagName:"feMerge",children:[{tagName:"feMergeNode"},{tagName:"feMergeNode",attributes:{in:"SourceGraphic"}}]}]}),i.renderer.definition({tagName:"style",textContent:".highcharts-tooltip-"+i.index+"{filter:url(#drop-shadow-"+i.index+")}"})},z.prototype.bodyFormatter=function(i){return i.map((function(i){var s=i.series.tooltipOptions;return(s[(i.point.formatPrefix||"point")+"Formatter"]||i.point.tooltipFormatter).call(i.point,s[(i.point.formatPrefix||"point")+"Format"]||"")}))},z.prototype.cleanSplit=function(i){this.chart.series.forEach((function(s){var o=s&&s.tt;o&&(!o.isActive||i?s.tt=o.destroy():o.isActive=!1)}))},z.prototype.defaultFormatter=function(i){var s=this.points||j(this),o=[i.tooltipFooterHeaderFormatter(s[0])];return(o=o.concat(i.bodyFormatter(s))).push(i.tooltipFooterHeaderFormatter(s[0],!0)),o},z.prototype.destroy=function(){this.label&&(this.label=this.label.destroy()),this.split&&this.tt&&(this.cleanSplit(this.chart,!0),this.tt=this.tt.destroy()),this.renderer&&(this.renderer=this.renderer.destroy(),S(this.container)),o.clearTimeout(this.hideTimer),o.clearTimeout(this.tooltipTimeout)},z.prototype.getAnchor=function(i,s){var o,h,v=this.chart,y=v.pointer,_=v.inverted,S=v.plotTop,T=v.plotLeft,x=0,R=0;return i=j(i),this.followPointer&&s?(void 0===s.chartX&&(s=y.normalize(s)),y=[s.chartX-T,s.chartY-S]):i[0].tooltipPos?y=i[0].tooltipPos:(i.forEach((function(i){o=i.series.yAxis,h=i.series.xAxis,x+=i.plotX||0,R+=i.plotLow?(i.plotLow+(i.plotHigh||0))/2:i.plotY||0,h&&o&&(_?(x+=S+v.plotHeight-h.len-h.pos,R+=T+v.plotWidth-o.len-o.pos):(x+=h.pos-T,R+=o.pos-S))})),x/=i.length,R/=i.length,y=[_?v.plotWidth-R:x,_?v.plotHeight-x:R],this.shared&&1<i.length&&s&&(_?y[0]=s.chartX-T:y[1]=s.chartY-S)),y.map(Math.round)},z.prototype.getDateFormat=function(i,s,o,h){var v=this.chart.time,y=v.dateFormat("%m-%d %H:%M:%S.%L",s),_={millisecond:15,second:12,minute:9,hour:6,day:3},S="millisecond";for(T in K){if(i===K.week&&+v.dateFormat("%w",s)===o&&"00:00:00.000"===y.substr(6)){var T="week";break}if(K[T]>i){T=S;break}if(_[T]&&y.substr(_[T])!=="01-01 00:00:00.000".substr(_[T]))break;"week"!==T&&(S=T)}if(T)var x=v.resolveDTLFormat(h[T]).main;return x},z.prototype.getLabel=function(){var s,o,h,v,S=this,T=this.chart.renderer,x=this.chart.styledMode,R=this.options,P="tooltip"+(_(R.className)?" "+R.className:""),L=(null===(s=R.style)||void 0===s?void 0:s.pointerEvents)||(!this.followPointer&&R.stickOnContact?"auto":"none");s=function(){S.inContact=!0};if(!this.label){if(this.outside){var N=null===(o=this.chart.options.chart)||void 0===o?void 0:o.style;this.container=v=i.doc.createElement("div"),v.className="highcharts-tooltip-container",y(v,{position:"absolute",top:"1px",pointerEvents:L,zIndex:Math.max((null===(h=this.options.style)||void 0===h?void 0:h.zIndex)||0,((null==N?void 0:N.zIndex)||0)+3)}),i.doc.body.appendChild(v),this.renderer=T=new i.Renderer(v,0,0,N,void 0,void 0,T.styledMode)}if(this.split?this.label=T.g(P):(this.label=T.label("",0,0,R.shape||"callout",null,null,R.useHTML,null,P).attr({padding:R.padding,r:R.borderRadius}),x||this.label.attr({fill:R.backgroundColor,"stroke-width":R.borderWidth}).css(R.style).css({pointerEvents:L}).shadow(R.shadow)),x&&(this.applyFilter(),this.label.addClass("highcharts-tooltip-"+this.chart.index)),S.outside&&!S.split){var V=this.label,j=V.xSetter,W=V.ySetter;V.xSetter=function(i){j.call(V,S.distance),v.style.left=i+"px"},V.ySetter=function(i){W.call(V,S.distance),v.style.top=i+"px"}}this.label.on("mouseenter",s).on("mouseleave",(function(){var i=S.chart.hoverSeries;S.inContact=!1,i&&i.onMouseOut&&i.onMouseOut()})).attr({zIndex:8}).add()}return this.label},z.prototype.getPosition=function(i,s,o){var v,y=this.chart,_=this.distance,S={},T=y.inverted&&o.h||0,x=this.outside,R=x?h.documentElement.clientWidth-2*_:y.chartWidth,P=x?Math.max(h.body.scrollHeight,h.documentElement.scrollHeight,h.body.offsetHeight,h.documentElement.offsetHeight,h.documentElement.clientHeight):y.chartHeight,L=y.pointer.getChartPosition(),l=function(h){var v="x"===h;return[h,v?R:P,v?i:s].concat(x?[v?i*L.scaleX:s*L.scaleY,v?L.left-_+(o.plotX+y.plotLeft)*L.scaleX:L.top-_+(o.plotY+y.plotTop)*L.scaleY,0,v?R:P]:[v?i:s,v?o.plotX+y.plotLeft:o.plotY+y.plotTop,v?y.plotLeft:y.plotTop,v?y.plotLeft+y.plotWidth:y.plotTop+y.plotHeight])},N=l("y"),j=l("x"),W=!this.followPointer&&V(o.ttBelow,!y.inverted==!!o.negative),n=function(i,s,o,h,v,y,x){var R="y"===i?_*L.scaleY:_*L.scaleX,P=(o-h)/2,N=h<v-_,V=v+_+h<s,j=v-R-o+P;if(v=v+R-P,W&&V)S[i]=v;else if(!W&&N)S[i]=j;else if(N)S[i]=Math.min(x-h,0>j-T?j:j-T);else{if(!V)return!1;S[i]=Math.max(y,v+T+o>s?v:v+T)}},C=function(i,s,o,h,v){var y;return v<_||v>s-_?y=!1:S[i]=v<o/2?1:v>s-h/2?s-h-2:v-o/2,y},A=function(i){var s=N;N=j,j=s,v=i},z=function(){!1!==n.apply(0,N)?!1!==C.apply(0,j)||v||(A(!0),z()):v?S.x=S.y=0:(A(!0),z())};return(y.inverted||1<this.len)&&A(),z(),S},z.prototype.getXDateFormat=function(i,s,o){s=s.dateTimeLabelFormats;var h=o&&o.closestPointRange;return(h?this.getDateFormat(h,i.x,o.options.startOfWeek,s):s.day)||s.year},z.prototype.hide=function(i){var s=this;o.clearTimeout(this.hideTimer),i=V(i,this.options.hideDelay,500),this.isHidden||(this.hideTimer=W((function(){s.getLabel().fadeOut(i?void 0:i),s.isHidden=!0}),i))},z.prototype.init=function(i,s){this.chart=i,this.options=s,this.crosshairs=[],this.now={x:0,y:0},this.isHidden=!0,this.split=s.split&&!i.inverted&&!i.polar,this.shared=s.shared||this.split,this.outside=V(s.outside,!(!i.scrollablePixelsX&&!i.scrollablePixelsY))},z.prototype.isStickyOnContact=function(){return!(this.followPointer||!this.options.stickOnContact||!this.inContact)},z.prototype.move=function(i,s,h,v){var y=this,_=y.now,S=!1!==y.options.animation&&!y.isHidden&&(1<Math.abs(i-_.x)||1<Math.abs(s-_.y)),x=y.followPointer||1<y.len;T(_,{x:S?(2*_.x+i)/3:i,y:S?(_.y+s)/2:s,anchorX:x?void 0:S?(2*_.anchorX+h)/3:h,anchorY:x?void 0:S?(_.anchorY+v)/2:v}),y.getLabel().attr(_),y.drawTracker(),S&&(o.clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout((function(){y&&y.move(i,s,h,v)}),32))},z.prototype.refresh=function(i,h){var v=this.chart,y=this.options,_=i,S={},T=[],R=y.formatter||this.defaultFormatter;S=this.shared;var P=v.styledMode;if(y.enabled){o.clearTimeout(this.hideTimer),this.followPointer=j(_)[0].series.tooltipOptions.followPointer;var L=this.getAnchor(_,h);h=L[0];var N=L[1];!S||_.series&&_.series.noSharedTooltip?S=_.getLabelConfig():(v.pointer.applyInactiveState(_),_.forEach((function(i){i.setState("hover"),T.push(i.getLabelConfig())})),(S={x:_[0].category,y:_[0].y}).points=T,_=_[0]),this.len=T.length,v=R.call(S,this),R=_.series,this.distance=V(R.tooltipOptions.distance,16),!1===v?this.hide():(this.split?this.renderSplit(v,j(i)):(i=this.getLabel(),y.style.width&&!P||i.css({width:this.chart.spacingBox.width+"px"}),i.attr({text:v&&v.join?v.join(""):v}),i.removeClass(/highcharts-color-[\d]+/g).addClass("highcharts-color-"+V(_.colorIndex,R.colorIndex)),P||i.attr({stroke:y.borderColor||_.color||R.color||s.neutralColor60}),this.updatePosition({plotX:h,plotY:N,negative:_.negative,ttBelow:_.ttBelow,h:L[2]||0})),this.isHidden&&this.label&&this.label.attr({opacity:1}).show(),this.isHidden=!1),x(this,"refresh")}},z.prototype.renderSplit=function(o,h){function d(i,s,o,h,y){return void 0===y&&(y=!0),o?(s=ae?0:se,i=v(i-h/2,te.left,te.right-h)):(s-=ne,i=v(i=y?i-h-X:i+X,y?i:te.left,te.right)),{x:i,y:s}}var y=this,_=y.chart,S=y.chart,x=S.plotHeight,R=S.plotLeft,P=S.plotTop,N=S.pointer,j=S.renderer,W=S.scrollablePixelsY,K=void 0===W?0:W,U=(W=void 0===(W=S.scrollingContainer)?{scrollLeft:0,scrollTop:0}:W).scrollLeft,Y=W.scrollTop,$=S.styledMode,X=y.distance,Z=y.options,ee=y.options.positioner,te={left:U,right:U+S.chartWidth,top:Y,bottom:Y+S.chartHeight},ie=y.getLabel(),ae=!(!_.xAxis[0]||!_.xAxis[0].opposite),ne=P+Y,re=0,se=x-K;L(o)&&(o=[!1,o]),o=o.slice(0,h.length+1).reduce((function(i,o,_){if(!1!==o&&""!==o){var S=(_=h[_-1]||{isHeader:!0,plotX:h[0].plotX,plotY:x,series:{}}).isHeader,T=S?y:_.series,L=T.tt,N=_.isHeader,W=_.series,U="highcharts-color-"+V(_.colorIndex,W.colorIndex,"none");L||(L={padding:Z.padding,r:Z.borderRadius},$||(L.fill=Z.backgroundColor,L["stroke-width"]=Z.borderWidth),L=j.label("",0,0,Z[N?"headerShape":"shape"]||"callout",void 0,void 0,Z.useHTML).addClass((N?"highcharts-tooltip-header ":"")+"highcharts-tooltip-box "+U).attr(L).add(ie)),L.isActive=!0,L.attr({text:o}),$||L.css(Z.style).shadow(Z.shadow).attr({stroke:Z.borderColor||_.color||W.color||s.neutralColor80}),o=T.tt=L,T=(N=o.getBBox()).width+o.strokeWidth(),S&&(re=N.height,se+=re,ae&&(ne-=re)),W=void 0===(W=_.plotX)?0:W,U=void 0===(U=_.plotY)?0:U;var le=_.series;if(_.isHeader){W=R+W;var oe=P+x/2}else L=le.xAxis,le=le.yAxis,W=L.pos+v(W,-X,L.len+X),le.pos+U>=Y+P&&le.pos+U<=Y+P+x-K&&(oe=le.pos+U);W=v(W,te.left-X,te.right+X),"number"==typeof oe?(N=N.height+1,U=ee?ee.call(y,T,N,_):d(W,oe,S,T),i.push({align:ee?0:void 0,anchorX:W,anchorY:oe,boxWidth:T,point:_,rank:V(U.rank,S?1:0),size:N,target:U.y,tt:o,x:U.x})):o.isActive=!1}return i}),[]),!ee&&o.some((function(i){return i.x<te.left}))&&(o=o.map((function(i){var s=d(i.anchorX,i.anchorY,i.point.isHeader,i.boxWidth,!1);return T(i,{target:s.y,x:s.x})}))),y.cleanSplit(),i.distribute(o,se),o.forEach((function(i){var s=i.pos;i.tt.attr({visibility:void 0===s?"hidden":"inherit",x:i.x,y:s+ne,anchorX:i.anchorX,anchorY:i.anchorY})})),o=y.container,_=y.renderer,y.outside&&o&&_&&(S=ie.getBBox(),_.setSize(S.width+S.x,S.height+S.y,!1),N=N.getChartPosition(),o.style.left=N.left+"px",o.style.top=N.top+"px")},z.prototype.drawTracker=function(){if(this.followPointer||!this.options.stickOnContact)this.tracker&&this.tracker.destroy();else{var i=this.chart,s=this.label,o=i.hoverPoint;if(s&&o){var h={x:0,y:0,width:0,height:0};o=this.getAnchor(o);var v=s.getBBox();o[0]+=i.plotLeft-s.translateX,o[1]+=i.plotTop-s.translateY,h.x=Math.min(0,o[0]),h.y=Math.min(0,o[1]),h.width=0>o[0]?Math.max(Math.abs(o[0]),v.width-o[0]):Math.max(Math.abs(o[0]),v.width),h.height=0>o[1]?Math.max(Math.abs(o[1]),v.height-Math.abs(o[1])):Math.max(Math.abs(o[1]),v.height),this.tracker?this.tracker.attr(h):(this.tracker=s.renderer.rect(h).addClass("highcharts-tracker").add(s),i.styledMode||this.tracker.attr({fill:"rgba(0,0,0,0)"}))}}},z.prototype.styledModeFormat=function(i){return i.replace('style="font-size: 10px"','class="highcharts-header"').replace(/style="color:{(point|series)\.color}"/g,'class="highcharts-color-{$1.colorIndex}"')},z.prototype.tooltipFooterHeaderFormatter=function(i,s){var o=s?"footer":"header",h=i.series,v=h.tooltipOptions,y=v.xDateFormat,_=h.xAxis,S=_&&"datetime"===_.options.type&&P(i.key),T=v[o+"Format"];return x(this,"headerFormatter",s={isFooter:s,labelConfig:i},(function(s){S&&!y&&(y=this.getXDateFormat(i,v,_)),S&&y&&(i.point&&i.point.tooltipDateKeys||["key"]).forEach((function(i){T=T.replace("{point."+i+"}","{point."+i+":"+y+"}")})),h.chart.styledMode&&(T=this.styledModeFormat(T)),s.text=R(T,{point:i,series:h},this.chart)})),s.text},z.prototype.update=function(i){this.destroy(),N(!0,this.chart.options.tooltip.userOptions,i),this.init(this.chart,N(!0,this.options,i))},z.prototype.updatePosition=function(i){var s=this.chart,o=s.pointer,h=this.getLabel(),v=i.plotX+s.plotLeft;if(s=i.plotY+s.plotTop,o=o.getChartPosition(),i=(this.options.positioner||this.getPosition).call(this,h.width,h.height,i),this.outside){var _=(this.options.borderWidth||0)+2*this.distance;this.renderer.setSize(h.width+_,h.height+_,!1),1===o.scaleX&&1===o.scaleY||(y(this.container,{transform:"scale("+o.scaleX+", "+o.scaleY+")"}),v*=o.scaleX,s*=o.scaleY),v+=o.left-i.x,s+=o.top-i.y}this.move(Math.round(i.x),Math.round(i.y||0),v,s)},z}();return i.Tooltip=U,i.Tooltip})),O(s,"Core/Pointer.js",[s["Core/Color/Color.js"],s["Core/Globals.js"],s["Core/Color/Palette.js"],s["Core/Tooltip.js"],s["Core/Utilities.js"]],(function(i,s,o,h,v){var y=i.parse,_=s.charts,S=s.noop,T=v.addEvent,x=v.attr,R=v.css,P=v.defined,L=v.extend,N=v.find,V=v.fireEvent,j=v.isNumber,W=v.isObject,K=v.objectEach,U=v.offset,Y=v.pick,$=v.splat;return i=function(){function e(i,s){this.lastValidTouch={},this.pinchDown=[],this.runChartClick=!1,this.chart=i,this.hasDragged=!1,this.options=s,this.unbindContainerMouseLeave=function(){},this.unbindContainerMouseEnter=function(){},this.init(i,s)}return e.prototype.applyInactiveState=function(i){var s,o=[];(i||[]).forEach((function(i){s=i.series,o.push(s),s.linkedParent&&o.push(s.linkedParent),s.linkedSeries&&(o=o.concat(s.linkedSeries)),s.navigatorSeries&&o.push(s.navigatorSeries)})),this.chart.series.forEach((function(i){-1===o.indexOf(i)?i.setState("inactive",!0):i.options.inactiveOtherPoints&&i.setAllPointsToState("inactive")}))},e.prototype.destroy=function(){var i=this;void 0!==i.unDocMouseMove&&i.unDocMouseMove(),this.unbindContainerMouseLeave(),s.chartCount||(s.unbindDocumentMouseUp&&(s.unbindDocumentMouseUp=s.unbindDocumentMouseUp()),s.unbindDocumentTouchEnd&&(s.unbindDocumentTouchEnd=s.unbindDocumentTouchEnd())),clearInterval(i.tooltipTimeout),K(i,(function(s,o){i[o]=void 0}))},e.prototype.drag=function(i){var s=this.chart,h=s.options.chart,v=i.chartX,_=i.chartY,S=this.zoomHor,T=this.zoomVert,x=s.plotLeft,R=s.plotTop,P=s.plotWidth,L=s.plotHeight,N=this.selectionMarker,V=this.mouseDownX||0,j=this.mouseDownY||0,K=W(h.panning)?h.panning&&h.panning.enabled:h.panning,U=h.panKey&&i[h.panKey+"Key"];if((!N||!N.touch)&&(v<x?v=x:v>x+P&&(v=x+P),_<R?_=R:_>R+L&&(_=R+L),this.hasDragged=Math.sqrt(Math.pow(V-v,2)+Math.pow(j-_,2)),10<this.hasDragged)){var Y=s.isInsidePlot(V-x,j-R);s.hasCartesianSeries&&(this.zoomX||this.zoomY)&&Y&&!U&&!N&&(this.selectionMarker=N=s.renderer.rect(x,R,S?1:P,T?1:L,0).attr({class:"highcharts-selection-marker",zIndex:7}).add(),s.styledMode||N.attr({fill:h.selectionMarkerFill||y(o.highlightColor80).setOpacity(.25).get()})),N&&S&&(v-=V,N.attr({width:Math.abs(v),x:(0<v?0:v)+V})),N&&T&&(v=_-j,N.attr({height:Math.abs(v),y:(0<v?0:v)+j})),Y&&!N&&K&&s.pan(i,h.panning)}},e.prototype.dragStart=function(i){var s=this.chart;s.mouseIsDown=i.type,s.cancelClick=!1,s.mouseDownX=this.mouseDownX=i.chartX,s.mouseDownY=this.mouseDownY=i.chartY},e.prototype.drop=function(i){var s=this,o=this.chart,h=this.hasPinched;if(this.selectionMarker){var v,y={originalEvent:i,xAxis:[],yAxis:[]},_=this.selectionMarker,S=_.attr?_.attr("x"):_.x,T=_.attr?_.attr("y"):_.y,x=_.attr?_.attr("width"):_.width,N=_.attr?_.attr("height"):_.height;(this.hasDragged||h)&&(o.axes.forEach((function(o){if(o.zoomEnabled&&P(o.min)&&(h||s[{xAxis:"zoomX",yAxis:"zoomY"}[o.coll]])&&j(S)&&j(T)){var _=o.horiz,R="touchend"===i.type?o.minPixelPadding:0,L=o.toValue((_?S:T)+R);_=o.toValue((_?S+x:T+N)-R),y[o.coll].push({axis:o,min:Math.min(L,_),max:Math.max(L,_)}),v=!0}})),v&&V(o,"selection",y,(function(i){o.zoom(L(i,h?{animation:!1}:null))}))),j(o.index)&&(this.selectionMarker=this.selectionMarker.destroy()),h&&this.scaleGroups()}o&&j(o.index)&&(R(o.container,{cursor:o._cursor}),o.cancelClick=10<this.hasDragged,o.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[])},e.prototype.findNearestKDPoint=function(i,s,o){var h,v=this.chart,y=v.hoverPoint;return v=v.tooltip,y&&v&&v.isStickyOnContact()?y:(i.forEach((function(i){var v=!(i.noSharedTooltip&&s)&&0>i.options.findNearestPointBy.indexOf("y");if(i=i.searchPoint(o,v),(v=W(i,!0)&&i.series)&&!(v=!W(h,!0))){v=h.distX-i.distX;var y=h.dist-i.dist,_=(i.series.group&&i.series.group.zIndex)-(h.series.group&&h.series.group.zIndex);v=0<(0!==v&&s?v:0!==y?y:0!==_?_:h.series.index>i.series.index?-1:1)}v&&(h=i)})),h)},e.prototype.getChartCoordinatesFromPoint=function(i,s){var o=i.series,h=o.xAxis;o=o.yAxis;var v=Y(i.clientX,i.plotX),y=i.shapeArgs;return h&&o?s?{chartX:h.len+h.pos-v,chartY:o.len+o.pos-i.plotY}:{chartX:v+h.pos,chartY:i.plotY+o.pos}:y&&y.x&&y.y?{chartX:y.x,chartY:y.y}:void 0},e.prototype.getChartPosition=function(){if(this.chartPosition)return this.chartPosition;var i=this.chart.container,s=U(i);return this.chartPosition={left:s.left,top:s.top,scaleX:1,scaleY:1},2<i.offsetWidth&&2<i.offsetHeight&&i.getBoundingClientRect&&(s=i.getBoundingClientRect(),this.chartPosition.scaleX=s.width/i.offsetWidth,this.chartPosition.scaleY=s.height/i.offsetHeight),this.chartPosition},e.prototype.getCoordinates=function(i){var s={xAxis:[],yAxis:[]};return this.chart.axes.forEach((function(o){s[o.isXAxis?"xAxis":"yAxis"].push({axis:o,value:o.toValue(i[o.horiz?"chartX":"chartY"])})})),s},e.prototype.getHoverData=function(i,s,o,h,v,y){var _,S=[];h=!(!h||!i);var T=s&&!s.stickyTracking,x={chartX:y?y.chartX:void 0,chartY:y?y.chartY:void 0,shared:v};return V(this,"beforeGetHoverData",x),T=T?[s]:o.filter((function(i){return x.filter?x.filter(i):i.visible&&!(!v&&i.directTouch)&&Y(i.options.enableMouseTracking,!0)&&i.stickyTracking})),s=(_=h||!y?i:this.findNearestKDPoint(T,v,y))&&_.series,_&&(v&&!s.noSharedTooltip?(T=o.filter((function(i){return x.filter?x.filter(i):i.visible&&!(!v&&i.directTouch)&&Y(i.options.enableMouseTracking,!0)&&!i.noSharedTooltip}))).forEach((function(i){var s=N(i.points,(function(i){return i.x===_.x&&!i.isNull}));W(s)&&(i.chart.isBoosting&&(s=i.getPoint(s)),S.push(s))})):S.push(_)),V(this,"afterGetHoverData",x={hoverPoint:_}),{hoverPoint:x.hoverPoint,hoverSeries:s,hoverPoints:S}},e.prototype.getPointFromEvent=function(i){i=i.target;for(var s;i&&!s;)s=i.point,i=i.parentNode;return s},e.prototype.onTrackerMouseOut=function(i){i=i.relatedTarget||i.toElement;var s=this.chart.hoverSeries;this.isDirectTouch=!1,!s||!i||s.stickyTracking||this.inClass(i,"highcharts-tooltip")||this.inClass(i,"highcharts-series-"+s.index)&&this.inClass(i,"highcharts-tracker")||s.onMouseOut()},e.prototype.inClass=function(i,s){for(var o;i;){if(o=x(i,"class")){if(-1!==o.indexOf(s))return!0;if(-1!==o.indexOf("highcharts-container"))return!1}i=i.parentNode}},e.prototype.init=function(i,s){this.options=s,this.chart=i,this.runChartClick=s.chart.events&&!!s.chart.events.click,this.pinchDown=[],this.lastValidTouch={},h&&(i.tooltip=new h(i,s.tooltip),this.followTouchMove=Y(s.tooltip.followTouchMove,!0)),this.setDOMEvents()},e.prototype.normalize=function(i,s){var o=i.touches,h=o?o.length?o.item(0):Y(o.changedTouches,i.changedTouches)[0]:i;return s||(s=this.getChartPosition()),o=h.pageX-s.left,h=h.pageY-s.top,o/=s.scaleX,h/=s.scaleY,L(i,{chartX:Math.round(o),chartY:Math.round(h)})},e.prototype.onContainerClick=function(i){var s=this.chart,o=s.hoverPoint;i=this.normalize(i);var h=s.plotLeft,v=s.plotTop;s.cancelClick||(o&&this.inClass(i.target,"highcharts-tracker")?(V(o.series,"click",L(i,{point:o})),s.hoverPoint&&o.firePointEvent("click",i)):(L(i,this.getCoordinates(i)),s.isInsidePlot(i.chartX-h,i.chartY-v)&&V(s,"click",i)))},e.prototype.onContainerMouseDown=function(i){var o=1==(1&(i.buttons||i.button));i=this.normalize(i),s.isFirefox&&0!==i.button&&this.onContainerMouseMove(i),(void 0===i.button||o)&&(this.zoomOption(i),o&&i.preventDefault&&i.preventDefault(),this.dragStart(i))},e.prototype.onContainerMouseLeave=function(i){var o=_[Y(s.hoverChartIndex,-1)],h=this.chart.tooltip;i=this.normalize(i),o&&(i.relatedTarget||i.toElement)&&(o.pointer.reset(),o.pointer.chartPosition=void 0),h&&!h.isHidden&&this.reset()},e.prototype.onContainerMouseEnter=function(i){delete this.chartPosition},e.prototype.onContainerMouseMove=function(i){var s=this.chart;i=this.normalize(i),this.setHoverChartIndex(),i.preventDefault||(i.returnValue=!1),("mousedown"===s.mouseIsDown||this.touchSelect(i))&&this.drag(i),s.openMenu||!this.inClass(i.target,"highcharts-tracker")&&!s.isInsidePlot(i.chartX-s.plotLeft,i.chartY-s.plotTop)||this.runPointActions(i)},e.prototype.onDocumentTouchEnd=function(i){_[s.hoverChartIndex]&&_[s.hoverChartIndex].pointer.drop(i)},e.prototype.onContainerTouchMove=function(i){this.touchSelect(i)?this.onContainerMouseMove(i):this.touch(i)},e.prototype.onContainerTouchStart=function(i){this.touchSelect(i)?this.onContainerMouseDown(i):(this.zoomOption(i),this.touch(i,!0))},e.prototype.onDocumentMouseMove=function(i){var s=this.chart,o=this.chartPosition;i=this.normalize(i,o);var h=s.tooltip;!o||h&&h.isStickyOnContact()||s.isInsidePlot(i.chartX-s.plotLeft,i.chartY-s.plotTop)||this.inClass(i.target,"highcharts-tracker")||this.reset()},e.prototype.onDocumentMouseUp=function(i){var o=_[Y(s.hoverChartIndex,-1)];o&&o.pointer.drop(i)},e.prototype.pinch=function(i){var s=this,o=s.chart,h=s.pinchDown,v=i.touches||[],y=v.length,_=s.lastValidTouch,T=s.hasZoom,x=s.selectionMarker,R={},P=1===y&&(s.inClass(i.target,"highcharts-tracker")&&o.runTrackerClick||s.runChartClick),N={};1<y&&(s.initiated=!0),T&&s.initiated&&!P&&!1!==i.cancelable&&i.preventDefault(),[].map.call(v,(function(i){return s.normalize(i)})),"touchstart"===i.type?([].forEach.call(v,(function(i,s){h[s]={chartX:i.chartX,chartY:i.chartY}})),_.x=[h[0].chartX,h[1]&&h[1].chartX],_.y=[h[0].chartY,h[1]&&h[1].chartY],o.axes.forEach((function(i){if(i.zoomEnabled){var s=o.bounds[i.horiz?"h":"v"],h=i.minPixelPadding,v=i.toPixels(Math.min(Y(i.options.min,i.dataMin),i.dataMin)),y=i.toPixels(Math.max(Y(i.options.max,i.dataMax),i.dataMax)),_=Math.max(v,y);s.min=Math.min(i.pos,Math.min(v,y)-h),s.max=Math.max(i.pos+i.len,_+h)}})),s.res=!0):s.followTouchMove&&1===y?this.runPointActions(s.normalize(i)):h.length&&(x||(s.selectionMarker=x=L({destroy:S,touch:!0},o.plotBox)),s.pinchTranslate(h,v,R,x,N,_),s.hasPinched=T,s.scaleGroups(R,N),s.res&&(s.res=!1,this.reset(!1,0)))},e.prototype.pinchTranslate=function(i,s,o,h,v,y){this.zoomHor&&this.pinchTranslateDirection(!0,i,s,o,h,v,y),this.zoomVert&&this.pinchTranslateDirection(!1,i,s,o,h,v,y)},e.prototype.pinchTranslateDirection=function(i,s,o,h,v,y,_,S){var T,x,R=this.chart,P=i?"x":"y",L=i?"X":"Y",N="chart"+L,V=i?"width":"height",j=R["plot"+(i?"Left":"Top")],W=S||1,K=R.inverted,U=R.bounds[i?"h":"v"],Y=1===s.length,$=s[0][N],X=o[0][N],Z=!Y&&s[1][N],ee=!Y&&o[1][N];if((o=function(){"number"==typeof ee&&20<Math.abs($-Z)&&(W=S||Math.abs(X-ee)/Math.abs($-Z)),x=(j-X)/W+$,T=R["plot"+(i?"Width":"Height")]/W})(),(s=x)<U.min){s=U.min;var te=!0}else s+T>U.max&&(s=U.max-T,te=!0);te?(X-=.8*(X-_[P][0]),"number"==typeof ee&&(ee-=.8*(ee-_[P][1])),o()):_[P]=[X,ee],K||(y[P]=x-j,y[V]=T),y=K?1/W:W,v[V]=T,v[P]=s,h[K?i?"scaleY":"scaleX":"scale"+L]=W,h["translate"+L]=y*j+(X-y*$)},e.prototype.reset=function(i,s){var o=this.chart,h=o.hoverSeries,v=o.hoverPoint,y=o.hoverPoints,_=o.tooltip,S=_&&_.shared?y:v;i&&S&&$(S).forEach((function(s){s.series.isCartesian&&void 0===s.plotX&&(i=!1)})),i?_&&S&&$(S).length&&(_.refresh(S),_.shared&&y?y.forEach((function(i){i.setState(i.state,!0),i.series.isCartesian&&(i.series.xAxis.crosshair&&i.series.xAxis.drawCrosshair(null,i),i.series.yAxis.crosshair&&i.series.yAxis.drawCrosshair(null,i))})):v&&(v.setState(v.state,!0),o.axes.forEach((function(i){i.crosshair&&v.series[i.coll]===i&&i.drawCrosshair(null,v)})))):(v&&v.onMouseOut(),y&&y.forEach((function(i){i.setState()})),h&&h.onMouseOut(),_&&_.hide(s),this.unDocMouseMove&&(this.unDocMouseMove=this.unDocMouseMove()),o.axes.forEach((function(i){i.hideCrosshair()})),this.hoverX=o.hoverPoints=o.hoverPoint=null)},e.prototype.runPointActions=function(i,o){var h=this.chart,v=h.tooltip&&h.tooltip.options.enabled?h.tooltip:void 0,y=!!v&&v.shared,S=o||h.hoverPoint,x=S&&S.series||h.hoverSeries;S=(x=this.getHoverData(S,x,h.series,(!i||"touchmove"!==i.type)&&(!!o||x&&x.directTouch&&this.isDirectTouch),y,i)).hoverPoint;var R=x.hoverPoints;if(o=(x=x.hoverSeries)&&x.tooltipOptions.followPointer,y=y&&x&&!x.noSharedTooltip,S&&(S!==h.hoverPoint||v&&v.isHidden)){if((h.hoverPoints||[]).forEach((function(i){-1===R.indexOf(i)&&i.setState()})),h.hoverSeries!==x&&x.onMouseOver(),this.applyInactiveState(R),(R||[]).forEach((function(i){i.setState("hover")})),h.hoverPoint&&h.hoverPoint.firePointEvent("mouseOut"),!S.series)return;h.hoverPoints=R,h.hoverPoint=S,S.firePointEvent("mouseOver"),v&&v.refresh(y?R:S,i)}else o&&v&&!v.isHidden&&(S=v.getAnchor([{}],i),v.updatePosition({plotX:S[0],plotY:S[1]}));this.unDocMouseMove||(this.unDocMouseMove=T(h.container.ownerDocument,"mousemove",(function(i){var o=_[s.hoverChartIndex];o&&o.pointer.onDocumentMouseMove(i)}))),h.axes.forEach((function(s){var o,v=Y((s.crosshair||{}).snap,!0);v&&((o=h.hoverPoint)&&o.series[s.coll]===s||(o=N(R,(function(i){return i.series[s.coll]===s})))),o||!v?s.drawCrosshair(i,o):s.hideCrosshair()}))},e.prototype.scaleGroups=function(i,s){var o,h=this.chart;h.series.forEach((function(v){o=i||v.getPlotBox(),v.xAxis&&v.xAxis.zoomEnabled&&v.group&&(v.group.attr(o),v.markerGroup&&(v.markerGroup.attr(o),v.markerGroup.clip(s?h.clipRect:null)),v.dataLabelsGroup&&v.dataLabelsGroup.attr(o))})),h.clipRect.attr(s||h.clipBox)},e.prototype.setDOMEvents=function(){var i=this,o=this.chart.container,h=o.ownerDocument;o.onmousedown=this.onContainerMouseDown.bind(this),o.onmousemove=this.onContainerMouseMove.bind(this),o.onclick=this.onContainerClick.bind(this),this.unbindContainerMouseEnter=T(o,"mouseenter",this.onContainerMouseEnter.bind(this)),this.unbindContainerMouseLeave=T(o,"mouseleave",this.onContainerMouseLeave.bind(this)),s.unbindDocumentMouseUp||(s.unbindDocumentMouseUp=T(h,"mouseup",this.onDocumentMouseUp.bind(this)));for(var v=this.chart.renderTo.parentElement;v&&"BODY"!==v.tagName;)T(v,"scroll",(function(){delete i.chartPosition})),v=v.parentElement;s.hasTouch&&(T(o,"touchstart",this.onContainerTouchStart.bind(this),{passive:!1}),T(o,"touchmove",this.onContainerTouchMove.bind(this),{passive:!1}),s.unbindDocumentTouchEnd||(s.unbindDocumentTouchEnd=T(h,"touchend",this.onDocumentTouchEnd.bind(this),{passive:!1})))},e.prototype.setHoverChartIndex=function(){var i=this.chart,o=s.charts[Y(s.hoverChartIndex,-1)];o&&o!==i&&o.pointer.onContainerMouseLeave({relatedTarget:!0}),o&&o.mouseIsDown||(s.hoverChartIndex=i.index)},e.prototype.touch=function(i,s){var o=this.chart;if(this.setHoverChartIndex(),1===i.touches.length)if(i=this.normalize(i),o.isInsidePlot(i.chartX-o.plotLeft,i.chartY-o.plotTop)&&!o.openMenu){if(s&&this.runPointActions(i),"touchmove"===i.type)var h=!!(s=this.pinchDown)[0]&&4<=Math.sqrt(Math.pow(s[0].chartX-i.chartX,2)+Math.pow(s[0].chartY-i.chartY,2));Y(h,!0)&&this.pinch(i)}else s&&this.reset();else 2===i.touches.length&&this.pinch(i)},e.prototype.touchSelect=function(i){return!(!this.chart.options.chart.zoomBySingleTouch||!i.touches||1!==i.touches.length)},e.prototype.zoomOption=function(i){var s=this.chart,o=s.options.chart,h=o.zoomType||"";s=s.inverted,/touch/.test(i.type)&&(h=Y(o.pinchType,h)),this.zoomX=i=/x/.test(h),this.zoomY=h=/y/.test(h),this.zoomHor=i&&!s||h&&s,this.zoomVert=h&&!s||i&&s,this.hasZoom=i||h},e}(),s.Pointer=i})),O(s,"Core/MSPointer.js",[s["Core/Globals.js"],s["Core/Pointer.js"],s["Core/Utilities.js"]],(function(i,s,o){function w(){var i=[];return i.item=function(i){return this[i]},x(P,(function(s){i.push({pageX:s.pageX,pageY:s.pageY,target:s.target})})),i}function D(s,o,h,y){"touch"!==s.pointerType&&s.pointerType!==s.MSPOINTER_TYPE_TOUCH||!v[i.hoverChartIndex]||(y(s),(y=v[i.hoverChartIndex].pointer)[o]({type:h,target:s.currentTarget,preventDefault:_,touches:w()}))}var h=this&&this.__extends||function(){var b=function(i,s){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var o in s)s.hasOwnProperty(o)&&(i[o]=s[o])})(i,s)};return function(i,s){function e(){this.constructor=i}b(i,s),i.prototype=null===s?Object.create(s):(e.prototype=s.prototype,new e)}}(),v=i.charts,y=i.doc,_=i.noop,S=o.addEvent,T=o.css,x=o.objectEach,R=o.removeEvent,P={},L=!!i.win.PointerEvent;return function(i){function e(){return null!==i&&i.apply(this,arguments)||this}return h(e,i),e.prototype.batchMSEvents=function(i){i(this.chart.container,L?"pointerdown":"MSPointerDown",this.onContainerPointerDown),i(this.chart.container,L?"pointermove":"MSPointerMove",this.onContainerPointerMove),i(y,L?"pointerup":"MSPointerUp",this.onDocumentPointerUp)},e.prototype.destroy=function(){this.batchMSEvents(R),i.prototype.destroy.call(this)},e.prototype.init=function(s,o){i.prototype.init.call(this,s,o),this.hasZoom&&T(s.container,{"-ms-touch-action":"none","touch-action":"none"})},e.prototype.onContainerPointerDown=function(i){D(i,"onContainerTouchStart","touchstart",(function(i){P[i.pointerId]={pageX:i.pageX,pageY:i.pageY,target:i.currentTarget}}))},e.prototype.onContainerPointerMove=function(i){D(i,"onContainerTouchMove","touchmove",(function(i){P[i.pointerId]={pageX:i.pageX,pageY:i.pageY},P[i.pointerId].target||(P[i.pointerId].target=i.currentTarget)}))},e.prototype.onDocumentPointerUp=function(i){D(i,"onDocumentTouchEnd","touchend",(function(i){delete P[i.pointerId]}))},e.prototype.setDOMEvents=function(){i.prototype.setDOMEvents.call(this),(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(S)},e}(s)})),O(s,"Core/Series/Point.js",[s["Core/Renderer/HTML/AST.js"],s["Core/Animation/AnimationUtilities.js"],s["Core/Globals.js"],s["Core/Options.js"],s["Core/Utilities.js"]],(function(i,s,o,h,v){var y=s.animObject,_=h.defaultOptions,S=v.addEvent,T=v.defined,x=v.erase,R=v.extend,P=v.fireEvent,L=v.format,N=v.getNestedProperty,V=v.isArray,j=v.isFunction,W=v.isNumber,K=v.isObject,U=v.merge,Y=v.objectEach,$=v.pick,X=v.syncTimeout,Z=v.removeEvent,ee=v.uniqueKey;return s=function(){function a(){this.colorIndex=this.category=void 0,this.formatPrefix="point",this.id=void 0,this.isNull=!1,this.percentage=this.options=this.name=void 0,this.selected=!1,this.total=this.series=void 0,this.visible=!0,this.x=void 0}return a.prototype.animateBeforeDestroy=function(){var i,s=this,o={x:s.startXPos,opacity:0},h=s.getGraphicalProps();h.singular.forEach((function(h){i="dataLabel"===h,s[h]=s[h].animate(i?{x:s[h].startXPos,y:s[h].startYPos,opacity:0}:o)})),h.plural.forEach((function(i){s[i].forEach((function(i){i.element&&i.animate(R({x:s.startXPos},i.startYPos?{x:i.startXPos,y:i.startYPos}:{}))}))}))},a.prototype.applyOptions=function(i,s){var o=this.series,h=o.options.pointValKey||o.pointValKey;return i=a.prototype.optionsToObject.call(this,i),R(this,i),this.options=this.options?R(this.options,i):i,i.group&&delete this.group,i.dataLabels&&delete this.dataLabels,h&&(this.y=a.prototype.getNestedProperty.call(this,h)),this.formatPrefix=(this.isNull=$(this.isValid&&!this.isValid(),null===this.x||!W(this.y)))?"null":"point",this.selected&&(this.state="select"),"name"in this&&void 0===s&&o.xAxis&&o.xAxis.hasNames&&(this.x=o.xAxis.nameToX(this)),void 0===this.x&&o&&(this.x=void 0===s?o.autoIncrement(this):s),this},a.prototype.destroy=function(){function a(){for(h in(i.graphic||i.dataLabel||i.dataLabels)&&(Z(i),i.destroyElements()),i)i[h]=null}var i=this,s=i.series,o=s.chart;s=s.options.dataSorting;var h,v=o.hoverPoints,_=y(i.series.chart.renderer.globalAnimation);i.legendItem&&o.legend.destroyItem(i),v&&(i.setState(),x(v,i),v.length||(o.hoverPoints=null)),i===o.hoverPoint&&i.onMouseOut(),s&&s.enabled?(this.animateBeforeDestroy(),X(a,_.duration)):a(),o.pointCount--},a.prototype.destroyElements=function(i){var s=this;(i=s.getGraphicalProps(i)).singular.forEach((function(i){s[i]=s[i].destroy()})),i.plural.forEach((function(i){s[i].forEach((function(i){i.element&&i.destroy()})),delete s[i]}))},a.prototype.firePointEvent=function(i,s,o){var h=this,v=this.series.options;(v.point.events[i]||h.options&&h.options.events&&h.options.events[i])&&h.importEvents(),"click"===i&&v.allowPointSelect&&(o=function(i){h.select&&h.select(null,i.ctrlKey||i.metaKey||i.shiftKey)}),P(h,i,s,o)},a.prototype.getClassName=function(){return"highcharts-point"+(this.selected?" highcharts-point-select":"")+(this.negative?" highcharts-negative":"")+(this.isNull?" highcharts-null-point":"")+(void 0!==this.colorIndex?" highcharts-color-"+this.colorIndex:"")+(this.options.className?" "+this.options.className:"")+(this.zone&&this.zone.className?" "+this.zone.className.replace("highcharts-negative",""):"")},a.prototype.getGraphicalProps=function(i){var s,o=this,h=[],v={singular:[],plural:[]};for((i=i||{graphic:1,dataLabel:1}).graphic&&h.push("graphic","upperGraphic","shadowGroup"),i.dataLabel&&h.push("dataLabel","dataLabelUpper","connector"),s=h.length;s--;){var y=h[s];o[y]&&v.singular.push(y)}return["dataLabel","connector"].forEach((function(s){var h=s+"s";i[s]&&o[h]&&v.plural.push(h)})),v},a.prototype.getLabelConfig=function(){return{x:this.category,y:this.y,color:this.color,colorIndex:this.colorIndex,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},a.prototype.getNestedProperty=function(i){if(i)return 0===i.indexOf("custom.")?N(i,this.options):this[i]},a.prototype.getZone=function(){var i=this.series,s=i.zones;i=i.zoneAxis||"y";var o,h=0;for(o=s[h];this[i]>=o.value;)o=s[++h];return this.nonZonedColor||(this.nonZonedColor=this.color),this.color=o&&o.color&&!this.options.color?o.color:this.nonZonedColor,o},a.prototype.hasNewShapeType=function(){return(this.graphic&&(this.graphic.symbolName||this.graphic.element.nodeName))!==this.shapeType},a.prototype.init=function(i,s,o){return this.series=i,this.applyOptions(s,o),this.id=T(this.id)?this.id:ee(),this.resolveColor(),i.chart.pointCount++,P(this,"afterInit"),this},a.prototype.optionsToObject=function(i){var s={},o=this.series,h=o.options.keys,v=h||o.pointArrayMap||["y"],y=v.length,_=0,S=0;if(W(i)||null===i)s[v[0]]=i;else if(V(i))for(!h&&i.length>y&&("string"===(o=typeof i[0])?s.name=i[0]:"number"===o&&(s.x=i[0]),_++);S<y;)h&&void 0===i[_]||(0<v[S].indexOf(".")?a.prototype.setNestedProperty(s,i[_],v[S]):s[v[S]]=i[_]),_++,S++;else"object"==typeof i&&(s=i,i.dataLabels&&(o._hasPointLabels=!0),i.marker&&(o._hasPointMarkers=!0));return s},a.prototype.resolveColor=function(){var i=this.series,s=i.chart.options.chart.colorCount,o=i.chart.styledMode;delete this.nonZonedColor,o||this.options.color||(this.color=i.color),i.options.colorByPoint?(o||(s=i.options.colors||i.chart.options.colors,this.color=this.color||s[i.colorCounter],s=s.length),o=i.colorCounter,i.colorCounter++,i.colorCounter===s&&(i.colorCounter=0)):o=i.colorIndex,this.colorIndex=$(this.options.colorIndex,o)},a.prototype.setNestedProperty=function(i,s,o){return o.split(".").reduce((function(i,o,h,v){return i[o]=v.length-1===h?s:K(i[o],!0)?i[o]:{},i[o]}),i),i},a.prototype.tooltipFormatter=function(i){var s=this.series,o=s.tooltipOptions,h=$(o.valueDecimals,""),v=o.valuePrefix||"",y=o.valueSuffix||"";return s.chart.styledMode&&(i=s.chart.tooltip.styledModeFormat(i)),(s.pointArrayMap||["y"]).forEach((function(s){s="{point."+s,(v||y)&&(i=i.replace(RegExp(s+"}","g"),v+s+"}"+y)),i=i.replace(RegExp(s+"}","g"),s+":,."+h+"f}")})),L(i,{point:this,series:this.series},s.chart)},a.prototype.update=function(i,s,o,h){function c(){y.applyOptions(i);var h=S&&y.hasDummyGraphic;h=null===y.y?!h:h,S&&h&&(y.graphic=S.destroy(),delete y.hasDummyGraphic),K(i,!0)&&(S&&S.element&&i&&i.marker&&void 0!==i.marker.symbol&&(y.graphic=S.destroy()),i&&i.dataLabels&&y.dataLabel&&(y.dataLabel=y.dataLabel.destroy()),y.connector&&(y.connector=y.connector.destroy())),v=y.index,_.updateParallelArrays(y,v),x.data[v]=K(x.data[v],!0)||K(i,!0)?y.options:$(i,x.data[v]),_.isDirty=_.isDirtyData=!0,!_.fixedBox&&_.hasCartesianSeries&&(T.isDirtyBox=!0),"point"===x.legendType&&(T.isDirtyLegend=!0),s&&T.redraw(o)}var v,y=this,_=y.series,S=y.graphic,T=_.chart,x=_.options;s=$(s,!0),!1===h?c():y.firePointEvent("update",{options:i},c)},a.prototype.remove=function(i,s){this.series.removePoint(this.series.data.indexOf(this),i,s)},a.prototype.select=function(i,s){var o=this,h=o.series,v=h.chart;this.selectedStaging=i=$(i,!o.selected),o.firePointEvent(i?"select":"unselect",{accumulate:s},(function(){o.selected=o.options.selected=i,h.options.data[h.data.indexOf(o)]=o.options,o.setState(i&&"select"),s||v.getSelectedPoints().forEach((function(i){var s=i.series;i.selected&&i!==o&&(i.selected=i.options.selected=!1,s.options.data[s.data.indexOf(i)]=i.options,i.setState(v.hoverPoints&&s.options.inactiveOtherPoints?"inactive":""),i.firePointEvent("unselect"))}))})),delete this.selectedStaging},a.prototype.onMouseOver=function(i){var s=this.series.chart,o=s.pointer;i=i?o.normalize(i):o.getChartCoordinatesFromPoint(this,s.inverted),o.runPointActions(i,this)},a.prototype.onMouseOut=function(){var i=this.series.chart;this.firePointEvent("mouseOut"),this.series.options.inactiveOtherPoints||(i.hoverPoints||[]).forEach((function(i){i.setState()})),i.hoverPoints=i.hoverPoint=null},a.prototype.importEvents=function(){if(!this.hasImportedEvents){var i=this,s=U(i.series.options.point,i.options).events;i.events=s,Y(s,(function(s,o){j(s)&&S(i,o,s)})),this.hasImportedEvents=!0}},a.prototype.setState=function(s,o){var h,v=this.series,y=this.state,S=v.options.states[s||"normal"]||{},T=_.plotOptions[v.type].marker&&v.options.marker,x=T&&!1===T.enabled,L=T&&T.states&&T.states[s||"normal"]||{},N=!1===L.enabled,V=v.stateMarkerGraphic,j=this.marker||{},W=v.chart,K=v.halo,U=T&&v.markerAttribs;if(!((s=s||"")===this.state&&!o||this.selected&&"select"!==s||!1===S.enabled||s&&(N||x&&!1===L.enabled)||s&&j.states&&j.states[s]&&!1===j.states[s].enabled)){if(this.state=s,U&&(h=v.markerAttribs(this,s)),this.graphic){if(y&&this.graphic.removeClass("highcharts-point-"+y),s&&this.graphic.addClass("highcharts-point-"+s),!W.styledMode){var Y=v.pointAttribs(this,s),X=$(W.options.chart.animation,S.animation);v.options.inactiveOtherPoints&&Y.opacity&&((this.dataLabels||[]).forEach((function(i){i&&i.animate({opacity:Y.opacity},X)})),this.connector&&this.connector.animate({opacity:Y.opacity},X)),this.graphic.animate(Y,X)}h&&this.graphic.animate(h,$(W.options.chart.animation,L.animation,T.animation)),V&&V.hide()}else s&&L&&(y=j.symbol||v.symbol,V&&V.currentSymbol!==y&&(V=V.destroy()),h&&(V?V[o?"animate":"attr"]({x:h.x,y:h.y}):y&&(v.stateMarkerGraphic=V=W.renderer.symbol(y,h.x,h.y,h.width,h.height).add(v.markerGroup),V.currentSymbol=y)),!W.styledMode&&V&&V.attr(v.pointAttribs(this,s))),V&&(V[s&&this.isInside?"show":"hide"](),V.element.point=this);s=S.halo,S=(V=this.graphic||V)&&V.visibility||"inherit",s&&s.size&&V&&"hidden"!==S&&!this.isCluster?(K||(v.halo=K=W.renderer.path().add(V.parentGroup)),K.show()[o?"animate":"attr"]({d:this.haloPath(s.size)}),K.attr({class:"highcharts-halo highcharts-color-"+$(this.colorIndex,v.colorIndex)+(this.className?" "+this.className:""),visibility:S,zIndex:-1}),K.point=this,W.styledMode||K.attr(R({fill:this.color||v.color,"fill-opacity":s.opacity},i.filterUserAttributes(s.attributes||{})))):K&&K.point&&K.point.haloPath&&K.animate({d:K.point.haloPath(0)},null,K.hide),P(this,"afterSetState")}},a.prototype.haloPath=function(i){return this.series.chart.renderer.symbols.circle(Math.floor(this.plotX)-i,this.plotY-i,2*i,2*i)},a}(),o.Point=s})),O(s,"Core/Legend.js",[s["Core/Animation/AnimationUtilities.js"],s["Core/Globals.js"],s["Core/Series/Point.js"],s["Core/Utilities.js"]],(function(i,s,o,h){var v=i.animObject,y=i.setAnimation;i=s.isFirefox;var _=s.marginNames,S=s.win,T=h.addEvent,x=h.createElement,R=h.css,P=h.defined,L=h.discardElement,N=h.find,V=h.fireEvent,j=h.format,W=h.isNumber,K=h.merge,U=h.pick,Y=h.relativeLength,$=h.stableSort,X=h.syncTimeout;h=h.wrap;var Z=function(){function d(i,s){this.allItems=[],this.contentGroup=this.box=void 0,this.display=!1,this.group=void 0,this.offsetWidth=this.maxLegendWidth=this.maxItemWidth=this.legendWidth=this.legendHeight=this.lastLineHeight=this.lastItemY=this.itemY=this.itemX=this.itemMarginTop=this.itemMarginBottom=this.itemHeight=this.initialItemY=0,this.options={},this.padding=0,this.pages=[],this.proximate=!1,this.scrollGroup=void 0,this.widthOption=this.totalItemWidth=this.titleHeight=this.symbolWidth=this.symbolHeight=0,this.chart=i,this.init(i,s)}return d.prototype.init=function(i,s){this.chart=i,this.setOptions(s),s.enabled&&(this.render(),T(this.chart,"endResize",(function(){this.legend.positionCheckboxes()})),this.proximate?this.unchartrender=T(this.chart,"render",(function(){this.legend.proximatePositions(),this.legend.positionItems()})):this.unchartrender&&this.unchartrender())},d.prototype.setOptions=function(i){var s=U(i.padding,8);this.options=i,this.chart.styledMode||(this.itemStyle=i.itemStyle,this.itemHiddenStyle=K(this.itemStyle,i.itemHiddenStyle)),this.itemMarginTop=i.itemMarginTop||0,this.itemMarginBottom=i.itemMarginBottom||0,this.padding=s,this.initialItemY=s-5,this.symbolWidth=U(i.symbolWidth,16),this.pages=[],this.proximate="proximate"===i.layout&&!this.chart.inverted,this.baseline=void 0},d.prototype.update=function(i,s){var o=this.chart;this.setOptions(K(!0,this.options,i)),this.destroy(),o.isDirtyLegend=o.isDirtyBox=!0,U(s,!0)&&o.redraw(),V(this,"afterUpdate")},d.prototype.colorizeItem=function(i,s){if(i.legendGroup[s?"removeClass":"addClass"]("highcharts-legend-item-hidden"),!this.chart.styledMode){var o=this.options,h=i.legendItem,v=i.legendLine,y=i.legendSymbol,_=this.itemHiddenStyle.color;o=s?o.itemStyle.color:_;var S=s&&i.color||_,T=i.options&&i.options.marker,x={fill:S};h&&h.css({fill:o,color:o}),v&&v.attr({stroke:S}),y&&(T&&y.isMarker&&(x=i.pointAttribs(),s||(x.stroke=x.fill=_)),y.attr(x))}V(this,"afterColorizeItem",{item:i,visible:s})},d.prototype.positionItems=function(){this.allItems.forEach(this.positionItem,this),this.chart.isResizing||this.positionCheckboxes()},d.prototype.positionItem=function(i){var s=this,o=this.options,h=o.symbolPadding,v=!o.rtl,y=i._legendItemPos;o=y[0],y=y[1];var _=i.checkbox,S=i.legendGroup;S&&S.element&&(h={translateX:v?o:this.legendWidth-o-2*h-4,translateY:y},v=function(){V(s,"afterPositionItem",{item:i})},P(S.translateY)?S.animate(h,void 0,v):(S.attr(h),v())),_&&(_.x=o,_.y=y)},d.prototype.destroyItem=function(i){var s=i.checkbox;["legendItem","legendLine","legendSymbol","legendGroup"].forEach((function(s){i[s]&&(i[s]=i[s].destroy())})),s&&L(i.checkbox)},d.prototype.destroy=function(){function a(i){this[i]&&(this[i]=this[i].destroy())}this.getAllItems().forEach((function(i){["legendItem","legendGroup"].forEach(a,i)})),"clipRect up down pager nav box title group".split(" ").forEach(a,this),this.display=null},d.prototype.positionCheckboxes=function(){var i=this.group&&this.group.alignAttr,s=this.clipHeight||this.legendHeight,o=this.titleHeight;if(i){var h=i.translateY;this.allItems.forEach((function(v){var y=v.checkbox;if(y){var _=h+o+y.y+(this.scrollOffset||0)+3;R(y,{left:i.translateX+v.checkboxOffset+y.x-20+"px",top:_+"px",display:this.proximate||_>h-6&&_<h+s-6?"":"none"})}}),this)}},d.prototype.renderTitle=function(){var i=this.options,s=this.padding,o=i.title,h=0;o.text&&(this.title||(this.title=this.chart.renderer.label(o.text,s-3,s-4,null,null,null,i.useHTML,null,"legend-title").attr({zIndex:1}),this.chart.styledMode||this.title.css(o.style),this.title.add(this.group)),o.width||this.title.css({width:this.maxLegendWidth+"px"}),h=(i=this.title.getBBox()).height,this.offsetWidth=i.width,this.contentGroup.attr({translateY:h})),this.titleHeight=h},d.prototype.setText=function(i){var s=this.options;i.legendItem.attr({text:s.labelFormat?j(s.labelFormat,i,this.chart):s.labelFormatter.call(i)})},d.prototype.renderItem=function(i){var s=this.chart,o=s.renderer,h=this.options,v=this.symbolWidth,y=h.symbolPadding,_=this.itemStyle,S=this.itemHiddenStyle,T="horizontal"===h.layout?U(h.itemDistance,20):0,x=!h.rtl,R=i.legendItem,P=!i.series,L=!P&&i.series.drawLegendSymbol?i.series:i,N=L.options;T=v+y+T+((N=this.createCheckboxForItem&&N&&N.showCheckbox)?20:0);var V=h.useHTML,j=i.options.className;R||(i.legendGroup=o.g("legend-item").addClass("highcharts-"+L.type+"-series highcharts-color-"+i.colorIndex+(j?" "+j:"")+(P?" highcharts-series-"+i.index:"")).attr({zIndex:1}).add(this.scrollGroup),i.legendItem=R=o.text("",x?v+y:-y,this.baseline||0,V),s.styledMode||R.css(K(i.visible?_:S)),R.attr({align:x?"left":"right",zIndex:2}).add(i.legendGroup),this.baseline||(this.fontMetrics=o.fontMetrics(s.styledMode?12:_.fontSize,R),this.baseline=this.fontMetrics.f+3+this.itemMarginTop,R.attr("y",this.baseline)),this.symbolHeight=h.symbolHeight||this.fontMetrics.f,L.drawLegendSymbol(this,i),this.setItemEvents&&this.setItemEvents(i,R,V)),N&&!i.checkbox&&this.createCheckboxForItem&&this.createCheckboxForItem(i),this.colorizeItem(i,i.visible),!s.styledMode&&_.width||R.css({width:(h.itemWidth||this.widthOption||s.spacingBox.width)-T+"px"}),this.setText(i),s=R.getBBox(),i.itemWidth=i.checkboxOffset=h.itemWidth||i.legendItemWidth||s.width+T,this.maxItemWidth=Math.max(this.maxItemWidth,i.itemWidth),this.totalItemWidth+=i.itemWidth,this.itemHeight=i.itemHeight=Math.round(i.legendItemHeight||s.height||this.symbolHeight)},d.prototype.layoutItem=function(i){var s=this.options,o=this.padding,h="horizontal"===s.layout,v=i.itemHeight,y=this.itemMarginBottom,_=this.itemMarginTop,S=h?U(s.itemDistance,20):0,T=this.maxLegendWidth;s=s.alignColumns&&this.totalItemWidth>T?this.maxItemWidth:i.itemWidth,h&&this.itemX-o+s>T&&(this.itemX=o,this.lastLineHeight&&(this.itemY+=_+this.lastLineHeight+y),this.lastLineHeight=0),this.lastItemY=_+this.itemY+y,this.lastLineHeight=Math.max(v,this.lastLineHeight),i._legendItemPos=[this.itemX,this.itemY],h?this.itemX+=s:(this.itemY+=_+v+y,this.lastLineHeight=v),this.offsetWidth=this.widthOption||Math.max((h?this.itemX-o-(i.checkbox?0:S):s)+o,this.offsetWidth)},d.prototype.getAllItems=function(){var i=[];return this.chart.series.forEach((function(s){var o=s&&s.options;s&&U(o.showInLegend,!P(o.linkedTo)&&void 0,!0)&&(i=i.concat(s.legendItems||("point"===o.legendType?s.data:s)))})),V(this,"afterGetAllItems",{allItems:i}),i},d.prototype.getAlignment=function(){var i=this.options;return this.proximate?i.align.charAt(0)+"tv":i.floating?"":i.align.charAt(0)+i.verticalAlign.charAt(0)+i.layout.charAt(0)},d.prototype.adjustMargins=function(i,s){var o=this.chart,h=this.options,v=this.getAlignment();v&&[/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/].forEach((function(y,S){y.test(v)&&!P(i[S])&&(o[_[S]]=Math.max(o[_[S]],o.legend[(S+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][S]*h[S%2?"x":"y"]+U(h.margin,12)+s[S]+(o.titleOffset[S]||0)))}))},d.prototype.proximatePositions=function(){var i=this.chart,o=[],h="left"===this.options.align;this.allItems.forEach((function(s){var v,y=h;if(s.yAxis){s.xAxis.options.reversed&&(y=!y),s.points&&(v=N(y?s.points:s.points.slice(0).reverse(),(function(i){return W(i.plotY)}))),y=this.itemMarginTop+s.legendItem.getBBox().height+this.itemMarginBottom;var _=s.yAxis.top-i.plotTop;s.visible?(v=v?v.plotY:s.yAxis.height,v+=_-.3*y):v=_+s.yAxis.height,o.push({target:v,size:y,item:s})}}),this),s.distribute(o,i.plotHeight),o.forEach((function(s){s.item._legendItemPos[1]=i.plotTop-i.spacing[0]+s.pos}))},d.prototype.render=function(){var i=this.chart,s=i.renderer,o=this.group,h=this.box,v=this.options,y=this.padding;this.itemX=y,this.itemY=this.initialItemY,this.lastItemY=this.offsetWidth=0,this.widthOption=Y(v.width,i.spacingBox.width-y);var _=i.spacingBox.width-2*y-v.x;-1<["rm","lm"].indexOf(this.getAlignment().substring(0,2))&&(_/=2),this.maxLegendWidth=this.widthOption||_,o||(this.group=o=s.g("legend").attr({zIndex:7}).add(),this.contentGroup=s.g().attr({zIndex:1}).add(o),this.scrollGroup=s.g().add(this.contentGroup)),this.renderTitle();var S=this.getAllItems();$(S,(function(i,s){return(i.options&&i.options.legendIndex||0)-(s.options&&s.options.legendIndex||0)})),v.reversed&&S.reverse(),this.allItems=S,this.display=_=!!S.length,this.itemHeight=this.totalItemWidth=this.maxItemWidth=this.lastLineHeight=0,S.forEach(this.renderItem,this),S.forEach(this.layoutItem,this),S=(this.widthOption||this.offsetWidth)+y;var T=this.lastItemY+this.lastLineHeight+this.titleHeight;T=this.handleOverflow(T),T+=y,h||(this.box=h=s.rect().addClass("highcharts-legend-box").attr({r:v.borderRadius}).add(o),h.isNew=!0),i.styledMode||h.attr({stroke:v.borderColor,"stroke-width":v.borderWidth||0,fill:v.backgroundColor||"none"}).shadow(v.shadow),0<S&&0<T&&(h[h.isNew?"attr":"animate"](h.crisp.call({},{x:0,y:0,width:S,height:T},h.strokeWidth())),h.isNew=!1),h[_?"show":"hide"](),i.styledMode&&"none"===o.getStyle("display")&&(S=T=0),this.legendWidth=S,this.legendHeight=T,_&&this.align(),this.proximate||this.positionItems(),V(this,"afterRender")},d.prototype.align=function(i){void 0===i&&(i=this.chart.spacingBox);var s=this.chart,o=this.options,h=i.y;/(lth|ct|rth)/.test(this.getAlignment())&&0<s.titleOffset[0]?h+=s.titleOffset[0]:/(lbh|cb|rbh)/.test(this.getAlignment())&&0<s.titleOffset[2]&&(h-=s.titleOffset[2]),h!==i.y&&(i=K(i,{y:h})),this.group.align(K(o,{width:this.legendWidth,height:this.legendHeight,verticalAlign:this.proximate?"top":o.verticalAlign}),!0,i)},d.prototype.handleOverflow=function(i){var s=this,o=this.chart,h=o.renderer,v=this.options,y=v.y,_=this.padding;y=o.spacingBox.height+("top"===v.verticalAlign?-y:y)-_;var S,T,x=v.maxHeight,R=this.clipRect,P=v.navigation,L=U(P.animation,!0),N=P.arrowSize||12,V=this.nav,j=this.pages,W=this.allItems,C=function(i){"number"==typeof i?R.attr({height:i}):R&&(s.clipRect=R.destroy(),s.contentGroup.clip()),s.contentGroup.div&&(s.contentGroup.div.style.clip=i?"rect("+_+"px,9999px,"+(_+i)+"px,0)":"auto")},J=function(i){return s[i]=h.circle(0,0,1.3*N).translate(N/2,N/2).add(V),o.styledMode||s[i].attr("fill","rgba(0,0,0,0.0001)"),s[i]};return"horizontal"!==v.layout||"middle"===v.verticalAlign||v.floating||(y/=2),x&&(y=Math.min(y,x)),j.length=0,i>y&&!1!==P.enabled?(this.clipHeight=S=Math.max(y-20-this.titleHeight-_,0),this.currentPage=U(this.currentPage,1),this.fullHeight=i,W.forEach((function(i,s){var o=i._legendItemPos[1],h=Math.round(i.legendItem.getBBox().height),v=j.length;(!v||o-j[v-1]>S&&(T||o)!==j[v-1])&&(j.push(T||o),v++),i.pageIx=v-1,T&&(W[s-1].pageIx=v-1),s===W.length-1&&o+h-j[v-1]>S&&o!==T&&(j.push(o),i.pageIx=v),o!==T&&(T=o)})),R||(R=s.clipRect=h.clipRect(0,_,9999,0),s.contentGroup.clip(R)),C(S),V||(this.nav=V=h.g().attr({zIndex:1}).add(this.group),this.up=h.symbol("triangle",0,0,N,N).add(V),J("upTracker").on("click",(function(){s.scroll(-1,L)})),this.pager=h.text("",15,10).addClass("highcharts-legend-navigation"),o.styledMode||this.pager.css(P.style),this.pager.add(V),this.down=h.symbol("triangle-down",0,0,N,N).add(V),J("downTracker").on("click",(function(){s.scroll(1,L)}))),s.scroll(0),i=y):V&&(C(),this.nav=V.destroy(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0),i},d.prototype.scroll=function(i,s){var o=this,h=this.chart,_=this.pages,S=_.length,T=this.currentPage+i;i=this.clipHeight;var x=this.options.navigation,R=this.pager,P=this.padding;T>S&&(T=S),0<T&&(void 0!==s&&y(s,h),this.nav.attr({translateX:P,translateY:i+this.padding+7+this.titleHeight,visibility:"visible"}),[this.up,this.upTracker].forEach((function(i){i.attr({class:1===T?"highcharts-legend-nav-inactive":"highcharts-legend-nav-active"})})),R.attr({text:T+"/"+S}),[this.down,this.downTracker].forEach((function(i){i.attr({x:18+this.pager.getBBox().width,class:T===S?"highcharts-legend-nav-inactive":"highcharts-legend-nav-active"})}),this),h.styledMode||(this.up.attr({fill:1===T?x.inactiveColor:x.activeColor}),this.upTracker.css({cursor:1===T?"default":"pointer"}),this.down.attr({fill:T===S?x.inactiveColor:x.activeColor}),this.downTracker.css({cursor:T===S?"default":"pointer"})),this.scrollOffset=-_[T-1]+this.initialItemY,this.scrollGroup.animate({translateY:this.scrollOffset}),this.currentPage=T,this.positionCheckboxes(),s=v(U(s,h.renderer.globalAnimation,!0)),X((function(){V(o,"afterScroll",{currentPage:T})}),s.duration))},d.prototype.setItemEvents=function(i,s,h){var v=this,y=v.chart.renderer.boxWrapper,_=i instanceof o,S="highcharts-legend-"+(_?"point":"series")+"-active",T=v.chart.styledMode;(h?[s,i.legendSymbol]:[i.legendGroup]).forEach((function(o){o&&o.on("mouseover",(function(){i.visible&&v.allItems.forEach((function(s){i!==s&&s.setState("inactive",!_)})),i.setState("hover"),i.visible&&y.addClass(S),T||s.css(v.options.itemHoverStyle)})).on("mouseout",(function(){v.chart.styledMode||s.css(K(i.visible?v.itemStyle:v.itemHiddenStyle)),v.allItems.forEach((function(s){i!==s&&s.setState("",!_)})),y.removeClass(S),i.setState()})).on("click",(function(s){var b=function(){i.setVisible&&i.setVisible(),v.allItems.forEach((function(s){i!==s&&s.setState(i.visible?"inactive":"",!_)}))};y.removeClass(S),s={browserEvent:s},i.firePointEvent?i.firePointEvent("legendItemClick",s,b):V(i,"legendItemClick",s,b)}))}))},d.prototype.createCheckboxForItem=function(i){i.checkbox=x("input",{type:"checkbox",className:"highcharts-legend-checkbox",checked:i.selected,defaultChecked:i.selected},this.options.itemCheckboxStyle,this.chart.container),T(i.checkbox,"click",(function(s){V(i.series||i,"checkboxClick",{checked:s.target.checked,item:i},(function(){i.select()}))}))},d}();return(/Trident\/7\.0/.test(S.navigator&&S.navigator.userAgent)||i)&&h(Z.prototype,"positionItem",(function(i,s){var o=this,d=function(){s._legendItemPos&&i.call(o,s)};d(),o.bubbleLegend||setTimeout(d)})),s.Legend=Z,s.Legend})),O(s,"Core/Series/SeriesRegistry.js",[s["Core/Globals.js"],s["Core/Options.js"],s["Core/Series/Point.js"],s["Core/Utilities.js"]],(function(i,s,o,h){var v,y=s.defaultOptions,_=h.error,S=h.extendClass,T=h.merge;return function(i){function e(s,h){var v=y.plotOptions||{},_=h.defaultOptions;h.prototype.pointClass||(h.prototype.pointClass=o),h.prototype.type=s,_&&(v[s]=_),i.seriesTypes[s]=h}i.seriesTypes={},i.getSeries=function(s,o){void 0===o&&(o={});var h=s.options.chart;h=o.type||h.type||h.defaultSeriesType||"";var v=i.seriesTypes[h];return i||_(17,!0,s,{missingModuleFor:h}),"function"==typeof(h=new v).init&&h.init(s,o),h},i.registerSeriesType=e,i.seriesType=function(s,h,v,_,x){var R=y.plotOptions||{};return h=h||"",R[s]=T(R[h],v),e(s,S(i.seriesTypes[h]||function(){},_)),i.seriesTypes[s].prototype.type=s,x&&(i.seriesTypes[s].prototype.pointClass=S(o,x)),i.seriesTypes[s]}}(v||(v={})),i.seriesType=v.seriesType,i.seriesTypes=v.seriesTypes,v})),O(s,"Core/Chart/Chart.js",[s["Core/Animation/AnimationUtilities.js"],s["Core/Axis/Axis.js"],s["Core/Globals.js"],s["Core/Legend.js"],s["Core/MSPointer.js"],s["Core/Options.js"],s["Core/Color/Palette.js"],s["Core/Pointer.js"],s["Core/Series/SeriesRegistry.js"],s["Core/Time.js"],s["Core/Utilities.js"],s["Core/Renderer/HTML/AST.js"]],(function(i,s,o,h,v,y,_,S,T,x,R,P){var L=i.animate,N=i.animObject,V=i.setAnimation,j=o.charts,W=o.doc,K=o.win,U=y.defaultOptions,Y=y.time,$=T.seriesTypes,X=R.addEvent,Z=R.attr,ee=R.cleanRecursively,te=R.createElement,ie=R.css,ae=R.defined,ne=R.discardElement,re=R.erase,se=R.error,le=R.extend,oe=R.find,de=R.fireEvent,ce=R.getStyle,he=R.isArray,ue=R.isFunction,pe=R.isNumber,fe=R.isObject,ge=R.isString,me=R.merge,ve=R.numberFormat,ye=R.objectEach,_e=R.pick,Se=R.pInt,be=R.relativeLength,Te=R.removeEvent,Ee=R.splat,ke=R.syncTimeout,Ce=R.uniqueKey,xe=o.marginNames,we=function(){function e(i,s,o){this.yAxis=this.xAxis=this.userOptions=this.titleOffset=this.time=this.symbolCounter=this.spacingBox=this.spacing=this.series=this.renderTo=this.renderer=this.pointer=this.pointCount=this.plotWidth=this.plotTop=this.plotLeft=this.plotHeight=this.plotBox=this.options=this.numberFormatter=this.margin=this.legend=this.labelCollectors=this.isResizing=this.index=this.container=this.colorCounter=this.clipBox=this.chartWidth=this.chartHeight=this.bounds=this.axisOffset=this.axes=void 0,this.getArgs(i,s,o)}return e.prototype.getArgs=function(i,s,o){ge(i)||i.nodeName?(this.renderTo=i,this.init(s,o)):this.init(i,s)},e.prototype.init=function(i,s){var h,v=i.series,y=i.plotOptions||{};de(this,"init",{args:arguments},(function(){i.series=null;var _=(h=me(U,i)).chart||{};ye(h.plotOptions,(function(i,s){fe(i)&&(i.tooltip=y[s]&&me(y[s].tooltip)||void 0)})),h.tooltip.userOptions=i.chart&&i.chart.forExport&&i.tooltip.userOptions||i.tooltip,h.series=i.series=v,this.userOptions=i;var S=_.events;this.margin=[],this.spacing=[],this.bounds={h:{},v:{}},this.labelCollectors=[],this.callback=s,this.isResizing=0,this.options=h,this.axes=[],this.series=[],this.time=i.time&&Object.keys(i.time).length?new x(i.time):o.time,this.numberFormatter=_.numberFormatter||ve,this.styledMode=_.styledMode,this.hasCartesianSeries=_.showAxes;var T=this;T.index=j.length,j.push(T),o.chartCount++,S&&ye(S,(function(i,s){ue(i)&&X(T,s,i)})),T.xAxis=[],T.yAxis=[],T.pointCount=T.colorCounter=T.symbolCounter=0,de(T,"afterInit"),T.firstRender()}))},e.prototype.initSeries=function(i){var s=this.options.chart;s=i.type||s.type||s.defaultSeriesType;var o=$[s];return o||se(17,!0,this,{missingModuleFor:s}),"function"==typeof(s=new o).init&&s.init(this,i),s},e.prototype.setSeriesData=function(){this.getSeriesOrderByLinks().forEach((function(i){i.points||i.data||!i.enabledDataSorting||i.setData(i.options.data,!1)}))},e.prototype.getSeriesOrderByLinks=function(){return this.series.concat().sort((function(i,s){return i.linkedSeries.length||s.linkedSeries.length?s.linkedSeries.length-i.linkedSeries.length:0}))},e.prototype.orderSeries=function(i){var s=this.series;for(i=i||0;i<s.length;i++)s[i]&&(s[i].index=i,s[i].name=s[i].getName())},e.prototype.isInsidePlot=function(i,s,o){var h=o?s:i;return h={x:h,y:i=o?i:s,isInsidePlot:0<=h&&h<=this.plotWidth&&0<=i&&i<=this.plotHeight},de(this,"afterIsInsidePlot",h),h.isInsidePlot},e.prototype.redraw=function(i){de(this,"beforeRedraw");var s=this.axes,o=this.series,h=this.pointer,v=this.legend,y=this.userOptions.legend,_=this.isDirtyLegend,S=this.hasCartesianSeries,T=this.isDirtyBox,x=this.renderer,R=x.isHidden(),P=[];for(this.setResponsive&&this.setResponsive(!1),V(!!this.hasRendered&&i,this),R&&this.temporaryDisplay(),this.layOutTitles(),i=o.length;i--;){var L=o[i];if(L.options.stacking||L.options.centerInCategory){var N=!0;if(L.isDirty){var j=!0;break}}}if(j)for(i=o.length;i--;)(L=o[i]).options.stacking&&(L.isDirty=!0);o.forEach((function(i){i.isDirty&&("point"===i.options.legendType?("function"==typeof i.updateTotals&&i.updateTotals(),_=!0):y&&(y.labelFormatter||y.labelFormat)&&(_=!0)),i.isDirtyData&&de(i,"updatedData")})),_&&v&&v.options.enabled&&(v.render(),this.isDirtyLegend=!1),N&&this.getStacks(),S&&s.forEach((function(i){i.updateNames(),i.setScale()})),this.getMargins(),S&&(s.forEach((function(i){i.isDirty&&(T=!0)})),s.forEach((function(i){var s=i.min+","+i.max;i.extKey!==s&&(i.extKey=s,P.push((function(){de(i,"afterSetExtremes",le(i.eventArgs,i.getExtremes())),delete i.eventArgs}))),(T||N)&&i.redraw()}))),T&&this.drawChartBox(),de(this,"predraw"),o.forEach((function(i){(T||i.isDirty)&&i.visible&&i.redraw(),i.isDirtyData=!1})),h&&h.reset(!0),x.draw(),de(this,"redraw"),de(this,"render"),R&&this.temporaryDisplay(!0),P.forEach((function(i){i.call()}))},e.prototype.get=function(i){function c(s){return s.id===i||s.options&&s.options.id===i}var s,o=this.series,h=oe(this.axes,c)||oe(this.series,c);for(s=0;!h&&s<o.length;s++)h=oe(o[s].points||[],c);return h},e.prototype.getAxes=function(){var i=this,o=this.options,h=o.xAxis=Ee(o.xAxis||{});o=o.yAxis=Ee(o.yAxis||{}),de(this,"getAxes"),h.forEach((function(i,s){i.index=s,i.isX=!0})),o.forEach((function(i,s){i.index=s})),h.concat(o).forEach((function(o){new s(i,o)})),de(this,"afterGetAxes")},e.prototype.getSelectedPoints=function(){var i=[];return this.series.forEach((function(s){i=i.concat(s.getPointsCollection().filter((function(i){return _e(i.selectedStaging,i.selected)})))})),i},e.prototype.getSelectedSeries=function(){return this.series.filter((function(i){return i.selected}))},e.prototype.setTitle=function(i,s,o){this.applyDescription("title",i),this.applyDescription("subtitle",s),this.applyDescription("caption",void 0),this.layOutTitles(o)},e.prototype.applyDescription=function(i,s){var o=this,h="title"===i?{color:_.neutralColor80,fontSize:this.options.isStock?"16px":"18px"}:{color:_.neutralColor60};h=this.options[i]=me(!this.styledMode&&{style:h},this.options[i],s);var v=this[i];v&&s&&(this[i]=v=v.destroy()),h&&!v&&((v=this.renderer.text(h.text,0,0,h.useHTML).attr({align:h.align,class:"highcharts-"+i,zIndex:h.zIndex||4}).add()).update=function(s){o[{title:"setTitle",subtitle:"setSubtitle",caption:"setCaption"}[i]](s)},this.styledMode||v.css(h.style),this[i]=v)},e.prototype.layOutTitles=function(i){var s=[0,0,0],o=this.renderer,h=this.spacingBox;["title","subtitle","caption"].forEach((function(i){var v=this[i],y=this.options[i],_=y.verticalAlign||"top";if(i="title"===i?-3:"top"===_?s[0]+2:0,v){if(!this.styledMode)var S=y.style.fontSize;S=o.fontMetrics(S,v).b,v.css({width:(y.width||h.width+(y.widthAdjust||0))+"px"});var T=Math.round(v.getBBox(y.useHTML).height);v.align(le({y:"bottom"===_?S:i+S,height:T},y),!1,"spacingBox"),y.floating||("top"===_?s[0]=Math.ceil(s[0]+T):"bottom"===_&&(s[2]=Math.ceil(s[2]+T)))}}),this),s[0]&&"top"===(this.options.title.verticalAlign||"top")&&(s[0]+=this.options.title.margin),s[2]&&"bottom"===this.options.caption.verticalAlign&&(s[2]+=this.options.caption.margin);var v=!this.titleOffset||this.titleOffset.join(",")!==s.join(",");this.titleOffset=s,de(this,"afterLayOutTitles"),!this.isDirtyBox&&v&&(this.isDirtyBox=this.isDirtyLegend=v,this.hasRendered&&_e(i,!0)&&this.isDirtyBox&&this.redraw())},e.prototype.getChartSize=function(){var i=this.options.chart,s=i.width;i=i.height;var o=this.renderTo;ae(s)||(this.containerWidth=ce(o,"width")),ae(i)||(this.containerHeight=ce(o,"height")),this.chartWidth=Math.max(0,s||this.containerWidth||600),this.chartHeight=Math.max(0,be(i,this.chartWidth)||(1<this.containerHeight?this.containerHeight:400))},e.prototype.temporaryDisplay=function(i){var s=this.renderTo;if(i)for(;s&&s.style;)s.hcOrigStyle&&(ie(s,s.hcOrigStyle),delete s.hcOrigStyle),s.hcOrigDetached&&(W.body.removeChild(s),s.hcOrigDetached=!1),s=s.parentNode;else for(;s&&s.style&&(W.body.contains(s)||s.parentNode||(s.hcOrigDetached=!0,W.body.appendChild(s)),("none"===ce(s,"display",!1)||s.hcOricDetached)&&(s.hcOrigStyle={display:s.style.display,height:s.style.height,overflow:s.style.overflow},i={display:"block",overflow:"hidden"},s!==this.renderTo&&(i.height=0),ie(s,i),s.offsetWidth||s.style.setProperty("display","block","important")),(s=s.parentNode)!==W.body););},e.prototype.setClassName=function(i){this.container.className="highcharts-container "+(i||"")},e.prototype.getContainer=function(){var i,s,h=this.options,v=h.chart,y=this.renderTo,_=Ce();y||(this.renderTo=y=v.renderTo),ge(y)&&(this.renderTo=y=W.getElementById(y)),y||se(13,!0,this);var S=Se(Z(y,"data-highcharts-chart"));pe(S)&&j[S]&&j[S].hasRendered&&j[S].destroy(),Z(y,"data-highcharts-chart",this.index),y.innerHTML="",v.skipClone||y.offsetWidth||this.temporaryDisplay(),this.getChartSize(),S=this.chartWidth;var T=this.chartHeight;if(ie(y,{overflow:"hidden"}),this.styledMode||(i=le({position:"relative",overflow:"hidden",width:S+"px",height:T+"px",textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)",userSelect:"none"},v.style)),this.container=y=te("div",{id:_},i,y),this._cursor=y.style.cursor,this.renderer=new(o[v.renderer]||o.Renderer)(y,S,T,null,v.forExport,h.exporting&&h.exporting.allowHTML,this.styledMode),V(void 0,this),this.setClassName(v.className),this.styledMode)for(s in h.defs)this.renderer.definition(h.defs[s]);else this.renderer.setStyle(v.style);this.renderer.chartIndex=this.index,de(this,"afterGetContainer")},e.prototype.getMargins=function(i){var s=this.spacing,o=this.margin,h=this.titleOffset;this.resetMargins(),h[0]&&!ae(o[0])&&(this.plotTop=Math.max(this.plotTop,h[0]+s[0])),h[2]&&!ae(o[2])&&(this.marginBottom=Math.max(this.marginBottom,h[2]+s[2])),this.legend&&this.legend.display&&this.legend.adjustMargins(o,s),de(this,"getMargins"),i||this.getAxisMargins()},e.prototype.getAxisMargins=function(){var i=this,s=i.axisOffset=[0,0,0,0],o=i.colorAxis,h=i.margin,f=function(i){i.forEach((function(i){i.visible&&i.getOffset()}))};i.hasCartesianSeries?f(i.axes):o&&o.length&&f(o),xe.forEach((function(o,v){ae(h[v])||(i[o]+=s[v])})),i.setChartSize()},e.prototype.reflow=function(i){var s=this,o=s.options.chart,h=s.renderTo,v=ae(o.width)&&ae(o.height),y=o.width||ce(h,"width");o=o.height||ce(h,"height"),h=i?i.target:K,delete s.pointer.chartPosition,v||s.isPrinting||!y||!o||h!==K&&h!==W||(y===s.containerWidth&&o===s.containerHeight||(R.clearTimeout(s.reflowTimeout),s.reflowTimeout=ke((function(){s.container&&s.setSize(void 0,void 0,!1)}),i?100:0)),s.containerWidth=y,s.containerHeight=o)},e.prototype.setReflow=function(i){var s=this;!1===i||this.unbindReflow?!1===i&&this.unbindReflow&&(this.unbindReflow=this.unbindReflow()):(this.unbindReflow=X(K,"resize",(function(i){s.options&&s.reflow(i)})),X(this,"destroy",this.unbindReflow))},e.prototype.setSize=function(i,s,o){var h=this,v=h.renderer;h.isResizing+=1,V(o,h),o=v.globalAnimation,h.oldChartHeight=h.chartHeight,h.oldChartWidth=h.chartWidth,void 0!==i&&(h.options.chart.width=i),void 0!==s&&(h.options.chart.height=s),h.getChartSize(),h.styledMode||(o?L:ie)(h.container,{width:h.chartWidth+"px",height:h.chartHeight+"px"},o),h.setChartSize(!0),v.setSize(h.chartWidth,h.chartHeight,o),h.axes.forEach((function(i){i.isDirty=!0,i.setScale()})),h.isDirtyLegend=!0,h.isDirtyBox=!0,h.layOutTitles(),h.getMargins(),h.redraw(o),h.oldChartHeight=null,de(h,"resize"),ke((function(){h&&de(h,"endResize",null,(function(){--h.isResizing}))}),N(o).duration)},e.prototype.setChartSize=function(i){var s,o,h,v,y=this.inverted,_=this.renderer,S=this.chartWidth,T=this.chartHeight,x=this.options.chart,R=this.spacing,P=this.clipOffset;this.plotLeft=s=Math.round(this.plotLeft),this.plotTop=o=Math.round(this.plotTop),this.plotWidth=h=Math.max(0,Math.round(S-s-this.marginRight)),this.plotHeight=v=Math.max(0,Math.round(T-o-this.marginBottom)),this.plotSizeX=y?v:h,this.plotSizeY=y?h:v,this.plotBorderWidth=x.plotBorderWidth||0,this.spacingBox=_.spacingBox={x:R[3],y:R[0],width:S-R[3]-R[1],height:T-R[0]-R[2]},this.plotBox=_.plotBox={x:s,y:o,width:h,height:v},S=2*Math.floor(this.plotBorderWidth/2),y=Math.ceil(Math.max(S,P[3])/2),_=Math.ceil(Math.max(S,P[0])/2),this.clipBox={x:y,y:_,width:Math.floor(this.plotSizeX-Math.max(S,P[1])/2-y),height:Math.max(0,Math.floor(this.plotSizeY-Math.max(S,P[2])/2-_))},i||this.axes.forEach((function(i){i.setAxisSize(),i.setAxisTranslation()})),de(this,"afterSetChartSize",{skipAxes:i})},e.prototype.resetMargins=function(){de(this,"resetMargins");var i=this,s=i.options.chart;["margin","spacing"].forEach((function(o){var h=s[o],v=fe(h)?h:[h,h,h,h];["Top","Right","Bottom","Left"].forEach((function(h,y){i[o][y]=_e(s[o+h],v[y])}))})),xe.forEach((function(s,o){i[s]=_e(i.margin[o],i.spacing[o])})),i.axisOffset=[0,0,0,0],i.clipOffset=[0,0,0,0]},e.prototype.drawChartBox=function(){var i,s=this.options.chart,o=this.renderer,h=this.chartWidth,v=this.chartHeight,y=this.chartBackground,_=this.plotBackground,S=this.plotBorder,T=this.styledMode,x=this.plotBGImage,R=s.backgroundColor,P=s.plotBackgroundColor,L=s.plotBackgroundImage,N=this.plotLeft,V=this.plotTop,j=this.plotWidth,W=this.plotHeight,K=this.plotBox,U=this.clipRect,Y=this.clipBox,$="animate";if(y||(this.chartBackground=y=o.rect().addClass("highcharts-background").add(),$="attr"),T)var X=i=y.strokeWidth();else i=(X=s.borderWidth||0)+(s.shadow?8:0),R={fill:R||"none"},(X||y["stroke-width"])&&(R.stroke=s.borderColor,R["stroke-width"]=X),y.attr(R).shadow(s.shadow);y[$]({x:i/2,y:i/2,width:h-i-X%2,height:v-i-X%2,r:s.borderRadius}),$="animate",_||($="attr",this.plotBackground=_=o.rect().addClass("highcharts-plot-background").add()),_[$](K),T||(_.attr({fill:P||"none"}).shadow(s.plotShadow),L&&(x?(L!==x.attr("href")&&x.attr("href",L),x.animate(K)):this.plotBGImage=o.image(L,N,V,j,W).add())),U?U.animate({width:Y.width,height:Y.height}):this.clipRect=o.clipRect(Y),$="animate",S||($="attr",this.plotBorder=S=o.rect().addClass("highcharts-plot-border").attr({zIndex:1}).add()),T||S.attr({stroke:s.plotBorderColor,"stroke-width":s.plotBorderWidth||0,fill:"none"}),S[$](S.crisp({x:N,y:V,width:j,height:W},-S.strokeWidth())),this.isDirtyBox=!1,de(this,"afterDrawChartBox")},e.prototype.propFromSeries=function(){var i,s,o,h=this,v=h.options.chart,y=h.options.series;["inverted","angular","polar"].forEach((function(_){for(i=$[v.type||v.defaultSeriesType],o=v[_]||i&&i.prototype[_],s=y&&y.length;!o&&s--;)(i=$[y[s].type])&&i.prototype[_]&&(o=!0);h[_]=o}))},e.prototype.linkSeries=function(){var i=this,s=i.series;s.forEach((function(i){i.linkedSeries.length=0})),s.forEach((function(s){var o=s.options.linkedTo;ge(o)&&(o=":previous"===o?i.series[s.index-1]:i.get(o))&&o.linkedParent!==s&&(o.linkedSeries.push(s),s.linkedParent=o,o.enabledDataSorting&&s.setDataSortingOptions(),s.visible=_e(s.options.visible,o.options.visible,s.visible))})),de(this,"afterLinkSeries")},e.prototype.renderSeries=function(){this.series.forEach((function(i){i.translate(),i.render()}))},e.prototype.renderLabels=function(){var i=this,s=i.options.labels;s.items&&s.items.forEach((function(o){var h=le(s.style,o.style),v=Se(h.left)+i.plotLeft,y=Se(h.top)+i.plotTop+12;delete h.left,delete h.top,i.renderer.text(o.html,v,y).attr({zIndex:2}).css(h).add()}))},e.prototype.render=function(){var i=this.axes,s=this.colorAxis,o=this.renderer,v=this.options,y=0,g=function(i){i.forEach((function(i){i.visible&&i.render()}))};this.setTitle(),this.legend=new h(this,v.legend),this.getStacks&&this.getStacks(),this.getMargins(!0),this.setChartSize(),v=this.plotWidth,i.some((function(i){if(i.horiz&&i.visible&&i.options.labels.enabled&&i.series.length)return y=21,!0}));var _=this.plotHeight=Math.max(this.plotHeight-y,0);i.forEach((function(i){i.setScale()})),this.getAxisMargins();var S=1.1<v/this.plotWidth,T=1.05<_/this.plotHeight;(S||T)&&(i.forEach((function(i){(i.horiz&&S||!i.horiz&&T)&&i.setTickInterval(!0)})),this.getMargins()),this.drawChartBox(),this.hasCartesianSeries?g(i):s&&s.length&&g(s),this.seriesGroup||(this.seriesGroup=o.g("series-group").attr({zIndex:3}).add()),this.renderSeries(),this.renderLabels(),this.addCredits(),this.setResponsive&&this.setResponsive(),this.hasRendered=!0},e.prototype.addCredits=function(i){var s=this,o=me(!0,this.options.credits,i);o.enabled&&!this.credits&&(this.credits=this.renderer.text(o.text+(this.mapCredits||""),0,0).addClass("highcharts-credits").on("click",(function(){o.href&&(K.location.href=o.href)})).attr({align:o.position.align,zIndex:8}),s.styledMode||this.credits.css(o.style),this.credits.add().align(o.position),this.credits.update=function(i){s.credits=s.credits.destroy(),s.addCredits(i)})},e.prototype.destroy=function(){var i,s=this,h=s.axes,v=s.series,y=s.container,_=y&&y.parentNode;for(de(s,"destroy"),s.renderer.forExport?re(j,s):j[s.index]=void 0,o.chartCount--,s.renderTo.removeAttribute("data-highcharts-chart"),Te(s),i=h.length;i--;)h[i]=h[i].destroy();for(this.scroller&&this.scroller.destroy&&this.scroller.destroy(),i=v.length;i--;)v[i]=v[i].destroy();"title subtitle chartBackground plotBackground plotBGImage plotBorder seriesGroup clipRect credits pointer rangeSelector legend resetZoomButton tooltip renderer".split(" ").forEach((function(i){var o=s[i];o&&o.destroy&&(s[i]=o.destroy())})),y&&(y.innerHTML="",Te(y),_&&ne(y)),ye(s,(function(i,o){delete s[o]}))},e.prototype.firstRender=function(){var i=this,s=i.options;i.isReadyToRender&&!i.isReadyToRender()||(i.getContainer(),i.resetMargins(),i.setChartSize(),i.propFromSeries(),i.getAxes(),(he(s.series)?s.series:[]).forEach((function(s){i.initSeries(s)})),i.linkSeries(),i.setSeriesData(),de(i,"beforeRender"),S&&(i.pointer=o.hasTouch||!K.PointerEvent&&!K.MSPointerEvent?new S(i,s):new v(i,s)),i.render(),i.renderer.imgCount||i.hasLoaded||i.onload(),i.temporaryDisplay(!0))},e.prototype.onload=function(){this.callbacks.concat([this.callback]).forEach((function(i){i&&void 0!==this.index&&i.apply(this,[this])}),this),de(this,"load"),de(this,"render"),ae(this.index)&&this.setReflow(this.options.chart.reflow),this.hasLoaded=!0},e.prototype.addSeries=function(i,s,o){var h,v=this;return i&&(s=_e(s,!0),de(v,"addSeries",{options:i},(function(){h=v.initSeries(i),v.isDirtyLegend=!0,v.linkSeries(),h.enabledDataSorting&&h.setData(i.data,!1),de(v,"afterAddSeries",{series:h}),s&&v.redraw(o)}))),h},e.prototype.addAxis=function(i,s,o,h){return this.createAxis(s?"xAxis":"yAxis",{axis:i,redraw:o,animation:h})},e.prototype.addColorAxis=function(i,s,o){return this.createAxis("colorAxis",{axis:i,redraw:s,animation:o})},e.prototype.createAxis=function(i,h){var v=this.options,y="colorAxis"===i,_=h.redraw,S=h.animation;h=me(h.axis,{index:this[i].length,isX:"xAxis"===i});var T=y?new o.ColorAxis(this,h):new s(this,h);return v[i]=Ee(v[i]||{}),v[i].push(h),y&&(this.isDirtyLegend=!0,this.axes.forEach((function(i){i.series=[]})),this.series.forEach((function(i){i.bindAxes(),i.isDirtyData=!0}))),_e(_,!0)&&this.redraw(S),T},e.prototype.showLoading=function(i){var s=this,o=s.options,h=s.loadingDiv,v=s.loadingSpan,y=o.loading,k=function(){h&&ie(h,{left:s.plotLeft+"px",top:s.plotTop+"px",width:s.plotWidth+"px",height:s.plotHeight+"px"})};h||(s.loadingDiv=h=te("div",{className:"highcharts-loading highcharts-loading-hidden"},null,s.container)),v||(s.loadingSpan=v=te("span",{className:"highcharts-loading-inner"},null,h),X(s,"redraw",k)),h.className="highcharts-loading",P.setElementHTML(v,_e(i,o.lang.loading,"")),s.styledMode||(ie(h,le(y.style,{zIndex:10})),ie(v,y.labelStyle),s.loadingShown||(ie(h,{opacity:0,display:""}),L(h,{opacity:y.style.opacity||.5},{duration:y.showDuration||0}))),s.loadingShown=!0,k()},e.prototype.hideLoading=function(){var i=this.options,s=this.loadingDiv;s&&(s.className="highcharts-loading highcharts-loading-hidden",this.styledMode||L(s,{opacity:0},{duration:i.loading.hideDuration||100,complete:function(){ie(s,{display:"none"})}})),this.loadingShown=!1},e.prototype.update=function(i,s,o,h){var v,y,_,S=this,T={credits:"addCredits",title:"setTitle",subtitle:"setSubtitle",caption:"setCaption"},R=i.isResponsiveOptions,P=[];if(de(S,"update",{options:i}),R||S.setResponsive(!1,!0),i=ee(i,S.options),S.userOptions=me(S.userOptions,i),v=i.chart){if(me(!0,S.options.chart,v),"className"in v&&S.setClassName(v.className),"reflow"in v&&S.setReflow(v.reflow),"inverted"in v||"polar"in v||"type"in v){S.propFromSeries();var L=!0}"alignTicks"in v&&(L=!0),ye(v,(function(i,s){-1!==S.propsRequireUpdateSeries.indexOf("chart."+s)&&(y=!0),-1!==S.propsRequireDirtyBox.indexOf(s)&&(S.isDirtyBox=!0),-1!==S.propsRequireReflow.indexOf(s)&&(R?S.isDirtyBox=!0:_=!0)})),!S.styledMode&&"style"in v&&S.renderer.setStyle(v.style)}!S.styledMode&&i.colors&&(this.options.colors=i.colors),i.time&&(this.time===Y&&(this.time=new x(i.time)),me(!0,S.options.time,i.time)),ye(i,(function(s,o){S[o]&&"function"==typeof S[o].update?S[o].update(s,!1):"function"==typeof S[T[o]]?S[T[o]](s):"color"!==o&&-1===S.collectionsWithUpdate.indexOf(o)&&me(!0,S.options[o],i[o]),"chart"!==o&&-1!==S.propsRequireUpdateSeries.indexOf(o)&&(y=!0)})),this.collectionsWithUpdate.forEach((function(s){if(i[s]){if("series"===s){var h=[];S[s].forEach((function(i,s){i.options.isInternal||h.push(_e(i.options.index,s))}))}Ee(i[s]).forEach((function(i,v){var y,_=ae(i.id);_&&(y=S.get(i.id)),!y&&S[s]&&(y=S[s][h?h[v]:v])&&_&&ae(y.options.id)&&(y=void 0),y&&y.coll===s&&(y.update(i,!1),o&&(y.touched=!0)),!y&&o&&S.collectionsWithInit[s]&&(S.collectionsWithInit[s][0].apply(S,[i].concat(S.collectionsWithInit[s][1]||[]).concat([!1])).touched=!0)})),o&&S[s].forEach((function(i){i.touched||i.options.isInternal?delete i.touched:P.push(i)}))}})),P.forEach((function(i){i.chart&&i.remove(!1)})),L&&S.axes.forEach((function(i){i.update({},!1)})),y&&S.getSeriesOrderByLinks().forEach((function(i){i.chart&&i.update({},!1)}),this),L=v&&v.width,v=v&&v.height,ge(v)&&(v=be(v,L||S.chartWidth)),_||pe(L)&&L!==S.chartWidth||pe(v)&&v!==S.chartHeight?S.setSize(L,v,h):_e(s,!0)&&S.redraw(h),de(S,"afterUpdate",{options:i,redraw:s,animation:h})},e.prototype.setSubtitle=function(i,s){this.applyDescription("subtitle",i),this.layOutTitles(s)},e.prototype.setCaption=function(i,s){this.applyDescription("caption",i),this.layOutTitles(s)},e.prototype.showResetZoom=function(){function a(){i.zoomOut()}var i=this,s=U.lang,o=i.options.chart.resetZoomButton,h=o.theme,v=h.states,y="chart"===o.relativeTo||"spaceBox"===o.relativeTo?null:"plotBox";de(this,"beforeShowResetZoom",null,(function(){i.resetZoomButton=i.renderer.button(s.resetZoom,null,null,a,h,v&&v.hover).attr({align:o.position.align,title:s.resetZoomTitle}).addClass("highcharts-reset-zoom").add().align(o.position,!1,y)})),de(this,"afterShowResetZoom")},e.prototype.zoomOut=function(){de(this,"selection",{resetSelection:!0},this.zoom)},e.prototype.zoom=function(i){var s,o=this,h=o.pointer,v=!1,y=o.inverted?h.mouseDownX:h.mouseDownY;!i||i.resetSelection?(o.axes.forEach((function(i){s=i.zoom()})),h.initiated=!1):i.xAxis.concat(i.yAxis).forEach((function(i){var _=i.axis,S=o.inverted?_.left:_.top,T=o.inverted?S+_.width:S+_.height,x=_.isXAxis,R=!1;(!x&&y>=S&&y<=T||x||!ae(y))&&(R=!0),h[x?"zoomX":"zoomY"]&&R&&(s=_.zoom(i.min,i.max),_.displayBtn&&(v=!0))}));var _=o.resetZoomButton;v&&!_?o.showResetZoom():!v&&fe(_)&&(o.resetZoomButton=_.destroy()),s&&o.redraw(_e(o.options.chart.animation,i&&i.animation,100>o.pointCount))},e.prototype.pan=function(i,s){var o,h=this,v=h.hoverPoints,y=h.options.chart,_=h.options.mapNavigation&&h.options.mapNavigation.enabled;s="object"==typeof s?s:{enabled:s,type:"x"},y&&y.panning&&(y.panning=s);var S=s.type;de(this,"pan",{originalEvent:i},(function(){v&&v.forEach((function(i){i.setState()}));var s=[1];"xy"===S?s=[1,0]:"y"===S&&(s=[0]),s.forEach((function(s){var v=h[s?"xAxis":"yAxis"][0],y=v.horiz,T=i[y?"chartX":"chartY"],x=h[y=y?"mouseDownX":"mouseDownY"],R=(v.pointRange||0)/2,P=v.reversed&&!h.inverted||!v.reversed&&h.inverted?-1:1,L=v.getExtremes(),N=v.toValue(x-T,!0)+R*P,V=(P=v.toValue(x+v.len-T,!0)-R*P)<N;x=V?P:N,N=V?N:P;var j=v.hasVerticalPanning(),W=v.panningState;v.series.forEach((function(i){if(j&&!s&&(!W||W.isDirty)){var o=i.getProcessedData(!0);o=i.getExtremes(o.yData,!0),W||(W={startMin:Number.MAX_VALUE,startMax:-Number.MAX_VALUE}),pe(o.dataMin)&&pe(o.dataMax)&&(W.startMin=Math.min(_e(i.options.threshold,1/0),o.dataMin,W.startMin),W.startMax=Math.max(_e(i.options.threshold,-1/0),o.dataMax,W.startMax))}})),P=Math.min(_e(null==W?void 0:W.startMin,L.dataMin),R?L.min:v.toValue(v.toPixels(L.min)-v.minPixelPadding)),R=Math.max(_e(null==W?void 0:W.startMax,L.dataMax),R?L.max:v.toValue(v.toPixels(L.max)+v.minPixelPadding)),v.panningState=W,v.isOrdinal||(0<(V=P-x)&&(N+=V,x=P),0<(V=N-R)&&(N=R,x-=V),v.series.length&&x!==L.min&&N!==L.max&&x>=P&&N<=R&&(v.setExtremes(x,N,!1,!1,{trigger:"pan"}),h.resetZoomButton||_||x===P||N===R||!S.match("y")||(h.showResetZoom(),v.displayBtn=!1),o=!0),h[y]=T)})),o&&h.redraw(!1),ie(h.container,{cursor:"move"})}))},e}();return le(we.prototype,{callbacks:[],collectionsWithInit:{xAxis:[we.prototype.addAxis,[!0]],yAxis:[we.prototype.addAxis,[!1]],series:[we.prototype.addSeries]},collectionsWithUpdate:["xAxis","yAxis","zAxis","series"],propsRequireDirtyBox:"backgroundColor borderColor borderWidth borderRadius plotBackgroundColor plotBackgroundImage plotBorderColor plotBorderWidth plotShadow shadow".split(" "),propsRequireReflow:"margin marginTop marginRight marginBottom marginLeft spacing spacingTop spacingRight spacingBottom spacingLeft".split(" "),propsRequireUpdateSeries:"chart.inverted chart.polar chart.ignoreHiddenSeries chart.type colors plotOptions time tooltip".split(" ")}),o.chart=function(i,s,o){return new we(i,s,o)},o.Chart=we,we})),O(s,"Extensions/ScrollablePlotArea.js",[s["Core/Animation/AnimationUtilities.js"],s["Core/Chart/Chart.js"],s["Core/Globals.js"],s["Core/Utilities.js"]],(function(i,s,o,h){var v=i.stop,y=h.addEvent,_=h.createElement,S=h.pick;y(s,"afterSetChartSize",(function(i){var s=this.options.chart.scrollablePlotArea,h=s&&s.minWidth;if(s=s&&s.minHeight,!this.renderer.forExport){if(h){if(this.scrollablePixelsX=h=Math.max(0,h-this.chartWidth)){this.plotWidth+=h,this.inverted?(this.clipBox.height+=h,this.plotBox.height+=h):(this.clipBox.width+=h,this.plotBox.width+=h);var v={1:{name:"right",value:h}}}}else s&&(this.scrollablePixelsY=h=Math.max(0,s-this.chartHeight))&&(this.plotHeight+=h,this.inverted?(this.clipBox.width+=h,this.plotBox.width+=h):(this.clipBox.height+=h,this.plotBox.height+=h),v={2:{name:"bottom",value:h}});v&&!i.skipAxes&&this.axes.forEach((function(i){v[i.side]?i.getPlotLinePath=function(){var s=v[i.side].name,h=this[s];this[s]=h-v[i.side].value;var y=o.Axis.prototype.getPlotLinePath.apply(this,arguments);return this[s]=h,y}:(i.setAxisSize(),i.setAxisTranslation())}))}})),y(s,"render",(function(){this.scrollablePixelsX||this.scrollablePixelsY?(this.setUpScrolling&&this.setUpScrolling(),this.applyFixed()):this.fixedDiv&&this.applyFixed()})),s.prototype.setUpScrolling=function(){var i=this,s={WebkitOverflowScrolling:"touch",overflowX:"hidden",overflowY:"hidden"};this.scrollablePixelsX&&(s.overflowX="auto"),this.scrollablePixelsY&&(s.overflowY="auto"),this.scrollingParent=_("div",{className:"highcharts-scrolling-parent"},{position:"relative"},this.renderTo),this.scrollingContainer=_("div",{className:"highcharts-scrolling"},s,this.scrollingParent),y(this.scrollingContainer,"scroll",(function(){i.pointer&&delete i.pointer.chartPosition})),this.innerContainer=_("div",{className:"highcharts-inner-container"},null,this.scrollingContainer),this.innerContainer.appendChild(this.container),this.setUpScrolling=null},s.prototype.moveFixedElements=function(){var i,s=this.container,o=this.fixedRenderer,h=".highcharts-contextbutton .highcharts-credits .highcharts-legend .highcharts-legend-checkbox .highcharts-navigator-series .highcharts-navigator-xaxis .highcharts-navigator-yaxis .highcharts-navigator .highcharts-reset-zoom .highcharts-scrollbar .highcharts-subtitle .highcharts-title".split(" ");this.scrollablePixelsX&&!this.inverted?i=".highcharts-yaxis":this.scrollablePixelsX&&this.inverted||this.scrollablePixelsY&&!this.inverted?i=".highcharts-xaxis":this.scrollablePixelsY&&this.inverted&&(i=".highcharts-yaxis"),i&&h.push(i+":not(.highcharts-radial-axis)",i+"-labels:not(.highcharts-radial-axis-labels)"),h.forEach((function(i){[].forEach.call(s.querySelectorAll(i),(function(i){(i.namespaceURI===o.SVG_NS?o.box:o.box.parentNode).appendChild(i),i.style.pointerEvents="auto"}))}))},s.prototype.applyFixed=function(){var i,s,h,T=!this.fixedDiv,x=this.options.chart,R=x.scrollablePlotArea;T?(this.fixedDiv=_("div",{className:"highcharts-fixed"},{position:"absolute",overflow:"hidden",pointerEvents:"none",zIndex:((null===(i=x.style)||void 0===i?void 0:i.zIndex)||0)+2,top:0},null,!0),null===(s=this.scrollingContainer)||void 0===s||s.parentNode.insertBefore(this.fixedDiv,this.scrollingContainer),this.renderTo.style.overflow="visible",this.fixedRenderer=i=new o.Renderer(this.fixedDiv,this.chartWidth,this.chartHeight,null===(h=this.options.chart)||void 0===h?void 0:h.style),this.scrollableMask=i.path().attr({fill:this.options.chart.backgroundColor||"#fff","fill-opacity":S(R.opacity,.85),zIndex:-1}).addClass("highcharts-scrollable-mask").add(),this.moveFixedElements(),y(this,"afterShowResetZoom",this.moveFixedElements),y(this,"afterLayOutTitles",this.moveFixedElements)):this.fixedRenderer.setSize(this.chartWidth,this.chartHeight),h=this.chartWidth+(this.scrollablePixelsX||0),i=this.chartHeight+(this.scrollablePixelsY||0),v(this.container),this.container.style.width=h+"px",this.container.style.height=i+"px",this.renderer.boxWrapper.attr({width:h,height:i,viewBox:[0,0,h,i].join(" ")}),this.chartBackground.attr({width:h,height:i}),this.scrollingContainer.style.height=this.chartHeight+"px",T&&(R.scrollPositionX&&(this.scrollingContainer.scrollLeft=this.scrollablePixelsX*R.scrollPositionX),R.scrollPositionY&&(this.scrollingContainer.scrollTop=this.scrollablePixelsY*R.scrollPositionY)),i=this.axisOffset,T=this.plotTop-i[0]-1,R=this.plotLeft-i[3]-1,h=this.plotTop+this.plotHeight+i[2]+1,i=this.plotLeft+this.plotWidth+i[1]+1,s=this.plotLeft+this.plotWidth-(this.scrollablePixelsX||0),x=this.plotTop+this.plotHeight-(this.scrollablePixelsY||0),T=this.scrollablePixelsX?[["M",0,T],["L",this.plotLeft-1,T],["L",this.plotLeft-1,h],["L",0,h],["Z"],["M",s,T],["L",this.chartWidth,T],["L",this.chartWidth,h],["L",s,h],["Z"]]:this.scrollablePixelsY?[["M",R,0],["L",R,this.plotTop-1],["L",i,this.plotTop-1],["L",i,0],["Z"],["M",R,x],["L",R,this.chartHeight],["L",i,this.chartHeight],["L",i,x],["Z"]]:[["M",0,0]],"adjustHeight"!==this.redrawTrigger&&this.scrollableMask.attr({d:T})}})),O(s,"Mixins/LegendSymbol.js",[s["Core/Globals.js"],s["Core/Utilities.js"]],(function(i,s){var o=s.merge,h=s.pick;return i.LegendSymbolMixin={drawRectangle:function(i,s){var o=i.symbolHeight,v=i.options.squareSymbol;s.legendSymbol=this.chart.renderer.rect(v?(i.symbolWidth-o)/2:0,i.baseline-o+1,v?o:i.symbolWidth,o,h(i.options.symbolRadius,o/2)).addClass("highcharts-point").attr({zIndex:3}).add(s.legendGroup)},drawLineMarker:function(i){var s=this.options,v=s.marker,y=i.symbolWidth,_=i.symbolHeight,S=_/2,T=this.chart.renderer,x=this.legendGroup;i=i.baseline-Math.round(.3*i.fontMetrics.b);var R={};this.chart.styledMode||(R={"stroke-width":s.lineWidth||0},s.dashStyle&&(R.dashstyle=s.dashStyle)),this.legendLine=T.path([["M",0,i],["L",y,i]]).addClass("highcharts-graph").attr(R).add(x),v&&!1!==v.enabled&&y&&(s=Math.min(h(v.radius,S),S),0===this.symbol.indexOf("url")&&(v=o(v,{width:_,height:_}),s=0),this.legendSymbol=v=T.symbol(this.symbol,y/2-s,i-s,2*s,2*s,v).addClass("highcharts-point").add(x),v.isMarker=!0)}}})),O(s,"Core/Series/Series.js",[s["Core/Animation/AnimationUtilities.js"],s["Core/Globals.js"],s["Mixins/LegendSymbol.js"],s["Core/Options.js"],s["Core/Color/Palette.js"],s["Core/Series/Point.js"],s["Core/Series/SeriesRegistry.js"],s["Core/Renderer/SVG/SVGElement.js"],s["Core/Utilities.js"]],(function(i,s,o,h,v,y,_,S,T){var x=i.animObject,R=i.setAnimation,P=s.hasTouch,L=s.svg,N=s.win,V=h.defaultOptions,j=_.seriesTypes,W=T.addEvent,K=T.arrayMax,U=T.arrayMin,Y=T.clamp,$=T.cleanRecursively,X=T.correctFloat,Z=T.defined,ee=T.erase,te=T.error,ie=T.extend,ae=T.find,ne=T.fireEvent,re=T.getNestedProperty,se=T.isArray,le=T.isFunction,oe=T.isNumber,de=T.isString,ce=T.merge,he=T.objectEach,ue=T.pick,pe=T.removeEvent,fe=T.splat,ge=T.syncTimeout;return i=function(){function b(){this.zones=this.yAxis=this.xAxis=this.userOptions=this.tooltipOptions=this.processedYData=this.processedXData=this.points=this.options=this.linkedSeries=this.index=this.eventsToUnbind=this.eventOptions=this.data=this.chart=this._i=void 0}return b.prototype.init=function(i,s){ne(this,"init",{options:s});var o,h=this,v=i.series;this.eventOptions=this.eventOptions||{},this.eventsToUnbind=[],h.chart=i,h.options=s=h.setOptions(s),h.linkedSeries=[],h.bindAxes(),ie(h,{name:s.name,state:"",visible:!1!==s.visible,selected:!0===s.selected});var y=s.events;he(y,(function(i,s){le(i)&&h.eventOptions[s]!==i&&(le(h.eventOptions[s])&&pe(h,s,h.eventOptions[s]),h.eventOptions[s]=i,W(h,s,i))})),(y&&y.click||s.point&&s.point.events&&s.point.events.click||s.allowPointSelect)&&(i.runTrackerClick=!0),h.getColor(),h.getSymbol(),h.parallelArrays.forEach((function(i){h[i+"Data"]||(h[i+"Data"]=[])})),h.isCartesian&&(i.hasCartesianSeries=!0),v.length&&(o=v[v.length-1]),h._i=ue(o&&o._i,-1)+1,h.opacity=h.options.opacity,i.orderSeries(this.insert(v)),s.dataSorting&&s.dataSorting.enabled?h.setDataSortingOptions():h.points||h.data||h.setData(s.data,!1),ne(this,"afterInit")},b.prototype.is=function(i){return j[i]&&this instanceof j[i]},b.prototype.insert=function(i){var s,o=this.options.index;if(oe(o)){for(s=i.length;s--;)if(o>=ue(i[s].options.index,i[s]._i)){i.splice(s+1,0,this);break}-1===s&&i.unshift(this),s+=1}else i.push(this);return ue(s,i.length-1)},b.prototype.bindAxes=function(){var i,s=this,o=s.options,h=s.chart;ne(this,"bindAxes",null,(function(){(s.axisTypes||[]).forEach((function(v){h[v].forEach((function(h){i=h.options,(o[v]===i.index||void 0!==o[v]&&o[v]===i.id||void 0===o[v]&&0===i.index)&&(s.insert(h.series),s[v]=h,h.isDirty=!0)})),s[v]||s.optionalAxis===v||te(18,!0,h)}))})),ne(this,"afterBindAxes")},b.prototype.updateParallelArrays=function(i,s){var o=i.series,h=arguments,v=oe(s)?function(h){var v="y"===h&&o.toYData?o.toYData(i):i[h];o[h+"Data"][s]=v}:function(i){Array.prototype[s].apply(o[i+"Data"],Array.prototype.slice.call(h,2))};o.parallelArrays.forEach(v)},b.prototype.hasData=function(){return this.visible&&void 0!==this.dataMax&&void 0!==this.dataMin||this.visible&&this.yData&&0<this.yData.length},b.prototype.autoIncrement=function(){var i,s=this.options,o=this.xIncrement,h=s.pointIntervalUnit,v=this.chart.time;return o=ue(o,s.pointStart,0),this.pointInterval=i=ue(this.pointInterval,s.pointInterval,1),h&&(s=new v.Date(o),"day"===h?v.set("Date",s,v.get("Date",s)+i):"month"===h?v.set("Month",s,v.get("Month",s)+i):"year"===h&&v.set("FullYear",s,v.get("FullYear",s)+i),i=s.getTime()-o),this.xIncrement=o+i,o},b.prototype.setDataSortingOptions=function(){var i=this.options;ie(this,{requireSorting:!1,sorted:!1,enabledDataSorting:!0,allowDG:!1}),Z(i.pointRange)||(i.pointRange=1)},b.prototype.setOptions=function(i){var s=this.chart,o=s.options,h=o.plotOptions,v=s.userOptions||{};i=ce(i),s=s.styledMode;var y={plotOptions:h,userOptions:i};ne(this,"setOptions",y);var _=y.plotOptions[this.type],S=v.plotOptions||{};return this.userOptions=y.userOptions,v=ce(_,h.series,v.plotOptions&&v.plotOptions[this.type],i),this.tooltipOptions=ce(V.tooltip,V.plotOptions.series&&V.plotOptions.series.tooltip,V.plotOptions[this.type].tooltip,o.tooltip.userOptions,h.series&&h.series.tooltip,h[this.type].tooltip,i.tooltip),this.stickyTracking=ue(i.stickyTracking,S[this.type]&&S[this.type].stickyTracking,S.series&&S.series.stickyTracking,!(!this.tooltipOptions.shared||this.noSharedTooltip)||v.stickyTracking),null===_.marker&&delete v.marker,this.zoneAxis=v.zoneAxis,o=this.zones=(v.zones||[]).slice(),!v.negativeColor&&!v.negativeFillColor||v.zones||(h={value:v[this.zoneAxis+"Threshold"]||v.threshold||0,className:"highcharts-negative"},s||(h.color=v.negativeColor,h.fillColor=v.negativeFillColor),o.push(h)),o.length&&Z(o[o.length-1].value)&&o.push(s?{}:{color:this.color,fillColor:this.fillColor}),ne(this,"afterSetOptions",{options:v}),v},b.prototype.getName=function(){return ue(this.options.name,"Series "+(this.index+1))},b.prototype.getCyclic=function(i,s,o){var h=this.chart,v=this.userOptions,y=i+"Index",_=i+"Counter",S=o?o.length:ue(h.options.chart[i+"Count"],h[i+"Count"]);if(!s){var T=ue(v[y],v["_"+y]);Z(T)||(h.series.length||(h[_]=0),v["_"+y]=T=h[_]%S,h[_]+=1),o&&(s=o[T])}void 0!==T&&(this[y]=T),this[i]=s},b.prototype.getColor=function(){this.chart.styledMode?this.getCyclic("color"):this.options.colorByPoint?this.options.color=null:this.getCyclic("color",this.options.color||V.plotOptions[this.type].color,this.chart.options.colors)},b.prototype.getPointsCollection=function(){return(this.hasGroupedData?this.points:this.data)||[]},b.prototype.getSymbol=function(){this.getCyclic("symbol",this.options.marker.symbol,this.chart.options.symbols)},b.prototype.findPointIndex=function(i,s){var o,h=i.id,v=i.x,y=this.points,_=this.options.dataSorting;if(h)var S=this.chart.get(h);else if(this.linkedParent||this.enabledDataSorting){var T=_&&_.matchByName?"name":"index";if(!(S=ae(y,(function(s){return!s.touched&&s[T]===i[T]}))))return}if(S){var x=S&&S.index;void 0!==x&&(o=!0)}return void 0===x&&oe(v)&&(x=this.xData.indexOf(v,s)),-1!==x&&void 0!==x&&this.cropped&&(x=x>=this.cropStart?x-this.cropStart:x),!o&&y[x]&&y[x].touched&&(x=void 0),x},b.prototype.updateData=function(i,s){var o,h,v,y=this.options,_=y.dataSorting,S=this.points,T=[],x=this.requireSorting,R=i.length===S.length,P=!0;if(this.xIncrement=null,i.forEach((function(i,s){var h=Z(i)&&this.pointClass.prototype.optionsToObject.call({series:this},i)||{},P=h.x;h.id||oe(P)?(-1===(P=this.findPointIndex(h,v))||void 0===P?T.push(i):S[P]&&i!==y.data[P]?(S[P].update(i,!1,null,!1),S[P].touched=!0,x&&(v=P+1)):S[P]&&(S[P].touched=!0),(!R||s!==P||_&&_.enabled||this.hasDerivedData)&&(o=!0)):T.push(i)}),this),o)for(i=S.length;i--;)(h=S[i])&&!h.touched&&h.remove&&h.remove(!1,s);else!R||_&&_.enabled?P=!1:(i.forEach((function(i,s){S[s].update&&i!==S[s].y&&S[s].update(i,!1,null,!1)})),T.length=0);return S.forEach((function(i){i&&(i.touched=!1)})),!!P&&(T.forEach((function(i){this.addPoint(i,!1,null,null,!1)}),this),null===this.xIncrement&&this.xData&&this.xData.length&&(this.xIncrement=K(this.xData),this.autoIncrement()),!0)},b.prototype.setData=function(i,s,o,h){var v,y=this,_=y.points,S=_&&_.length||0,T=y.options,x=y.chart,R=T.dataSorting,P=null,L=y.xAxis;P=T.turboThreshold;var N,V=this.xData,j=this.yData,W=(v=y.pointArrayMap)&&v.length,K=T.keys,U=0,Y=1;if(v=(i=i||[]).length,s=ue(s,!0),R&&R.enabled&&(i=this.sortData(i)),!1!==h&&v&&S&&!y.cropped&&!y.hasGroupedData&&y.visible&&!y.isSeriesBoosting&&(N=this.updateData(i,o)),!N){if(y.xIncrement=null,y.colorCounter=0,this.parallelArrays.forEach((function(i){y[i+"Data"].length=0})),P&&v>P)if(P=y.getFirstValidPoint(i),oe(P))for(o=0;o<v;o++)V[o]=this.autoIncrement(),j[o]=i[o];else if(se(P))if(W)for(o=0;o<v;o++)h=i[o],V[o]=h[0],j[o]=h.slice(1,W+1);else for(K&&(U=0<=(U=K.indexOf("x"))?U:0,Y=0<=(Y=K.indexOf("y"))?Y:1),o=0;o<v;o++)h=i[o],V[o]=h[U],j[o]=h[Y];else te(12,!1,x);else for(o=0;o<v;o++)void 0!==i[o]&&(h={series:y},y.pointClass.prototype.applyOptions.apply(h,[i[o]]),y.updateParallelArrays(h,o));for(j&&de(j[0])&&te(14,!0,x),y.data=[],y.options.data=y.userOptions.data=i,o=S;o--;)_[o]&&_[o].destroy&&_[o].destroy();L&&(L.minRange=L.userMinRange),y.isDirty=x.isDirtyBox=!0,y.isDirtyData=!!_,o=!1}"point"===T.legendType&&(this.processData(),this.generatePoints()),s&&x.redraw(o)},b.prototype.sortData=function(i){var s=this,o=s.options.dataSorting.sortKey||"y",f=function(i,s){return Z(s)&&i.pointClass.prototype.optionsToObject.call({series:i},s)||{}};return i.forEach((function(o,h){i[h]=f(s,o),i[h].index=h}),this),i.concat().sort((function(i,s){return i=re(o,i),(s=re(o,s))<i?-1:s>i?1:0})).forEach((function(i,s){i.x=s}),this),s.linkedSeries&&s.linkedSeries.forEach((function(s){var o=s.options,h=o.data;o.dataSorting&&o.dataSorting.enabled||!h||(h.forEach((function(o,v){h[v]=f(s,o),i[v]&&(h[v].x=i[v].x,h[v].index=v)})),s.setData(h,!1))})),i},b.prototype.getProcessedData=function(i){var s=this.xData,o=this.yData,h=s.length,v=0,y=this.xAxis,_=this.options,S=_.cropThreshold,T=i||this.getExtremesFromAll||_.getExtremesFromAll,x=this.isCartesian;i=y&&y.val2lin,_=!(!y||!y.logarithmic);var R=this.requireSorting;if(y)var P=(y=y.getExtremes()).min,L=y.max;if(x&&this.sorted&&!T&&(!S||h>S||this.forceCrop))if(s[h-1]<P||s[0]>L)s=[],o=[];else if(this.yData&&(s[0]<P||s[h-1]>L)){s=(v=this.cropData(this.xData,this.yData,P,L)).xData,o=v.yData,v=v.start;var N=!0}for(S=s.length||1;--S;)if(0<(h=_?i(s[S])-i(s[S-1]):s[S]-s[S-1])&&(void 0===V||h<V))var V=h;else 0>h&&R&&(te(15,!1,this.chart),R=!1);return{xData:s,yData:o,cropped:N,cropStart:v,closestPointRange:V}},b.prototype.processData=function(i){var s=this.xAxis;if(this.isCartesian&&!this.isDirty&&!s.isDirty&&!this.yAxis.isDirty&&!i)return!1;i=this.getProcessedData(),this.cropped=i.cropped,this.cropStart=i.cropStart,this.processedXData=i.xData,this.processedYData=i.yData,this.closestPointRange=this.basePointRange=i.closestPointRange},b.prototype.cropData=function(i,s,o,h,v){var y,_=i.length,S=0,T=_;for(v=ue(v,this.cropShoulder),y=0;y<_;y++)if(i[y]>=o){S=Math.max(0,y-v);break}for(o=y;o<_;o++)if(i[o]>h){T=o+v;break}return{xData:i.slice(S,T),yData:s.slice(S,T),start:S,end:T}},b.prototype.generatePoints=function(){var i,s=this.options,o=s.data,h=this.data,v=this.processedXData,y=this.processedYData,_=this.pointClass,S=v.length,T=this.cropStart||0,x=this.hasGroupedData;s=s.keys;var R,P=[];for(h||x||((h=[]).length=o.length,h=this.data=h),s&&x&&(this.options.keys=!1),R=0;R<S;R++){var L=T+R;if(x){var N=(new _).init(this,[v[R]].concat(fe(y[R])));N.dataGroup=this.groupMap[R],N.dataGroup.options&&(N.options=N.dataGroup.options,ie(N,N.dataGroup.options),delete N.dataLabels)}else(N=h[L])||void 0===o[L]||(h[L]=N=(new _).init(this,o[L],v[R]));N&&(N.index=L,P[R]=N)}if(this.options.keys=s,h&&(S!==(i=h.length)||x))for(R=0;R<i;R++)R!==T||x||(R+=S),h[R]&&(h[R].destroyElements(),h[R].plotX=void 0);this.data=h,this.points=P,ne(this,"afterGeneratePoints")},b.prototype.getXExtremes=function(i){return{min:U(i),max:K(i)}},b.prototype.getExtremes=function(i,s){var o,h=this.xAxis,v=this.yAxis,y=this.processedXData||this.xData,_=[],S=0,T=0,x=0,R=this.requireSorting?this.cropShoulder:0,P=!!v&&v.positiveValuesOnly;for(v=(i=i||this.stackedYData||this.processedYData||[]).length,h&&(T=(x=h.getExtremes()).min,x=x.max),o=0;o<v;o++){var L=y[o],N=i[o],V=(oe(N)||se(N))&&(N.length||0<N||!P);if(L=s||this.getExtremesFromAll||this.options.getExtremesFromAll||this.cropped||!h||(y[o+R]||L)>=T&&(y[o-R]||L)<=x,V&&L)if(V=N.length)for(;V--;)oe(N[V])&&(_[S++]=N[V]);else _[S++]=N}return i={dataMin:U(_),dataMax:K(_)},ne(this,"afterGetExtremes",{dataExtremes:i}),i},b.prototype.applyExtremes=function(){var i=this.getExtremes();return this.dataMin=i.dataMin,this.dataMax=i.dataMax,i},b.prototype.getFirstValidPoint=function(i){for(var s=null,o=i.length,h=0;null===s&&h<o;)s=i[h],h++;return s},b.prototype.translate=function(){this.processedXData||this.processData(),this.generatePoints();var i,s,o=this.options,h=o.stacking,v=this.xAxis,y=v.categories,_=this.enabledDataSorting,S=this.yAxis,T=this.points,x=T.length,R=!!this.modifyValue,P=this.pointPlacementToXValue(),L=!!P,N=o.threshold,V=o.startFromThreshold?N:0,j=this.zoneAxis||"y",W=Number.MAX_VALUE;for(i=0;i<x;i++){var K=T[i],U=K.x,$=K.y,ee=K.low,te=h&&S.stacking&&S.stacking.stacks[(this.negStacks&&$<(V?0:N)?"-":"")+this.stackKey];if((S.positiveValuesOnly&&!S.validatePositiveValue($)||v.positiveValuesOnly&&!v.validatePositiveValue(U))&&(K.isNull=!0),K.plotX=s=X(Y(v.translate(U,0,0,0,1,P,"flags"===this.type),-1e5,1e5)),h&&this.visible&&te&&te[U]){var ie=this.getStackIndicator(ie,U,this.index);if(!K.isNull)var ae=te[U],re=ae.points[ie.key]}if(se(re)&&(ee=re[0],$=re[1],ee===V&&ie.key===te[U].base&&(ee=ue(oe(N)&&N,S.min)),S.positiveValuesOnly&&0>=ee&&(ee=null),K.total=K.stackTotal=ae.total,K.percentage=ae.total&&K.y/ae.total*100,K.stackY=$,this.irregularWidths||ae.setOffset(this.pointXOffset||0,this.barW||0)),K.yBottom=Z(ee)?Y(S.translate(ee,0,1,0,1),-1e5,1e5):null,R&&($=this.modifyValue($,K)),K.plotY=void 0,oe($)&&(void 0!==($=S.translate($,!1,!0,!1,!0))&&(K.plotY=Y($,-1e5,1e5))),K.isInside=this.isPointInside(K),K.clientX=L?X(v.translate(U,0,0,0,1,P)):s,K.negative=K[j]<(o[j+"Threshold"]||N||0),K.category=y&&void 0!==y[K.x]?y[K.x]:K.x,!K.isNull&&!1!==K.visible){void 0!==le&&(W=Math.min(W,Math.abs(s-le)));var le=s}K.zone=this.zones.length&&K.getZone(),!K.graphic&&this.group&&_&&(K.isNew=!0)}this.closestPointRangePx=W,ne(this,"afterTranslate")},b.prototype.getValidPoints=function(i,s,o){var h=this.chart;return(i||this.points||[]).filter((function(i){return!(s&&!h.isInsidePlot(i.plotX,i.plotY,h.inverted))&&(!1!==i.visible&&(o||!i.isNull))}))},b.prototype.getClipBox=function(i,s){var o=this.options,h=this.chart,v=h.inverted,y=this.xAxis,_=y&&this.yAxis,S=h.options.chart.scrollablePlotArea||{};return i&&!1===o.clip&&_?i=v?{y:-h.chartWidth+_.len+_.pos,height:h.chartWidth,width:h.chartHeight,x:-h.chartHeight+y.len+y.pos}:{y:-_.pos,height:h.chartHeight,width:h.chartWidth,x:-y.pos}:(i=this.clipBox||h.clipBox,s&&(i.width=h.plotSizeX,i.x=(h.scrollablePixelsX||0)*(S.scrollPositionX||0))),s?{width:i.width,x:i.x}:i},b.prototype.setClip=function(i){var s=this.chart,o=this.options,h=s.renderer,v=s.inverted,y=this.clipBox,_=this.getClipBox(i),S=this.sharedClipKey||["_sharedClip",i&&i.duration,i&&i.easing,i&&i.defer,_.height,o.xAxis,o.yAxis].join(),T=s[S],x=s[S+"m"];i&&(_.width=0,v&&(_.x=s.plotHeight+(!1!==o.clip?0:s.plotTop))),T?s.hasLoaded||T.attr(_):(i&&(s[S+"m"]=x=h.clipRect(v?s.plotSizeX+99:-99,v?-s.plotLeft:-s.plotTop,99,v?s.chartWidth:s.chartHeight)),s[S]=T=h.clipRect(_),T.count={length:0}),i&&!T.count[this.index]&&(T.count[this.index]=!0,T.count.length+=1),(!1!==o.clip||i)&&(this.group.clip(i||y?T:s.clipRect),this.markerGroup.clip(x),this.sharedClipKey=S),i||(T.count[this.index]&&(delete T.count[this.index],--T.count.length),0===T.count.length&&S&&s[S]&&(y||(s[S]=s[S].destroy()),s[S+"m"]&&(s[S+"m"]=s[S+"m"].destroy())))},b.prototype.animate=function(i){var s=this.chart,o=x(this.options.animation);if(i)this.setClip(o);else{var h=this.sharedClipKey;i=s[h];var v=this.getClipBox(o,!0);i&&i.animate(v,o),s[h+"m"]&&s[h+"m"].animate({width:v.width+99,x:v.x-(s.inverted?0:99)},o)}},b.prototype.afterAnimate=function(){this.setClip(),ne(this,"afterAnimate"),this.finishedAnimating=!0},b.prototype.drawPoints=function(){var i,s,o=this.points,h=this.chart,v=this.options.marker,y=this[this.specialGroup]||this.markerGroup,_=this.xAxis,S=ue(v.enabled,!(_&&!_.isRadial)||null,this.closestPointRangePx>=v.enabledThreshold*v.radius);if(!1!==v.enabled||this._hasPointMarkers)for(i=0;i<o.length;i++){var T=o[i],x=(s=T.graphic)?"animate":"attr",R=T.marker||{},P=!!T.marker;if((S&&void 0===R.enabled||R.enabled)&&!T.isNull&&!1!==T.visible){var L=ue(R.symbol,this.symbol),N=this.markerAttribs(T,T.selected&&"select");this.enabledDataSorting&&(T.startXPos=_.reversed?-N.width:_.width);var V=!1!==T.isInside;s?s[V?"show":"hide"](V).animate(N):V&&(0<N.width||T.hasImage)&&(T.graphic=s=h.renderer.symbol(L,N.x,N.y,N.width,N.height,P?R:v).add(y),this.enabledDataSorting&&h.hasRendered&&(s.attr({x:T.startXPos}),x="animate")),s&&"animate"===x&&s[V?"show":"hide"](V).animate(N),s&&!h.styledMode&&s[x](this.pointAttribs(T,T.selected&&"select")),s&&s.addClass(T.getClassName(),!0)}else s&&(T.graphic=s.destroy())}},b.prototype.markerAttribs=function(i,s){var o=this.options,h=o.marker,v=i.marker||{},y=v.symbol||h.symbol,_=ue(v.radius,h.radius);return s&&(h=h.states[s],s=v.states&&v.states[s],_=ue(s&&s.radius,h&&h.radius,_+(h&&h.radiusPlus||0))),i.hasImage=y&&0===y.indexOf("url"),i.hasImage&&(_=0),i={x:o.crisp?Math.floor(i.plotX)-_:i.plotX-_,y:i.plotY-_},_&&(i.width=i.height=2*_),i},b.prototype.pointAttribs=function(i,s){var o=this.options.marker,h=i&&i.options,v=h&&h.marker||{},y=this.color,_=h&&h.color,S=i&&i.color;h=ue(v.lineWidth,o.lineWidth);var T=i&&i.zone&&i.zone.color;return i=1,y=_||T||S||y,_=v.fillColor||o.fillColor||y,y=v.lineColor||o.lineColor||y,s=s||"normal",o=o.states[s],s=v.states&&v.states[s]||{},h=ue(s.lineWidth,o.lineWidth,h+ue(s.lineWidthPlus,o.lineWidthPlus,0)),_=s.fillColor||o.fillColor||_,{stroke:y=s.lineColor||o.lineColor||y,"stroke-width":h,fill:_,opacity:i=ue(s.opacity,o.opacity,i)}},b.prototype.destroy=function(i){var s,o,h,v=this,y=v.chart,_=/AppleWebKit\/533/.test(N.navigator.userAgent),x=v.data||[];for(ne(v,"destroy"),this.removeEvents(i),(v.axisTypes||[]).forEach((function(i){(h=v[i])&&h.series&&(ee(h.series,v),h.isDirty=h.forceRedraw=!0)})),v.legendItem&&v.chart.legend.destroyItem(v),s=x.length;s--;)(o=x[s])&&o.destroy&&o.destroy();v.points=null,T.clearTimeout(v.animationTimeout),he(v,(function(i,s){i instanceof S&&!i.survive&&i[_&&"group"===s?"hide":"destroy"]()})),y.hoverSeries===v&&(y.hoverSeries=null),ee(y.series,v),y.orderSeries(),he(v,(function(s,o){i&&"hcEvents"===o||delete v[o]}))},b.prototype.applyZones=function(){var i,s,o,h,v,y,_,S,T=this,x=this.chart,R=x.renderer,P=this.zones,L=this.clips||[],N=this.graph,V=this.area,j=Math.max(x.chartWidth,x.chartHeight),W=this[(this.zoneAxis||"y")+"Axis"],K=x.inverted,U=!1;if(P.length&&(N||V)&&W&&void 0!==W.min){var $=W.reversed,X=W.horiz;N&&!this.showLine&&N.hide(),V&&V.hide();var Z=W.getExtremes();P.forEach((function(P,ee){i=$?X?x.plotWidth:0:X?0:W.toPixels(Z.min)||0,i=Y(ue(s,i),0,j),s=Y(Math.round(W.toPixels(ue(P.value,Z.max),!0)||0),0,j),U&&(i=s=W.toPixels(Z.max)),h=Math.abs(i-s),v=Math.min(i,s),y=Math.max(i,s),W.isXAxis?(o={x:K?y:v,y:0,width:h,height:j},X||(o.x=x.plotHeight-o.x)):(o={x:0,y:K?y:v,width:j,height:h},X&&(o.y=x.plotWidth-o.y)),K&&R.isVML&&(o=W.isXAxis?{x:0,y:$?v:y,height:o.width,width:x.chartWidth}:{x:o.y-x.plotLeft-x.spacingBox.x,y:0,width:o.height,height:x.chartHeight}),L[ee]?L[ee].animate(o):L[ee]=R.clipRect(o),_=T["zone-area-"+ee],S=T["zone-graph-"+ee],N&&S&&S.clip(L[ee]),V&&_&&_.clip(L[ee]),U=P.value>Z.max,T.resetZones&&0===s&&(s=void 0)})),this.clips=L}else T.visible&&(N&&N.show(!0),V&&V.show(!0))},b.prototype.invertGroups=function(i){function b(){["group","markerGroup"].forEach((function(h){s[h]&&(o.renderer.isVML&&s[h].attr({width:s.yAxis.len,height:s.xAxis.len}),s[h].width=s.yAxis.len,s[h].height=s.xAxis.len,s[h].invert(!s.isRadialSeries&&i))}))}var s=this,o=s.chart;s.xAxis&&(s.eventsToUnbind.push(W(o,"resize",b)),b(),s.invertGroups=b)},b.prototype.plotGroup=function(i,s,o,h,v){var y=this[i],_=!y;return o={visibility:o,zIndex:h||.1},void 0===this.opacity||this.chart.styledMode||"inactive"===this.state||(o.opacity=this.opacity),_&&(this[i]=y=this.chart.renderer.g().add(v)),y.addClass("highcharts-"+s+" highcharts-series-"+this.index+" highcharts-"+this.type+"-series "+(Z(this.colorIndex)?"highcharts-color-"+this.colorIndex+" ":"")+(this.options.className||"")+(y.hasClass("highcharts-tracker")?" highcharts-tracker":""),!0),y.attr(o)[_?"attr":"animate"](this.getPlotBox()),y},b.prototype.getPlotBox=function(){var i=this.chart,s=this.xAxis,o=this.yAxis;return i.inverted&&(s=o,o=this.xAxis),{translateX:s?s.left:i.plotLeft,translateY:o?o.top:i.plotTop,scaleX:1,scaleY:1}},b.prototype.removeEvents=function(i){i||pe(this),this.eventsToUnbind.length&&(this.eventsToUnbind.forEach((function(i){i()})),this.eventsToUnbind.length=0)},b.prototype.render=function(){var i=this,s=i.chart,o=i.options,h=x(o.animation),v=!i.finishedAnimating&&s.renderer.isSVG&&h.duration,y=i.visible?"inherit":"hidden",_=o.zIndex,S=i.hasRendered,T=s.seriesGroup,R=s.inverted;ne(this,"render");var P=i.plotGroup("group","series",y,_,T);i.markerGroup=i.plotGroup("markerGroup","markers",y,_,T),v&&i.animate&&i.animate(!0),P.inverted=!(!i.isCartesian&&!i.invertable)&&R,i.drawGraph&&(i.drawGraph(),i.applyZones()),i.visible&&i.drawPoints(),i.drawDataLabels&&i.drawDataLabels(),i.redrawPoints&&i.redrawPoints(),i.drawTracker&&!1!==i.options.enableMouseTracking&&i.drawTracker(),i.invertGroups(R),!1===o.clip||i.sharedClipKey||S||P.clip(s.clipRect),v&&i.animate&&i.animate(),S||(v&&h.defer&&(v+=h.defer),i.animationTimeout=ge((function(){i.afterAnimate()}),v||0)),i.isDirty=!1,i.hasRendered=!0,ne(i,"afterRender")},b.prototype.redraw=function(){var i=this.chart,s=this.isDirty||this.isDirtyData,o=this.group,h=this.xAxis,v=this.yAxis;o&&(i.inverted&&o.attr({width:i.plotWidth,height:i.plotHeight}),o.animate({translateX:ue(h&&h.left,i.plotLeft),translateY:ue(v&&v.top,i.plotTop)})),this.translate(),this.render(),s&&delete this.kdTree},b.prototype.searchPoint=function(i,s){var o=this.xAxis,h=this.yAxis,v=this.chart.inverted;return this.searchKDTree({clientX:v?o.len-i.chartY+o.pos:i.chartX-o.pos,plotY:v?h.len-i.chartX+h.pos:i.chartY-h.pos},s,i)},b.prototype.buildKDTree=function(i){this.buildingKdTree=!0;var s=this,o=-1<s.options.findNearestPointBy.indexOf("y")?2:1;delete s.kdTree,ge((function(){s.kdTree=function b(i,o,h){var v;if(v=i&&i.length){var y=s.kdAxisArray[o%h];return i.sort((function(i,s){return i[y]-s[y]})),{point:i[v=Math.floor(v/2)],left:b(i.slice(0,v),o+1,h),right:b(i.slice(v+1),o+1,h)}}}(s.getValidPoints(null,!s.directTouch),o,o),s.buildingKdTree=!1}),s.options.kdNow||i&&"touchstart"===i.type?0:1)},b.prototype.searchKDTree=function(i,s,o){var h=this,v=this.kdAxisArray[0],y=this.kdAxisArray[1],_=s?"distX":"dist";if(s=-1<h.options.findNearestPointBy.indexOf("y")?2:1,this.kdTree||this.buildingKdTree||this.buildKDTree(o),this.kdTree)return function f(i,s,o,S){var T=s.point,x=h.kdAxisArray[o%S],R=T,P=Z(i[v])&&Z(T[v])?Math.pow(i[v]-T[v],2):null,L=Z(i[y])&&Z(T[y])?Math.pow(i[y]-T[y],2):null;return L=(P||0)+(L||0),T.dist=Z(L)?Math.sqrt(L):Number.MAX_VALUE,T.distX=Z(P)?Math.sqrt(P):Number.MAX_VALUE,P=0>(x=i[x]-T[x])?"right":"left",s[L=0>x?"left":"right"]&&(R=(L=f(i,s[L],o+1,S))[_]<R[_]?L:T),s[P]&&Math.sqrt(x*x)<R[_]&&(R=(i=f(i,s[P],o+1,S))[_]<R[_]?i:R),R}(i,this.kdTree,s,s)},b.prototype.pointPlacementToXValue=function(){var i=this.options,s=i.pointRange,o=this.xAxis;return"between"===(i=i.pointPlacement)&&(i=o.reversed?-.5:.5),oe(i)?i*(s||o.pointRange):0},b.prototype.isPointInside=function(i){return void 0!==i.plotY&&void 0!==i.plotX&&0<=i.plotY&&i.plotY<=this.yAxis.len&&0<=i.plotX&&i.plotX<=this.xAxis.len},b.prototype.drawTracker=function(){var i=this,s=i.options,o=s.trackByArea,h=[].concat(o?i.areaPath:i.graphPath),v=i.chart,y=v.pointer,_=v.renderer,S=v.options.tooltip.snap,T=i.tracker,p=function(s){v.hoverSeries!==i&&i.onMouseOver()},x="rgba(192,192,192,"+(L?1e-4:.002)+")";T?T.attr({d:h}):i.graph&&(i.tracker=_.path(h).attr({visibility:i.visible?"visible":"hidden",zIndex:2}).addClass(o?"highcharts-tracker-area":"highcharts-tracker-line").add(i.group),v.styledMode||i.tracker.attr({"stroke-linecap":"round","stroke-linejoin":"round",stroke:x,fill:o?x:"none","stroke-width":i.graph.strokeWidth()+(o?0:2*S)}),[i.tracker,i.markerGroup].forEach((function(i){i.addClass("highcharts-tracker").on("mouseover",p).on("mouseout",(function(i){y.onTrackerMouseOut(i)})),s.cursor&&!v.styledMode&&i.css({cursor:s.cursor}),P&&i.on("touchstart",p)}))),ne(this,"afterDrawTracker")},b.prototype.addPoint=function(i,s,o,h,v){var y=this.options,_=this.data,S=this.chart,T=this.xAxis;T=T&&T.hasNames&&T.names;var x,R=y.data,P=this.xData;s=ue(s,!0);var L={series:this};this.pointClass.prototype.applyOptions.apply(L,[i]);var N=L.x,V=P.length;if(this.requireSorting&&N<P[V-1])for(x=!0;V&&P[V-1]>N;)V--;this.updateParallelArrays(L,"splice",V,0,0),this.updateParallelArrays(L,V),T&&L.name&&(T[N]=L.name),R.splice(V,0,i),x&&(this.data.splice(V,0,null),this.processData()),"point"===y.legendType&&this.generatePoints(),o&&(_[0]&&_[0].remove?_[0].remove(!1):(_.shift(),this.updateParallelArrays(L,"shift"),R.shift())),!1!==v&&ne(this,"addPoint",{point:L}),this.isDirtyData=this.isDirty=!0,s&&S.redraw(h)},b.prototype.removePoint=function(i,s,o){var h=this,v=h.data,y=v[i],_=h.points,S=h.chart,m=function(){_&&_.length===v.length&&_.splice(i,1),v.splice(i,1),h.options.data.splice(i,1),h.updateParallelArrays(y||{series:h},"splice",i,1),y&&y.destroy(),h.isDirty=!0,h.isDirtyData=!0,s&&S.redraw()};R(o,S),s=ue(s,!0),y?y.firePointEvent("remove",null,m):m()},b.prototype.remove=function(i,s,o,h){function f(){v.destroy(h),y.isDirtyLegend=y.isDirtyBox=!0,y.linkSeries(),ue(i,!0)&&y.redraw(s)}var v=this,y=v.chart;!1!==o?ne(v,"remove",null,f):f()},b.prototype.update=function(i,s){i=$(i,this.userOptions),ne(this,"update",{options:i});var o,h=this,v=h.chart,y=h.userOptions,_=h.initialType||h.type,S=v.options.plotOptions,T=i.type||y.type||v.options.chart.type,x=!(this.hasDerivedData||T&&T!==this.type||void 0!==i.pointStart||void 0!==i.pointInterval||h.hasOptionChanged("dataGrouping")||h.hasOptionChanged("pointStart")||h.hasOptionChanged("pointInterval")||h.hasOptionChanged("pointIntervalUnit")||h.hasOptionChanged("keys")),R=j[_].prototype,P=["eventOptions","navigatorSeries","baseSeries"],L=h.finishedAnimating&&{animation:!1},N={};if(x&&(P.push("data","isDirtyData","points","processedXData","processedYData","xIncrement","cropped","_hasPointMarkers","_hasPointLabels","nodes","layout","mapMap","mapData","minY","maxY","minX","maxX"),!1!==i.visible&&P.push("area","graph"),h.parallelArrays.forEach((function(i){P.push(i+"Data")})),i.data&&(i.dataSorting&&ie(h.options.dataSorting,i.dataSorting),this.setData(i.data,!1))),i=ce(y,L,{index:void 0===y.index?h.index:y.index,pointStart:ue(S&&S.series&&S.series.pointStart,y.pointStart,h.xData[0])},!x&&{data:h.options.data},i),x&&i.data&&(i.data=h.options.data),(P=["group","markerGroup","dataLabelsGroup","transformGroup"].concat(P)).forEach((function(i){P[i]=h[i],delete h[i]})),j[T||_]){if(y=T!==h.type,h.remove(!1,!1,!1,!0),y)if(Object.setPrototypeOf)Object.setPrototypeOf(h,j[T||_].prototype);else{for(o in y=Object.hasOwnProperty.call(h,"hcEvents")&&h.hcEvents,R)h[o]=void 0;ie(h,j[T||_].prototype),y?h.hcEvents=y:delete h.hcEvents}}else te(17,!0,v,{missingModuleFor:T||_});if(P.forEach((function(i){h[i]=P[i]})),h.init(v,i),x&&this.points){var V=h.options;!1===V.visible?(N.graphic=1,N.dataLabel=1):h._hasPointLabels||(i=V.marker,T=V.dataLabels,i&&(!1===i.enabled||"symbol"in i)&&(N.graphic=1),T&&!1===T.enabled&&(N.dataLabel=1)),this.points.forEach((function(i){i&&i.series&&(i.resolveColor(),Object.keys(N).length&&i.destroyElements(N),!1===V.showInLegend&&i.legendItem&&v.legend.destroyItem(i))}),this)}h.initialType=_,v.linkSeries(),ne(this,"afterUpdate"),ue(s,!0)&&v.redraw(!!x&&void 0)},b.prototype.setName=function(i){this.name=this.options.name=this.userOptions.name=i,this.chart.isDirtyLegend=!0},b.prototype.hasOptionChanged=function(i){var s=this.options[i],o=this.chart.options.plotOptions,h=this.userOptions[i];return h?s!==h:s!==ue(o&&o[this.type]&&o[this.type][i],o&&o.series&&o.series[i],s)},b.prototype.onMouseOver=function(){var i=this.chart,s=i.hoverSeries;i.pointer.setHoverChartIndex(),s&&s!==this&&s.onMouseOut(),this.options.events.mouseOver&&ne(this,"mouseOver"),this.setState("hover"),i.hoverSeries=this},b.prototype.onMouseOut=function(){var i=this.options,s=this.chart,o=s.tooltip,h=s.hoverPoint;s.hoverSeries=null,h&&h.onMouseOut(),this&&i.events.mouseOut&&ne(this,"mouseOut"),!o||this.stickyTracking||o.shared&&!this.noSharedTooltip||o.hide(),s.series.forEach((function(i){i.setState("",!0)}))},b.prototype.setState=function(i,s){var o=this,h=o.options,v=o.graph,y=h.inactiveOtherPoints,_=h.states,S=h.lineWidth,T=h.opacity,x=ue(_[i||"normal"]&&_[i||"normal"].animation,o.chart.options.chart.animation);if(h=0,i=i||"",o.state!==i&&([o.group,o.markerGroup,o.dataLabelsGroup].forEach((function(s){s&&(o.state&&s.removeClass("highcharts-series-"+o.state),i&&s.addClass("highcharts-series-"+i))})),o.state=i,!o.chart.styledMode)){if(_[i]&&!1===_[i].enabled)return;if(i&&(S=_[i].lineWidth||S+(_[i].lineWidthPlus||0),T=ue(_[i].opacity,T)),v&&!v.dashstyle)for(_={"stroke-width":S},v.animate(_,x);o["zone-graph-"+h];)o["zone-graph-"+h].attr(_),h+=1;y||[o.group,o.markerGroup,o.dataLabelsGroup,o.labelBySeries].forEach((function(i){i&&i.animate({opacity:T},x)}))}s&&y&&o.points&&o.setAllPointsToState(i||void 0)},b.prototype.setAllPointsToState=function(i){this.points.forEach((function(s){s.setState&&s.setState(i)}))},b.prototype.setVisible=function(i,s){var o=this,h=o.chart,v=o.legendItem,y=h.options.chart.ignoreHiddenSeries,_=o.visible,S=(o.visible=i=o.options.visible=o.userOptions.visible=void 0===i?!_:i)?"show":"hide";["group","dataLabelsGroup","markerGroup","tracker","tt"].forEach((function(i){o[i]&&o[i][S]()})),h.hoverSeries!==o&&(h.hoverPoint&&h.hoverPoint.series)!==o||o.onMouseOut(),v&&h.legend.colorizeItem(o,i),o.isDirty=!0,o.options.stacking&&h.series.forEach((function(i){i.options.stacking&&i.visible&&(i.isDirty=!0)})),o.linkedSeries.forEach((function(s){s.setVisible(i,!1)})),y&&(h.isDirtyBox=!0),ne(o,S),!1!==s&&h.redraw()},b.prototype.show=function(){this.setVisible(!0)},b.prototype.hide=function(){this.setVisible(!1)},b.prototype.select=function(i){this.selected=i=this.options.selected=void 0===i?!this.selected:i,this.checkbox&&(this.checkbox.checked=i),ne(this,i?"select":"unselect")},b.defaultOptions={lineWidth:2,allowPointSelect:!1,crisp:!0,showCheckbox:!1,animation:{duration:1e3},events:{},marker:{enabledThreshold:2,lineColor:v.backgroundColor,lineWidth:0,radius:4,states:{normal:{animation:!0},hover:{animation:{duration:50},enabled:!0,radiusPlus:2,lineWidthPlus:1},select:{fillColor:v.neutralColor20,lineColor:v.neutralColor100,lineWidth:2}}},point:{events:{}},dataLabels:{animation:{},align:"center",defer:!0,formatter:function(){var i=this.series.chart.numberFormatter;return"number"!=typeof this.y?"":i(this.y,-1)},padding:5,style:{fontSize:"11px",fontWeight:"bold",color:"contrast",textOutline:"1px contrast"},verticalAlign:"bottom",x:0,y:0},cropThreshold:300,opacity:1,pointRange:0,softThreshold:!0,states:{normal:{animation:!0},hover:{animation:{duration:50},lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{animation:{duration:0}},inactive:{animation:{duration:50},opacity:.2}},stickyTracking:!0,turboThreshold:1e3,findNearestPointBy:"x"},b}(),ie(i.prototype,{axisTypes:["xAxis","yAxis"],coll:"series",colorCounter:0,cropShoulder:1,directTouch:!1,drawLegendSymbol:o.drawLineMarker,isCartesian:!0,kdAxisArray:["clientX","plotY"],parallelArrays:["x","y"],pointClass:y,requireSorting:!0,sorted:!0}),_.series=i,i})),O(s,"Core/Axis/StackingAxis.js",[s["Core/Animation/AnimationUtilities.js"],s["Core/Utilities.js"]],(function(i,s){var o=i.getDeferredAnimation,h=s.addEvent,v=s.destroyObjectProperties,y=s.fireEvent,_=s.objectEach,S=s.pick,T=function(){function b(i){this.oldStacks={},this.stacks={},this.stacksTouched=0,this.axis=i}return b.prototype.buildStacks=function(){var i,s=this.axis,o=s.series,h=S(s.options.reversedStacks,!0),v=o.length;if(!s.isXAxis){for(this.usePercentage=!1,i=v;i--;){var _=o[h?i:v-i-1];_.setStackedPoints(),_.setGroupedPoints()}for(i=0;i<v;i++)o[i].modifyStacks();y(s,"afterBuildStacks")}},b.prototype.cleanStacks=function(){if(!this.axis.isXAxis){if(this.oldStacks)var i=this.stacks=this.oldStacks;_(i,(function(i){_(i,(function(i){i.cumulative=i.total}))}))}},b.prototype.resetStacks=function(){var i=this,s=i.stacks;i.axis.isXAxis||_(s,(function(s){_(s,(function(o,h){o.touched<i.stacksTouched?(o.destroy(),delete s[h]):(o.total=null,o.cumulative=null)}))}))},b.prototype.renderStackTotals=function(){var i=this.axis,s=i.chart,h=s.renderer,v=this.stacks;i=o(s,i.options.stackLabels.animation);var y=this.stackTotalGroup=this.stackTotalGroup||h.g("stack-labels").attr({visibility:"visible",zIndex:6,opacity:0}).add();y.translate(s.plotLeft,s.plotTop),_(v,(function(i){_(i,(function(i){i.render(y)}))})),y.animate({opacity:1},i)},b}();return function(){function b(){}return b.compose=function(i){h(i,"init",b.onInit),h(i,"destroy",b.onDestroy)},b.onDestroy=function(){var i=this.stacking;if(i){var s=i.stacks;_(s,(function(i,o){v(i),s[o]=null})),i&&i.stackTotalGroup&&i.stackTotalGroup.destroy()}},b.onInit=function(){this.stacking||(this.stacking=new T(this))},b}()})),O(s,"Extensions/Stacking.js",[s["Core/Axis/Axis.js"],s["Core/Chart/Chart.js"],s["Core/Globals.js"],s["Core/Series/Series.js"],s["Core/Axis/StackingAxis.js"],s["Core/Utilities.js"]],(function(i,s,o,h,v,y){var _=y.correctFloat,S=y.defined,T=y.destroyObjectProperties,x=y.format,R=y.isNumber,P=y.pick,L=function(){function b(i,s,o,h,v){var y=i.chart.inverted;this.axis=i,this.isNegative=o,this.options=s=s||{},this.x=h,this.total=null,this.points={},this.hasValidPoints=!1,this.stack=v,this.rightCliff=this.leftCliff=0,this.alignOptions={align:s.align||(y?o?"left":"right":"center"),verticalAlign:s.verticalAlign||(y?"middle":o?"bottom":"top"),y:s.y,x:s.x},this.textAlign=s.textAlign||(y?o?"right":"left":"center")}return b.prototype.destroy=function(){T(this,this.axis)},b.prototype.render=function(i){var s=this.axis.chart,o=this.options,h=o.format;h=h?x(h,this,s):o.formatter.call(this),this.label?this.label.attr({text:h,visibility:"hidden"}):(this.label=s.renderer.label(h,null,null,o.shape,null,null,o.useHTML,!1,"stack-labels"),h={r:o.borderRadius||0,text:h,rotation:o.rotation,padding:P(o.padding,5),visibility:"hidden"},s.styledMode||(h.fill=o.backgroundColor,h.stroke=o.borderColor,h["stroke-width"]=o.borderWidth,this.label.css(o.style)),this.label.attr(h),this.label.added||this.label.add(i)),this.label.labelrank=s.plotSizeY},b.prototype.setOffset=function(i,s,o,v,y){var _=this.axis,T=_.chart;v=_.translate(_.stacking.usePercentage?100:v||this.total,0,0,0,1),o=_.translate(o||0),o=S(v)&&Math.abs(v-o),i=P(y,T.xAxis[0].translate(this.x))+i,_=S(v)&&this.getStackBox(T,this,i,v,s,o,_),s=this.label,o=this.isNegative,i="justify"===P(this.options.overflow,"justify");var x=this.textAlign;s&&_&&(y=s.getBBox(),v=s.padding,x="left"===x?T.inverted?-v:v:"right"===x?y.width:T.inverted&&"center"===x?y.width/2:T.inverted?o?y.width+v:-v:y.width/2,o=T.inverted?y.height/2:o?-v:y.height,this.alignOptions.x=P(this.options.x,0),this.alignOptions.y=P(this.options.y,0),_.x-=x,_.y-=o,s.align(this.alignOptions,null,_),T.isInsidePlot(s.alignAttr.x+x-this.alignOptions.x,s.alignAttr.y+o-this.alignOptions.y)?s.show():(s.alignAttr.y=-9999,i=!1),i&&h.prototype.justifyDataLabel.call(this.axis,s,this.alignOptions,s.alignAttr,y,_),s.attr({x:s.alignAttr.x,y:s.alignAttr.y}),P(!i&&this.options.crop,!0)&&((T=R(s.x)&&R(s.y)&&T.isInsidePlot(s.x-v+s.width,s.y)&&T.isInsidePlot(s.x+v,s.y))||s.hide()))},b.prototype.getStackBox=function(i,s,o,h,v,y,_){var S=s.axis.reversed,T=i.inverted,x=_.height+_.pos-(T?i.plotLeft:i.plotTop);return s=s.isNegative&&!S||!s.isNegative&&S,{x:T?s?h-_.right:h-y+_.pos-i.plotLeft:o+i.xAxis[0].transB-i.plotLeft,y:T?_.height-o-v:s?x-h-y:x-h,width:T?y:v,height:T?v:y}},b}();return s.prototype.getStacks=function(){var i=this,s=i.inverted;i.yAxis.forEach((function(i){i.stacking&&i.stacking.stacks&&i.hasVisibleSeries&&(i.stacking.oldStacks=i.stacking.stacks)})),i.series.forEach((function(o){var h=o.xAxis&&o.xAxis.options||{};!o.options.stacking||!0!==o.visible&&!1!==i.options.chart.ignoreHiddenSeries||(o.stackKey=[o.type,P(o.options.stack,""),s?h.top:h.left,s?h.height:h.width].join())}))},v.compose(i),h.prototype.setGroupedPoints=function(){this.options.centerInCategory&&(this.is("column")||this.is("columnrange"))&&!this.options.stacking&&1<this.chart.series.length&&h.prototype.setStackedPoints.call(this,"group")},h.prototype.setStackedPoints=function(i){var s=i||this.options.stacking;if(s&&(!0===this.visible||!1===this.chart.options.chart.ignoreHiddenSeries)){var o=this.processedXData,h=this.processedYData,v=[],y=h.length,T=this.options,x=T.threshold,R=P(T.startFromThreshold&&x,0);T=T.stack;var N,V,j="-"+(i=i?this.type+","+s:this.stackKey),W=this.negStacks,K=this.yAxis,U=K.stacking.stacks,Y=K.stacking.oldStacks;for(K.stacking.stacksTouched+=1,V=0;V<y;V++){var $=o[V],X=h[V],Z=this.getStackIndicator(Z,$,this.index),ee=Z.key,te=(N=W&&X<(R?0:x))?j:i;U[te]||(U[te]={}),U[te][$]||(Y[te]&&Y[te][$]?(U[te][$]=Y[te][$],U[te][$].total=null):U[te][$]=new L(K,K.options.stackLabels,N,$,T)),te=U[te][$],null!==X?(te.points[ee]=te.points[this.index]=[P(te.cumulative,R)],S(te.cumulative)||(te.base=ee),te.touched=K.stacking.stacksTouched,0<Z.index&&!1===this.singleStacks&&(te.points[ee][0]=te.points[this.index+","+$+",0"][0])):te.points[ee]=te.points[this.index]=null,"percent"===s?(N=N?i:j,W&&U[N]&&U[N][$]?(N=U[N][$],te.total=N.total=Math.max(N.total,te.total)+Math.abs(X)||0):te.total=_(te.total+(Math.abs(X)||0))):"group"===s?null!==X&&(te.total=(te.total||0)+1):te.total=_(te.total+(X||0)),te.cumulative="group"===s?(te.total||1)-1:P(te.cumulative,R)+(X||0),null!==X&&(te.points[ee].push(te.cumulative),v[V]=te.cumulative,te.hasValidPoints=!0)}"percent"===s&&(K.stacking.usePercentage=!0),"group"!==s&&(this.stackedYData=v),K.stacking.oldStacks={}}},h.prototype.modifyStacks=function(){var i,s=this,o=s.stackKey,h=s.yAxis.stacking.stacks,v=s.processedXData,y=s.options.stacking;s[y+"Stacker"]&&[o,"-"+o].forEach((function(o){for(var _,S,T=v.length;T--;)_=v[T],i=s.getStackIndicator(i,_,s.index,o),(S=(_=h[o]&&h[o][_])&&_.points[i.key])&&s[y+"Stacker"](S,_,T)}))},h.prototype.percentStacker=function(i,s,o){s=s.total?100/s.total:0,i[0]=_(i[0]*s),i[1]=_(i[1]*s),this.stackedYData[o]=i[1]},h.prototype.getStackIndicator=function(i,s,o,h){return!S(i)||i.x!==s||h&&i.key!==h?i={x:s,index:0,key:h}:i.index++,i.key=[o,s,i.index].join(),i},o.StackItem=L,o.StackItem})),O(s,"Series/Line/LineSeries.js",[s["Core/Color/Palette.js"],s["Core/Series/Series.js"],s["Core/Series/SeriesRegistry.js"],s["Core/Utilities.js"]],(function(i,s,o,h){var v=this&&this.__extends||function(){var b=function(i,s){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var o in s)s.hasOwnProperty(o)&&(i[o]=s[o])})(i,s)};return function(i,s){function k(){this.constructor=i}b(i,s),i.prototype=null===s?Object.create(s):(k.prototype=s.prototype,new k)}}(),y=h.defined,_=h.merge;return h=function(o){function r(){var i=null!==o&&o.apply(this,arguments)||this;return i.data=void 0,i.options=void 0,i.points=void 0,i}return v(r,o),r.prototype.drawGraph=function(){var s=this,o=this.options,h=(this.gappedPath||this.getGraphPath).call(this),v=this.chart.styledMode,y=[["graph","highcharts-graph"]];v||y[0].push(o.lineColor||this.color||i.neutralColor20,o.dashStyle),(y=s.getZonesGraphs(y)).forEach((function(i,y){var _=i[0],S=s[_],T=S?"animate":"attr";S?(S.endX=s.preventGraphAnimation?null:h.xMap,S.animate({d:h})):h.length&&(s[_]=S=s.chart.renderer.path(h).addClass(i[1]).attr({zIndex:1}).add(s.group)),S&&!v&&(_={stroke:i[2],"stroke-width":o.lineWidth,fill:s.fillGraph&&s.color||"none"},i[3]?_.dashstyle=i[3]:"square"!==o.linecap&&(_["stroke-linecap"]=_["stroke-linejoin"]="round"),S[T](_).shadow(2>y&&o.shadow)),S&&(S.startX=h.xMap,S.isArea=h.isArea)}))},r.prototype.getGraphPath=function(i,s,o){var h,v,_=this,S=_.options,T=S.step,x=[],R=[];return(h=(i=i||_.points).reversed)&&i.reverse(),(T={right:1,center:2}[T]||T&&3)&&h&&(T=4-T),(i=this.getValidPoints(i,!1,!(S.connectNulls&&!s&&!o))).forEach((function(h,P){var L=h.plotX,N=h.plotY,V=i[P-1];(h.leftCliff||V&&V.rightCliff)&&!o&&(v=!0),h.isNull&&!y(s)&&0<P?v=!S.connectNulls:h.isNull&&!s?v=!0:(0===P||v?P=[["M",h.plotX,h.plotY]]:_.getPointSpline?P=[_.getPointSpline(i,h,P)]:T?(P=1===T?[["L",V.plotX,N]]:2===T?[["L",(V.plotX+L)/2,V.plotY],["L",(V.plotX+L)/2,N]]:[["L",L,V.plotY]]).push(["L",L,N]):P=[["L",L,N]],R.push(h.x),T&&(R.push(h.x),2===T&&R.push(h.x)),x.push.apply(x,P),v=!1)})),x.xMap=R,_.graphPath=x},r.prototype.getZonesGraphs=function(i){return this.zones.forEach((function(s,o){o=["zone-graph-"+o,"highcharts-graph highcharts-zone-graph-"+o+" "+(s.className||"")],this.chart.styledMode||o.push(s.color||this.color,s.dashStyle||this.options.dashStyle),i.push(o)}),this),i},r.defaultOptions=_(s.defaultOptions,{}),r}(s),o.registerSeriesType("line",h),h})),O(s,"Series/Area/AreaSeries.js",[s["Core/Color/Color.js"],s["Mixins/LegendSymbol.js"],s["Core/Series/SeriesRegistry.js"],s["Core/Utilities.js"]],(function(i,s,o,h){var v=this&&this.__extends||function(){var b=function(i,s){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var o in s)s.hasOwnProperty(o)&&(i[o]=s[o])})(i,s)};return function(i,s){function k(){this.constructor=i}b(i,s),i.prototype=null===s?Object.create(s):(k.prototype=s.prototype,new k)}}(),y=i.parse,_=o.seriesTypes.line;i=h.extend;var S=h.merge,T=h.objectEach,x=h.pick;return h=function(i){function e(){var s=null!==i&&i.apply(this,arguments)||this;return s.data=void 0,s.options=void 0,s.points=void 0,s}return v(e,i),e.prototype.drawGraph=function(){this.areaPath=[],i.prototype.drawGraph.apply(this);var s=this,o=this.areaPath,h=this.options,v=[["area","highcharts-area",this.color,h.fillColor]];this.zones.forEach((function(i,o){v.push(["zone-area-"+o,"highcharts-area highcharts-zone-area-"+o+" "+i.className,i.color||s.color,i.fillColor||h.fillColor])})),v.forEach((function(i){var v=i[0],_=s[v],S=_?"animate":"attr",T={};_?(_.endX=s.preventGraphAnimation?null:o.xMap,_.animate({d:o})):(T.zIndex=0,(_=s[v]=s.chart.renderer.path(o).addClass(i[1]).add(s.group)).isArea=!0),s.chart.styledMode||(T.fill=x(i[3],y(i[2]).setOpacity(x(h.fillOpacity,.75)).get())),_[S](T),_.startX=o.xMap,_.shiftUnit=h.step?2:1}))},e.prototype.getGraphPath=function(i){var s,o=_.prototype.getGraphPath,h=this.options,v=h.stacking,y=this.yAxis,S=[],T=[],R=this.index,P=y.stacking.stacks[this.stackKey],L=h.threshold,N=Math.round(y.getThreshold(h.threshold));h=x(h.connectNulls,"percent"===v);var a=function(s,o,h){var _=i[s];s=v&&P[_.x].points[R];var x=_[h+"Null"]||0;if(h=_[h+"Cliff"]||0,_=!0,h||x){var V=(x?s[0]:s[1])+h,W=s[0]+h;_=!!x}else!v&&i[o]&&i[o].isNull&&(V=W=L);void 0!==V&&(T.push({plotX:j,plotY:null===V?N:y.getThreshold(V),isNull:_,isCliff:!0}),S.push({plotX:j,plotY:null===W?N:y.getThreshold(W),doCurve:!1}))};for(i=i||this.points,v&&(i=this.getStackPoints(i)),s=0;s<i.length;s++){v||(i[s].leftCliff=i[s].rightCliff=i[s].leftNull=i[s].rightNull=void 0);var V=i[s].isNull,j=x(i[s].rectPlotX,i[s].plotX),W=v?x(i[s].yBottom,N):N;V&&!h||(h||a(s,s-1,"left"),V&&!v&&h||(T.push(i[s]),S.push({x:s,plotX:j,plotY:W})),h||a(s,s+1,"right"))}return s=o.call(this,T,!0,!0),S.reversed=!0,(W=(V=o.call(this,S,!0,!0))[0])&&"M"===W[0]&&(V[0]=["L",W[1],W[2]]),V=s.concat(V),o=o.call(this,T,!1,h),V.xMap=s.xMap,this.areaPath=V,o},e.prototype.getStackPoints=function(i){var s,o=[],h=[],v=this.xAxis,y=this.yAxis,_=y.stacking.stacks[this.stackKey],S={},R=this.index,P=y.series,L=P.length,N=x(y.options.reversedStacks,!0)?1:-1;if(i=i||this.points,this.options.stacking){for(s=0;s<i.length;s++)i[s].leftNull=i[s].rightNull=void 0,S[i[s].x]=i[s];T(_,(function(i,s){null!==i.total&&h.push(s)})),h.sort((function(i,s){return i-s}));var V=P.map((function(i){return i.visible}));h.forEach((function(i,T){var x,P,j=0;if(S[i]&&!S[i].isNull)o.push(S[i]),[-1,1].forEach((function(o){var v=1===o?"rightNull":"leftNull",y=0,j=_[h[T+o]];if(j)for(s=R;0<=s&&s<L;)(x=j.points[s])||(s===R?S[i][v]=!0:V[s]&&(P=_[i].points[s])&&(y-=P[1]-P[0])),s+=N;S[i][1===o?"rightCliff":"leftCliff"]=y}));else{for(s=R;0<=s&&s<L;){if(x=_[i].points[s]){j=x[1];break}s+=N}j=y.translate(j,0,1,0,1),o.push({isNull:!0,plotX:v.translate(i,0,0,0,1),x:i,plotY:j,yBottom:j})}}))}return o},e.defaultOptions=S(_.defaultOptions,{threshold:0}),e}(_),i(h.prototype,{singleStacks:!1,drawLegendSymbol:s.drawRectangle}),o.registerSeriesType("area",h),h})),O(s,"Series/Spline/SplineSeries.js",[s["Core/Series/SeriesRegistry.js"],s["Core/Utilities.js"]],(function(i,s){var o=this&&this.__extends||function(){var b=function(i,s){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var o in s)s.hasOwnProperty(o)&&(i[o]=s[o])})(i,s)};return function(i,s){function r(){this.constructor=i}b(i,s),i.prototype=null===s?Object.create(s):(r.prototype=s.prototype,new r)}}(),h=i.seriesTypes.line,v=s.merge,y=s.pick;return s=function(i){function e(){var s=null!==i&&i.apply(this,arguments)||this;return s.data=void 0,s.options=void 0,s.points=void 0,s}return o(e,i),e.prototype.getPointSpline=function(i,s,o){var h=s.plotX||0,v=s.plotY||0,_=i[o-1];if(o=i[o+1],_&&!_.isNull&&!1!==_.doCurve&&!s.isCliff&&o&&!o.isNull&&!1!==o.doCurve&&!s.isCliff){i=_.plotY||0;var S=o.plotX||0;o=o.plotY||0;var T=0,x=(1.5*h+(_.plotX||0))/2.5,R=(1.5*v+i)/2.5,P=(1.5*v+o)/2.5;(S=(1.5*h+S)/2.5)!==x&&(T=(P-R)*(S-h)/(S-x)+v-P),P+=T,(R+=T)>i&&R>v?P=2*v-(R=Math.max(i,v)):R<i&&R<v&&(P=2*v-(R=Math.min(i,v))),P>o&&P>v?R=2*v-(P=Math.max(o,v)):P<o&&P<v&&(R=2*v-(P=Math.min(o,v))),s.rightContX=S,s.rightContY=P}return s=["C",y(_.rightContX,_.plotX,0),y(_.rightContY,_.plotY,0),y(x,h,0),y(R,v,0),h,v],_.rightContX=_.rightContY=void 0,s},e.defaultOptions=v(h.defaultOptions),e}(h),i.registerSeriesType("spline",s),s})),O(s,"Series/AreaSpline/AreaSplineSeries.js",[s["Series/Area/AreaSeries.js"],s["Series/Spline/SplineSeries.js"],s["Mixins/LegendSymbol.js"],s["Core/Series/SeriesRegistry.js"],s["Core/Utilities.js"]],(function(i,s,o,h,v){var y=this&&this.__extends||function(){var b=function(i,s){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var o in s)s.hasOwnProperty(o)&&(i[o]=s[o])})(i,s)};return function(i,s){function g(){this.constructor=i}b(i,s),i.prototype=null===s?Object.create(s):(g.prototype=s.prototype,new g)}}(),_=i.prototype,S=v.extend,T=v.merge;return S((v=function(o){function k(){var i=null!==o&&o.apply(this,arguments)||this;return i.data=void 0,i.points=void 0,i.options=void 0,i}return y(k,o),k.defaultOptions=T(s.defaultOptions,i.defaultOptions),k}(s)).prototype,{getGraphPath:_.getGraphPath,getStackPoints:_.getStackPoints,drawGraph:_.drawGraph,drawLegendSymbol:o.drawRectangle}),h.registerSeriesType("areaspline",v),v})),O(s,"Series/Column/ColumnSeries.js",[s["Core/Animation/AnimationUtilities.js"],s["Core/Color/Color.js"],s["Core/Globals.js"],s["Mixins/LegendSymbol.js"],s["Core/Color/Palette.js"],s["Core/Series/Series.js"],s["Core/Series/SeriesRegistry.js"],s["Core/Utilities.js"]],(function(i,s,o,h,v,y,_,S){var T=this&&this.__extends||function(){var b=function(i,s){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var o in s)s.hasOwnProperty(o)&&(i[o]=s[o])})(i,s)};return function(i,s){function c(){this.constructor=i}b(i,s),i.prototype=null===s?Object.create(s):(c.prototype=s.prototype,new c)}}(),x=i.animObject,R=s.parse,P=o.hasTouch;i=o.noop;var L=S.clamp,N=S.css,V=S.defined,j=S.extend,W=S.fireEvent,K=S.isArray,U=S.isNumber,Y=S.merge,$=S.pick,X=S.objectEach;return S=function(i){function d(){var s=null!==i&&i.apply(this,arguments)||this;return s.borderWidth=void 0,s.data=void 0,s.group=void 0,s.options=void 0,s.points=void 0,s}return T(d,i),d.prototype.animate=function(i){var s=this,o=this.yAxis,h=s.options,v=this.chart.inverted,y={},_=v?"translateX":"translateY";if(i)y.scaleY=.001,i=L(o.toPixels(h.threshold),o.pos,o.pos+o.len),v?y.translateX=i-o.len:y.translateY=i,s.clipBox&&s.setClip(),s.group.attr(y);else{var S=s.group.attr(_);s.group.animate({scaleY:1},j(x(s.options.animation),{step:function(i,h){s.group&&(y[_]=S+h.pos*(o.pos-S),s.group.attr(y))}}))}},d.prototype.init=function(s,o){i.prototype.init.apply(this,arguments);var h=this;(s=h.chart).hasRendered&&s.series.forEach((function(i){i.type===h.type&&(i.isDirty=!0)}))},d.prototype.getColumnMetrics=function(){var i=this,s=i.options,o=i.xAxis,h=i.yAxis,v=o.options.reversedStacks;v=o.reversed&&!v||!o.reversed&&v;var y,_={},S=0;!1===s.grouping?S=1:i.chart.series.forEach((function(s){var o=s.yAxis,v=s.options;if(s.type===i.type&&(s.visible||!i.chart.options.chart.ignoreHiddenSeries)&&h.len===o.len&&h.pos===o.pos){if(v.stacking&&"group"!==v.stacking){y=s.stackKey,void 0===_[y]&&(_[y]=S++);var T=_[y]}else!1!==v.grouping&&(T=S++);s.columnIndex=T}}));var T=Math.min(Math.abs(o.transA)*(o.ordinal&&o.ordinal.slope||s.pointRange||o.closestPointRange||o.tickInterval||1),o.len),x=T*s.groupPadding,R=(T-2*x)/(S||1);return s=Math.min(s.maxPointWidth||o.len,$(s.pointWidth,R*(1-2*s.pointPadding))),i.columnMetrics={width:s,offset:(R-s)/2+(x+((i.columnIndex||0)+(v?1:0))*R-T/2)*(v?-1:1),paddedWidth:R,columnCount:S},i.columnMetrics},d.prototype.crispCol=function(i,s,o,h){var v=this.chart,y=this.borderWidth,_=-(y%2?.5:0);return y=y%2?.5:1,v.inverted&&v.renderer.isVML&&(y+=1),this.options.crisp&&(o=Math.round(i+o)+_,o-=i=Math.round(i)+_),h=Math.round(s+h)+y,_=.5>=Math.abs(s)&&.5<h,h-=s=Math.round(s)+y,_&&h&&(--s,h+=1),{x:i,y:s,width:o,height:h}},d.prototype.adjustForMissingColumns=function(i,s,o,h){var v=this,y=this.options.stacking;if(!o.isNull&&1<h.columnCount){var _=0,S=0;X(this.yAxis.stacking&&this.yAxis.stacking.stacks,(function(i){if("number"==typeof o.x&&(i=i[o.x.toString()])){var s=i.points[v.index],h=i.total;y?(s&&(_=S),i.hasValidPoints&&S++):K(s)&&(_=s[1],S=h||0)}})),i=(o.plotX||0)+((S-1)*h.paddedWidth+s)/2-s-_*h.paddedWidth}return i},d.prototype.translate=function(){var i=this,s=i.chart,o=i.options,h=i.dense=2>i.closestPointRange*i.xAxis.transA;h=i.borderWidth=$(o.borderWidth,h?0:1);var v=i.xAxis,_=i.yAxis,S=o.threshold,T=i.translatedThreshold=_.getThreshold(S),x=$(o.minPointLength,5),R=i.getColumnMetrics(),P=R.width,N=i.barW=Math.max(P,1+2*h),j=i.pointXOffset=R.offset,W=i.dataMin,K=i.dataMax;s.inverted&&(T-=.5),o.pointPadding&&(N=Math.ceil(N)),y.prototype.translate.apply(i),i.points.forEach((function(h){var y=$(h.yBottom,T),Y=999+Math.abs(y),X=P,Z=h.plotX||0;Y=L(h.plotY,-Y,_.len+Y);var ee=Z+j,te=N,ie=Math.min(Y,y),ae=Math.max(Y,y)-ie;if(x&&Math.abs(ae)<x){ae=x;var ne=!_.reversed&&!h.negative||_.reversed&&h.negative;U(S)&&U(K)&&h.y===S&&K<=S&&(_.min||0)<S&&(W!==K||(_.max||0)<=S)&&(ne=!ne),ie=Math.abs(ie-T)>x?y-x:T-(ne?x:0)}V(h.options.pointWidth)&&(X=te=Math.ceil(h.options.pointWidth),ee-=Math.round((X-P)/2)),o.centerInCategory&&(ee=i.adjustForMissingColumns(ee,X,h,R)),h.barX=ee,h.pointWidth=X,h.tooltipPos=s.inverted?[L(_.len+_.pos-s.plotLeft-Y,_.pos-s.plotLeft,_.len+_.pos-s.plotLeft),v.len+v.pos-s.plotTop-(Z||0)-j-te/2,ae]:[v.left-s.plotLeft+ee+te/2,L(Y+_.pos-s.plotTop,_.pos-s.plotTop,_.len+_.pos-s.plotTop),ae],h.shapeType=i.pointClass.prototype.shapeType||"rect",h.shapeArgs=i.crispCol.apply(i,h.isNull?[ee,T,te,0]:[ee,ie,te,ae])}))},d.prototype.drawGraph=function(){this.group[this.dense?"addClass":"removeClass"]("highcharts-dense-data")},d.prototype.pointAttribs=function(i,s){var o=this.options,h=this.pointAttrToOptions||{},v=h.stroke||"borderColor",y=h["stroke-width"]||"borderWidth",_=i&&i.color||this.color,S=i&&i[v]||o[v]||this.color||_,T=i&&i[y]||o[y]||this[y]||0;h=i&&i.options.dashStyle||o.dashStyle;var x=$(i&&i.opacity,o.opacity,1);if(i&&this.zones.length){var P=i.getZone();_=i.options.color||P&&(P.color||i.nonZonedColor)||this.color,P&&(S=P.borderColor||S,h=P.dashStyle||h,T=P.borderWidth||T)}return s&&i&&(s=(i=Y(o.states[s],i.options.states&&i.options.states[s]||{})).brightness,_=i.color||void 0!==s&&R(_).brighten(i.brightness).get()||_,S=i[v]||S,T=i[y]||T,h=i.dashStyle||h,x=$(i.opacity,x)),v={fill:_,stroke:S,"stroke-width":T,opacity:x},h&&(v.dashstyle=h),v},d.prototype.drawPoints=function(){var i,s=this,o=this.chart,h=s.options,v=o.renderer,y=h.animationLimit||250;s.points.forEach((function(_){var S=_.graphic,T=!!S,x=S&&o.pointCount<y?"animate":"attr";U(_.plotY)&&null!==_.y?(i=_.shapeArgs,S&&_.hasNewShapeType()&&(S=S.destroy()),s.enabledDataSorting&&(_.startXPos=s.xAxis.reversed?-(i?i.width:0):s.xAxis.width),S||(_.graphic=S=v[_.shapeType](i).add(_.group||s.group))&&s.enabledDataSorting&&o.hasRendered&&o.pointCount<y&&(S.attr({x:_.startXPos}),T=!0,x="animate"),S&&T&&S[x](Y(i)),h.borderRadius&&S[x]({r:h.borderRadius}),o.styledMode||S[x](s.pointAttribs(_,_.selected&&"select")).shadow(!1!==_.allowShadow&&h.shadow,null,h.stacking&&!h.borderRadius),S&&(S.addClass(_.getClassName(),!0),S.attr({visibility:_.visible?"inherit":"hidden"}))):S&&(_.graphic=S.destroy())}))},d.prototype.drawTracker=function(){var i,s=this,o=s.chart,h=o.pointer,f=function(i){var s=h.getPointFromEvent(i);void 0!==s&&(h.isDirectTouch=!0,s.onMouseOver(i))};s.points.forEach((function(s){i=K(s.dataLabels)?s.dataLabels:s.dataLabel?[s.dataLabel]:[],s.graphic&&(s.graphic.element.point=s),i.forEach((function(i){i.div?i.div.point=s:i.element.point=s}))})),s._hasTracking||(s.trackerGroups.forEach((function(i){s[i]&&(s[i].addClass("highcharts-tracker").on("mouseover",f).on("mouseout",(function(i){h.onTrackerMouseOut(i)})),P&&s[i].on("touchstart",f),!o.styledMode&&s.options.cursor&&s[i].css(N).css({cursor:s.options.cursor}))})),s._hasTracking=!0),W(this,"afterDrawTracker")},d.prototype.remove=function(){var i=this,s=i.chart;s.hasRendered&&s.series.forEach((function(s){s.type===i.type&&(s.isDirty=!0)})),y.prototype.remove.apply(i,arguments)},d.defaultOptions=Y(y.defaultOptions,{borderRadius:0,centerInCategory:!1,groupPadding:.2,marker:null,pointPadding:.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{halo:!1,brightness:.1},select:{color:v.neutralColor20,borderColor:v.neutralColor100}},dataLabels:{align:void 0,verticalAlign:void 0,y:void 0},startFromThreshold:!0,stickyTracking:!1,tooltip:{distance:6},threshold:0,borderColor:v.backgroundColor}),d}(y),j(S.prototype,{cropShoulder:0,directTouch:!0,drawLegendSymbol:h.drawRectangle,getSymbol:i,negStacks:!0,trackerGroups:["group","dataLabelsGroup"]}),_.registerSeriesType("column",S),S})),O(s,"Series/Bar/BarSeries.js",[s["Series/Column/ColumnSeries.js"],s["Core/Series/SeriesRegistry.js"],s["Core/Utilities.js"]],(function(i,s,o){var h=this&&this.__extends||function(){var b=function(i,s){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var o in s)s.hasOwnProperty(o)&&(i[o]=s[o])})(i,s)};return function(i,s){function r(){this.constructor=i}b(i,s),i.prototype=null===s?Object.create(s):(r.prototype=s.prototype,new r)}}(),v=o.extend,y=o.merge;return v((o=function(s){function l(){var i=null!==s&&s.apply(this,arguments)||this;return i.data=void 0,i.options=void 0,i.points=void 0,i}return h(l,s),l.defaultOptions=y(i.defaultOptions,{}),l}(i)).prototype,{inverted:!0}),s.registerSeriesType("bar",o),o})),O(s,"Series/Scatter/ScatterSeries.js",[s["Series/Column/ColumnSeries.js"],s["Series/Line/LineSeries.js"],s["Core/Series/SeriesRegistry.js"],s["Core/Utilities.js"]],(function(i,s,o,h){var v=this&&this.__extends||function(){var b=function(i,s){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var o in s)s.hasOwnProperty(o)&&(i[o]=s[o])})(i,s)};return function(i,s){function l(){this.constructor=i}b(i,s),i.prototype=null===s?Object.create(s):(l.prototype=s.prototype,new l)}}(),y=h.addEvent,_=h.extend,S=h.merge;return _((h=function(i){function l(){var s=null!==i&&i.apply(this,arguments)||this;return s.data=void 0,s.options=void 0,s.points=void 0,s}return v(l,i),l.prototype.applyJitter=function(){var i=this,s=this.options.jitter,o=this.points.length;s&&this.points.forEach((function(h,v){["x","y"].forEach((function(y,_){var S="plot"+y.toUpperCase();if(s[y]&&!h.isNull){var T=i[y+"Axis"],x=s[y]*T.transA;if(T&&!T.isLog){var R=Math.max(0,h[S]-x);T=Math.min(T.len,h[S]+x),_=1e4*Math.sin(v+_*o),h[S]=R+(T-R)*(_-Math.floor(_)),"x"===y&&(h.clientX=h.plotX)}}}))}))},l.prototype.drawGraph=function(){(this.options.lineWidth||0===this.options.lineWidth&&this.graph&&this.graph.strokeWidth())&&i.prototype.drawGraph.call(this)},l.defaultOptions=S(s.defaultOptions,{lineWidth:0,findNearestPointBy:"xy",jitter:{x:0,y:0},marker:{enabled:!0},tooltip:{headerFormat:'<span style="color:{point.color}">●</span> <span style="font-size: 10px"> {series.name}</span><br/>',pointFormat:"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>"}}),l}(s)).prototype,{drawTracker:i.prototype.drawTracker,sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1}),y(h,"afterTranslate",(function(){this.applyJitter()})),o.registerSeriesType("scatter",h),h})),O(s,"Mixins/CenteredSeries.js",[s["Core/Globals.js"],s["Core/Series/Series.js"],s["Core/Utilities.js"]],(function(i,s,o){var h=o.isNumber,v=o.pick,y=o.relativeLength,_=i.deg2rad;return i.CenteredSeriesMixin={getCenter:function(){var i=this.options,o=this.chart,h=2*(i.slicedOffset||0),_=o.plotWidth-2*h,S=o.plotHeight-2*h,T=i.center,x=Math.min(_,S),R=i.size,P=i.innerSize||0;for("string"==typeof R&&(R=parseFloat(R)),"string"==typeof P&&(P=parseFloat(P)),i=[v(T[0],"50%"),v(T[1],"50%"),v(R&&0>R?void 0:i.size,"100%"),v(P&&0>P?void 0:i.innerSize||0,"0%")],!o.angular||this instanceof s||(i[3]=0),T=0;4>T;++T)R=i[T],o=2>T||2===T&&/%$/.test(R),i[T]=y(R,[_,S,x,i[2]][T])+(o?h:0);return i[3]>i[2]&&(i[3]=i[2]),i},getStartAndEndRadians:function(i,s){return i=h(i)?i:0,s=h(s)&&s>i&&360>s-i?s:i+360,{start:_*(i+-90),end:_*(s+-90)}}}})),O(s,"Series/Pie/PiePoint.js",[s["Core/Animation/AnimationUtilities.js"],s["Core/Series/Point.js"],s["Core/Utilities.js"]],(function(i,s,o){var h=this&&this.__extends||function(){var b=function(i,s){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var o in s)s.hasOwnProperty(o)&&(i[o]=s[o])})(i,s)};return function(i,s){function k(){this.constructor=i}b(i,s),i.prototype=null===s?Object.create(s):(k.prototype=s.prototype,new k)}}(),v=i.setAnimation,y=o.addEvent,_=o.defined;i=o.extend;var S=o.isNumber,T=o.pick,x=o.relativeLength;return o=function(i){function k(){var s=null!==i&&i.apply(this,arguments)||this;return s.labelDistance=void 0,s.options=void 0,s.series=void 0,s}return h(k,i),k.prototype.getConnectorPath=function(){var i=this.labelPosition,s=this.series.options.dataLabels,o=s.connectorShape,h=this.connectorShapes;return h[o]&&(o=h[o]),o.call(this,{x:i.final.x,y:i.final.y,alignment:i.alignment},i.connectorPosition,s)},k.prototype.getTranslate=function(){return this.sliced?this.slicedTranslation:{translateX:0,translateY:0}},k.prototype.haloPath=function(i){var s=this.shapeArgs;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(s.x,s.y,s.r+i,s.r+i,{innerR:s.r-1,start:s.start,end:s.end})},k.prototype.init=function(){s.prototype.init.apply(this,arguments);var i=this;i.name=T(i.name,"Slice");var k=function(s){i.slice("select"===s.type)};return y(i,"select",k),y(i,"unselect",k),i},k.prototype.isValid=function(){return S(this.y)&&0<=this.y},k.prototype.setVisible=function(i,s){var o=this,h=o.series,v=h.chart,y=h.options.ignoreHiddenPoint;s=T(s,y),i!==o.visible&&(o.visible=o.options.visible=i=void 0===i?!o.visible:i,h.options.data[h.data.indexOf(o)]=o.options,["graphic","dataLabel","connector","shadowGroup"].forEach((function(s){o[s]&&o[s][i?"show":"hide"](i)})),o.legendItem&&v.legend.colorizeItem(o,i),i||"hover"!==o.state||o.setState(""),y&&(h.isDirty=!0),s&&v.redraw())},k.prototype.slice=function(i,s,o){var h=this.series;v(o,h.chart),T(s,!0),this.sliced=this.options.sliced=_(i)?i:!this.sliced,h.options.data[h.data.indexOf(this)]=this.options,this.graphic&&this.graphic.animate(this.getTranslate()),this.shadowGroup&&this.shadowGroup.animate(this.getTranslate())},k}(s),i(o.prototype,{connectorShapes:{fixedOffset:function(i,s,o){var h=s.breakAt;return s=s.touchingSliceAt,[["M",i.x,i.y],o.softConnector?["C",i.x+("left"===i.alignment?-5:5),i.y,2*h.x-s.x,2*h.y-s.y,h.x,h.y]:["L",h.x,h.y],["L",s.x,s.y]]},straight:function(i,s){return s=s.touchingSliceAt,[["M",i.x,i.y],["L",s.x,s.y]]},crookedLine:function(i,s,o){s=s.touchingSliceAt;var h=this.series,v=h.center[0],y=h.chart.plotWidth,_=h.chart.plotLeft;h=i.alignment;var S=this.shapeArgs.r;return o=x(o.crookDistance,1),o=["L",y="left"===h?v+S+(y+_-v-S)*(1-o):_+(v-S)*o,i.y],v=!0,("left"===h?y>i.x||y<s.x:y<i.x||y>s.x)&&(v=!1),i=[["M",i.x,i.y]],v&&i.push(o),i.push(["L",s.x,s.y]),i}}}),o})),O(s,"Series/Pie/PieSeries.js",[s["Mixins/CenteredSeries.js"],s["Series/Column/ColumnSeries.js"],s["Core/Globals.js"],s["Mixins/LegendSymbol.js"],s["Core/Color/Palette.js"],s["Series/Pie/PiePoint.js"],s["Core/Series/Series.js"],s["Core/Series/SeriesRegistry.js"],s["Core/Renderer/SVG/SVGRenderer.js"],s["Core/Utilities.js"]],(function(i,s,o,h,v,y,_,S,T,x){var R=this&&this.__extends||function(){var b=function(i,s){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var o in s)s.hasOwnProperty(o)&&(i[o]=s[o])})(i,s)};return function(i,s){function g(){this.constructor=i}b(i,s),i.prototype=null===s?Object.create(s):(g.prototype=s.prototype,new g)}}(),P=i.getStartAndEndRadians;o=o.noop;var L=x.clamp,N=x.extend,V=x.fireEvent,j=x.merge,W=x.pick,K=x.relativeLength;return N((x=function(i){function e(){var s=null!==i&&i.apply(this,arguments)||this;return s.center=void 0,s.data=void 0,s.maxLabelDistance=void 0,s.options=void 0,s.points=void 0,s}return R(e,i),e.prototype.animate=function(i){var s=this,o=s.points,h=s.startAngleRad;i||o.forEach((function(i){var o=i.graphic,v=i.shapeArgs;o&&v&&(o.attr({r:W(i.startR,s.center&&s.center[3]/2),start:h,end:h}),o.animate({r:v.r,start:v.start,end:v.end},s.options.animation))}))},e.prototype.drawEmpty=function(){var i=this.startAngleRad,s=this.endAngleRad,o=this.options;if(0===this.total&&this.center){var h=this.center[0],y=this.center[1];this.graph||(this.graph=this.chart.renderer.arc(h,y,this.center[1]/2,0,i,s).addClass("highcharts-empty-series").add(this.group)),this.graph.attr({d:T.prototype.symbols.arc(h,y,this.center[2]/2,0,{start:i,end:s,innerR:this.center[3]/2})}),this.chart.styledMode||this.graph.attr({"stroke-width":o.borderWidth,fill:o.fillColor||"none",stroke:o.color||v.neutralColor20})}else this.graph&&(this.graph=this.graph.destroy())},e.prototype.drawPoints=function(){var i=this.chart.renderer;this.points.forEach((function(s){s.graphic&&s.hasNewShapeType()&&(s.graphic=s.graphic.destroy()),s.graphic||(s.graphic=i[s.shapeType](s.shapeArgs).add(s.series.group),s.delayedRendering=!0)}))},e.prototype.generatePoints=function(){i.prototype.generatePoints.call(this),this.updateTotals()},e.prototype.getX=function(i,s,o){var h=this.center,v=this.radii?this.radii[o.index]||0:h[2]/2;return i=Math.asin(L((i-h[1])/(v+o.labelDistance),-1,1)),h[0]+(s?-1:1)*Math.cos(i)*(v+o.labelDistance)+(0<o.labelDistance?(s?-1:1)*this.options.dataLabels.padding:0)},e.prototype.hasData=function(){return!!this.processedXData.length},e.prototype.redrawPoints=function(){var i,s,o,h,v=this,y=v.chart,_=y.renderer,S=v.options.shadow;this.drawEmpty(),!S||v.shadowGroup||y.styledMode||(v.shadowGroup=_.g("shadow").attr({zIndex:-1}).add(v.group)),v.points.forEach((function(T){var x={};if(s=T.graphic,!T.isNull&&s){if(h=T.shapeArgs,i=T.getTranslate(),!y.styledMode){var R=T.shadowGroup;S&&!R&&(R=T.shadowGroup=_.g("shadow").add(v.shadowGroup)),R&&R.attr(i),o=v.pointAttribs(T,T.selected&&"select")}T.delayedRendering?(s.setRadialReference(v.center).attr(h).attr(i),y.styledMode||s.attr(o).attr({"stroke-linejoin":"round"}).shadow(S,R),T.delayedRendering=!1):(s.setRadialReference(v.center),y.styledMode||j(!0,x,o),j(!0,x,h,i),s.animate(x)),s.attr({visibility:T.visible?"inherit":"hidden"}),s.addClass(T.getClassName(),!0)}else s&&(T.graphic=s.destroy())}))},e.prototype.sortByAngle=function(i,s){i.sort((function(i,o){return void 0!==i.angle&&(o.angle-i.angle)*s}))},e.prototype.translate=function(i){this.generatePoints();var s=0,o=this.options,h=o.slicedOffset,v=h+(o.borderWidth||0),y=P(o.startAngle,o.endAngle),_=this.startAngleRad=y.start;y=(this.endAngleRad=y.end)-_;var S=this.points,T=o.dataLabels.distance;o=o.ignoreHiddenPoint;var x,R=S.length;for(i||(this.center=i=this.getCenter()),x=0;x<R;x++){var L=S[x],N=_+s*y;!L.isValid()||o&&!L.visible||(s+=L.percentage/100);var j=_+s*y;L.shapeType="arc",L.shapeArgs={x:i[0],y:i[1],r:i[2]/2,innerR:i[3]/2,start:Math.round(1e3*N)/1e3,end:Math.round(1e3*j)/1e3},L.labelDistance=W(L.options.dataLabels&&L.options.dataLabels.distance,T),L.labelDistance=K(L.labelDistance,L.shapeArgs.r),this.maxLabelDistance=Math.max(this.maxLabelDistance||0,L.labelDistance),(j=(j+N)/2)>1.5*Math.PI?j-=2*Math.PI:j<-Math.PI/2&&(j+=2*Math.PI),L.slicedTranslation={translateX:Math.round(Math.cos(j)*h),translateY:Math.round(Math.sin(j)*h)};var U=Math.cos(j)*i[2]/2,Y=Math.sin(j)*i[2]/2;L.tooltipPos=[i[0]+.7*U,i[1]+.7*Y],L.half=j<-Math.PI/2||j>Math.PI/2?1:0,L.angle=j,N=Math.min(v,L.labelDistance/5),L.labelPosition={natural:{x:i[0]+U+Math.cos(j)*L.labelDistance,y:i[1]+Y+Math.sin(j)*L.labelDistance},final:{},alignment:0>L.labelDistance?"center":L.half?"right":"left",connectorPosition:{breakAt:{x:i[0]+U+Math.cos(j)*N,y:i[1]+Y+Math.sin(j)*N},touchingSliceAt:{x:i[0]+U,y:i[1]+Y}}}}V(this,"afterTranslate")},e.prototype.updateTotals=function(){var i,s=0,o=this.points,h=o.length,v=this.options.ignoreHiddenPoint;for(i=0;i<h;i++){var y=o[i];!y.isValid()||v&&!y.visible||(s+=y.y)}for(this.total=s,i=0;i<h;i++)(y=o[i]).percentage=0<s&&(y.visible||!v)?y.y/s*100:0,y.total=s},e.defaultOptions=j(_.defaultOptions,{center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{allowOverlap:!0,connectorPadding:5,connectorShape:"fixedOffset",crookDistance:"70%",distance:30,enabled:!0,formatter:function(){return this.point.isNull?void 0:this.point.name},softConnector:!0,x:0},fillColor:void 0,ignoreHiddenPoint:!0,inactiveOtherPoints:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,stickyTracking:!1,tooltip:{followPointer:!0},borderColor:v.backgroundColor,borderWidth:1,lineWidth:void 0,states:{hover:{brightness:.1}}}),e}(_)).prototype,{axisTypes:[],directTouch:!0,drawGraph:null,drawLegendSymbol:h.drawRectangle,drawTracker:s.prototype.drawTracker,getCenter:i.getCenter,getSymbol:o,isCartesian:!1,noSharedTooltip:!0,pointAttribs:s.prototype.pointAttribs,pointClass:y,requireSorting:!1,searchPoint:o,trackerGroups:["group","dataLabelsGroup"]}),S.registerSeriesType("pie",x),x})),O(s,"Core/Series/DataLabels.js",[s["Core/Animation/AnimationUtilities.js"],s["Core/Globals.js"],s["Core/Color/Palette.js"],s["Core/Series/Series.js"],s["Core/Series/SeriesRegistry.js"],s["Core/Utilities.js"]],(function(i,s,o,h,v,y){var _=i.getDeferredAnimation;i=s.noop,v=v.seriesTypes;var S=y.arrayMax,T=y.clamp,x=y.defined,R=y.extend,P=y.fireEvent,L=y.format,N=y.isArray,V=y.merge,j=y.objectEach,W=y.pick,K=y.relativeLength,U=y.splat,Y=y.stableSort;s.distribute=function(i,o,h){function g(i,s){return i.target-s.target}var v,y=!0,_=i,S=[],x=0,R=_.reducedLen||o;for(v=i.length;v--;)x+=i[v].size;if(x>R){for(Y(i,(function(i,s){return(s.rank||0)-(i.rank||0)})),x=v=0;x<=R;)x+=i[v].size,v++;S=i.splice(v-1,i.length)}for(Y(i,g),i=i.map((function(i){return{size:i.size,targets:[i.target],align:W(i.align,.5)}}));y;){for(v=i.length;v--;)y=i[v],x=(Math.min.apply(0,y.targets)+Math.max.apply(0,y.targets))/2,y.pos=T(x-y.size*y.align,0,o-y.size);for(v=i.length,y=!1;v--;)0<v&&i[v-1].pos+i[v-1].size>i[v].pos&&(i[v-1].size+=i[v].size,i[v-1].targets=i[v-1].targets.concat(i[v].targets),i[v-1].align=.5,i[v-1].pos+i[v-1].size>o&&(i[v-1].pos=o-i[v-1].size),i.splice(v,1),y=!0)}_.push.apply(_,S),v=0,i.some((function(i){var y=0;if(i.targets.some((function(){if(_[v].pos=i.pos+y,void 0!==h&&Math.abs(_[v].pos-_[v].target)>h)return _.slice(0,v+1).forEach((function(i){delete i.pos})),_.reducedLen=(_.reducedLen||o)-.1*o,_.reducedLen>.1*o&&s.distribute(_,o,h),!0;y+=_[v].size,v++})))return!0})),Y(_,g)},h.prototype.drawDataLabels=function(){function e(i,s){var o,h=[];if(N(i)&&!N(s))h=i.map((function(i){return V(i,s)}));else if(N(s)&&!N(i))h=s.map((function(s){return V(i,s)}));else if(N(i)||N(s))for(o=Math.max(i.length,s.length);o--;)h[o]=V(i[o],s[o]);else h=V(i,s);return h}var i=this,s=i.chart,h=i.options,v=h.dataLabels,y=i.points,S=i.hasRendered||0,T=v.animation;T=v.defer?_(s,T,i):{defer:0,duration:0};var R=s.renderer;if(v=e(e(s.options.plotOptions&&s.options.plotOptions.series&&s.options.plotOptions.series.dataLabels,s.options.plotOptions&&s.options.plotOptions[i.type]&&s.options.plotOptions[i.type].dataLabels),v),P(this,"drawDataLabels"),N(v)||v.enabled||i._hasPointLabels){var K=i.plotGroup("dataLabelsGroup","data-labels",S?"inherit":"hidden",v.zIndex||6);K.attr({opacity:+S}),!S&&(S=i.dataLabelsGroup)&&(i.visible&&K.show(!0),S[h.animation?"animate":"attr"]({opacity:1},T)),y.forEach((function(y){U(e(v,y.dlOptions||y.options&&y.options.dataLabels)).forEach((function(v,_){var S=v.enabled&&(!y.isNull||y.dataLabelOnNull)&&function b(i,s){var o=s.filter;return!o||(s=o.operator,i=i[o.property],o=o.value,">"===s&&i>o||"<"===s&&i<o||">="===s&&i>=o||"<="===s&&i<=o||"=="===s&&i==o||"==="===s&&i===o)}(y,v),T=y.dataLabels?y.dataLabels[_]:y.dataLabel,P=y.connectors?y.connectors[_]:y.connector,N=W(v.distance,y.labelDistance),V=!T;if(S){var U=y.getLabelConfig(),Y=W(v[y.formatPrefix+"Format"],v.format);U=x(Y)?L(Y,U,s):(v[y.formatPrefix+"Formatter"]||v.formatter).call(U,v),Y=v.style;var $=v.rotation;s.styledMode||(Y.color=W(v.color,Y.color,i.color,o.neutralColor100),"contrast"===Y.color?(y.contrastColor=R.getContrast(y.color||i.color),Y.color=!x(N)&&v.inside||0>N||h.stacking?y.contrastColor:o.neutralColor100):delete y.contrastColor,h.cursor&&(Y.cursor=h.cursor));var X={r:v.borderRadius||0,rotation:$,padding:v.padding,zIndex:1};s.styledMode||(X.fill=v.backgroundColor,X.stroke=v.borderColor,X["stroke-width"]=v.borderWidth),j(X,(function(i,s){void 0===i&&delete X[s]}))}!T||S&&x(U)?S&&x(U)&&(T?X.text=U:(y.dataLabels=y.dataLabels||[],T=y.dataLabels[_]=$?R.text(U,0,-9999,v.useHTML).addClass("highcharts-data-label"):R.label(U,0,-9999,v.shape,null,null,v.useHTML,null,"data-label"),_||(y.dataLabel=T),T.addClass(" highcharts-data-label-color-"+y.colorIndex+" "+(v.className||"")+(v.useHTML?" highcharts-tracker":""))),T.options=v,T.attr(X),s.styledMode||T.css(Y).shadow(v.shadow),T.added||T.add(K),v.textPath&&!v.useHTML&&(T.setTextPath(y.getDataLabelPath&&y.getDataLabelPath(T)||y.graphic,v.textPath),y.dataLabelPath&&!v.textPath.enabled&&(y.dataLabelPath=y.dataLabelPath.destroy())),i.alignDataLabel(y,T,v,null,V)):(y.dataLabel=y.dataLabel&&y.dataLabel.destroy(),y.dataLabels&&(1===y.dataLabels.length?delete y.dataLabels:delete y.dataLabels[_]),_||delete y.dataLabel,P&&(y.connector=y.connector.destroy(),y.connectors&&(1===y.connectors.length?delete y.connectors:delete y.connectors[_])))}))}))}P(this,"afterDrawDataLabels")},h.prototype.alignDataLabel=function(i,s,o,h,v){var y=this,_=this.chart,S=this.isCartesian&&_.inverted,T=this.enabledDataSorting,x=W(i.dlBox&&i.dlBox.centerX,i.plotX,-9999),P=W(i.plotY,-9999),L=s.getBBox(),N=o.rotation,V=o.align,j=_.isInsidePlot(x,Math.round(P),S),K="justify"===W(o.overflow,T?"none":"justify"),U=this.visible&&!1!==i.visible&&(i.series.forceDL||T&&!K||j||o.inside&&h&&_.isInsidePlot(x,S?h.x+1:h.y+h.height-1,S)),z=function(o){T&&y.xAxis&&!K&&y.setDataLabelStartPos(i,s,v,j,o)};if(U){var Y=_.renderer.fontMetrics(_.styledMode?void 0:o.style.fontSize,s).b;h=R({x:S?this.yAxis.len-P:x,y:Math.round(S?this.xAxis.len-x:P),width:0,height:0},h),R(o,{width:L.width,height:L.height}),N?(K=!1,x=_.renderer.rotCorr(Y,N),z(x={x:h.x+(o.x||0)+h.width/2+x.x,y:h.y+(o.y||0)+{top:0,middle:.5,bottom:1}[o.verticalAlign]*h.height}),s[v?"attr":"animate"](x).attr({align:V}),z=180<(z=(N+720)%360)&&360>z,"left"===V?x.y-=z?L.height:0:"center"===V?(x.x-=L.width/2,x.y-=L.height/2):"right"===V&&(x.x-=L.width,x.y-=z?0:L.height),s.placed=!0,s.alignAttr=x):(z(h),s.align(o,null,h),x=s.alignAttr),K&&0<=h.height?this.justifyDataLabel(s,o,x,L,h,v):W(o.crop,!0)&&(U=_.isInsidePlot(x.x,x.y)&&_.isInsidePlot(x.x+L.width,x.y+L.height)),o.shape&&!N&&s[v?"attr":"animate"]({anchorX:S?_.plotWidth-i.plotY:i.plotX,anchorY:S?_.plotHeight-i.plotX:i.plotY})}v&&T&&(s.placed=!1),U||T&&!K||(s.hide(!0),s.placed=!1)},h.prototype.setDataLabelStartPos=function(i,s,o,h,v){var y=this.chart,_=y.inverted,S=this.xAxis,T=S.reversed,x=_?s.height/2:s.width/2;i=(i=i.pointWidth)?i/2:0,S=_?v.x:T?-x-i:S.width-x+i,v=_?T?this.yAxis.height-x+i:-x-i:v.y,s.startXPos=S,s.startYPos=v,h?"hidden"===s.visibility&&(s.show(),s.attr({opacity:0}).animate({opacity:1})):s.attr({opacity:1}).animate({opacity:0},void 0,s.hide),y.hasRendered&&(o&&s.attr({x:s.startXPos,y:s.startYPos}),s.placed=!0)},h.prototype.justifyDataLabel=function(i,s,o,h,v,y){var _=this.chart,S=s.align,T=s.verticalAlign,x=i.box?0:i.padding||0,R=s.x;R=void 0===R?0:R;var P=s.y,L=void 0===P?0:P;if(0>(P=o.x+x)){"right"===S&&0<=R?(s.align="left",s.inside=!0):R-=P;var N=!0}return(P=o.x+h.width-x)>_.plotWidth&&("left"===S&&0>=R?(s.align="right",s.inside=!0):R+=_.plotWidth-P,N=!0),0>(P=o.y+x)&&("bottom"===T&&0<=L?(s.verticalAlign="top",s.inside=!0):L-=P,N=!0),(P=o.y+h.height-x)>_.plotHeight&&("top"===T&&0>=L?(s.verticalAlign="bottom",s.inside=!0):L+=_.plotHeight-P,N=!0),N&&(s.x=R,s.y=L,i.placed=!y,i.align(s,void 0,v)),N},v.pie&&(v.pie.prototype.dataLabelPositioners={radialDistributionY:function(i){return i.top+i.distributeBox.pos},radialDistributionX:function(i,s,o,h){return i.getX(o<s.top+2||o>s.bottom-2?h:o,s.half,s)},justify:function(i,s,o){return o[0]+(i.half?-1:1)*(s+i.labelDistance)},alignToPlotEdges:function(i,s,o,h){return i=i.getBBox().width,s?i+h:o-i-h},alignToConnectors:function(i,s,o,h){var v,y=0;return i.forEach((function(i){(v=i.dataLabel.getBBox().width)>y&&(y=v)})),s?y+h:o-y-h}},v.pie.prototype.drawDataLabels=function(){var i,v,y,_,T,R,P,L,N,j,K,U,Y=this,$=Y.data,X=Y.chart,Z=Y.options.dataLabels||{},ee=Z.connectorPadding,te=X.plotWidth,ie=X.plotHeight,ae=X.plotLeft,ne=Math.round(X.chartWidth/3),re=Y.center,se=re[2]/2,le=re[1],oe=[[],[]],de=[0,0,0,0],ce=Y.dataLabelPositioners;Y.visible&&(Z.enabled||Y._hasPointLabels)&&($.forEach((function(i){i.dataLabel&&i.visible&&i.dataLabel.shortened&&(i.dataLabel.attr({width:"auto"}).css({width:"auto",textOverflow:"clip"}),i.dataLabel.shortened=!1)})),h.prototype.drawDataLabels.apply(Y),$.forEach((function(i){i.dataLabel&&(i.visible?(oe[i.half].push(i),i.dataLabel._pos=null,!x(Z.style.width)&&!x(i.options.dataLabels&&i.options.dataLabels.style&&i.options.dataLabels.style.width)&&i.dataLabel.getBBox().width>ne&&(i.dataLabel.css({width:Math.round(.7*ne)+"px"}),i.dataLabel.shortened=!0)):(i.dataLabel=i.dataLabel.destroy(),i.dataLabels&&1===i.dataLabels.length&&delete i.dataLabels))})),oe.forEach((function(o,h){var v,y=o.length,S=[];if(y){if(Y.sortByAngle(o,h-.5),0<Y.maxLabelDistance){var V=Math.max(0,le-se-Y.maxLabelDistance),$=Math.min(le+se+Y.maxLabelDistance,X.plotHeight);o.forEach((function(i){0<i.labelDistance&&i.dataLabel&&(i.top=Math.max(0,le-se-i.labelDistance),i.bottom=Math.min(le+se+i.labelDistance,X.plotHeight),v=i.dataLabel.getBBox().height||21,i.distributeBox={target:i.labelPosition.natural.y-i.top+v/2,size:v,rank:i.y},S.push(i.distributeBox))})),V=$+v-V,s.distribute(S,V,V/5)}for(K=0;K<y;K++){if(i=o[K],R=i.labelPosition,_=i.dataLabel,j=!1===i.visible?"hidden":"inherit",N=V=R.natural.y,S&&x(i.distributeBox)&&(void 0===i.distributeBox.pos?j="hidden":(P=i.distributeBox.size,N=ce.radialDistributionY(i))),delete i.positionIndex,Z.justify)L=ce.justify(i,se,re);else switch(Z.alignTo){case"connectors":L=ce.alignToConnectors(o,h,te,ae);break;case"plotEdges":L=ce.alignToPlotEdges(_,h,te,ae);break;default:L=ce.radialDistributionX(Y,i,N,V)}_._attr={visibility:j,align:R.alignment},U=i.options.dataLabels||{},_._pos={x:L+W(U.x,Z.x)+({left:ee,right:-ee}[R.alignment]||0),y:N+W(U.y,Z.y)-10},R.final.x=L,R.final.y=N,W(Z.crop,!0)&&(T=_.getBBox().width,V=null,L-T<ee&&1===h?(V=Math.round(T-L+ee),de[3]=Math.max(V,de[3])):L+T>te-ee&&0===h&&(V=Math.round(L+T-te+ee),de[1]=Math.max(V,de[1])),0>N-P/2?de[0]=Math.max(Math.round(P/2-N),de[0]):N+P/2>ie&&(de[2]=Math.max(Math.round(N+P/2-ie),de[2])),_.sideOverflow=V)}}})),0===S(de)||this.verifyDataLabelOverflow(de))&&(this.placeDataLabels(),this.points.forEach((function(i){var s;(U=V(Z,i.options.dataLabels),v=W(U.connectorWidth,1))&&(y=i.connector,(_=i.dataLabel)&&_._pos&&i.visible&&0<i.labelDistance?(j=_._attr.visibility,(s=!y)&&(i.connector=y=X.renderer.path().addClass("highcharts-data-label-connector highcharts-color-"+i.colorIndex+(i.className?" "+i.className:"")).add(Y.dataLabelsGroup),X.styledMode||y.attr({"stroke-width":v,stroke:U.connectorColor||i.color||o.neutralColor60})),y[s?"attr":"animate"]({d:i.getConnectorPath()}),y.attr("visibility",j)):y&&(i.connector=y.destroy()))})))},v.pie.prototype.placeDataLabels=function(){this.points.forEach((function(i){var s,o=i.dataLabel;o&&i.visible&&((s=o._pos)?(o.sideOverflow&&(o._attr.width=Math.max(o.getBBox().width-o.sideOverflow,0),o.css({width:o._attr.width+"px",textOverflow:(this.options.dataLabels.style||{}).textOverflow||"ellipsis"}),o.shortened=!0),o.attr(o._attr),o[o.moved?"animate":"attr"](s),o.moved=!0):o&&o.attr({y:-9999})),delete i.distributeBox}),this)},v.pie.prototype.alignDataLabel=i,v.pie.prototype.verifyDataLabelOverflow=function(i){var s=this.center,o=this.options,h=o.center,v=o.minSize||80,y=null!==o.size;if(!y){if(null!==h[0])var _=Math.max(s[2]-Math.max(i[1],i[3]),v);else _=Math.max(s[2]-i[1]-i[3],v),s[0]+=(i[3]-i[1])/2;null!==h[1]?_=T(_,v,s[2]-Math.max(i[0],i[2])):(_=T(_,v,s[2]-i[0]-i[2]),s[1]+=(i[0]-i[2])/2),_<s[2]?(s[2]=_,s[3]=Math.min(K(o.innerSize||0,_),_),this.translate(s),this.drawDataLabels&&this.drawDataLabels()):y=!0}return y}),v.column&&(v.column.prototype.alignDataLabel=function(i,s,o,v,y){var _=this.chart.inverted,S=i.series,T=i.dlBox||i.shapeArgs,x=W(i.below,i.plotY>W(this.translatedThreshold,S.yAxis.len)),R=W(o.inside,!!this.options.stacking);T&&(0>(v=V(T)).y&&(v.height+=v.y,v.y=0),0<(T=v.y+v.height-S.yAxis.len)&&T<v.height&&(v.height-=T),_&&(v={x:S.yAxis.len-v.y-v.height,y:S.xAxis.len-v.x-v.width,width:v.height,height:v.width}),R||(_?(v.x+=x?0:v.width,v.width=0):(v.y+=x?v.height:0,v.height=0))),o.align=W(o.align,!_||R?"center":x?"right":"left"),o.verticalAlign=W(o.verticalAlign,_||R?"middle":x?"top":"bottom"),h.prototype.alignDataLabel.call(this,i,s,o,v,y),o.inside&&i.contrastColor&&s.css({color:i.contrastColor})})})),O(s,"Extensions/OverlappingDataLabels.js",[s["Core/Chart/Chart.js"],s["Core/Utilities.js"]],(function(i,s){var o=s.addEvent,h=s.fireEvent,v=s.isArray,y=s.isNumber,_=s.objectEach,S=s.pick;o(i,"render",(function(){var i=[];(this.labelCollectors||[]).forEach((function(s){i=i.concat(s())})),(this.yAxis||[]).forEach((function(s){s.stacking&&s.options.stackLabels&&!s.options.stackLabels.allowOverlap&&_(s.stacking.stacks,(function(s){_(s,(function(s){i.push(s.label)}))}))})),(this.series||[]).forEach((function(s){var o=s.options.dataLabels;s.visible&&(!1!==o.enabled||s._hasPointLabels)&&((o=function(s){return s.forEach((function(s){s.visible&&(v(s.dataLabels)?s.dataLabels:s.dataLabel?[s.dataLabel]:[]).forEach((function(o){var h=o.options;o.labelrank=S(h.labelrank,s.labelrank,s.shapeArgs&&s.shapeArgs.height),h.allowOverlap||i.push(o)}))}))})(s.nodes||[]),o(s.points))})),this.hideOverlappingLabels(i)})),i.prototype.hideOverlappingLabels=function(i){var s,o,v,_=this,S=i.length,T=_.renderer,x=!1,r=function(i){var s,o,h=i.box?0:i.padding||0,v=s=0;if(i&&(!i.alignAttr||i.placed)){var _=i.alignAttr||{x:i.attr("x"),y:i.attr("y")},S=i.parentGroup;i.width||(s=i.getBBox(),i.width=s.width,i.height=s.height,s=T.fontMetrics(null,i.element).h);var x=i.width-2*h;return(o={left:"0",center:"0.5",right:"1"}[i.alignValue])?v=+o*x:y(i.x)&&Math.round(i.x)!==i.translateX&&(v=i.x-i.translateX),{x:_.x+(S.translateX||0)+h-(v||0),y:_.y+(S.translateY||0)+h-s,width:i.width-2*h,height:i.height-2*h}}};for(o=0;o<S;o++)(s=i[o])&&(s.oldOpacity=s.opacity,s.newOpacity=1,s.absoluteBox=r(s));for(i.sort((function(i,s){return(s.labelrank||0)-(i.labelrank||0)})),o=0;o<S;o++){var R=(r=i[o])&&r.absoluteBox;for(s=o+1;s<S;++s){var P=(v=i[s])&&v.absoluteBox;!R||!P||r===v||0===r.newOpacity||0===v.newOpacity||P.x>=R.x+R.width||P.x+P.width<=R.x||P.y>=R.y+R.height||P.y+P.height<=R.y||((r.labelrank<v.labelrank?r:v).newOpacity=0)}}i.forEach((function(i){if(i){var s=i.newOpacity;i.oldOpacity!==s&&(i.alignAttr&&i.placed?(i[s?"removeClass":"addClass"]("highcharts-data-label-hidden"),x=!0,i.alignAttr.opacity=s,i[i.isOld?"animate":"attr"](i.alignAttr,null,(function(){_.styledMode||i.css({pointerEvents:s?"auto":"none"}),i.visibility=s?"inherit":"hidden"})),h(_,"afterHideOverlappingLabel")):i.attr({opacity:s})),i.isOld=!0}})),x&&h(_,"afterHideAllOverlappingLabels")}})),O(s,"Core/Responsive.js",[s["Core/Chart/Chart.js"],s["Core/Utilities.js"]],(function(i,s){var o=s.find,h=s.isArray,v=s.isObject,y=s.merge,_=s.objectEach,S=s.pick,T=s.splat,x=s.uniqueKey;i.prototype.setResponsive=function(i,s){var h=this.options.responsive,v=[],_=this.currentResponsive;!s&&h&&h.rules&&h.rules.forEach((function(i){void 0===i._id&&(i._id=x()),this.matchResponsiveRule(i,v)}),this),(s=y.apply(0,v.map((function(i){return o(h.rules,(function(s){return s._id===i})).chartOptions})))).isResponsiveOptions=!0,(v=v.toString()||void 0)!==(_&&_.ruleIds)&&(_&&this.update(_.undoOptions,i,!0),v?((_=this.currentOptions(s)).isResponsiveOptions=!0,this.currentResponsive={ruleIds:v,mergedOptions:s,undoOptions:_},this.update(s,i,!0)):this.currentResponsive=void 0)},i.prototype.matchResponsiveRule=function(i,s){var o=i.condition;(o.callback||function(){return this.chartWidth<=S(o.maxWidth,Number.MAX_VALUE)&&this.chartHeight<=S(o.maxHeight,Number.MAX_VALUE)&&this.chartWidth>=S(o.minWidth,0)&&this.chartHeight>=S(o.minHeight,0)}).call(this)&&s.push(i._id)},i.prototype.currentOptions=function(i){var s=this,o={};return function e(i,o,y,S){var x;_(i,(function(i,_){if(!S&&-1<s.collectionsWithUpdate.indexOf(_)&&o[_])for(i=T(i),y[_]=[],x=0;x<Math.max(i.length,o[_].length);x++)o[_][x]&&(void 0===i[x]?y[_][x]=o[_][x]:(y[_][x]={},e(i[x],o[_][x],y[_][x],S+1)));else v(i)?(y[_]=h(i)?[]:{},e(i,o[_]||{},y[_],S+1)):y[_]=void 0===o[_]?null:o[_]}))}(i,this.options,o,0),o}})),O(s,"masters/highcharts.src.js",[s["Core/Globals.js"],s["Core/Utilities.js"],s["Core/Series/Series.js"]],(function(i,s,o){return i.addEvent=s.addEvent,i.arrayMax=s.arrayMax,i.arrayMin=s.arrayMin,i.attr=s.attr,i.clearTimeout=s.clearTimeout,i.correctFloat=s.correctFloat,i.createElement=s.createElement,i.css=s.css,i.defined=s.defined,i.destroyObjectProperties=s.destroyObjectProperties,i.discardElement=s.discardElement,i.erase=s.erase,i.error=s.error,i.extend=s.extend,i.extendClass=s.extendClass,i.find=s.find,i.fireEvent=s.fireEvent,i.format=s.format,i.getMagnitude=s.getMagnitude,i.getStyle=s.getStyle,i.inArray=s.inArray,i.isArray=s.isArray,i.isClass=s.isClass,i.isDOMElement=s.isDOMElement,i.isFunction=s.isFunction,i.isNumber=s.isNumber,i.isObject=s.isObject,i.isString=s.isString,i.keys=s.keys,i.merge=s.merge,i.normalizeTickInterval=s.normalizeTickInterval,i.numberFormat=s.numberFormat,i.objectEach=s.objectEach,i.offset=s.offset,i.pad=s.pad,i.pick=s.pick,i.pInt=s.pInt,i.relativeLength=s.relativeLength,i.removeEvent=s.removeEvent,i.splat=s.splat,i.stableSort=s.stableSort,i.syncTimeout=s.syncTimeout,i.timeUnits=s.timeUnits,i.uniqueKey=s.uniqueKey,i.useSerialIds=s.useSerialIds,i.wrap=s.wrap,i.Series=o,i})),s["masters/highcharts.src.js"]._modules=s,s["masters/highcharts.src.js"]}))},1173:function(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.retrieveMLToolkitApp=s.mlModelsURL=s.mlModelsBaseURL=s.getSeverityColorFromColorRangeTable=void 0;var h=o(405),v=o(404),y=o(111),_=o(58),S="app/".concat(h.SPLUNKBASE_APPS.Machine_Learning_Toolkit.name,"/models");s.mlModelsURL=S;var T=(0,_.createITSIURL)(S);s.mlModelsBaseURL=T;s.retrieveMLToolkitApp=()=>(0,v.retrieveApp)(h.SPLUNKBASE_APPS.Machine_Learning_Toolkit.name);s.getSeverityColorFromColorRangeTable=function getSeverityColorFromColorRangeTable(i){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[(0,y.getSeverityColor)(6),(0,y.getSeverityColor)(5),(0,y.getSeverityColor)(4),(0,y.getSeverityColor)(3),(0,y.getSeverityColor)(2)],o=s.length-1,h=100/s.length,v=Math.floor(i/h);return 100===i?s[o]:v>o||v<0?(0,y.getSeverityColor)(-1):s[v]}},1174:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_=h(o(9)),S=h(o(28)),T=h(o(15)),x=h(o(163)),R=h(o(73)),P=h(o(0)),L=h(o(36)),N=h(o(3)),V=o(5),j=o(16),W=h(o(99)),K=o(2927),U=o(200),Y=o(76),$=h(o(2999)),X=h(o(114)),Z=h(o(3e3)),ee=h(o(52)),te=(0,N.default)(W.default)(v||(v=(0,_.default)(['\n\t& [data-test="toggle"] {\n\t\ttext-overflow: ellipsis;\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\tmax-width: ',"\n\t}\n"])),i=>"".concat(i.tooltipToggleWidth,"px")),ie=N.default.h3(y||(y=(0,_.default)(["\n\tmax-width: 100%;\n"]))),ae=T.default.View.extend({isReadOnly:!1,initialize:function initialize(i){if(!(i=i||{}).serviceModel)throw"Must provide serviceModel";this.servicesCollectionData=i.servicesCollectionData,this.serviceModel=i.serviceModel,this.showOverview=i.showOverview||!0,this.severityLabels=i.severityLabels,this.kpiCollection=this.serviceModel.get("kpis"),this.initKPIDependencyCollection(),this.dispatcher=(0,R.default)({},T.default.Events),this.overviewView=new Z.default({collection:this.kpiCollection,serviceModel:this.serviceModel,dependentKpiCollection:this.dependentKpiCollection,severityLabels:this.severityLabels}),this.listenTo(this.overviewView,"set-tile-not-loading",this.triggerTileNotLoading),this.children={},this.filteredKpiCollection=new T.default.Collection,this.dependentFilteredKpiCollection=new T.default.Collection,T.default.View.prototype.initialize.apply(this,arguments)},initKPIDependencyCollection:function initKPIDependencyCollection(){if(this.dependentKpiCollection=new T.default.Collection,this.serviceModel.get("object_type")!==U.OBJECT_TYPE){this.serviceDependenciesIndexMap={},this.unOverloaded={};for(var i,s=this.serviceModel.get("services_depends_on"),o=s.length-1;o>=0;o--){this.serviceDependenciesIndexMap[s[o].serviceid]=o;for(var h=s[o].kpis_depending_on.length-1;h>=0;h--)s[o].hasOwnProperty("overloaded_urgencies")&&s[o].overloaded_urgencies.hasOwnProperty(s[o].kpis_depending_on[h])?i=s[o].overloaded_urgencies[s[o].kpis_depending_on[h]]:-1!==s[o].kpis_depending_on[h].indexOf(Y.HEALTH_SCORE_KPI_PREFIX)?i=Y.DEFAULT_SHKPI_URGENCY:(this.unOverloaded[s[o].kpis_depending_on[h]]=!0,i=Y.DEFAULT_KPI_URGENCY),this.dependentKpiCollection.add(new T.default.Model({id:s[o].kpis_depending_on[h],serviceId:s[o].serviceid,urgency:i,kpi_severity:"normal"}))}this.listenTo(this.dependentKpiCollection,"change:urgency",this._updateServiceDependencies),this.listenTo(this.serviceModel,"changeDependencies",this._reRenderDependencyTable)}},_addTitlesAndRenderDependencyTable:function _addTitlesAndRenderDependencyTable(){for(var i,s=this.servicesCollectionData.length-1;s>=0;s--)for(var o=this.servicesCollectionData[s].kpis.length-1;o>=0;o--)(i=this.dependentKpiCollection.get(this.servicesCollectionData[s].kpis[o]._key))&&(i.set("kpiTitle",this.servicesCollectionData[s].kpis[o].title),i.set("serviceTitle",this.servicesCollectionData[s].title));delete this.unOverloaded,this.renderDependencyTableView()},_reRenderDependencyTable:function _reRenderDependencyTable(){this.stopListening(this.overviewView,"set-tile-not-loading",this.triggerTileNotLoading),this.overviewView.remove(),this.initKPIDependencyCollection(),this.overviewView=new Z.default({collection:this.kpiCollection,serviceModel:this.serviceModel,dependentKpiCollection:this.dependentKpiCollection,severityLabels:this.severityLabels}),this.listenTo(this.overviewView,"set-tile-not-loading",this.triggerTileNotLoading),this._recalculateHealthScore(),this.showOverview&&this.$(".service-health-overview").append(this.overviewView.render().$el),this._addTitlesAndRenderDependencyTable()},_updateServiceDependencies:function _updateServiceDependencies(i){var s=this.serviceModel.get("services_depends_on"),o=this.serviceModel.get("services_depends_on")[this.serviceDependenciesIndexMap[i.get("serviceId")]];o.overloaded_urgencies=o.overloaded_urgencies||{},o.overloaded_urgencies[String(i.id)]=i.get("urgency"),this.serviceModel.set("services_depends_on",s),this.serviceModel.trigger("change"),this._recalculateHealthScore()},renderDependencyTableView:function renderDependencyTableView(){this.$(".service-health-dependent-kpi-importance-table").length&&(this.dependentFilteredKpiCollection.reset(),this.dependentKpiCollection.models.forEach(i=>{var s=new T.default.Model({id:i.get("id"),kpiTitle:i.get("kpiTitle"),serviceId:i.get("serviceId"),serviceTitle:i.get("serviceTitle"),kpi_severity:i.get("kpi_severity"),urgency:i.get("urgency")});this.dependentFilteredKpiCollection.add(s)}),this.listenTo(this.dependentFilteredKpiCollection,"change:kpi_severity",this._recalculateHealthScore),this.listenTo(this.dependentFilteredKpiCollection,"change:urgency",this._updateDependentUrgency),L.default.unmountComponentAtNode(this.$(".service-health-dependent-kpi-importance-table").get(0)),L.default.render(P.default.createElement(ee.default,null,P.default.createElement($.default,{kpiCollection:this.dependentFilteredKpiCollection,isReadOnly:this.isReadOnly})),this.$(".service-health-dependent-kpi-importance-table").get(0)),this.children.loadingDependentKpisMessage.hide())},getKpiHealthScores:function getKpiHealthScores(){this.kpiToStatus={};var i={output_mode:"csv",exec_mode:"oneshot",search:"search `get_itsi_summary_index` `service_level_max_severity_event_only` earliest=-60m | stats latest(alert_severity) as latest_status latest(kpi) as kpi_name by itsi_service_id itsi_kpi_id "+"| search itsi_service_id=".concat(this.serviceModel.id)},s=S.default.Deferred();return(0,K.retrieveJob)(i).then(i=>i.data).then(i=>{var o=i.split("\n");o.length<=1&&s.resolve();for(var h=1;h<o.length;++h){var v=o[h].split(","),y=v[1];this.kpiToStatus[y]=v[2]}this.overviewView.updateKpiToStatus(this.kpiToStatus),s.resolve()}).catch(i=>{s.reject(i)}),s},render:function render(){if(this.kpiCollection.length>0){var i=new X.default({content:(0,V.gettext)("Loading health score data..."),dataTestItsi:"service-health-view-loading-message",style:{marginTop:20},type:"info"});this.$el.html(i.render().$el),this.getKpiHealthScores().done(function(){this._renderData(),this._recalculateHealthScore()}.bind(this)).fail(function(){this.$el.text((0,V.gettext)("Failed to load health score data."))}.bind(this))}else this.$el.text((0,V.gettext)("You must create KPIs before configuring service health."));return this},_renderData:function _renderData(){this.$el.html('<div class="service-health-overview"></div><h3 class="first-service-health-table service-health-table-title" data-test-itsi="direct-kpi-service-health-table-title"></h3><div class="service-health-kpi-importance-table-loading-container"></div><div class="service-health-kpi-importance-table"></div><h3 class="second-service-health-table service-health-table-title" data-test-itsi="dependent-kpi-service-health-table-title">'+(0,V.gettext)("Dependent KPIs")+'</h3><div class="service-health-dependent-kpi-importance-table-loading-container"></div><div class="service-health-dependent-kpi-importance-table"></div>'),this.children.loadingKpisMessage=new X.default({content:(0,V.gettext)("Loading KPIs importance..."),dataTestItsi:"service-health-view-loading-kpi-importance-message",style:{marginTop:20},type:"info"}),this.$el.find(".service-health-kpi-importance-table-loading-container").html(this.children.loadingKpisMessage.render().$el),this.children.loadingDependentKpisMessage=new X.default({content:(0,V.gettext)("Loading dependent KPIs importance..."),dataTestItsi:"service-health-view-loading-kpi-dependent-importance-message",style:{marginTop:20},type:"info"}),this.$el.find(".service-health-dependent-kpi-importance-table-loading-container").html(this.children.loadingDependentKpisMessage.render().$el),this.showOverview&&this.$(".service-health-overview").append(this.overviewView.render().$el),this.$(".service-health-kpi-importance-table").length&&(this.filteredKpiCollection.reset(),this.kpiCollection.models.forEach(i=>{var s=i.get("_key")||"";if(!s.startsWith(Y.HEALTH_SCORE_KPI_PREFIX)){var o=new T.default.Model({_key:s,title:i.get("title"),kpi_severity:"normal",urgency:i.get("urgency")});this.filteredKpiCollection.add(o)}}),this.listenTo(this.filteredKpiCollection,"change:kpi_severity",this._recalculateHealthScore),this.listenTo(this.filteredKpiCollection,"change:urgency",this._updateUrgency),L.default.unmountComponentAtNode(this.$(".service-health-kpi-importance-table").get(0)),L.default.render(P.default.createElement(ee.default,null,P.default.createElement($.default,{isDependentKPIs:!1,kpiCollection:this.filteredKpiCollection,isReadOnly:this.isReadOnly})),this.$(".service-health-kpi-importance-table").get(0))),this.children.loadingKpisMessage.hide();var i=this.$el.find(".first-service-health-table");if(i.length){var s=this.serviceModel.get("title"),o=(0,j.sprintf)((0,V.gettext)("KPIs of %s"),(0,x.default)(s));L.default.unmountComponentAtNode(i.get(0)),L.default.render(P.default.createElement(ee.default,null,P.default.createElement(te,{content:s.length<100?"":s,"data-test-itsi":"service-health-table-service-name",tooltipToggleWidth:"700"},P.default.createElement(ie,{className:"service-health-table-service-name service-health-table-title","data-test-itsi":"direct-kpi-service-health-table-title"},o))),i.get(0))}this._addTitlesAndRenderDependencyTable()},triggerTileNotLoading:function triggerTileNotLoading(){this.trigger("set-tile-not-loading")},triggerTileLoading:function triggerTileLoading(){this.trigger("set-tile-loading")},_updateUrgency:function _updateUrgency(i){this.triggerTileLoading();var s=this.kpiCollection.filter(s=>s.get("_key")===i.get("_key"));s.length&&s[0].set("urgency",i.get("urgency"))},_updateDependentUrgency:function _updateDependentUrgency(i){this.triggerTileLoading();var s=this.dependentKpiCollection.filter(s=>s.get("id")===i.get("id"));s.length&&s[0].set("urgency",i.get("urgency"))},_recalculateHealthScore:function _recalculateHealthScore(){this.triggerTileLoading(),this.kpiToStatus={},this.filteredKpiCollection.models.forEach(i=>{"unknown"!==i.get("kpi_severity")&&(this.kpiToStatus[i.get("_key")]=i.get("kpi_severity"))}),this.dependentFilteredKpiCollection.each(function(i){this.kpiToStatus[i.id]=i.get("kpi_severity")}.bind(this)),this.overviewView.updateKpiToStatus(this.kpiToStatus),this.overviewView.render()},remove:function remove(){return this.overviewView.remove(),T.default.View.prototype.remove.apply(this,arguments)}});s.default=ae,i.exports=s.default},1325:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(42)),y=h(o(15)),_=h(o(3015));o(3016);var S=y.default.View.extend({template:_.default,initialize:function initialize(i){this.label=i.label||"",this.sidebarContent=i.sidebarContent instanceof Array?i.sidebarContent:[i.sidebarContent],this.mainContent=i.mainContent instanceof Array?i.mainContent:[i.mainContent],this._firstRender=!0},render:function render(){return this.$el.html(this.template),this.$(".sidebar-layout-header").text(this.label),(0,v.default)(this.sidebarContent,function(i){this.$(".sidebar-layout-sidebar").append(i)}.bind(this)),(0,v.default)(this.mainContent,function(i){this.$(".sidebar-layout-main").append(i)}.bind(this)),this}});s.default=S,i.exports=s.default},1639:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(1174)).default.extend({isReadOnly:!0});s.default=v,i.exports=s.default},1640:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(18)),y=h(o(17)),_=h(o(30)),S=h(o(21)),T=h(o(22)),x=h(o(20)),R=h(o(11)),P=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),L=h(o(2)),N=h(o(56)),V=h(o(132)),j=o(5);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,x.default)(i);if(s){var v=(0,x.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,T.default)(this,o)}}o(29);var W=function(i){(0,S.default)(BackfillToggleControl,i);var s=_createSuper(BackfillToggleControl);function BackfillToggleControl(i){var o;(0,y.default)(this,BackfillToggleControl);for(var h=arguments.length,v=new Array(h>1?h-1:0),S=1;S<h;S++)v[S-1]=arguments[S];return o=s.call(this,i,...v),(0,R.default)((0,_.default)(o),"handleClick",(i,s)=>{var{onChange:h}=o.props,v=!s.value;o.setState({isSelected:v}),h(v)}),(0,R.default)((0,_.default)(o),"render",()=>{var{isReadOnly:i,size:s,tooltipContent:h}=o.props,{isSelected:v}=o.state;return P.default.createElement(N.default,{"data-test-itsi":"service-backfill-control-group",label:(0,j.gettext)("Backfill"),tooltip:h},P.default.createElement(V.default,{"data-test-itsi":"backfill-control-switch",value:!!v,appearance:"toggle",selected:!!v,onClick:o.handleClick,size:s,disabled:i},v?null:(0,j.gettext)("No Backfill")))}),o.state={isSelected:o.props.enabled},o}return(0,v.default)(BackfillToggleControl)}(P.Component);(0,R.default)(W,"propTypes",{onChange:L.default.func.isRequired,enabled:L.default.bool,isReadOnly:L.default.bool,size:L.default.string,tooltipContent:L.default.string}),(0,R.default)(W,"defaultProps",{enabled:!1,size:"small",isReadOnly:!1,tooltipContent:(0,j.gettext)("If enabled, the summary index will be backfilled if necessary. Backfilling can only be done once.")});var K=W;s.default=K,i.exports=s.default},1641:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y=h(o(9)),_=h(o(0)),S=h(o(2)),T=h(o(47)),x=h(o(3)),R=h(o(56)),P=o(5),L=h(o(3005));o(29);var N={backfillEnabled:S.default.bool.isRequired,backfillEarliest:S.default.string.isRequired,onTimePickerSelection:S.default.func.isRequired,setInputValidity:S.default.func},V={setInputValidity:T.default},j=x.default.span(v||(v=(0,y.default)(["\n\tpadding-left: 7px;\n\tpadding-top: 6px;\n"])));function BackfillStatusControl(i){return _.default.createElement("div",null,i.backfillEnabled?_.default.createElement(R.default,{"data-test-itsi":"service-settings-backfill-with-control-group",label:(0,P.gettext)("Backfill with")},_.default.createElement(L.default,{onTimePickerSelection:i.onTimePickerSelection,setInputValidity:i.setInputValidity,backfillEnabled:i.backfillEnabled,currentSetBackfillPeriod:i.backfillEarliest}),_.default.createElement(j,{"data-test-itsi":"backfill-time-text"},(0,P.gettext)("of data"))):_.default.createElement("span",null))}BackfillStatusControl.propTypes=N,BackfillStatusControl.defaultProps=V;var W=BackfillStatusControl;s.default=W,i.exports=s.default},1642:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(11)),y=h(o(15)),_=h(o(42)),S=o(5),T=o(76),x=h(o(888)),R=h(o(1324)),P=h(o(3025)),L=h(o(3026)),N=h(o(3046)),V=h(o(3066));function ownKeys(i,s){var o=Object.keys(i);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(i);s&&(h=h.filter((function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable}))),o.push.apply(o,h)}return o}function _objectSpread(i){for(var s=1;s<arguments.length;s++){var o=null!=arguments[s]?arguments[s]:{};s%2?ownKeys(Object(o),!0).forEach((function(s){(0,v.default)(i,s,o[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(o,s))}))}return i}o(3086);var j=y.default.View.extend({initialize:function initialize(i){if(i=i||{},this.options=i,!i.kpiModel)throw"Must provide kpiModel";if(this.kpiModel=i.kpiModel,!i.serviceModel)throw"Must provide serviceModel";this.hideAnomalyDetectionPanel=i.hideAnomalyDetectionPanel||!1,this.hideRecommendedThresholding=i.hideRecommendedThresholding||!1,this.serviceTemplate=i.serviceTemplate,this.sdDispatcher=i.sdDispatcher,this.serviceKpiBackfillMapping=i.serviceKpiBackfillMapping,this.serviceModel=i.serviceModel,this.linkedServices=i.linkedServices,this.childViews={},this.showUnlinkWarning=this.serviceModel.get("object_type")===T.OBJECT_TYPE&&this.kpiModel.get("base_service_template_id"),this.showUnlinkWarning?this.setupServiceDefinitionHeader():this.setupHeader(),this.setupPanelViews();this.listenTo(this.kpiModel,"change:title",function(i,s){s&&s.replace(/\s+/g,"")&&i.isValid()&&i.gatherSearchClause({service:this.serviceModel})}.bind(this))},setupHeader:function setupHeader(){this.childViews.kpiTitleControl=new x.default({dataTestItsi:"kpi-title-text-control",model:this.kpiModel,modelAttribute:"title",clickToEdit:!0,placeholder:(0,S.gettext)("KPI title")}),this.childViews.kpiDescriptionControl=new x.default({dataTestItsi:"kpi-description-text-control",model:this.kpiModel,modelAttribute:"description",clickToEdit:!0,placeholder:(0,S.gettext)("KPI description")})},setupServiceDefinitionHeader:function setupServiceDefinitionHeader(){this.childViews.kpiTitleControl=new P.default({dataTestItsi:"kpi-title-text-control",model:this.kpiModel,modelAttribute:"title",clickToEdit:!0,placeholder:(0,S.gettext)("KPI title"),serviceTemplate:this.serviceTemplate,serviceModel:this.serviceModel,sdDispatcher:this.sdDispatcher}),this.childViews.kpiDescriptionControl=new x.default({dataTestItsi:"kpi-description-text-control",model:this.kpiModel,modelAttribute:"description",clickToEdit:!0,placeholder:(0,S.gettext)("KPI description")})},setupPanelViews:function setupPanelViews(){this.kpiSearchPanel=new L.default(_objectSpread({kpiModel:this.kpiModel,serviceModel:this.serviceModel,serviceTemplateTitle:this.serviceTemplate?this.serviceTemplate.get("title"):""},this.options)),this.kpiThresholdingPanel=new N.default(_objectSpread({kpiModel:this.kpiModel,linkedServices:this.linkedServices,serviceModel:this.serviceModel,serviceTemplateTitle:this.serviceTemplate?this.serviceTemplate.get("title"):""},this.options)),this.kpiAnomalyDetectionPanel=new V.default({kpiModel:this.kpiModel,serviceModel:this.serviceModel}),!0===this.hideAnomalyDetectionPanel?this.childViews.centerLayout=new R.default({panels:[this.kpiSearchPanel,this.kpiThresholdingPanel]}):this.childViews.centerLayout=new R.default({panels:[this.kpiSearchPanel,this.kpiThresholdingPanel,this.kpiAnomalyDetectionPanel]})},render:function render(){return this.$el.html(""),this.childViews.kpiTitleControl&&this.$el.append(this.childViews.kpiTitleControl.render().$el),this.childViews.kpiDescriptionControl&&this.$el.append(this.childViews.kpiDescriptionControl.render().$el),this.childViews.centerLayout&&this.$el.append(this.childViews.centerLayout.render().$el),this},remove:function remove(){return(0,_.default)(this.childViews,function(i){i&&i instanceof y.default.View&&(this.stopListening(i),i.remove())}.bind(this)),y.default.View.prototype.remove.apply(this,arguments)}});s.default=j,i.exports=s.default},1643:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(11)),y=h(o(28)),_=h(o(15)),S=h(o(163)),T=h(o(70)),x=h(o(41)),R=h(o(1982)),P=h(o(0)),L=h(o(36)),N=h(o(56)),V=h(o(148)),j=o(5),W=o(16),K=o(409),U=o(68),Y=o(144),$=o(1144),X=o(200),Z=o(76),ee=o(185),te=h(o(1287)),ie=h(o(79)),ae=h(o(52)),ne=h(o(689)),re=h(o(1644)),se=h(o(2066)),le=h(o(895)),oe=h(o(1296));function ownKeys(i,s){var o=Object.keys(i);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(i);s&&(h=h.filter((function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable}))),o.push.apply(o,h)}return o}function _objectSpread(i){for(var s=1;s<arguments.length;s++){var o=null!=arguments[s]?arguments[s]:{};s%2?ownKeys(Object(o),!0).forEach((function(s){(0,v.default)(i,s,o[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(o,s))}))}return i}o(1646);var de=_.default.View.extend({attributes:{"data-test-itsi":"summary-view"},className:"summary-view",tagName:"div",initialize:function initialize(i){if(!(i=i||{}).kpiModel)throw"Must provide kpiModel";if(this.kpiModel=i.kpiModel,!i.serviceModel)throw"Must provide serviceModel";this.serviceModel=i.serviceModel,_.default.View.prototype.initialize.apply(this,arguments)},render:function render(){return this.$el.html(""),this.renderSummaryItems(),this},renderSummaryItems:function renderSummaryItems(){throw"Must override renderSummaryItems"}}),ce=_.default.View.extend({initialize:function initialize(i){this.featureFlags=i.featureFlags,this.kpiModel=i.kpiModel,this.serviceModel=i.serviceModel,this.initialStep=i.initialStep,this.isReadOnly=i.isReadOnly,this.baseSearchSelectItems=i.baseSearchSelectItems,this.isModalOpen=i.isModalOpen,this.savedBaseSearchCollection=i.savedBaseSearchCollection,this.validateModelEntriesCallback=i.validateModelEntriesCallback,this.handleUpdateKpiModelCallback=i.handleUpdateKpiModelCallback,this.serviceTemplate=i.serviceTemplate,this.sdDispatcher=i.sdDispatcher,this.serviceKpiBackfillMapping=i.serviceKpiBackfillMapping,this.children={},this.children.editKPIButton=new ie.default({dataTestItsi:"kpi-search-panel-edit-button",label:(0,j.gettext)("Edit"),onClick:this._onClickEdit.bind(this)}),_.default.View.prototype.initialize.apply(this,arguments),this.editAndSaveKpi=this.editAndSaveKpi.bind(this),this.handleAcceptToUnlink=this.handleAcceptToUnlink.bind(this)},render:function render(){return this.$el.html(this.children.editKPIButton.render().$el),this},_onClickEdit:function _onClickEdit(){this.serviceModel.get("object_type")===Z.OBJECT_TYPE&&this.serviceTemplate&&this.kpiModel.get("base_service_template_id")?this._showUnlinkWarningModal():this._showEditModal()},_showUnlinkWarningModal:function _showUnlinkWarningModal(){var i=(0,y.default)('<div class="unlink-warning-modal"></div>'),s=(0,j.gettext)("Edit KPI Search");L.default.unmountComponentAtNode(i.get(0)),L.default.render(P.default.createElement(ae.default,null,P.default.createElement(le.default,{modalTitleSubstring:s,serviceTitle:this.serviceModel.get("title"),serviceTemplateTitle:this.serviceTemplate.get("title"),serviceTemplateUrl:this.serviceTemplate.getEditUrl(),isModalOpen:!0,handleAcceptToUnlink:this.handleAcceptToUnlink})),i.get(0))},handleAcceptToUnlink:function handleAcceptToUnlink(){this.sdDispatcher.trigger("unsetBaseServiceTemplateId",this.serviceModel),this.sdDispatcher.trigger("unlink"),this._showEditModal()},_showEditModal:function _showEditModal(){if(this.serviceModel.get("object_type")===X.OBJECT_TYPE){var i={base_search_id:this.kpiModel.get("base_search_id"),base_search_metric:this.kpiModel.get("base_search_metric"),title:this.kpiModel.get("title"),description:this.kpiModel.get("description")},s=function(){var s=(0,y.default)('<div class="edit-service-template-kpi-modal"></div>');L.default.unmountComponentAtNode(s.get(0)),L.default.render(P.default.createElement(ae.default,null,P.default.createElement(se.default,{savedBaseSearchCollection:this.savedBaseSearchCollection,baseSearchSelectItems:this.baseSearchSelectItems,validateModelEntries:this.validateModelEntriesCallback,handleUpdateKpiModel:this.handleUpdateKpiModelCallback,isModalOpen:this.isModalOpen,isNew:!1,editAndSaveKpi:this.editAndSaveKpi,currentKpiSearchValuesObject:i,kpiModel:this.kpiModel.clone()})),s.get(0))}.bind(this);this.modal=s()}else this.modal=new re.default({featureFlags:this.featureFlags,kpiModel:this.kpiModel,serviceModel:this.serviceModel,initialStep:this.initialStep,serviceKpiBackfillMapping:this.serviceKpiBackfillMapping}),this.listenToOnce(this.modal,"kpichanged",function(i){var s=(0,x.default)(this.kpiModel.parse(i.toJSON()),["aggregate_thresholds","entity_thresholds","time_variate_thresholds_specification","skip_kpi_validation"]);this.kpiModel.set(s),this.kpiModel.trigger("change:time_variate_thresholds")}.bind(this)),(0,y.default)("body").append(this.modal.render().el),this.modal.show()},editAndSaveKpi:function editAndSaveKpi(i){var s=(0,x.default)(this.kpiModel.parse(i.toJSON()),["aggregate_thresholds","entity_thresholds","time_variate_thresholds_specification","skip_kpi_validation"]);this.kpiModel.set(s),this.kpiModel.trigger("change:time_variate_thresholds")}}),he=_.default.View.extend({tagName:"div",initialize:function initialize(i){if(i=i||{},this.options=i,!i.kpiModel)throw"Must provide kpiModel";if(this.kpiModel=i.kpiModel,!i.serviceModel)throw"Must provide serviceModel";if(this.serviceModel=i.serviceModel,!i.title)throw"Must provide title";this.featureFlags=i.featureFlags,this.initialStep=i.initialStep,this.serviceKpiBackfillMapping=i.serviceKpiBackfillMapping;var s=i.title,o=!!i.showEditControl,h=_.default.View.extend({tagName:"div",className:"title-view",render:function render(){return this.$el.text(s),this}});if(!i.SummaryView)throw"Must provide summary view";var v=i.SummaryView;this.summaryView=new v({kpiModel:this.kpiModel,serviceModel:this.serviceModel});var y=[{view:new h({kpiModel:this.kpiModel,serviceModel:this.serviceModel}),width:250},{view:this.summaryView,flex:2}];o&&y.push({view:new ce(_objectSpread({featureFlags:this.featureFlags,kpiModel:this.kpiModel,serviceModel:this.serviceModel,initialStep:this.initialStep},this.options)),width:30}),this.layout=new te.default({align:"stretch",items:y}),this.listenTo(this.kpiModel,"change",this.onChangeAttribute),_.default.View.prototype.initialize.apply(arguments)},onChangeAttribute:function onChangeAttribute(){this.summaryView.render()},render:function render(){return this.$el.html(this.layout.render().$el),this.options.dataTestItsi&&this.$el.attr("data-test-itsi",this.options.dataTestItsi),this}}),ue={marginBottom:0},pe={maxWidth:"100%",overflowWrap:"anywhere"},getInnerContentHTML=i=>({__html:i}),fe=function renderControlGroup(i){var s=(0,y.default)("<div></div>");L.default.unmountComponentAtNode(s.get(0));var o=i.content;return i.isContentHTML&&(o=P.default.createElement("div",{dangerouslySetInnerHTML:getInnerContentHTML(i.content)})),L.default.render(P.default.createElement(ae.default,null,P.default.createElement(N.default,{"data-test-itsi":i.controlGroupDataTestItsi,label:i.controlGroupLabel,labelWidth:U.LABEL_WIDTHS.Massive,style:ue},P.default.createElement(V.default,{"data-test-itsi":i.labelDataTestItsi,style:pe},o))),s.get(0)),s},ge=_.default.View.extend({initialize:function initialize(i){if(i=i||{},this.options=i,!i.kpiModel)throw"Must provide kpiModel";var s=this;if(this.kpiModel=i.kpiModel,!i.serviceModel)throw"Must provide serviceModel";this.featureFlags=i.featureFlags,this.serviceModel=i.serviceModel,this.baseSearchSelectItems=i.baseSearchSelectItems,this.serviceKpiBackfillMapping=i.serviceKpiBackfillMapping,this.isModalOpen=i.isModalOpen,this.savedBaseSearchCollection=i.savedBaseSearchCollection,this.isBaseServiceTemplate=this.serviceModel.get("object_type")===X.OBJECT_TYPE;var o=!this.isBaseServiceTemplate;this.sourceView=new he(_objectSpread({featureFlags:this.featureFlags,kpiModel:i.kpiModel,title:(0,j.gettext)("Source"),serviceModel:i.serviceModel,serviceKpiBackfillMapping:this.serviceKpiBackfillMapping,initialStep:1,showEditControl:!0,className:"three-column-view source-three-column-view",dataTestItsi:"source-three-column-view",SummaryView:de.extend({initialize:function initialize(){de.prototype.initialize.apply(this,arguments),this.kpiBaseSearchCache={}},renderSummaryItems:function renderSummaryItems(){var i=this.kpiModel.get("search_type"),s=this.kpiModel.get("metric");if("datamodel"===i){var o=this.kpiModel.get("datamodel");o.validate()?this.$el.text((0,j.gettext)("Not configured")):(this.$el.append(fe({controlGroupDataTestItsi:"kpi-source-data-model-field",labelDataTestItsi:"kpi-source-data-model-value",controlGroupLabel:(0,j.gettext)("Data model"),content:o.get("datamodel")})),this.$el.append(fe({controlGroupDataTestItsi:"kpi-source-data-model-object-field",labelDataTestItsi:"kpi-source-data-model-object-value",controlGroupLabel:(0,j.gettext)("Data model object"),content:o.get("object")})),this.$el.append(fe({controlGroupDataTestItsi:"kpi-source-data-model-field-field",labelDataTestItsi:"kpi-source-data-model-field-value",controlGroupLabel:(0,j.gettext)("Data model field"),content:o.get("field")})))}else if("metric"===i)this.$el.append(fe({controlGroupDataTestItsi:"kpi-source-metric-search-field",labelDataTestItsi:"kpi-source-metric-search-value",controlGroupLabel:(0,j.gettext)("Search"),content:(0,j.gettext)("Metrics search")})),this.$el.append(fe({controlGroupDataTestItsi:"kpi-source-metrics-index-field",labelDataTestItsi:"kpi-source-metrics-index-value",controlGroupLabel:(0,j.gettext)("Metrics index"),content:(0,S.default)(s.metric_index)})),this.$el.append(fe({controlGroupDataTestItsi:"kpi-source-metric-name-field",labelDataTestItsi:"kpi-source-metric-name-value",controlGroupLabel:(0,j.gettext)("Metric name"),content:(0,S.default)(s.metric_name)}));else if("adhoc"===i)this.$el.append(fe({controlGroupDataTestItsi:"kpi-source-adhoc-search-field",labelDataTestItsi:"kpi-source-adhoc-search-value",controlGroupLabel:(0,j.gettext)("Search"),content:(0,S.default)(this.kpiModel.get("base_search")),isContentHTML:!0})),this.$el.append(fe({controlGroupDataTestItsi:"kpi-source-threshold-field-field",labelDataTestItsi:"kpi-source-threshold-field-value",controlGroupLabel:(0,j.gettext)("Threshold field"),content:(0,S.default)(this.kpiModel.get("threshold_field"))}));else if(this.kpiModel.get("base_search_id")&&!this.isFetching){var successHandler=i=>{if(i){var o=(0,T.default)(i.metrics.models,function(i){return i.get("_key")===this.kpiModel.get("base_search_metric")}.bind(this));this.$el.append(fe({controlGroupDataTestItsi:"kpi-source-base-search-field",labelDataTestItsi:"kpi-source-base-search-value",controlGroupLabel:(0,j.gettext)("Base search"),content:(0,S.default)(i.title)})),i.is_metric?(this.$el.append(fe({controlGroupDataTestItsi:"kpi-source-base-search-metrics-index-field",labelDataTestItsi:"kpi-source-base-search-metrics-index-value",controlGroupLabel:(0,j.gettext)("Base search metrics index"),content:(0,S.default)(s.metric_index)})),this.$el.append(fe({controlGroupDataTestItsi:"kpi-source-base-search-metric-name-field",labelDataTestItsi:"kpi-source-base-search-metric-name-value",controlGroupLabel:(0,j.gettext)("Base search metric name"),content:(0,S.default)(s.metric_name)})),null!=o&&o.get("title")&&this.$el.append(fe({controlGroupDataTestItsi:"kpi-source-base-search-metric-title-field",labelDataTestItsi:"kpi-source-base-search-metric-title-value",controlGroupLabel:(0,j.gettext)("Metric"),content:(0,S.default)(o.get("title"))}))):(this.$el.append(fe({controlGroupDataTestItsi:"kpi-source-base-search-search-field",labelDataTestItsi:"kpi-source-base-search-search-value",controlGroupLabel:(0,j.gettext)("Search"),content:(0,S.default)(this.kpiModel.get("base_search")),isContentHTML:!0})),this.$el.append(fe({controlGroupDataTestItsi:"kpi-source-base-search-threshold-field-field",labelDataTestItsi:"kpi-source-base-search-threshold-field-value",controlGroupLabel:(0,j.gettext)("Threshold field"),content:(0,S.default)(this.kpiModel.get("threshold_field"))})))}};if(this.kpiBaseSearchCache[this.kpiModel.get("base_search_id")])successHandler(this.kpiBaseSearchCache[this.kpiModel.get("base_search_id")]);else{var h=new oe.default({_key:this.kpiModel.get("base_search_id")});this.isFetching=!0,h.fetch().done(i=>{this.isFetching=!1,this.kpiBaseSearchCache[this.kpiModel.get("base_search_id")]=i,successHandler(i)}).fail(()=>{this.isFetching=!1,this.$el.append(fe({controlGroupDataTestItsi:"kpi-source-base-search-field-fetch-error",labelDataTestItsi:"kpi-source-base-search-value-fetch-error",controlGroupLabel:(0,j.gettext)("Base search"),content:(0,j.gettext)("Could not retrieve the KPI base search information. Try refreshing the page.")}))})}}}})},this.options));var h=(0,$.getAggregationOperations)("all");this.calculationView=new he(_objectSpread({featureFlags:this.featureFlags,kpiModel:i.kpiModel,title:(0,j.gettext)("Calculation"),serviceModel:i.serviceModel,initialStep:3,showEditControl:o,className:"three-column-view calculation-three-column-view",dataTestItsi:"calculation-three-column-view",SummaryView:de.extend({renderSummaryItems:function renderSummaryItems(){var i,s,o=this.kpiModel.get("aggregate_statop");0===o.indexOf("perc")&&(s=o.substr(4),i={value:o,label:(0,W.sprintf)((0,j.gettext)("Percentile (%s)"),s)});var v,y=this.kpiModel.get("entity_statop");if(0===y.indexOf("perc")&&(s=y.substr(4),v={value:y,label:(0,W.sprintf)((0,j.gettext)("Percentile (%s)"),s)}),!i||!v)for(var _=0;_<h.length&&(o===h[_].value&&(i=h[_]),y===h[_].value&&(v=h[_]),!i||!v);++_);if(i){var T,x=i.label,R=v.label,P=this.kpiModel.get("alert_period"),L=this.kpiModel.get("search_alert_earliest"),N=(0,S.default)(this.kpiModel.get("threshold_field")),V=this.kpiModel.get("fill_gaps");T=this.kpiModel.get("is_entity_breakdown")?(0,W.sprintf)((0,j.gettext)('Calculating <span class="field-title">%s</span> of %s per entity as entity value, <span class="field-title">%s</span> of entity value as aggregate over the last <span class="field-title">%s minute(s)</span> every <span class="field-title">%s minute(s)</span>.'),R,N,x,L,P):(0,W.sprintf)((0,j.gettext)('Calculating <span class="field-title">%s</span> of %s as aggregate over the last <span class="field-title">%s minute(s)</span> every <span class="field-title">%s minute(s)</span>.'),x,N,L,P),T+="null_value"===V?" "+(0,W.sprintf)((0,j.gettext)("Fill gaps in data with Null values and use a %s threshold level for them"),(0,Y.getSeverityLabel)(this.kpiModel.get("gap_severity")).toLowerCase()):"custom_value"===V?" "+(0,W.sprintf)((0,j.gettext)("Fill gaps in data with custom value of %s"),this.kpiModel.get("gap_custom_alert_value")):" "+(0,j.gettext)("Fill gaps in data with the last available value of data"),T+=".",this.$el.append(fe({controlGroupDataTestItsi:"calculation-field",labelDataTestItsi:"calculation-value",controlGroupLabel:(0,j.gettext)("Calculation"),content:T,isContentHTML:!0}))}else this.$el.text((0,j.gettext)("Not configured"))}})},this.options)),this.entityView=new he(_objectSpread({featureFlags:this.featureFlags,kpiModel:i.kpiModel,title:(0,j.gettext)("Entities"),serviceModel:i.serviceModel,initialStep:2,showEditControl:o,className:"three-column-view entities-three-column-view",dataTestItsi:"entities-three-column-view",SummaryView:de.extend({renderSummaryItems:function renderSummaryItems(){if(this.kpiModel.get("is_entity_breakdown")||this.kpiModel.get("is_service_entity_filter")){if(this.kpiModel.get("is_entity_breakdown")&&this.$el.append(fe({controlGroupDataTestItsi:"entity-split-by-field-field",labelDataTestItsi:"entity-split-by-field-value",controlGroupLabel:(0,j.gettext)("Entity Split Field(s)"),content:this.kpiModel.get("entity_breakdown_id_fields")})),this.kpiModel.get("is_service_entity_filter")&&this.serviceModel.getNumEntityRules()>0){this.$el.append(fe({controlGroupDataTestItsi:"entity-id-fields-field",labelDataTestItsi:"entity-id-fields-value",controlGroupLabel:(0,j.gettext)("Data filtered by service entities in field"),content:this.kpiModel.get("entity_id_fields")}));for(var i=this.serviceModel.get("entity_rules"),s=[],o=0;o<i.length;++o)for(var h=i.at(o).get("rule_items").pluck("field"),v=0;v<h.length;++v)s.push((0,S.default)(h[v]));s=(0,R.default)(s),this.$el.append(fe({controlGroupDataTestItsi:"services-matches-entities-field",labelDataTestItsi:"services-matches-entities-value",controlGroupLabel:(0,j.gettext)("Service matches entities on fields"),content:s.join(", ")}))}}else this.$el.append(fe({controlGroupDataTestItsi:"not-filtering-entities-field",labelDataTestItsi:"not-filtering-entities-value",controlGroupLabel:(0,j.gettext)("Entities"),content:(0,j.gettext)("This KPI is not filtered by or monitoring any entities.")}));return this}})},this.options)),this.unitView=new he(_objectSpread({featureFlags:this.featureFlags,kpiModel:i.kpiModel,title:(0,j.gettext)("Unit and Monitoring Lag"),serviceModel:i.serviceModel,initialStep:4,showEditControl:o,className:"three-column-view unit-three-column-view",dataTestItsi:"unit-three-column-view",SummaryView:de.extend({renderSummaryItems:function renderSummaryItems(){this.$el.append(fe({controlGroupDataTestItsi:"unit-monitoring-lag-unit-field",labelDataTestItsi:"unit-monitoring-lag-unit-value",controlGroupLabel:(0,j.gettext)("Unit"),content:this.kpiModel.get("unit")||(0,j.gettext)("None")})),this.$el.append(fe({controlGroupDataTestItsi:"unit-monitoring-lag-lag-field",labelDataTestItsi:"unit-monitoring-lag-lag-value",controlGroupLabel:(0,j.gettext)("Monitoring Lag"),content:this.kpiModel.get("alert_lag")}))}})},this.options)),this.isBaseServiceTemplate||(this.backfillView=new he(_objectSpread({featureFlags:this.featureFlags,kpiModel:i.kpiModel,title:(0,j.gettext)("Backfill"),serviceModel:i.serviceModel,initialStep:5,showEditControl:o,className:"three-column-view backfill-three-column-view",dataTestItsi:"backfill-three-column-view",SummaryView:de.extend({renderSummaryItems:function renderSummaryItems(){!1===this.kpiModel.get("backfill_enabled")?this.$el.append(fe({controlGroupDataTestItsi:"backfill-field-not-configured-control-group",labelDataTestItsi:"backfill-value-not-configured",controlGroupLabel:(0,j.gettext)("Backfill"),content:(0,j.gettext)("Backfill has not been configured.")})):(this.$el.append(fe({controlGroupDataTestItsi:"backfill-field-waiting-control-group",labelDataTestItsi:"backfill-value-waiting",controlGroupLabel:(0,j.gettext)("Backfill"),content:ee.BACKFILL_STATUSES.WAITING})),s._checkBackfillProgress())}})},this.options))),_.default.View.prototype.initialize.apply(this,arguments)},_checkIfBackfillIsNeeded:function _checkIfBackfillIsNeeded(i){this._checkBackfillProgress(i)},_renderBackfillControls:function _renderBackfillControls(i,s){var o,h=this.kpiModel.get("_key"),v=this.kpiModel.get("backfill_earliest_time");if(i)o=ne.default.renderBackfillStatus(s,v),this._hideEditOnBackfillView();else{var y=(0,K.createRangeLabel)(v,"now").toLowerCase();o=(0,W.sprintf)((0,j.gettext)("Backfill has been configured for %(timeLabel)s of data."),{timeLabel:y}),this.serviceKpiBackfillMapping[h]?this._hideEditOnBackfillView():this._showEditOnBackfillView()}this.backfillView.summaryView.$el.html(fe({controlGroupDataTestItsi:"backfill-field-control-group",labelDataTestItsi:"backfill-value",controlGroupLabel:(0,j.gettext)("Backfill"),content:o}))},_checkBackfillProgress:function _checkBackfillProgress(i){this.kpiModel._cachedBackfillProgressStatus&&void 0!==this.kpiModel._cachedBackfillProgressStatus.progress&&void 0!==this.kpiModel._cachedBackfillProgressStatus.status?this._renderBackfillControls(this.kpiModel._cachedBackfillProgressStatus.progress,this.kpiModel._cachedBackfillProgressStatus.status,i):ne.default.getBackfillDataForKpi(this.kpiModel.get("_key")).done((s,o)=>{this._renderBackfillControls(s,o,i)})},_hideEditOnBackfillView:function _hideEditOnBackfillView(){this.backfillView&&this.backfillView.layout&&this.backfillView.layout.items&&this.backfillView.layout.items.length>=3&&this.backfillView.layout.items[2].view&&this.backfillView.layout.items[2].view.children&&this.backfillView.layout.items[2].view.children.editKPIButton&&this.backfillView.layout.items[2].view.children.editKPIButton.hide()},_showEditOnBackfillView:function _showEditOnBackfillView(){this.backfillView&&this.backfillView.layout&&this.backfillView.layout.items&&this.backfillView.layout.items.length>=3&&this.backfillView.layout.items[2].view&&this.backfillView.layout.items[2].view.children&&this.backfillView.layout.items[2].view.children.editKPIButton&&this.backfillView.layout.items[2].view.children.editKPIButton.show()},render:function render(){return this.$el.html(""),this.$el.append(this.sourceView.render().$el),this.$el.append(this.entityView.render().$el),this.$el.append(this.calculationView.render().$el),this.$el.append(this.unitView.render().$el),this.isBaseServiceTemplate||(this.$el.append(this.backfillView.render().$el),this.isReadOnly||(this.kpiModel.get("backfill_enabled")&&this.serviceKpiBackfillMapping&&this.serviceKpiBackfillMapping[this.kpiModel.get("_key")]?this._hideEditOnBackfillView():this._showEditOnBackfillView())),this}});s.default=ge,i.exports=s.default},1644:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(28)),y=h(o(15)),_=h(o(36)),S=h(o(0)),T=h(o(97)),x=h(o(42)),R=h(o(95)),P=h(o(112)),L=h(o(63)),N=h(o(860)),V=h(o(96)),j=o(16),W=o(5),K=o(125),U=h(o(178)),Y=o(106),$=o(25),X=o(68),Z=o(100),ee=o(135),te=o(199),ie=o(137),ae=o(76),ne=h(o(52)),re=h(o(150)),se=h(o(277)),le=h(o(2816)),oe=h(o(79)),de=h(o(3027)),ce=h(o(3030)),he=h(o(3031)),ue=h(o(2817)),pe=h(o(2818)),fe=h(o(3036)),ge=h(o(3038)),me=h(o(3039));o(3043);var ve=re.default.extend({attributes:v.default.extend({},re.default.DEFAULT_ATTRIBUTES,{"data-test-itsi":"kpi-search-and-calculate-modal"}),className:"kpi-search-and-calculate-modal "+re.default.CLASS_NAME+" "+re.default.CLASS_MODAL_WIDE,events:{'click .close[data-test-itsi="base-modal-close-button"]':"_onClose"},initialize:function initialize(i){if((i=i||{}).backdrop="static",v.default.fn.modal.Constructor.prototype.enforceFocus=function(){},!i.kpiModel)throw"Must provide kpiModel";if(this.kpiModel=i.kpiModel.clone(),!i.serviceModel)throw"Must provide serviceModel";this.isNestedModalShown=!1,this.featureFlags=i.featureFlags,this.serviceModel=i.serviceModel,this.serviceKpiBackfillMapping=i.serviceKpiBackfillMapping,this.currentStep=i.initialStep||1,this.metricsUtilsInstance=new le.default,this.step1=new he.default({kpiModel:this.kpiModel,serviceModel:this.serviceModel,metricsUtilsInstance:this.metricsUtilsInstance}),this.step2=new pe.default({kpiModel:this.kpiModel,serviceModel:this.serviceModel,metricsUtilsInstance:this.metricsUtilsInstance}),this.step3=new ue.default({kpiModel:this.kpiModel}),this.step4=new fe.default({kpiModel:this.kpiModel,serviceModel:this.serviceModel}),this.step5=new me.default({kpiModel:this.kpiModel,serviceModel:this.serviceModel,serviceKpiBackfillMapping:this.serviceKpiBackfillMapping}),this.steps=[this.step1,this.step2,this.step3,this.step4,this.step5],i.showFTRSteps&&(this.step0=new ce.default({kpiModel:this.kpiModel,serviceModel:this.serviceModel}),this.steps.unshift(this.step0),this.step6=new ge.default({kpiModel:this.kpiModel,serviceModel:this.serviceModel,aggregateThresholdModel:this.kpiModel.getThresholdSettingModel(ee.KPI_THRESHOLD_TYPES.AGGREGATE),entityThresholdModel:this.kpiModel.getThresholdSettingModel(ee.KPI_THRESHOLD_TYPES.ENTITY)}),this.steps.push(this.step6)),this.flashMessagesCollection=new y.default.Collection,this.flashMessages=new se.default({collection:this.flashMessagesCollection}),this.generatedSearchView=new de.default({kpiModel:this.kpiModel});var s="change:threshold_field change:aggregate_statop change:entity_statop change:base_search change:metric change:fill_gaps change:search_alert_earliest change:search_alert_earliest_custom_val change:alert_period change:entity_id_fields change:entity_breakdown_id_fields";this.listenTo(this.kpiModel,s,(0,T.default)(function(i,s){((0,L.default)(i.changed,"metric")||s&&s.replace(/\s+/g,""))&&i.gatherSearchClause({service:this.serviceModel})}.bind(this),Z.DEFAULT_DEBOUNCE_DELAY)),this.listenTo(this.kpiModel,"change:title",function(i){(0,L.default)(i.changed,"title")&&this.$(re.default.HEADER_TITLE_SELECTOR).text(this.kpiModel.get("title"))}.bind(this)),this.hasValidationSearchExecuted=!1,this.hasValidationSearchResults=!1,this.listenTo(this.kpiModel,"change:base_search change:search_type change:metric",()=>{this.resetKpiValidationFlags()}),this.listenTo(this.kpiModel.get("datamodel"),"change:datamodel change:field change:object",()=>{this.resetKpiValidationFlags()}),this.listenTo(this.kpiModel,"change:is_entity_breakdown change:is_service_entity_filter change:datamodel_filter",function(i){i.gatherSearchClause({service:this.serviceModel})}.bind(this)),this.kpiModel.get("search")&&this.kpiModel.getSummaryIndexEarliest(),re.default.prototype.initialize.apply(this,arguments),this.children.cancelButton=new oe.default({dataDismiss:"modal",dataTestItsi:"kpi-modal-cancel-button",onClick:this._onCancel.bind(this),label:(0,W.gettext)("Cancel")}),this.children.backButton=new oe.default({dataTestItsi:"kpi-modal-back-button",label:(0,W.gettext)("Back"),onClick:this._onBack.bind(this),style:{marginLeft:10}}),this.children.nextButton=new oe.default({appearance:"primary",dataTestItsi:"kpi-modal-next-button",label:(0,W.gettext)("Next"),onClick:this._onNext.bind(this),style:{marginLeft:10}}),this.children.finishButton=new oe.default({dataTestItsi:"kpi-modal-finish-button",label:(0,W.gettext)("Finish"),onClick:this._onFinish.bind(this),style:{marginLeft:10}})},resetKpiValidationFlags:function resetKpiValidationFlags(){this.hasValidationSearchExecuted=!1,this.hasValidationSearchResults=!1,this.resetKpiHasResultsModel()},_showKpiChangeWarning:function _showKpiChangeWarning(i){this._toggleButtons(!0,!0),this.isNestedModalShown=!0,(0,v.default)(".kpi-search-and-calculate-modal").fadeOut();var s=v.default.Deferred(),recordWarningAccept=()=>{this._warningFieldsSuppressed=this._warningFieldsSuppressed||{},(0,x.default)(this.kpiModel.getWatchedAttrs({humanReadable:!1}),i=>{this._warningFieldsSuppressed[i]=!0})},onNestedModalClose=()=>{this.isNestedModalShown=!1,(0,v.default)(".kpi-search-and-calculate-modal").fadeIn()},o=(0,v.default)('<div class="service-save-modal-container"></div>');return _.default.unmountComponentAtNode(o.get(0)),_.default.render(S.default.createElement(ne.default,null,S.default.createElement(U.default,{title:(0,W.gettext)("Warning: possible unsafe change"),modalDataTestItsi:"kpi-search-and-calculate-nested-confirm-modal",cancelButtonDataTestItsi:"service-possible-unsafe-changes-no-button",primaryButtonDataTestItsi:"service-possible-unsafe-changes-yes-button",primaryButtonLabel:(0,W.gettext)("Yes"),secondaryButtonLabel:(0,W.gettext)("No"),open:!0,showCancel:!0,closeOnClickAway:!1,modalStyles:X.CONFIRMATION_MODAL_STYLE,primaryButtonClicked:()=>{this._toggleButtons(!1),recordWarningAccept(),onNestedModalClose(),s.resolve()},secondaryButtonClicked:()=>{this._toggleButtons(!1),onNestedModalClose(),s.reject()}},i)),o.get(0)),s.promise()},_advanceStep:function _advanceStep(){if(this.currentStep+1<1||this.currentStep+1>this.steps.length)throw"Invalid step forward";this._removeChildViewsForCurrentStep(this.steps[this.currentStep-1]),this.currentStep++,this.renderStep()},_toggleButtons:function _toggleButtons(i){var s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];i?(s&&(this.children.cancelButton.disable(),this.$('button.close[data-test-itsi="base-modal-close-button"]').css("display","none")),this.children.backButton.disable(),this.children.nextButton.disable(),this.children.finishButton.disable()):(this.children.cancelButton.enable(),1!==this.currentStep&&this.children.backButton.enable(),this.children.nextButton.enable(),this.children.finishButton.enable(),this.$('button.close[data-test-itsi="base-modal-close-button"]').css("display","block"))},resetKpiHasResultsModel:function resetKpiHasResultsModel(){this._toggleButtons(!1),this.onProgressChange(0),this.cleanupSearchJob()},cleanupSearchJob:function cleanupSearchJob(){this.subscription&&(this.subscription.unsubscribe(),this.subscription=null),this.progressSubscription&&(this.progressSubscription.unsubscribe(),this.progressSubscription=null),this.searchJob&&(this.searchJob.cancel(),this.searchJob=null)},_warningIfSearchReturnNoResults:function _warningIfSearchReturnNoResults(){var i;return this.hasValidationSearchExecuted&&this.hasValidationSearchResults||this.featureFlags&&!this.featureFlags[te.featureFlagsStanzas.KPI_SECURITY_CHECK]||!this.isSearchStep()||this.kpiModel.get("search_type")===ae.KPI_SEARCH_TYPES.SHARED_BASE?Promise.resolve():this.hasValidationSearchExecuted&&!this.hasValidationSearchResults?Promise.reject(ae.KPI_VALIDATION_NO_RESULTS_MARKER):(this._toggleButtons(!0,!1),new Promise((s,o)=>{this.onProgressChange(1),this.searchJob=V.default.create({cancelOnUnload:!0,search:this.kpiModel.get("search"),earliest_time:ae.KPI_VALIDATION_EARLIEST_TIME_RANGE,latest_time:"now"},{app:(0,Y.getShortAppName)(!0),owner:K.username}),this.subscription=this.searchJob.getResults({offset:0,count:ae.KPI_VALIDATION_RESULTS_COUNT}).subscribe({next:s=>{i=s},error:()=>{this.hasValidationSearchExecuted=!0,this.hasValidationSearchResults=!1,this._toggleButtons(!1),o(ae.KPI_VALIDATION_SEARCH_ERROR_MARKER)},complete:()=>{this._toggleButtons(!1),this.hasValidationSearchExecuted=!0;var h=!(!i||!Array.isArray(i.results))&&i.results.length>0;h?(s(h),this.hasValidationSearchResults=!0):(o(ae.KPI_VALIDATION_NO_RESULTS_MARKER),this.hasValidationSearchResults=!1)}}),this.progressSubscription=this.searchJob.getProgress().subscribe({next:i=>{var s=(0,P.default)(i,["content","doneProgress"],0);this.onProgressChange((0,$.roundNumber)(100*s,1))}})}))},onProgressChange:function onProgressChange(i){100===i&&(this.removeProgressBarTimeout&&clearTimeout(this.removeProgressBarTimeout),this.removeProgressBarTimeout=setTimeout(()=>{this.onProgressChange(0)},ae.KPI_VALIDATION_PROGRESS_HIDE_DELAY));var s=this.$(".search-results-progress-bar-container");_.default.unmountComponentAtNode(s.get(0)),_.default.render(S.default.createElement(ne.default,null,i>0&&S.default.createElement(S.default.Fragment,null,S.default.createElement("span",{"data-test-itsi":"kpi-search-preview-results-progress-text"},(0,j.sprintf)((0,W.gettext)("Validating search... %(percentage)s%% complete"),{percentage:i})),S.default.createElement(N.default,{"data-test-itsi":"kpi-search-preview-results-progress-bar",percentage:i,tooltip:(0,j.sprintf)((0,W.gettext)("%(percentage)s%% complete."),{percentage:i})}))),s.get(0))},_warnIfKpiChanged:function _warnIfKpiChanged(){var i=v.default.Deferred(),s=function(s,o){if(s)return i.resolve().promise();var h=this.kpiModel.getWatchedAttrs({humanReadable:!1});if(0===(0,R.default)(h,function(i){return!(0,L.default)(this._warningFieldsSuppressed||{},i)}.bind(this)).length)return i.resolve().promise();var v=this.kpiModel.getWatchedAttrs({humanReadable:!0}).join("; "),y=(0,j.sprintf)((0,W.gettext)("The following has changed: %s."),v),_=(0,W.gettext)("Continuing this change will cause features that use historical data (such as adaptive thresholding and anomaly detection) to produce incorrect results. Consider cloning this KPI instead."),S=(0,W.gettext)("Are you sure you want to continue?"),T=[y,"backfillInProgress"===o?(0,W.gettext)("However, there exists an unfinished backfill operation using the previous KPI definition."):(0,W.gettext)("There is some data that exists in the summary index in last 180 days which might not be consistent with this new KPI definition."),_,S].join(" ");return this._showKpiChangeWarning(T)}.bind(this),o=function(s){return console.log("ERROR: problems performing KPI/data consistency check: "+s),this.flashMessagesCollection.reset(),i.resolve().promise()}.bind(this);return this.kpiModel.isConsistentWithSummarizedData().then(s,o)},_attemptStepChange:function _attemptStepChange(){Promise.all([this._warnIfKpiChanged(),this._warningIfSearchReturnNoResults()]).then(i=>{var[,s]=i;"boolean"==typeof s&&!s&&this.isSearchStep()&&"function"==typeof this.step1.setSearchReturnsResults&&this.step1.setSearchReturnsResults(),this._advanceStep(),this.onProgressChange(0)}).catch(i=>{"string"==typeof i&&i===ae.KPI_VALIDATION_NO_RESULTS_MARKER&&this.isSearchStep()&&"function"==typeof this.step1.setSearchReturnsNoResults&&(this.step1.setSearchReturnsNoResults(),this.kpiModel.get("skip_kpi_validation")&&(this._advanceStep(),this.onProgressChange(0)))}).finally(()=>{this.reEnableButton()})},_onCancel:function _onCancel(){this.cleanupSearchJob(),this._removeStepChildReactViews(),this.hide(),this.remove()},_onBack:function _onBack(){if(this.currentStep-1<1||this.currentStep-1>this.steps.length)throw"Invalid step back";this._removeChildViewsForCurrentStep(this.steps[this.currentStep-1]),this.currentStep--,this.flashMessagesCollection.reset(),this.renderStep()},_onNext:function _onNext(){this.children.nextButton.disable();var i=function(){this.flashMessagesCollection.reset()}.bind(this),s=function(i){this.reEnableButton();var s=[];if(i&&Array.isArray(i)&&i.length>0&&(s=s.concat(i.filter(i=>i!==ae.KPI_VALIDATION_FAILED_MARKER))),s.length>0){var o=s.join(" ");this.flashMessagesCollection.reset([{dataTestItsi:"kpi-search-calculate-next-validation-error-message",html:o,type:"error"}])}}.bind(this);this.steps[this.currentStep-1].validate(!0).done(i,this._attemptStepChange.bind(this)).fail(s)},reEnableButton:function reEnableButton(){this.currentStep<this.steps.length&&!this.isNestedModalShown&&this.children.nextButton.enable()},_onFinish:function _onFinish(){this.children.finishButton.disable(),this.cleanUpBeforeSave();for(var i=[],s=0;s<this.steps.length;++s)i.push(this.steps[s].validate(!0));var o=function(){5===this.steps.length?this.trigger("kpichanged",this.kpiModel):this.trigger("kpicreated",this.kpiModel),this.hide(),this.remove()}.bind(this),h=function(i){var s=[];if(i&&Array.isArray(i)&&i.length>0&&(s=s.concat(i.filter(i=>i!==ae.KPI_VALIDATION_FAILED_MARKER&&i!==ae.KPI_VALIDATION_NO_RESULTS_MARKER))),i&&i===ae.KPI_VALIDATION_NO_RESULTS_MARKER&&this.isSearchStep()&&this.step1&&"function"==typeof this.step1.setSearchReturnsNoResults&&(this.step1.setSearchReturnsNoResults(),this.kpiModel.get("skip_kpi_validation")&&o()),s.length>0){var h=s.join(" ");this.flashMessagesCollection.reset([{dataTestItsi:"kpi-search-calculate-finish-validation-error-message",html:h,type:"error"}])}this.$(".kpi-invalid-backfill-time")&&this.$(".kpi-invalid-backfill-time").remove(),this.children.finishButton.enable()}.bind(this);v.default.when.apply(v.default,i).then(this._warnIfKpiChanged.bind(this)).then(this._warningIfSearchReturnNoResults.bind(this)).done(o).fail(h)},_onClose:function _onClose(i){i.preventDefault(),this.cleanupSearchJob(),this._removeStepChildReactViews()},_removeChildViewsForCurrentStep:function _removeChildViewsForCurrentStep(i){"function"==typeof i.removeChildReactViews&&i.removeChildReactViews()},_removeStepChildReactViews:function _removeStepChildReactViews(){(0,x.default)(this.steps,function(i){this._removeChildViewsForCurrentStep(i)}.bind(this))},cleanUpBeforeSave:function cleanUpBeforeSave(){this.kpiModel.get("search_type")===ae.KPI_SEARCH_TYPES.METRIC||this.kpiModel.get("is_metric")||this.kpiModel.unset("metric",{silent:!0}),this.kpiModel.unset("is_metric",{silent:!0}),this.kpiModel.get("search_alert_earliest")===ie.ALERT_EARLIEST.CUSTOM&&parseInt(this.kpiModel.get("search_alert_earliest_custom_val"),10)<=ie.ALERT_EARLIEST.HR_24&&this.kpiModel.set("search_alert_earliest",this.kpiModel.get("search_alert_earliest_custom_val")),this.kpiModel.unset("search_alert_earliest_custom_val")},_handleValidateCallbacks:function _handleValidateCallbacks(i,s){var o=i,h=0,v=[];return function(i){if(h++,i&&i.length>0&&(v=v.concat(i)),h===o){var y=v;if(y.length>0){var _=y.join(" ");this.flashMessagesCollection.reset([{dataTestItsi:"kpi-search-calculate-callback-validation-error-message",html:_,type:"error"}])}else s()}}.bind(this)},isSearchStep:function isSearchStep(){return 5===this.steps.length&&1===this.currentStep||7===this.steps.length&&2===this.currentStep},renderStep:function renderStep(){if(this.currentStep<1||this.currentStep>this.steps.length)throw"Invalid step";this.$(".step-content").children().detach(),this.$(".step-content").append(this.steps[this.currentStep-1].render().$el);var i=(0,j.sprintf)((0,W.gettext)("Step %s of %s: %s"),this.currentStep,this.steps.length,this.steps[this.currentStep-1].getSubTitle());this.$(".header-sub-title").text(i),1===this.currentStep?this.children.backButton.disable():this.children.backButton.enable(),this.currentStep===this.steps.length?this.children.nextButton.disable():this.children.nextButton.enable()},hide:function hide(){re.default.prototype.hide.apply(this,arguments),this.cleanupSearchJob(),this.trigger("hidden")},render:function render(){var i=this.kpiModel.get("title");return this.$el.html(re.default.TEMPLATE),this.$(re.default.HEADER_TITLE_SELECTOR).text(i),this.$(re.default.HEADER_SELECTOR).append('<div class="header-sub-title" data-test-itsi="service-header-sub-title"></div>'),this.$(re.default.FOOTER_SELECTOR).css("display","flex"),this.$(re.default.FOOTER_SELECTOR).append('<div class="search-results-progress-bar-container"></div>'),this.$(re.default.FOOTER_SELECTOR).append('<div class="kpi-search-and-calculate-modal-footer-buttons-container"></div>'),this.$el.find(".kpi-search-and-calculate-modal-footer-buttons-container").append(this.children.cancelButton.render().$el),this.$el.find(".kpi-search-and-calculate-modal-footer-buttons-container").append(this.children.backButton.render().$el),this.$el.find(".kpi-search-and-calculate-modal-footer-buttons-container").append(this.children.nextButton.render().$el),this.$el.find(".kpi-search-and-calculate-modal-footer-buttons-container").append(this.children.finishButton.render().$el),this.$(re.default.BODY_SELECTOR).html(this.flashMessages.render().$el),this.$(re.default.BODY_SELECTOR).append('<div class="step-content"></div>'),this.$(re.default.BODY_SELECTOR).append(this.generatedSearchView.render().$el),this.renderStep(),this},remove:function remove(){this.generatedSearchView.remove();for(var i=0;i<this.steps.length;++i)this.steps[i].remove();return re.default.prototype.remove.apply(this,arguments)}});s.default=ve,i.exports=s.default},1645:function(i,s,o){var h=o(3037);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},1646:function(i,s,o){var h=o(3045);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},1647:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_,S,T,x,R,P,L,N,V=h(o(9)),j=o(64),W=o(49),K=h(o(101)),U=h(o(97)),Y=h(o(252)),$=h(o(42)),X=h(o(70)),Z=h(o(112)),ee=h(o(45)),te=h(o(65)),ie=h(o(53)),ae=h(o(28)),ne=h(o(15)),re=h(o(0)),se=h(o(36)),le=h(o(3)),oe=o(5),de=o(16),ce=o(40),he=o(125),ue=o(190),pe=h(o(407)),fe=h(o(43)),ge=h(o(33)),me=h(o(75)),ve=h(o(860)),ye=h(o(99)),_e=h(o(590)),Se=h(o(86)),be=h(o(96)),Te=h(o(110)),Ee=o(525),ke=o(405),Ce=o(106),xe=o(25),we=o(68),Me=o(133),Re=o(111),Ae=o(135),Ie=o(199),Oe=o(77),Pe=o(200),De=o(76),Le=o(137),Ne=o(149),Ve=o(327),He=o(121),Be=o(362),je=o(1086),We=o(688),Ke=o(185),Fe=h(o(178)),Ge=h(o(3047)),Ue=h(o(3048)),ze=h(o(619)),Ye=h(o(90)),qe=h(o(302)),$e=h(o(79)),Je=h(o(603)),Xe=h(o(694)),Ze=h(o(114)),Qe=h(o(970)),et=h(o(885)),tt=h(o(808)),it=h(o(2809)),at=h(o(2748)),nt=h(o(1966)),rt=h(o(52)),st=h(o(1632)),lt=h(o(1651)),ot=h(o(1652)),dt=h(o(1634)),ct=h(o(3061)),ht=h(o(1323)),ut=h(o(2053)),pt=h(o(2940)),ft=h(o(2944)),gt=h(o(3062)),mt=h(o(2943));o(1653);var vt=(0,Ee.getStore)(),yt=(0,le.default)(_e.default)(v||(v=(0,V.default)(["\n\tcolor: ",";\n"])),ce.variables.contentColorMuted),_t=le.default.span(y||(y=(0,V.default)(["\n\tfont-weight: ",";\n"])),ce.variables.fontWeightBold),St=le.default.img(_||(_=(0,V.default)(["\n\tdisplay: block;\n\tmargin-left: auto;\n\tmargin-right: auto;\n"]))),bt=(0,le.default)(Se.default)(S||(S=(0,V.default)(["\n\tvertical-align: middle;\n\tmargin-right: 5px;\n"]))),Tt=le.default.span(T||(T=(0,V.default)(["\n padding: 6px 0;\n min-width: calc(100vw - 20px * 4);\n"]))),Et=(0,le.default)(me.default)(x||(x=(0,V.default)(["\n\tfont-size: 20px;\n\ttext-align: center;\n\tfont-weight: bold;\n\tmargin-top: 20px;\n\tmargin-bottom: 30px;\n"]))),kt=(0,le.default)(me.default)(R||(R=(0,V.default)(["\n\ttext-align: center;\n\tmargin-top: -10px;\n"]))),Ct=(0,le.default)(pe.default)(P||(P=(0,V.default)(["\n\tmargin-right: 5px;"]))),xt=(0,le.default)(ge.default)(L||(L=(0,V.default)(["\n margin: 20px 0 0;\n"]))),wt=le.default.div(N||(N=(0,V.default)(["\n\tmax-width: 60ch;\n\tword-wrap: break-word;\n"]))),Mt=re.default.createElement(wt,null,(0,de.sprintf)((0,oe.gettext)("Indicates that the KPI is linked to an active %(objectName)s"),{objectName:Be.OBJECT_NAMES.singular})),Rt=ne.default.View.extend({kpiTimePresetsList:[{value:"-7d",label:(0,oe.gettext)("7 days")},{value:"-14d",label:(0,oe.gettext)("14 days")},{value:"-30d",label:(0,oe.gettext)("30 days")},{value:"-60d",label:(0,oe.gettext)("60 days")}],KpiSingleThresholdingView:ht.default,KpiTimeVariantThresholdingView:ut.default,currPageLabelWidth:we.LABEL_WIDTHS.Massive,compiledTemplate:(0,W.template)(gt.default,null,{variable:"vars"}),initialize:function initialize(i){var s,o,h,v,y,_;if(!(i=i||{}).service)throw"Must provide service";if(this.service=i.service,this.linkedServices=i.linkedServices,this.featureFlags=i.featureFlags,this.appsData=i.appsData,this.isServiceTemplate=this.service.get("object_type")===Pe.OBJECT_TYPE,this.canWriteOnGlobalTeam=null===(s=i)||void 0===s||null===(o=s.permissions)||void 0===o?void 0:o.canWriteOnGlobalTeam,this.previewServiceCache=null===(h=i)||void 0===h?void 0:h.previewServiceCache,this.thresholdTemplateCollection=null===(v=i)||void 0===v?void 0:v.thresholdTemplateCollection,this.userTimezoneObject=null===(y=i)||void 0===y||null===(_=y.userData)||void 0===_?void 0:_.timezone,this.hasNoLinkedServicesState=!!this.linkedServices&&0===this.linkedServices.length,this.showAtConfigMessage=!1,this.configMessageAlreadySeen=!1,this.handleConfigChangeDismiss=()=>{this.configMessageAlreadySeen=!0},this.hideRecommendedThresholding=i.hideRecommendedThresholding,!i.kpiModel)throw"Must provide kpiModel";if(this.kpiModel=i.kpiModel,this.isServiceTemplate||i.featureFlags&&!i.featureFlags[Ie.featureFlagsStanzas.ENTITY_LEVEL_AT]){var S;S=this.kpiModel.get("is_recommended_time_policies")?Ae.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED:!this.kpiModel.get("is_threshold_template_option_selected",!1)&&!this.kpiModel.get("kpi_threshold_template_id")||this.kpiModel.get("kpi_threshold_template_id")===Ae.KPI_THRESHOLD_TEMPLATE_TYPES.CUSTOM?Ae.KPI_THRESHOLD_TEMPLATE_TYPES.CUSTOM:Ae.KPI_THRESHOLD_TEMPLATE_TYPES.TEMPLATE,this.radioControlModel=new ne.default.Model({value:S}),this.selectItems=[],this._handleThresholdConfigTabChange=this._handleThresholdConfigTabChange.bind(this),this._onEnableDisableAlerting=this._onEnableDisableAlerting.bind(this),this._onOutlierDetectionSettingsChange=this._onOutlierDetectionSettingsChange.bind(this),this.getCurrentRules=this.getCurrentRules.bind(this),this.getAvailableSeveritiesForDropdown=this.getAvailableSeveritiesForDropdown.bind(this),this.handleKpiAlertingOptionChange=this.handleKpiAlertingOptionChange.bind(this),this.addOrUpdateRuleToKpiModel=this.addOrUpdateRuleToKpiModel.bind(this),this.removeRuleFromKpiModel=this.removeRuleFromKpiModel.bind(this),this.removeAndAddRuleToKpiModel=this.removeAndAddRuleToKpiModel.bind(this),this._configSettingsModel=new ne.default.Model({threshold_config_is_aggregate:!0,adaptive_thresholds_is_enabled:this.kpiModel.get("adaptive_thresholds_is_enabled"),adaptive_thresholding_training_window:this.kpiModel.get("adaptive_thresholding_training_window"),kpiConfigView:i.kpiConfigView||!1}),this.trainingRecommendationIcon=new Je.default({dataTestItsi:"kpi-thresholding-adaptive-training-time-recommender-icon",style:{marginRight:"5px"},type:"starsparklesdouble"}),this.kpiTrainingEarliestTimePicker=new Ye.default({controlType:"SyntheticSelect",controlOptions:{dataTestItsi:"kpi-adaptive-training-time-select",items:this.kpiTimePresetsList,model:this._configSettingsModel,modelAttribute:"adaptive_thresholding_training_window",style:{width:"100%"}},dataTestItsi:"kpi-adaptive-training-time-control-group",label:(0,oe.gettext)("Training window"),labelWidth:we.LABEL_WIDTHS.Plus,tooltip:(0,oe.gettext)("Select the time window over which the KPI adaptive thresholding training should run.")}),this.timeVariantRecommendationIcon=new Je.default({dataTestItsi:"kpi-thresholding-time-policies-recommender-icon",style:{marginRight:"5px"},type:"starsparklesdouble"}),this.outlierRecommendationIcon=new Je.default({dataTestItsi:"kpi-thresholding-outlier-exclusion-recommender-icon",style:{marginRight:"5px"},type:"starsparklesdouble"}),this.outlierAlgoRecommendationIcon=new Je.default({dataTestItsi:"kpi-thresholding-outlier-exclusion-algo-recommender-icon",style:{marginRight:"5px"},type:"starsparklesdouble"}),this.outlierSensitivityRecommendationIcon=new Je.default({dataTestItsi:"kpi-thresholding-outlier-exclusion-sensitivity-recommender-icon",style:{marginRight:"5px"},type:"starsparklesdouble"});var T=this.createSwitchControl(this.kpiModel.get("time_variate_thresholds"),"enable-disable-time-policies",this.handleTimeVariantControlChange.bind(this),(0,oe.gettext)("Enable Time Policies"),(0,oe.gettext)("Enable thresholds that can vary based on time of day."),"kpi-thresholding-time-policies-control-switch","kpi-thresholding-time-policies-control-group");this.enableTimeVariantControl=T.mountNode,this.timeVariantEnableDisableControlDomRef=T.reactDomRef,this.aggregateEntityConfigureControl=this.createThresholdControlTabs(),this.adaptiveRecommendationIcon=new Je.default({dataTestItsi:"kpi-thresholding-adaptive-thresholding-recommender-icon",style:{marginRight:"5px"},type:"starsparklesdouble"});var x=this.createSwitchControl(this._configSettingsModel.get("adaptive_thresholds_is_enabled"),"enable-disable-adaptive-thresholding",this.handleAdaptiveThresholdControlChange.bind(this),(0,oe.gettext)("Enable Adaptive Thresholding"),(0,oe.gettext)("Allow for time varying thresholds to update periodically."),"kpi-thresholding-adaptive-thresholding-control-switch","kpi-thresholding-adaptive-thresholding-control-group");this.enableAdaptiveThresholdControl=x.mountNode,this.adaptiveThresholdEnableDisableControlDomRef=x.reactDomRef,this.isPreviewKpiModelReady=!1,this.isRecommendedThresholdSearchInProgress=!1,this.showRecommendationIcon=!1,this.recommendationResponse={},this.loadingMask=new Xe.default,this.loadingMaskHandler=i=>i?this.loadingMask.show(i):this.loadingMask.hide(),this.listenTo(this.kpiModel,"change:time_variate_thresholds",function(){this._toggleTimeVariantThresholdingView(),this._setThresholdingTemplateState(),this.kpiModel.get("time_variate_thresholds")?this.singleThresholdingPreviewChart&&(this.singleThresholdingPreviewChart.remove(),this.singleThresholdingPreviewChart=null):this._renderSingleThresholdingPreviewChart()}.bind(this));var R=this.kpiModel.get("time_variate_thresholds_specification");this.listenTo(R,"change",function(i,s){if(s&&s.changeManifest){(0,$.default)(["levels","baseSeverity","removePolicy","addPolicy","addTimeBlock","title","policy_type"],function(i){if(s.changeManifest[i])return this.showAtConfigMessage=!0,this._renderApplyATControls(),void(this.kpiModel.get("did_load_recommendation")&&!this.kpiModel.get("was_recommendation_modified")&&this.kpiModel.set("was_recommendation_modified",!0))}.bind(this))}}.bind(this)),this.listenTo(this.kpiModel,"change:adaptive_thresholds_is_enabled",(function(){this.kpiModel.get("adaptive_thresholds_is_enabled")||this._changePoliciesToStatic(),this._toggleAdaptiveThresholdingControls()})),this.listenTo(R,"applyat",()=>this.isServiceTemplate&&this._repaint()),this.listenTo(this.kpiModel,"change:kpi_threshold_template_id",this._changeThresholdTemplate),this.listenTo(this.kpiModel,"change:is_entity_breakdown",this._toggleAggregateEntitySelector),this.listenTo(this.kpiModel,"change:search",this._toggleTimeVariantThresholdingView),this.listenTo(this.kpiModel,"change:aggregate_outlier_detection_enabled change:outlier_detection_algo change:outlier_detection_sensitivity",()=>{this.kpiModel.get("did_load_recommendation")&&!this.kpiModel.get("was_recommendation_modified")&&this.kpiModel.set("was_recommendation_modified",!0),this.showAtConfigMessage=!0,this._renderApplyATControls()}),this.listenTo(this._configSettingsModel,"change:adaptive_thresholds_is_enabled",function(){this.kpiModel.set("adaptive_thresholds_is_enabled",this._configSettingsModel.get("adaptive_thresholds_is_enabled"))}.bind(this)),this.listenTo(this._configSettingsModel,"change:adaptive_thresholding_training_window",function(){this.kpiModel.set("adaptive_thresholding_training_window",this._configSettingsModel.get("adaptive_thresholding_training_window")),this.showAtConfigMessage=!0,this._renderApplyATControls()}.bind(this)),this.listenTo(this._configSettingsModel,"change:threshold_config_is_aggregate",this._toggleThresholdingConfigSettings);var P="change:adaptive_thresholds_is_enabled change:adaptive_thresholding_training_window change:time_variate_thresholds change:time_variate_thresholds_specification";this.listenTo(this.kpiModel,P,(function(){this.kpiModel.get("did_load_recommendation")&&!this.kpiModel.get("was_recommendation_modified")&&this.kpiModel.set("was_recommendation_modified",!0)})),this.singleThresholdingSummaryIndexCheckComplete=!1,this.singleThresholdingUseRawSearch=!0;var L=[this.kpiModel.getThresholdSettingModel(Ae.KPI_THRESHOLD_TYPES.AGGREGATE),this.kpiModel.getThresholdSettingModel(Ae.KPI_THRESHOLD_TYPES.ENTITY)];L.forEach(i=>this.listenTo(i,"change",this._renderSingleThresholdingPreviewChart)),this.checkSingleThresholdingShouldUseRawSearch(),this.children={},this.children.documentationLink=new $e.default({dataTestItsi:"threshold-timezones-external-link",icon:"external",isLink:!0,label:(0,oe.gettext)("Learn more"),openInNewContext:!0,to:(0,xe.makeDocsURL)("app.itsi.threshold_timezones")}),this.isServiceTemplate&&(this.singleThresholdingView=new this.KpiSingleThresholdingView({kpiModel:this.kpiModel,service:this.service,configSettingsModel:this._configSettingsModel,aggregateThresholdModel:this.kpiModel.getThresholdSettingModel(Ae.KPI_THRESHOLD_TYPES.AGGREGATE),entityThresholdModel:this.kpiModel.getThresholdSettingModel(Ae.KPI_THRESHOLD_TYPES.ENTITY)}),this.previewKpiModel=this.kpiModel,this.previewServiceModel=this.service,this.stopListening(this.previewKpiModel,"change"),this.listenTo(this.previewKpiModel,"change",this._onKPIChange),this.previewModel=new ne.default.Model({serviceId:""}),this.listenTo(this.previewModel,"change:serviceId",this._onSelectService))}ne.default.View.prototype.initialize.apply(this,arguments)},createSwitchControl:function createSwitchControl(i,s,o,h,v,y,_){var S,T=(0,ae.default)('<div class="'.concat(s,'"></div>')).css({display:"inline-block","vertical-align":"middle"});return se.default.unmountComponentAtNode(T.get(0)),se.default.render(re.default.createElement(rt.default,null,re.default.createElement(Qe.default,{controlGroupDataTestItsi:_,dataTestItsi:y,enabled:i,hasControlGroup:!0,onChange:o,size:"medium",label:h,labelWidth:this.currPageLabelWidth,tooltip:v,ref:i=>{S=i}})),T.get(0)),{mountNode:T,reactDomRef:S}},handleTimeVariantControlChange:function handleTimeVariantControlChange(i){this.kpiModel.set({time_variate_thresholds:i}),this.renderRadioControl()},handleAdaptiveThresholdControlChange:function handleAdaptiveThresholdControlChange(i){this._configSettingsModel.set({adaptive_thresholds_is_enabled:i})},createThresholdControlTabs:function createThresholdControlTabs(){var i=(0,ae.default)('<div class="threshold-config-tabs-container"></div>');return se.default.unmountComponentAtNode(i.get(0)),se.default.render(re.default.createElement(rt.default,null,re.default.createElement(ft.default,{handleTabChange:this._handleThresholdConfigTabChange,showRecommendationIcon:this.showRecommendationIcon})),i.get(0)),i},_handleThresholdConfigTabChange:function _handleThresholdConfigTabChange(i){i===Ae.KPI_THRESHOLD_TYPES.AGGREGATE?this._configSettingsModel.set({threshold_config_is_aggregate:!0}):this._configSettingsModel.set({threshold_config_is_aggregate:!1})},_onKPIChange:function _onKPIChange(){this.hasNoLinkedServicesState||this.kpiModel.trigger("change")},_populateThresholdTemplatePicker:function _populateThresholdTemplatePicker(){var i=[];this.thresholdTemplateCollection&&((0,$.default)(this.thresholdTemplateCollection.models,(function(s){i.push({value:s.get("_key"),label:s.get("title")})})),this.selectItems=i,this.renderRadioControl())},_generateTemplate:function _generateTemplate(){var i={owner:He.USERS.DEFAULT_ADMIN,can_write:!0,perms:{write:[],read:[]},modifiable:!0,can_share_app:!0,can_share_global:!0,sharing:Ve.PERMISSIONS.APP,can_share_user:!0,can_change_perms:!0},s=this.kpiModel.get("adaptive_thresholding_training_window"),o=this.kpiModel.get("adaptive_thresholds_is_enabled"),h=this.kpiModel.get("time_variate_thresholds"),v=this.kpiModel.get("time_variate_thresholds_specification"),y=this.kpiModel.get("aggregate_outlier_detection_enabled"),_=this.kpiModel.get("outlier_detection_algo"),S=this.kpiModel.get("outlier_detection_sensitivity");return new st.default({title:"",description:"",acl:i,sec_grp:Ne.GLOBAL_TEAM_KEY,adaptive_thresholding_training_window:s,time_variate_thresholds:h,adaptive_thresholds_is_enabled:o,time_variate_thresholds_specification:v,aggregate_outlier_detection_enabled:y,outlier_detection_algo:_,outlier_detection_sensitivity:S})},_exportTemplate:function _exportTemplate(){if(this.canWriteOnGlobalTeam){var i=this._generateTemplate(),s=function(i){var s=this.thresholdTemplateCollection.pluck("title");return(0,W.contains)(s,i)?{isValid:!1,message:(0,oe.gettext)("A template with this title already exists.")}:""===i.replace(/\s+/g,"")?{isValid:!1,message:(0,oe.gettext)("Title field is required.")}:{isValid:!0,message:""}}.bind(this),o=new At({model:{savedPage:i,validate:s},objectNameSingular:i.objectNameSingular,onHiddenRemove:!0});(0,ae.default)("body").append(o.render().el),o.show(),o.on("exportcomplete",i=>{this.thresholdTemplateCollection.fetch().done(()=>{this._populateThresholdTemplatePicker();var s=i.id;this.kpiModel.set("kpi_threshold_template_id",s,{silent:!0}),this.radioControlModel.set("value",Ae.KPI_THRESHOLD_TEMPLATE_TYPES.TEMPLATE),this.renderRadioControl(),this._applyThresholdTemplate(s),this._setThresholdingTemplateState()}).fail(()=>{})})}},updateThresholdInKpiModel:function updateThresholdInKpiModel(i){if(this.kpiModel.unset("kpi_threshold_template_id"),i.isTimeVariateThresholds){var s=new tt.default((0,K.default)(i.timeVariateThresholdsSpecification),{parse:!0});this.kpiModel.set({time_variate_thresholds_specification:s})}else if(i.thresholdType===Ae.KPI_THRESHOLD_TYPES.ENTITY){var o=new et.default(JSON.parse(JSON.stringify((0,K.default)(i.entityThresholdsConfig))),{parse:!0});this.kpiModel.set({entity_thresholds:o})}else{var h=new et.default(JSON.parse(JSON.stringify((0,K.default)(i.aggregateThresholdsConfig))),{parse:!0});this.kpiModel.set({aggregate_thresholds:h})}},render:function render(){if(!this.isServiceTemplate&&this.featureFlags&&this.featureFlags[Ie.featureFlagsStanzas.ENTITY_LEVEL_AT])return se.default.unmountComponentAtNode(this.$el.get(0)),se.default.render(re.default.createElement(j.Provider,{store:vt},re.default.createElement(ze.default,null,re.default.createElement(Ue.default,{appsData:this.appsData,kpiModel:this.kpiModel,thresholdTemplateCollection:this.thresholdTemplateCollection,canWriteOnGlobalTeam:this.canWriteOnGlobalTeam,generateTemplate:this._generateTemplate.bind(this),updateThresholdInKpiModel:this.updateThresholdInKpiModel.bind(this)}))),this.$el.get(0)),this;var i=new Ze.default({content:(0,oe.gettext)("Loading thresholding info..."),dataTestItsi:"kpi-thresholding-content-view-loading-message",style:{marginLeft:20},type:"info"});return(0,ae.default)("body").append(this.loadingMask.render().el),this.$el.html(i.render().$el),this._renderKpiThresholdingContentView(),this._populateThresholdTemplatePicker(),this},_populateServiceSelector:function _populateServiceSelector(){for(var i=[],s=0;s<this.linkedServices.length;++s){var o=this.linkedServices[s];i.push({label:o.title,value:o._key})}this.serviceSelector=new Ye.default({controlType:"SyntheticSelect",controlOptions:{dataTestItsi:"kpi-thresholding-preview-service-select",items:i,model:this.previewModel,modelAttribute:"serviceId",style:{width:300},truncate:!0,typeAheadFilter:!0},dataTestItsi:"kpi-thresholding-preview-service-control-group",label:(0,oe.gettext)("Preview Service"),labelWidth:this.currPageLabelWidth}),i.length>0?(this.previewModel.set("serviceId",i[0].value),this.$(".thresholding-configure-preview-service").append(this.serviceSelector.render().$el)):this._renderNoServiceState()},_renderError:function _renderError(i,s){this._clearTimeVariantThresholdingView();var o=new Ze.default({content:s,dataTestItsi:i,type:"error"});this.$(".thresholding-configure-error-state").html(o.render().$el),this.$(".thresholding-configure-error-state").show(),this.$(".thresholding-configure-aggregate-entity-toggle").hide(),this.$(".thresholding-default-container").hide(),this.$(".thresholding-configure-preview-service").hide(),this.$(".thresholding-time-policy-container").hide()},_renderNoServiceState:function _renderNoServiceState(){this.hasNoLinkedServicesState=!0,this._renderError("thresholding-configure-at-least-one-service-error-message",(0,oe.gettext)("At least one service must be linked to the service template to enable the preview."))},_renderNewKPIState:function _renderNewKPIState(){this.stopListening(this.previewKpiModel,"change"),this._renderError("thresholding-configure-no-kpi-yet-error-message",(0,oe.gettext)("Threshold previews cannot be displayed until this KPI is created in the linked services. After saving the service template and propagating the changes, threshold previews will appear here."))},_onSelectService:function _onSelectService(){var i=this.previewModel.get("serviceId");if(this.previewServiceModel&&this.previewServiceModel._key===i)this._updateKpiModel(this.previewServiceModel),this._repaint();else{var s=this.previewServiceCache&&this.previewServiceCache[i];s?(this.previewServiceModel=s,this._updateKpiModel(this.previewServiceCache[i]),this.isPreviewKpiModelReady=!0,this._repaint()):(this.previewServiceModel=new qe.default({_key:i}),this.previewServiceModel.fetch().done(function(){this.previewServiceCache&&(this.previewServiceCache[i]=this.previewServiceModel),this._updateKpiModel(this.previewServiceModel),this.isPreviewKpiModelReady=!0,this._repaint()}.bind(this)).fail((function(){})))}},_updateKpiModel:function _updateKpiModel(i){this.stopListening(this.previewKpiModel,"change"),this.previewKpiModel=(0,X.default)(i.get("kpis").models,function(i){return this.kpiModel.get("title")===i.get("title")}.bind(this)),this.previewKpiModel&&(this.listenTo(this.previewKpiModel,"change",this._onKPIChange),this.listenTo(this.previewKpiModel.get("aggregate_thresholds"),"change",(function(){this._renderSingleThresholdingPreviewChart()})))},_clearTimeVariantThresholdingView:function _clearTimeVariantThresholdingView(){this.timeVariantThresholdingView&&this.timeVariantThresholdingView.remove()},handleRadioChange:function handleRadioChange(i){i===Ae.KPI_THRESHOLD_TEMPLATE_TYPES.CUSTOM?(this.kpiModel.unset("kpi_threshold_template_id"),this.kpiModel.unset("is_threshold_template_option_selected"),this.kpiModel.set("is_recommended_time_policies",!1),this.kpiModel.set("was_recommendation_modified",!1),this.kpiModel.set("did_load_recommendation",!1),this.kpiModel.unset("recommendation_apply_as_value"),this.kpiModel.unset("recommendation_apply_to_value"),this.kpiModel.unset("recommendation_start_date"),this.kpiModel.unset("recommendation_training_window"),this.kpiModel.unset("threshold_direction"),this._removeRecommendedInfoViewAndRecommendationIcons()):i===Ae.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED?(this.kpiModel.set("is_recommended_time_policies",!0),this.kpiModel.unset("is_threshold_template_option_selected"),this.kpiModel.unset("kpi_threshold_template_id"),this.kpiModel.unset("recommendation_apply_as_value",Le.RECOMMENDATION_APPLY_AS_OPTIONS[0].value),this.kpiModel.set("recommendation_apply_to_value",Le.RECOMMENDATION_APPLY_TO_OPTIONS[0].value),this.kpiModel.set("recommendation_start_date",(0,Te.default)().subtract(Le.ANALYSIS_WINDOW_OPTIONS[1].days,"days").unix()),this.kpiModel.set("recommendation_training_window",Le.ANALYSIS_WINDOW_OPTIONS[1].value),this.kpiModel.set("threshold_direction",Le.THRESHOLD_CONFIGURATION_OPTIONS[0].value)):(this.kpiModel.set("is_threshold_template_option_selected",!0),this.kpiModel.set("is_recommended_time_policies",!1),this.kpiModel.set("was_recommendation_modified",!1),this.kpiModel.set("did_load_recommendation",!1),this.kpiModel.unset("recommendation_apply_as_value"),this.kpiModel.unset("recommendation_apply_to_value"),this.kpiModel.unset("recommendation_start_date"),this.kpiModel.unset("recommendation_training_window"),this.kpiModel.unset("threshold_direction"),this._removeRecommendedInfoViewAndRecommendationIcons()),this.radioControlModel.set("value",i),i!==Ae.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED&&this.$(".thresholding-recommendation-error-container").get(0).children.length&&this._renderKpiThresholdingContentView()},handleSelectChange:function handleSelectChange(i){this.kpiModel.set("kpi_threshold_template_id",i)},handleApplyAsValueChange:function handleApplyAsValueChange(i){this.kpiModel.set("recommendation_apply_as_value",i),this.kpiModel.set("did_load_recommendation",!1)},handleApplyToValueChange:function handleApplyToValueChange(i){this.kpiModel.set("recommendation_apply_to_value",i),this.kpiModel.set("did_load_recommendation",!1)},handleAnalysisWindowChange:function handleAnalysisWindowChange(i){this.kpiModel.set("recommendation_training_window",i),this.kpiModel.set("did_load_recommendation",!1)},handleAnalysisWindowStartDateChange:function handleAnalysisWindowStartDateChange(i){this.kpiModel.set("recommendation_start_date",i),this.kpiModel.set("did_load_recommendation",!1)},handleThresholdConfigChange:function handleThresholdConfigChange(i){this.kpiModel.set("threshold_direction",i),this.kpiModel.set("did_load_recommendation",!1)},cleanupRecommendedThresholdsSearchJob:function cleanupRecommendedThresholdsSearchJob(){this.subscription&&(this.subscription.unsubscribe(),this.subscription=null),this.progressSubscription&&(this.progressSubscription.unsubscribe(),this.progressSubscription=null),this.searchJob&&(this.searchJob.cancel(),this.searchJob=null)},cleanupKPIThresholdDataSearchDataJob:function cleanupKPIThresholdDataSearchDataJob(){this.KPIThresholdDataSearchSubscription&&(this.KPIThresholdDataSearchSubscription.unsubscribe(),this.KPIThresholdDataSearchSubscription=null),this.KPIThresholdDataSearchJob&&(this.KPIThresholdDataSearchJob.cancel(),this.KPIThresholdDataSearchJob=null)},_createKPIThresholdDataSearchDataJob:function _createKPIThresholdDataSearchDataJob(){var i;this.cleanupKPIThresholdDataSearchDataJob();var s=Te.default.unix(this.kpiModel.get("recommendation_start_date")),o=s.clone(),h=this.kpiModel.get("recommendation_training_window").match(/\d+/g)[0];o.add(h,"days");var v={search:(0,Ke.getMetricIndexEarliestTimeSearchForKPIData)([this.kpiModel.get("_key")]),earliest_time:"-".concat((0,Te.default)().diff(s,"day"),"d"),latest_time:(0,Te.default)().isSame(o,"day")?"now":"-".concat((0,Te.default)().diff(o,"day"),"d"),autostart:!0,auto_cancel:300},y={app:(0,Ce.getShortAppName)(!0),owner:he.username};return this.KPIThresholdDataSearchJob=be.default.create(v,y),new Promise((s,o)=>{this.KPIThresholdDataSearchSubscription=this.KPIThresholdDataSearchJob.getResults().subscribe({next:s=>{i=s},error:i=>{o(i)},complete:()=>{s(i)}})})},_createRecommendedThresholdsSearchJob:function _createRecommendedThresholdsSearchJob(){var i,s=Te.default.unix(this.kpiModel.get("recommendation_start_date")),o=s.clone(),h=this.kpiModel.get("recommendation_training_window").match(/\d+/g)[0];o.add(h,"days");var v={search:(0,Ke.getRecommendedThresholdSearchForKPIs)([this.kpiModel.get("_key")],null,this.kpiModel.get("threshold_direction")),earliest_time:"-".concat((0,Te.default)().diff(s,"day"),"d"),latest_time:(0,Te.default)().isSame(o,"day")?"now":"-".concat((0,Te.default)().diff(o,"day"),"d"),autostart:!0,auto_cancel:300},y={app:(0,Ce.getShortAppName)(!0),owner:he.username};return this.searchJob=be.default.create(v,y),new Promise((s,o)=>{this.subscription=this.searchJob.getResults().subscribe({next:s=>{i=s},error:i=>{o(i)},complete:()=>{this._onThresholdRecommendationProgress(100,!0),s(i)}}),this.progressSubscription=this.searchJob.getProgress().subscribe({next:i=>{var s=(0,Z.default)(i,["content","doneProgress"],0);s>0&&this._onThresholdRecommendationProgress((0,xe.roundNumber)(100*s,1))}})})},_handleLoadRecommendationsConfirmationModalSearchJobStatusHandler:function _handleLoadRecommendationsConfirmationModalSearchJobStatusHandler(i,s){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],h=(0,oe.gettext)("Loading recommendations will cause all existing threshold settings to be overwritten. Are you sure you want to load recommendations?");se.default.render(re.default.createElement(rt.default,null,re.default.createElement(Fe.default,{hideCloseButton:!o,disablePrimaryClick:!o,disableCancelClick:!o,modalDataTestItsi:"load-recommendations-modal",cancelButtonDataTestItsi:"load-recommendations-modal-cancel-button",primaryButtonDataTestItsi:"load-recommendations-modal-confirm-button",showCancel:o,open:!0,title:(0,oe.gettext)("Load Recommendations"),primaryButtonLabel:(0,oe.gettext)("Confirm"),primaryButtonClicked:this._handleLoadRecommendations.bind(this)}," ",o&&h,i)),s.get(0))},_handleLoadRecommendations:function _handleLoadRecommendations(){this.isRecommendedThresholdSearchInProgress=!0,this._renderKpiThresholdingContentView(),this._onThresholdRecommendationProgress(1),this.cleanupRecommendedThresholdsSearchJob(),this.recommendedThresholdsSearchPromise=this._createRecommendedThresholdsSearchJob();var i=ae.default.Deferred();this.recommendedThresholdsSearchPromise.then(s=>{var o,h;if(this.isRecommendedThresholdSearchInProgress=!1,!s||(0,ee.default)(s.results)||(0,ee.default)(s.fields)){var v="";s.messages&&(v=s.messages[0].text);var y=(0,de.sprintf)((0,oe.gettext)("Recommendation failed to be generated. No results returned. %(searchMsg)s"),{searchMsg:v});return this._handleLoadRecommendationsErrorMessage(y),void i.reject()}if(s.results[0][Le.RECOMMENDATION_FIELD]!==Le.KPI_RECOMMENDATIONS.SUCCESSFUL&&s.results[0][Le.RECOMMENDATION_FIELD]!==Le.KPI_NO_RECOMMENDATIONS.NO_PATTERN)return this._handleLoadRecommendationsNoRecommendation(s.results[0][Le.RECOMMENDATION_FIELD]),void i.reject();var _=s.fields.findIndex(i=>(0,te.default)(i.name,"Threshold Direction")),S=null!==(o=s.results)&&void 0!==o&&o.length?s.results[0][s.fields[_].name]:this.kpiModel.get("threshold_direction");if(this.recommendationResponse=s,s.results[0][Le.RECOMMENDATION_FIELD]===Le.KPI_NO_RECOMMENDATIONS.NO_PATTERN)return this.kpiModel.set({time_variate_thresholds:!1,aggregate_outlier_detection_enabled:!1,threshold_direction:S,threshold_recommendations:s.results}),this._configSettingsModel.set({adaptive_thresholds_is_enabled:!1}),void i.resolve(s);var T=s.fields.findIndex(i=>(0,te.default)(i.name,"Sensitivity")),x=Le.OUTLIER_DEFAULT_DETECTION_SENSITIVITY;null!==(h=s.results)&&void 0!==h&&h.length&&(x=s.results[0][s.fields[T].name]===Le.OUTLIER_NO_RECOMMENDATION?s.results[0][s.fields[T].name]:Number(s.results[0][s.fields[T].name])),x!==Le.OUTLIER_NO_RECOMMENDATION?this.kpiModel.set({time_variate_thresholds:!0,aggregate_outlier_detection_enabled:!0,outlier_detection_algo:Le.OUTLIER_RECOMMENDATION_DETECTION_ALGORITHM,outlier_detection_sensitivity:x,threshold_direction:S,threshold_recommendations:s.results}):this.kpiModel.set({time_variate_thresholds:!0,aggregate_outlier_detection_enabled:!1,threshold_direction:S,threshold_recommendations:s.results}),this._configSettingsModel.set({adaptive_thresholds_is_enabled:!0,adaptive_thresholding_training_window:this.kpiModel.get("recommendation_training_window")}),this.showAtConfigMessage=!0,this.recommendationResponse=s,i.resolve(s)}).catch(s=>{this.isRecommendedThresholdSearchInProgress=!1;var o=(0,de.sprintf)((0,oe.gettext)("Error encountered while loading recommendations. %(error)s"),{error:s});this._handleLoadRecommendationsErrorMessage(o),i.reject(s)})},_showLoadRecommendationsConfirmModal:function _showLoadRecommendationsConfirmModal(){var i=this.kpiModel.get("recommendation_training_window").match(/\d+/g)[0],s=this.$(".thresholding-confirmation-dialog");se.default.unmountComponentAtNode(s.get(0));var o=re.default.createElement(Tt,null,re.default.createElement(bt,{"data-test-itsi":"load-recommendation-wait-spinner",size:"medium"})," ",(0,oe.gettext)("Checking for KPI data in the selected time range..."));this._handleLoadRecommendationsConfirmationModalSearchJobStatusHandler(o,s,!1),this._createKPIThresholdDataSearchDataJob().then(h=>{var v=h.results.length?Math.ceil((new Date-1e3*Number(h.results[0].earliest_data_time))/864e5):0;o=v<Number(i)&&re.default.createElement(xt,{type:"warning",appearance:"fill"},(0,de.sprintf)((0,oe.gettext)("You have only %(data_range)d days of summary data for this KPI."),{data_range:v})),this._handleLoadRecommendationsConfirmationModalSearchJobStatusHandler(o,s,!0)}).catch(()=>{o=re.default.createElement(xt,{type:"error",appearance:"fill"},(0,oe.gettext)("Unable to identify KPI data for the number of days selected. Update the analysis window and try again.")),this._handleLoadRecommendationsConfirmationModalSearchJobStatusHandler(o,s,!0)})},generateSeverityModel:function generateSeverityModel(i){var s=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,h=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,v=new et.default({},{parse:!0}),y=[],_=function _loop(i){var v=Array.isArray(T)?T:[T],_=Re.DEFAULT_SEVERITY_LEVELS.find(s=>s.severityLabel===i);if(_)for(var S of v){var x=void 0;x=s?{severityLabel:_.severityLabel,severityValue:_.severityValue,severityColor:_.severityColor,severityColorLight:_.severityColorLight,thresholdValue:S*h+o,dynamicParam:S}:{severityLabel:_.severityLabel,severityValue:_.severityValue,severityColor:_.severityColor,severityColorLight:_.severityColorLight,dynamicParam:0,thresholdValue:S},y.push(x)}};for(var[S,T]of Object.entries(i))_(S);if(s){y.sort((i,s)=>i.dynamicParam-s.dynamicParam);for(var x=0;x<y.length;x++)v.addThreshold(y[x])}else{y.sort((i,s)=>i.thresholdValue-s.thresholdValue);for(var R=0;R<y.length;R++)v.addThreshold(y[R])}if(this.kpiModel.get("threshold_direction")!==Le.THRESHOLD_CONFIGURATION_OPTIONS[2].value){var P=Re.DEFAULT_SEVERITY_LEVELS[5];v.updateBaseSeverity({baseSeverityLabel:P.severityLabel,baseSeverityValue:P.severityValue,baseSeverityColor:P.severityColor,baseSeverityColorLight:P.severityColorLight},!0)}return v},_populateThresholdConfigFromRecommendations:function _populateThresholdConfigFromRecommendations(){if(this.recommendationResponse.results){var i=this.recommendationResponse.fields.findIndex(i=>(0,te.default)(i.name,"Cron Expression")),s=this.recommendationResponse.fields.findIndex(i=>(0,te.default)(i.name,"Duration")),o=this.recommendationResponse.fields.findIndex(i=>(0,te.default)(i.name,"Thresholds")),h=this.recommendationResponse.fields.findIndex(i=>(0,te.default)(i.name,"Algorithm")),v=this.recommendationResponse.fields.findIndex(i=>(0,te.default)(i.name,"Confidence")),y=this.recommendationResponse.fields.findIndex(i=>(0,te.default)(i.name,"Score")),_=this.recommendationResponse.fields.findIndex(i=>(0,te.default)(i.name,"Time Policy")),S=this.recommendationResponse.fields.findIndex(i=>(0,te.default)(i.name,"Mean")),T=this.recommendationResponse.fields.findIndex(i=>(0,te.default)(i.name,"Std"));if(this.recommendationResponse.results[0][Le.RECOMMENDATION_FIELD]===Le.KPI_NO_RECOMMENDATIONS.NO_PATTERN){var x=this.recommendationResponse.results[0][this.recommendationResponse.fields[o].name].replace(/'/g,'"'),R=JSON.parse(x),P=this.generateSeverityModel(R,!1);this.kpiModel.set({aggregate_thresholds:P})}else{for(var L=this.kpiModel.get("time_variate_thresholds_specification"),N=new nt.default({_key:Ae.DEFAULT_POLICY_KEY,title:(0,oe.gettext)("Default"),time_blocks:[]}),V=new at.default([N]),j=0;j<this.recommendationResponse.results.length;j++){var W=(0,xe.generateUUID)(),K=[[this.recommendationResponse.results[j][this.recommendationResponse.fields[i].name],parseInt(this.recommendationResponse.results[j][this.recommendationResponse.fields[s].name],10)]],U=(0,Oe.getUserTimezoneOffset)("sec"),Y=(0,Ae.getPolicyTitleFromTimeBlock)(K,U),$=this.recommendationResponse.results[j][this.recommendationResponse.fields[o].name].replace(/'/g,'"'),X=JSON.parse($),Z=parseFloat(this.recommendationResponse.results[j][this.recommendationResponse.fields[S].name],0),ee=parseFloat(this.recommendationResponse.results[j][this.recommendationResponse.fields[T].name],0),ie=this.generateSeverityModel(X,!0,Z,ee),ae=new nt.default({_key:W,title:Y,aggregate_thresholds:ie,policy_type:this.recommendationResponse.results[j][this.recommendationResponse.fields[h].name],time_blocks:K});V.push(ae)}L.set(L.parse({policies:JSON.parse(JSON.stringify(V))}))}this.kpiModel.set({did_load_recommendation:!0}),this.kpiModel.set({was_recommendation_modified:!1}),this.showRecommendationIcon=!0,this._renderKpiThresholdingContentView(),this._loadRecommendedInfoView(this.recommendationResponse.results[0][this.recommendationResponse.fields[v].name],this.recommendationResponse.results[0][this.recommendationResponse.fields[y].name],this.recommendationResponse.results[0][this.recommendationResponse.fields[_].name],this.recommendationResponse.results[0][this.recommendationResponse.fields[h].name],this.kpiModel.toJSON())}},_loadRecommendedInfoView:function _loadRecommendedInfoView(i,s,o,h,v){var y=this.$(".thresholding-recommendation-info-container");se.default.unmountComponentAtNode(y.get(0)),se.default.render(re.default.createElement(rt.default,null,re.default.createElement(Ge.default,{confidenceLevel:i,confidenceScore:s,timePolicyDesc:o,timePolicyType:h,kpiObj:v})),y.get(0))},_removeRecommendedInfoViewAndRecommendationIcons:function _removeRecommendedInfoViewAndRecommendationIcons(){var i=this.$(".thresholding-recommendation-info-container");se.default.unmountComponentAtNode(i.get(0)),this.timeVariantRecommendationIcon.remove(),this.trainingRecommendationIcon.remove(),this.adaptiveRecommendationIcon.remove(),this.outlierRecommendationIcon.remove(),this.outlierAlgoRecommendationIcon.remove(),this.outlierSensitivityRecommendationIcon.remove()},_onThresholdRecommendationProgress:function _onThresholdRecommendationProgress(i,s){s&&(this.removeProgressBarTimeout&&clearTimeout(this.removeProgressBarTimeout),this.removeProgressBarTimeout=setTimeout(()=>{this._onThresholdRecommendationProgress(0),this._populateThresholdConfigFromRecommendations()},500));var o=this.$(".thresholding-recommendation-progress-control");se.default.unmountComponentAtNode(o.get(0)),se.default.render(re.default.createElement(rt.default,null,i>0&&re.default.createElement(re.default.Fragment,null,re.default.createElement(_t,{"data-test-itsi":"kpi-thresholding-recommendation-progress-text"},(0,de.sprintf)((0,oe.gettext)("Loading recommended threshold configuration based on an analysis of your KPI..."))),re.default.createElement(ve.default,{"data-test-itsi":"kpi-thresholding-recommendation-progress-bar",percentage:i,tooltip:(0,de.sprintf)((0,oe.gettext)("%(percentage)s%% complete."),{percentage:i})}))),o.get(0))},_handleLoadRecommendationsNoRecommendation:function _handleLoadRecommendationsNoRecommendation(i){switch(i){case Le.KPI_NO_RECOMMENDATIONS.CONSTANT_KPI:this._handleLoadRecommendationsErrorMessage((0,oe.gettext)("We detected a constant value in your data and are unable to recommend threshold values and settings."));break;case Le.KPI_NO_RECOMMENDATIONS.INSUFFICIENT_DATA:this._handleNoRecommendationInsufficientDataMessage();break;case Le.KPI_NO_RECOMMENDATIONS.PATTERN_SWITCH:this._handleLoadRecommendationsErrorMessage((0,oe.gettext)("We could not detect a consistent pattern in your data. It appears that there is more than one pattern."));break;default:this._handleLoadRecommendationsErrorMessage((0,de.sprintf)((0,oe.gettext)("No recommendations available due to unknown reason: %(reasonCode)s"),{reasonCode:i}))}},_handleNoRecommendationInsufficientDataMessage(){var i=this.$(".thresholding-recommendation-error-container");this._onThresholdRecommendationProgress(0),this.renderRadioControl(),se.default.unmountComponentAtNode(i.get(0)),se.default.render(re.default.createElement(rt.default,null,re.default.createElement(St,{src:(0,ue.createStaticURL)("".concat(Le.STATIC_IMAGES_BASE_URL).concat("disk.svg")),"data-test-itsi":"no-recommendation-insufficient-data-image"}),re.default.createElement(Et,{"data-test-itsi":"no-recommendation-insufficient-data-header"},(0,oe.gettext)("Insufficient Data")),re.default.createElement(kt,{"data-test-itsi":"no-recommendation-insufficient-data-msg"},(0,oe.gettext)("Your KPI does not have enough data for our system to produce targeted recommendations for the options you previously selected.")),re.default.createElement(kt,{"data-test-itsi":"no-recommendation-insufficient-data-try-again-msg"},(0,oe.gettext)("Choose different options and try again."))),i.get(0))},_handleLoadRecommendationsErrorMessage:function _handleLoadRecommendationsErrorMessage(i){var s=this.$(".thresholding-recommendation-error-container");this._onThresholdRecommendationProgress(0),this.renderRadioControl(),se.default.unmountComponentAtNode(s.get(0)),se.default.render(re.default.createElement(rt.default,null,i&&re.default.createElement(xt,{appearance:"fill",type:"error",onRequestRemove:this._renderKpiThresholdingContentView.bind(this)},i)),s.get(0))},_renderCustomThresholdWindowStatus:function _renderCustomThresholdWindowStatus(){var i=this.$(".kpi-thresholding-panel-custom-threshold-window-status");se.default.unmountComponentAtNode(i.get(0)),se.default.render(re.default.createElement(rt.default,null,re.default.createElement(Ct,{"data-test-itsi":"kpi-thresholding-panel-custom-threshold-window-active-status-chip"},(0,oe.gettext)("Active")),re.default.createElement(ye.default,{contentRelationship:"label",content:Mt,"data-test-itsi":"kpi-thresholding-panel-custom-threshold-window-active-status-tooltip"})),i.get(0));var s=this.kpiModel.get("active_custom_threshold_window");if(s){var o=this.$(".kpi-thresholding-panel-custom-threshold-window-link");se.default.unmountComponentAtNode(o.get(0)),se.default.render(re.default.createElement(rt.default,null,re.default.createElement(fe.default,{"data-test-itsi":"view-custom-threshold-windows-link",openInNewContext:!0,to:(0,je.uiEditURL)({id:s})},(0,de.sprintf)((0,oe.gettext)("View %(objectName)s"),{objectName:Be.OBJECT_NAMES.singular}))),o.get(0))}},renderRadioControl:function renderRadioControl(){if(this.$(".thresholding-template-radio-control").length>0){var i=!1,s=!0,o=this.featureFlags&&this.featureFlags[Ie.featureFlagsStanzas.ENTITY_LEVEL_AT];(0,$.default)(ke.PYTHON_SCIENTIFIC_APP_NAMES,o=>{this.appsData&&this.appsData[o]&&this.appsData[o].isInstalled&&(i=!0,this.appsData[o].isDisabled||(s=!1))}),this.radioControlModel.get("value")===Ae.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDATION&&(!this.kpiModel.get("recommendation_apply_as_value")||this.kpiModel.set("recommendation_apply_as_value",Le.RECOMMENDATION_APPLY_AS_OPTIONS[0].value),!this.kpiModel.get("recommendation_apply_to_value")||this.kpiModel.set("recommendation_apply_to_value",Le.RECOMMENDATION_APPLY_TO_OPTIONS[0].value),!this.kpiModel.get("recommendation_training_window")||this.kpiModel.set("recommendation_training_window",Le.ANALYSIS_WINDOW_OPTIONS[1].value),!this.kpiModel.get("recommendation_start_date")||this.kpiModel.set("recommendation_start_date",(0,Te.default)().subtract(Le.ANALYSIS_WINDOW_OPTIONS[1].days,"days").unix()),!this.kpiModel.get("threshold_direction")||this.kpiModel.set("threshold_direction",Le.THRESHOLD_CONFIGURATION_OPTIONS[0].value)),se.default.unmountComponentAtNode(this.$(".thresholding-template-radio-control").get(0)),se.default.render(re.default.createElement(rt.default,null,re.default.createElement(ct.default,{analysisWindowValue:this.kpiModel.get("recommendation_training_window"),analysisWindowStartDate:this.kpiModel.get("recommendation_start_date"),canWriteOnGlobalTeam:this.canWriteOnGlobalTeam,exportAction:this._exportTemplate.bind(this),hasTimeVariateThresholds:this.kpiModel.get("time_variate_thresholds"),hideRecommendedThresholding:this.hideRecommendedThresholding,isPSCDisabled:s,isPSCInstalled:i,isRecommendedThresholdSearchInProgress:this.isRecommendedThresholdSearchInProgress,onAnalysisWindowChange:this.handleAnalysisWindowChange.bind(this),onAnalysisWindowStartDateChange:this.handleAnalysisWindowStartDateChange.bind(this),onApplyAsValueChange:this.handleApplyAsValueChange.bind(this),onApplyToValueChange:this.handleApplyToValueChange.bind(this),onLoadRecommendationsClick:this._showLoadRecommendationsConfirmModal.bind(this),onRadioChange:this.handleRadioChange.bind(this),onSelectChange:this.handleSelectChange.bind(this),onThresholdConfigChange:this.handleThresholdConfigChange.bind(this),radioValue:this.radioControlModel.get("value"),recommendationApplyAsValue:this.kpiModel.get("recommendation_apply_as_value"),recommendationApplyToValue:this.kpiModel.get("recommendation_apply_to_value"),selectValue:this.kpiModel.get("kpi_threshold_template_id"),selectOptions:this.selectItems,showEntityLevelAdaptiveThresholding:o,thresholdConfigValue:this.kpiModel.get("threshold_direction")})),this.$(".thresholding-template-radio-control").get(0))}},_renderAdaptiveThresholdingExplanation:function _renderAdaptiveThresholdingExplanation(){var i=this.$(".thresholding-adaptive-thresholding-explanation");i.length&&(se.default.unmountComponentAtNode(i.get(0)),se.default.render(re.default.createElement(rt.default,null,re.default.createElement(yt,{"data-test-itsi":"thresholding-adaptive-thresholding-explanation",as:"span",variant:"smallBody",weight:400},(0,oe.gettext)("Adaptive Thresholding runs everyday around midnight and updates the thresholding for the KPI based on the settings below. Once updated, old thresholds cannot be recovered."))),i.get(0)))},_renderApplyATControls:function _renderApplyATControls(){var i=this.$(".thresholding-apply-adaptive-thresholding"),s=this.kpiModel;this.isServiceTemplate&&(s=this.previewKpiModel),s&&i.length&&se.default.render(re.default.createElement(rt.default,null,re.default.createElement(mt.default,{kpiModel:s,thresholdSpec:this.kpiModel.get("time_variate_thresholds_specification"),configSettingsModel:this._configSettingsModel,featureFlags:this.featureFlags,showAtConfigMessage:this.showAtConfigMessage&&!this.configMessageAlreadySeen,onConfigChangeDismiss:this.handleConfigChangeDismiss,loadingMaskHandler:this.loadingMaskHandler})),i.get(0))},_removeApplyAtControls:function _removeApplyAtControls(){var i=this.$(".thresholding-apply-adaptive-thresholding");i.length&&se.default.unmountComponentAtNode(i.get(0))},_renderKpiThresholdingContentView:function _renderKpiThresholdingContentView(){if(this.$el.html(this.compiledTemplate({canWriteOnGlobalTeam:this.canWriteOnGlobalTeam,isServiceTemplate:this.isServiceTemplate},{variable:"vars"})),this.service.get("object_type")===De.OBJECT_TYPE&&(0,Ke.hasActiveCustomThresholdWindow)(this.kpiModel.toJSON())?(this._renderCustomThresholdWindowStatus(),this.$(".kpi-thresholding-panel-custom-threshold-window-content").removeClass("hide")):this.$(".kpi-thresholding-panel-custom-threshold-window-content").addClass("hide"),this.renderRadioControl(),!this.isRecommendedThresholdSearchInProgress){var i=this.kpiModel.get("kpi_threshold_template_id");if(i&&i!==Ae.KPI_THRESHOLD_TEMPLATE_TYPES.CUSTOM&&this.thresholdTemplateCollection){var s=this.thresholdTemplateCollection.filter(s=>s.get("_key")===i);if(s&&!s.length){var o=new st.default({_key:i});o.fetch().done(()=>{this._renderControlsFromTemplate(o)})}else this._renderControlsFromTemplate(s[0])}this._renderTrainingControls(),this.showRecommendationIcon&&(this.aggregateEntityConfigureControl=this.createThresholdControlTabs()),this.$(".thresholding-configure-aggregate-entity-toggle").append(this.aggregateEntityConfigureControl),this._toggleAggregateEntitySelector(),this._toggleThresholdingConfigSettings(),this.isServiceTemplate||(this.$(".thresholding-configure-error-state").hide(),this.singleThresholdingView&&this.singleThresholdingView.remove(),this._renderSingleThresholdingPreviewChart(),this.singleThresholdingView=new this.KpiSingleThresholdingView({kpiModel:this.kpiModel,service:this.service,configSettingsModel:this._configSettingsModel,aggregateThresholdModel:this.kpiModel.getThresholdSettingModel(Ae.KPI_THRESHOLD_TYPES.AGGREGATE),entityThresholdModel:this.kpiModel.getThresholdSettingModel(Ae.KPI_THRESHOLD_TYPES.ENTITY)}),this.$(".thresholding-default-settings").html("")),this.$(".thresholding-default-settings").html(this.singleThresholdingView.render().$el),this._toggleTimeVariantThresholdingView(),this.isServiceTemplate&&this._populateServiceSelector(),this._setThresholdingTemplateState()}return this},_renderSingleThresholdingPreviewChart:(0,U.default)((function(){var i;this.isServiceTemplate||!this.singleThresholdingSummaryIndexCheckComplete||null!==(i=this.kpiModel)&&void 0!==i&&i.get("time_variate_thresholds")||(this.singleThresholdingPreviewChart||(this.singleThresholdingPreviewChart=new pt.default({kpiModel:this.kpiModel,configSettingsModel:this._configSettingsModel,getTimeInIso:!0,useRawSearch:this.singleThresholdingUseRawSearch})),this.$(".thresholding-default-preview").html(""),this.$(".thresholding-default-preview").html(this.singleThresholdingPreviewChart.render().$el))})),checkSingleThresholdingShouldUseRawSearch:function checkSingleThresholdingShouldUseRawSearch(){this.summaryIndexSearchJobDetails&&(this.summaryIndexSearchJobDetails.subscription.unsubscribe(),this.summaryIndexSearchJobDetails.searchJob.cancel()),this.summaryIndexSearchJobDetails=(0,Ae.checkSummaryIndexForKpiData)(this.kpiModel.get("_key"),"single-thresholding-preview"),this.summaryIndexSearchJobDetails&&Promise.all([this.summaryIndexSearchJobDetails.promise]).then(i=>{this.singleThresholdingUseRawSearch=!i.length||(0,Ae.checkShouldUseRawSearch)(i[0]),this.singleThresholdingSummaryIndexCheckComplete=!0,this._renderSingleThresholdingPreviewChart()}).catch(()=>{this.singleThresholdingUseRawSearch=!0,this.singleThresholdingSummaryIndexCheckComplete=!0,this._renderSingleThresholdingPreviewChart()})},_renderControlsFromTemplate:function _renderControlsFromTemplate(i){this._configSettingsModel.set("adaptive_thresholding_training_window",i.get("adaptive_thresholding_training_window"),{silent:!0}),this._configSettingsModel.set("adaptive_thresholds_is_enabled",i.get("adaptive_thresholds_is_enabled"),{silent:!0}),this._toggleAdaptiveThresholdingControls(),this._setThresholdingTemplateState()},_setThresholdingTemplateState:function _setThresholdingTemplateState(){var i=this.kpiModel.get("kpi_threshold_template_id");i&&i!==Ae.KPI_THRESHOLD_TEMPLATE_TYPES.CUSTOM?this._disableAllThresholdControls():this._enableAllThresholdControls(),this.renderRadioControl();var s=this.featureFlags&&this.featureFlags[Ie.featureFlagsStanzas.AT_OUTLIER_REMOVAL];!this.isServiceTemplate&&s&&this._configSettingsModel.get("adaptive_thresholds_is_enabled")&&this._renderOutlierDetectionControls()},_disableAllThresholdControls:function _disableAllThresholdControls(){this.timeVariantEnableDisableControlDomRef.toggleSwitchControl(!1,this.kpiModel.get("time_variate_thresholds")),this.adaptiveThresholdEnableDisableControlDomRef.toggleSwitchControl(!1,this._configSettingsModel.get("adaptive_thresholds_is_enabled")),this.kpiTrainingEarliestTimePicker.disable()},_enableAllThresholdControls:function _enableAllThresholdControls(){this.timeVariantEnableDisableControlDomRef.toggleSwitchControl(!0,this.kpiModel.get("time_variate_thresholds")),this.adaptiveThresholdEnableDisableControlDomRef.toggleSwitchControl(!0,this._configSettingsModel.get("adaptive_thresholds_is_enabled")),this.kpiTrainingEarliestTimePicker.enable(),this._toggleAdaptiveThresholdingControls()},remove:function remove(){return this.cleanupKPIThresholdDataSearchDataJob(),this.summaryIndexSearchJobDetails&&(this.summaryIndexSearchJobDetails.subscription.unsubscribe(),this.summaryIndexSearchJobDetails.searchJob.cancel()),this.singleThresholdingPreviewChart&&this.singleThresholdingPreviewChart.remove(),this.singleThresholdingView&&this.singleThresholdingView.remove(),this.timeVariantThresholdingView&&this.timeVariantThresholdingView.remove(),this.serviceSelector&&this.serviceSelector.remove(),this._removeApplyAtControls(),ne.default.View.prototype.remove.apply(this,arguments)},_applyThresholdTemplate:function _applyThresholdTemplate(i){var s=this.thresholdTemplateCollection.get(i),o=s.get("time_variate_thresholds_specification"),h=this.kpiModel.get("time_variate_thresholds_specification");h.set(h.parse({policies:JSON.parse(JSON.stringify(o.get("policies")))})),this.kpiModel.set("kpi_threshold_template_id",i),this._configSettingsModel.set("adaptive_thresholding_training_window",s.get("adaptive_thresholding_training_window")),this.kpiModel.set("time_variate_thresholds",s.get("time_variate_thresholds")),this.kpiModel.get("time_variate_thresholds")&&this._renderTimeVariantThresholdView(),this._configSettingsModel.set("adaptive_thresholds_is_enabled",s.get("adaptive_thresholds_is_enabled")),this.kpiModel.set("aggregate_outlier_detection_enabled",s.get("aggregate_outlier_detection_enabled")),this.kpiModel.set("outlier_detection_algo",s.get("outlier_detection_algo")),this.kpiModel.set("outlier_detection_sensitivity",s.get("outlier_detection_sensitivity")),this._toggleAdaptiveThresholdingControls(),this._setThresholdingTemplateState()},_changeThresholdTemplate:function _changeThresholdTemplate(i,s,o){if(!s)return this._setThresholdingTemplateState(),void this._renderTimeVariantThresholdView();if(!o||!o.isExport&&!o.isApply){var h=new Ze.default({appearance:"fill",content:re.default.createElement("div",null,(0,oe.gettext)("The threshold time policies will be applied in UTC. If you want the threshold time policies to be applied in your local timezone, clone this template using your timezone and then apply it.")," ",re.default.createElement(fe.default,{"data-test-itsi":"clone-kpi-threshold-template-link",openInNewContext:!0,to:We.uiListerURL},(0,oe.gettext)("Clone Threshold Template")),"."),dataTestItsi:"kpi-threshold-template-apply-info-message",style:{marginTop:20},type:"info"}),v=this.thresholdTemplateCollection.get(s),y=(0,ae.default)('<div class="apply-thresholding-react-modal-container"></div>');se.default.unmountComponentAtNode(y.get(0)),se.default.render(re.default.createElement(rt.default,null,re.default.createElement(Fe.default,{modalDataTestItsi:"apply-threshold-template-modal",cancelButtonDataTestItsi:"threshold-template-modal-cancel-button",primaryButtonDataTestItsi:"threshold-template-modal-apply-button",showCancel:!0,open:!0,modalStyles:we.CONFIRMATION_MODAL_STYLE,title:(0,oe.gettext)("Apply Threshold Template"),primaryButtonLabel:(0,oe.gettext)("Apply"),primaryButtonClicked:(()=>{this.kpiModel.get("is_entity_breakdown")&&this._configSettingsModel.set("threshold_config_is_aggregate",!0),this._applyThresholdTemplate(s)}).bind(this),secondaryButtonClicked:(()=>{var s=i.previous("kpi_threshold_template_id");i.set("kpi_threshold_template_id",s,{silent:!0}),this.renderRadioControl()}).bind(this)},re.default.createElement("span",{"data-test-itsi":"threshold-template-modal-apply-message"},(0,oe.gettext)("All existing threshold settings will be discarded. Are you sure you want to apply template?"),v.get("_immutable")&&h.getComponent()))),y.get(0))}},_toggleAggregateEntitySelector:function _toggleAggregateEntitySelector(){this.kpiModel.get("is_entity_breakdown")?this.aggregateEntityConfigureControl.show():(this._configSettingsModel.set("threshold_config_is_aggregate",!0),this.aggregateEntityConfigureControl.hide())},_renderTrainingControls:function _renderTrainingControls(){this.$(".thresholding-enable-time-policy-control").append(this.enableTimeVariantControl),this.$(".thresholding-enable-adaptive-thresholding").append(this.enableAdaptiveThresholdControl),this._renderAdaptiveThresholdingExplanation(),this.$(".thresholding-adaptive-thresholding-training").append(this.kpiTrainingEarliestTimePicker.render().$el),this._toggleAdaptiveThresholdingControls(),this.showRecommendationIcon&&(this.$('.thresholding-enable-time-policy-control [data-test-itsi="kpi-thresholding-time-policies-control-group"] label[data-test="label"]').prepend(this.timeVariantRecommendationIcon.render().$el),this.$('.thresholding-enable-adaptive-thresholding [data-test-itsi="kpi-thresholding-adaptive-thresholding-control-group"] label[data-test="label"]').prepend(this.adaptiveRecommendationIcon.render().$el),this.$('.thresholding-adaptive-thresholding-training [data-test-itsi="kpi-adaptive-training-time-control-group"] label[data-test="label"]').prepend(this.trainingRecommendationIcon.render().$el)),this.$(".kpi-thresholding-panel-config-container",this.$el).css("visibility","visible")},_changePoliciesToStatic:function _changePoliciesToStatic(){this.timeVariantThresholdingView&&this.timeVariantThresholdingView.remove();for(var i=this.kpiModel.get("time_variate_thresholds_specification").get("policies"),s=0;s<i.length;++s)i.at(s).set("policy_type","static");this._renderTimeVariantThresholdView()},_toggleAdaptiveThresholdingControls:function _toggleAdaptiveThresholdingControls(){this.kpiModel.get("time_variate_thresholds")?(this.adaptiveThresholdEnableDisableControlDomRef.toggleSwitchControl(!0,this._configSettingsModel.get("adaptive_thresholds_is_enabled")),this.kpiModel.get("adaptive_thresholds_is_enabled")?(this.kpiTrainingEarliestTimePicker.$el.show(),this.$(".thresholding-adaptive-thresholding-explanation").show(),this.$(".thresholding-enable-outlier-detection").show(),this.$(".thresholding-apply-adaptive-thresholding").show()):(this.kpiTrainingEarliestTimePicker.$el.hide(),this.$(".thresholding-adaptive-thresholding-explanation").hide(),this.$(".thresholding-enable-outlier-detection").hide(),this.$(".thresholding-apply-adaptive-thresholding").hide())):(this.adaptiveThresholdEnableDisableControlDomRef.toggleSwitchControl(!1,this._configSettingsModel.get("adaptive_thresholds_is_enabled")),this.kpiTrainingEarliestTimePicker.$el.hide(),this.$(".thresholding-adaptive-thresholding-explanation").hide(),this.$(".thresholding-enable-outlier-detection").hide(),this.$(".thresholding-apply-adaptive-thresholding").hide())},_onOutlierDetectionSettingsChange:function _onOutlierDetectionSettingsChange(i,s){var o={aggregate_outlier_detection_enabled:this.kpiModel.get("aggregate_outlier_detection_enabled")||!1,outlier_detection_algo:this.kpiModel.get("outlier_detection_algo")||Le.OUTLIER_DEFAULT_DETECTION_ALGORITHM,outlier_detection_sensitivity:this.kpiModel.get("outlier_detection_sensitivity")||Le.OUTLIER_DEFAULT_DETECTION_SENSITIVITY};De.TOGGLE_OUTLIER_TYPES[s]&&(o[De.TOGGLE_OUTLIER_TYPES[s]]=i),this.kpiModel.set(o)},_createKpiAlertingSwitchControl:function _createKpiAlertingSwitchControl(){var i=this.kpiModel.get("aggregate_thresholds_alert_enabled"),s=(0,ae.default)("<div></div>").css({display:"inline-block","vertical-align":"top"});return se.default.unmountComponentAtNode(s.get(0)),se.default.render(re.default.createElement(rt.default,null,re.default.createElement(lt.default,{enabled:i,onChange:this._onEnableDisableAlerting,size:"medium",isEntityBreakDown:this.kpiModel.get("is_entity_breakdown")})),s.get(0)),i&&(this.$(".kpi-alerting-options").show(),this.$(".kpi-alerting-options").html(this._createKpiAlertingOptions())),s},_renderOutlierDetectionControls:function _renderOutlierDetectionControls(){var i=this.kpiModel.get("aggregate_outlier_detection_enabled"),s=this.kpiModel.get("outlier_detection_algo"),o=this.kpiModel.get("outlier_detection_sensitivity"),h=this.radioControlModel.get("value")===Ae.KPI_THRESHOLD_TEMPLATE_TYPES.TEMPLATE,v=this.$(".thresholding-enable-outlier-detection").css({display:"inline-block","vertical-align":"top"});return se.default.unmountComponentAtNode(v.get(0)),se.default.render(re.default.createElement(rt.default,null,re.default.createElement(dt.default,{enabled:i,algo:s,sensitivity:o,onChange:this._onOutlierDetectionSettingsChange,size:"medium",controlsDisabled:h,showRecommendationIcon:this.showRecommendationIcon})),v.get(0)),this.showRecommendationIcon&&(this.$('.thresholding-enable-outlier-detection [data-test-itsi="kpi-outlier-detection-control-group"] label[data-test="label"]').prepend(this.outlierRecommendationIcon.render().$el),this.$('.thresholding-enable-outlier-detection [data-test-itsi="kpi-outlier-detection-algo-control-group"] label[data-test="label"]').prepend(this.outlierAlgoRecommendationIcon.render().$el),this.$('.thresholding-enable-outlier-detection [data-test-itsi="kpi-outlier-detection-sensitivity-control-group"] label[data-test="label"]').prepend(this.outlierSensitivityRecommendationIcon.render().$el)),v},_createKpiAlertingOptions:function _createKpiAlertingOptions(){var i=(0,ae.default)("<div></div>");se.default.unmountComponentAtNode(i.get(0));var s=this.kpiModel.get("aggregate_thresholds_custom_alert_rules"),o=2;return s&&this.kpiModel.get("aggregate_thresholds_custom_alert_enabled")&&0!==s.length||(o=1),se.default.render(re.default.createElement(rt.default,null,re.default.createElement(ot.default,{selectedAdvancedOption:o,getCurrentRules:this.getCurrentRules,getAvailableSeverityValues:this.getAvailableSeveritiesForDropdown,handleKpiAlertingOptionChange:this.handleKpiAlertingOptionChange,addOrUpdateRuleToKpiModel:this.addOrUpdateRuleToKpiModel,removeRuleFromKpiModel:this.removeRuleFromKpiModel,removeAndAddRuleToKpiModel:this.removeAndAddRuleToKpiModel})),i.get(0)),i},handleKpiAlertingOptionChange:function handleKpiAlertingOptionChange(i){2===i?(this.kpiModel.set({aggregate_thresholds_custom_alert_enabled:!0}),this.addOrUpdateRuleToKpiModel("critical",["high","medium","low","normal","info"]),this.$(".kpi-alerting-custom-rules").show(),this.$(".kpi-alerting-add-rule").show()):(this.kpiModel.set({aggregate_thresholds_custom_alert_rules:[],aggregate_thresholds_custom_alert_enabled:!1}),this.$(".kpi-alerting-custom-rules").hide(),this.$(".kpi-alerting-add-rule").hide())},getCurrentRules:function getCurrentRules(){return this.kpiModel.get("aggregate_thresholds_custom_alert_rules")},getAvailableSeveritiesForDropdown:function getAvailableSeveritiesForDropdown(){var i=(0,Ae.getSortedThresholdValues)(),s=(0,ie.default)(i,(function(i){return i.value})),o=(0,ie.default)(this.kpiModel.get("aggregate_thresholds_custom_alert_rules"),(function(i){return i.change_to}));return(0,Y.default)(s,o)},addOrUpdateRuleToKpiModel:function addOrUpdateRuleToKpiModel(i,s){var o=JSON.parse(JSON.stringify(this.kpiModel.get("aggregate_thresholds_custom_alert_rules")));(0,X.default)(o,(function(o){return o.change_to===i&&(o.change_from=s,!0)}))||o.push({change_to:i,change_from:s}),this.kpiModel.set({aggregate_thresholds_custom_alert_rules:o})},removeAndAddRuleToKpiModel:function removeAndAddRuleToKpiModel(i,s){this.removeRuleFromKpiModel(i),this.addOrUpdateRuleToKpiModel(s,[])},removeRuleFromKpiModel:function removeRuleFromKpiModel(i){var s=this.kpiModel.get("aggregate_thresholds_custom_alert_rules").filter(s=>s.change_to!==i);this.kpiModel.set({aggregate_thresholds_custom_alert_rules:s})},_onEnableDisableAlerting:function _onEnableDisableAlerting(i){i?(this.kpiModel.set({aggregate_thresholds_alert_enabled:!0}),this.$(".kpi-alerting-options").show(),this.$(".kpi-alerting-options").html(this._createKpiAlertingOptions())):(this.kpiModel.set({aggregate_thresholds_alert_enabled:!1}),this.$(".kpi-alerting-options").hide(),this.$(".kpi-alerting-custom-rules").hide())},_toggleThresholdingConfigSettings:function _toggleThresholdingConfigSettings(){var i=this.service.get("object_type"),s=i===De.OBJECT_TYPE||i===Pe.OBJECT_TYPE,o=this.featureFlags&&this.featureFlags[Ie.featureFlagsStanzas.AT_OUTLIER_REMOVAL];this._renderSingleThresholdingPreviewChart(),s&&this._configSettingsModel.get("threshold_config_is_aggregate")?(this.$(".thresholding-configure-settings").show(),this._renderApplyATControls(),this.$(".kpi-alerting-enable-disable-control").html(this._createKpiAlertingSwitchControl()),!this.isServiceTemplate&&o&&this._renderOutlierDetectionControls(),this._toggleAdaptiveThresholdingControls()):this.$(".thresholding-configure-settings").hide()},_toggleTimeVariantThresholdingView:function _toggleTimeVariantThresholdingView(){this.hasNoLinkedServicesState||(this.kpiModel.get("time_variate_thresholds")?(this._renderTimeVariantThresholdView(),this.$(".thresholding-time-policy-container").show(),this.$(".thresholding-default-container").hide()):(this._configSettingsModel.set("adaptive_thresholds_is_enabled",!1),this.$(".thresholding-time-policy-container").hide(),this.timeVariantThresholdingView&&this.timeVariantThresholdingView.remove(),this.$(".thresholding-default-container").show()),this._toggleAdaptiveThresholdingControls())},_repaint:function _repaint(){this.kpiModel.get("time_variate_thresholds")?(this._renderTimeVariantThresholdView(),this._renderApplyATControls()):this._renderAggregateThresholdView()},_renderTimeVariantThresholdView:(0,U.default)((function(){this.$(".thresholding-configure-error-state").hide(),this.timeVariantThresholdingView&&this.timeVariantThresholdingView.remove();var i=this.kpiModel.get("kpi_threshold_template_id"),s=i&&i!==Ae.KPI_THRESHOLD_TEMPLATE_TYPES.CUSTOM,o=this.kpiModel,h=this.service;if(this.isServiceTemplate){if(o=this.previewKpiModel,h=this.previewServiceModel,!this.previewKpiModel)return void this._renderNewKPIState();if(this.previewServiceModel.get("object_type")===Pe.OBJECT_TYPE)return void this._renderNoServiceState()}this.timeVariantThresholdingView=new this.KpiTimeVariantThresholdingView({kpiModel:o,service:h,configSettingsModel:this._configSettingsModel,timeVariantThresholdModel:this.kpiModel.get("time_variate_thresholds_specification"),disableAllControls:s,previewMode:this.isServiceTemplate,isServiceTemplate:this.isServiceTemplate,isPreviewKpiModelReady:this.isPreviewKpiModelReady,featureFlags:this.featureFlags}),this.$(".thresholding-time-policy-container").html(""),this.$(".thresholding-time-policy-container").append(this.timeVariantThresholdingView.render().$el),this._setThresholdingTemplateState()})),_renderAggregateThresholdView:(0,U.default)((function(){this.$(".thresholding-configure-error-state").hide(),this.singleThresholdingView&&this.singleThresholdingView.remove(),this.previewKpiModel?(this._renderSingleThresholdingPreviewChart(),this.singleThresholdingView=new this.KpiSingleThresholdingView({kpiModel:this.previewKpiModel,service:this.previewServiceModel,configSettingsModel:this._configSettingsModel,aggregateThresholdModel:this.kpiModel.getThresholdSettingModel(Ae.KPI_THRESHOLD_TYPES.AGGREGATE),entityThresholdModel:this.kpiModel.getThresholdSettingModel(Ae.KPI_THRESHOLD_TYPES.ENTITY)}),this.$(".thresholding-default-settings").html(""),this.$(".thresholding-default-settings").html(this.singleThresholdingView.render().$el)):this._renderNewKPIState()}))}),At=it.default.extend({initialize:function initialize(){it.default.prototype.initialize.apply(this,arguments),this.children.titleField=new Ye.default({controlType:"Text",controlOptions:{dataTestItsi:"threshold-template-title-text",modelAttribute:"title",model:this.model.working},dataTestItsi:"kpi-threshold-template-title-control-group",label:(0,oe.gettext)("Title"),required:!0});var i=this;this.model.savedPage.on("change:title",(function(){i.trigger("exportcomplete",this)}))},onSaveEditTitleSave:function onSaveEditTitleSave(){var i=this.model.working.get("title"),s=this.model.validate(i);s.isValid?it.default.prototype.onSaveEditTitleSave.apply(this,arguments):this.children.titleField.error(Me.NO_EMPTY_TITLE_MESSAGE)}}),It=Rt;s.default=It,i.exports=s.default},1648:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y=h(o(9)),_=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),S=h(o(2)),T=h(o(3)),x=h(o(101)),R=h(o(97)),P=h(o(299)),L=h(o(118)),N=h(o(53)),V=h(o(110)),j=o(100),W=o(77),K=o(137),U=h(o(2941)),Y=h(o(2942));function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}var $=T.default.div(v||(v=(0,y.default)(["\n margin-top: 10px;\n display: flex;\n"])));function ThresholdingPreviewVizContainer(i){var{isEntityLevelPreview:s,entityData:o,getTimeInIso:h,thresholdData:v,isDefaultEntityThresholdView:y,useRawSearch:S}=i,[T,X]=(0,_.useState)((0,W.getDaysAgoFromStartOfDay)(7)),Z=V.default.newSplunkTime().subtract(1,"day").endOf("day").unix(),[ee,te]=(0,_.useState)(7),[ie,ae]=(0,_.useState)([]),[ne,re]=(0,_.useState)({min:null,max:null}),[se,le]=(0,_.useState)({min:null,max:null}),[oe,de]=(0,_.useState)(S),ce=K.TIME_RANGE_WINDOW_SPANS[ee],he=T;if(v.isAdaptiveThresholdsEnabled&&v.isOutlierDetectionEnabled){var ue=K.ANALYSIS_WINDOW_OPTIONS.filter(i=>i.value===v.adaptiveTrainingWindow)[0];he=(0,W.getDaysAgoFromStartOfDay)(Number(ue.days))}var pe=(0,_.useCallback)(i=>{te(i),X((0,W.getDaysAgoFromStartOfDay)(i))},[]),fe=(0,_.useCallback)(i=>{ae((0,P.default)((0,N.default)(i,i=>K.TRENDLINE_VALUES_MAP[i])))},[]),ge=(0,R.default)(i=>{var s=(0,x.default)(ne);s.max=(0,L.default)(i)?i:null,re(s)},j.DEFAULT_DEBOUNCE_DELAY),me=(0,R.default)(i=>{var s=(0,x.default)(ne);s.min=(0,L.default)(i)?i:null,re(s)},j.DEFAULT_DEBOUNCE_DELAY),ve=(0,_.useCallback)(i=>{S||de(i)},[S]),ye=(0,_.useCallback)(i=>{i.min===se.min&&i.max===se.max||le(i)},[se.max,se.min]);return _.default.createElement(_.default.Fragment,null,_.default.createElement(U.default,{isAggregateConfigView:!s,handleTimeWindowChange:pe,handleTrendlineChange:fe,disableTrendlineControls:oe,handleYMaxChange:ge,handleYMinChange:me,defaultYAxisRange:se,isEntityThreshold:s,isDefaultEntityThresholdView:y,selectedEntityTitle:null==o?void 0:o.entity_title}),_.default.createElement($,null,_.default.createElement(Y.default,{displayLegend:!1,displayTooltipFooter:!1,entityData:o,graphsEarliestTime:T,graphsLatestTime:Z,getTimeInIso:h,handleZoomLevel:ve,handleDefaultYAxisRangeChange:ye,isAdaptiveThresholdsEnabled:v.isAdaptiveThresholdsEnabled,outlierDetectionEnabled:v.isOutlierDetectionEnabled,outlierDetectionAlgo:v.outlierDetectionAlgorithm,outlierDetectionSensitivity:v.outlierDetectionSensitivity,outlierGraphEarliestTime:he,outlierGraphLatestTime:Z,isServiceDefinitionView:!0,isDefaultEntityThresholdView:y,isEntityLevelPreview:s,thresholdObj:v,maxTicks:7,numDays:ee,searchSpan:ce,selectedTrendlines:ie,shouldPreviewUpdate:!1,showYAxisTicks:!1,useRawSearch:S,windowConfigPercentage:10,yAxisRange:ne})))}ThresholdingPreviewVizContainer.propTypes={isEntityLevelPreview:S.default.bool.isRequired,entityData:S.default.object,getTimeInIso:S.default.bool.isRequired,thresholdData:S.default.object.isRequired,isDefaultEntityThresholdView:S.default.bool,useRawSearch:S.default.bool.isRequired},ThresholdingPreviewVizContainer.defaultProps={isDefaultEntityThresholdView:!1,entityData:{}};var X=ThresholdingPreviewVizContainer;s.default=X,i.exports=s.default},1649:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(11)),y=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),_=h(o(2)),S=h(o(516)),T=h(o(101)),x=h(o(97)),R=h(o(131)),P=h(o(2731)),L=h(o(47)),N=o(25),V=h(o(3052));function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function ownKeys(i,s){var o=Object.keys(i);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(i);s&&(h=h.filter((function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable}))),o.push.apply(o,h)}return o}function _objectSpread(i){for(var s=1;s<arguments.length;s++){var o=null!=arguments[s]?arguments[s]:{};s%2?ownKeys(Object(o),!0).forEach((function(s){(0,v.default)(i,s,o[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(o,s))}))}return i}function ThresholdConfigurationViewContainer(i){var{isEntityLevelPreview:s,entityData:o,isDefaultEntityThresholdView:h,isEntityLevelThreshold:v,isReadOnly:_,onThresholdUpdate:L,thresholdObj:j,width:W}=i,[K,U]=(0,y.useState)(j),Y=(0,y.useRef)(j),$=(0,y.useMemo)(()=>{var i,o,h,v=(0,T.default)(K),addIdsToThresholdLevels=i=>{var s,o=(0,T.default)(i);return null!==(s=o.thresholdLevels)&&void 0!==s&&s.length&&(o.thresholdLevels=(0,T.default)(o.thresholdLevels.map(i=>_objectSpread(_objectSpread({},i),{},{id:(0,N.generateUUID)()})))),o},y=s?"entityThresholdsConfig":"aggregateThresholdsConfig";return null!==(i=v[y])&&void 0!==i&&null!==(o=i.thresholdLevels)&&void 0!==o&&o.length&&(v[y]=addIdsToThresholdLevels(v[y])),null!==(h=v.timeVariateThresholdsSpecification)&&void 0!==h&&h.policies&&(v.timeVariateThresholdsSpecification.policies=Object.keys(v.timeVariateThresholdsSpecification.policies).map(i=>{var o=(0,T.default)(_objectSpread(_objectSpread({},v.timeVariateThresholdsSpecification.policies[i]),{},{_key:i})),h=s?"entity_thresholds":"aggregate_thresholds";return o[h]&&(o[h]=addIdsToThresholdLevels(o[h])),o})),v},[s,K]),X=(0,x.default)(i=>{var o,h,v,y=(0,T.default)(i),_=s?"entity_thresholds":"aggregate_thresholds";if(null===(o=y[s?"entityThresholdsConfig":"aggregateThresholdsConfig"])||void 0===o||null===(h=o.thresholdLevels)||void 0===h||h.forEach(i=>(0,P.default)(i,"id")),null!==(v=y.timeVariateThresholdsSpecification)&&void 0!==v&&v.policies){var x={};y.timeVariateThresholdsSpecification.policies.forEach(i=>{var s,o;null===(s=i[_])||void 0===s||null===(o=s.thresholdLevels)||void 0===o||o.forEach(i=>(0,P.default)(i,"id")),x[i._key]=(0,S.default)((0,T.default)(i),{_key:void 0})}),y.timeVariateThresholdsSpecification.policies=x}Y.current=(0,S.default)((0,T.default)(Y.current),y),L(y)},80);return(0,y.useEffect)(()=>{(j.isTimeVariateThresholds!==Y.current.isTimeVariateThresholds||j.isAdaptiveThresholdsEnabled!==Y.current.isAdaptiveThresholdsEnabled||(j.isTimeVariateThresholds&&Y.current.isTimeVariateThresholds?!(0,R.default)(Y.current.timeVariateThresholdsSpecification,j.timeVariateThresholdsSpecification):s?!(0,R.default)(Y.current.entityThresholdsConfig,j.entityThresholdsConfig):!(0,R.default)(Y.current.aggregateThresholdsConfig,j.aggregateThresholdsConfig)))&&(U(j),Y.current=j)},[j]),y.default.createElement(V.default,{isEntityLevelPreview:s,thresholdObj:$,entityObj:o,width:W,isReadOnly:_,isEntityLevelThreshold:v,isDefaultEntityThresholdView:h,onThresholdUpdate:X})}ThresholdConfigurationViewContainer.propTypes={isEntityLevelPreview:_.default.bool.isRequired,thresholdObj:_.default.object.isRequired,width:_.default.number,isReadOnly:_.default.bool,entityData:_.default.object,isDefaultEntityThresholdView:_.default.bool,isEntityLevelThreshold:_.default.bool,onThresholdUpdate:_.default.func},ThresholdConfigurationViewContainer.defaultProps={isDefaultEntityThresholdView:!1,isEntityLevelThreshold:!1,isReadOnly:!1,entityData:{},width:1120,onThresholdUpdate:L.default};var j=ThresholdConfigurationViewContainer;s.default=j,i.exports=s.default},1650:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_,S,T,x,R,P,L,N=h(o(9)),V=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),j=h(o(3)),W=h(o(2)),K=h(o(39)),U=h(o(56)),Y=h(o(87)),$=h(o(43)),X=h(o(33)),Z=h(o(473)),ee=h(o(82)),te=h(o(110)),ie=o(5),ae=o(405),ne=o(404),re=o(68),se=o(77),le=o(137),oe=o(76),de=h(o(568));function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}var ce=j.default.div(v||(v=(0,N.default)(["\n margin: 16px 10px;\n display: flex;\n"]))),he=(0,j.default)(U.default)(y||(y=(0,N.default)(["\n margin-left: 16px;\n"]))),ue=(0,j.default)(U.default)(_||(_=(0,N.default)(["\n align-self: flex-end;\n margin-left: 16px;\n"]))),pe=(0,j.default)(ee.default)(S||(S=(0,N.default)(["\n width: 220px !important;\n"]))),fe=(0,j.default)(ee.default)(T||(T=(0,N.default)(["\n width: 196px !important;\n"]))),ge=(0,j.default)(Y.default)(x||(x=(0,N.default)(["\n margin-top: 10px;\n width: 150px;\n"]))),me=(0,j.default)(K.default)(R||(R=(0,N.default)(["\n flex-grow: 0;\n width: 280px;\n"]))),ve=(0,j.default)(K.default)(P||(P=(0,N.default)(["\n align-self: end;\n flex-grow: 0;\n height: fit-content;\n margin-left: 16px;\n margin-bottom: 15px;\n"]))),ye=(0,j.default)(K.default)(L||(L=(0,N.default)(["\n align-self: end;\n flex-grow: 0;\n height: fit-content;\n margin-left: 16px !important;\n margin-bottom: 15px !important;\n"]))),_e=V.default.createElement(de.default,{"data-test-itsi":"recommendation-control-star-sparkles-double-icon",viewBox:"0 0 16 16"});function RecommendationControl(i){var s,{isPSCDisabled:o,isPSCInstalled:h,onLoadRecommendationsClick:v,onRecommendationControlsChange:y,recommendationSettingsObject:_}=i,[S,T]=(0,V.useState)(_.analysisWindowValue),[x,R]=(0,V.useState)(_.analysisWindowStartDate),[P,L]=(0,V.useState)(!1),[N,j]=(0,V.useState)(_.thresholdConfigValue),[W,K]=(0,V.useState)(!0),[U,Y]=(0,V.useState)(_.recommendationApplyAsValue),de=(0,V.useCallback)(()=>{L(!0)},[]),Se=(0,V.useCallback)((i,s)=>{var{value:o}=s;j(o),y("threshold_direction",o)},[y]),be=(0,V.useCallback)((i,s)=>{var{value:o}=s,h=(0,te.default)().subtract(o.match(/\d+/g)[0],"days").unix(),v=o.match(/\d+/g)[0],_=(0,te.default)().subtract(v,"day");K(te.default.unix(h).isBefore(_)),T(o),R(h),y("analysis_window",o),y("start_date",h)},[y]),Te=(0,V.useCallback)((i,s)=>{var{value:o}=s,h=(0,te.default)(o).unix(),v=S.match(/\d+/g)[0],_=(0,te.default)().subtract(v,"day");R(h),y("start_date",h),K(te.default.unix(h).isBefore(_))},[S,y]),Ee=(0,V.useCallback)((i,s)=>{var{value:o}=s;Y(o),y("apply_as",o)},[y]),ke=(0,V.useCallback)(()=>{L(!1)},[]),Ce=te.default.unix(x).format(se.MOMENT_FORMAT).toString(),xe=!h||o,we="";return h?o&&(we=oe.AT_RECOMMENDATION_PSC_DISABLED_MESSAGE,s="warning"):(we=oe.AT_RECOMMENDATION_PSC_NOT_INSTALLED_MESSAGE,s="error"),V.default.createElement(V.default.Fragment,null,V.default.createElement(ce,null,V.default.createElement(ge,{"data-test-itsi":"threshold-recommendation-control-heading",level:4},(0,ie.gettext)("Splunk AI (optional)")),(!P||xe)&&V.default.createElement(me,{"data-test-itsi":"threshold-recommendation-load-configuration-button",label:(0,ie.gettext)("Recommend threshold configuration"),icon:_e,onClick:de}),P&&!xe&&V.default.createElement(V.default.Fragment,null,V.default.createElement(he,{"data-test-itsi":"threshold-recommendation-direction",label:(0,ie.gettext)("Thresholding Direction"),labelPosition:"top",required:!0,tooltip:le.RECOMMENDATION_THRESHOLD_DIRECTION_TOOLTIP},V.default.createElement(pe,{"data-test-itsi":"threshold-recommendation-direction-select",value:N,onChange:Se},le.THRESHOLD_CONFIGURATION_OPTIONS.map(i=>V.default.createElement(ee.default.Option,{"data-test-itsi":"threshold-recommendation-direction-select-option",description:i.description,label:i.label,value:i.value,key:i.value})))),V.default.createElement(he,{"data-test-itsi":"threshold-recommendation-analysis-window",label:(0,ie.gettext)("Analysis Window"),labelPosition:"top",required:!0,tooltip:le.RECOMMENDATION_THRESHOLD_ANALYSIS_WINDOW_TOOLTIP},V.default.createElement(ee.default,{"data-test-itsi":"threshold-recommendation-analysis-window-select",value:S,onChange:be},le.ANALYSIS_WINDOW_OPTIONS.map(i=>V.default.createElement(ee.default.Option,{"data-test-itsi":"threshold-recommendation-analysis-window-select-option",description:i.description,label:i.label,value:i.value,key:i.value})))),V.default.createElement(ue,{"data-test-itsi":"threshold-recommendation-start-date-control-group",label:(0,ie.gettext)("Starting on"),labelWidth:re.LABEL_WIDTHS.Short,error:!W&&(0,ie.gettext)("Selected analysis window and date will exceed today's date")},V.default.createElement(Z.default,{"data-test-itsi":"threshold-recommendation-start-date",value:Ce,onChange:Te})),V.default.createElement(he,{"data-test-itsi":"threshold-recommendation-apply-as-control",label:(0,ie.gettext)("Apply As"),labelPosition:"top",required:!0},V.default.createElement(fe,{"data-test-itsi":"threshold-recommendation-apply-as-select",onChange:Ee,value:U},le.RECOMMENDATION_APPLY_AS_OPTIONS.map(i=>V.default.createElement(ee.default.Option,{"data-test-itsi":"threshold-recommendation-apply-as-select-option",description:i.description,label:i.label,value:i.value,key:i.value})))),V.default.createElement(ve,{appearance:"primary","data-test-itsi":"threshold-recommendation-load-recommendations-button",disabled:!W,onClick:v,label:(0,ie.gettext)("Load Recommendations"),icon:_e}),V.default.createElement(ye,{appearance:"pill","data-test-itsi":"threshold-recommendation-control-cancel-button",label:(0,ie.gettext)("Cancel"),onClick:ke}))),P&&xe&&V.default.createElement(X.default,{type:s,"data-test-itsi":"kpi-thresholding-install-psc-".concat(s,"-message")},we," ",!h&&V.default.createElement(V.default.Fragment,null,(0,ie.gettext)("Download the app for "),V.default.createElement($.default,{"data-test-itsi":"kpi-thresholding-psc-app-install-link-linux",to:(0,ne.getSplunkBaseURL)(ae.SPLUNKBASE_APPS.Python_Scientific_Linux.id),openInNewContext:!0},(0,ie.gettext)("Linux 64-bit")),(0,ie.gettext)(", "),V.default.createElement($.default,{"data-test-itsi":"kpi-thresholding-psc-app-install-link-windows",to:(0,ne.getSplunkBaseURL)(ae.SPLUNKBASE_APPS.Python_Scientific_Windows.id),openInNewContext:!0},(0,ie.gettext)("Windows 64-bit")),(0,ie.gettext)(", or "),V.default.createElement($.default,{"data-test-itsi":"kpi-thresholding-psc-app-install-link-mac",to:(0,ne.getSplunkBaseURL)(ae.SPLUNKBASE_APPS.Python_Scientific_Mac.id),openInNewContext:!0},(0,ie.gettext)("Mac Intel"))),h&&o&&V.default.createElement($.default,{"data-test-itsi":"kpi-thresholding-psc-app-enable-link",to:(0,ne.manageAppsURL)({search:ae.PYTHON_SCIENTIFIC_APP_NAME_PREFIX}),openInNewContext:!0},(0,ie.gettext)("Enable the app here"))))}RecommendationControl.propTypes={isPSCDisabled:W.default.bool,isPSCInstalled:W.default.bool,onRecommendationControlsChange:W.default.func.isRequired,onLoadRecommendationsClick:W.default.func.isRequired,recommendationSettingsObject:W.default.object.isRequired},RecommendationControl.defaultProps={isPSCDisabled:!1,isPSCInstalled:!0};var Se=RecommendationControl;s.default=Se,i.exports=s.default},1651:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_=h(o(18)),S=h(o(17)),T=h(o(30)),x=h(o(21)),R=h(o(22)),P=h(o(20)),L=h(o(11)),N=h(o(9)),V=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),j=h(o(2)),W=h(o(47)),K=h(o(3)),U=h(o(56)),Y=h(o(148)),$=h(o(132)),X=o(5),Z=o(68);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,P.default)(i);if(s){var v=(0,P.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,R.default)(this,o)}}o(29);var ee=(0,K.default)(Y.default)(v||(v=(0,N.default)(["\n\tpadding-left: 0;\n"]))),te=(0,K.default)($.default)(y||(y=(0,N.default)(["\n\tpadding: 0;\n\tdisplay: inline-block;\n\tvertical-align: bottom;\n"]))),ie=function(i){(0,x.default)(KpiAlertingToggleControl,i);var s=_createSuper(KpiAlertingToggleControl);function KpiAlertingToggleControl(i){var o;(0,S.default)(this,KpiAlertingToggleControl);for(var h=arguments.length,v=new Array(h>1?h-1:0),y=1;y<h;y++)v[y-1]=arguments[y];return o=s.call(this,i,...v),(0,L.default)((0,T.default)(o),"handleClick",(i,s)=>{var h=!s.value;o.setState({isSelected:h}),o.props.onChange(h)}),(0,L.default)((0,T.default)(o),"render",()=>{var{isReadOnly:i,size:s,tooltipContent:h}=o.props,v=!!o.state.isSelected;return V.default.createElement(V.Fragment,null,V.default.createElement(U.default,{"data-test-itsi":i?"kpi-alerting-read-only-control-group":"kpi-alerting-control-group",label:(0,X.gettext)("Enable KPI Alerting"),labelWidth:Z.LABEL_WIDTHS.Massive,tooltip:i?null:h},i?V.default.createElement(ee,{"data-test-itsi":"kpi-alerting-read-only-value"},v?(0,X.gettext)("Yes"):(0,X.gettext)("No")):V.default.createElement(te,{"data-test-itsi":"kpi-alerting-control-switch",value:v,appearance:"toggle",selected:v,onClick:o.handleClick,size:s})))}),o.state={isSelected:o.props.enabled},o}return(0,_.default)(KpiAlertingToggleControl)}(V.Component);(0,L.default)(ie,"propTypes",{onChange:j.default.func.isRequired,enabled:j.default.bool,isReadOnly:j.default.bool,size:j.default.string,tooltipContent:j.default.string}),(0,L.default)(ie,"defaultProps",{enabled:!1,onChange:W.default,size:"small",isReadOnly:!1,tooltipContent:(0,X.gettext)("If enabled, the KPI generates alerts for changes in severity.")});var ae=ie;s.default=ae,i.exports=s.default},1652:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_=h(o(18)),S=h(o(17)),T=h(o(30)),x=h(o(21)),R=h(o(22)),P=h(o(20)),L=h(o(11)),N=h(o(9)),V=h(o(2)),j=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),W=h(o(3)),K=h(o(39)),U=h(o(454)),Y=h(o(148)),$=h(o(360)),X=o(40),Z=o(5),ee=h(o(3060));function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,P.default)(i);if(s){var v=(0,P.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,R.default)(this,o)}}o(29);var te=(0,W.default)(K.default)(v||(v=(0,N.default)(["\n\tcolor: ",";\n\tmargin-top: 10px;\n"])),X.variables.linkColor),ie=(0,W.default)(Y.default)(y||(y=(0,N.default)(["\n\tpadding-left: 0;\n"]))),ae=function(i){(0,x.default)(KpiAlertingAdvancedOptionsView,i);var s=_createSuper(KpiAlertingAdvancedOptionsView);function KpiAlertingAdvancedOptionsView(i){var o;(0,S.default)(this,KpiAlertingAdvancedOptionsView);for(var h=arguments.length,v=new Array(h>1?h-1:0),y=1;y<h;y++)v[y-1]=arguments[y];return o=s.call(this,i,...v),(0,L.default)((0,T.default)(o),"shouldShowRules",i=>2===i),(0,L.default)((0,T.default)(o),"handleOptionChange",(i,s)=>{var{value:h}=s,v={value:h};o.props.handleKpiAlertingOptionChange(h),v.showRules=o.shouldShowRules(h),o.setState(v)}),(0,L.default)((0,T.default)(o),"onClickAddRule",()=>{var i=o.props.getAvailableSeverityValues();0!==i.length&&(o.props.addOrUpdateRuleToKpiModel(i[0],[]),i=o.props.getAvailableSeverityValues(),o.setState({availableSeverityValues:i}))}),(0,L.default)((0,T.default)(o),"onClickRemoveRule",i=>{o.props.removeRuleFromKpiModel(i),o.setState({availableSeverityValues:o.props.getAvailableSeverityValues()})}),(0,L.default)((0,T.default)(o),"updateRule",(i,s)=>{o.props.addOrUpdateRuleToKpiModel(i,s);var h=o.props.getAvailableSeverityValues();o.setState({availableSeverityValues:h})}),(0,L.default)((0,T.default)(o),"onUpdateToSeverity",(i,s)=>{o.props.removeAndAddRuleToKpiModel(i,s);var h=o.props.getAvailableSeverityValues();o.setState({availableSeverityValues:h})}),(0,L.default)((0,T.default)(o),"generateRules",()=>{var{addOrUpdateRuleToKpiModel:i,getAvailableSeverityValues:s,getCurrentRules:h,isReadOnly:v}=o.props,y=[],_=h();return _&&0!==_.length&&_.forEach(h=>{y.push(j.default.createElement(ee.default,{getAvailableSeverityValues:s,addOrUpdateRuleToKpiModel:i,updateRule:o.updateRule,toSeverity:h.change_to,fromSeverityValues:h.change_from,key:h.change_to,removeRuleFromKpiModel:o.onClickRemoveRule,onUpdateToSeverity:o.onUpdateToSeverity,isReadOnly:v}))}),y}),(0,L.default)((0,T.default)(o),"render",()=>{var{availableSeverityValues:i,showRules:s,value:h}=o.state,v=o.generateRules(),y=i.length>0,_=(0,Z.gettext)("Trigger a notable event for ALL KPI severity changes"),S=(0,Z.gettext)("Trigger a notable event for specific changes");return j.default.createElement(j.Fragment,null,o.props.isReadOnly?j.default.createElement(j.Fragment,null,j.default.createElement(ie,{"data-test-itsi":"kpi-alerting-advanced-options-view"},1===h?_:S),s&&v):j.default.createElement(j.Fragment,null,j.default.createElement(U.default,{"data-test-itsi":"kpi-alerting-options-radio",style:{display:"block"},value:h,onChange:o.handleOptionChange},j.default.createElement(U.default.Option,{"data-test-itsi":"all-option",style:{display:"inline-flex",paddingRight:"20px"},value:1},_),j.default.createElement(U.default.Option,{"data-test-itsi":"custom-option",style:{display:"inline-flex",position:"absolute"},value:2},S)),s&&v,s&&y&&j.default.createElement(te,{"data-test-itsi":"add-kpi-alerting-rule-button",icon:j.default.createElement($.default,null),label:(0,Z.gettext)("Add rule"),appearance:"pill",onClick:o.onClickAddRule})))}),o.state={value:o.props.selectedAdvancedOption,showRules:o.shouldShowRules(o.props.selectedAdvancedOption),availableSeverityValues:o.props.getAvailableSeverityValues()},o}return(0,_.default)(KpiAlertingAdvancedOptionsView)}(j.Component);(0,L.default)(ae,"propTypes",{selectedAdvancedOption:V.default.number.isRequired,getCurrentRules:V.default.func.isRequired,getAvailableSeverityValues:V.default.func.isRequired,handleKpiAlertingOptionChange:V.default.func.isRequired,addOrUpdateRuleToKpiModel:V.default.func.isRequired,removeRuleFromKpiModel:V.default.func.isRequired,removeAndAddRuleToKpiModel:V.default.func.isRequired,isReadOnly:V.default.bool}),(0,L.default)(ae,"defaultProps",{isReadOnly:!1});var ne=ae;s.default=ne,i.exports=s.default},1653:function(i,s,o){var h=o(3063);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},1654:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(28)),y=h(o(15)),_=o(203),S=y.default.View.extend({initialize:function initialize(i){this.data=i.data,this.time=i.time},hideZeroDots:function hideZeroDots(i){v.default.each(i.series,(function(s){v.default.each(i.series[s].data,(function(){0===this.y&&this.graphic&&this.graphic.hide()}))}))},render:function render(){this.$el.highcharts({title:{text:""},tooltip:{formatter:function formatter(){var i="<b>"+this.x+"</b>";return i+='<br/><span style="color:'+this.series.color+'">●</span>',i+=this.series.name+":"+this.y,-1!==this.series.name.indexOf("Anomaly")?0!==this.y&&i:i}},chart:{events:{redraw:function(){this.hideZeroDots(this.$el.highcharts())}.bind(this)}},xAxis:{categories:this.time,labels:{enabled:!0,align:"left",rotation:45,formatter:function formatter(){return this.value.split(", ")[0]}},tickInterval:40,tickLength:4,showLastLabel:!1,showFirstLabel:!0},yAxis:{title:{text:""},labels:{enabled:!1},min:0,plotLines:[{value:0,width:1,color:_.textColor}]},legend:{align:"center",verticalAlign:"bottom",borderWidth:0},credits:{enabled:!1},plotOptions:{series:{events:{legendItemClick:function legendItemClick(){return!1}}}},series:this.data.toJSON()},this.hideZeroDots)}});s.default=S,i.exports=s.default},2054:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(15)),y=o(5),_=v.default.View.extend({tagName:"div",className:"step-wizard-step",initialize:function initialize(i){return i=i||{},this.value=i.value||this.cid,this},showPreviousButton:!0,showNextButton:!0,previousLabel:"",nextLabel:(0,y.gettext)("Save & Next"),saveLabel:(0,y.gettext)("Save & Exit"),enabled:!0,visible:!0,label:(0,y.gettext)("Step"),value:"",dispatcher:null,activate:function activate(){return this},deactivate:function deactivate(){return this},validate:function validate(){throw"Extenders of BaseStepView must overload the validate method."},save:function save(){throw"Extenders of BaseStepView must overload the save method."},setEventDispatcher:function setEventDispatcher(i){this.dispatcher=i},stepForward:function stepForward(){this.dispatcher&&this.dispatcher.trigger("stepforward",this)},showErrorMessage:function showErrorMessage(i){this.dispatcher&&this.dispatcher.trigger("customerror",this,i)},clearErrorMessage:function clearErrorMessage(){this.dispatcher&&this.dispatcher.trigger("clearerror",this)}});s.default=_,i.exports=s.default},2064:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(17)),y=h(o(18)),_=h(o(21)),S=h(o(22)),T=h(o(20)),x=h(o(11)),R=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),P=h(o(2)),L=h(o(87)),N=o(5),V=o(111),j=o(154),W=o(461);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,T.default)(i);if(s){var v=(0,T.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,S.default)(this,o)}}o(29);var K=function(i){(0,_.default)(PredictiveAnalyticsWidget,i);var s=_createSuper(PredictiveAnalyticsWidget);function PredictiveAnalyticsWidget(i){var o;(0,v.default)(this,PredictiveAnalyticsWidget);for(var h=arguments.length,y=new Array(h>1?h-1:0),_=1;_<h;_++)y[_-1]=arguments[_];return(o=s.call(this,i,...y)).state={},o}return(0,y.default)(PredictiveAnalyticsWidget,[{key:"render",value:function render(){var i={fontSize:"55px",maxWidth:"300px",textOverflow:"ellipsis",whitespace:"nowrap",textAlign:"center",fontWeight:"bold",margin:"auto",color:this.props.color},s={background:this.props.widgetSeverity,padding:"84px 50px"},o="<div></div>",h=this.props.data;switch(h&&!isNaN(h)&&(h=parseFloat(this.props.data).toFixed(2)),this.props.searchProgress){case j.SEARCH_PROGRESS.NOT_STARTED:o=this.props.initialWidgetContent?W.SEARCH_PROGRESS_ELEMENTS.getSearchInfoElement(this.props.initialWidgetContent):W.SEARCH_PROGRESS_ELEMENTS.getSearchInfoElement();break;case j.SEARCH_PROGRESS.IN_PROGRESS:o=W.SEARCH_PROGRESS_ELEMENTS.getSearchInProgressElement();break;case j.SEARCH_PROGRESS.ERROR:o=R.default.createElement("div",{style:{margin:"0px auto"}},W.SEARCH_PROGRESS_ELEMENTS.getErrorMessageElement(this.props.errorMessage));break;case j.SEARCH_PROGRESS.NO_RESULTS:o=W.SEARCH_PROGRESS_ELEMENTS.getNoResultsElement((0,N.gettext)("No results found."));break;case j.SEARCH_PROGRESS.COMPLETED:o=R.default.createElement("div",{style:s},R.default.createElement(L.default,{"data-test-itsi":"pa-widget-heading",level:4,style:i},String(h)))}return o}}]),PredictiveAnalyticsWidget}(R.Component);(0,x.default)(K,"propTypes",{widgetSeverity:P.default.string,color:P.default.string,data:P.default.oneOfType([P.default.string,P.default.number]),searchProgress:P.default.number.isRequired,errorMessage:P.default.string,initialWidgetContent:P.default.string}),(0,x.default)(K,"defaultProps",{widgetSeverity:(0,V.getSeverityColor)(6),color:"#FFFFFF",data:"",errorMessage:"",initialWidgetContent:""});var U=K;s.default=U,i.exports=s.default},2065:function(i,s,o){var h=o(3022);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},2066:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y=h(o(17)),_=h(o(18)),S=h(o(30)),T=h(o(21)),x=h(o(22)),R=h(o(20)),P=h(o(11)),L=h(o(9)),N=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),V=h(o(2)),j=h(o(3)),W=h(o(39)),K=h(o(56)),U=h(o(43)),Y=h(o(33)),$=h(o(107)),X=h(o(82)),Z=h(o(89)),ee=h(o(290)),te=o(5),ie=o(133),ae=o(93),ne=o(883);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,R.default)(i);if(s){var v=(0,R.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,x.default)(this,o)}}o(29);var re=(0,j.default)($.default)(v||(v=(0,L.default)(["\n\twidth: 600px;\n"]))),se=function(i){(0,T.default)(BaseServiceTemplateSearchAndCalculateModal,i);var s=_createSuper(BaseServiceTemplateSearchAndCalculateModal);function BaseServiceTemplateSearchAndCalculateModal(i){var o;(0,y.default)(this,BaseServiceTemplateSearchAndCalculateModal);for(var h=arguments.length,v=new Array(h>1?h-1:0),_=1;_<h;_++)v[_-1]=arguments[_];o=s.call(this,i,...v),(0,P.default)((0,S.default)(o),"handleRequestClose",()=>{o.setState({isModalOpen:!1})}),(0,P.default)((0,S.default)(o),"generateSelectOptions",i=>i.map(i=>N.default.createElement(X.default.Option,{"data-test-itsi":"base-search-select-option",label:i.label,value:i.value,key:i.value}))),(0,P.default)((0,S.default)(o),"getSelectedBaseSearchMetrics",i=>{var s=i;return s||(s=o.props.baseSearchSelectItems[0].value),o.props.savedBaseSearchCollection.findWhere({_key:s}).get("metrics").map((function(i){return{value:i.id||i.get("_key"),label:i.get("title")}}))}),(0,P.default)((0,S.default)(o),"handleBaseSearchChange",(i,s)=>{var{value:h}=s,v=o.getSelectedBaseSearchMetrics(h);o.setState({baseSearchValue:h,metricsList:v,metricsValue:v[0].value}),o.props.handleUpdateKpiModel(h,v[0].value,o.state.titleValue,o.state.descriptionValue,o.props.kpiModel)}),(0,P.default)((0,S.default)(o),"handleMetricChange",(i,s)=>{var{value:h}=s;o.setState({metricsValue:h}),o.props.handleUpdateKpiModel(o.state.baseSearchValue,h,o.state.titleValue,o.state.descriptionValue,o.props.kpiModel)}),(0,P.default)((0,S.default)(o),"handleTitleChange",(i,s)=>{var{value:h}=s;o.props.handleUpdateKpiModel(o.state.baseSearchValue,o.state.metricsValue,h,o.state.descriptionValue,o.props.kpiModel),o.setState({titleValue:h})}),(0,P.default)((0,S.default)(o),"handleDescriptionChange",(i,s)=>{var{value:h}=s;o.props.handleUpdateKpiModel(o.state.baseSearchValue,o.state.metricsValue,o.state.titleValue,h,o.props.kpiModel),o.setState({descriptionValue:h})}),(0,P.default)((0,S.default)(o),"save",()=>{var i=o.props.validateModelEntries(o.props.kpiModel,o.props.isNew);i?o.props.kpiModel.get("title")?"not-unique-kpi-title"===i?o.setState({invalidKPITitle:ie.ALREADY_EXISTING_TITLE_MESSAGE}):o.setState({errorMessage:i}):o.setState({invalidKPITitle:ie.NO_EMPTY_TITLE_MESSAGE}):(o.setState({invalidKPITitle:""}),o.props.isNew?o.props.createKpi(o.props.kpiModel):o.props.editAndSaveKpi(o.props.kpiModel),o.handleRequestClose())}),(0,P.default)((0,S.default)(o),"getHelpLink",i=>N.default.createElement(U.default,{"data-test-itsi":"service-template-kpi-edit-base-search-link",to:i,openInNewContext:!0},(0,te.gettext)("Edit Base Search"))),(0,P.default)((0,S.default)(o),"getBaseSearchUrl",()=>{var i=o.state.baseSearchValue;if(i)return(0,ne.uiEditURL)(i)});var T=o.props.isNew;o.props.isNew&&o.props.isExampleKpi&&(T=!1);var x=T?o.getSelectedBaseSearchMetrics():o.getSelectedBaseSearchMetrics(o.props.currentKpiSearchValuesObject.base_search_id);return o.state={isModalOpen:o.props.isModalOpen,baseSearchValue:T?o.props.baseSearchSelectItems[0].value:o.props.currentKpiSearchValuesObject.base_search_id,metricsList:x,metricsValue:T?x[0].value:o.props.currentKpiSearchValuesObject.base_search_metric,titleValue:T?"":o.props.currentKpiSearchValuesObject.title,descriptionValue:T?"":o.props.currentKpiSearchValuesObject.description,errorMessage:""},T&&o.props.handleUpdateKpiModel(o.state.baseSearchValue,o.state.metricsValue,o.state.titleValue,o.state.descriptionValue,o.props.kpiModel),o}return(0,_.default)(BaseServiceTemplateSearchAndCalculateModal,[{key:"render",value:function render(){var{invalidKPITitle:i}=this.state,s=this.generateSelectOptions(this.props.baseSearchSelectItems),o=this.generateSelectOptions(this.state.metricsList);return N.default.createElement("div",(0,ae.createITSITestHook)(this.constructor.name),N.default.createElement(re,{"data-test-itsi":"base-service-template-search-and-calculate-modal",onRequestClose:this.handleRequestClose,open:this.state.isModalOpen},N.default.createElement($.default.Header,{title:this.props.isNew?(0,te.gettext)("New KPI"):(0,te.gettext)("Edit KPI"),onRequestClose:this.handleRequestClose}),N.default.createElement($.default.Body,null,this.state.errorMessage&&N.default.createElement(Y.default,{"data-test-itsi":"create-service-template-kpi-error-message",type:"error"},this.state.errorMessage),N.default.createElement(K.default,{"data-test-itsi":"create-service-template-kpi-title-control-group",error:!!i,help:i,label:(0,te.gettext)("Title")},N.default.createElement(Z.default,{"data-test-itsi":"create-service-template-kpi-title-text",error:!!i,value:this.state.titleValue,onChange:this.handleTitleChange,placeholder:(0,te.gettext)("required")})),N.default.createElement(K.default,{"data-test-itsi":"create-service-template-kpi-description-control-group",label:(0,te.gettext)("Description")},N.default.createElement(ee.default,{"data-test-itsi":"create-service-template-kpi-description-text-area",value:this.state.descriptionValue,onChange:this.handleDescriptionChange,placeholder:(0,te.gettext)("optional")})),N.default.createElement(K.default,{"data-test-itsi":"service-template-kpi-base-search-control-group",help:this.getHelpLink(this.getBaseSearchUrl()),label:(0,te.gettext)("Base Search"),tooltip:(0,te.gettext)("Select a base search. Ad hoc and data model searches cannot be used for service template KPIs.")},N.default.createElement(X.default,{"data-test-itsi":"base-search-select",filter:!0,value:this.state.baseSearchValue,onChange:this.handleBaseSearchChange},s)),N.default.createElement(K.default,{"data-test-itsi":"service-template-kpi-base-search-metric-control-group",label:(0,te.gettext)("Metric"),tooltip:(0,te.gettext)("Metric from the selected base search to associate with this KPI.")},N.default.createElement(X.default,{"data-test-itsi":"base-search-metric-select",filter:!0,value:this.state.metricsValue,onChange:this.handleMetricChange},o))),N.default.createElement($.default.Footer,null,N.default.createElement(W.default,{"data-test-itsi":"base-service-template-search-and-calculate-modal-cancel-button",onClick:this.handleRequestClose,label:(0,te.gettext)("Cancel")}),N.default.createElement(W.default,{appearance:"primary","data-test-itsi":this.props.isNew?"base-service-template-search-and-calculate-modal-save-create-button":"base-service-template-search-and-calculate-modal-save-edit-button",onClick:this.save,label:this.props.isNew?(0,te.gettext)("Create"):(0,te.gettext)("Save")}))))}}]),BaseServiceTemplateSearchAndCalculateModal}(N.Component);(0,P.default)(se,"propTypes",{savedBaseSearchCollection:V.default.object.isRequired,baseSearchSelectItems:V.default.array.isRequired,validateModelEntries:V.default.func.isRequired,createKpi:V.default.func,editAndSaveKpi:V.default.func,handleUpdateKpiModel:V.default.func.isRequired,isModalOpen:V.default.bool,isNew:V.default.bool.isRequired,isExampleKpi:V.default.bool,currentKpiSearchValuesObject:V.default.object,kpiModel:V.default.object.isRequired}),(0,P.default)(se,"defaultProps",{isModalOpen:!1,isExampleKpi:!1,currentKpiSearchValuesObject:{},createKpi:function createKpi(){},editAndSaveKpi:function editAndSaveKpi(){}});var le=se;s.default=le,i.exports=s.default},2991:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(15)),y=o(58),_=v.default.Router.extend({ServiceView:new v.default.View,initialize:function initialize(i){i=i||{},this.cachedServiceBaseModel=i.serviceBaseModel,this.configurationLayoutViewOptions=i.configurationLayoutViewOptions||{},v.default.View.prototype.initialize.apply(this,arguments)},page:function page(){v.default.View.prototype.page.apply(this,arguments),this.handleHash()},navigate:function navigate(i){(0,y.updateURL)(i)}});s.default=_,i.exports=s.default},2992:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(42)),y=h(o(15)),_=h(o(1145)),S=y.default.View.extend({tabLayoutDataTestItsi:"base-service-view-tab-layout",events:{kpiselected:"_onKpiSelected"},initialize:function initialize(i){if(y.default.View.prototype.initialize.apply(this,arguments),!i.model)throw"Must provide model option";this.modelClone=i.model,this.tabToShow=i.tabToShow,this.childViews={},this.childViews.tabViews=new _.default({dataTestItsi:this.tabLayoutDataTestItsi,tabShownCallback:this.onTabShown.bind(this),tabToShow:this.tabToShow,tabs:[]})},getUrlString:function getUrlString(i,s,o){var h=null,v="new";this.modelClone.isNew()||(v=this.modelClone.id);var y="serviceId="+v+"&tab="+i;return i===s&&(h=o)&&(y+="&kpiId="+h),y},remove:function remove(){return(0,v.default)(this.childViews,(function(i){i.remove()})),y.default.View.prototype.remove.apply(this,arguments)},onTabShown:function onTabShown(i){this.trigger("tabactivated",i)},getUrl:function getUrl(i){return this.getUrlString(i,this.kpiTab.getTabId(),this.kpiTab.getContentView().getSelectedKpiId())},_onKpiSelected:function _onKpiSelected(){this.trigger("kpiselected")}});s.default=S,i.exports=s.default},2993:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=o(5),y=h(o(294)),_=y.default.extend({dataTestItsi:"base-service-entities-tab",initialize:function initialize(i){(i=i||{}).tabLabel=(0,v.gettext)("Entities"),y.default.prototype.initialize.apply(this,arguments)}});s.default=_,i.exports=s.default},2994:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=o(49),y=h(o(42)),_=h(o(95)),S=o(16),T=o(5),x=h(o(8273)),R=h(o(114)),P=h(o(2749)),L=h(o(8276)),N=h(o(8279));o(8280);var V=(0,v.template)(N.default,null,{variable:"vars"}),j=x.default.extend({tagName:"div",className:x.default.prototype.className+" service-definition-entities-content-view",_onDismiss:function _onDismiss(){this.$(".show-warning-message-container").css({display:"none"})},initialize:function initialize(i){if(i=i||{},this.serviceTemplate=i.serviceTemplate,!i.service)throw"Must pass service object to ServiceDefinitionEntitiesContentView";this._setupHeader(i.service),x.default.prototype.initialize.apply(this,arguments),this.children={},this.children.fillInWarningMessage=new R.default({appearance:"fill",content:this.serviceTemplate?(0,S.sprintf)((0,T.gettext)("Provide values for all empty entity rules coming from the %s service template to filter the service to a specific set of entities."),this.serviceTemplate.get("title")):"",dataTestItsi:"fill-in-warning-message",onRequestRemove:this._onDismiss.bind(this),style:{marginTop:10},type:"warning"})},_rulesChanged:function _rulesChanged(i,s){var o=0===s.length;this.service.unset("entity_rules",{silent:!o}),o?(this.service.set("entity_rules",new P.default,{silent:!o}),this.service.get("kpis").each((function(i){"shared_base"!==i.get("search_type")&&i.set("is_service_entity_filter",!1)}))):this.service.set("entity_rules",s),this.matchedEntitiesView&&this.matchedEntitiesView.refresh()},_setupHeader:function _setupHeader(i){var s=this._isBlankRuleType(i);this.showWarningMessage=!!this.serviceTemplate&&s,this.entityRulesHeader=V({entityRulesDescription:(0,T.gettext)("Entity Rules allow for the optional, dynamic filtering of KPIs and can help in root cause analysis. A service need not define any Entity Rules and is not limited to only the entities matching Entity Rules."),showWarningMessage:this.showWarningMessage},{variable:"vars"})},_isBlankRuleType:function _isBlankRuleType(i){if(!i.get("base_service_template_id"))return!1;var s=i.get("entity_rules").models,o=!1;return s.length&&(0,y.default)(s,function(i){var s=i.get("rule_items").models;if(s.length&&(0,_.default)(s,function(i){return"notmatchesblank"===i.get("rule_type")||"matchesblank"===i.get("rule_type")}.bind(this)).length)return void(o=!0)}.bind(this)),o},initEntityRulesView:function initEntityRulesView(){this.specifyEntityRulesView=new L.default({rulesContainerModel:this.service,ruleFieldsBlockList:["services"],serviceTemplateTitle:this.serviceTemplate?this.serviceTemplate.get("title"):""})},addWarningMessage:function addWarningMessage(){this.showWarningMessage&&this.$el.find(".show-warning-message-container").append(this.children.fillInWarningMessage.render().$el)},refreshModel:function refreshModel(){this._setupHeader(this.service),this.$(".entity-description-header").html(""),this.$(".entity-description-header").replaceWith(this.entityRulesHeader),x.default.prototype.refreshModel.apply(this,arguments),this.addWarningMessage()},render:function render(){return x.default.prototype.render.apply(this,arguments),this.addWarningMessage(),this}});s.default=j,i.exports=s.default},2995:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(15)),y=o(64),_=h(o(0)),S=h(o(36)),T=o(5),x=o(525),R=h(o(2996)),P=h(o(619)),L=h(o(52)),N=(0,x.getStore)(),V=v.default.View.extend({attributes:{"data-test-itsi":"matched-entities-view"},tagName:"div",className:"matched-entities-view",initialize:function initialize(i){if(i=i||{},this.options=i,!i.service)throw"Must provide service";this.service=i.service,v.default.View.prototype.initialize.apply(this,arguments)},renderTable:function renderTable(){this.$el.html('<div data-test-itsi="matched-entities-table-container"></div>');var i=this.$el.find('[data-test-itsi="matched-entities-table-container"]'),s=this.options.noDataText||(0,T.gettext)("No entities currently matched. They will be automatically added to the service when created.");i.length&&(S.default.unmountComponentAtNode(i.get(0)),S.default.render(_.default.createElement(L.default,null,_.default.createElement(y.Provider,{store:N},_.default.createElement(P.default,null,_.default.createElement(R.default,{noDataText:s,entityFilter:this.service.get("entity_rules").toJSON()})))),i.get(0)))},refresh:function refresh(){this.renderTable()},remove:function remove(){return v.default.View.prototype.remove.apply(this,arguments)},render:function render(){return this.refresh(),this}});s.default=V,i.exports=s.default},2996:function(i,s,o){"use strict";var h=this&&this.__createBinding||(Object.create?function(i,s,o,h){void 0===h&&(h=o);var v=Object.getOwnPropertyDescriptor(s,o);v&&!("get"in v?!s.__esModule:v.writable||v.configurable)||(v={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,h,v)}:function(i,s,o,h){void 0===h&&(h=o),i[h]=s[o]}),v=this&&this.__setModuleDefault||(Object.create?function(i,s){Object.defineProperty(i,"default",{enumerable:!0,value:s})}:function(i,s){i.default=s}),y=this&&this.__importStar||function(i){if(i&&i.__esModule)return i;var s={};if(null!=i)for(var o in i)"default"!==o&&Object.prototype.hasOwnProperty.call(i,o)&&h(s,i,o);return v(s,i),s},_=this&&this.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(s,"__esModule",{value:!0}),s.cellData=s.columnsData=void 0;const S=y(o(0)),T=_(o(97)),x=_(o(163)),R=_(o(1813)),P=_(o(53)),L=o(59),N=o(64),V=_(o(3)),j=_(o(33)),W=_(o(152)),K=_(o(104)),U=o(5),Y=o(16),$=_(o(512)),X=_(o(789)),Z=o(25),ee=o(48),te=o(161),ie=o(100),ae=o(671),ne=o(519),re=o(227),se=o(667),le=o(510),oe=_(o(2848));s.columnsData=[{dataTestItsi:"matched-entities-body-table-title-column-header",name:(0,U.gettext)("Title"),sortable:!0},{dataTestItsi:"matched-entities-body-table-aliases-column-header",name:(0,U.gettext)("Aliases")},{dataTestItsi:"matched-entities-body-table-info-column-header",name:(0,U.gettext)("Info")},{dataTestItsi:"matched-entities-body-table-types-column-header",name:(0,U.gettext)("Entity Types")}],s.cellData=[{dataTestItsi:"matched-entities-body-table-title-cell"},{dataTestItsi:"matched-entities-body-table-aliases-cell"},{dataTestItsi:"matched-entities-body-table-info-cell"},{dataTestItsi:"matched-entities-body-table-types-cell"}];const de=V.default.div`
display: flex;
padding-bottom: 10px;
align-items: center;
`,ce=V.default.div`
margin-left: auto;
margin-right: 0;
`,he=(0,V.default)(j.default)`
display: block;
overflow-y: scroll;
max-height: 80px;
`;s.default=(0,N.connect)(i=>({entitiesApiStatus:i.entities.apiStatus,entitiesCountApiStatus:i.entities.entitiesCountApiStatus,entitiesTotalCount:i.entities.entitiesCountData.count,entityTypes:i.entityTypes.data,entityTypesApiStatus:i.entityTypes.apiStatus,entitiesObjectsArr:i.entities.data}),i=>(0,L.bindActionCreators)({entitiesFromItsiFilterRetrieveAction:ae.entitiesFromItsiFilterRetrieve,entitiesCountFromItsiFilterRetrieveAction:ae.entitiesCountFromItsiFilterRetrieve,entityTypesRetrieveAction:se.entityTypesRetrieve},i))((function MatchedEntitiesTable({entitiesApiStatus:i,entitiesCountApiStatus:o,entitiesCountFromItsiFilterRetrieveAction:h,entitiesFromItsiFilterRetrieveAction:v,entitiesTotalCount:y,entityTypesApiStatus:_,entityTypesRetrieveAction:L,entityTypes:N,entitiesObjectsArr:V,entityFilter:ae,noDataText:se}){const[ue,pe]=(0,S.useState)(1),[fe,ge]=(0,S.useState)(!1),[me,ve]=(0,S.useState)({}),[ye,_e]=(0,S.useState)("asc"),[Se,be]=(0,S.useState)(10),Te=y||0,Ee=(0,T.default)(()=>{const i={count:Se,offset:(ue-1)*Se,sort_dir:ye,sort_key:"identifying_name"};v(ae,re.ITSI_FILTER_MODE.ADVANCED,i)},ie.DEFAULT_DEBOUNCE_DELAY),ke=(0,T.default)(()=>{h(ae,re.ITSI_FILTER_MODE.ADVANCED)},ie.DEFAULT_DEBOUNCE_DELAY);(0,S.useEffect)(()=>{Ee(),ke(),L({fetchParams:{fields:"identifying_name,_key,_title"},mode:re.ITSI_FILTER_MODE.SIMPLE})},[]),(0,S.useEffect)(()=>{Ee()},[ue,Se,ye]),(0,S.useEffect)(()=>{Ee(),ke()},[JSON.stringify(ae)]);const getAliases=i=>i?i.values instanceof Array?(0,x.default)(i.values.join(", ")):(0,x.default)(i.values):"",getTypes=i=>{if(_===le.ENTITY_TYPES_RETRIEVE_STATUS.IN_PROGRESS)return(0,U.gettext)("Loading...");if(!N||!i)return"";i instanceof Array||(i=[i]);const s=(0,R.default)(N,i,({_key:i},s)=>i===s);return(0,x.default)((0,P.default)(s,"title").join(", "))},handleRowClick=(i,s)=>{ge(!0),ve(s)},handleSort=()=>{_e("asc"===ye?"desc":"asc")},Ce=(0,Y.sprintf)((0,Z.ungettext)("%(totalCount)d Entity","%(totalCount)d Entities",Te),{totalCount:Te}),xe=o===ee.READY||o===ne.ENTITIES_COUNT_FROM_ITSI_FILTER_RETRIEVE_STATUS.IN_PROGRESS,we=i===ee.READY||i===ne.ENTITIES_FROM_ITSI_FILTER_RETRIEVE_STATUS.IN_PROGRESS||_===ee.READY||_===le.ENTITY_TYPES_RETRIEVE_STATUS.IN_PROGRESS;if(!we&&!xe&&!Te)return S.default.createElement(j.default,{"data-test-itsi":"matched-entities-table-no-matches-message"},se);const Me=Math.ceil(Te/Se);return S.default.createElement(S.default.Fragment,null,xe?null:S.default.createElement(de,null,S.default.createElement("div",{"data-test-itsi":"matched-entities-body-table-count"},Ce),Me>1&&S.default.createElement(ce,null,S.default.createElement($.default,{telemetryNamespace:"Matched Entities Table",appearance:"pill",itemsPerPage:Se||0,itemsPerPageOptions:te.LOW_NUMBERS_COUNTS_PER_PAGE_OPTIONS.map(i=>i.value),onItemsPerPageChange:i=>{pe(1),be(i)},"data-test-itsi":"entities-per-page"}),S.default.createElement(W.default,{"data-test-itsi":"matched-entities-body-table-paginator",current:ue,onChange:(i,{page:s})=>{pe(s)},totalPages:Me}))),we?S.default.createElement(he,{"data-test-itsi":"matched-entities-loading-message",type:"info"},(0,U.gettext)("Loading entities...")):S.default.createElement(S.default.Fragment,null,S.default.createElement(K.default,{"data-test-itsi":"matched-entities-table",stripeRows:!0},S.default.createElement(K.default.Head,{"data-test-itsi":"matched-entities-table-head"},s.columnsData.map(i=>{const s=i.sortable?{onSort:handleSort,sortDir:ye,sortKey:"identifying_name"}:{};return S.default.createElement(K.default.HeadCell,Object.assign({"data-test-itsi":i.dataTestItsi,key:i.dataTestItsi},s),i.name)})),S.default.createElement(K.default.Body,null,V.map(i=>{const o=i._key;return S.default.createElement(K.default.Row,{"data-test-itsi":"matched-entities-body-row",data:i,key:o,onClick:handleRowClick},S.default.createElement(K.default.Cell,{"data-test-itsi":s.cellData[0].dataTestItsi,key:`${o}-${i.title}-entity-title-cell`},S.default.createElement(X.default,{dataTestItsi:"matched-entities-body-table-info",tooltipDataTestItsi:"matched-entities-body-table-info-tooltip",maxWidth:300,value:i.title})),S.default.createElement(K.default.Cell,{"data-test-itsi":s.cellData[1].dataTestItsi,key:`${o}-${i.title}-entity-alias-cell`},S.default.createElement(X.default,{dataTestItsi:"matched-entities-body-table-alias",tooltipDataTestItsi:"matched-entities-body-table-alias-tooltip",maxWidth:300,value:getAliases(i.identifier)})),S.default.createElement(K.default.Cell,{"data-test-itsi":s.cellData[2].dataTestItsi,key:`${o}-${i.title}-entity-info-cell`},S.default.createElement(X.default,{dataTestItsi:"matched-entities-body-table-info",tooltipDataTestItsi:"matched-entities-body-table-info-tooltip",maxWidth:300,value:getAliases(i.informational)})),S.default.createElement(K.default.Cell,{"data-test-itsi":s.cellData[3].dataTestItsi,key:`${o}-${i.title}-entity-types-cell`},S.default.createElement(X.default,{dataTestItsi:"matched-entities-body-table-types",tooltipDataTestItsi:"matched-entities-body-table-types-tooltip",maxWidth:300,value:getTypes(i.entity_type_ids)})))}))),S.default.createElement(oe.default,{"data-test-itsi":"entity-container-modal",isOpen:fe,closeModal:()=>{ge(!1),ve({})},entityTypes:N,selectedEntity:me,entitiesApiStatus:ne.ENTITIES_UPDATE_STATUS.SUCCESS,errorMessage:"",readOnlyView:!0,canUserCreateEntity:!1})))}))},2997:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=o(5),y=o(76),_=h(o(294)),S=_.default.extend({dataTestItsi:"base-service-settings-tab",initialize:function initialize(i){(i=i||{}).tabId=y.SERVICE_DEFINITION_TABS.SETTINGS,i.tabLabel=(0,v.gettext)("Settings"),_.default.prototype.initialize.call(this,i)}});s.default=S,i.exports=s.default},2998:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y=h(o(9)),_=h(o(28)),S=h(o(15)),T=o(49),x=h(o(0)),R=h(o(36)),P=h(o(53)),L=h(o(3)),N=o(5),V=h(o(56)),j=h(o(43)),W=h(o(33)),K=o(58),U=o(225),Y=o(200),$=o(185),X=o(283),Z=o(174),ee=h(o(1610)),te=h(o(1999)),ie=h(o(1614)),ae=h(o(52)),ne=h(o(969)),re=h(o(1174)),se=h(o(1639)),le=h(o(970)),oe=h(o(3004)),de=h(o(3006)),ce=h(o(3008)),he=h(o(3010));o(3011);var ue=(0,L.default)(W.default)(v||(v=(0,y.default)(["\n\tmargin-left: 140px;\n\tmargin-bottom: 10px;\n"]))),pe={},fe=S.default.View.extend({ServiceHealthView:re.default,tagName:"div",className:"settings-content-view",compiledTemplate:(0,T.template)(he.default,null,{variable:"vars"}),initialize:function initialize(i){if(!(i=i||{}).service)throw"Must provide service";this.serviceModelClone=i.service,this.servicesCollectionData=i.servicesCollectionData,this.serviceTemplate=i.serviceTemplate,this.sdDispatcher=i.sdDispatcher,this.isReadOnly=i.isReadOnly||!1,this.isReadOnly&&(this.ServiceHealthView=se.default),this.severityLabels=i.severityLabels,this.healthScoreKPI=null,this.enableDisableAttribute=this.serviceModelClone.has("enabled"),this.setBackfillNeededStatus=this._setBackfillNeededStatus.bind(this),this.setBackfillEarliestTime=this._setBackfillEarliestTime.bind(this),this.setBackfillEnabledStatus=this._setBackfillEnabledStatus.bind(this),this.setCalculateByEntityEnabledStatus=this._setCalculateByEntityEnabledStatus.bind(this),this.updateTags=this._updateTags.bind(this),this.isBaseServiceTemplate=this.serviceModelClone.get("object_type")===Y.OBJECT_TYPE,this.listenTo(this.serviceModelClone,"on_sec_grp_title_update",this._renderSecurityGroupsDropdownControl),this.listenTo(this.serviceModelClone,"change",this._renderHealthScoreCalculateByEntityControl),this.serviceModelClone.fetchSecurityGroupTitle(),S.default.View.prototype.initialize.apply(this,arguments)},securityGroupDetails:function securityGroupDetails(){(0,K.redirect)((0,X.uiEditURL)(this.serviceModelClone.get("sec_grp"),!0))},render:function render(){return this.$el.html(this.compiledTemplate({gettext:N.gettext,isBaseServiceTemplate:this.isBaseServiceTemplate},{variable:"vars"})),this.$el.addClass("form-horizontal"),this.enableDisableAttribute&&this._renderEnableDisableControl(),this._renderServiceTagsControl(this.servicesCollectionData),this.healthScoreKPI=this._fetchHealthScoreKPI(),this.isBaseServiceTemplate||(this._renderHealthScoreBackfillControl(),this._renderSecurityGroupsDropdownControl()),this._renderHealthScoreCalculateByEntityControl(),this._renderHealthScoreContent(),this},_updateTile:function _updateTile(){this.tileView.model.set({color:this.healthModel.get("health_severity_color"),value:this.healthModel.get("health_score")}),(0,Z.safeRemoveView)(this,this.tileView),(0,_.default)(".service-health-tile",this.$el).append(this.tileView.render().$el)},setTileLoading:function setTileLoading(){(0,_.default)(".service-health-tile",this.$el).css("position","relative"),this.tileView.setTileLoading()},setTileNotLoading:function setTileNotLoading(){(0,_.default)(".service-health-tile",this.$el).removeAttr("position"),this.tileView.setTileNotLoading()},_renderHealthScoreContent:function _renderHealthScoreContent(){(0,Z.safeRemoveView)(this,this.healthScoreContentView),this.healthScoreContentView=new this.ServiceHealthView({serviceModel:this.serviceModelClone,servicesCollectionData:this.servicesCollectionData,showOverview:!1,severityLabels:this.severityLabels}),this.listenTo(this.healthScoreContentView,"set-tile-loading",this.setTileLoading),this.listenTo(this.healthScoreContentView,"set-tile-not-loading",this.setTileNotLoading),this.$(".kpi-severity-importance-table-container",this.$el).append(this.healthScoreContentView.render().$el),this.healthModel=this.healthScoreContentView.overviewView.healthModel,this.listenTo(this.healthModel,"change",this._updateTile),(0,Z.safeRemoveView)(this,this.healthTileHeaderView),this.healthTileHeaderView=new ee.default({dataTestItsi:"simulated-health-score-text-label-control",label:(0,N.gettext)("Simulated Health Score"),tooltip:(0,N.gettext)("Range: Critical 0-20, High 20-40, Medium 40-60, Low 60-80, Normal 80-100")}),this.$(".service-health-tile-header",this.$el).append(this.healthTileHeaderView.render().$el),this.$(".health-score-title-description",this.$el).text((0,N.gettext)("Tweak the importance of each of the KPIs and see how that reflects on the simulated Service Health Score.")),(0,Z.safeRemoveView)(this,this.tileView);var i=new te.default({label:this.isBaseServiceTemplate?(0,N.gettext)("Example Service"):this.serviceModelClone.get("title")});this.tileView=new ie.default({hasSparkline:!1,model:i,tileSize:U.TILE_SIZES.LARGE.value}),this.$(".service-health-tile",this.$el).append(this.tileView.render().$el)},_createTeamsDependencyWarning:function _createTeamsDependencyWarning(){var i=(0,_.default)('<div class="teams-dependency-warning-container"></div>');return R.default.unmountComponentAtNode(i.get(0)),R.default.render(x.default.createElement(ae.default,null,x.default.createElement(ue,{"data-test-itsi":"security-group-change-warning-message",type:"warning"},(0,N.gettext)("Changing a service's team may break service dependencies. Ask your Splunk administrator to")," ",x.default.createElement(j.default,{"data-test-itsi":"service-def-review-logs-link",openInNewContext:!0,to:(0,X.getTeamsDependencyURL)()},(0,N.gettext)("review the logs"))," ",(0,N.gettext)("after saving the change."))),i.get(0)),i},_renderSecurityGroupsDropdownControl:function _renderSecurityGroupsDropdownControl(){(0,Z.safeRemoveView)(this,this.securityGroupsDropdown),this.securityGroupsDropdown=new ne.default({help:x.default.createElement(j.default,{"data-test-itsi":"service-teams-help-link",openInNewContext:!0,onClick:this.securityGroupDetails.bind(this)},(0,N.gettext)("View Details")),isReadOnly:this.isReadOnly,retainSecurityGroup:!0,securableObjectModel:this.serviceModelClone}),(0,_.default)(".security-group-dropdown-control",this.$el).html(this.securityGroupsDropdown.render().$el),this.isReadOnly||(0,_.default)(".security-group-dropdown-control",this.$el).append(this._createTeamsDependencyWarning())},_renderServiceTagsControl:function _renderServiceTagsControl(i){pe=this.isBaseServiceTemplate?this.serviceModelClone.get("template_tags")||[]:this.serviceModelClone.get("service_tags")||{};var s=(0,$.extractExistingTags)(i),o=(0,_.default)("<div></div>").css({display:"inline-block","vertical-align":"middle"});R.default.unmountComponentAtNode(o.get(0)),R.default.render(x.default.createElement(ae.default,null,x.default.createElement(ce.default,{allServiceTags:s,existingTags:pe,isReadOnly:this.isReadOnly,updateTags:this.updateTags})),o.get(0)),this.$(".service-tags-input-control").append(o)},_renderEnableDisableControl:function _renderEnableDisableControl(){var i=1===this.serviceModelClone.get("enabled"),s=(0,_.default)("<div></div>").css({display:"inline-block"});R.default.unmountComponentAtNode(s.get(0)),R.default.render(x.default.createElement(ae.default,null,x.default.createElement(V.default,{"data-test-itsi":"service-status-control-group",label:(0,N.gettext)("Status")},x.default.createElement(le.default,{dataTestItsi:"service-status-control-switch",enabled:i,showEnableDisableLabel:!0,onChange:this.onEnableDisable.bind(this),size:"medium",isReadOnly:this.isReadOnly}))),s.get(0)),this.$(".service-enable-disable-control").append(s)},_renderHealthScoreBackfillControl:function _renderHealthScoreBackfillControl(){var i=(0,_.default)("<div></div>").css({display:"table"});R.default.unmountComponentAtNode(i.get(0)),R.default.render(x.default.createElement(ae.default,null,x.default.createElement(oe.default,{kpiModel:this.healthScoreKPI,isReadOnly:this.isReadOnly,setBackfillEnabled:this.setBackfillEnabledStatus,setBackfillNeededStatus:this.setBackfillNeededStatus,setEarliestTime:this.setBackfillEarliestTime})),i.get(0)),this.$(".service-health-score-backfill-control").append(i)},_renderHealthScoreCalculateByEntityControl:function _renderHealthScoreCalculateByEntityControl(){var i=(0,_.default)("<div></div>").css({display:"table"});R.default.unmountComponentAtNode(i.get(0)),R.default.render(x.default.createElement(ae.default,null,x.default.createElement(de.default,{serviceModel:this.serviceModelClone,serviceTemplate:this.serviceTemplate?this.serviceTemplate:null,sdDispatcher:this.sdDispatcher?this.sdDispatcher:null,isReadOnly:this.isReadOnly,setCalculateByEntityEnabled:this.setCalculateByEntityEnabledStatus})),i.get(0)),this.$(".service-health-score-calculate-by-entity-control").html(i)},_fetchHealthScoreKPI:function _fetchHealthScoreKPI(){var i=this.serviceModelClone.get("kpis"),s=(0,$.getServiceHealthKpiId)(this.serviceModelClone.get("_key"));return i.get(s)},_setBackfillNeededStatus:function _setBackfillNeededStatus(i){this.healthScoreKPI._checkSummarizedDataCache.backfillNeeded=i},_setBackfillEarliestTime:function _setBackfillEarliestTime(i){this.healthScoreKPI.set({backfill_earliest_time:i})},_setBackfillEnabledStatus:function _setBackfillEnabledStatus(i){this.healthScoreKPI.set({backfill_enabled:i})},_setCalculateByEntityEnabledStatus:function _setCalculateByEntityEnabledStatus(i){this.serviceModelClone.set({is_healthscore_calculate_by_entity_enabled:i})},_updateTags:function _updateTags(i,s){var o,h;i&&(o=(0,P.default)(i,i=>i.toLocaleLowerCase())),s&&(h=(0,P.default)(s,i=>i.toLocaleLowerCase())),this.isBaseServiceTemplate?this.serviceModelClone.set({template_tags:o}):this.serviceModelClone.set({service_tags:{tags:o,template_tags:h}})},onEnableDisable:function onEnableDisable(i){var s=i?1:0;this.serviceModelClone.set({enabled:s})},refreshModel:function refreshModel(){this.render()}});s.default=fe,i.exports=s.default},2999:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_,S,T=h(o(9)),x=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),R=h(o(2)),P=h(o(15)),L=h(o(3)),N=h(o(33)),V=h(o(152)),j=h(o(104)),W=h(o(148)),K=o(5),U=o(16),Y=h(o(789)),$=h(o(809)),X=h(o(1608)),Z=o(135),ee=o(25),te=o(161);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}var ie=[{dataTestItsi:"service-health-table-kpi-title-column-header",label:(0,K.gettext)("KPI Title")},{dataTestItsi:"service-health-table-simulated-severity-column-header",label:(0,K.gettext)("Simulated Severity")},{dataTestItsi:"service-health-table-importance-column-header",label:(0,K.gettext)("Importance")}],ae=[{dataTestItsi:"service-health-table-dependent-kpi-title-column-header",label:(0,K.gettext)("KPI Title")},{dataTestItsi:"service-health-table-dependent-service-title-column-header",label:(0,K.gettext)("Service")},{dataTestItsi:"service-health-table-dependent-simulated-severity-column-header",label:(0,K.gettext)("Simulated Severity")},{dataTestItsi:"service-health-table-dependent-importance-column-header",label:(0,K.gettext)("Importance")}],ne=[{dataTestItsi:"service-health-table-kpi-title-cell",stringValueDataTestItsi:"service-health-table-kpi-title",stringValueTooltipDataTestItsi:"service-health-table-kpi-title-tooltip"},{dataTestItsi:"service-health-table-simulated-severity-title-cell",stringValueDataTestItsi:"service-health-table-simulated-severity-title",stringValueTooltipDataTestItsi:"service-health-table-simulated-severity-title-tooltip"},{dataTestItsi:"service-health-table-importance-cell",stringValueDataTestItsi:"service-health-table-importance",stringValueTooltipDataTestItsi:"service-health-table-importance-tooltip"}],re=[{dataTestItsi:"service-health-table-dependent-kpi-title-cell",stringValueDataTestItsi:"service-health-table-dependent-kpi-title",stringValueTooltipDataTestItsi:"service-health-table-dependent-kpi-title-tooltip"},{dataTestItsi:"service-health-table-dependent-service-title-cell",stringValueDataTestItsi:"service-health-table-dependent-service-title",stringValueTooltipDataTestItsi:"service-health-table-dependent-service-title-tooltip"},{dataTestItsi:"service-health-table-dependent-simulated-severity-title-cell",stringValueDataTestItsi:"service-health-table-dependent-simulated-severity-title",stringValueTooltipDataTestItsi:"service-health-table-dependent-simulated-severity-title-tooltip"},{dataTestItsi:"service-health-table-dependent-importance-cell",stringValueDataTestItsi:"service-health-table-dependent-importance-cell",stringValueTooltipDataTestItsi:"service-health-table-dependent-importance-cell-tooltip"}],se=(0,L.default)(j.default.Cell)(v||(v=(0,T.default)(["\n width: 400px;\n"]))),le=(0,L.default)(j.default.Cell)(y||(y=(0,T.default)(["\n width: 160px;\n"]))),oe=L.default.div(_||(_=(0,T.default)(["\n display: flex;\n margin-bottom: 10px;\n"]))),de=L.default.div(S||(S=(0,T.default)(["\n flex-grow: 1;\n"]))),ce=te.COUNTS_PER_PAGE_MODAL[0],ImportanceTable=i=>{var{isDependentKPIs:s,isReadOnly:o,kpiCollection:h}=i,v=h.length,[y,_]=(0,x.useState)(1),S=s?ae:ie,T=s?re:ne,R=s?"service-health-dependent-kpis-importance-table":"service-health-kpis-importance-table",P=s?"service-health-dependent-kpis-importance-paginator":"service-health-kpis-importance-paginator";if(!v){var L=s?(0,K.gettext)("The service doesn't have any dependent KPIs."):(0,K.gettext)("No KPIs found in the service."),te=s?"service-health-dependent-no-kpis-message":"service-health-no-kpis-message";return x.default.createElement(N.default,{"data-test-itsi":te,type:"info"},L)}var he=y*ce-ce,ue=y*ce,pe=Math.ceil(v/ce);return x.default.createElement(x.default.Fragment,null,x.default.createElement(oe,null,x.default.createElement("div",{"data-test-itsi":"".concat(R,"-count")},(0,U.sprintf)((0,ee.ungettext)("%d KPI","%d KPIs",v),v)),x.default.createElement(de,null),pe>1&&x.default.createElement(V.default,{current:y,"data-test-itsi":P,onChange:(i,s)=>{var{page:o}=s;_(o)},totalPages:pe})),x.default.createElement(j.default,{"data-test-itsi":R,stripeRows:!0},x.default.createElement(j.default.Head,null,S.map(i=>x.default.createElement(j.default.HeadCell,{"data-test-itsi":i.dataTestItsi,key:i.dataTestItsi},i.label))),x.default.createElement(j.default.Body,null,h.filter((i,s)=>he<=s&&s<ue).map((i,h)=>{var v=parseInt(i.get("urgency"),10);return x.default.createElement(j.default.Row,{"data-test-itsi":"".concat(R,"-row"),key:"".concat(i.get("_key"),"-").concat(h)},s?x.default.createElement(x.default.Fragment,null,x.default.createElement(j.default.Cell,{"data-test-itsi":T[0].dataTestItsi,key:"".concat(T[0].dataTestItsi,"-").concat(i.get("kpiTitle"),"-").concat(i.get("serviceTitle"),"-kpi-title")},x.default.createElement(Y.default,{dataTestItsi:T[0].stringValueDataTestItsi,maxWidth:350,tooltipDataTestItsi:T[0].stringValueTooltipDataTestItsi,value:i.get("kpiTitle")})),x.default.createElement(j.default.Cell,{"data-test-itsi":T[1].dataTestItsi,key:"".concat(T[1].dataTestItsi,"-").concat(i.get("kpiTitle"),"-").concat(i.get("serviceTitle"),"-service-title")},x.default.createElement(Y.default,{dataTestItsi:T[1].stringValueDataTestItsi,maxWidth:350,tooltipDataTestItsi:T[1].stringValueTooltipDataTestItsi,value:i.get("serviceTitle")})),x.default.createElement(le,{"data-test-itsi":T[2].dataTestItsi,key:"".concat(T[2].dataTestItsi,"-").concat(i.get("kpiTitle"),"-").concat(i.get("serviceTitle"),"-severity")},x.default.createElement($.default,{dataTestItsi:"dependent-kpi-severity-select",options:(0,Z.getImportanceValues)(),updateValueInParent:s=>{i.set("kpi_severity",s)},value:i.get("kpi_severity"),valueType:"string"})),x.default.createElement(se,{"data-test-itsi":T[3].dataTestItsi,key:"".concat(T[3].dataTestItsi,"-").concat(i.get("kpiTitle"),"-").concat(i.get("serviceTitle"),"-urgency")},o?x.default.createElement(W.default,{"data-test-itsi":"health-score-dependent-importance-static-content"},v):x.default.createElement(X.default,{dataTestItsi:"health-score-dependent-importance-slider",disabled:o,initialValue:v,max:11,min:0,onChange:s=>{i.set("urgency",s)},step:1}))):x.default.createElement(x.default.Fragment,null,x.default.createElement(j.default.Cell,{"data-test-itsi":T[0].dataTestItsi,key:"".concat(T[0].dataTestItsi,"-").concat(i.get("title"),"-kpi-title")},x.default.createElement(Y.default,{dataTestItsi:T[0].stringValueDataTestItsi,maxWidth:700,tooltipDataTestItsi:T[0].stringValueTooltipDataTestItsi,value:i.get("title")})),x.default.createElement(le,{"data-test-itsi":T[1].dataTestItsi,key:"".concat(T[1].dataTestItsi,"-").concat(i.get("title"),"-health-score")},x.default.createElement($.default,{dataTestItsi:"direct-kpi-severity-select",options:(0,Z.getImportanceValues)(),updateValueInParent:s=>{i.set("kpi_severity",s)},value:i.get("kpi_severity"),valueType:"string"})),x.default.createElement(se,{"data-test-itsi":T[2].dataTestItsi,key:"".concat(T[2].dataTestItsi,"-").concat(i.get("title"),"-urgency")},o?x.default.createElement(W.default,{"data-test-itsi":"health-score-direct-importance-static-content"},v):x.default.createElement(X.default,{dataTestItsi:"health-score-direct-importance-slider",disabled:o,initialValue:v,max:11,min:0,onChange:s=>{i.set("urgency",s)},step:1}))))}))))};ImportanceTable.propTypes={isDependentKPIs:R.default.bool,isReadOnly:R.default.bool,kpiCollection:R.default.instanceOf(P.default.Collection).isRequired},ImportanceTable.defaultProps={isDependentKPIs:!0,isReadOnly:!1};var he=ImportanceTable;s.default=he,i.exports=s.default},3e3:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(15)),y=o(49),_=h(o(97)),S=o(5),T=o(100),x=o(111),R=o(1985),P=h(o(2806)),L=h(o(3001));o(3002);var N=(0,y.template)(L.default,null,{variable:"vars"}),V=v.default.View.extend({initialize:function initialize(i){this.serviceModel=i.serviceModel,this.collection=i&&i.collection,this.kpiToStatus=i&&i.kpiToStatus||{},this.dependentKpiCollection=i&&i.dependentKpiCollection,this.severityLabels=i.severityLabels,this.totalKpis=0,this.totalTriggers=0,this.healthModel=new v.default.Model,this.listenTo(this.collection,"add remove reset change",this.getDataAndShow),this.listenTo(this.collection,"change:urgency",function(i){i.gatherSearchClause({service:this.serviceModel})}.bind(this))},updateKpiToStatus:function updateKpiToStatus(i){this.kpiToStatus=i},getDataAndShow:(0,_.default)((function(){this.render()}),T.DEFAULT_DEBOUNCE_DELAY),getHealthData:function getHealthData(){var i=[],s=!1;if(this.collection.each(function(o){this.kpiToStatus[o.id]?i.push({urgency:o.get("urgency"),severity_name:this.kpiToStatus[o.id]}):s=!0}.bind(this)),this.dependentKpiCollection.each(function(o){this.kpiToStatus[o.id]?i.push({urgency:o.get("urgency"),severity_name:this.kpiToStatus[o.id]}):s=!0}.bind(this)),0===i.length)return s&&(this.healthModel.set({health_score:"N/A",health_severity_name:"unknown",health_severity_color:(0,x.getSeverityColor)(-1)}),this.trigger("set-tile-not-loading")),Promise.resolve();var o={severity_urgency_list:JSON.stringify(i)};return this.failedHealthScoreCalculation=!1,(0,R.retrieveHealthScore)(o).then(i=>i.data).then(i=>{this.healthModel.set(i.data),this.trigger("set-tile-not-loading")}).catch(()=>{this.failedHealthScoreCalculation=!0})},render:function render(){return this.$el.html('<div class="service-health-loading-text">'+(0,S.gettext)("Calculating health score...")+"</div>"),this.getHealthData().then(()=>{if(this.failedHealthScoreCalculation)this.$el.text((0,S.gettext)("Could not calculate health score."));else{this.$el.html(N({gettext:S.gettext,totalKpis:this.totalKpis||0,totalTriggers:this.totalTriggers||0,healthScore:this.healthModel.get("health_score")},{variables:"vars"}));var i=new P.default({model:this.healthModel,modelStatusAttribute:"health_severity_name",modelColorAttribute:"health_severity_color",severityLabels:this.severityLabels});this.$(".overview-latest-status").append(i.render().el)}}).catch(()=>{this.$el.text((0,S.gettext)("Could not calculate health score."))}),this}});s.default=V,i.exports=s.default},3001:function(i,s){i.exports='<% if (vars.healthScore !== undefined && vars.healthScore !== null && vars.healthScore !== "") { %>\n\t<div class="overall-trigger-health-container" data-test-itsi="overall-trigger-health-container">\n\t\t<div class="overview-health-score pull-left inline-group">\n\t\t\t<div class="overview-health-score-text" data-test-itsi="overview-health-score-text"><%- vars.gettext("Composite Score") %>:</div>\n\t\t\t<div class="overview-health-score-value" data-test-itsi="overview-health-score-value"><%= vars.healthScore %></div>\n\t\t</div>\n\t\t<div class="overview-latest-status"></div>\n\t</div>\n\t<span class="help-block overall-trigger-health-help-block">\n\t\t<%- vars.gettext("Range: Critical 0-20, High 20-40, Medium 40-60, Low 60-80, Normal 80-100") %>\n\t</span>\n<% } %>'},3002:function(i,s,o){var h=o(3003);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},3003:function(i,s,o){(s=o(37)(!1)).push([i.i,".service-health-overview {\n\theight: 32px;\n\tmargin-bottom: 10px;\n\tmargin-left: 20px;\n}\n\n.service-health-loading-text {\n\tfont-size: large;\n}\n\n.overview-health-score-value {\n\tpadding-right: 15px;\n\tdisplay: inline;\n}\n\n.overview-health-score-text {\n\tpadding-right: 5px;\n\tdisplay: inline;\n}\n\n.overall-trigger-health-container {\n\theight: 16px;\n\tfont-size: large;\n}\n\n.overall-trigger-count-container {\n\theight: 40px;\n\tfont-size: large;\n}\n\n.service-health-table-title {\n\tfont-size: 16px;\n}\n\n.first-service-health-table,\n.second-service-health-table {\n\tmargin-top: 20px;\n}\n.second-service-health-table {\n\tline-height: 46px; /* Matches the height of first-service-health-table with/without its Tooltip */\n}\n\n",""]),i.exports=s},3004:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(18)),y=h(o(17)),_=h(o(30)),S=h(o(21)),T=h(o(22)),x=h(o(20)),R=h(o(11)),P=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),L=h(o(2)),N=o(5),V=o(16),j=o(409),W=h(o(33)),K=h(o(86)),U=o(185),Y=o(25),$=o(77),X=h(o(1640)),Z=h(o(1641)),ee=h(o(689));function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,x.default)(i);if(s){var v=(0,x.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,T.default)(this,o)}}o(29);var te={CHECK:U.BACKFILL_STATUSES.WAITING,UNAVAILABLE:U.BACKFILL_STATUSES.NOT_AVAILABLE,CONFIGURED:(0,N.gettext)("Backfill has been configured for %(timeLabel)s of data.")},ie=0,ae=1,ne=2,re=3,se=4,le=(0,N.gettext)("It is advised that you first backfill the KPIs in this service and all dependent services for at least the time range selected here."),oe=(0,N.gettext)("Enabling backfill for a KPI does not mean backfill has completed. Wait for a successful backfill completion message for all KPIs before backfilling the service health score."),de=(0,N.gettext)("Please choose a date that is earlier than the current date."),ce=function(i){(0,S.default)(HealthScoreBackfillControlView,i);var s=_createSuper(HealthScoreBackfillControlView);function HealthScoreBackfillControlView(i){var o;(0,y.default)(this,HealthScoreBackfillControlView);for(var h=arguments.length,v=new Array(h>1?h-1:0),S=1;S<h;S++)v[S-1]=arguments[S];return o=s.call(this,i,...v),(0,R.default)((0,_.default)(o),"componentDidMount",()=>{o.checkBackfillProgress()}),(0,R.default)((0,_.default)(o),"checkBackfillProgress",()=>{ee.default.fetchKpiBackfillRequests(o.props.kpiModel.get("_key")).done(i=>{if(i&&i[0]&&i[0].status)o.renderBackfillStatus(i[0].status),o.setState({renderStatus:ae});else if(!i)if(o.props.kpiModel.get("backfill_enabled")){var s=(0,j.createRangeLabel)(o.state.backfillEarliest,"now").toLowerCase();o.setState({renderStatus:re,backfillStatus:(0,V.sprintf)(te.CONFIGURED,{timeLabel:s})})}else o.setState({renderStatus:ne})})}),(0,R.default)((0,_.default)(o),"checkIfBackfillPeriodIsValid",i=>{var s=parseInt(o.earliestTimeonKPI,10),h=(new Date).getTime()/1e3-(0,$.relativeToSeconds)(i),v=!1;return(isNaN(s)||h<s)&&(v=!0),o.props.setBackfillNeededStatus(v),v}),(0,R.default)((0,_.default)(o),"getEarliestTimeAndCheckBackfillNeeded",()=>{o.setState({isBackfillEarliestInProgress:!0}),o.props.kpiModel.getSummaryIndexEarliest().done(i=>{o.earliestTimeonKPI=i;var s=o.props.kpiModel.get("backfill_earliest_time");if(o.checkIfBackfillPeriodIsValid(s)||s===U.BACKFILL_TIME_PERIOD_EARLIEST_INVALID_TIME)o.props.setBackfillNeededStatus(!0),o.setState({renderStatus:ne,isBackfillEarliestInProgress:!1});else{o.props.setBackfillNeededStatus(!1);var h=s.slice(1,s.length-1);o.setState({renderStatus:ie,backfillStatus:te.UNAVAILABLE,isBackfillEarliestInProgress:!1,backfillNotNeededMessage:(0,V.sprintf)((0,N.gettext)("You already have %s day(s) of data in the summary index. Select a larger time range."),h)})}}).fail((i,s)=>{o.setState({renderStatus:se,backfillStatus:s})})}),(0,R.default)((0,_.default)(o),"onEnableDisableBackfill",i=>{i&&o.getEarliestTimeAndCheckBackfillNeeded(),o.props.setBackfillEnabled(i),o.setState({backfillEnabled:i,renderStatus:ne})}),(0,R.default)((0,_.default)(o),"setInputValidity",i=>{o.setState({inputIsValid:i})}),(0,R.default)((0,_.default)(o),"onTimePickerSelection",i=>{o.props.setEarliestTime(i);var s=o.checkIfBackfillPeriodIsValid(i),h=i.slice(1,i.length-1);s||i===U.BACKFILL_TIME_PERIOD_EARLIEST_INVALID_TIME?o.setState({renderStatus:ne,isBackfillEarliestInProgress:!1,backfillEarliest:i}):o.setState({renderStatus:ie,backfillStatus:te.UNAVAILABLE,isBackfillEarliestInProgress:!1,backfillNotNeededMessage:(0,V.sprintf)((0,N.gettext)("You already have %s day(s) of data in the summary index. Select a larger time range."),h),backfillEarliest:i})}),(0,R.default)((0,_.default)(o),"renderBackfillState",()=>P.default.createElement(Z.default,{backfillEnabled:o.state.backfillEnabled,backfillEarliest:o.state.backfillEarliest,onTimePickerSelection:o.onTimePickerSelection,setInputValidity:o.setInputValidity})),(0,R.default)((0,_.default)(o),"renderBackfillStatus",i=>{var s=o.state.backfillEarliest||o.props.kpiModel.get("backfill_earliest_time"),h=ee.default.renderBackfillStatus(i,s);o.setState({backfillStatus:h})}),(0,R.default)((0,_.default)(o),"getWaitingMessage",()=>P.default.createElement("div",{style:{padding:"6px 140px"}},P.default.createElement(K.default,{"data-test-itsi":"backfill-status-wait-spinner",style:{verticalAlign:"middle",marginRight:"5px"}})," ",(0,N.gettext)("Determining backfill status..."))),(0,R.default)((0,_.default)(o),"render",()=>{var i=o.getWaitingMessage();return P.default.createElement(P.Fragment,null,P.default.createElement("div",null,(o.state.renderStatus===ne||o.state.renderStatus===ie)&&P.default.createElement(P.Fragment,null,P.default.createElement("div",null,P.default.createElement(X.default,{enabled:o.state.backfillEnabled,onChange:o.onEnableDisableBackfill,size:"medium",isReadOnly:o.props.isReadOnly})),o.renderBackfillState()),o.state.renderStatus!==ne&&o.state.renderStatus!==ie&&P.default.createElement("div",{"data-test-itsi":"service-backfill-status-message"},o.state.backfillStatus)),o.state.renderStatus===ie&&o.state.backfillNotNeededMessage&&P.default.createElement(W.default,{"data-test-itsi":"backfill-not-needed-error-message",type:"error",style:{marginLeft:140}},o.state.backfillNotNeededMessage),o.state.isBackfillEarliestInProgress&&i,!o.state.inputIsValid&&P.default.createElement(W.default,{"data-test-itsi":"backfill-validation-error-message",type:"error",style:{marginLeft:"57px"}},de),o.state.backfillEnabled&&(o.state.renderStatus===ne||o.state.renderStatus===ie)&&P.default.createElement(W.default,{"data-test-itsi":"backfill-warning-message",type:"warning",style:{marginLeft:140}},P.default.createElement("div",null,le,P.default.createElement("br",null),oe)))}),o.state={backfillEnabled:(0,Y.normalizeBoolean)(o.props.kpiModel.get("backfill_enabled")),backfillStatus:te.CHECK,renderStatus:ie,backfillEarliest:o.props.kpiModel.get("backfill_earliest_time"),inputIsValid:!0,isBackfillEarliestInProgress:!1,backfillNotNeededMessage:""},o}return(0,v.default)(HealthScoreBackfillControlView)}(P.Component);(0,R.default)(ce,"propTypes",{kpiModel:L.default.object.isRequired,setBackfillEnabled:L.default.func.isRequired,setBackfillNeededStatus:L.default.func.isRequired,setEarliestTime:L.default.func.isRequired,isReadOnly:L.default.bool}),(0,R.default)(ce,"defaultProps",{isReadOnly:!1});var he=ce;s.default=he,i.exports=s.default},3005:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(66)),y=h(o(17)),_=h(o(18)),S=h(o(30)),T=h(o(21)),x=h(o(22)),R=h(o(20)),P=h(o(11)),L=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),N=h(o(2)),V=h(o(70)),j=h(o(105)),W=h(o(53)),K=h(o(47)),U=h(o(110)),Y=h(o(473)),$=h(o(82)),X=o(125),Z=o(409),ee=o(5),te=o(185),ie=o(93);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,R.default)(i);if(s){var v=(0,R.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,x.default)(this,o)}}o(29);var ae=function(i){(0,T.default)(BackfillTimePicker,i);var s=_createSuper(BackfillTimePicker);function BackfillTimePicker(i){var o;(0,y.default)(this,BackfillTimePicker);for(var h=arguments.length,v=new Array(h>1?h-1:0),_=1;_<h;_++)v[_-1]=arguments[_];return o=s.call(this,i,...v),(0,P.default)((0,S.default)(o),"componentDidMount",()=>{if(o.props.currentSetBackfillPeriod&&o.props.backfillEnabled){var i=(0,V.default)(te.BACKFILL_TIME_PERIOD_SELECT_LIST,i=>i.value===o.props.currentSetBackfillPeriod);if((0,j.default)(i)){var s,h,v=o.convertRangeToDate(o.props.currentSetBackfillPeriod);o.props.currentSetBackfillPeriod===te.BACKFILL_TIME_PERIOD_EARLIEST_INVALID_TIME?(s=te.BACKFILL_TIME_PERIOD_EARLIEST_INVALID_TIME,h=!1):(s=(0,Z.createRangeLabel)(o.props.currentSetBackfillPeriod,"now").toLowerCase(),h=!0),o.setState({datePickerVisible:!0,datePickerSelection:v,selectedTimeRange:o.props.currentSetBackfillPeriod,customSelectedLabel:s,inputIsValid:h})}else o.setState({selectedTimeRange:o.props.currentSetBackfillPeriod})}}),(0,P.default)((0,S.default)(o),"convertRangeToDate",i=>{var s=i.slice(1,i.length-1);return U.default.newSplunkTime().subtract(parseInt(s),"day").format("YYYY-MM-DD").toString()}),(0,P.default)((0,S.default)(o),"convertDateToTimeRange",i=>{var s=U.default.newSplunkTime();return U.default.newSplunkTime({time:i,format:"YYYY-MM-DD"}).diff(s,"days")+"d"}),(0,P.default)((0,S.default)(o),"setTimeSelection",(i,s)=>{var{value:h}=s,v=h;if("custom"===h){v=o.convertDateToTimeRange(o.defaultCustomDateSelected);var y=(0,Z.createRangeLabel)(v,"now").toLowerCase();o.setState({customSelectedLabel:y,datePickerVisible:!0,selectedTimeRange:v,inputIsValid:!0,datePickerSelection:o.defaultCustomDateSelected})}else o.setState({selectedTimeRange:h,datePickerVisible:!1,inputIsValid:!0,datePickerSelection:o.defaultCustomDateSelected});o.props.setInputValidity(!0),o.props.onTimePickerSelection(v)}),(0,P.default)((0,S.default)(o),"handleCustomTimeSelection",(i,s)=>{var{value:h}=s,v=U.default.newSplunkTime(),y=U.default.newSplunkTime({time:h,format:"YYYY-MM-DD"}).isBefore(v,"day");if(y){var _=o.convertDateToTimeRange(h);o.props.onTimePickerSelection(_);var S=(0,Z.createRangeLabel)(_,"now").toLowerCase();o.setState({datePickerSelection:h,selectedTimeRange:_,customSelectedLabel:S,inputIsValid:y})}else o.props.onTimePickerSelection(te.BACKFILL_TIME_PERIOD_EARLIEST_INVALID_TIME),o.setState({selectedTimeRange:"",datePickerSelection:h,inputIsValid:y,customSelectedLabel:(0,ee.gettext)("invalid time range")});o.props.setInputValidity(y)}),(0,P.default)((0,S.default)(o),"renderBackfillSelection",()=>L.default.createElement($.default,{"data-test-itsi":"backfill-time-select",inline:!0,value:o.state.selectedTimeRange,placeholder:o.state.customSelectedLabel,onChange:o.setTimeSelection},(0,W.default)(te.BACKFILL_TIME_PERIOD_SELECT_LIST,i=>L.default.createElement($.default.Option,{"data-test-itsi":"backfill-time-select-option",key:i.value,label:i.label,value:i.value})))),(0,P.default)((0,S.default)(o),"renderDatePicker",()=>L.default.createElement(Y.default,{"data-test-itsi":"backfill-time-picker-date-control",locale:X.locale,value:o.state.datePickerSelection,onChange:o.handleCustomTimeSelection,error:!o.state.inputIsValid})),o.defaultCustomTimeRange="-1d",o.defaultCustomDateSelected=o.convertRangeToDate(o.defaultCustomTimeRange),o.state={selectedTimeRange:te.BACKFILL_TIME_PERIOD_SELECT_LIST[0].value,datePickerVisible:!1,customSelectedLabel:(0,ee.gettext)("Custom backfill date"),datePickerSelection:o.defaultCustomDateSelected,inputIsValid:!0},o}return(0,_.default)(BackfillTimePicker,[{key:"render",value:function render(){return L.default.createElement("div",(0,v.default)({style:{display:"inline-block",verticalAlign:"middle"}},(0,ie.createITSITestHook)(this.constructor.name)),this.renderBackfillSelection(),this.state.datePickerVisible&&this.renderDatePicker())}}]),BackfillTimePicker}(L.Component);(0,P.default)(ae,"propTypes",{onTimePickerSelection:N.default.func.isRequired,backfillEnabled:N.default.bool,currentSetBackfillPeriod:N.default.string,setInputValidity:N.default.func}),(0,P.default)(ae,"defaultProps",{backfillEnabled:!1,currentSetBackfillPeriod:"-7d",setInputValidity:K.default});var ne=ae;s.default=ne,i.exports=s.default},3006:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(18)),y=h(o(17)),_=h(o(30)),S=h(o(21)),T=h(o(22)),x=h(o(20)),R=h(o(11)),P=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),L=h(o(2)),N=h(o(47)),V=o(25),j=h(o(3007));function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,x.default)(i);if(s){var v=(0,x.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,T.default)(this,o)}}o(29);var W=function(i){(0,S.default)(HealthScoreCalculateByEntityControlView,i);var s=_createSuper(HealthScoreCalculateByEntityControlView);function HealthScoreCalculateByEntityControlView(i){var o;(0,y.default)(this,HealthScoreCalculateByEntityControlView);for(var h=arguments.length,v=new Array(h>1?h-1:0),S=1;S<h;S++)v[S-1]=arguments[S];return o=s.call(this,i,...v),(0,R.default)((0,_.default)(o),"componentDidMount",()=>{o.props.isReadOnly?o.resetState():o.checkIfAtleastOneKPIHasSplitByEntity()}),(0,R.default)((0,_.default)(o),"resetState",()=>{var i=o.props.isReadOnly;o.setState({isReadOnly:i})}),(0,R.default)((0,_.default)(o),"checkIfAtleastOneKPIHasSplitByEntity",()=>{var i=o.props.serviceModel.get("kpis").some((function(i){return i.get("is_entity_breakdown")}));o.setState({isReadOnly:!i})}),(0,R.default)((0,_.default)(o),"onEnableDisableCalculateByEntity",i=>{o.props.setCalculateByEntityEnabled(i),o.setState({calculateByEntityEnabled:i})}),(0,R.default)((0,_.default)(o),"setInputValidity",i=>{o.setState({inputIsValid:i})}),(0,R.default)((0,_.default)(o),"render",()=>P.default.createElement(P.Fragment,null,P.default.createElement("div",null,P.default.createElement(P.Fragment,null,P.default.createElement("div",{style:{display:"table-cell",verticalAlign:"middle"}},P.default.createElement(j.default,{serviceModel:o.props.serviceModel,serviceTemplate:o.props.serviceTemplate?o.props.serviceTemplate:null,sdDispatcher:o.props.sdDispatcher?o.props.sdDispatcher:null,enabled:o.state.calculateByEntityEnabled,onChange:o.onEnableDisableCalculateByEntity,size:"medium",isReadOnly:o.state.isReadOnly})))))),o.state={calculateByEntityEnabled:(0,V.normalizeBoolean)(o.props.serviceModel.get("is_healthscore_calculate_by_entity_enabled"))},o}return(0,v.default)(HealthScoreCalculateByEntityControlView)}(P.Component);(0,R.default)(W,"propTypes",{serviceModel:L.default.object.isRequired,serviceTemplate:L.default.object,sdDispatcher:L.default.object,setCalculateByEntityEnabled:L.default.func,isReadOnly:L.default.bool}),(0,R.default)(W,"defaultProps",{serviceTemplate:null,sdDispatcher:null,setCalculateByEntityEnabled:N.default,isReadOnly:!1});var K=W;s.default=K,i.exports=s.default},3007:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_,S,T=h(o(18)),x=h(o(17)),R=h(o(30)),P=h(o(21)),L=h(o(22)),N=h(o(20)),V=h(o(11)),j=h(o(9)),W=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),K=h(o(2)),U=h(o(3)),Y=h(o(56)),$=h(o(43)),X=h(o(862)),Z=h(o(132)),ee=h(o(99)),te=o(5),ie=o(16),ae=o(25),ne=o(76),re=h(o(895));function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,N.default)(i);if(s){var v=(0,N.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,L.default)(this,o)}}o(29);var se=(0,U.default)(Z.default)(v||(v=(0,j.default)(["\n padding: 0;\n\tdisplay: inline-block;\n\tvertical-align: bottom;\n"]))),le=(0,U.default)(ee.default)(y||(y=(0,j.default)(["\n\tpadding-left: 2px\n"]))),oe=(0,U.default)(X.default)(_||(_=(0,j.default)(["\n\tmargin: 2px;\n\tpadding-top: 6px;\n"]))),de=U.default.div(S||(S=(0,j.default)(["\n display: inline-block;\n\tmargin-left: 10px;\n\tmargin-top: 5px;\n"]))),ce=function(i){(0,P.default)(CalculateByEntityToggleControl,i);var s=_createSuper(CalculateByEntityToggleControl);function CalculateByEntityToggleControl(i){var o;(0,x.default)(this,CalculateByEntityToggleControl);for(var h=arguments.length,v=new Array(h>1?h-1:0),y=1;y<h;y++)v[y-1]=arguments[y];return o=s.call(this,i,...v),(0,V.default)((0,R.default)(o),"handleClick",(i,s)=>{var{serviceModel:h}=o.props;o.value=s,h.get("object_type")===ne.OBJECT_TYPE&&h.get("base_service_template_id")?o.setState({showUnlinkWarningModal:!0}):o.switchValueHandler()}),(0,V.default)((0,R.default)(o),"switchValueHandler",()=>{var i=!o.value.value;o.setState({isSelected:i}),o.props.onChange(i)}),(0,V.default)((0,R.default)(o),"_showUnlinkWarningModal",()=>{var{serviceModel:i,serviceTemplate:s}=o.props;if(o.state.showUnlinkWarningModal){var h=(0,te.gettext)("Update Include Entities");return W.default.createElement("div",{className:"unlink-warning-modal","data-test-itsi":"calculate-by-entity-toggle-control-container"},W.default.createElement(re.default,{modalTitleSubstring:h,serviceTitle:i.get("title"),serviceTemplateTitle:s.get("title"),serviceTemplateUrl:s.getEditUrl(),isModalOpen:!0,handleAcceptToUnlink:o.handleAcceptToUnlink.bind((0,R.default)(o)),handleDeclineToUnlink:o.handleDeclineToUnlink.bind((0,R.default)(o))}))}}),(0,V.default)((0,R.default)(o),"handleAcceptToUnlink",()=>{var{sdDispatcher:i}=o.props;i.trigger("unsetBaseServiceTemplateId",o.props.serviceModel),i.trigger("unlink"),o.switchValueHandler()}),(0,V.default)((0,R.default)(o),"handleDeclineToUnlink",()=>{o.setState({showUnlinkWarningModal:!1})}),(0,V.default)((0,R.default)(o),"render",()=>{var i=!!o.state.isSelected,s=o._showUnlinkWarningModal(),{isReadOnly:h,serviceModel:v,serviceTemplate:y,size:_,tooltipContent:S}=o.props;return W.default.createElement(Y.default,{"data-test-itsi":"calculate-by-entity-toggle-control-group",label:(0,te.gettext)("Include Entities"),tooltip:S},W.default.createElement(se,{"data-test-itsi":"calculate-by-entity-control-switch",value:i,appearance:"toggle",selected:i,onClick:o.handleClick,size:_,disabled:h},!h&&v.get("object_type")===ne.OBJECT_TYPE&&!!v.get("base_service_template_id")&&W.default.createElement(le,{content:(0,ie.sprintf)((0,te.gettext)("KPI linked to service template %(title)s."),{title:y.get("title","")}),"data-test-itsi":"calculate-by-entity-toggle-from-service-locked-tooltip"},W.default.createElement(oe,{"data-test-itsi":"calculate-by-entity-toggle-from-service-locked-icon"}))),W.default.createElement(de,null,W.default.createElement($.default,{"data-test-itsi":"kpi-importance-more-info-link",openInNewContext:!0,to:(0,ae.makeDocsURL)("app.itsi.kpi_importance")},(0,te.gettext)("More Info"))),s)}),o.state={isSelected:o.props.enabled,showUnlinkWarningModal:!1},o}return(0,T.default)(CalculateByEntityToggleControl)}(W.Component);(0,V.default)(ce,"propTypes",{serviceModel:K.default.object.isRequired,serviceTemplate:K.default.object,sdDispatcher:K.default.object,onChange:K.default.func.isRequired,enabled:K.default.bool,isReadOnly:K.default.bool,size:K.default.string,tooltipContent:K.default.string}),(0,V.default)(ce,"defaultProps",{serviceTemplate:null,sdDispatcher:null,enabled:!0,size:"small",isReadOnly:!1,tooltipContent:(0,te.gettext)("Service health score calculation accounts for the severity levels of individual entities if at least one KPI is split by entity")});var he=ce;s.default=he,i.exports=s.default},3008:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y=h(o(17)),_=h(o(18)),S=h(o(30)),T=h(o(21)),x=h(o(22)),R=h(o(20)),P=h(o(11)),L=h(o(9)),N=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),V=h(o(2)),j=h(o(3)),W=h(o(517)),K=h(o(42)),U=h(o(95)),Y=h(o(65)),$=h(o(88)),X=h(o(53)),Z=h(o(639)),ee=h(o(406)),te=h(o(871)),ie=h(o(172)),ae=h(o(736)),ne=h(o(367)),re=h(o(793)),se=h(o(1598)),le=h(o(56)),oe=h(o(238)),de=o(40),ce=o(16),he=o(5),ue=o(93),pe=o(3009);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,R.default)(i);if(s){var v=(0,R.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,x.default)(this,o)}}o(29);var fe=(0,he.gettext)("Tags with a lock icon come from a service template but can be removed. Tags are case insensitive and will not be added if an existing tag in a different case already exists. All tags will be converted to lower case upon save."),ge=(0,j.default)(se.default)(v||(v=(0,L.default)(["\n\tcolor: ",";\n"])),de.variables.warningColor),me=function(i){(0,T.default)(ServiceTagsControlView,i);var s=_createSuper(ServiceTagsControlView);function ServiceTagsControlView(i){var o;(0,y.default)(this,ServiceTagsControlView);for(var h=arguments.length,v=new Array(h>1?h-1:0),_=1;_<h;_++)v[_-1]=arguments[_];return o=s.call(this,i,...v),(0,P.default)((0,S.default)(o),"handleServiceTagChange",(i,s)=>{var{values:h}=s,{currentTagsNames:v,currentTagsService:y,currentTagsFromTemplate:_}=o.state,{updateTags:S}=o.props,T=(0,X.default)(v,i=>(0,ae.default)(i)),x=(0,U.default)(h,i=>!o.hasSpecialCharInInput(i)),R=(0,X.default)(x,i=>(0,ae.default)(i)),P=(0,re.default)(x,i=>(0,ae.default)(i)),L=(0,U.default)(T,i=>!R.includes(i)),N=(0,U.default)(P,i=>!T.includes((0,ae.default)(i)));(0,K.default)(L,i=>{y=(0,Z.default)(y,s=>(0,ae.default)(s)===(0,ae.default)(i)),_=(0,Z.default)(_,s=>(0,ae.default)(s)===(0,ae.default)(i))});var V=y.concat(N);S(V,_),o.setState({currentTagsNames:P,currentTagsService:V,currentTagsFromTemplate:_,tagsToRender:v}),o.handleFetch("",P)}),(0,P.default)((0,S.default)(o),"handleServiceTemplateTagChange",(i,s)=>{var{values:h}=s,{currentTagsNames:v,currentTemplateTags:y}=o.state,{updateTags:_}=o.props,S=(0,X.default)(v,i=>(0,ae.default)(i)),T=(0,U.default)(h,i=>!o.hasSpecialCharInInput(i)),x=(0,X.default)(T,i=>(0,ae.default)(i)),R=(0,re.default)(T,i=>(0,ae.default)(i)),P=(0,U.default)(S,i=>!x.includes(i)),L=(0,U.default)(R,i=>!S.includes((0,ae.default)(i)));(0,K.default)(P,i=>{y=(0,Z.default)(y,s=>(0,ae.default)(s)===(0,ae.default)(i))});var N=y.concat(L);_(N),o.setState({currentTagsNames:R,currentTemplateTags:N,tagsToRender:v}),o.handleFetch("",R)}),(0,P.default)((0,S.default)(o),"handleFetch",(i,s)=>{var{allServiceTags:h}=o.props,v=(0,X.default)(s,i=>(0,ae.default)(i)),y=(0,U.default)(h,i=>!(0,Y.default)(v,(0,ae.default)(i))).filter(s=>(0,Y.default)((0,ae.default)(s),(0,ae.default)(i))),_=(0,ee.default)(y),S=_>10?10:_;o.setState({count:S,fullCount:_,filteredTags:y})}),(0,P.default)((0,S.default)(o),"hasSpecialCharInInput",i=>new RegExp("[=\"'/\\\\!@$^*,.?;|]+|\\s+$").test(i)),(0,P.default)((0,S.default)(o),"handleFilterChange",(i,s)=>{var{keyword:h}=s,{currentTagsNames:v}=o.state,y=o.hasSpecialCharInInput(h);o.handleFetch(h,v),o.setState({keyword:h,inputContainsSpecialChar:y})}),(0,P.default)((0,S.default)(o),"renderMultiselectOptions",()=>{var{filteredTags:i}=o.state,s=(0,te.default)(i,0,10);return(0,ie.default)(s,i=>(0,ae.default)(i))}),(0,P.default)((0,S.default)(o),"renderFooter",()=>{var{count:i,fullCount:s,inputContainsSpecialChar:h}=o.state,v=null;return h?v=(0,he.gettext)("Tags cannot contain trailing spaces or the following characters:")+" "+pe.TAGS_RESTRICTED_CHARS:s>0&&(v=(0,ce.sprintf)((0,he.gettext)("Showing %(subtotal)d of %(total)d tags"),{subtotal:i,total:s})),v}),(0,P.default)((0,S.default)(o),"renderTag",i=>{var{currentTagsFromTemplate:s}=o.state,h=!o.isServiceTemplate&&s.includes(i);return i?N.default.createElement(oe.default.Option,{"data-test-itsi":"service-tags-multiselect-option",label:i,value:i,key:i,icon:h&&N.default.createElement(ge,{"data-test-itsi":"service-tags-icon-unlocked"})}):null}),o.state={count:0,currentTagsNames:[],currentTagsService:[],currentTagsFromTemplate:[],currentTemplateTags:[],filteredTags:[],fullCount:0,keyword:"",inputContainsSpecialChar:!1,tagsToRender:[]},o.isServiceTemplate=(0,$.default)(i.existingTags),o}return(0,_.default)(ServiceTagsControlView,[{key:"componentDidMount",value:function componentDidMount(){var i,s,o,h,{existingTags:v}=this.props;this.isServiceTemplate?(o=v,h=(0,ie.default)(v,i=>(0,ae.default)(i))):(i=v.tags||[],s=v.template_tags||[],h=(0,ie.default)((0,W.default)(i,s),i=>(0,ae.default)(i))),this.setState({currentTagsNames:h,currentTagsService:i,currentTagsFromTemplate:s,currentTemplateTags:o,tagsToRender:h}),this.handleFetch("",h)}},{key:"render",value:function render(){var{currentTagsNames:i,inputContainsSpecialChar:s,tagsToRender:o}=this.state,{isReadOnly:h}=this.props,v=this.renderMultiselectOptions(),y=(0,X.default)((0,ne.default)(o,v),i=>this.renderTag(i)),_=this.renderFooter();return N.default.createElement("div",(0,ue.createITSITestHook)(this.constructor.name),N.default.createElement(le.default,{"data-test-itsi":"service-tags-control-group",label:(0,he.gettext)("Tags"),tooltip:fe},N.default.createElement(oe.default,{allowNewValues:!0,controlledFilter:!0,inline:!0,"data-test-itsi":"service-tags-multiselect",disabled:h,defaultPlacement:"below",error:s,footerMessage:_,onChange:this.isServiceTemplate?this.handleServiceTemplateTagChange:this.handleServiceTagChange,onFilterChange:this.handleFilterChange,values:i},y)))}}]),ServiceTagsControlView}(N.Component);me.propTypes={allServiceTags:V.default.arrayOf(V.default.string),existingTags:V.default.oneOfType([V.default.array,V.default.object]).isRequired,isReadOnly:V.default.bool.isRequired,updateTags:V.default.func.isRequired},me.defaultProps={allServiceTags:[]};var ve=me;s.default=ve,i.exports=s.default},3009:function(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.TAGS_RESTRICTED_CHARS=void 0;s.TAGS_RESTRICTED_CHARS="\\ / | \" ' * ! @ ? . , ; $ ^"},3010:function(i,s){i.exports='<h3 class="settings-tab-title" data-test-itsi="general-settings-title"><%- vars.gettext("General") %></h3>\n<div class="service-enable-disable-control general-settings-control"></div>\n<div class="security-group-dropdown-control general-settings-control"></div>\n<div class="service-tags-input-control general-settings-control"></div>\n<div class="health-score-header">\n <h3 class="settings-tab-title" data-test-itsi="service-health-score-title"><%- vars.gettext("Service Health Score") %></h3>\n <% if (!vars.isBaseServiceTemplate) {%>\n <div class="service-health-score-backfill-control general-settings-control" data-test-itsi="service-health-score-backfill-control"></div>\n <% } %>\n <div class="service-health-score-calculate-by-entity-control general-settings-control"></div>\n</div>\n<div class="health-score-title-sub-section">\n <h3 class="settings-tab-title" data-test-itsi="health-score-calculation-title"><%- vars.gettext("Health Score Calculation") %></h3>\n <div class="health-score-title-description" data-test-itsi="health-score-title-description"></div>\n</div>\n<div class="health-score-content">\n <div class="kpi-severity-importance-table-container"></div>\n <div class="service-health-tile-container" data-test-itsi="service-health-tile-container">\n <div class="service-health-tile-header" data-test-itsi="service-health-tile-header"></div>\n <div class="service-health-tile"></div>\n </div>\n</div>'},3011:function(i,s,o){var h=o(3012);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},3012:function(i,s,o){(s=o(37)(!1)).push([i.i,'/* Main container of the section */\n.settings-content-view {\n\twidth: auto; /* Override fixed width of 600px */\n\tpadding: 20px;\n}\n/* Targets the custom help blocks of the page */\n.settings-content-view .overall-trigger-health-help-block {\n\tdisplay: inline-block;\n\tmargin-left: 10px;\n}\n/* Section titles */\n.settings-tab-title {\n\tmargin-bottom: 16px;\n}\n/* Fixes the width issues between control group widths */\n.general-settings-control div[data-test="control-group"] {\n\twidth: 540px;\n}\n.health-score-content {\n\tdisplay: flex;\n\twidth: 100%;\n}\n.service-health-tile-container {\n\twidth: 25%;\n\tmargin: 16px 0 0 40px;\n}\n.severity-tile-text-large {\n\tpadding-top: 24px;\n}\n.severity-tile-title {\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\twhite-space: nowrap;\n\tmax-width: 153px;\n}\n.service-health-overview { /* the overview view is not rendered in the Settings tab */\n\tdisplay: none;\n}\n.service-health-table-service-name {\n\tdisplay: inline-block;\n\tvertical-align: middle;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\twhite-space: nowrap;\n\tmax-width: 94%;\n}\n.kpi-severity-importance-table-container {\n\twidth: 75%;\n\tpadding-right: 20px;\n}\n.health-score-title-sub-section {\n\tmargin-top: 20px;\n}\n.health-score-header {\n\tmargin-top: 20px;\n}\n/* Targets the Simulated Health Score label */\n.service-health-tile-header > .text-label-control-group > label {\n\tfloat: none;\n\tmargin: 10px 0;\n\tfont-size: 16px;\n\tfont-family: inherit;\n\tfont-weight: 500;\n\tline-height: 20px;\n\ttext-transform: none;\n\tcolor: #3c444d; /* theme.textColor */\n\ttext-rendering: optimizelegibility;\n}\n.health-score-title-description {\n\tfont-size: 14px;\n\tfont-weight: 400;\n\tline-height: 16px;\n}',""]),i.exports=s},3013:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=o(5),y=o(76),_=h(o(294)),S=_.default.extend({dataTestItsi:"base-service-kpis-tab",initialize:function initialize(i){(i=i||{}).tabId=y.SERVICE_DEFINITION_TABS.KPI,i.tabLabel=(0,v.gettext)("KPIs"),_.default.prototype.initialize.apply(this,arguments)}});s.default=S,i.exports=s.default},3014:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(28)),y=h(o(236)),_=h(o(15)),S=o(5),T=o(76),x=h(o(749)),R=h(o(1325)),P=h(o(689)),L=h(o(3018)),N=h(o(1642)),V=h(o(1644)),j=h(o(1174));o(3088);var W=_.default.View.extend({KpiMainContentView:N.default,ServiceHealthView:j.default,initialize:function initialize(i){i=i||{},this.featureFlags=i.featureFlags,this.appsData=i.appsData,this.permissions=i.permissions,this.thresholdTemplateCollection=i.thresholdTemplateCollection,this.userData=i.userData,this.readOnly=i.readOnly,this.serviceTemplate=i.serviceTemplate,this.sdDispatcher=i.sdDispatcher,this.serviceKpiBackfillMapping=i.serviceKpiBackfillMapping,this.hideAnomalyDetectionPanel=i.hideAnomalyDetectionPanel,this.hideRecommendedThresholding=i.hideRecommendedThresholding,this.severityLabels=i.severityLabels,this.kpiToShow=i.kpiToShow,this.previewServiceCache={},this.kpiCollection=this.serviceObj.get("kpis"),!this.kpiToShow&&this.kpiCollection&&this.kpiCollection.primarykpis&&this.kpiCollection.primarykpis.length&&(this.kpiToShow=this.kpiCollection.primarykpis.models[0].get("_key")),this._buildKpiListView(),this._bindKpiCollectionEvents(),this.sdDispatcher&&this.listenTo(this.sdDispatcher,"unlink",this.refreshModel),_.default.View.prototype.initialize.apply(this,arguments)},_buildKpiListView:function _buildKpiListView(){this.kpiListView&&this.kpiListView.remove(),this.kpiListView=new L.default({service:this.serviceObj,collection:this.kpiCollection,readOnly:this.readOnly,serviceTemplate:this.serviceTemplate,sdDispatcher:this.sdDispatcher}),this.listenTo(this.kpiListView,"collectionview:rowselected",this._onKpiSelected),this.listenTo(this.kpiListView,"newkpi",this._onNewKPI)},_resetKpiCollection:function _resetKpiCollection(){this.kpiCollection&&this.stopListening(this.kpiCollection),this.kpiCollection=this.serviceObj.get("kpis"),this.serviceKpiBackfillMapping=P.default.getKpiBackfillStatus(this.serviceObj),this._bindKpiCollectionEvents()},_bindKpiCollectionEvents:function _bindKpiCollectionEvents(){this.listenTo(this.kpiCollection,"change add",this._onKPIChanged),this.listenTo(this.kpiCollection,"remove",this._onKPIDeleted)},selectKpi:function selectKpi(i){this.kpiListView.selectItem(i)},_onKpiSelected:function _onKpiSelected(i,s){this.mainContent&&this.mainContent.remove();var o=s.model;o._cachedBackfillProgressStatus=o._cachedBackfillProgressStatus||{},!0===o.get("backfill_enabled")&&(this.kpiBackfillReqDfd=P.default.getBackfillDataForKpi(o.id),this.kpiBackfillReqDfd.done((i,s)=>{o._cachedBackfillProgressStatus={progress:i,status:s}})),this._renderOnKpiSelected(o)},_renderOnKpiSelected:function _renderOnKpiSelected(i){i.get("type")!==T.KPI_TYPES.SERVICE_HEALTH?this.mainContent=new this.KpiMainContentView({featureFlags:this.featureFlags,appsData:this.appsData,kpiModel:i,serviceModel:this.serviceObj,readOnly:this.readOnly,hideAnomalyDetectionPanel:this.hideAnomalyDetectionPanel,hideRecommendedThresholding:this.hideRecommendedThresholding,serviceTemplate:this.serviceTemplate,sdDispatcher:this.sdDispatcher,serviceKpiBackfillMapping:this.serviceKpiBackfillMapping,permissions:this.permissions,previewServiceCache:this.previewServiceCache,thresholdTemplateCollection:this.thresholdTemplateCollection,userData:this.userData}):this.mainContent=new this.ServiceHealthView({serviceModel:this.serviceObj,severityLabels:this.severityLabels}),this.$mainContentEl.html(""),this.$mainContentEl.append(this.mainContent.render().$el),this.$el.trigger("kpiselected",this,i.id)},_onKPIDeleted:function _onKPIDeleted(){delete this.mainContent,this.renderNoSelection(),this.serviceObj.trigger("change",this.serviceObj)},_onNewKPI:function _onNewKPI(i,s){this._performNewKpi(i,s)},_performNewKpi:function _performNewKpi(i,s){var o,h={service:this.serviceObj,parse:!0};if(s)delete(o=s.toJSON())._key;else{var _=this.kpiCollection.primarykpis.length+1;o={title:this.serviceObj.get("title")+" KPI "+_}}o._key=this.serviceObj.generateKpiId();var S=new x.default(o,h),T=function(){var s=new V.default({featureFlags:this.featureFlags,kpiModel:S,serviceModel:this.serviceObj,showFTRSteps:!0,serviceKpiBackfillMapping:this.serviceKpiBackfillMapping});this.listenToOnce(s,"kpicreated",function(s){S.set(S.parse(s.toJSON())),this.kpiCollection.add(S),i.selectItem(S.id)}.bind(this)),(0,v.default)("body").append(s.render().el),s.show()}.bind(this);(0,y.default)(s)?S.gatherSearchClause({service:this.serviceObj}).always(function(){T()}.bind(this)):T()},getSelectedKpiId:function getSelectedKpiId(){var i=this.kpiListView.getSelected();return i&&i.length>0?i[0].model.id:null},_onKPIChanged:function _onKPIChanged(){this.serviceObj.trigger("change")},refreshModel:function refreshModel(){var i=null;if(this.kpiListView){var s=this.kpiListView.getSelected();s&&s.length>0&&(i=s[0].model.id)}this._resetKpiCollection(),this._buildKpiListView(),this.render(),i&&this.kpiListView.selectItem(i)},renderNoSelection:function renderNoSelection(){this.$mainContentEl.html('<div class="kpi-no-selection" data-test-itsi="kpi-no-selection">'+(0,S.gettext)("Create your first KPI or clone a KPI from the left side panel.")+"</div>")},render:function render(){this.$mainContentEl=(0,v.default)('<div class="kpi-main-content" data-test-itsi="kpi-main-content"></div>'),this.kpiToShow||this.renderNoSelection();var i=new R.default({sidebarContent:this.kpiListView.render().$el,mainContent:this.$mainContentEl});return this.$el.html(i.render().$el),this.kpiToShow&&this.selectKpi(this.kpiToShow),this},remove:function remove(){return this.kpiListView&&this.kpiListView.remove(),this.mainContent&&this.mainContent.remove(),_.default.View.prototype.remove.apply(this,arguments)}});s.default=W,i.exports=s.default},3015:function(i,s){i.exports='<div class="sidebar-layout-container">\n\t<div class="sidebar-layout-header"></div>\n\t<div>\n\t\t<table class="side-bar-layout-table" data-test-itsi="side-bar-layout-table">\n\t\t\t<tbody>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class="sidebar-layout-sidebar-td" data-test-itsi="side-bar-layout-table-sidebar">\n\t\t\t\t\t\t<div class="sidebar-layout-sidebar"></div>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class="sidebar-layout-main-td" data-test-itsi="side-bar-layout-table-main">\n\t\t\t\t\t\t<div class="sidebar-layout-main"></div>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n</div>'},3016:function(i,s,o){var h=o(3017);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},3017:function(i,s,o){(s=o(37)(!1)).push([i.i,".side-bar-layout-table {\n\twidth: 100%;\n}\n.sidebar-layout-header {\n\theight: 80px;\n\tpadding-left: 20px;\n\tborder-bottom: 1px solid #c3cbd4; /* theme.borderColor */\n\tfont-size: 20px;\n\tline-height: 80px;\n}\n\n.sidebar-layout-sidebar-td {\n\twidth: 250px;\n\tvertical-align: top;\n\tborder-right: 1px solid #c3cbd4; /* theme.borderColor */\n}\n\n.sidebar-layout-main-td {\n\tvertical-align: top;\n}\n\n.sidebar-layout-main {\n\twidth: 100%;\n}\n",""]),i.exports=s},3018:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y=h(o(9)),_=h(o(28)),S=h(o(0)),T=h(o(36)),x=h(o(163)),R=h(o(3)),P=h(o(3019)),L=h(o(39)),N=h(o(99)),V=o(5),j=o(16),W=o(68),K=h(o(178)),U=h(o(393)),Y=o(200),$=o(76),X=o(185),Z=o(362),ee=h(o(79)),te=h(o(603)),ie=h(o(1600)),ae=h(o(1971)),ne=h(o(2772)),re=h(o(3020)),se=h(o(895)),le=h(o(52)),oe=h(o(1288));o(3023);var de={maxHeight:"400px",overflow:"scroll"},ce=R.default.div(v||(v=(0,y.default)(["\n\tmax-width: 60ch;\n\tword-wrap: break-word;\n"]))),he=S.default.createElement(ce,null,(0,j.sprintf)((0,V.gettext)("Indicates that the KPI is linked to an active %(objectName)s"),{objectName:Z.OBJECT_NAMES.singular})),ue=ne.default.extend({title:(0,V.gettext)("KPIs"),initialize:function initialize(i){this.serviceModel=i.serviceModel,this.examples=new oe.default,this.exampleDfd=this.examples.fetch({data:{filter:this.serviceModel.getSecGrpMembershipFilter()}}),this.readOnly=i.readOnly,ne.default.prototype.initialize.call(this,arguments)},triggerClickCloneKPI:function triggerClickCloneKPI(){this.serviceModel.trigger("clickCloneKPI")},triggerClickNewKPI:function triggerClickNewKPI(i){this.serviceModel.trigger("clickNewKPI",i)},render:function render(){if(ne.default.prototype.render.apply(this,arguments),!this.readOnly){var i=this.serviceModel.get("object_type")===Y.OBJECT_TYPE;this.$el.append('<div class="actions pull-right" data-test-itsi="kpi-list-view-actions"><div class="kpi-list-view-button-placeholder" style="display: inline-block; margin-right: 10px"></div><div class="kpi-list-view-placeholder" style="display: inline-block"></div></div>'),i?T.default.render(S.default.createElement(le.default,null,S.default.createElement(L.default,{"data-test-itsi":"kpi-create-button",label:(0,V.gettext)("New KPI"),onClick:this.triggerClickNewKPI.bind(this)})),this.$(".kpi-list-view-button-placeholder").get(0)):T.default.render(S.default.createElement(le.default,null,S.default.createElement(L.default,{"data-test-itsi":"kpi-clone-button",label:(0,V.gettext)("Clone"),onClick:this.triggerClickCloneKPI.bind(this)})),this.$(".kpi-list-view-button-placeholder").get(0)),this.exampleDfd.done(()=>{for(var i=[{dataTestItsi:"new-generic-kpi-item-option",label:(0,V.gettext)("Generic KPI"),handleClick:this.triggerClickNewKPI.bind(this)}],s=0;s<this.examples.length;++s)this._addExampleCollection(i,this.examples.at(s));T.default.render(S.default.createElement(le.default,null,S.default.createElement(U.default,{buttonAppearance:"default",buttonLabel:(0,V.gettext)("New"),dataTestItsiButton:"kpi-create-dropdown-button",dataTestItsiDropdown:"kpi-create-dropdown",menuStyle:de,options:i})),this.$(".kpi-list-view-placeholder").get(0))}).fail(()=>{})}return this},getExamplesCollection:function getExamplesCollection(){return this.examples},_addExampleCollection:function _addExampleCollection(i,s){var o=this,lowerCaseFlat=i=>i.toLowerCase().replaceAll(" ","-").replace(":",""),h=s.get("title");i.push({dataTestItsi:"new-kpi-item-option-".concat(lowerCaseFlat(h)),title:h});for(var v=s.get("kpis").primarykpis,y=function _loop(){var h=s.id,y=v.at(_).get("title"),S=v.at(_).id,T="".concat(lowerCaseFlat(h),"-").concat(lowerCaseFlat(y));i.push({dataTestItsi:"new-kpi-item-option-".concat(T),label:y,handleClick:()=>o.triggerClickNewKPI({"data-collection":h,"data-id":S})})},_=0;_<v.length;++_)y()}}),pe=ae.default.extend({initialize:function initialize(i){this.readOnly=i.readOnly,this.serviceTemplate=i.serviceTemplate,this.serviceModel=i.serviceModel,this.sdDispatcher=i.sdDispatcher,ae.default.prototype.initialize.apply(this,arguments),this.children={},this.children.deleteButton=new ee.default({appearance:"pill",dataTestItsi:"remove-kpi-button",icon:"clear",onClick:this._onDelete.bind(this),screenReaderText:(0,V.gettext)("Delete KPI"),style:{marginRight:5},wrapperStyle:"float:right;vertical-align:top"}),this.children.lockIcon=new te.default({dataTestItsi:"kpi-from-service-template-locked-icon",dataTestItsiTooltip:"kpi-from-service-template-locked-icon-tooltip",hasTooltip:!0,style:{fontSize:15},tooltipContent:(0,j.sprintf)((0,V.gettext)("KPI linked to service template %(serviceTemplateName)s."),{serviceTemplateName:this.serviceTemplate?this.serviceTemplate.get("title"):""}),type:"lock"})},_renderActiveCustomThresholdWindowIcon:function _renderActiveCustomThresholdWindowIcon(){var i=(0,_.default)('<div class="kpi-list-row-custom-threshold-window-icon-container"></div>');return T.default.unmountComponentAtNode(i.get(0)),T.default.render(S.default.createElement(le.default,null,S.default.createElement(N.default,{"data-test-itsi":"kpi-list-row-custom-threshold-window-icon-tooltip",contentRelationship:"label",content:he},S.default.createElement(P.default,{"data-test-itsi":"kpi-list-row-custom-threshold-window-icon",hideDefaultTooltip:!0}))),i.get(0)),i},render:function render(){return ae.default.prototype.render.apply(this,arguments),this.$el.append('<div class="kpi-list-row-indicator-icons"></div>'),this.model.get("base_service_template_id")&&this.serviceModel.get("object_type")===$.OBJECT_TYPE&&(this.$el.find(".collection-list-row-content").addClass("short-item-lock-icon"),this.$el.find(".kpi-list-row-indicator-icons").append('<div class="kpi-list-row-lock-icon-container"><span class="kpi-from-service-template-locked-icon-wrapper"></span></div>'),this.$el.find(".kpi-from-service-template-locked-icon-wrapper").html(this.children.lockIcon.render().$el)),this.serviceModel.get("object_type")===$.OBJECT_TYPE&&(0,X.hasActiveCustomThresholdWindow)(this.model.toJSON())&&this.$el.find(".kpi-list-row-indicator-icons").append(this._renderActiveCustomThresholdWindowIcon()),this.readOnly||this.$el.append(this.children.deleteButton.render().$el),this},primaryButtonClickedAction:function primaryButtonClickedAction(){this.$el.trigger("deletekpi",this.model.id)},_onDelete:function _onDelete(){if(this.serviceTemplate&&this.model.get("base_service_template_id"))this._showUnlinkWarningModal();else{var i=this.$el.parents(".collection-list-container").find(".collection-list-modal-container");T.default.unmountComponentAtNode(i.get(0)),T.default.render(S.default.createElement(le.default,null,S.default.createElement(K.default,{modalDataTestItsi:"kpi-list-view-delete-modal",cancelButtonDataTestItsi:"kpi-list-view-modal-cancel-button",primaryButtonDataTestItsi:"kpi-list-view-modal-delete-button",showCancel:!0,open:!0,modalStyles:W.CONFIRMATION_MODAL_STYLE,title:(0,V.gettext)("Delete KPI"),primaryButtonLabel:(0,V.gettext)("Delete"),primaryButtonClicked:this.primaryButtonClickedAction.bind(this)},S.default.createElement("span",{"data-test-itsi":"delete-service-kpi-message"},(0,j.sprintf)((0,V.gettext)("Are you sure you want to delete %s?"),(0,x.default)(this.model.get("title")))))),i.get(0))}},_showUnlinkWarningModal:function _showUnlinkWarningModal(){var i=(0,_.default)('<div class="unlink-warning-modal"></div>');T.default.unmountComponentAtNode(i.get(0)),T.default.render(S.default.createElement(le.default,null,S.default.createElement(se.default,{modalTitleSubstring:(0,V.gettext)("Delete KPI"),serviceTitle:this.serviceModel.get("title"),serviceTemplateTitle:this.serviceTemplate.get("title"),serviceTemplateUrl:this.serviceTemplate.getEditUrl(),isModalOpen:!0,handleAcceptToUnlink:this.handleAcceptToUnlink.bind(this)})),i.get(0))},handleAcceptToUnlink:function handleAcceptToUnlink(){this.sdDispatcher.trigger("unsetBaseServiceTemplateId",this.serviceModel),this.sdDispatcher.trigger("unlink"),this.serviceModel.deleteKpi(this.model.id)},select:function select(){this.isSelected()||(this.toggleSelect(),this.trigger("selectionchange",this,this.selected))}}),fe=ie.default.extend({attributes:{"data-test-itsi":"kpi-list-view"},className:"kpi-list-view",events:{deletekpi:"_onDeleteKpi"},initialize:function initialize(i){this.readOnly=i.readOnly,this.service=i.service,this.serviceTemplate=i.serviceTemplate,this.sdDispatcher=i.sdDispatcher,(i=i||{}).HeaderView=ue,i.headerOptions={readOnly:this.readOnly,serviceModel:this.service},i.RowView=pe,i.rowOptions={readOnly:this.readOnly,serviceTemplate:this.serviceTemplate,serviceModel:this.service,sdDispatcher:this.sdDispatcher},ie.default.prototype.initialize.call(this,i),this.listenTo(this.service,"clickCloneKPI",this.onImportKPIs.bind(this)),this.listenTo(this.service,"clickNewKPI",this._handleNewKpi.bind(this))},onImportKPIs:function onImportKPIs(){var i=new re.default({onHiddenRemove:!0,service:this.service});this.listenTo(i,"kpiscloned",(function(i){this.collection.add(i)})),(0,_.default)("body").append(i.render().el),i.show()},_handleNewKpi:function _handleNewKpi(i){if("blank"!==i["data-id"]&&i["data-collection"]){var s=this.getHeaderView().getExamplesCollection(),o=i["data-collection"],h=s.get(o).get("kpis").primarykpis;this.trigger("newkpi",this,h.get(i["data-id"]))}else this.trigger("newkpi",this)},_onDeleteKpi:function _onDeleteKpi(i,s){this.service.deleteKpi(s)},addItem:function addItem(i){i.get("type")!==$.KPI_TYPES.SERVICE_HEALTH&&ie.default.prototype.addItem.apply(this,arguments)},render:function render(){return ie.default.prototype.render.apply(this,arguments),this}});s.default=fe,i.exports=s.default},3019:function(i,s,o){i.exports=function(i){var s={};function __webpack_require__(o){if(s[o])return s[o].exports;var h=s[o]={i:o,l:!1,exports:{}};return i[o].call(h.exports,h,h.exports,__webpack_require__),h.l=!0,h.exports}return __webpack_require__.m=i,__webpack_require__.c=s,__webpack_require__.d=function(i,s,o){__webpack_require__.o(i,s)||Object.defineProperty(i,s,{enumerable:!0,get:o})},__webpack_require__.r=function(i){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},__webpack_require__.t=function(i,s){if(1&s&&(i=__webpack_require__(i)),8&s)return i;if(4&s&&"object"==typeof i&&i&&i.__esModule)return i;var o=Object.create(null);if(__webpack_require__.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:i}),2&s&&"string"!=typeof i)for(var h in i)__webpack_require__.d(o,h,function(s){return i[s]}.bind(null,h));return o},__webpack_require__.n=function(i){var s=i&&i.__esModule?function getDefault(){return i.default}:function getModuleExports(){return i};return __webpack_require__.d(s,"a",s),s},__webpack_require__.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=23)}({0:function(i,s){i.exports=o(0)},1:function(i,s){i.exports=o(116)},2:function(i,s){i.exports=o(126)},23:function(i,s,o){"use strict";o.r(s),o.d(s,"default",(function(){return BarStacked100}));var h=o(0),v=o.n(h),y=o(1),_=o(2),S=o.n(_);function _extends(){return(_extends=Object.assign||function(i){for(var s=1;s<arguments.length;s++){var o=arguments[s];for(var h in o)Object.prototype.hasOwnProperty.call(o,h)&&(i[h]=o[h])}return i}).apply(this,arguments)}function BarStacked100(i){return v.a.createElement(S.a,_extends({screenReaderText:Object(y._)("Bar Stacked 100"),viewBox:"0 0 1200 1500"},i),v.a.createElement("path",{d:"M0 1500V0h525v1500H0zm675 0V0h525v1500H675zm75-975v900h375V525H750zM75 825v600h375V825H75z"}))}}})},3020:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(28)),y=h(o(15)),_=h(o(0)),S=h(o(36)),T=h(o(42)),x=h(o(70)),R=h(o(182)),P=o(5),L=o(125),N=h(o(1831)),V=o(106),j=o(76),W=o(119),K=o(137),U=h(o(3021)),Y=h(o(150)),$=h(o(114)),X=h(o(1325)),Z=h(o(79)),ee=h(o(749)),te=h(o(302)),ie=h(o(52));o(2065);var ae={width:"250px"},ne=Y.default.extend({attributes:v.default.extend({},Y.default.DEFAULT_ATTRIBUTES,{"data-test-itsi":"kpi-clone-modal"}),className:"kpi-clone-modal fetch-list-on-scroll-modal "+Y.default.CLASS_NAME+" "+Y.default.CLASS_MODAL_WIDE,initialize:function initialize(i){Y.default.prototype.initialize.apply(this,arguments),this.service=i.service,this.layout=new X.default({sidebarContent:this.sidebarTemplate,mainContent:this.mainTemplate}),this.fetchServiceObjectView=this._createScrollableServiceList();var s=y.default.Model.extend({idAttribute:"_key"}),o=y.default.Collection.extend({model:s});this.kpiCollection=new o,this.selectedKPIs=[],this.children.cancelButton=new Z.default({dataDismiss:"modal",dataTestItsi:"kpi-clone-modal-cancel-button",label:(0,P.gettext)("Cancel")}),this.children.saveButton=new Z.default({appearance:"primary",dataTestItsi:"kpi-clone-modal-primary-button",label:(0,P.gettext)("Clone"),onClick:this._saveKpis.bind(this),style:{marginLeft:10}})},_createScrollableServiceList:function _createScrollableServiceList(){var i=(0,v.default)('<div class="field-value-react-dropdown" data-test-itsi="kpi-clone-list"></div>');return S.default.unmountComponentAtNode(i.get(0)),S.default.render(_.default.createElement(ie.default,null,_.default.createElement(N.default,{objectsCollectionCountPath:"".concat(W.baseURL,"/count"),objectsCollectionPath:W.baseURL,handleItemSelect:this.handleServiceSelect.bind(this),handleItemDeselect:this.handleServiceDeselect.bind(this),filterPlaceholder:(0,P.gettext)("Filter services"),fields:"title,_key,kpis.title,kpis._key,kpis.type,kpis.description",searchBarStyle:ae,isSearchBarInline:!1,itemTitle:j.OBJECT_NAMES})),i.get(0)),i},onRequestToggle:function onRequestToggle(i){var s=this.selectedKPIs.indexOf(i);s>-1?this.selectedKPIs.splice(s,1):this.selectedKPIs.push(i),this.renderCloneKPITable()},onRequestToggleAllRows:function onRequestToggleAllRows(i){0===this.selectedKPIs.length||(0,R.default)(i,this.selectedKPIs).length!==this.selectedKPIs.length?this.selectedKPIs=this.kpiCollection.models.map(i=>i.get("_key")):this.selectedKPIs=[],this.renderCloneKPITable()},renderCloneKPITable:function renderCloneKPITable(){if(this.$(".kpi-main-list").length){S.default.unmountComponentAtNode(this.$(".kpi-main-list").get(0));var i=this.kpiCollection.models.map(i=>({_key:i.get("_key"),description:i.get("description"),title:i.get("title"),serviceTitle:i.get("serviceTitle")}));S.default.render(_.default.createElement(ie.default,null,_.default.createElement(U.default,{kpiData:i,onRequestToggle:this.onRequestToggle.bind(this),onRequestToggleAllRows:this.onRequestToggleAllRows.bind(this),selectedKPIs:this.selectedKPIs})),this.$(".kpi-main-list").get(0))}},handleServiceSelect:function handleServiceSelect(i){var s=[];i.kpis.forEach((function(i){i.type===j.KPI_TYPES.PRIMARY&&s.push(i)}));for(var o=0;o<s.length;o++)this.kpiCollection.add({serviceId:i._key,serviceTitle:i.title,_key:s[o]._key,title:s[o].title,description:s[o].description});this.renderCloneKPITable()},handleServiceDeselect:function handleServiceDeselect(i){var s=[];i.kpis.forEach((function(i){i.type===j.KPI_TYPES.PRIMARY&&s.push(i)})),s.forEach(i=>{var s=this.selectedKPIs.indexOf(i._key);s>-1&&this.selectedKPIs.splice(s,1)});var o=i._key,h=this.kpiCollection.where({serviceId:o});this.kpiCollection.remove(h),this.renderCloneKPITable()},_saveKpis:function _saveKpis(){if(this.children.saveButton.changeStateAndLabel(!0,(0,P.gettext)("Cloning...")),0===this.selectedKPIs.length)return this.children.errorMessage?this.children.errorMessage.show():this.children.errorMessage=new $.default({content:(0,P.gettext)("Must select at least one KPI."),dataTestItsi:"clone-kpi-none-selected-error-message",isInline:!0,type:"error"}),void this.$(Y.default.FOOTER_SELECTOR).prepend(this.children.errorMessage.render().$el);this.children.errorMessage&&this.children.errorMessage.hide();var i=[],s=[],o=[];(0,T.default)(this.selectedKPIs,s=>{var h=this.kpiCollection.where({_key:s});if(h&&h.length>0){var v=function processServiceModel(s){var o=s.get("serviceId"),h=new te.default({_key:o});if(!(0,x.default)(i,function(i){return i.id===o}.bind(this)))return i.push(h),h.fetch()}(h[0]);v&&o.push(v)}}),v.default.when.apply(v.default,o).done(function(){(0,T.default)(this.selectedKPIs,function(o){var h=null;(0,x.default)(i,function(i){var s=i.get("kpis").findWhere({_key:o});s&&(h=s)}.bind(this));var v=new ee.default(h.attributes,{service:this.service});v.unset(ee.default.prototype.idAttribute),(0,T.default)(K.KPI_CLONE_ATTRIBUTES_BLOCK_LIST,function(i){v.unset(i)}.bind(this)),v.set(ee.default.prototype.idAttribute,this.service.generateKpiId());for(var y=this.service.get("kpis"),_=" ("+(0,P.gettext)("copy")+")",S=v.get("title");y.findWhere({title:S});)S+=_;v.set("title",S),0===this.service.getNumEntityRules()&&"shared_base"!==v.get("search_type")&&v.set("is_service_entity_filter",!1),v.save({},{service:this.service,app:(0,V.getShortAppName)(!0),owner:L.username}),this.service.get("kpis").primarykpis.add(v),s.push(v)}.bind(this)),this.trigger("kpiscloned",s),this.hide(),this.remove()}.bind(this)).fail(()=>{this.children.saveButton.changeStateAndLabel(!1,(0,P.gettext)("Clone"))})},render:function render(){return this.$el.html(Y.default.TEMPLATE),this.$(Y.default.HEADER_TITLE_SELECTOR).html((0,P.gettext)("Clone KPIs")),this.$(Y.default.BODY_SELECTOR).append(this.layout.render().el),this.$(".sidebar-layout-header").hide(),this.$(".service-list").append(this.fetchServiceObjectView),this.renderCloneKPITable(),this.$(Y.default.FOOTER_SELECTOR).append(this.children.cancelButton.render().$el),this.$(Y.default.FOOTER_SELECTOR).append(this.children.saveButton.render().$el),this},sidebarTemplate:'<div class="service-list"></div>',mainTemplate:'<div class="kpi-main-list"></div>'});s.default=ne,i.exports=s.default},3021:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=s.columnsData=s.cellData=void 0;var v,y=h(o(9)),_=h(o(0)),S=h(o(2)),T=h(o(33)),x=h(o(104)),R=h(o(99)),P=o(5),L=o(161),N=(0,h(o(3)).default)(x.default)(v||(v=(0,y.default)(["\n width: 100%;\n"]))),V=[{dataTestItsi:"kpi-clone-table-kpi-title-column-header",label:(0,P.gettext)("KPI Title")},{dataTestItsi:"kpi-clone-table-kpi-description-column-header",label:(0,P.gettext)("KPI Description")},{dataTestItsi:"kpi-clone-table-kpi-service-title-column-header",label:(0,P.gettext)("Service Title")}];s.columnsData=V;var j=[{dataTestItsi:"kpi-clone-table-kpi-title-cell"},{dataTestItsi:"kpi-clone-table-kpi-description-cell"},{dataTestItsi:"kpi-clone-table-kpi-service-title-cell"}];s.cellData=j;function CloneKPITable(i){var{kpiData:s,onRequestToggle:o,onRequestToggleAllRows:h,selectedKPIs:v}=i,onRequestToggleInternal=(i,s)=>{o(s)},limitCellContentSize=(i,s)=>!i||i.length<=16?i:_.default.createElement(R.default,{"data-test-itsi":s,content:i,key:"".concat(i,"-").concat(s)},"".concat(i.slice(0,16),"..."));return s&&s.length?_.default.createElement(N,{"data-test-itsi":"clone-kpi-table",stripeRows:!0,onRequestToggleAllRows:()=>{h(s.map(i=>i._key))},rowSelection:0===v.length?L.SELECTED_NONE:v.length===s.length?L.SELECTED_ALL:L.SELECTED_SOME},_.default.createElement(x.default.Head,{"data-test-itsi":"clone-kpi-table-head"},V.map(i=>_.default.createElement(x.default.HeadCell,{"data-test-itsi":i.dataTestItsi,key:i.dataTestItsi},i.label))),_.default.createElement(x.default.Body,null,s.map(i=>_.default.createElement(x.default.Row,{"data-test-itsi":"clone-kpi-table-row",key:"".concat(i._key,"-").concat(i.title,"-row"),onRequestToggle:onRequestToggleInternal,data:i._key,selected:v.indexOf(i._key)>-1},_.default.createElement(x.default.Cell,{"data-test-itsi":j[0].dataTestItsi,key:"".concat(i._key,"-").concat(i.title,"-kpi-title-cell")},limitCellContentSize(i.title,"clone-kpi-table-kpi-title-tooltip")),_.default.createElement(x.default.Cell,{"data-test-itsi":j[1].dataTestItsi,key:"".concat(i._key,"-").concat(i.title,"-kpi-description-cell")},limitCellContentSize(i.description,"clone-kpi-table-kpi-description-tooltip")),_.default.createElement(x.default.Cell,{"data-test-itsi":j[2].dataTestItsi,key:"".concat(i._key,"-").concat(i.title,"-service-title-cell")},limitCellContentSize(i.serviceTitle,"clone-kpi-table-service-title-tooltip")))))):_.default.createElement(T.default,{"data-test-itsi":"clone-kpi-table-none-message",type:"info"},(0,P.gettext)("No KPIs to display. Select service(s) on the left panel."))}CloneKPITable.propTypes={kpiData:S.default.arrayOf(S.default.shape({_key:S.default.string,description:S.default.string,title:S.default.string,serviceTitle:S.default.string})),onRequestToggle:S.default.func.isRequired,onRequestToggleAllRows:S.default.func.isRequired,selectedKPIs:S.default.array},CloneKPITable.defaultProps={kpiData:[],selectedKPIs:[]};var W=CloneKPITable;s.default=W},3022:function(i,s,o){(s=o(37)(!1)).push([i.i,".add-service-dependency-modal .sidebar-layout-main-td,\n.kpi-clone-modal .sidebar-layout-main-td {\n\tpadding-left: 20px;\n}\n.add-service-dependency-modal .sidebar-layout-sidebar-td,\n.kpi-clone-modal .sidebar-layout-sidebar-td {\n\tborder-right: none;\n}\n.add-service-dependency-modal .modal-footer div,\n.kpi-clone-modal .modal-footer div {\n\tdisplay: inline-block;\n}\n.kpi-main-list,\n.service-list {\n\toverflow-y: auto;\n}\n.kpi-main-list {\n\theight: 460px;\n}\n.sidebar-layout-sidebar-td {\n\tmax-width: 250px;\n}",""]),i.exports=s},3023:function(i,s,o){var h=o(3024);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},3024:function(i,s,o){(s=o(37)(!1)).push([i.i,".sidebar-layout-sidebar-td {\n\tmin-width: 250px;\n}\n\n.kpi-list-view .collection-list-item {\n\tpadding-top: 10px;\n\tpadding-left: 20px;\n\tposition: relative;\n}\n\n.kpi-list-view .collection-list-item .kpi-list-row-indicator-icons {\n\tdisplay: inline;\n\tposition: absolute;\n\tright: 35px;\n}\n\n.kpi-list-view .collection-list-item .kpi-list-row-indicator-icons .kpi-list-row-lock-icon-container {\n\tdisplay: inline-block;\n\tvertical-align: middle;\n\tpadding: 0 5px;\n}\n\n.kpi-list-view .collection-list-item .kpi-list-row-indicator-icons .kpi-list-row-custom-threshold-window-icon-container {\n\tdisplay: inline-block;\n\tvertical-align: middle;\n\tpadding: 0 5px 0 10px;\n}\n\n.kpi-list-view .collection-list-row-content {\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\tmax-width: 190px;\n\tdisplay: inline-block;\n}\n.kpi-list-view .collection-list-row-content.short-item-lock-icon {\n\tmax-width: 175px;\n}",""]),i.exports=s},3025:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(28)),y=h(o(0)),_=h(o(36)),S=o(5),T=h(o(888)),x=h(o(52)),R=h(o(895)),P=T.default.extend({initialize:function initialize(i){if(!(i=i||{}).serviceTemplate)throw"Should pass serviceTemplate to ServiceDefinitionKpiInlineTextControl";if(!i.serviceModel)throw"Should pass serviceModel to ServiceDefinitionKpiInlineTextControl";this.serviceTemplate=i.serviceTemplate,this.serviceModel=i.serviceModel,this.sdDispatcher=i.sdDispatcher,T.default.prototype.initialize.apply(this,arguments)},_toEditMode:function _toEditMode(){this._showUnlinkWarningModal()},handleAcceptToUnlink:function handleAcceptToUnlink(){this.sdDispatcher.trigger("unsetBaseServiceTemplateId",this.serviceModel),this.sdDispatcher.trigger("unlink")},_showUnlinkWarningModal:function _showUnlinkWarningModal(){var i=(0,v.default)('<div class="unlink-warning-modal"></div>'),s=(0,S.gettext)("Edit KPI Title");_.default.unmountComponentAtNode(i.get(0)),_.default.render(y.default.createElement(x.default,null,y.default.createElement(R.default,{modalTitleSubstring:s,serviceTitle:this.serviceModel.get("title"),serviceTemplateTitle:this.serviceTemplate.get("title"),serviceTemplateUrl:this.serviceTemplate.getEditUrl(),isModalOpen:!0,handleAcceptToUnlink:this.handleAcceptToUnlink.bind(this)})),i.get(0))}});s.default=P,i.exports=s.default},3026:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(11)),y=h(o(41)),_=o(5),S=o(16),T=h(o(603)),x=h(o(415)),R=h(o(1643));function ownKeys(i,s){var o=Object.keys(i);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(i);s&&(h=h.filter((function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable}))),o.push.apply(o,h)}return o}function _objectSpread(i){for(var s=1;s<arguments.length;s++){var o=null!=arguments[s]?arguments[s]:{};s%2?ownKeys(Object(o),!0).forEach((function(s){(0,v.default)(i,s,o[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(o,s))}))}return i}o(1646);var P=x.default.extend({tagName:"div",className:"kpi-search-panel",initialize:function initialize(i){if(i=i||{},this.options=i,!i.kpiModel)throw"Must provide kpiModel";if(this.kpiModel=i.kpiModel,!i.serviceModel)throw"Must provide serviceModel";this.serviceModel=i.serviceModel,this.serviceTemplateTitle=i.serviceTemplateTitle,i.dataTestItsi="service-search-and-calculate-collapsible-panel",i.panelId="search",i.panelTitle=(0,_.gettext)("Search and Calculate"),i.contentViewOptions=_objectSpread({kpiModel:this.kpiModel,serviceModel:this.serviceModel},(0,y.default)(this.options,"dataTestItsi")),i.ContentView=R.default,this.iconDataTestItsiSelector="search-and-calculate-collapsible-linked-to-st-icon",this.children={},this.children.lockIcon=new T.default({dataTestItsi:this.iconDataTestItsiSelector,dataTestItsiTooltip:"".concat(this.iconDataTestItsiSelector,"-tooltip"),hasTooltip:!0,style:{marginLeft:8,fontSize:15},tooltipContent:(0,S.sprintf)((0,_.gettext)("KPI linked to service template %(serviceTemplateName)s."),{serviceTemplateName:this.serviceTemplateTitle}),type:"lock"}),x.default.prototype.initialize.apply(this,arguments)},render:function render(){return x.default.prototype.render.apply(this,arguments),this.kpiModel.get("base_service_template_id")&&0===this.$el.find('[data-test-itsi="'.concat(this.iconDataTestItsiSelector,'"]')).length&&this.$el.find('[data-test="collapsible-panel"] [data-test="toggle"] [data-test="title"]').append(this.children.lockIcon.render().$el),this}});s.default=P,i.exports=s.default},3027:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(15)),y=h(o(28)),_=h(o(0)),S=h(o(36)),T=h(o(43)),x=h(o(33)),R=o(5),P=o(58),L=o(142),N=o(137),V=o(76),j=h(o(52)),W=h(o(415));o(3028);var K=W.default.extend({tagName:"div",className:"kpi-generated-search-panel",initialize:function initialize(i){(i=i||{}).dataTestItsi="service-generated-search-collapsible-panel",i.panelId="generated-search",i.panelTitle=(0,R.gettext)("Generated Search"),i.contentViewOptions={kpiModel:i.kpiModel},i.ContentView=v.default.View.extend({tagName:"div",className:"kpi-generated-search-internal-panel",initialize:function initialize(i){this.kpiModel=i.kpiModel,this.listenTo(this.kpiModel,"change:search_alert",this.render),v.default.View.prototype.initialize.apply(this,arguments)},escapeKpiTitleGeneratedSearch:function escapeKpiTitleGeneratedSearch(i){var s,o,h=i.indexOf('kpi="'),v=i.indexOf("urgency=");o=s="";var y=h+5;for(v-=3;y<v;)'"'!==i[y]&&"\\"!==i[y]||(o+="\\"),o+=i[y],s+=i[y],++y;return i.replace(s,o)},onRunSearchClick:function onRunSearchClick(){var i=this.kpiModel.get("search_alert");if(i=this.escapeKpiTitleGeneratedSearch(i)){var s=this.kpiModel.get("search_alert_earliest");s===N.ALERT_EARLIEST.CUSTOM&&(s=this.kpiModel.get("search_alert_earliest_custom_val"));var o={q:i,earliest:"-"+s+"m",latest:"now"};(0,P.redirect)((0,L.uiEditURL)(o),!0,null,!0)}},remove:function remove(){var i=(0,y.default)('<div class="generated-search-view-container"></div>');return S.default.unmountComponentAtNode(i.get(0)),v.default.View.prototype.remove.apply(this,arguments)},render:function render(){var i=this.kpiModel.get("search_alert");i=this.escapeKpiTitleGeneratedSearch(i);var s=(0,y.default)('<div class="generated-search-view-container"></div>');return S.default.unmountComponentAtNode(s.get(0)),S.default.render(_.default.createElement(j.default,null,_.default.createElement(_.default.Fragment,null,this.kpiModel.get("search_type")===V.KPI_SEARCH_TYPES.SHARED_BASE&&_.default.createElement(x.default,{"data-test-itsi":"generated-base-search-preview-warning",style:{marginBottom:0,marginLeft:10},type:"warning"},(0,R.gettext)("This search preview might differ from the actual KPI search.")),_.default.createElement("div",{className:"service-definition-generated-search-preview","data-test-itsi":"service-definition-generated-search-preview"},i.length>0?i:(0,R.gettext)("No generated search yet available.")),_.default.createElement(T.default,{"data-test-itsi":"generated-search-run-in-search-link",openInNewContext:!0,onClick:this.onRunSearchClick.bind(this),style:{margin:"5px 0px 5px 5px"}},(0,R.gettext)("Run in Search")))),s.get(0)),this.$el.html(s),this}}),W.default.prototype.initialize.apply(this,arguments)}});s.default=K,i.exports=s.default},3028:function(i,s,o){var h=o(3029);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},3029:function(i,s,o){(s=o(37)(!1)).push([i.i,'.service-definition-generated-search-preview {\n\tpadding: 5px;\n\tmargin: 5px;\n\tborder: 1px solid #c3cbd4; /* theme.borderColor */\n\tfont-family: "Droid Sans Mono", "Consolas", "Monaco", "Courier New", Courier, monospace;\n\tcursor: pointer;\n\tmax-height: 100px;\n\toverflow-y: auto;\n}\n',""]),i.exports=s},3030:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(28)),y=h(o(15)),_=o(49),S=o(5),T=o(133),x=h(o(90)),R=y.default.View.extend({initialize:function initialize(i){this.kpiModel=i.kpiModel,this.serviceModel=i.serviceModel,this.titleControl=new x.default({controlType:"Text",controlOptions:{dataTestItsi:"create-kpi-title-text",model:this.kpiModel,modelAttribute:"title"},dataTestItsi:"create-kpi-title-control-group",label:(0,S.gettext)("Title"),required:!0}),this.descriptionControl=new x.default({controlType:"Textarea",controlOptions:{dataTestItsi:"create-kpi-description-text-area",model:this.kpiModel,modelAttribute:"description",placeholder:this.kpiModel.get("description")||(0,S.gettext)("optional")},dataTestItsi:"kpi-description-control-group",label:(0,S.gettext)("Description")}),this._firstRender=!0,y.default.View.prototype.initialize.apply(this,arguments)},getSubTitle:function getSubTitle(){return(0,S.gettext)("Title and Description")},render:function render(){return this._firstRender&&(this.$el.html(""),this.$el.append('<div class="title-controls form-horizontal"></div>'),this.$(".title-controls").append(this.titleControl.render().el),this.$(".title-controls").append(this.descriptionControl.render().el),this._firstRender=!1),this},validate:function validate(){var i=!1;this.titleControl.error(!1);var s=v.default.Deferred(),o=this.kpiModel.get("title");o.length<1&&(this.titleControl.error(T.NO_EMPTY_TITLE_MESSAGE),i=!0);var h=this.serviceModel.get("kpis").pluck("title");return(0,_.contains)(h,o)&&(this.titleControl.error(T.ALREADY_EXISTING_TITLE_MESSAGE),i=!0),i?s.reject([]):s.resolve(),s}});s.default=R,i.exports=s.default},3031:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(28)),y=h(o(15)),_=h(o(0)),S=h(o(36)),T=o(5),x=o(16),R=h(o(43)),P=o(74),L=o(133),N=o(154),V=o(58),j=o(2825),W=o(883),K=o(974),U=o(142),Y=o(76),$=o(137),X=h(o(79)),Z=h(o(114)),ee=h(o(3032)),te=h(o(90)),ie=h(o(2826)),ae=h(o(2819)),ne=h(o(52)),re=h(o(3033)),se=h(o(2051)),le=y.default.View.extend({initialize:function initialize(i){this.kpiModel=i.kpiModel,this.serviceModel=i.serviceModel,this.metricsUtilsInstance=i.metricsUtilsInstance,this.savedBaseSearchCollection=new se.default,this.filteredSavedBaseSearchCollection={},this.kpiModel.set("skip_kpi_validation",!1),this.adHocSearchControl=new te.default({controlType:"Textarea",controlOptions:{dataTestItsi:"adhoc-search-text-area",listenForModelChanges:!0,modelAttribute:"base_search",model:this.kpiModel},dataTestItsi:"kpi-adhoc-search-control-group",label:(0,T.gettext)("Search"),help:_.default.createElement(R.default,{"data-test-itsi":"step-view-run-search-link",openInNewContext:!0,onClick:this.runBaseSearch.bind(this)},(0,T.gettext)("Run Search")),required:!0,tooltip:(0,T.gettext)("Event gathering search used to get data for the KPI.")}),this.adHocThresholdControl=new te.default({controlType:"Text",controlOptions:{dataTestItsi:"kpi-threshold-field-text",listenForModelChanges:!0,model:this.kpiModel,modelAttribute:"threshold_field"},dataTestItsi:"kpi-threshold-field-control-group",label:(0,T.gettext)("Threshold Field"),required:!0,tooltip:(0,T.gettext)("Field in the data that the KPI aggregates and monitors. For pure counts, use _time.")}),this.dataModelModel=this.kpiModel.get("datamodel"),this.dataModelControl=new ie.default({datamodelModel:this.dataModelModel}),this.dataModelFilterView=new re.default({kpiModel:this.kpiModel}),this.metricsSearchControl=null,this.baseSearchSelectItems=[],this.kpiBaseSearchSelectDisabled=!0,this._createSkipKpiValidationControls(),this._createBaseSearchControls(),this.children={},this.children.runDataModelBaseSearchLink=new X.default({dataTestItsi:"run-data-model-base-search-link",icon:"external",isLink:!0,label:(0,T.gettext)("Run Data Model Base Search"),openInNewContext:!0,onClick:this.runBaseSearch.bind(this)}),this.children.noEntitiesForServiceMessage=new Z.default({content:(0,T.gettext)("Selected base search filters by entities. This service does not have entities."),dataTestItsi:"no-entities-in-service-message",isVisible:!1,type:"warning"}),this.children.noBaseSearchPermsMessage=new Z.default({content:(0,T.gettext)("You do not have permission to view base searches."),dataTestItsi:"no-base-search-perms-message",isVisible:!1,type:"warning"}),this.children.noValidBaseSearchMessage=new Z.default({content:_.default.createElement("div",null,(0,T.gettext)("No valid base searches defined.")," ",_.default.createElement(R.default,{"data-test-itsi":"configure-base-search-link",openInNewContext:!0,to:W.uiListerURL},(0,T.gettext)("Configure KPI Base Search"))),dataTestItsi:"no-valid-base-search-message",isVisible:!1,type:"warning"}),this.listenTo(this.dataModelControl,"availablefieldschanged",this._onDataModelFieldsChange),this.listenTo(this.kpiModel,"change:search_type",this.toggleSearchControls),this.listenTo(this.dataModelModel,"change",this._onDataModelChange),this.listenTo(this.dataModelFilterView,"filterchange",this._onDataModelFilterChange),this.listenTo(this.kpiModel,"change:base_search_id",this._onBaseSearchSelect),this.listenTo(this.kpiModel,"change:base_search_metric",this._onMetricSelect),this._firstRender=!0,this.hasError=!1,y.default.View.prototype.initialize.apply(this,arguments)},runBaseSearch:function runBaseSearch(){var i=this.kpiModel.get("base_search");if(i&&(this.kpiModel.get("search_type")!==Y.KPI_SEARCH_TYPES.DATA_MODEL||this.kpiModel.get("datamodel").isValid())){var s=this.kpiModel.get("search_alert_earliest");s===$.ALERT_EARLIEST.CUSTOM&&(s=this.kpiModel.get("search_alert_earliest_custom_val"));var o={q:i,earliest:"-"+s+"m",latest:"now"};(0,V.redirect)((0,U.uiEditURL)(o),!0,null,!0)}},editBaseSearch:function editBaseSearch(){var i=this.kpiModel.get("base_search_id");i&&(0,V.redirect)((0,W.uiEditURL)(i),!0)},getSubTitle:function getSubTitle(){return(0,T.gettext)("Source")},setSearchReturnsResults:function setSearchReturnsResults(){this.kpiModel.get("search_type")===Y.KPI_SEARCH_TYPES.ADHOC&&this.adHocSearchControl?this.adHocSearchControl.error(!1):this.kpiModel.get("search_type")===Y.KPI_SEARCH_TYPES.DATA_MODEL?(this.dataModelControl.dataModelSelect.error(!1),this.dataModelControl.objectSelect.error(!1),this.dataModelControl.fieldSelect.error(!1)):this.kpiModel.get("search_type")===Y.KPI_SEARCH_TYPES.METRIC?this.metricsSelectorView&&this.metricsSelectorView.validate(!0):this.kpiModel.get("search_type")===Y.KPI_SEARCH_TYPES.SHARED_BASE&&(this.baseSearchView&&this.baseSearchView.validate(!0),this.metricsControl&&this.metricsControl.error(!1))},setSearchReturnsNoResults:function setSearchReturnsNoResults(){this.kpiModel.get("search_type")===Y.KPI_SEARCH_TYPES.ADHOC&&this.adHocSearchControl?(this.adHocSearchControl.error(N.NO_RESULTS_ERROR_MESSAGE),this.hasError=!0,this.renderSkipKpiValidationControls()):this.kpiModel.get("search_type")===Y.KPI_SEARCH_TYPES.DATA_MODEL?(this.dataModelControl.dataModelSelect.error(N.NO_RESULTS_ERROR_MESSAGE),this.dataModelControl.objectSelect.error(N.NO_RESULTS_ERROR_MESSAGE),this.dataModelControl.fieldSelect.error(N.NO_RESULTS_ERROR_MESSAGE)):this.kpiModel.get("search_type")===Y.KPI_SEARCH_TYPES.METRIC?this.metricsSelectorView&&this.metricsSelectorView.setSearchReturnsNoResults():(this.kpiModel.get("search_type"),Y.KPI_SEARCH_TYPES.SHARED_BASE)},validate:function validate(i){var s=v.default.Deferred(),o=[],h=!1;if(this.adHocSearchControl.error(!1),this.adHocThresholdControl.error(!1),this.dataModelControl.dataModelSelect.error(!1),this.dataModelControl.objectSelect.error(!1),this.dataModelControl.fieldSelect.error(!1),this.baseSearchView&&this.baseSearchView.validate(!0),this.metricsControl.error(!1),this.metricsSelectorView&&this.metricsSelectorView.validate(!0),this.kpiModel.get("search_type")===Y.KPI_SEARCH_TYPES.ADHOC){if(this.kpiModel.get("base_search")||(this.adHocSearchControl.error(L.NO_EMPTY_SEARCH_STRING_MESSAGE),h=!0),this.kpiModel.get("threshold_field")||(this.adHocThresholdControl.error((0,T.gettext)("Threshold field is required.")),h=!0),h)return s.reject([Y.KPI_VALIDATION_FAILED_MARKER]),s;if(i){var y=this.kpiModel.get("base_search").trim();0!==y.indexOf("search")&&0!==y.indexOf("|")&&(y="search "+y);var _={output_mode:"json",parse_only:!0,q:y};(0,K.parseSearch)(_).then(i=>i.data).then(()=>{s.resolve()}).catch(i=>{var o=(0,P.formatErrorResponse)(i),h=(0,x.sprintf)((0,T.gettext)("Search parser failed: %s. Please check your search syntax and verify that all the Splunk objects used in search have proper permissions."),o.message);this.adHocSearchControl.error(h),s.reject(i)})}return s}if(this.kpiModel.get("search_type")===Y.KPI_SEARCH_TYPES.DATA_MODEL){var S=this.kpiModel.get("datamodel");return S.validate()&&(S.get("datamodel")||(this.dataModelControl.dataModelSelect.error(j.VALIDATION_ERRORS.DATAMODEL),h=!0),S.get("object")||(this.dataModelControl.objectSelect.error(j.VALIDATION_ERRORS.DATAMODEL_OBJECT),h=!0),S.get("field")||(this.dataModelControl.fieldSelect.error(j.VALIDATION_ERRORS.DATAMODEL_FIELD),h=!0)),this.kpiModel.get("datamodel_filter").each(i=>{var s=i.validate();s&&(o.push(s),h=!0),this.dataModelFilterView.validateControls()}),h||o.length>0?h?s.reject([Y.KPI_VALIDATION_FAILED_MARKER]):s.reject(o):s.resolve(),s}return this.kpiModel.get("search_type")===Y.KPI_SEARCH_TYPES.METRIC?(this.kpiModel.get("metric")?(this.kpiModel.get("metric").metric_index||(h=!0),this.kpiModel.get("metric").metric_name||(h=!0)):o.push((0,T.gettext)("Metric field is required.")),h||o.length>0?(h&&(this.metricsSelectorView.validate(),s.reject([Y.KPI_VALIDATION_FAILED_MARKER])),s.reject(o)):s.resolve(),s):(this.kpiModel.get("base_search_id")||(this.baseSearchView&&this.baseSearchView.validate(!1,(0,T.gettext)("Base search field is required.")),h=!0),this.kpiModel.get("base_search_metric")||(this.metricsControl.error((0,T.gettext)("Metric field is required.")),h=!0),this.kpiModel.get("is_service_entity_filter")&&0===this.serviceModel.getNumEntityRules()&&o.push((0,T.gettext)("Cannot filter on entities as this service does not have entities.")),h||o.length>0?h?s.reject([Y.KPI_VALIDATION_FAILED_MARKER]):s.reject(o):(s.resolve(),this._updateKpiModelWithBaseSearchModel()),s)},_updateKpiModelWithBaseSearchModel:function _updateKpiModelWithBaseSearchModel(){var i=this.savedBaseSearchCollection.findWhere({_key:this.kpiModel.get("base_search_id")});if(i){var s=i.get("metrics").findWhere({_key:this.kpiModel.get("base_search_metric")}),o=i.get("search_alert_earliest");[$.ALERT_EARLIEST.MIN_1,$.ALERT_EARLIEST.MIN_5,$.ALERT_EARLIEST.MIN_15,$.ALERT_EARLIEST.HR_24].includes(o)?this.kpiModel.has("search_alert_earliest_custom_val")||this.kpiModel.set("search_alert_earliest",o):(this.kpiModel.set("search_alert_earliest_custom_val",o),this.kpiModel.set("search_alert_earliest",$.ALERT_EARLIEST.CUSTOM)),this.kpiModel.set({metric:i.get("metric"),base_search:i.get("base_search"),alert_period:i.get("alert_period"),is_metric:i.get("is_metric"),is_entity_breakdown:i.get("is_entity_breakdown"),entity_id_fields:i.get("entity_id_fields"),entity_breakdown_id_fields:i.get("entity_breakdown_id_fields"),is_service_entity_filter:i.get("is_service_entity_filter"),alert_lag:i.get("alert_lag"),threshold_field:s.get("threshold_field"),unit:s.get("unit"),entity_statop:s.get("entity_statop"),aggregate_statop:s.get("aggregate_statop"),fill_gaps:s.get("fill_gaps"),gap_custom_alert_value:s.get("gap_custom_alert_value"),gap_severity:s.get("gap_severity"),gap_severity_color:s.get("gap_severity_color"),gap_severity_color_light:s.get("gap_severity_color_light"),gap_severity_value:s.get("gap_severity_value")})}},toggleSearchControls:function toggleSearchControls(i){this.kpiModel&&this.kpiModel.changed&&this.kpiModel.changed.search_type&&this.kpiModel.changed.search_type===Y.KPI_SEARCH_TYPES.ADHOC&&this.kpiModel&&"function"==typeof this.kpiModel.previousAttributes&&this.kpiModel.previousAttributes().search_type&&this.kpiModel.previousAttributes().search_type===Y.KPI_SEARCH_TYPES.SHARED_BASE&&(this.kpiModel.set("base_search",""),this.kpiModel.set("threshold_field",""),this.kpiModel.set("skip_kpi_validation",!1),this.hasError=!1),this.hasError&&this.kpiModel&&this.kpiModel.changed&&this.kpiModel.changed.search_type&&this.kpiModel.changed.search_type===Y.KPI_SEARCH_TYPES.ADHOC&&this.kpiModel&&"function"==typeof this.kpiModel.previousAttributes&&this.kpiModel.previousAttributes().search_type&&this.kpiModel.previousAttributes().search_type!==Y.KPI_SEARCH_TYPES.SHARED_BASE&&this.$(".skip-kpi-validation-control-container").show(),this.kpiModel.get("search_type")===Y.KPI_SEARCH_TYPES.ADHOC?(this.dataModelControl.$el.hide(),this.dataModelFilterView.$el.hide(),this.$(".gather-step-datamodel-helper").hide(),this.$(".kpi-base-search-selector-container").hide(),this.$(".kpi-metrics-control-container").hide(),this.children.noBaseSearchPermsMessage.hide(),this.children.noValidBaseSearchMessage.hide(),this.children.noEntitiesForServiceMessage.hide(),this.adHocSearchControl.$el.show(),this.adHocThresholdControl.$el.show(),this.metricsSearchControl.hide()):this.kpiModel.get("search_type")===Y.KPI_SEARCH_TYPES.METRIC?(this.dataModelControl.$el.hide(),this.dataModelFilterView.$el.hide(),this.$(".gather-step-datamodel-helper").hide(),this.adHocSearchControl.$el.hide(),this.adHocThresholdControl.$el.hide(),this.$(".kpi-base-search-selector-container").hide(),this.$(".kpi-metrics-control-container").hide(),this.children.noBaseSearchPermsMessage.hide(),this.children.noValidBaseSearchMessage.hide(),this.children.noEntitiesForServiceMessage.hide(),this.metricsSearchControl.show(),this.$(".skip-kpi-validation-control-container").hide()):this.kpiModel.get("search_type")===Y.KPI_SEARCH_TYPES.DATA_MODEL?(this.dataModelControl.$el.show(),this.dataModelFilterView.$el.show(),this.$(".gather-step-datamodel-helper").show(),this.adHocSearchControl.$el.hide(),this.adHocThresholdControl.$el.hide(),this.$(".kpi-base-search-selector-container").hide(),this.$(".kpi-metrics-control-container").hide(),this.children.noBaseSearchPermsMessage.hide(),this.children.noValidBaseSearchMessage.hide(),this.children.noEntitiesForServiceMessage.hide(),this.metricsSearchControl.hide(),this.$(".skip-kpi-validation-control-container").hide()):this.kpiModel.get("search_type")===Y.KPI_SEARCH_TYPES.SHARED_BASE&&(this.dataModelControl.$el.hide(),this.dataModelFilterView.$el.hide(),this.$(".gather-step-datamodel-helper").hide(),this.adHocSearchControl.$el.hide(),this.adHocThresholdControl.$el.hide(),this.children.noEntitiesForServiceMessage.hide(),this.$(".skip-kpi-validation-control-container").hide(),this._checkForNoEntitiesInService(),0===this.savedBaseSearchCollection.length||0===this.filteredSavedBaseSearchCollection.length?(this.children.noBaseSearchPermsMessage.show(),this.children.noValidBaseSearchMessage.show(),this.kpiBaseSearchSelectDisabled=!0,this.$(".kpi-base-search-selector-container").hide()):(this.kpiBaseSearchSelectDisabled=!1,this.$(".kpi-base-search-selector-container").show(),this.$(".kpi-metrics-control-container").show()),i||this._populateBaseSearchControls(),this.metricsSearchControl.hide())},removeMetricsSelectorView:function removeMetricsSelectorView(){var i=this.$(".kpi-metric-selector-container").get(0);i&&S.default.unmountComponentAtNode(i)},_createMetricsSelectorView:function _createMetricsSelectorView(){var i=this.$(".kpi-metric-selector-container");return this.removeMetricsSelectorView(),S.default.render(_.default.createElement(ne.default,null,_.default.createElement(ae.default,{model:this.kpiModel,metricsUtilsInstance:this.metricsUtilsInstance,ref:i=>this.metricsSelectorView=i})),i.get(0)),i},removeKPIBaseSearchSelectorView:function removeKPIBaseSearchSelectorView(){this.$(".kpi-base-search-selector-container").length&&S.default.unmountComponentAtNode(this.$(".kpi-base-search-selector-container").get(0))},onKpiBaseSearchChange:function onKpiBaseSearchChange(i){this.kpiModel.set({base_search_id:i})},_createKpiBaseSearchSelectorView:function _createKpiBaseSearchSelectorView(i){return this.removeKPIBaseSearchSelectorView(),S.default.render(_.default.createElement(ne.default,null,_.default.createElement(ee.default,{controlGroupDataTestItsi:"kpi-modal-base-search-control-group",disabled:this.kpiBaseSearchSelectDisabled,help:_.default.createElement(R.default,{"data-test-itsi":"service-kpi-edit-base-search-link",onClick:this.editBaseSearch.bind(this),openInNewContext:!0},(0,T.gettext)("Edit Base Search")),initialValue:this.kpiModel.get("base_search_id"),label:(0,T.gettext)("Base Search"),onChange:this.onKpiBaseSearchChange.bind(this),options:i,placeholder:(0,T.gettext)("Select a Base Search"),ref:i=>this.baseSearchView=i,selectDataTestItsi:"kpi-modal-base-search-select",tooltip:(0,T.gettext)("Base search to associate with this KPI.")})),this.$(".kpi-base-search-selector-container").get(0)),this.$(".kpi-base-search-selector-container")},_checkForNoEntitiesInService:function _checkForNoEntitiesInService(){var i=this.savedBaseSearchCollection.findWhere({_key:this.kpiModel.get("base_search_id")});i&&(0===this.serviceModel.getNumEntityRules()&&i.get("is_service_entity_filter")?this.children.noEntitiesForServiceMessage.show():this.children.noEntitiesForServiceMessage.hide())},_onMetricSelect:function _onMetricSelect(){this.kpiModel.get("base_search_metric")?this._updateKpiModelWithBaseSearchModel():this.kpiModel.unset("threshold_field",{silent:!0})},_onDataModelFieldsChange:function _onDataModelFieldsChange(i){this.dataModelFilterView.updateFilterFields(i),this.dataModelFilterView.render()},_onDataModelChange:function _onDataModelChange(){this.dataModelModel.isValid()&&this.kpiModel.set("threshold_field",this.dataModelModel.get("owner_field"))},_onDataModelFilterChange:function _onDataModelFilterChange(i,s){this.kpiModel.unset("datamodel_filter",{silent:!0}),this.kpiModel.set("datamodel_filter",s)},_createSkipKpiValidationControls:function _createSkipKpiValidationControls(){this.skipKpiValidationText=new te.default({controlType:"Label",controlOptions:{dataTestItsi:"skip-kpi-validation-text",defaultValue:(0,T.gettext)("Do you want to skip the KPI validation check?")},dataTestItsi:"skip-kpi-validation-label-control-group",label:(0,T.gettext)("KPI validation"),tooltip:(0,T.gettext)("Save searches with no data in the last 15 minutes.")}),this.skipKpiValidationCheckbox=new te.default({controlType:"SyntheticCheckbox",controlOptions:{dataTestItsi:"skip-kpi-validation-checkbox",label:(0,T.gettext)("Skip KPI validation"),listenForModelChanges:!0,style:{marginLeft:120},model:this.kpiModel,modelAttribute:"skip_kpi_validation"},dataTestItsi:"skip-kpi-validation-checkbox-control-group"})},_onBaseSearchSelect:function _onBaseSearchSelect(){this.kpiModel.unset("base_search_metric"),this._populateMetricsControl(),this._checkForNoEntitiesInService()},_createBaseSearchControls:function _createBaseSearchControls(){this.metricsControl=new te.default({controlType:"SyntheticSelect",controlOptions:{dataTestItsi:"base-search-metric-select",items:[{value:"dummy",label:"Dummy"}],prompt:(0,T.gettext)("Select a metric"),model:this.kpiModel,modelAttribute:"base_search_metric",style:{width:"100%"},typeAheadFilter:!0},dataTestItsi:"kpi-base-search-metric-control-group",label:(0,T.gettext)("Metric"),tooltip:(0,T.gettext)("Metric to associate with this KPI from the selected base search.")})},_populateBaseSearchControls:function _populateBaseSearchControls(){this.filteredSavedBaseSearchCollection=this.savedBaseSearchCollection.filter((function(i){return i.get("metrics").length>0})),this.baseSearchSelectItems=this.filteredSavedBaseSearchCollection.map((function(i){return{label:i.get("title"),value:i.get("_key")}})),this.kpiBaseSearchSelectDisabled=!1,this._createKpiBaseSearchSelectorView(this.baseSearchSelectItems),this._checkForNoEntitiesInService(),this.kpiModel.get("base_search_id")?this._populateMetricsControl():(this.metricsControl.disable(),this.renderMetricsControl())},_populateMetricsControl:function _populateMetricsControl(){this.metricsControl.enable(),this.renderMetricsControl();var i=[];this.kpiModel.get("base_search_id")&&(i=this.savedBaseSearchCollection.findWhere({_key:this.kpiModel.get("base_search_id")}).get("metrics").map((function(i){return{value:i.id,label:i.get("title")}})));this.metricsControl.setItems(i),this.renderMetricsControl()},renderSkipKpiValidationControls:function renderSkipKpiValidationControls(){var i=this.skipKpiValidationText.render().$el,s=this.skipKpiValidationCheckbox.render().$el;this.$(".skip-kpi-validation-control-container").append(i),this.$(".skip-kpi-validation-control-container").append(s),this.$(".skip-kpi-validation-control-container").show()},renderMetricsControl:function renderMetricsControl(){this.$(".kpi-metrics-control-container").append(this.metricsControl.render().$el)},render:function render(){if(this.savedBaseSearchCollection.fetch().done(function(){this.renderControls(),this._populateBaseSearchControls()}.bind(this)).fail(function(i){403===i.status&&this.renderControls(!0)}.bind(this)),this._firstRender){var i=new Z.default({content:(0,T.gettext)("Loading source controls..."),dataTestItsi:"gather-step-view-loading-message",type:"info"});this.$el.append(i.render().$el)}return this},renderControls:function renderControls(i){if(this._firstRender){this.$el.html(""),this.$el.append('<div class="gathering-controls form-horizontal"></div>');var s=[{label:(0,T.gettext)("Data Model"),value:Y.KPI_SEARCH_TYPES.DATA_MODEL},{label:(0,T.gettext)("Metrics Search"),value:Y.KPI_SEARCH_TYPES.METRIC},{label:(0,T.gettext)("Ad hoc Search"),value:Y.KPI_SEARCH_TYPES.ADHOC},{label:(0,T.gettext)("Base Search"),value:Y.KPI_SEARCH_TYPES.SHARED_BASE}];this.isAdHocControl=new te.default({controlType:"SyntheticRadio",controlOptions:{dataTestItsi:"kpi-search-type-radio",items:i?s.splice(0,3):s,model:this.kpiModel,modelAttribute:"search_type"},dataTestItsi:"kpi-search-type-control-group",label:(0,T.gettext)("KPI Source"),tooltip:(0,T.gettext)('Select "Data Model" to base the KPI search on a Splunk data model, "Ad hoc Search" to specify the search string to use, or "Base Search" to select a pre-configured KPI base search.')}),this.$(".gathering-controls").append(this.isAdHocControl.render().$el),this.$(".gathering-controls").append(this.adHocSearchControl.render().$el),this.$(".gathering-controls").append(this.adHocThresholdControl.render().$el),this.$(".gathering-controls").append('<div class="kpi-base-search-selector-container" style="display:none"></div>'),this.$(".gathering-controls").append('<div class="kpi-metrics-control-container"></div>'),this.renderMetricsControl(),this.$(".gathering-controls").append('<div class="kpi-metric-selector-container"></div>'),i?this.$(".gathering-controls").append(this.children.noBaseSearchPermsMessage.render().$el):this.$(".gathering-controls").append(this.children.noValidBaseSearchMessage.render().$el),this.$(".gathering-controls").append(this.children.noEntitiesForServiceMessage.render().$el),this.$el.append(this.dataModelControl.render().$el),this.$el.append(this.dataModelFilterView.render().$el),this.$el.append('<div class="gather-step-datamodel-helper"></div>'),this.$el.find(".gather-step-datamodel-helper").html(this.children.runDataModelBaseSearchLink.render().$el),this.$(".gathering-controls").append('<div class="skip-kpi-validation-control-container"></div>'),this._firstRender=!1}this.metricsSearchControl=this._createMetricsSelectorView(),this._createKpiBaseSearchSelectorView(this.baseSearchSelectItems),this.toggleSearchControls(i)}});s.default=le,i.exports=s.default},3032:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y=h(o(17)),_=h(o(18)),S=h(o(30)),T=h(o(21)),x=h(o(22)),R=h(o(20)),P=h(o(11)),L=h(o(9)),N=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),V=h(o(2)),j=h(o(3)),W=h(o(56)),K=h(o(82));function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,R.default)(i);if(s){var v=(0,R.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,x.default)(this,o)}}o(29);var U=(0,j.default)(K.default)(v||(v=(0,L.default)(["\n\tdisplay: inline-block;\n\tvertical-align: bottom;\n\twidth: 100%;\n"]))),Y=function(i){(0,T.default)(ControlGroupSelectWithTypeAhead,i);var s=_createSuper(ControlGroupSelectWithTypeAhead);function ControlGroupSelectWithTypeAhead(){var i;(0,y.default)(this,ControlGroupSelectWithTypeAhead);for(var o=arguments.length,h=new Array(o),v=0;v<o;v++)h[v]=arguments[v];return i=s.call(this,...h),(0,P.default)((0,S.default)(i),"onChange",(s,o)=>{var{value:h}=o;i.setState({value:h},()=>{i.props.onChange(h)})}),(0,P.default)((0,S.default)(i),"setError",s=>{i.setState({error:s})}),(0,P.default)((0,S.default)(i),"validate",(s,o)=>{if(s)i.setState({error:!1});else{var{value:h}=i.state,v=!1;h||(v=o),i.setState({error:v})}}),(0,P.default)((0,S.default)(i),"getOptions",()=>{var{options:s,selectDataTestItsi:o}=i.props;return s.map(i=>N.default.createElement(K.default.Option,{"data-test-itsi":"".concat(o,"-option"),key:i.value,label:i.label,value:i.value}))}),i.state={error:!1,value:i.props.initialValue},i}return(0,_.default)(ControlGroupSelectWithTypeAhead,[{key:"render",value:function render(){var{controlGroupDataTestItsi:i,disabled:s,help:o,label:h,placeholder:v,selectDataTestItsi:y,tooltip:_}=this.props,{error:S,value:T}=this.state;return N.default.createElement(W.default,{"data-test-itsi":i,error:S,help:o,label:h,tooltip:_},N.default.createElement(U,{"data-test-itsi":y,error:!!S,filter:!0,disabled:s,placeholder:v,value:T,onChange:this.onChange},this.getOptions()))}}]),ControlGroupSelectWithTypeAhead}(N.Component);(0,P.default)(Y,"propTypes",{controlGroupDataTestItsi:V.default.string,disabled:V.default.bool,help:V.default.object,initialValue:V.default.string.isRequired,label:V.default.string.isRequired,placeholder:V.default.string,onChange:V.default.func.isRequired,options:V.default.arrayOf(V.default.shape({label:V.default.string,value:V.default.string})).isRequired,selectDataTestItsi:V.default.string,tooltip:V.default.string}),(0,P.default)(Y,"defaultProps",{controlGroupDataTestItsi:"control-group-select-with-type-ahead-label",disabled:!1,help:null,placeholder:null,selectDataTestItsi:"select-with-type-ahead",tooltip:null});var $=Y;s.default=$,i.exports=s.default},3033:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y=h(o(9)),_=h(o(15)),S=o(49),T=h(o(53)),x=h(o(184)),R=h(o(198)),P=h(o(0)),L=h(o(36)),N=h(o(3)),V=o(5),j=h(o(56)),W=h(o(43)),K=h(o(360)),U=h(o(809)),Y=h(o(52)),$=h(o(79)),X=h(o(2747)),Z=h(o(90));o(3034);var ee=(0,N.default)(j.default)(v||(v=(0,y.default)(["\n\tmargin-bottom: 0;\n"]))),te=_.default.View.extend({tagName:"div",className:"kpi-filter-item",initialize:function initialize(i){i&&i.filterModel?this.model=i.filterModel:this.model=new X.default,this.fieldData=[],this.invalidFieldError="",this._operatorSelector=new Z.default({controlType:"SyntheticSelect",controlOptions:{dataTestItsi:"kpi-filter-operator-select",inline:!0,items:[{value:"=",label:(0,V.gettext)("Equals")},{value:"<",label:(0,V.gettext)("Less than")},{value:">",label:(0,V.gettext)("Greater than")}],label:"",model:this.model,modelAttribute:"_operator"},hasControlGroup:!1,inline:!0}),this._valueControl=new Z.default({controlType:"Text",controlOptions:{dataTestItsi:"datamodel-kpi-filter-value-text",modelAttribute:"_value",model:this.model,placeholder:(0,V.gettext)("required"),style:{marginLeft:10}},hasControlGroup:!1,inline:!0}),this.children={},this.children.deleteButton=new $.default({appearance:"pill",dataTestItsi:"kpi-filter-delete-button",icon:"clear",onClick:this._deleteFilter.bind(this),screenReaderText:(0,V.gettext)("Delete filter"),style:{marginLeft:10}}),_.default.View.prototype.initialize.apply(this,arguments)},renderSelectControl:function renderSelectControl(){0===this.$(".select-field-control").length&&this.$el.append('<div class="select-field-control"></div>'),L.default.unmountComponentAtNode(this.$(".select-field-control").get(0)),L.default.render(P.default.createElement(Y.default,null,P.default.createElement(U.default,{dataTestItsi:"data-model-field-select",filter:!0,error:!!this.invalidFieldError,options:this.fieldData,placeholder:(0,V.gettext)("Select a data model field"),updateValueInParent:i=>{this.model.set("_field",i)},value:this.model.get("_field"),valueType:typeof this.model.get("_field")})),this.$(".select-field-control").get(0))},showErrorsInControlsIfAny:function showErrorsInControlsIfAny(){this.model.get("_field")?(this.invalidFieldError="",this.renderSelectControl()):(this.invalidFieldError=(0,V.gettext)("Must select a data model field."),this.renderSelectControl()),this.model.get("_value")?this._valueControl.error(!1):this._valueControl.error((0,V.gettext)("Must enter a filter value."))},render:function render(){return 0===this.$(".select-field-control").length&&this.$el.append('<div class="select-field-control"></div>'),this.renderSelectControl(),this.$el.append(this._operatorSelector.render().$el),this.$el.append(this._valueControl.render().$el),this.$el.append(this.children.deleteButton.render().$el),this},remove:function remove(){return this._operatorSelector.remove(),this._valueControl.remove(),_.default.View.prototype.remove.apply(this,arguments)},updateFieldData:function updateFieldData(i){this.fieldData=i,this.renderSelectControl()},getFieldData:function getFieldData(){return this.fieldData},selectField:function selectField(i){this.model.set("_field",i),this.renderSelectControl()},selectOperator:function selectOperator(i){this._operatorSelector.setValue(i)},setValue:function setValue(i){this._valueControl.setValue(i)},_deleteFilter:function _deleteFilter(){this.model.destroy()}}),ie=_.default.View.extend({tagName:"div",className:"kpi-filter-view",initialize:function initialize(i){if(!(i=i||{}).kpiModel)throw"Must provide kpiModel in options";this.fieldData=[],i.fieldData&&(this.fieldData=i.fieldData),this.kpiModel=i.kpiModel,this.collection=this.kpiModel.get("datamodel_filter"),this.collection.on("change",this._onChangeOfAttribute,this),this.collection.on("remove",this._onRemoveModel,this),this.filterItems=[],this.children={}},validate:function validate(){return!(0,x.default)(this.collection.models,(function(i){return i.validate()}))},renderControlGroup:function renderControlGroup(){this.$el.find(".kpi-filters-control-group-container").length>0&&(L.default.unmountComponentAtNode(this.$el.find(".kpi-filters-control-group-container").get(0)),L.default.render(P.default.createElement(Y.default,null,P.default.createElement(ee,{"data-test-itsi":"data-model-kpi-filters-control-group",label:(0,V.gettext)("Filters"),tooltip:(0,V.gettext)("Apply extra filters to selected data model.")},P.default.createElement(P.default.Fragment,null,P.default.createElement("div",{className:"filter-outer-container"},P.default.createElement("div",{className:"filter-container"}),P.default.createElement(W.default,{"data-test-itsi":"kpi-add-filter-link",onClick:this._addFilter.bind(this)},P.default.createElement(K.default,{size:.9,screenReaderText:(0,V.gettext)("Remove filter")})," ",(0,V.gettext)("Add filter")))))),this.$el.find(".kpi-filters-control-group-container").get(0)))},validateControls:function validateControls(){this.filterItems.forEach(i=>i.showErrorsInControlsIfAny())},render:function render(){return this._removeItems(),this.$el.html('<div class="kpi-filters-control-group-container"></div>'),this.renderControlGroup(),this.collection.each(function(i){this._addFilterImpl(i)}.bind(this)),this.delegateEvents(),this},_removeItems:function _removeItems(){for(var i=0;i<this.filterItems.length;++i)this.filterItems[i].remove();this.filterItems=[]},remove:function remove(){return this._removeItems(),_.default.View.prototype.remove.apply(this,arguments)},_onChangeOfAttribute:function _onChangeOfAttribute(){this.validate()&&this.trigger("filterchange",this,this.collection)},_onRemoveModel:function _onRemoveModel(i){var s=(0,S.select)(this.filterItems,(function(s){return s.model===i}))[0];this.filterItems=(0,R.default)(this.filterItems,s),s.$el.remove(),this.validate()&&this.trigger("filterchange",this,this.collection)},updateFilterFields:function updateFilterFields(i){this.fieldData=(0,T.default)(i,(function(i){return{value:i.owner_field,label:i.label}})),this._updateFieldData()},_updateFieldData:function _updateFieldData(){for(var i=0;i<this.filterItems.length;++i){this.filterItems[i].updateFieldData(this.fieldData)}},_addFilterImpl:function _addFilterImpl(i){var s=new te({filterModel:i});s.updateFieldData(this.fieldData),this.filterItems.push(s),this.$(".filter-container").css("display","block").append(s.render().$el)},_addFilter:function _addFilter(){var i=new X.default;this.collection.add(i),this._addFilterImpl(i)},getCollection:function getCollection(){return this.collection},getFilterViewItem:function getFilterViewItem(i){for(var s=0;s<this.filterItems.length;++s)if(this.filterItems[s].model.id===i.id)return this.filterItems[s];return null}});s.default=ie,i.exports=s.default},3034:function(i,s,o){var h=o(3035);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},3035:function(i,s,o){(s=o(37)(!1)).push([i.i,".filter-outer-container {\n\tdisplay: inline-block;\n\tline-height: 30px;\n\tpadding: 0;\n\tflex-grow: 1;\n}\n.filter-container {\n\tdisplay: none;\n}\n.select-field-control {\n\tdisplay: inline-block;\n\tmargin-right: 10px;\n}\n.kpi-filter-item {\n\tmargin-bottom: 10px;\n\twhite-space: nowrap;\n}\n.kpi-filter-item .control-dispatcher-wrapper-inline:last-of-type {\n\tmargin-left: 10px;\n}",""]),i.exports=s},3036:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(28)),y=h(o(15)),_=h(o(0)),S=o(5),T=h(o(43)),x=o(25),R=o(68),P=o(58),L=o(142),N=o(76),V=h(o(90)),j=h(o(114));o(1645);var W=y.default.View.extend({initialize:function initialize(i){this.kpiModel=i.kpiModel,this.serviceModel=i.serviceModel;var s=R.LABEL_WIDTHS.ExtraLong;this.kpiUnitControl=new V.default({controlType:"Text",controlOptions:{dataTestItsi:"kpi-unit-input",model:this.kpiModel,modelAttribute:"unit",placeholder:(0,S.gettext)("optional")},dataTestItsi:"kpi-unit-control-group",label:(0,S.gettext)("Unit"),labelWidth:s,help:(0,S.gettext)('Specify the unit of measurement to display in KPI visualizations. (For example "GB," "Mbps," "secs", etc.).')}),this.alertLagControl=new V.default({controlType:"Number",controlOptions:{dataTestItsi:"kpi-alert-lag-number-control",max:1800,min:0,model:this.kpiModel,modelAttribute:"alert_lag",placeholder:(0,S.gettext)("required"),style:{width:"100%"}},dataTestItsi:"kpi-alert-lag-control-group",help:_.default.createElement(T.default,{"data-test-itsi":"kpi-determine-recommended-lag-link",openInNewContext:!0,onClick:this.runIndexLagSearch.bind(this)},(0,S.gettext)("Determine Recommended Lag")),label:(0,S.gettext)("Monitoring Lag (in seconds)"),labelWidth:s,tooltip:(0,S.gettext)("Pushes KPI evaluation back by a number of seconds. Should be set to data's index lag.")}),this.children={},this.children.baseSearchAutoFillMessage=new j.default({content:(0,S.gettext)("Fields are populated from the selected base search."),dataTestItsi:"base-search-auto-fill-unit-message",type:"warning"}),y.default.View.prototype.initialize.apply(this,arguments)},getSubTitle:function getSubTitle(){return(0,S.gettext)("Optional Setup - Unit and Monitoring Lag")},runIndexLagSearch:function runIndexLagSearch(){var i=this.kpiModel.get("kpi_base_search");if(i){var s={q:i+=' | eval indexing_lag=floor(_indextime - _time) | stats perc98(indexing_lag) AS "Recommended Monitoring Lag" max(indexing_lag) AS "Maximum Indexing Lag" avg(indexing_lag) AS "Average Indexing Lag" min(indexing_lag) AS "Minimum Indexing Lag"',earliest:"-90m",latest:"-30m"};(0,P.redirect)((0,L.uiEditURL)(s),!0,null,!0)}},render:function render(){this.$el.html(""),this.$el.append('<div class="unit-controls form-horizontal"></div><div class="advanced-controls form-horizontal"></div>'),this.$(".unit-controls").append(this.kpiUnitControl.render().el),this.$(".advanced-controls").append(this.alertLagControl.render().el),"shared_base"===this.kpiModel.get("search_type")?(this.$el.prepend(this.children.baseSearchAutoFillMessage.render().$el),this.kpiUnitControl.disable(),this.alertLagControl.disable()):(this.kpiUnitControl.enable(),this.alertLagControl.enable());return(0,v.default)("input",this.kpiUnitControl.$el).attr("maxlength",4),this},validate:function validate(){var i=!1;this.alertLagControl.error(!1);var s=v.default.Deferred(),o=this.kpiModel.get("alert_lag");return(!x.isAllNumericRE.test(o)||parseInt(o,10)>1800)&&(i=!0,this.alertLagControl.error((0,S.gettext)("Must be a positive integer less than 1800 seconds."))),i?s.reject([N.KPI_VALIDATION_FAILED_MARKER]):s.resolve(),s}});s.default=W,i.exports=s.default},3037:function(i,s,o){(s=o(37)(!1)).push([i.i,".backfill-status-label {\n\twidth: 100px;\n\tdisplay: inline-block;\n\ttext-align: right;\n}\n.backfill-status-text {\n\tdisplay: inline-block;\n\tmargin-left: 20px;\n}",""]),i.exports=s},3038:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(28)),y=h(o(15)),_=o(5),S=h(o(90)),T=h(o(1323)),x=y.default.View.extend({initialize:function initialize(i){this.kpiModel=i.kpiModel,this.serviceModel=i.serviceModel,this.aggregateThresholdModel=i.aggregateThresholdModel,this.entityThresholdModel=i.entityThresholdModel,this._configSettingsModel=new y.default.Model({threshold_config_is_aggregate:!0}),y.default.View.prototype.initialize.apply(this,arguments)},getSubTitle:function getSubTitle(){return(0,_.gettext)("Thresholds")},render:function render(){return this.thresholdView&&this.thresholdView.remove(),this.thresholdView=new T.default({kpiModel:this.kpiModel,service:this.serviceModel,aggregateThresholdModel:this.aggregateThresholdModel,entityThresholdModel:this.entityThresholdModel,configSettingsModel:this._configSettingsModel}),this.aggregateEntityConfigureControl&&this.aggregateEntityConfigureControl.remove(),this.aggregateEntityConfigureControl=new S.default({controlType:"SyntheticRadio",controlOptions:{dataTestItsi:"service-threshold-config-radio",items:[{value:!0,label:(0,_.gettext)("Aggregate Thresholds")},{value:!1,label:(0,_.gettext)("Per-Entity Thresholds")}],model:this._configSettingsModel,modelAttribute:"threshold_config_is_aggregate"},hasControlGroup:!1}),this.$el.html(""),this.$el.append(this.aggregateEntityConfigureControl.render().$el),this._toggleAggregateEntitySelector(),this.$el.append(this.thresholdView.render().$el),this.thresholdView&&this.thresholdView.aggregateSettings&&this.thresholdView.aggregateSettings.thresholdPreviewView&&this.thresholdView.aggregateSettings.thresholdPreviewView.children&&this.thresholdView.aggregateSettings.thresholdPreviewView.children&&this.thresholdView.aggregateSettings.thresholdPreviewView.children.optionsLink&&this.thresholdView.aggregateSettings.thresholdPreviewView.children.optionsLink.hide(),this},_toggleAggregateEntitySelector:function _toggleAggregateEntitySelector(){this.kpiModel.get("is_entity_breakdown")?this.aggregateEntityConfigureControl.$el.show():(this._configSettingsModel.set("threshold_config_is_aggregate",!0),this.aggregateEntityConfigureControl.$el.hide())},remove:function remove(){return this.thresholdView&&this.thresholdView.remove(),y.default.View.prototype.remove.apply(this,arguments)},validate:function validate(){return v.default.Deferred().resolve()}});s.default=x,i.exports=s.default},3039:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(28)),y=h(o(15)),_=h(o(36)),S=h(o(309)),T=o(5),x=o(25),R=o(185),P=o(137),L=h(o(114)),N=h(o(3040));o(1645);var V=y.default.View.extend({initialize:function initialize(i){this.kpiModel=i.kpiModel,this.serviceModel=i.serviceModel,this.backfillControl=null,this.serviceKpiBackfillMapping=i.serviceKpiBackfillMapping,y.default.View.prototype.initialize.apply(this,arguments)},getSubTitle:function getSubTitle(){return(0,T.gettext)("Optional Setup - Backfill")},removeChildReactViews:function removeChildReactViews(){var i=this.$(".backfill-enable-disable-control").get(0);i&&_.default.unmountComponentAtNode(i);var s=this.$(".kpi-backfill-status-control").get(0);s&&_.default.unmountComponentAtNode(s)},render:function render(){this.$el.html(""),this.$el.append('<div class="unit-controls form-horizontal"></div><div class="advanced-controls form-horizontal"></div>');var i=this.kpiModel.get("search_alert_earliest");if(i===P.ALERT_EARLIEST.CUSTOM&&(i=this.kpiModel.get("search_alert_earliest_custom_val")),Number(i)>15){this.kpiModel.set("backfill_enabled",!1);var s=new L.default({content:(0,T.gettext)("Calculation window too large to backfill KPI."),dataTestItsi:"calculation-window-too-large-message",type:"warning"});this.$(".advanced-controls").append(s.render().$el)}else this.backfillControl instanceof N.default&&this.backfillControl.remove(),this.backfillControl=new N.default({kpiModel:this.kpiModel,serviceModel:this.serviceModel,serviceKpiBackfillMapping:this.serviceKpiBackfillMapping}),this.$(".advanced-controls").append(this.backfillControl.render().$el);return this},validate:function validate(){var i=[],s=v.default.Deferred(),o=this.kpiModel.get("backfill_enabled");return(0,S.default)(o)&&i.push((0,T.gettext)("Invalid backfill settings")),this.kpiModel.get("backfill_earliest_time")===R.BACKFILL_TIME_PERIOD_EARLIEST_INVALID_TIME?i.push((0,T.gettext)("Backfill period must have an earliest time before the current date.")):!this.kpiModel._checkSummarizedDataCache||(0,x.isUndefinedOrNull)(this.kpiModel._checkSummarizedDataCache.backfillNeeded)||this.kpiModel._checkSummarizedDataCache.backfillNeeded||i.push(this.kpiModel._checkSummarizedDataCache.backfillNeededErrorMessage),i.length>0?s.reject(i):s.resolve(),s}});s.default=V,i.exports=s.default},3040:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=o(49),y=h(o(28)),_=h(o(15)),S=h(o(115)),T=h(o(0)),x=h(o(36)),R=o(5),P=o(16),L=o(409),N=o(77),V=o(185),j=h(o(114)),W=h(o(52)),K=h(o(1640)),U=h(o(1641)),Y=h(o(689));o(3041);var $=(0,v.template)('<div class="backfill-status-label" data-test-itsi="backfill-status-label"><%- vars.gettext("Backfill Status") %></div><div class="backfill-status-text" data-test-itsi="backfill-status-text"><%- vars.status %></div>',null,{variable:"vars"}),X=_.default.View.extend({className:"form-horizontal kpi-backfill-control-view",initialize:function initialize(i){if(!i.kpiModel)throw"Must provide kpiModel";if(this.kpiModel=i.kpiModel,!i.serviceModel)throw"Must provide serviceModel";this.serviceModel=i.serviceModel,this.serviceKpiBackfillMapping=i.serviceKpiBackfillMapping,this.listenTo(this.kpiModel,"change:backfill_status",this._renderTrainingStatus),_.default.View.prototype.initialize.apply(this,arguments)},render:function render(){if(this._renderedStatus)"controls"===this._renderedStatus?this._renderControls():"backfillNotNeeded"===this._renderedStatus&&this._renderBackfillNotNeeded();else{var i=new j.default({content:(0,R.gettext)("Loading backfill controls..."),dataTestItsi:"backfill-control-view-loading-message",type:"info"});this.$el.html('<div class="backfill-controls"></div><div class="backfill-status"></div>'),this.$el.find(".backfill-controls").html(i.render().$el),this.checkIsKPICreateMode()?this._renderControls():this._getKpiEarliestTime()}return this},remove:function remove(){return this.earliestTimeSearchXhr&&(0,S.default)(this.earliestTimeSearchXhr.abort)&&this.earliestTimeSearchXhr.abort(),_.default.View.prototype.remove.apply(this,arguments)},_getKpiEarliestTime:function _getKpiEarliestTime(){this.kpiModel.earliestTimeSearchPromise.then(i=>{i?this._checkBackfillProgress():this._renderBackfillStatusFailure((0,R.gettext)("Error retrieving the KPI earliest time. Check logs for details."))})},checkIsKPICreateMode:function checkIsKPICreateMode(){return Object.prototype.hasOwnProperty.call(this.kpiModel._watchedAttrs.original,"base_search")&&""===this.kpiModel._watchedAttrs.original.base_search},_checkBackfillProgress:function _checkBackfillProgress(){var i=this.kpiModel.get("_key");Y.default.getBackfillDataForKpi(i).done(function(s,o){if(s)this._renderBackfillStatus(o);else if(this.serviceKpiBackfillMapping[i]){var h=(0,L.createRangeLabel)(this.kpiModel.get("backfill_earliest_time"),"now").toLowerCase(),v=(0,P.sprintf)((0,R.gettext)("Backfill has been configured for %(timeLabel)s of data."),{timeLabel:h});this._renderBackfillIsConfigured(v)}else this._renderControls()}.bind(this))},_renderBackfillStatus:function _renderBackfillStatus(i){this.$(".backfill-controls").hide();var s=this.kpiModel.get("backfill_earliest_time");i=Y.default.renderBackfillStatus(i,s);var o=$({gettext:R.gettext,status:i},{variable:"vars"});this.$(".backfill-status").html(o).show(),this._renderedStatus="inprogress"},_renderBackfillNotNeeded:function _renderBackfillNotNeeded(){this.$(".backfill-controls").hide(),this.$(".backfill-status").text(V.BACKFILL_STATUSES.NOT_AVAILABLE).show(),this._renderedStatus="backfillNotNeeded"},_renderBackfillStatusFailure:function _renderBackfillStatusFailure(i){this.$(".backfill-controls").hide(),this.$(".backfill-status").text(i).show(),this._renderedStatus="backfillError"},_renderBackfillIsConfigured:function _renderBackfillIsConfigured(i){this.$(".backfill-controls").hide();var s=$({gettext:R.gettext,status:i},{variable:"vars"});this.$(".backfill-status").html(s).show(),this._renderedStatus="configured"},onEnableDisableBackfill:function onEnableDisableBackfill(i){this.kpiModel.set({backfill_enabled:i}),this._renderBackfillTimeControls(i)},_createAndRenderSwitchControl:function _createAndRenderSwitchControl(){var i=this.kpiModel.get("backfill_enabled"),s=(0,y.default)('<div data-test-itsi="backfill-enable-disable-control" class="backfill-enable-disable-control"></div>');return x.default.unmountComponentAtNode(s.get(0)),x.default.render(T.default.createElement(W.default,null,T.default.createElement(K.default,{enabled:i,onChange:this.onEnableDisableBackfill.bind(this),size:"medium"})),s.get(0)),s},_checkAndSetIfBackfillPeriodIsValid:function _checkAndSetIfBackfillPeriodIsValid(i){var s=this.kpiModel._checkSummarizedDataCache.earliestTime,o=parseInt(s,10),h=(new Date).getTime()/1e3-(0,N.relativeToSeconds)(i),v=!1;return(isNaN(o)||h<o)&&(v=!0),this.kpiModel._checkSummarizedDataCache.backfillNeeded=v,this.kpiModel._checkSummarizedDataCache.backfillNeeded},_handleTimePickerSelection:function _handleTimePickerSelection(i){var s,o=this.checkIsKPICreateMode();o||(s=this._checkAndSetIfBackfillPeriodIsValid(i)),this.kpiModel.set("backfill_earliest_time",i),o||s||i===V.BACKFILL_TIME_PERIOD_EARLIEST_INVALID_TIME?this.$(".kpi-invalid-backfill-time")&&this.$(".kpi-invalid-backfill-time").remove():this._renderInValidBackfillTimeControl(i)},_renderControls:function _renderControls(){this.$(".backfill-status").hide();var i=this.$(".backfill-controls");i.html("").css({display:"table"}),this.kpiBackfillEnableControl=this._createAndRenderSwitchControl(),i.append(this.kpiBackfillEnableControl),i.append('<div class="backfill-enable-status"></div>'),this._renderBackfillTimeControls(this.kpiModel.get("backfill_enabled")),this._renderedStatus="controls"},_renderBackfillStatusControl:function _renderBackfillStatusControl(i){var s=(0,y.default)('<div class="kpi-backfill-status-control"></div>'),o=this.$(".kpi-backfill-status-control").get(0);if(o&&x.default.unmountComponentAtNode(o),i){var h,v=this.checkIsKPICreateMode();v||(h=this._checkAndSetIfBackfillPeriodIsValid(this.kpiModel.get("backfill_earliest_time"))),v||h||this.kpiModel.get("backfill_earliest_time")===V.BACKFILL_TIME_PERIOD_EARLIEST_INVALID_TIME||this._renderInValidBackfillTimeControl(this.kpiModel.get("backfill_earliest_time"))}else this.$(".kpi-invalid-backfill-time")&&this.$(".kpi-invalid-backfill-time").remove();return x.default.render(T.default.createElement(W.default,null,T.default.createElement(U.default,{backfillEnabled:i,backfillEarliest:this.kpiModel.get("backfill_earliest_time"),onTimePickerSelection:this._handleTimePickerSelection.bind(this)})),s.get(0)),s},_renderInValidBackfillTimeControl:function _renderInValidBackfillTimeControl(i){var s=i.slice(1,i.length-1),o=(0,P.sprintf)((0,R.gettext)("You already have %s day(s) of data in the summary index. Select a larger time range."),s),h=new j.default({content:o,dataTestItsi:"backfill-error-message",type:"error"});0===this.$(".kpi-invalid-backfill-time").length?(this.$el.append('<div class="kpi-invalid-backfill-time"></div>'),this.$el.find(".kpi-invalid-backfill-time").append(h.render().$el)):this.$(".kpi-invalid-backfill-time").html(h.render().$el),this.kpiModel._checkSummarizedDataCache.backfillNeededErrorMessage=o},_renderBackfillTimeControls:function _renderBackfillTimeControls(i){var s=this._renderBackfillStatusControl(i);this.$(".backfill-enable-status").html(s)},_renderTrainingStatus:function _renderTrainingStatus(){var i=this.kpiModel.get("backfill_status");if(i){"new"===i||"pending"===i||"running"===i?i=(0,R.gettext)("In progress"):"done"===i?i=(0,R.gettext)("Finished"):"failed"===i&&(i=(0,R.gettext)("Failed"));var s=$({gettext:R.gettext,status:i},{variable:"vars"});this.$(".kpi-backfill-search-status").html(s).show()}}});s.default=X,i.exports=s.default},3041:function(i,s,o){var h=o(3042);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},3042:function(i,s,o){(s=o(37)(!1)).push([i.i,".backfill-enable-status {\n\tdisplay: inline-block;\n\tvertical-align: top;\n}\n.kpi-invalid-backfill-time {\n\tmargin-left: 60px;\n}",""]),i.exports=s},3043:function(i,s,o){var h=o(3044);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},3044:function(i,s,o){(s=o(37)(!1)).push([i.i,".kpi-search-and-calculate-modal .modal-title {\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tpadding-right: 50px;\n\twhite-space: nowrap;\n}\n.kpi-search-and-calculate-modal .modal-body {\n\theight: 520px;\n}\n.kpi-search-and-calculate-modal .step-content {\n\tmax-height: 402px;\n\toverflow-y: auto;\n\tpadding: 3px 3px 3px 3px; /* Fixes the box-shadow highlight on focus */\n}\n.kpi-search-and-calculate-modal .step-content div .gather-step-datamodel-helper {\n\tmargin-left: 142px;\n\tline-height: 26px;\n\tpadding: 5px 5px 5px 0;\n}\n.kpi-search-and-calculate-modal .collapsible-panel-placeholder {\n\tbackground: white;\n\tposition: absolute;\n\tbottom: 0;\n\tleft: 0;\n\tright: 0;\n\tz-index: 30;\n}\n.kpi-search-and-calculate-modal .modal-footer .alert-error {\n\tfloat: left;\n\twidth: 450px;\n\tmargin-left: 10px;\n\tdisplay: block;\n}\n/* Applies to the Filters Control Group */\n.kpi-search-and-calculate-modal .kpi-filter-view {\n\tdisplay: inline-block;\n}\n/* Applies to the Filters Control Group label */\n.kpi-search-and-calculate-modal .kpi-filter-view .filter-label {\n\tdisplay: inline-block;\n}\n.kpi-search-and-calculate-modal .kpi-metric-selector-container,\n.kpi-search-and-calculate-modal .data-model-selector-dropdown-container {\n\tmargin-bottom: 10px;\n}\n.search-results-progress-bar-container {\n\tdisplay: inline-block;\n\tflex-grow: 1;\n\tpadding-right: 20px;\n}\n.kpi-search-and-calculate-modal-footer-buttons-container {\n\tdisplay: inline-block;\n}",""]),i.exports=s},3045:function(i,s,o){(s=o(37)(!1)).push([i.i,".kpi-main-content .three-column-view {\n\tpadding: 10px 20px 10px 20px;\n}\n.kpi-main-content .three-column-view .title-view {\n\tfont-size: 14px;\n}\n.kpi-main-content .three-column-view .summary-view {\n\toverflow: hidden;\n}\n.kpi-main-content .summary-view .field-title,\n.kpi-main-content .three-column-view .field-title {\n\ttext-decoration: underline;\n}\n.kpi-main-content .three-column-view .summary {\n\tpadding-right: 10px;\n}",""]),i.exports=s},3046:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(184)),y=o(49),_=o(5),S=o(16),T=h(o(415)),x=h(o(603)),R=o(203),P=h(o(1647));o(3064);var L=T.default.extend({tagName:"div",className:"kpi-thresholding-panel",initialize:function initialize(i){if(!(i=i||{}).kpiModel)throw"Must provide kpiModel";if(this.kpiModel=i.kpiModel,!i.serviceModel)throw"Must provide serviceModel";this.serviceModel=i.serviceModel,this.linkedServices=i.linkedServices,this.serviceTemplateTitle=i.serviceTemplateTitle,this.featureFlags=i.featureFlags,this.appsData=i.appsData,this.permissions=i.permissions,this.previewServiceCache=i.previewServiceCache,this.thresholdTemplateCollection=i.thresholdTemplateCollection,this.userData=i.userData,this.hideRecommendedThresholding=i.hideRecommendedThresholding||!1,i.dataTestItsi="thresholding-collapsible-panel",i.panelId="thresholding",i.panelTitle=(0,_.gettext)("Thresholding"),i.ContentView=P.default,i.contentViewOptions={appsData:this.appsData,service:this.serviceModel,hideRecommendedThresholding:this.hideRecommendedThresholding,kpiModel:this.kpiModel,linkedServices:this.linkedServices,kpiConfigView:!0,featureFlags:this.featureFlags,permissions:this.permissions,previewServiceCache:this.previewServiceCache,thresholdTemplateCollection:this.thresholdTemplateCollection,userData:this.userData},this.thresholdsUpdated=!!this.kpiModel.get("linked_kpi_thresholds_updated"),this.isLinkedToServiceTemplate=!!this.serviceModel.get("base_service_template_id")&&!!this.kpiModel.get("base_service_template_id"),this.children={},this.children.unlockIcon=new x.default({dataTestItsi:"service-template-icon-unlocked",dataTestItsiTooltip:"service-template-icon-unlocked-tooltip",hasTooltip:!0,style:{marginLeft:8,fontSize:15,color:R.warningColor},tooltipContent:(0,S.sprintf)((0,_.gettext)("This setting has been changed. Its value is no longer synced with the %s service template, even though the service is still linked."),this.serviceTemplateTitle),type:"lock-unlocked"}),T.default.prototype.initialize.apply(this,arguments)},_handleSoftLink:function _handleSoftLink(i,s){if(this.thresholdsUpdated)this._renderUnlock();else{var o=["renderBoundaryMax","renderBoundaryMin","search"],h=Object.keys(i.changed),_=(0,v.default)(h,(function(i){return!(0,y.contains)(o,i)}));(0!==h.length||s&&s.changeManifest&&s.changeManifest.search||s&&s.changeManifest&&s.changeManifest.renderBoundaryMax||s&&s.changeManifest&&s.changeManifest.renderBoundaryMin)&&!_||this.thresholdsUpdated||this._renderUnlock()}},_renderUnlock:function _renderUnlock(){0===this.$el.find('[data-test-itsi="service-template-icon-unlocked"]').length&&this.$('[data-test="collapsible-panel"] [data-test="toggle"] [data-test="title"]').append(this.children.unlockIcon.render().$el)},render:function render(){return T.default.prototype.render.apply(this,arguments),this.isLinkedToServiceTemplate&&(this.listenTo(this.kpiModel,"change:kpi_threshold_template_id change:tz_offset change:time_variate_thresholds change:adaptive_thresholds_is_enabled change:adaptive_thresholding_training_window ",this._handleSoftLink),this.listenTo(this.kpiModel.get("aggregate_thresholds"),"change",this._handleSoftLink),this.listenTo(this.kpiModel.get("entity_thresholds"),"change",this._handleSoftLink),this.listenTo(this.kpiModel.get("time_variate_thresholds_specification"),"change",this._handleSoftLink),this.listenTo(this.kpiModel,"change:aggregate_thresholds_alert_enabled change:aggregate_thresholds_custom_alert_enabled change:aggregate_thresholds_custom_alert_rules",this._handleSoftLink)),this.isLinkedToServiceTemplate&&this.thresholdsUpdated&&this._renderUnlock(),this}});s.default=L,i.exports=s.default},3047:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_,S,T=h(o(9)),x=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),R=h(o(2)),P=h(o(3)),L=h(o(407)),N=h(o(33)),V=h(o(75)),j=h(o(336)),W=h(o(590)),K=o(16),U=o(5),Y=h(o(568)),$=o(137),X=o(135);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}var Z=(0,P.default)(L.default)(v||(v=(0,T.default)(["\n margin-bottom: 18px;\n"]))),ee=(0,P.default)(j.default.Item)(y||(y=(0,T.default)(["\n display: flex;\n"]))),te=(0,P.default)(Y.default)(_||(_=(0,T.default)(["\n margin-right: 4px;\n"]))),ie=(0,P.default)(V.default)(S||(S=(0,T.default)(["\n margin-left: 4px;\n margin-right: 4px;\n"]))),ae=x.default.createElement(Y.default,{viewBox:"0 0 18 18","data-test-itsi":"kpi-recommendation-icon"});function KpiRecommendedThresholdingInfoView(i){var s,{confidenceLevel:o,confidenceScore:h,timePolicyDesc:v,timePolicyType:y,kpiObj:_}=i,[S,T]=(0,x.useState)(!0),R=(0,x.useCallback)(()=>{T(!1)},[]),P=(null==_?void 0:_.adaptive_thresholds_is_enabled)&&$.ANALYSIS_WINDOW_OPTIONS.filter(i=>i.value===_.adaptive_thresholding_training_window)[0],L=null===(s=X.POLICY_TYPES.find(i=>y===i.value))||void 0===s?void 0:s.label.toLowerCase();return x.default.createElement("div",null,S&&x.default.createElement(N.default,{appearance:"fill",type:"info","data-test-itsi":"kpi-threshold-recommended-info-message",onRequestRemove:R},x.default.createElement(W.default,{"data-test-itsi":"kpi-threshold-recommended-info-message-heading",as:"p",weight:"bold"},(0,U.gettext)("Splunk AI recommendations")),x.default.createElement(j.default,null,x.default.createElement(ee,{"data-test-itsi":"kpi-threshold-recommended-config-container-time-policy-item"},x.default.createElement(te,{viewBox:"0 0 18 18"}),x.default.createElement(W.default,{as:"p",weight:"bold"},(0,K.sprintf)((0,U.gettext)("Time policies are %(areTimePoliciesEnabled)s"),{areTimePoliciesEnabled:_.time_variate_thresholds?(0,U.gettext)("active"):(0,U.gettext)("inactive")})),x.default.createElement(ie,null,"-"),x.default.createElement(V.default,null,(0,U.gettext)("based on analysis of KPI behavior over time."))),_.adaptive_thresholds_is_enabled&&x.default.createElement(ee,{"data-test-itsi":"kpi-threshold-recommended-config-container-at-item"},x.default.createElement(te,{viewBox:"0 0 18 18"}),x.default.createElement(W.default,{as:"p",weight:"bold"},(0,K.sprintf)((0,U.gettext)("Adaptive thresholding with a %(days)s day analysis window using the %(algorithm)s algorithm"),{days:P.days,algorithm:L})," "),x.default.createElement(ie,null,"-"),x.default.createElement(V.default,null,(0,U.gettext)("this setting automatically adjusts threshold values by analyzing historical KPI behavior, and the algorithm method calculates threshold values that fit your data's behavior."))),_.adaptive_thresholds_is_enabled&&x.default.createElement(ee,{"data-test-itsi":"kpi-threshold-recommended-config-container-outlier-item"},x.default.createElement(te,{viewBox:"0 0 18 18"}),x.default.createElement(W.default,{as:"p",weight:"bold"},(0,K.sprintf)((0,U.gettext)("Outlier exclusion is active using %(outlierAlgo)s"),{outlierAlgo:$.OUTLIER_ALGORITHM_LABEL_MAP[_.outlier_detection_algo]})," "),x.default.createElement(ie,null,"-"),x.default.createElement(V.default,null,(0,U.gettext)("this setting defines outlier data points to exclude from adaptive threshold calculations to avoid data skews."))),x.default.createElement(ee,{"data-test-itsi":"kpi-threshold-recommended-config-container-description-item"},x.default.createElement(te,{viewBox:"0 0 18 18"}),x.default.createElement(W.default,{"data-test-itsi":"kpi-threshold-recommended-config-container-description",as:"p",weight:"bold"},(0,K.sprintf)((0,U.gettext)("%(description)s recommended with %(confidence)s confidence (Confidence Score = %(score)s%%)"),{description:v.charAt(0).toUpperCase()+v.slice(1),confidence:o,score:(100*h).toFixed(2)})),x.default.createElement(ie,null,"-"),x.default.createElement(V.default,null,(0,U.gettext)("settings that describe your data's patterns and are reflected in the recommendation."))))),x.default.createElement(Z,{icon:ae,"data-test-itsi":"kpi-threshold-recommended-info-icon-chip"},(0,U.gettext)("This icon represents threshold settings configured using Splunk's AI-powered analysis.")))}KpiRecommendedThresholdingInfoView.propTypes={confidenceLevel:R.default.string.isRequired,confidenceScore:R.default.string.isRequired,timePolicyDesc:R.default.string.isRequired,timePolicyType:R.default.string.isRequired,kpiObj:R.default.object.isRequired};var ne=KpiRecommendedThresholdingInfoView;s.default=ne,i.exports=s.default},3048:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_,S,T,x=h(o(9)),R=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),P=h(o(2)),L=h(o(3)),N=h(o(42)),V=h(o(86)),j=h(o(43)),W=h(o(82)),K=h(o(33)),U=o(5),Y=o(405),$=o(135),X=h(o(3049)),Z=h(o(3054)),ee=h(o(3055)),te=h(o(3059)),ie=h(o(178)),ae=o(68),ne=o(133),re=o(74),se=o(424),le=o(688);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}var oe=(0,L.default)(V.default)(v||(v=(0,x.default)(["\n padding: 20px 0;\n text-align: center;\n"]))),de=(0,L.default)(W.default)(y||(y=(0,x.default)(["\n margin-left: 10px;\n width: 250px !important;\n"]))),ce=(0,L.default)(K.default)(_||(_=(0,x.default)(["\n margin-top: 20px;\n"]))),he=L.default.span(S||(S=(0,x.default)(["\n margin-right: 15px;\n"]))),ue=L.default.div(T||(T=(0,x.default)(["\n margin-left: 20px;\n margin-bottom: 20px;\n"])));function KpiThresholdingViewContainer(i){var{appsData:s,kpiModel:o,updateThresholdInKpiModel:h,thresholdTemplateCollection:v,generateTemplate:y,canWriteOnGlobalTeam:_,disabled:S,hasTimeVariateThresholds:T}=i,[x,P]=(0,R.useState)(!0),[L,V]=(0,R.useState)(o.get("is_entity_breakdown")),[K,pe]=(0,R.useState)(!0),[fe,ge]=(0,R.useState)(!0),[me,ve]=(0,R.useState)(o.get("kpi_threshold_template_id")),[ye,_e]=(0,R.useState)(!1),[Se,be]=(0,R.useState)(!1),[Te,Ee]=(0,R.useState)([]),[ke,Ce]=(0,R.useState)(""),[xe,we]=(0,R.useState)(!1),[Me,Re]=(0,R.useState)("");(0,R.useEffect)(()=>{(()=>{var i=v.get(o.get("kpi_threshold_template_id"));if(i){var s=i.get("time_variate_thresholds_specification"),h=o.get("time_variate_thresholds_specification");h.set(h.parse({policies:JSON.parse(JSON.stringify(s.get("policies")))}),{silent:!0}),o.set("time_variate_thresholds",i.get("time_variate_thresholds"),{silent:!0}),o.set("aggregate_outlier_detection_enabled",i.get("aggregate_outlier_detection_enabled"),{silent:!0}),o.set("outlier_detection_algo",i.get("outlier_detection_algo"),{silent:!0}),o.set("outlier_detection_sensitivity",i.get("outlier_detection_sensitivity"),{silent:!0})}})(),o.on("change:is_entity_breakdown",()=>{V(o.get("is_entity_breakdown")),o.get("is_entity_breakdown")||pe(!0)}),o.on("change:kpi_threshold_template_id",(i,s,o)=>{o&&o.unset&&ve("create-new-template")});var i=(0,$.checkSummaryIndexForKpiData)(o.get("_key"),"single-thresholding-preview");return i.promise.then(i=>{var s=!i||(0,$.checkShouldUseRawSearch)(i);ge(s),P(!1)}).catch(()=>{ge(!0),P(!1)}),()=>{var s;null!=(s=i)&&s.subscription&&s.subscription.unsubscribe(),null!=s&&s.searchJob&&s.searchJob.cancel(),o.off("change:is_entity_breakdown"),o.off("change:kpi_threshold_template_id")}},[]),(0,R.useEffect)(()=>{var i=[];v&&(0,N.default)(v.models,s=>{i.push({value:s.get("_key"),label:s.get("title")})}),Ee(i)},[]);var applyKpiThresholdTemplate=i=>{var s=v.get(i);if(s){var h=s.get("time_variate_thresholds_specification"),y=o.get("time_variate_thresholds_specification");y.set(y.parse({policies:JSON.parse(JSON.stringify(h.get("policies")))})),o.set("kpi_threshold_template_id",i),o.set("adaptive_thresholds_is_enabled",s.get("adaptive_thresholds_is_enabled")),o.set("adaptive_thresholding_training_window",s.get("adaptive_thresholding_training_window")),o.set("time_variate_thresholds",s.get("time_variate_thresholds")),o.set("aggregate_outlier_detection_enabled",s.get("aggregate_outlier_detection_enabled")),o.set("outlier_detection_algo",s.get("outlier_detection_algo")),o.set("outlier_detection_sensitivity",s.get("outlier_detection_sensitivity")),Re(i)}},Ae=(0,R.useCallback)((i,s)=>{var{value:o}=s;ve(o),"create-new-template"!==o?o!==me&&_e(!0):be(!0)},[me]),handleCloseConfirmDialog=()=>{_e(!1)},handleApplyConfirmDialog=()=>{applyKpiThresholdTemplate(me)},Ie=(0,R.useCallback)(()=>{be(!1),Ce("")},[]),Oe=(0,R.useCallback)((i,s)=>{var o=y();o.set("title",i),o.set("description",s),we(!0),o.save(o.toJSON(),{silent:!0}).done(i=>{var s;ve(i._key),be(!1),s=i._key,v.fetch().done(()=>{var i=[];v&&(0,N.default)(v.models,s=>{i.push({value:s.get("_key"),label:s.get("title")})}),Ee(i),applyKpiThresholdTemplate(s)}).fail(()=>{}),we(!1)}).fail(i=>{we(!1),i&&409===i.status&&i.responseText&&i.responseText.indexOf(ne.ALREADY_EXISTING_TITLE_MARKER)>-1?Ce(ne.ALREADY_EXISTING_TITLE_MESSAGE):Ce("".concat(se.OBJECT_NAMES.singular," could not be saved. Possible cause: connection lost. Try restarting the Splunk platform. ").concat((0,re.formatErrorResponse)(i).message))})},[]),Pe=(0,R.useCallback)(i=>{var s={isValid:!0,message:""};return v.pluck("title").includes(i)?(s.isValid=!1,s.message=(0,U.gettext)("A template with this title already exists."),s):""===i.replace(/\s+/g,"")?(s.isValid=!1,s.message=(0,U.gettext)("Title field is required."),s):s},[v]),De=(0,R.useCallback)(i=>{i===$.KPI_THRESHOLD_TYPES.AGGREGATE?pe(!0):pe(!1)},[]);if(x)return R.default.createElement(oe,{"data-test-itsi":"kpi-thresholding-view-container-wait-spinner",size:"large"});var Le,Ne,Ve=!1,He=!0;return(0,N.default)(Y.PYTHON_SCIENTIFIC_APP_NAMES,i=>{s&&s[i]&&s[i].isInstalled&&(Ve=!0,s[i].isDisabled||(He=!1))}),R.default.createElement(R.default.Fragment,null,R.default.createElement(te.default,{validateKpiThresholdTitle:Pe,open:Se,handleClose:Ie,handleSave:Oe,apiErrorMessage:ke,isApiInProgress:xe}),R.default.createElement(ue,null,R.default.createElement(he,null,(0,U.gettext)("Apply template (optional) ")),R.default.createElement(de,{"data-test-itsi":"kpi-threshold-template-select",disabled:S,filter:!0,placeholder:(0,U.gettext)("Create new template"),onChange:Ae,truncate:!0,value:me},R.default.createElement(W.default.Divider,null),R.default.createElement(W.default.Option,{disabled:!(_&&T),key:"create-new-template",label:(0,U.gettext)("Create new template"),value:"create-new-template"}),R.default.createElement(W.default.Heading,null,(0,U.gettext)("Threshold templates")),Te.map(i=>R.default.createElement(W.default.Option,{"data-test-itsi":"kpi-threshold-template-select-option",key:i.value,label:i.label,value:i.value})))),L&&R.default.createElement(Z.default,{handleTabChange:De,showRecommendationIcon:!1}),K&&R.default.createElement(ee.default,{kpiModel:o,isPSCDisabled:He,isPSCInstalled:Ve,onThresholdUpdate:h,useRawSearch:fe,key:Me}),L&&!K&&R.default.createElement(X.default,{kpiModel:o,isPSCDisabled:He,isPSCInstalled:Ve,onThresholdUpdate:h,useRawSearch:fe,key:Me}),(Le=me,Ne=v.get(Le),R.default.createElement(ie.default,{modalDataTestItsi:"apply-threshold-template-modal",cancelButtonDataTestItsi:"apply-threshold-template-modal-cancel-button",primaryButtonDataTestItsi:"apply-threshold-template-modal-apply-button",showCancel:!0,open:ye,beforeClose:handleCloseConfirmDialog,modalStyles:ae.CONFIRMATION_MODAL_STYLE,title:(0,U.gettext)("Apply Threshold Template"),primaryButtonLabel:(0,U.gettext)("Apply"),primaryButtonClicked:handleApplyConfirmDialog,secondaryButtonClicked:handleCloseConfirmDialog},R.default.createElement("span",{"data-test-itsi":"threshold-template-modal-apply-message"},(0,U.gettext)("All existing threshold settings will be discarded. Are you sure you want to apply template?"),Ne&&Ne.get("_immutable")&&R.default.createElement(ce,{"data-test-itsi":"kpi-threshold-template-apply-info-message",type:"info",appearance:"fill"},R.default.createElement("div",null,(0,U.gettext)("The threshold time policies will be applied in UTC. If you want the threshold time policies to be applied in your local timezone, clone this template using your timezone and then apply it.")," ",R.default.createElement(j.default,{"data-test-itsi":"clone-kpi-threshold-template-link",openInNewContext:!0,to:le.uiListerURL},(0,U.gettext)("Clone Threshold Template")),"."))))))}KpiThresholdingViewContainer.propTypes={appsData:P.default.object.isRequired,kpiModel:P.default.object.isRequired,updateThresholdInKpiModel:P.default.func.isRequired,thresholdTemplateCollection:P.default.object.isRequired,generateTemplate:P.default.func.isRequired,canWriteOnGlobalTeam:P.default.bool,disabled:P.default.bool,hasTimeVariateThresholds:P.default.bool},KpiThresholdingViewContainer.defaultProps={canWriteOnGlobalTeam:!0,disabled:!1,hasTimeVariateThresholds:!0};var pe=KpiThresholdingViewContainer;s.default=pe,i.exports=s.default},3049:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_,S=h(o(11)),T=h(o(9)),x=_interopRequireWildcard(o(0)),R=o(64),P=o(59),L=h(o(516)),N=h(o(101)),V=h(o(45)),j=h(o(794)),W=h(o(2)),K=h(o(3)),U=h(o(95)),Y=h(o(53)),$=h(o(1241)),X=h(o(871)),Z=h(o(406)),ee=h(o(793)),te=_interopRequireWildcard(o(550)),ie=h(o(623)),ae=o(509),ne=h(o(86)),re=h(o(110)),se=o(5),le=o(16),oe=o(40),de=o(48),ce=o(25),he=o(111),ue=o(135),pe=o(77),fe=o(1421),ge=o(1603),me=o(787),ve=o(621),ye=o(811),_e=o(137),Se=h(o(178)),be=h(o(3050)),Te=h(o(3051)),Ee=h(o(1648)),ke=h(o(1649)),Ce=h(o(1650)),xe=h(o(3053));function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}return h.default=i,o&&o.set(i,h),h}function ownKeys(i,s){var o=Object.keys(i);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(i);s&&(h=h.filter((function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable}))),o.push.apply(o,h)}return o}function _objectSpread(i){for(var s=1;s<arguments.length;s++){var o=null!=arguments[s]?arguments[s]:{};s%2?ownKeys(Object(o),!0).forEach((function(s){(0,S.default)(i,s,o[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(o,s))}))}return i}var we=(0,te.makeCreateToast)(te.default),Me=(0,K.default)(ne.default)(v||(v=(0,T.default)(["\n padding: 20px 0;\n text-align: center;\n"]))),Re=K.default.div(y||(y=(0,T.default)(["\n display: flex;\n"]))),Ae=K.default.div(_||(_=(0,T.default)(["\n display: flex;\n flex-direction: column;\n position: relative;\n margin: 0px;\n padding: 12px;\n border: 1px solid ",";\n"])),oe.variables.gray80);function EntityThresholdingContainer(i){var{isPSCDisabled:s,isPSCInstalled:o,isReadOnly:h,kpiEntitiesApiErrorMessage:v,kpiEntitiesApiStatus:y,kpiEntitiesData:_,kpiEntitiesConfigApiStatus:S,kpiEntitiesConfigData:T,previewEntitiesThresholdsRecommendationSearchStatus:R,previewEntitiesThresholdsRecommendationResults:P,kpiModel:W,onThresholdUpdate:K,serviceKpiEntitiesRetrieveAction:te,serviceKpiEntitiesConfigRetrieveAction:ne,previewRecommendedEntitiesThresholdsSearchRetrieveAction:oe,useRawSearch:ge}=i,me=(0,x.useCallback)(i=>{var{_key:s,entity_key:o,entity_title:h,kpi_id:v,entity_thresholds:y,time_variate_thresholds:_,time_variate_thresholds_specification:S,adaptive_thresholds_is_enabled:T,adaptive_thresholding_training_window:x}=i;return{_key:s,adaptiveTrainingWindow:x,name:h,entityKey:o,kpiId:v,entityThresholdsConfig:_objectSpread({},y),isAdaptiveThresholdsEnabled:T,isTimeVariateThresholds:_,timeVariateThresholdsSpecification:(0,N.default)(S)}},[]),[Ie,Oe]=(0,x.useState)({entity:{},thresholdObj:{},isReadOnly:!1}),[Pe,De]=(0,x.useState)(!W.get("is_entity_level_thresholding")),[Le,Ne]=(0,x.useState)((i=>{var s,o,{_key:h,title:v,alert_period:y,aggregate_thresholds:_,base_search:S,entity_statop:T,entity_thresholds:x,entity_breakdown_id_fields:R,search_time_series_entities:P,threshold_field:L,time_variate_thresholds:N,time_variate_thresholds_specification:V,adaptive_thresholds_is_enabled:j,adaptive_thresholding_training_window:K,search_alert_earliest:U}=i;return{_key:h,name:v,isAdaptiveThresholdsEnabled:j,adaptiveTrainingWindow:K,isTimeVariateThresholds:N,baseSearch:S,entityStatop:T,searchTimeSeriesEntities:P,entityBreakdownIdFields:R,thresholdField:L,searchAlertEarliest:U,aggregateThresholdsConfig:_objectSpread(_objectSpread({},_),{},{thresholdLevels:_.thresholdLevels.models.map(i=>{var{severityColor:s,thresholdValue:o,severityValue:h,severityColorLight:v,dynamicParam:y,severityLabel:_}=i.toJSON();return{severityColor:s,thresholdValue:o,severityValue:h,severityColorLight:v,dynamicParam:y,severityLabel:_}})}),entityThresholdsConfig:_objectSpread(_objectSpread({},x),{},{thresholdLevels:x.thresholdLevels.models.map(i=>{var{severityColor:s,thresholdValue:o,severityValue:h,severityColorLight:v,dynamicParam:y,severityLabel:_}=i.toJSON();return{severityColor:s,thresholdValue:o,severityValue:h,severityColorLight:v,dynamicParam:y,severityLabel:_}})}),timeVariateThresholdsSpecification:(s=V.get("policies"),o={policies:{}},s.models&&s.models.forEach(i=>{var{id:s}=i,{title:h,aggregate_thresholds:v,entity_thresholds:y,policy_type:_,time_blocks:S}=i.toJSON()[s],{thresholdLevels:T,gaugeMin:x,gaugeMax:R,isMinStatic:P,isMaxStatic:L,renderBoundaryMin:N,renderBoundaryMax:V,baseSeverityValue:j,baseSeverityColor:W,baseSeverityColorLight:K,baseSeverityLabel:U,metricField:Y}=v;o.policies[s]={title:h,aggregate_thresholds:{gaugeMax:R,thresholdLevels:T.models.map(i=>{var{severityColor:s,thresholdValue:o,severityValue:h,severityColorLight:v,dynamicParam:y,severityLabel:_}=i.toJSON();return{severityColor:s,thresholdValue:o,severityValue:h,severityColorLight:v,dynamicParam:y,severityLabel:_}}),isMaxStatic:L,gaugeMin:x,baseSeverityLabel:U,baseSeverityColor:W,metricField:Y,baseSeverityValue:j,baseSeverityColorLight:K,renderBoundaryMin:N,renderBoundaryMax:V,isMinStatic:P},entity_thresholds:{gaugeMax:y.gaugeMax,thresholdLevels:y.thresholdLevels.models.map(i=>{var{severityColor:s,thresholdValue:o,severityValue:h,severityColorLight:v,dynamicParam:y,severityLabel:_}=i.toJSON();return{severityColor:s,thresholdValue:o,severityValue:h,severityColorLight:v,dynamicParam:y,severityLabel:_}}),isMaxStatic:y.isMaxStatic,gaugeMin:y.gaugeMin,baseSeverityLabel:y.baseSeverityLabel,baseSeverityColor:y.baseSeverityColor,metricField:y.metricField,baseSeverityValue:y.baseSeverityValue,baseSeverityColorLight:y.baseSeverityColorLight,renderBoundaryMin:y.renderBoundaryMin,renderBoundaryMax:y.renderBoundaryMax,isMinStatic:y.isMinStatic},policy_type:_,time_blocks:S}}),o),thresholdType:ue.KPI_THRESHOLD_TYPES.ENTITY,rawSearch:i.search_time_series_entities,alertPeriod:y,tempKpiData:_objectSpread(_objectSpread({},i),{},{adaptive_thresholding_training_window:W.get("adaptive_thresholding_training_window"),time_variate_thresholds_specification:JSON.parse(JSON.stringify(V.toJSON()))})}})(W.toJSON())),[Ve,He]=(0,x.useState)(W.get("is_entity_level_thresholding")||!1),[Be,je]=(0,x.useState)(!1),[We,Ke]=(0,x.useState)(!1),[Fe,Ge]=(0,x.useState)(!1),[Ue,ze]=(0,x.useState)(!1),[Ye,qe]=(0,x.useState)(!W.get("is_entity_level_thresholding")),$e={analysisWindowValue:W.get("entity_recommendation_training_window")||_e.ANALYSIS_WINDOW_OPTIONS[2].value,analysisWindowStartDate:W.get("entity_recommendation_start_date")||(0,re.default)().subtract(_e.ANALYSIS_WINDOW_OPTIONS[2].days,"days").unix(),recommendationApplyAsValue:W.get("entity_recommendation_apply_as_value")||_e.RECOMMENDATION_APPLY_AS_OPTIONS[0].value,thresholdConfigValue:W.get("entity_threshold_direction")||_e.THRESHOLD_CONFIGURATION_OPTIONS[0].value},Je=(0,x.useRef)(),Xe=(0,x.useCallback)(()=>{var i=(0,X.default)(_.results,0,10),s=W.get("entity_recommendation_training_window")||"30d",o=W.get("entity_recommendation_start_date")?re.default.unix(W.get("entity_recommendation_start_date")):re.default.unix((0,re.default)().subtract(s.match(/\d+/g)[0],"days").unix()),h=o.clone(),v=s.match(/\d+/g)[0];h.add(v,"days"),oe({kpiId:W.get("_key"),entityIds:(0,Y.default)(i,"entity_key"),entityTitles:(0,Y.default)(i,"entity_title"),thresholdDirection:W.get("entity_threshold_direction"),recommendationApplyAsValue:W.get("entity_recommendation_apply_as_value"),earliest:"-".concat((0,re.default)().diff(o,"day"),"d"),latest:(0,re.default)().isSame(h,"day")?"now":"-".concat((0,re.default)().diff(h,"day"),"d")})},[_.results,W,oe]),Ze=(0,x.useCallback)(i=>{var s=W.get("entity_threshold_configuration")||{},o=W.get("entity_threshold_recommended_configuration")||{};if(i in o)return[me(o[i]),!0];if(i in s)return[me(s[i]),!1];var h=T.length?T.findIndex(s=>i===s.entity_title):-1;return-1!==h?[me(T[h]),!1]:[{},!1]},[W,T,me]);(0,x.useEffect)(()=>(Je.current=null,()=>clearTimeout(Je.current)),[]),(0,x.useEffect)(()=>{W.on("change:is_entity_level_thresholding",()=>{W.get("is_entity_level_thresholding")?(qe(!1),De(!1),He(!0)):(De(!0),He(!1))})},[]),(0,x.useEffect)(()=>{Ve&&(ne(Le._key),te({kpiId:Le._key,requiredEvents:128,earliest:"-14d",latest:"now"}))},[Ve]),(0,x.useEffect)(()=>{if(y===ve.SERVICE_KPI_ENTITIES_RETRIEVE_STATUS.SUCCESS){if(Fe&&(Ge(!1),Xe()),_&&null!=_&&_.results.length&&null!=_&&_.results[0]){var[i,s]=Ze(_.results[0].entity_title);Oe({entity:_.results[0],thresholdObj:i,isReadOnly:s}),De(!1)}else Oe({entity:{entity_key:"entity_default_configuration",entity_title:(0,se.gettext)("Default Configuration")},thresholdObj:{},isReadOnly:!1}),De(!0);qe(!0)}},[y]),(0,x.useEffect)(()=>{},[v]);var generateToastMessage=(i,s)=>{we({type:i,message:s,autoDismiss:!0,dismissOnActionClick:!0,showAction:!1})},Qe=function generateThresholdLevels(i,s,o){var h=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,v=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,y=(0,N.default)(ue.DEFAULT_THRESHOLDS),_=[];Object.entries(i).forEach(i=>{var[s,y]=i,S=Array.isArray(y)?y:[y],T=he.DEFAULT_SEVERITY_LEVELS.find(i=>i.severityLabel===s);T&&S.forEach(i=>{var s={severityLabel:T.severityLabel,severityValue:T.severityValue,severityColor:T.severityColor,severityColorLight:T.severityColorLight,thresholdValue:o?i*v+h:i,dynamicParam:o?i:0};_.push(s)})}),_.sort((i,s)=>i.thresholdValue-s.thresholdValue);var{renderBoundaryMin:S}=y,{renderBoundaryMax:T}=y;if(y.thresholdLevels=_,_.length){var x=_[0].thresholdValue;y.gaugeMin=x-Math.abs(.1*x),y.gaugeMin<S&&(y.renderBoundaryMin=y.gaugeMin);var R=_[_.length-1].thresholdValue;y.gaugeMax=R+Math.abs(.1*R),y.gaugeMax>T&&(y.renderBoundaryMax=y.gaugeMax)}if(s!==_e.THRESHOLD_CONFIGURATION_OPTIONS[2].value){var{severityLabel:P,severityValue:L,severityColor:V,severityColorLight:j}=he.DEFAULT_SEVERITY_LEVELS[5];y.baseSeverityLabel=P,y.baseSeverityValue=L,y.baseSeverityColor=V,y.baseSeverityColorLight=j}return y},et=(0,x.useCallback)(i=>{for(var s={[ue.DEFAULT_POLICY_KEY]:ue.DEFAULT_POLICY},o=0;o<i.length;o+=1){var h=(0,ce.generateUUID)(),v=[[i[o]["Cron Expression"],parseInt(i[o].Duration,10)]],y=(0,pe.getUserTimezoneOffset)("sec"),_=(0,ue.getPolicyTitleFromTimeBlock)(v,y),S=i[o].Thresholds.replace(/'/g,'"'),T=parseFloat(i[o].Mean),x=parseFloat(i[o].Std),R=(0,ce.normalizeBoolean)(i[o]["Use Static"]),P=JSON.parse(S),L={title:_,entity_thresholds:Qe(P,i[o]["Threshold Direction"],!0,T,x),aggregate_thresholds:(0,N.default)(ue.DEFAULT_THRESHOLDS),policy_type:R?"static":i[o].Algorithm,time_blocks:v};s[h]=L}return s},[]);(0,x.useEffect)(()=>{if(R===ye.PREVIEW_RECOMMENDED_ENTITIES_THRESHOLDS_SEARCH_RETRIEVE_STATUS.IN_PROGRESS&&ze(!0),Ue){if(ze(!1),R===ye.PREVIEW_RECOMMENDED_ENTITIES_THRESHOLDS_SEARCH_RETRIEVE_STATUS.ERROR){var i=(0,se.gettext)("There was a problem training your entities");generateToastMessage(ae.TOAST_TYPES.ERROR,i)}if(R===ye.PREVIEW_RECOMMENDED_ENTITIES_THRESHOLDS_SEARCH_RETRIEVE_STATUS.SUCCESS){W.set("did_load_recommendation",!0);var s=(0,$.default)([(0,Z.default)(_.results),10]),o=(0,ee.default)(P.results,"entity_title"),h=(0,Z.default)((0,U.default)(o,i=>i["Recommendation Flag"]===_e.ENTITY_RECOMMENDATIONS.SUCCESSFUL||i["Recommendation Flag"]===_e.ENTITY_RECOMMENDATIONS.NO_PATTERN)),v=(0,le.sprintf)((0,se.gettext)("%(numSuccess)d of %(numEntities)d Entities Successfully Trained"),{numSuccess:h,numEntities:s}),y=h===s?ae.TOAST_TYPES.SUCCESS:ae.TOAST_TYPES.WARNING;generateToastMessage(y,v),(0,X.default)(_.results,0,10).forEach(i=>{var s=(0,U.default)(P.results,s=>s.entity_title===i.entity_title);if((0,Z.default)(s)&&s[0]["Recommendation Flag"]===_e.ENTITY_RECOMMENDATIONS.SUCCESSFUL){var o=et(s),h=(0,ce.normalizeBoolean)(s[0]["Use Static"]),v={_key:(0,fe.md5KeyGenerator)([i.entity_title,i.itsi_kpi_id]),entity_title:i.entity_title,entity_key:i.entity_key,kpi_id:i.itsi_kpi_id,entity_thresholds:Ie.thresholdObj,adaptive_thresholds_is_enabled:!h,time_variate_thresholds:!0,time_variate_thresholds_specification:{policies:o}},y=W.get("entity_threshold_recommended_configuration")||{};if(y[i.entity_title]=(0,N.default)(v),Ie.entity.entity_title===i.entity_title){var _=me(v),S=Object.assign((0,N.default)(Ie.thresholdObj),(0,N.default)(_));Oe({entity:Ie.entity,thresholdObj:S,isReadOnly:!0})}W.set("entity_threshold_recommended_configuration",(0,N.default)(y))}else if((0,Z.default)(s)&&s[0]["Recommendation Flag"]===_e.ENTITY_RECOMMENDATIONS.NO_PATTERN){var T=s[0].Thresholds.replace(/'/g,'"'),x=JSON.parse(T),R=Qe(x,s[0]["Threshold Direction"],!1),L={_key:(0,fe.md5KeyGenerator)([i.entity_title,i.itsi_kpi_id]),entity_title:i.entity_title,entity_key:i.entity_key,kpi_id:i.itsi_kpi_id,entity_thresholds:R,adaptive_thresholds_is_enabled:!1,time_variate_thresholds:!1,time_variate_thresholds_specification:{policies:{[ue.DEFAULT_POLICY_KEY]:ue.DEFAULT_POLICY}}},V=W.get("entity_threshold_recommended_configuration")||{};if(V[i.entity_title]=(0,N.default)(L),Ie.entity.entity_title===i.entity_title){var j=me(L),K=Object.assign((0,N.default)(Ie.thresholdObj),(0,N.default)(j));Oe({entity:Ie.entity,thresholdObj:K,isReadOnly:!0})}W.set("entity_threshold_recommended_configuration",(0,N.default)(V))}})}}},[R]);var tt=(0,x.useCallback)(i=>{if(qe(!1),"entity_default_configuration"===i.entity_key)De(!0),Oe({entity:i,thresholdObj:{},isReadOnly:!1});else{var[s,o]=Ze(i.entity_title);Oe({entity:i,thresholdObj:s,isReadOnly:o}),De(!1)}qe(!0)},[Ze]),it=(0,x.useCallback)(i=>{if(Pe){var s,o=_objectSpread({},Le);null!==(s=i.timeVariateThresholdsSpecification)&&void 0!==s&&s.policies&&(o.timeVariateThresholdsSpecification=i.timeVariateThresholdsSpecification),i.entityThresholdsConfig&&(o.entityThresholdsConfig=i.entityThresholdsConfig),Ne(o),K(o)}else{var h=T.length?T.findIndex(i=>Ie.entity.entity_title===i.entity_title):-1,v=(0,N.default)(Ie.thresholdObj),y=W.get("entity_threshold_configuration")||{};Ie.entity.entity_title in y?v.isTimeVariateThresholds?(v.timeVariateThresholdsSpecification=(0,N.default)(i.timeVariateThresholdsSpecification),y[Ie.entity.entity_title]=_objectSpread(_objectSpread({},y[Ie.entity.entity_title]),{},{time_variate_thresholds_specification:i.timeVariateThresholdsSpecification})):(y[Ie.entity.entity_title]=_objectSpread(_objectSpread({},y[Ie.entity.entity_title]),{},{entity_thresholds:i.entityThresholdsConfig}),v.entityThresholdsConfig=(0,N.default)(i.entityThresholdsConfig)):v.isTimeVariateThresholds?(y[Ie.entity.entity_title]=_objectSpread(_objectSpread({},T[h]),{},{time_variate_thresholds_specification:i.timeVariateThresholdsSpecification}),v.timeVariateThresholdsSpecification=i.timeVariateThresholdsSpecification):(y[Ie.entity.entity_title]=_objectSpread(_objectSpread({},T[h]),{},{entity_thresholds:i.entityThresholdsConfig}),v.entityThresholdsConfig=i.entityThresholdsConfig),W.set("entity_threshold_configuration",y),Oe(i=>({entity:i.entity,thresholdObj:v,isReadOnly:i.isReadOnly}))}},[Pe,Le,T,W,K,Ie.entity.entity_title,Ie.thresholdObj]),at=(0,x.useCallback)(()=>{je(!0),Je.current=setTimeout(()=>{var i=_objectSpread({},Le);if(Le.isTimeVariateThresholds){var s=(0,j.default)(Le.timeVariateThresholdsSpecification.policies,i=>{var s=(0,N.default)(i.aggregate_thresholds);return(0,L.default)(_objectSpread({},i),{entity_thresholds:s})});i.timeVariateThresholdsSpecification={policies:s}}else{var o=(0,N.default)(Le.aggregateThresholdsConfig);i.entityThresholdsConfig=o}Ne(i),K(i),je(!1)},100)},[Le,K]),nt=(0,x.useCallback)((i,s)=>{W.set("did_load_recommendation",!1),"threshold_direction"===i?W.set("entity_threshold_direction",s):"analysis_window"===i?W.set("entity_recommendation_training_window",s):"start_date"===i?W.set("entity_recommendation_start_date",s):"apply_as"===i&&W.set("entity_recommendation_apply_as_value",s)},[W]),handleEntityThresholdTypeChange=i=>{var s=(0,N.default)(Ie.thresholdObj),o=W.get("entity_threshold_configuration")||{};if(i===_e.THRESHOLD_TYPE_OPTIONS[0].value)if(s.isTimeVariateThresholds=!1,s.isAdaptiveThresholdsEnabled=!1,Ie.entity.entity_title in o)o[Ie.entity.entity_title]=_objectSpread(_objectSpread({},o[Ie.entity.entity_title]),{},{time_variate_thresholds:!1,adaptive_thresholds_is_enabled:!1});else{var h=T.findIndex(i=>Ie.entity.entity_title===i.entity_title);o[Ie.entity.entity_title]=_objectSpread(_objectSpread({},T[h]),{},{time_variate_thresholds:!1,adaptive_thresholds_is_enabled:!1})}else if(i===_e.THRESHOLD_TYPE_OPTIONS[2].value)if(s.isTimeVariateThresholds=!0,s.isAdaptiveThresholdsEnabled=!0,Ie.entity.entity_title in o)o[Ie.entity.entity_title]=_objectSpread(_objectSpread({},o[Ie.entity.entity_title]),{},{time_variate_thresholds:!0,adaptive_thresholds_is_enabled:!0});else{var v=T.findIndex(i=>Ie.entity.entity_title===i.entity_title);o[Ie.entity.entity_title]=_objectSpread(_objectSpread({},T[v]),{},{time_variate_thresholds:!0,adaptive_thresholds_is_enabled:!0})}else{s.isTimeVariateThresholds=!0,s.isAdaptiveThresholdsEnabled=!1;var y=s.timeVariateThresholdsSpecification.policies;if(Object.keys(y).forEach(i=>{"static"!==y[i].policy_type&&(y[i].policy_type="static")}),Ie.entity.entity_title in o)o[Ie.entity.entity_title]=_objectSpread(_objectSpread({},o[Ie.entity.entity_title]),{},{time_variate_thresholds:!0,adaptive_thresholds_is_enabled:!1,time_variate_thresholds_specification:{policies:(0,N.default)(y)}});else{var _=T.findIndex(i=>Ie.entity.entity_title===i.entity_title);o[Ie.entity.entity_title]=_objectSpread(_objectSpread({},T[_]),{},{time_variate_thresholds:!0,adaptive_thresholds_is_enabled:!1,time_variate_thresholds_specification:{policies:(0,N.default)(y)}})}}W.set("entity_threshold_configuration",o),Oe(i=>({entity:i.entity,thresholdObj:s,isReadOnly:i.isReadOnly}))},handleEntityAdaptiveTrainingWindowChange=i=>{var s=(0,N.default)(Ie.thresholdObj),o=W.get("entity_threshold_configuration")||{};if(s.adaptiveTrainingWindow=i,Ie.entity.entity_title in o)o[Ie.entity.entity_title]=_objectSpread(_objectSpread({},o[Ie.entity.entity_title]),{},{adaptive_thresholding_training_window:i});else{var h=T.findIndex(i=>Ie.entity.entity_title===i.entity_title);o[Ie.entity.entity_title]=_objectSpread(_objectSpread({},T[h]),{},{adaptive_thresholding_training_window:i})}W.set("entity_threshold_configuration",o),Oe(i=>({entity:i.entity,thresholdObj:s,isReadOnly:i.isReadOnly}))},getThresholdType=i=>i.isTimeVariateThresholds?i.isAdaptiveThresholdsEnabled?_e.THRESHOLD_TYPE_OPTIONS[2].value:_e.THRESHOLD_TYPE_OPTIONS[1].value:_e.THRESHOLD_TYPE_OPTIONS[0].value,rt=(0,x.useCallback)(()=>{Ke(!0)},[]),st=(0,x.useCallback)(()=>{Ke(!1)},[]),lt=(0,x.useCallback)(()=>{Ke(!1),W.get("entity_recommendation_training_window")||W.set("entity_recommendation_training_window",_e.ANALYSIS_WINDOW_OPTIONS[2].value),W.get("entity_recommendation_start_date")||W.set("entity_recommendation_start_date",(0,re.default)().subtract(_e.ANALYSIS_WINDOW_OPTIONS[2].days,"days").unix()),W.get("entity_recommendation_apply_as_value")||W.set("entity_recommendation_apply_as_value",_e.RECOMMENDATION_APPLY_AS_OPTIONS[0].value),W.get("entity_threshold_direction")||W.set("entity_threshold_direction",_e.THRESHOLD_CONFIGURATION_OPTIONS[0].value),W.set("is_entity_level_thresholding",!0),W.set("is_entity_recommendation_async_job_required",!0),y===ve.SERVICE_KPI_ENTITIES_RETRIEVE_STATUS.SUCCESS?Xe():Ge(!0)},[W,y,Xe]);return x.default.createElement("div",null,x.default.createElement(ie.default,{position:"top-center"}),x.default.createElement(Ce.default,{isPSCInstalled:o,isPSCDisabled:s,onLoadRecommendationsClick:rt,onRecommendationControlsChange:nt,recommendationSettingsObject:$e}),x.default.createElement(Te.default,{kpiModel:W,isThresholdCopyInProgress:Be,isPerEntityThresholdEnabled:Ve,handleCopyThresholds:at}),(()=>{if(Ve&&(y===ve.SERVICE_KPI_ENTITIES_RETRIEVE_STATUS.IN_PROGRESS||y===de.READY||S===ve.SERVICE_KPI_ENTITIES_CONFIG_RETRIEVE_STATUS||S===de.READY))return x.default.createElement(Me,{"data-test-itsi":"entity-thresholding-wait-spinner",size:"large"});var i,s,o,v=h||!Pe&&(0,V.default)(Ie.thresholdObj)||Ie.isReadOnly,T=(i=Le,s=Ie.thresholdObj,Pe||(0,V.default)(s)?i:_objectSpread(_objectSpread({},(0,N.default)(s)),{},{alertPeriod:i.alertPeriod,baseSearch:i.baseSearch,entityStatop:i.entityStatop,searchTimeSeriesEntities:i.searchTimeSeriesEntities,entityBreakdownIdFields:i.entityBreakdownIdFields,thresholdField:i.thresholdField,thresholdType:i.thresholdType,rawSearch:i.search_time_series_entities,searchAlertEarliest:i.searchAlertEarliest,is_entity_breakdown:null===(o=i.tempKpiData)||void 0===o?void 0:o.is_entity_breakdown})),R=!(Pe||(0,V.default)(Ie.thresholdObj));return x.default.createElement(Re,null,Ve&&x.default.createElement(be.default,{updateSelectedEntityInParent:tt,kpiEntitiesData:_&&(null==_?void 0:_.results)}),x.default.createElement(Ae,null,Ye?x.default.createElement(x.default.Fragment,null,R&&x.default.createElement(xe.default,{key:T._key,selectedThresholdType:getThresholdType(T),selectedAdaptiveTrainingWindow:T.adaptiveTrainingWindow,handleThresholdTypeChange:handleEntityThresholdTypeChange,handleAdaptiveTrainingWindowChange:handleEntityAdaptiveTrainingWindowChange,isReadOnly:v}),x.default.createElement(Ee.default,{isEntityLevelPreview:!0,entityData:Ie.entity,thresholdData:T,getTimeInIso:!0,isDefaultEntityThresholdView:Pe,useRawSearch:ge}),x.default.createElement(ke.default,{isEntityLevelPreview:!0,thresholdObj:T,entityData:Ie.entity,onThresholdUpdate:it,isReadOnly:v,isDefaultEntityThresholdView:Pe,isEntityLevelThreshold:R,width:1055})):x.default.createElement(Me,{"data-test-itsi":"entity-thresholding-per-entity-level-wait-spinner",size:"large"})))})(),x.default.createElement(Se.default,{modalDataTestItsi:"entity-load-recommendations-modal",cancelButtonDataTestItsi:"entity-load-recommendations-modal-cancel-button",primaryButtonDataTestItsi:"entity-load-recommendations-modal-confirm-button",showCancel:!0,beforeClose:st,open:We,title:(0,se.gettext)("Load Recommendations"),primaryButtonLabel:(0,se.gettext)("Confirm"),primaryButtonClicked:lt},(0,se.gettext)("Loading recommendations will cause all existing threshold settings to be overwritten. Are you sure you want to load recommendations?")))}EntityThresholdingContainer.propTypes={isPSCDisabled:W.default.bool,isPSCInstalled:W.default.bool,isReadOnly:W.default.bool,kpiModel:W.default.object.isRequired,kpiEntitiesApiErrorMessage:W.default.string.isRequired,kpiEntitiesApiStatus:W.default.string.isRequired,kpiEntitiesData:W.default.object.isRequired,previewEntitiesThresholdsRecommendationSearchStatus:W.default.string.isRequired,previewEntitiesThresholdsRecommendationResults:W.default.object.isRequired,kpiEntitiesConfigApiStatus:W.default.string.isRequired,kpiEntitiesConfigData:W.default.array.isRequired,onThresholdUpdate:W.default.func.isRequired,serviceKpiEntitiesRetrieveAction:W.default.func.isRequired,previewRecommendedEntitiesThresholdsSearchRetrieveAction:W.default.func.isRequired,serviceKpiEntitiesConfigRetrieveAction:W.default.func.isRequired,useRawSearch:W.default.bool.isRequired},EntityThresholdingContainer.defaultProps={isPSCDisabled:!1,isPSCInstalled:!0,isReadOnly:!1};var Ie=(0,R.connect)(i=>({kpiEntitiesApiErrorMessage:i.services.kpiEntitiesApiErrorMessage,kpiEntitiesApiStatus:i.services.kpiEntitiesApiStatus,kpiEntitiesData:i.services.kpiEntitiesData,previewEntitiesThresholdsRecommendationSearchStatus:i.serviceDefinition.previewEntitiesThresholdsRecommendationSearchStatus,previewEntitiesThresholdsRecommendationResults:i.serviceDefinition.previewEntitiesThresholdsRecommendationResults,kpiEntitiesConfigApiErrorMessage:i.services.kpiEntitiesConfigApiErrorMessage,kpiEntitiesConfigApiStatus:i.services.kpiEntitiesConfigApiStatus,kpiEntitiesConfigData:i.services.kpiEntitiesConfigData}),i=>(0,P.bindActionCreators)({serviceKpiEntitiesRetrieveAction:me.serviceKpiEntitiesRetrieve,previewRecommendedEntitiesThresholdsSearchRetrieveAction:ge.previewRecommendedEntitiesThresholdsSearchRetrieve,serviceKpiEntitiesConfigRetrieveAction:me.serviceKpiEntitiesConfigRetrieve},i))(EntityThresholdingContainer);s.default=Ie,i.exports=s.default},3050:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_,S,T,x,R,P,L,N,V=h(o(9)),j=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),W=o(64),K=h(o(2)),U=h(o(3)),Y=h(o(97)),$=h(o(70)),X=h(o(105)),Z=h(o(47)),ee=h(o(805)),te=h(o(345)),ie=h(o(665)),ae=h(o(237)),ne=h(o(87)),re=h(o(591)),se=h(o(82)),le=h(o(89)),oe=h(o(86)),de=h(o(844)),ce=o(5),he=o(48),ue=o(100),pe=o(811),fe=o(137);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}var ge=U.default.div(v||(v=(0,V.default)(["\n display: flex;\n flex-direction: column;\n width: 226px;\n align-items: flex-start;\n margin: 0px;\n border: 1px solid ",";\n"])),de.default.gray80),me=U.default.div(y||(y=(0,V.default)(["\n display: flex;\n flex-direction: column;\n gap: 13px;\n margin: 12px;\n width: 204px;\n"]))),ve=(0,U.default)(re.default)(_||(_=(0,V.default)(["\n overflow: auto;\n height: 720px;\n width: 100%;\n"]))),ye=(0,U.default)(ne.default)(S||(S=(0,V.default)(["\n margin: 4px 0px 0px 0px;\n"]))),_e=(0,U.default)(oe.default)(T||(T=(0,V.default)(["\n float: right;\n margin-right: 12px;\n"]))),Se=(0,U.default)(ee.default)(x||(x=(0,V.default)(["\n float: right;\n margin: 4px 12px 4px 4px;\n color: ",";\n"])),de.default.successColor),be=(0,U.default)(ie.default)(R||(R=(0,V.default)(["\n float: right;\n margin-right: 11px;\n margin-top: 2px;\n color: ",";\n font-size: 22px;\n"])),de.default.infoColor),Te=(0,U.default)(te.default)(P||(P=(0,V.default)(["\n float: right;\n margin-right: 12px;\n margin-top: 2px;\n color: ",";\n font-size: 22px;\n"])),de.default.errorColor),Ee=(0,U.default)(ae.default)(L||(L=(0,V.default)(["\n background-color: ",";\n padding-left: 12px;\n height: 48px;\n &:hover {\n background-color: ",";\n }\n width: 100%;\n"])),i=>i.selected?de.default.gray80:"none",de.default.gray80),ke=U.default.div(N||(N=(0,V.default)(["\n display: inline-block;\n font-weight: bold;\n overflow: hidden;\n text-overflow: ellipsis;\n vertical-align: middle;\n white-space: nowrap;\n width: 182px;\n"])));function EntitySidePanel(i){var{kpiEntitiesData:s,updateSelectedEntityInParent:o,previewEntitiesThresholdsRecommendationSearchStatus:h,previewEntitiesThresholdsRecommendationResults:v}=i,y={entity_key:"entity_default_configuration",entity_title:(0,ce.gettext)("Default Configuration")},[_,S]=(0,j.useState)(""),[T,x]=(0,j.useState)(s),[R,P]=(0,j.useState)(""),[L,N]=(0,j.useState)(s.length?s[0]:y),[V,W]=(0,j.useState)(!1),K=(0,Y.default)((i,o)=>{var h,v,{value:y}=o,T=y.toLowerCase();if(T!==_){var R=(h=T,v=new RegExp((0,ue.regexEscapedObjectName)(h.trim()),"ig"),s.filter(i=>-1!==i.entity_title.search(v)));S(T),x(R)}},ue.DEFAULT_DEBOUNCE_DELAY),U=(0,j.useCallback)((i,s)=>{var{value:o}=s;P(o)},[]),Z=(0,j.useCallback)(i=>{N(i),o(i)},[o]),handleEntityClick=i=>()=>Z(i);(0,j.useEffect)(()=>{h===pe.PREVIEW_RECOMMENDED_ENTITIES_THRESHOLDS_SEARCH_RETRIEVE_STATUS.IN_PROGRESS&&W(!0)},[h]);var createEntityItem=(i,s)=>j.default.createElement(Ee,{"data-test-itsi":"entity-side-panel-entity-list-clickable",key:"N/A"!==i.entity_key?i.entity_key:i.entity_title,onClick:handleEntityClick(i),selected:L&&L.entity_key===i.entity_key&&L.entity_title===i.entity_title},j.default.createElement(ke,{"data-test-itsi":"entity-side-panel-entity-list-title",title:i.entity_title},i.entity_title),((i,s)=>{if(!(0,X.default)(s)&&V){if(h!==he.READY&&s>9)return j.default.createElement(be,null);if(h===pe.PREVIEW_RECOMMENDED_ENTITIES_THRESHOLDS_SEARCH_RETRIEVE_STATUS.IN_PROGRESS)return j.default.createElement(_e,null);if(h===pe.PREVIEW_RECOMMENDED_ENTITIES_THRESHOLDS_SEARCH_RETRIEVE_STATUS.ERROR)return j.default.createElement(Te,null);if(h===pe.PREVIEW_RECOMMENDED_ENTITIES_THRESHOLDS_SEARCH_RETRIEVE_STATUS.SUCCESS){var o=(0,$.default)(v.results,{entity_title:i.entity_title});return(0,X.default)(o)||o["Recommendation Flag"]!==fe.ENTITY_RECOMMENDATIONS.SUCCESSFUL&&o["Recommendation Flag"]!==fe.ENTITY_RECOMMENDATIONS.NO_PATTERN?j.default.createElement(be,null):j.default.createElement(Se,{size:1})}}return j.default.createElement("span",null)})(i,s));return j.default.createElement(ge,null,j.default.createElement(me,null,j.default.createElement(ye,{"data-test-itsi":"entity-side-panel-entity-count"},T.length," ",(0,ce.gettext)("Entities")),j.default.createElement(le.default,{appearance:"search","data-test-itsi":"entity-side-panel-entity-search-box",canClear:!0,placeholder:(0,ce.gettext)("Search..."),onChange:K}),j.default.createElement(se.default,{"data-test-itsi":"entity-side-panel-recommendation-status-select",value:R,placeholder:(0,ce.gettext)("Entity Status"),onChange:U,inline:!1},fe.ENTITY_RECOMMENDATION_STATUS.map(i=>j.default.createElement(se.default.Option,{"data-test-itsi":"entity-side-panel-recommendation-status-select-option",label:i.label,value:i.value,key:i.value})))),j.default.createElement(ve,{"data-test-itsi":"entity-side-panel-entities-scroll-container"},j.default.createElement("div",{"data-test-itsi":"entity-side-panel-entities-container"},[createEntityItem(y),...T.map((i,s)=>createEntityItem(i,s))])))}EntitySidePanel.propTypes={kpiEntitiesData:K.default.array.isRequired,updateSelectedEntityInParent:K.default.func,previewEntitiesThresholdsRecommendationSearchStatus:K.default.string.isRequired,previewEntitiesThresholdsRecommendationResults:K.default.object.isRequired},EntitySidePanel.defaultProps={updateSelectedEntityInParent:Z.default};var Ce=(0,W.connect)(i=>({previewEntitiesThresholdsRecommendationSearchStatus:i.serviceDefinition.previewEntitiesThresholdsRecommendationSearchStatus,previewEntitiesThresholdsRecommendationResults:i.serviceDefinition.previewEntitiesThresholdsRecommendationResults}),null)(EntitySidePanel);s.default=Ce,i.exports=s.default},3051:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_,S,T,x,R=h(o(9)),P=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),L=h(o(3)),N=h(o(2)),V=h(o(39)),j=h(o(56)),W=h(o(87)),K=h(o(33)),U=h(o(82)),Y=o(5),$=o(137);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}var X=L.default.div(v||(v=(0,R.default)(["\n margin: 16px 10px;\n"]))),Z=L.default.div(y||(y=(0,R.default)(["\n display: flex;\n"]))),ee=(0,L.default)(W.default)(_||(_=(0,R.default)(["\n margin-top: 10px;\n width: 150px;\n"]))),te=(0,L.default)(U.default)(S||(S=(0,R.default)(["\n width: 220px !important;\n"]))),ie=(0,L.default)(j.default)(T||(T=(0,R.default)(["\n margin-left: 16px;\n div[data-test='controls'] {\n width: 120px;\n }\n"]))),ae=(0,L.default)(K.default)(x||(x=(0,R.default)(["\n align-self: flex-end;\n margin-left: 16px;\n"])));function EntityThresholdControls(i){var{kpiModel:s,isPerEntityThresholdEnabled:o,isThresholdCopyInProgress:h,handleCopyThresholds:v}=i,[y,_]=(0,P.useState)(o?$.ENTITY_THRESHOLD_APPLY_AS_OPTIONS[1].value:$.ENTITY_THRESHOLD_APPLY_AS_OPTIONS[0].value),S=(0,P.useCallback)((i,o)=>{var{value:h}=o;_(h),h===$.ENTITY_THRESHOLD_APPLY_AS_OPTIONS[1].value?s.set("is_entity_level_thresholding",!0):s.set("is_entity_level_thresholding",!1)},[s]);(0,P.useEffect)(()=>{o&&y!==$.ENTITY_THRESHOLD_APPLY_AS_OPTIONS[1].value?_($.ENTITY_THRESHOLD_APPLY_AS_OPTIONS[1].value):o||y===$.ENTITY_THRESHOLD_APPLY_AS_OPTIONS[0].value||_($.ENTITY_THRESHOLD_APPLY_AS_OPTIONS[0].value)},[o]);var T=s.get("time_variate_thresholds")?(0,Y.gettext)("time-variant"):(0,Y.gettext)("static");return P.default.createElement(X,null,P.default.createElement(Z,null,P.default.createElement(ee,{"data-test-itsi":"entity-threshold-control-threshold-set-up-header",level:4},(0,Y.gettext)("Entity set up")),P.default.createElement(j.default,{"data-test-itsi":"entity-threshold-control-threshold-apply-as-select-control",label:(0,Y.gettext)("Apply as"),labelPosition:"top",required:!0,tooltip:$.ENTITY_THRESHOLD_APPLY_AS_TYPE_TOOLTIP},P.default.createElement(te,{"data-test-itsi":"entity-threshold-control-threshold-apply-as-select",value:y,onChange:S},$.ENTITY_THRESHOLD_APPLY_AS_OPTIONS.map(i=>P.default.createElement(U.default.Option,{"data-test-itsi":"entity-threshold-control-threshold-apply-as-select-option",label:i.label,value:i.value,key:i.value})))),y===$.ENTITY_THRESHOLD_APPLY_AS_OPTIONS[0].value?P.default.createElement(ie,{"data-test-itsi":"entity-threshold-control-threshold-copy-threshold-button-control",label:(0,Y.gettext)("Copy KPI threshold settings to global entity threshold settings?"),labelPosition:"top"},P.default.createElement(V.default,{"data-test-itsi":"entity-threshold-control-threshold-copy-threshold-button",disabled:h,label:h?(0,Y.gettext)("Copying..."):(0,Y.gettext)("Copy settings"),onClick:v})):P.default.createElement(ae,{type:"info","data-test-itsi":"entity-threshold-per-entity-threshold-info-message"},(0,Y.gettext)("The default configuration will be saved to the threshold template. Customizations for individual entities will not be stored."))),y===$.ENTITY_THRESHOLD_APPLY_AS_OPTIONS[0].value&&P.default.createElement(K.default,{type:"info","data-test-itsi":"entity-threshold-threshold-type-info-message"},(0,Y.gettext)("The thresholding type is set to"),P.default.createElement("strong",null," ",T,", "),(0,Y.gettext)("aligned with your KPI thresholding settings. To change thresholding type for entities, you must also change thresholding type for KPIs.")))}EntityThresholdControls.propTypes={kpiModel:N.default.object.isRequired,isPerEntityThresholdEnabled:N.default.bool,isThresholdCopyInProgress:N.default.bool,handleCopyThresholds:N.default.func.isRequired},EntityThresholdControls.defaultProps={isPerEntityThresholdEnabled:!1,isThresholdCopyInProgress:!1};var ne=EntityThresholdControls;s.default=ne,i.exports=s.default},3052:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_,S,T,x,R,P,L,N,V,j,W,K,U,Y,$,X,Z,ee,te,ie,ae,ne,re,se,le=h(o(11)),oe=h(o(9)),de=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),ce=h(o(516)),he=h(o(101)),ue=h(o(517)),pe=h(o(163)),fe=h(o(95)),ge=h(o(70)),me=h(o(65)),ve=h(o(45)),ye=h(o(197)),_e=h(o(53)),Se=h(o(177)),be=h(o(469)),Te=h(o(2732)),Ee=h(o(3)),ke=h(o(2)),Ce=h(o(388)),xe=h(o(453)),we=h(o(360)),Me=h(o(39)),Re=h(o(56)),Ae=h(o(87)),Ie=h(o(33)),Oe=h(o(368)),Pe=h(o(82)),De=o(40),Le=o(16),Ne=o(5),Ve=h(o(386)),He=h(o(178)),Be=h(o(2733)),je=h(o(2734)),We=h(o(2735)),Ke=o(25),Fe=o(68),Ge=o(111),Ue=o(135);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function ownKeys(i,s){var o=Object.keys(i);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(i);s&&(h=h.filter((function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable}))),o.push.apply(o,h)}return o}function _objectSpread(i){for(var s=1;s<arguments.length;s++){var o=null!=arguments[s]?arguments[s]:{};s%2?ownKeys(Object(o),!0).forEach((function(s){(0,le.default)(i,s,o[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(o,s))}))}return i}var ze=Ee.default.div(v||(v=(0,oe.default)(["\n background-color: ",";\n display: flex;\n flex-direction: column;\n height: ","px;\n width: ","px;\n"])),De.variables.white,i=>i.height,i=>i.width),Ye=Ee.default.div(y||(y=(0,oe.default)(["\n display: flex;\n height: ","px;\n width: ","px;\n"])),i=>i.height,i=>i.width),qe=Ee.default.div(_||(_=(0,oe.default)(["\n display: flex;\n gap: 12px;\n margin-right: 20px;\n"]))),$e=(0,Ee.default)(Pe.default)(S||(S=(0,oe.default)(["\n width: 240px !important;\n"]))),Je=Ee.default.div(T||(T=(0,oe.default)(["\n align-self: end;\n"]))),Xe=(0,Ee.default)(we.default)(x||(x=(0,oe.default)(["\n margin-right: 5px;\n"]))),Ze=(0,Ee.default)(Ie.default)(R||(R=(0,oe.default)(["\n margin: 10px 14px;\n"]))),Qe=Ee.default.div(P||(P=(0,oe.default)(["\n flex-direction: column;\n display: flex;\n gap: 12px;\n min-width: ",";\n"])),i=>i.width),et=(0,Ee.default)(Me.default)(L||(L=(0,oe.default)(["\n align-items: center;\n display: flex;\n margin-top: 5px;\n width: 120px !important;\n"]))),tt=(0,Ee.default)(Me.default)(N||(N=(0,oe.default)(["\n align-items: center;\n align-self: end;\n display: flex;\n flex-grow: 0;\n margin: 0px auto 0px 12px;\n padding: 0px 14px;\n height: fit-content;\n"]))),it=Ee.default.div(V||(V=(0,oe.default)(["\n overflow-y: scroll;\n padding: 3px 0px 14px 0px;\n"]))),at=Ee.default.div(j||(j=(0,oe.default)(["\n font-weight: bold;\n min-width: 75px;\n"]))),nt=(0,Ee.default)(Pe.default)(W||(W=(0,oe.default)(["\n margin-left: 0px;\n width: 120px !important;\n"]))),rt=(0,Ee.default)(Pe.default)(K||(K=(0,oe.default)(["\n margin-left: 0px;\n width: 180px !important;\n"]))),st=Ee.default.div(U||(U=(0,oe.default)(["\n display: flex;\n flex-direction: column-reverse;\n gap: 5px;\n"]))),lt=Ee.default.div(Y||(Y=(0,oe.default)(["\n display: flex;\n gap: 176px;\n"]))),ot=Ee.default.div($||($=(0,oe.default)(["\n margin-bottom: 5px;\n"]))),dt=Ee.default.div(X||(X=(0,oe.default)(["\n display: flex;\n flex-direction: row;\n gap: 10px;\n width: fit-content;\n"]))),ct=(0,Ee.default)(Oe.default)(Z||(Z=(0,oe.default)(["\n width: 86px;\n span::after {\n content: ",";\n padding: 0px 8px;\n }\n"])),i=>i.unitStr?"'".concat(i.unitStr,"'"):""),ht=Ee.default.div(ee||(ee=(0,oe.default)(["\n align-items: center;\n display flex;\n min-width: 80px;\n"]))),ut=Ee.default.div(te||(te=(0,oe.default)(["\n align-items: center;\n display flex;\n min-width: 80px;\n margin-left: 60px;\n"]))),pt=Ee.default.div(ie||(ie=(0,oe.default)(["\n display: flex;\n flex-direction: 'row';\n gap: ",";\n margin-top: 15px;\n"])),i=>i.isReadOnly?"30px":"10px"),ft=Ee.default.div(ae||(ae=(0,oe.default)(["\n display: flex;\n flex-direction: column;\n gap: 4px;\n"]))),gt=(0,Ee.default)(Ce.default)(ne||(ne=(0,oe.default)(["\n color: ",";\n margin-right: 6px;\n margin-bottom: 2px;\n"])),i=>i.color),mt=(0,Ee.default)(Re.default)(re||(re=(0,oe.default)(["\n margin-left: 12px;\n margin-bottom: 0px;\n"]))),vt=(0,Ee.default)(xe.default)(se||(se=(0,oe.default)(["\n color: ",";\n &:hover {\n color: ",";\n }\n"])),De.variables.linkColor,De.variables.linkColorHover);function ThresholdConfigurationView(i){var{isEntityLevelPreview:s,height:o,width:h,isReadOnly:v,thresholdObj:y,onThresholdUpdate:_,isDefaultEntityThresholdView:S,isEntityLevelThreshold:T,entityObj:x}=i,R=(0,Ue.getSortedThresholdPolicies)(y.timeVariateThresholdsSpecification.policies)[0],[P,L]=(0,de.useState)(y.isTimeVariateThresholds?R._key:null),[N,V]=(0,de.useState)(0),[j,W]=(0,de.useState)(!1),[K,U]=(0,de.useState)(!1),[Y,$]=(0,de.useState)(!1),[X,Z]=(0,de.useState)(!1),[ee,te]=(0,de.useState)(y),[ie,ae]=(0,de.useState)(x),ne=(0,de.useMemo)(()=>{if(!ee.isTimeVariateThresholds)return h-321;var i=(0,ge.default)(ee.timeVariateThresholdsSpecification.policies,{_key:P});return!i||ee.isAdaptiveThresholdsEnabled&&"static"!==i.policy_type?h-663:h-572},[ee.isAdaptiveThresholdsEnabled,ee.isTimeVariateThresholds,ee.timeVariateThresholdsSpecification.policies,P,h]),re=(0,de.useCallback)(i=>{te(s=>(0,ce.default)(s,i)),_(i)},[_]),se=(0,de.useCallback)(i=>{var o=(0,he.default)(i);if(ee.isTimeVariateThresholds){var{policies:h}=ee.timeVariateThresholdsSpecification,v=(0,_e.default)(h,i=>{if(i._key!==P)return i;var h=(0,he.default)(i),v=s?"entity_thresholds":"aggregate_thresholds";return h[v]=o,o.thresholdLevels&&(h[v]=(0,Ue.updateThresholdBoundaries)(h[v])),h});re({timeVariateThresholdsSpecification:{policies:v}})}else{o.thresholdLevels&&(o=(0,Ue.updateThresholdBoundaries)(o)),re({[s?"entityThresholdsConfig":"aggregateThresholdsConfig"]:o})}},[ee.isTimeVariateThresholds,ee.timeVariateThresholdsSpecification,re,P,s]),le=(0,de.useCallback)(i=>{var s,{policies:o}=ee.timeVariateThresholdsSpecification;s=!!(0,ge.default)(o,{_key:i._key})?(0,_e.default)(o,s=>s._key!==i._key?s:i):(0,ue.default)(o,i);var h={timeVariateThresholdsSpecification:{policies:(0,Ue.getSortedThresholdPolicies)(s)}};re(h),L(i._key),V(N+1)},[ee,re,N]),oe=(0,de.useCallback)(()=>{if(P){var i=(0,fe.default)(ee.timeVariateThresholdsSpecification.policies,i=>i._key!==P);re({timeVariateThresholdsSpecification:{policies:i}})}L(null)},[P,ee.timeVariateThresholdsSpecification.policies,re]),Ee=(0,de.useCallback)(()=>{W(!1)},[]),ke=(0,de.useCallback)(()=>{U(!1)},[]),Ce=(0,de.useCallback)(()=>{Z(!1),$(!0)},[]),xe=(0,de.useCallback)(()=>{Z(!1),$(!1)},[]),we=(0,de.useCallback)((i,s,o,h)=>{var v=h?i.aggregate_thresholds:i.entity_thresholds,y=function copyBaseSeverityAndThresholdValues(i,s){var o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],h=(0,Ue.getThresholdBaseSeveritySettings)(i,!1),v=(0,_e.default)(s,"_key"),y=(0,_e.default)(ee.timeVariateThresholdsSpecification.policies,s=>{if(!(0,me.default)(v,s._key))return s;var y=o?"aggregate_thresholds":"entity_thresholds",_=(0,ce.default)(_objectSpread({},s[y]),h,{thresholdLevels:i.thresholdLevels});return(0,ce.default)(_objectSpread({},s),{[y]:_})});re({timeVariateThresholdsSpecification:{policies:y}})};s.length&&y(v,s),o.length&&y(v,o,!1)},[ee.timeVariateThresholdsSpecification.policies,re]),handleTimePolicyChange=(i,s)=>{var{value:o}=s;L(o)},onChangePolicyType=(i,s)=>{var{value:o}=s,{policies:h}=ee.timeVariateThresholdsSpecification,v=(0,_e.default)(h,i=>{if(i._key!==P)return i;var s=_objectSpread({},i);return s.policy_type=o,s});re({timeVariateThresholdsSpecification:{policies:v}})},getThresholdConfiguration=()=>{if(ee.isTimeVariateThresholds){var i=(0,ge.default)(ee.timeVariateThresholdsSpecification.policies,{_key:P});return s?i.entity_thresholds:i.aggregate_thresholds}return s?ee.entityThresholdsConfig:ee.aggregateThresholdsConfig},addNewThreshold=()=>{var i=getThresholdConfiguration(),s=i.thresholdLevels.length?(0,ye.default)(i.thresholdLevels).severityValue:i.baseSeverityValue,o=6===s?1:s+1,h=(0,ge.default)(Ge.DEFAULT_SEVERITY_LEVELS,["severityValue",o]);h.id=(0,Ke.generateUUID)();var v=(0,Ue.addThreshold)(h,i);se(v)},onChangeSeverity=(i,s)=>{var{name:o,value:h}=s,v=getThresholdConfiguration(),y=(0,ge.default)(Ge.DEFAULT_SEVERITY_LEVELS,["severityLabel",h]);if("base"===o){var _={baseSeverityLabel:y.severityLabel,baseSeverityValue:y.severityValue,baseSeverityColor:y.severityColor,baseSeverityColorLight:y.severityColorLight},S=(0,Se.default)(_objectSpread({},v),_);se(S)}else{var T=(0,_e.default)(v.thresholdLevels,i=>i.id!==o?i:(0,Se.default)(_objectSpread({},i),y)),x=(0,Se.default)(_objectSpread({},v),{thresholdLevels:T});se(x)}},onChangeThresholdValue=(i,o)=>{var{name:h,value:v}=o,y=getThresholdConfiguration(),_=ee.isTimeVariateThresholds?(0,ge.default)(ee.timeVariateThresholdsSpecification.policies,{_key:P}):{},S=(T||!s)&&ee.isTimeVariateThresholds&&ee.isAdaptiveThresholdsEnabled&&"static"!==_.policy_type?"dynamicParam":"thresholdValue",x=(0,_e.default)(y.thresholdLevels,i=>i.id!==h?i:(0,Se.default)(_objectSpread({},i),{[S]:v})),R=(0,Se.default)(_objectSpread({},y),{thresholdLevels:x});se(R)};(0,de.useEffect)(()=>{P&&ie.entity_title===x.entity_title?!(0,ge.default)(y.timeVariateThresholdsSpecification.policies,{_key:P})&&L(null):(P!==R._key&&L(R._key),ae(x));te(y)},[y]);return de.default.createElement(ze,{height:o+64,width:h},ee.isTimeVariateThresholds&&(()=>{var i,s,{policies:o}=ee.timeVariateThresholdsSpecification,h=(0,ge.default)(o,{_key:P});return de.default.createElement(de.default.Fragment,null,de.default.createElement(qe,null,de.default.createElement(Ae.default,{"data-test-itsi":"entity-thresholding-time-policy-controls-heading",level:4},(0,Ne.gettext)("Time policy settings")),de.default.createElement(mt,{"data-test-itsi":"entity-thresholding-time-policy-select-control",label:(0,Ne.gettext)("Time policy"),labelPosition:"top",required:!0},de.default.createElement($e,{"data-test-itsi":"entity-thresholding-time-policy-select",value:P,onChange:handleTimePolicyChange},(0,_e.default)((0,Ue.getSortedThresholdPolicies)(o),i=>de.default.createElement(Pe.default.Option,{label:i.title,value:i._key,key:i._key,truncate:!0})))),!v&&de.default.createElement(Je,{"data-test-itsi":"entity-threshold-time-policy-action-wrapper"},de.default.createElement(Ve.default,{actionItems:[{handleClick:()=>{Z(!0),$(!0)},isVisible:P!==Ue.DEFAULT_POLICY_KEY,label:(0,Ne.gettext)("Edit"),action:"edit"},{handleClick:()=>W(!0),isVisible:P!==Ue.DEFAULT_POLICY_KEY,label:(0,Ne.gettext)("Delete"),action:"delete"},{handleClick:()=>U(!0),label:(0,Ne.gettext)("Copy threshold values"),action:"copy"}],buttonLabel:"",buttonDataTestItsi:"entity-threshold-time-policy-action-dropdown",dropdownMenuStyle:{minWidth:150},toggleType:"icon-button"})),(null==h?void 0:h.policy_type)&&ee.isAdaptiveThresholdsEnabled&&!S&&de.default.createElement(mt,{"data-test-itsi":"entity-thresholding-time-policy-policy-type-select-control",label:(0,Ne.gettext)("Policy type"),labelPosition:"top",required:!0,tooltip:null!=h&&h.policy_type?null===(i=(0,ge.default)(Ue.POLICY_TYPES,{value:h.policy_type}))||void 0===i?void 0:i.explanation:null},(s=h.policy_type,v?de.default.createElement(at,null,(0,ge.default)(Ue.POLICY_TYPES,["value",s]).label):de.default.createElement(rt,{value:s,onChange:onChangePolicyType},(0,_e.default)(Ue.POLICY_TYPES,i=>de.default.createElement(Pe.default.Option,{key:i.value,label:i.label,value:i.value}))))),!v&&de.default.createElement(tt,{onClick:Ce},de.default.createElement(Xe,null),(0,Ne.gettext)("Add time policy"))),!v&&(()=>{var i=ee.isTimeVariateThresholds?(0,ge.default)(ee.timeVariateThresholdsSpecification.policies,{_key:P}):{};return de.default.createElement(de.default.Fragment,null,!(0,ve.default)(i)&&de.default.createElement(de.default.Fragment,null,de.default.createElement(He.default,{modalDataTestItsi:"delete-time-policy-modal",cancelButtonDataTestItsi:"delete-time-policy-modal-cancel-button",primaryButtonDataTestItsi:"delete-time-policy-modal-delete-button",showCancel:!0,open:j,beforeClose:Ee,modalStyles:Fe.CONFIRMATION_MODAL_STYLE,title:(0,Ne.gettext)("Delete policy"),primaryButtonLabel:(0,Ne.gettext)("Delete"),primaryButtonClicked:oe},de.default.createElement("span",{"data-test-itsi":"delete-time-policy-message"},(0,Le.sprintf)((0,Ne.gettext)("Are you sure you want to delete %s?"),(0,pe.default)(null==i?void 0:i.title)))),de.default.createElement(Be.default,{activeThresholdConfigIsAggregate:!1,selectedPolicy:i,availablePolicies:ee.timeVariateThresholdsSpecification.policies,isEntityBreakdown:!!ee.is_entity_breakdown,handleCopy:we,beforeClose:ke,open:K})),de.default.createElement(je.default,{key:X,open:Y,handleRequestClose:xe,existingPolicy:X?i:(0,Te.default)(),policies:ee.timeVariateThresholdsSpecification.policies,onUpdatePolicy:le}))})())})(),ee&&(()=>{if(ee.isTimeVariateThresholds&&!P)return de.default.createElement(Ze,{type:"info"},(0,Ne.gettext)("Select/Create a policy."));var i,y,_,R,L,V,j,W,K,U,Y,$=s?S?ee.searchTimeSeriesEntities:ee.entityBreakdownIdFields.includes(",")?"".concat(ee.baseSearch," | `aggregate_raw_compound_entity_into_limited_entity_time_series(")+"".concat(x.entity_title,", ").concat(ee.entityStatop,", ").concat(ee.thresholdField,", ").concat(ee.entityBreakdownIdFields,", ").concat(ee.searchAlertEarliest,")`"):"".concat(ee.baseSearch," | `aggregate_raw_into_limited_entity_time_series(")+"".concat(x.entity_title,", ").concat(ee.entityStatop,", ").concat(ee.thresholdField,", ").concat(ee.entityBreakdownIdFields,", ").concat(ee.searchAlertEarliest,")`"):ee.searchTimeSeriesAggregate;return de.default.createElement(Ye,{height:o,width:h},(R=getThresholdConfiguration(),L=ee.isTimeVariateThresholds?(0,ge.default)(ee.timeVariateThresholdsSpecification.policies,{_key:P}):{},V=(T||!s)&&ee.isTimeVariateThresholds&&ee.isAdaptiveThresholdsEnabled&&"static"!==L.policy_type?"dynamicParam":"thresholdValue",j=i=>de.default.createElement(gt,{color:i}),W=de.default.createElement(vt,null),K=(0,Ue.getAdornmentUnitStr)(L&&L.policy_type),U=(i,s)=>v?Ue.THRESHOLDS.filter(i=>i.value===s).map(s=>de.default.createElement(at,{key:i},j(s.boxFilledColor)," ",s.label)):de.default.createElement(nt,{key:i,name:i,value:s,onChange:onChangeSeverity},(0,_e.default)(Ue.THRESHOLDS,i=>de.default.createElement(Pe.default.Option,{key:i.value,label:i.label,value:i.value,icon:j(i.boxFilledColor)}))),Y=(i,s)=>{var{value:o}=s,h=(0,he.default)(getThresholdConfiguration()),v=(0,fe.default)([...h.thresholdLevels],i=>i.id!==o);h.thresholdLevels=v,se(h)},de.default.createElement(Qe,{width:"dynamicParam"===V?"373px":"280px"},de.default.createElement(Ae.default,{level:4},(0,Ne.gettext)("Threshold levels")),de.default.createElement(it,null,(null===(i=R.thresholdLevels)||void 0===i?void 0:i.length)>0&&de.default.createElement(lt,null,de.default.createElement(ot,null,(0,Ne.gettext)("Severity")),"dynamicParam"===V&&de.default.createElement(ot,null,(0,Ne.gettext)("Actual value"))),de.default.createElement(st,null,null===(y=R.thresholdLevels)||void 0===y?void 0:y.map(i=>de.default.createElement(dt,{key:"control".concat(i.id)},U(i.id,i.severityLabel),v?de.default.createElement(de.default.Fragment,null,de.default.createElement(at,{key:"level".concat(i.id)},i[V].toString()),"dynamicParam"===V&&de.default.createElement(ut,null,(0,be.default)(i.thresholdValue,2))):de.default.createElement(de.default.Fragment,null,de.default.createElement(ct,{key:"input".concat(i.id),name:i.id,value:i[V],onChange:onChangeThresholdValue,hideStepButtons:!0,unitStr:K}),"dynamicParam"===V&&de.default.createElement(ht,null,(0,be.default)(i.thresholdValue,2)),de.default.createElement(Me.default,{key:"delete".concat(i.id),icon:W,appearance:"pill",onClick:Y,value:i.id}))))),!v&&(null===(_=R.thresholdLevels)||void 0===_?void 0:_.length)<9&&de.default.createElement(et,{onClick:addNewThreshold},de.default.createElement(Xe,null),(0,Ne.gettext)("Add threshold")),de.default.createElement(pt,{isReadOnly:v},de.default.createElement(ft,null,(0,Ne.gettext)("Base severity"),U("base",R.baseSeverityLabel)))))),de.default.createElement(We.default,{key:"".concat(P,"-").concat(N),isTimePoliciesEnabled:ee.isTimeVariateThresholds,isReadOnly:v,height:o,width:ne,thresholdConfiguration:getThresholdConfiguration(),kpiSearch:$,onUpdateThresholdConfig:se,policyKey:P,policies:ee.timeVariateThresholdsSpecification.policies}))})())}ThresholdConfigurationView.propTypes={thresholdObj:ke.default.shape({timeVariateThresholdsSpecification:ke.default.object,is_entity_breakdown:ke.default.bool,thresholdType:ke.default.string,isTimeVariateThresholds:ke.default.bool,isAdaptiveThresholdsEnabled:ke.default.bool,search_time_series_aggregate:ke.default.string,search_time_series_entities:ke.default.string}).isRequired,isEntityLevelPreview:ke.default.bool.isRequired,entityObj:ke.default.object,onThresholdUpdate:ke.default.func.isRequired,height:ke.default.number,width:ke.default.number,isReadOnly:ke.default.bool,isDefaultEntityThresholdView:ke.default.bool,isEntityLevelThreshold:ke.default.bool},ThresholdConfigurationView.defaultProps={entityObj:{},height:400,width:1120,isReadOnly:!1,isDefaultEntityThresholdView:!1,isEntityLevelThreshold:!0};var yt=ThresholdConfigurationView;s.default=yt,i.exports=s.default},3053:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_,S,T=h(o(9)),x=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),R=h(o(3)),P=h(o(2)),L=h(o(47)),N=h(o(56)),V=h(o(82)),j=h(o(87)),W=o(5),K=o(137),U=o(76);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}var Y=R.default.div(v||(v=(0,T.default)(["\n margin: 16px 0px;\n display: flex;\n"]))),$=(0,R.default)(j.default)(y||(y=(0,T.default)(["\n margin-top: 10px;\n width: 150px;\n"]))),X=(0,R.default)(N.default)(_||(_=(0,T.default)(["\n margin-left: 16px;\n"]))),Z=(0,R.default)(V.default)(S||(S=(0,T.default)(["\n width: 220px !important;\n"])));function ThresholdTypeControl(i){var{isReadOnly:s,selectedAdaptiveTrainingWindow:o,selectedThresholdType:h,handleThresholdTypeChange:v,handleAdaptiveTrainingWindowChange:y}=i,[_,S]=(0,x.useState)(h),[T,R]=(0,x.useState)(o),P=(0,x.useCallback)((i,s)=>{var{value:o}=s;o!==_&&(S(o),v(o))},[v,_]),L=(0,x.useCallback)((i,s)=>{var{value:o}=s;o!==T&&(R(o),y(o))},[T,y]);return x.default.createElement(Y,null,x.default.createElement($,{"data-test-itsi":"threshold-type-control-heading",level:4},(0,W.gettext)("Settings")),x.default.createElement(N.default,{"data-test-itsi":"threshold-type-control-group",label:(0,W.gettext)("Thresholding Type"),labelPosition:"top",required:!0},x.default.createElement(Z,{"data-test-itsi":"threshold-type-select",value:_,onChange:P,disabled:s},K.THRESHOLD_TYPE_OPTIONS.map(i=>x.default.createElement(V.default.Option,{"data-test-itsi":"threshold-type-select-option",label:i.label,value:i.value,key:i.value})))),"adaptive"===_&&x.default.createElement(X,{"data-test-itsi":"threshold-type-adaptive-training-window-control",label:(0,W.gettext)("Training Window"),labelPosition:"top",required:!0,tooltip:K.AT_TRAINING_WINDOW_TOOLTIP},x.default.createElement(V.default,{"data-test-itsi":"threshold-type-adaptive-training-window-select",value:T,onChange:L,disabled:s},U.KPI_TIME_PRESETS.slice(0,2).map(i=>x.default.createElement(V.default.Option,{"data-test-itsi":"threshold-type-adaptive-training-window-select-option",label:i.label,value:i.value,key:i.value})))))}ThresholdTypeControl.propTypes={selectedThresholdType:P.default.string,selectedAdaptiveTrainingWindow:P.default.string,handleThresholdTypeChange:P.default.func,handleAdaptiveTrainingWindowChange:P.default.func,isReadOnly:P.default.bool},ThresholdTypeControl.defaultProps={selectedThresholdType:K.THRESHOLD_TYPE_OPTIONS[0].value,selectedAdaptiveTrainingWindow:U.KPI_TIME_PRESETS[0].value,handleThresholdTypeChange:L.default,handleAdaptiveTrainingWindowChange:L.default,isReadOnly:!1};var ee=ThresholdTypeControl;s.default=ee,i.exports=s.default},3054:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),y=h(o(47)),_=h(o(2)),S=h(o(595)),T=o(5),x=o(135),R=h(o(568));function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}var P=v.default.createElement(R.default,{viewBox:"0 0 18 18","data-test-itsi":"thresholding-content-tab-".concat(x.KPI_THRESHOLD_TYPES.AGGREGATE,"-recommendation-icon")});function KpiThresholdingContentTabView(i){var{showRecommendationIcon:s,handleTabChange:o}=i,[h,y]=(0,v.useState)(x.KPI_THRESHOLD_TYPES.AGGREGATE),_=(0,v.useCallback)((i,s)=>{var{selectedTabId:h}=s;y(h),o(h)},[o]);return v.default.createElement(S.default,{"data-test-itsi":"thresholding-content-tab-bar",activeTabId:h,onChange:_,iconSize:"inline"},v.default.createElement(S.default.Tab,{"data-test-itsi":"thresholding-content-tab-".concat(x.KPI_THRESHOLD_TYPES.AGGREGATE),label:(0,T.gettext)("KPI Thresholding"),tabId:x.KPI_THRESHOLD_TYPES.AGGREGATE,icon:s?P:""}),v.default.createElement(S.default.Tab,{"data-test-itsi":"thresholding-content-tab-".concat(x.KPI_THRESHOLD_TYPES.ENTITY),label:(0,T.gettext)("Entity Thresholding"),tabId:x.KPI_THRESHOLD_TYPES.ENTITY}))}KpiThresholdingContentTabView.propTypes={handleTabChange:_.default.func,showRecommendationIcon:_.default.bool},KpiThresholdingContentTabView.defaultProps={handleTabChange:y.default,showRecommendationIcon:!1};var L=KpiThresholdingContentTabView;s.default=L,i.exports=s.default},3055:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_,S,T,x,R,P,L,N,V,j,W=h(o(11)),K=h(o(9)),U=_interopRequireWildcard(o(0)),Y=o(64),$=o(59),X=h(o(2)),Z=h(o(3)),ee=_interopRequireWildcard(o(183)),te=h(o(101)),ie=h(o(42)),ae=h(o(45)),ne=h(o(110)),re=_interopRequireWildcard(o(550)),se=o(509),le=h(o(336)),oe=h(o(33)),de=h(o(96)),ce=h(o(75)),he=h(o(590)),ue=h(o(86)),pe=o(16),fe=o(5),ge=o(40),me=h(o(568)),ve=o(25),ye=o(111),_e=o(135),Se=o(77),be=o(804),Te=o(634),Ee=o(1603),ke=o(811),Ce=o(424),xe=o(1591),we=o(119),Me=o(185),Re=o(137),Ae=h(o(178)),Ie=h(o(3056)),Oe=h(o(3058)),Pe=h(o(1650)),De=h(o(1648)),Le=h(o(1649));function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}return h.default=i,o&&o.set(i,h),h}function ownKeys(i,s){var o=Object.keys(i);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(i);s&&(h=h.filter((function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable}))),o.push.apply(o,h)}return o}function _objectSpread(i){for(var s=1;s<arguments.length;s++){var o=null!=arguments[s]?arguments[s]:{};s%2?ownKeys(Object(o),!0).forEach((function(s){(0,W.default)(i,s,o[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(o,s))}))}return i}var Ne=Z.default.div(v||(v=(0,K.default)(["\n display: flex;\n flex-direction: column;\n position: relative;\n margin: 0px;\n padding: 12px;\n border: 1px solid ",";\n"])),ge.variables.gray80),Ve=Z.default.div(y||(y=(0,K.default)(["\n display: flex;\n"]))),He=Z.default.div(_||(_=(0,K.default)(["\n display: flex;\n flex-direction: row;\n width: 1000px;\n"]))),Be=Z.default.span(S||(S=(0,K.default)(["\n padding: 10px;\n"]))),je=(0,Z.default)(ue.default)(T||(T=(0,K.default)(["\n align-self: center;\n vertical-align: middle;\n"]))),We=Z.default.span(x||(x=(0,K.default)(["\n padding: 6px 0;\n min-width: calc(100vw - 20px * 4);\n"]))),Ke=Z.default.div(R||(R=(0,K.default)(["\n padding-top: 10px;\n"]))),Fe=(0,Z.default)(oe.default)(P||(P=(0,K.default)(["\n margin: 20px;\n"]))),Ge=(0,Z.default)(oe.default)(L||(L=(0,K.default)(["\n margin: 20px 0 0;\n"]))),Ue=(0,Z.default)(le.default.Item)(N||(N=(0,K.default)(["\n display: flex;\n"]))),ze=(0,Z.default)(me.default)(V||(V=(0,K.default)(["\n margin-right: 4px;\n"]))),Ye=(0,Z.default)(ce.default)(j||(j=(0,K.default)(["\n margin-left: 4px;\n margin-right: 4px;\n"]))),qe=(0,re.makeCreateToast)(re.default);function KpiThresholdingSectionContainer(i){var{isPSCDisabled:s,isPSCInstalled:o,isReadOnly:h,kpiModel:v,onThresholdUpdate:y,useRawSearch:_,healthAnalyticsConsoleRecommendationsSearchRetrieveAction:S,healthAnalyticsConsoleRecommendationsResultsRetrieveAction:T,healthAnalyticsConsoleRecommendationsSearchResetAction:x,recommendationSearchSid:R,recommendationSearchStatus:P,recommendationSearchErrorMessage:L,recommendationResults:N,thresholdRecommendationKPIDataAvailabilitySearchRetrieveAction:V,thresholdRecommendationKPIDataAvailabilitySearchStatus:j,thresholdRecommendationKPIDataAvailabilitySearchResults:W}=i,[K,Y]=(0,U.useState)((i=>{var s,o,{_key:h,title:y,alert_period:_,aggregate_thresholds:S,aggregate_thresholds_alert_enabled:T,aggregate_thresholds_custom_alert_enabled:x,aggregate_thresholds_custom_alert_rules:R,aggregate_outlier_detection_enabled:P,outlier_detection_algo:L,outlier_detection_sensitivity:N,base_search:V,entity_statop:j,entity_thresholds:W,entity_breakdown_id_fields:K,search_time_series_aggregate:U,search_time_series_entities:Y,threshold_field:$,time_variate_thresholds:X,time_variate_thresholds_specification:Z,adaptive_thresholds_is_enabled:ee,adaptive_thresholding_training_window:te,search_alert_earliest:ie,recommendation_training_window:ae}=i;return{_key:h,name:y,isAdaptiveThresholdsEnabled:ee,isKpiAlertingEnabled:T,isKpiCustomAlertingEnabled:x,kpiCustomAlertRules:R,isOutlierDetectionEnabled:P,outlierDetectionAlgorithm:L||"stdev",outlierDetectionSensitivity:N||2,adaptiveTrainingWindow:te||"7 days",isTimeVariateThresholds:X,baseSearch:V,entityStatop:j,searchTimeSeriesAggregate:U,searchTimeSeriesEntities:Y,entityBreakdownIdFields:K,thresholdField:$,searchAlertEarliest:ie,recommendationTrainingWindow:ae,aggregateThresholdsConfig:_objectSpread(_objectSpread({},S),{},{thresholdLevels:S.thresholdLevels.models.map(i=>{var{severityColor:s,thresholdValue:o,severityValue:h,severityColorLight:v,dynamicParam:y,severityLabel:_}=i.toJSON();return{severityColor:s,thresholdValue:o,severityValue:h,severityColorLight:v,dynamicParam:y,severityLabel:_}})}),entityThresholdsConfig:_objectSpread(_objectSpread({},W),{},{thresholdLevels:W.thresholdLevels.models.map(i=>{var{severityColor:s,thresholdValue:o,severityValue:h,severityColorLight:v,dynamicParam:y,severityLabel:_}=i.toJSON();return{severityColor:s,thresholdValue:o,severityValue:h,severityColorLight:v,dynamicParam:y,severityLabel:_}})}),timeVariateThresholdsSpecification:(s=Z.get("policies"),o={policies:{}},s.models&&s.models.forEach(i=>{var{id:s}=i,{title:h,aggregate_thresholds:v,entity_thresholds:y,policy_type:_,time_blocks:S}=i.toJSON()[s],{thresholdLevels:T,gaugeMin:x,gaugeMax:R,isMinStatic:P,isMaxStatic:L,renderBoundaryMin:N,renderBoundaryMax:V,baseSeverityValue:j,baseSeverityColor:W,baseSeverityColorLight:K,baseSeverityLabel:U,metricField:Y}=v;o.policies[s]={title:h,aggregate_thresholds:{gaugeMax:R,thresholdLevels:T.models.map(i=>{var{severityColor:s,thresholdValue:o,severityValue:h,severityColorLight:v,dynamicParam:y,severityLabel:_}=i.toJSON();return{severityColor:s,thresholdValue:o,severityValue:h,severityColorLight:v,dynamicParam:y,severityLabel:_}}),isMaxStatic:L,gaugeMin:x,baseSeverityLabel:U,baseSeverityColor:W,metricField:Y,baseSeverityValue:j,baseSeverityColorLight:K,renderBoundaryMin:N,renderBoundaryMax:V,isMinStatic:P},entity_thresholds:{gaugeMax:y.gaugeMax,thresholdLevels:y.thresholdLevels.models.map(i=>{var{severityColor:s,thresholdValue:o,severityValue:h,severityColorLight:v,dynamicParam:y,severityLabel:_}=i.toJSON();return{severityColor:s,thresholdValue:o,severityValue:h,severityColorLight:v,dynamicParam:y,severityLabel:_}}),isMaxStatic:y.isMaxStatic,gaugeMin:y.gaugeMin,baseSeverityLabel:y.baseSeverityLabel,baseSeverityColor:y.baseSeverityColor,metricField:y.metricField,baseSeverityValue:y.baseSeverityValue,baseSeverityColorLight:y.baseSeverityColorLight,renderBoundaryMin:y.renderBoundaryMin,renderBoundaryMax:y.renderBoundaryMax,isMinStatic:y.isMinStatic},policy_type:_,time_blocks:S}}),o),thresholdType:_e.KPI_THRESHOLD_TYPES.AGGREGATE,rawSearch:i.search_time_series_aggregate,alertPeriod:_,tempKpiData:_objectSpread(_objectSpread({},i),{},{adaptive_thresholding_training_window:v.get("adaptive_thresholding_training_window"),time_variate_thresholds_specification:JSON.parse(JSON.stringify(Z.toJSON()))})}})(v.toJSON())),[$,X]=(0,U.useState)(!1),[Z,re]=(0,U.useState)(""),[oe,ue]=(0,U.useState)(!1),[ge,me]=(0,U.useState)(!1),[be,Ee]=(0,U.useState)(!1),[$e,Je]=(0,U.useState)({}),[Xe,Ze]=(0,U.useState)(!1),[Qe,et]=(0,U.useState)({}),[tt,it]=(0,U.useState)(!1),at={analysisWindowValue:v.get("recommendation_training_window")||Re.ANALYSIS_WINDOW_OPTIONS[1].value,analysisWindowStartDate:v.get("recommendation_start_date")||(0,ne.default)().subtract(Re.ANALYSIS_WINDOW_OPTIONS[1].days,"days").unix(),recommendationApplyAsValue:v.get("recommendation_apply_as_value")||Re.RECOMMENDATION_APPLY_AS_OPTIONS[0].value,thresholdConfigValue:v.get("threshold_direction")||Re.THRESHOLD_CONFIGURATION_OPTIONS[0].value},nt=(0,U.useRef)();(0,U.useEffect)(()=>(nt.current=null,()=>clearTimeout(nt.current)),[]);var rt=(0,U.useCallback)(i=>{var s,o=_objectSpread({},K);null!==(s=i.timeVariateThresholdsSpecification)&&void 0!==s&&s.policies&&(o.timeVariateThresholdsSpecification=i.timeVariateThresholdsSpecification),i.aggregateThresholdsConfig&&(o.aggregateThresholdsConfig=i.aggregateThresholdsConfig),Y(o),y(o)},[K,y]),st=(0,U.useCallback)((i,s)=>{v.set("did_load_recommendation",!1),"threshold_direction"===i?v.set("threshold_direction",s):"analysis_window"===i?v.set("recommendation_training_window",s):"start_date"===i?v.set("recommendation_start_date",s):"apply_as"===i&&v.set("recommendation_apply_as_value",s)},[v]),lt=(0,U.useCallback)(i=>{var s=_objectSpread({},K);if("adaptive"===i)s.isTimeVariateThresholds=!0,s.isAdaptiveThresholdsEnabled=!0,Y(s),v.set("time_variate_thresholds",!0),v.set("adaptive_thresholds_is_enabled",!0);else if("time"===i){var o=s.timeVariateThresholdsSpecification.policies;Object.keys(o).forEach(i=>{"static"!==o[i].policy_type&&(o[i].policy_type="static")}),s.isTimeVariateThresholds=!0,s.isAdaptiveThresholdsEnabled=!1,s.timeVariateThresholdsSpecification.policies=o,Y(s),v.set("time_variate_thresholds",!0),v.set("adaptive_thresholds_is_enabled",!1),y(s)}else s.isTimeVariateThresholds=!1,s.isAdaptiveThresholdsEnabled=!1,Y(s),v.set("time_variate_thresholds",!1),v.set("adaptive_thresholds_is_enabled",!1);Je({})},[K,v,y]),ot=(0,U.useCallback)(i=>{var s=_objectSpread({},K);s.isKpiAlertingEnabled=i,Y(s),v.set("aggregate_thresholds_alert_enabled",i)},[K,v]),dt=(0,U.useCallback)(i=>{var s=_objectSpread({},K);s.adaptiveTrainingWindow=i,Y(s),v.set("adaptive_thresholding_training_window",i)},[K,v]),ct=(0,U.useCallback)(i=>{var s=_objectSpread({},K);s.isOutlierDetectionEnabled=i,Y(s),v.set("aggregate_outlier_detection_enabled",i)},[K,v]),ht=(0,U.useCallback)(i=>{var s=_objectSpread({},K);s.outlierDetectionAlgorithm=i,Y(s),v.set("outlier_detection_algo",i)},[K,v]),ut=(0,U.useCallback)(i=>{var s=_objectSpread({},K);s.outlierDetectionSensitivity=i,Y(s),v.set("outlier_detection_sensitivity",i)},[K,v]),pt=(0,U.useCallback)(()=>{Ee(!0),null!=Qe&&Qe.searchJobSubscription&&Qe.searchJobSubscription.unsubscribe(),null!=Qe&&Qe.searchJob&&Qe.searchJob.cancel();var i=K._key,s="".concat((0,Me.getAdaptiveThresholdMetricIndexSearchForKpi)(i,null,!1)," usetempcollection collection=itsi_temporary_storage key=").concat(i);(0,we.syncTempCollection)(K._key,v.toJSON()).then(()=>{var i=de.default.create({earliest_time:K.adaptiveTrainingWindow,latest_time:"now",preview:!1,cancelOnUnload:!0,search:s},{replace:!0}),o=i.getResults().subscribe({next:()=>{(0,we.retrieveTempCollection)(K._key).then(i=>{var{policies:s}=i.data.time_variate_thresholds_specification,o=K.timeVariateThresholdsSpecification.policies;(0,ie.default)(s,(i,h)=>{var v=o[h].aggregate_thresholds.thresholdLevels,_=ee.extent(i.aggregate_thresholds.thresholdLevels.map(i=>i.thresholdValue));_[0]=Number(_[0]),_[1]=Number(_[1]),(v.isMinStatic&&_[0]<v.gaugeMin||!v.isMinStatic)&&(v.gaugeMin=_[0]-Math.abs(.1*_[0]),v.renderBoundaryMin>v.gaugeMin&&(v.renderBoundaryMin=v.gaugeMin)),(v.isMaxStatic&&_[1]>v.gaugeMax||!v.isMaxStatic)&&(v.gaugeMax=_[1]+Math.abs(.1*_[1]),v.renderBoundaryMax<v.gaugeMax&&(v.renderBoundaryMax=v.gaugeMax));var S=_objectSpread({},K);S.timeVariateThresholdsSpecification={policies:s},y(S),Y(S),Ee(!1)})})}});et({searchJob:i,searchJobSubscription:o})})},[Qe.searchJob,Qe.searchJobSubscription,K,v,y]),ft=(0,U.useCallback)(()=>{var i=U.default.createElement(We,null,U.default.createElement(je,{"data-test-itsi":"load-recommendation-wait-spinner",size:"medium"})," ",(0,fe.gettext)("Checking for KPI data in the selected time range..."));re(i);var s=v.get("recommendation_training_window")||"30d",o=v.get("recommendation_start_date")?ne.default.unix(v.get("recommendation_start_date")):ne.default.unix((0,ne.default)().subtract(s.match(/\d+/g)[0],"days").unix()),h=o.clone(),y=s.match(/\d+/g)[0];h.add(y,"days");var _={search:(0,Me.getMetricIndexEarliestTimeSearchForKPIData)([K._key]),earliest:"-".concat((0,ne.default)().diff(o,"day"),"d"),latest:(0,ne.default)().isSame(h,"day")?"now":"-".concat((0,ne.default)().diff(h,"day"),"d")};V(_)},[K,v,V]),gt=(0,U.useCallback)(()=>{ue(!0),X(!0),ft()},[ft]),handleLoadRecommendationsKPIDataSearchResponse=(i,s)=>{var o=(v.get("recommendation_training_window")||"30d").match(/\d+/g)[0],h=U.default.createElement(Ge,{type:"error",appearance:"fill"},(0,fe.gettext)("Unable to identify KPI data for the number of days selected. Update the analysis window and try again."));if(i){var y=s.length?Math.ceil((new Date-1e3*Number(s[0].earliest_data_time))/864e5):0;h=y<Number(o)&&U.default.createElement(Ge,{type:"warning",appearance:"fill"},(0,pe.sprintf)((0,fe.gettext)("You have only %(data_range)d days of summary data for this KPI."),{data_range:y}))}re(h),ue(!1)},mt=(0,U.useCallback)(()=>{X(!1)},[]),handleLoadRecommendationsNoRecommendation=i=>{var s="";switch(i){case Re.KPI_NO_RECOMMENDATIONS.CONSTANT_KPI:s=(0,fe.gettext)("We detected a constant value in your data and are unable to recommend threshold values and settings.");break;case Re.KPI_NO_RECOMMENDATIONS.INSUFFICIENT_DATA:s=(0,fe.gettext)("Your KPI does not have enough data for our system to produce targeted recommendations for the options you previously selected.");break;case Re.KPI_NO_RECOMMENDATIONS.PATTERN_SWITCH:s=(0,fe.gettext)("We could not detect a consistent pattern in your data. It appears that there is more than one pattern.");break;default:s=(0,pe.sprintf)((0,fe.gettext)("No recommendations available due to unknown reason: %(reasonCode)s"),{reasonCode:i})}qe({type:se.TOAST_TYPES.ERROR,message:s,autoDismiss:!0,dismissOnActionClick:!0,showAction:!1})},vt=function generateSeverityLevels(i){var s=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,h=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,v=[],y=[];return Object.keys(i).forEach(v=>{var _=i[v],S=Array.isArray(_)?_:[_],T=ye.DEFAULT_SEVERITY_LEVELS.find(i=>i.severityLabel===v);T&&S.forEach(i=>{var v={severityLabel:T.severityLabel,severityValue:T.severityValue,severityColor:T.severityColor,severityColorLight:T.severityColorLight,dynamicParam:s?i:0,thresholdValue:s?i*h+o:i};y.push(v)})}),s?y.sort((i,s)=>i.dynamicParam-s.dynamicParam):y.sort((i,s)=>i.thresholdValue-s.thresholdValue),y.forEach(i=>v.push(i)),v};(0,U.useEffect)(()=>{if(P===Te.HEALTH_ANALYTICS_RECOMMENDATIONS_SEARCH_RETRIEVE_STATUS.SUCCESS&&R)T(R);else if(P===Te.HEALTH_ANALYTICS_RECOMMENDATIONS_RESULTS_RETRIEVE_STATUS.SUCCESS&&N){var i,s,o;if(me(!1),null!=N&&null!==(i=N.result)&&void 0!==i&&null!==(s=i.data)&&void 0!==s&&s.length&&(null===(o=N.result.data[0])||void 0===o?void 0:o.itsi_kpi_id)===K._key){var h,_=N.result.data[0].kpi_at_configurations.length?N.result.data[0].kpi_at_configurations:[],S=_[0][xe.KPI_AT_RESULTS_FIELDS.ALGORITHM_FIELD],V=null===(h=_e.POLICY_TYPES.find(i=>S===i.value))||void 0===h?void 0:h.label.toLowerCase(),U=_[0][xe.KPI_AT_RESULTS_FIELDS.CONFIDENCE_FIELD],$=_[0][xe.KPI_AT_RESULTS_FIELDS.SCORE_FIELD],X=_[0][xe.KPI_AT_RESULTS_FIELDS.TIME_POLICY_DESCRIPTION_FIELD],Z=Re.ANALYSIS_WINDOW_OPTIONS.filter(i=>i.value===K.recommendationTrainingWindow)[0],ee=_[0][xe.KPI_AT_RESULTS_FIELDS.THRESHOLD_DIRECTION_FIELD],ie={[_e.DEFAULT_POLICY_KEY]:{aggregate_thresholds:Ce.BASE_NORMAL_THRESHOLDS,entity_thresholds:Ce.BASE_NORMAL_THRESHOLDS,policy_type:"static",time_blocks:[],title:(0,fe.gettext)("Default")}};if(_[0][xe.KPI_AT_RESULTS_FIELDS.RECOMMENDATION_FIELD]!==Re.KPI_RECOMMENDATIONS.SUCCESSFUL&&_[0][xe.KPI_AT_RESULTS_FIELDS.RECOMMENDATION_FIELD]!==Re.KPI_NO_RECOMMENDATIONS.NO_PATTERN)return void handleLoadRecommendationsNoRecommendation(_[0][xe.KPI_AT_RESULTS_FIELDS.RECOMMENDATION_FIELD]);if(_[0][xe.KPI_AT_RESULTS_FIELDS.RECOMMENDATION_FIELD]===Re.KPI_NO_RECOMMENDATIONS.NO_PATTERN){var ae=_[0][xe.KPI_AT_RESULTS_FIELDS.THRESHOLDS_FIELD].replace(/'/g,'"'),ne=JSON.parse(ae),re=vt(ne,!1),se=(0,te.default)(_e.DEFAULT_THRESHOLDS);re.sort((i,s)=>i.thresholdValue-s.thresholdValue),se.thresholdLevels=re;var le=re[re.length-1].thresholdValue,oe=le+.1*le;se.gaugeMax=oe,se.renderBoundaryMax=oe,v.set("time_variate_thresholds",!1),v.set("adaptive_thresholds_is_enabled",!1),v.set("aggregate_outlier_detection_enabled",!1);var de=_objectSpread({},K);de.isTimeVariateThresholds=!1,de.isAdaptiveThresholdsEnabled=!1,de.isOutlierDetectionEnabled=!1,de.aggregateThresholdsConfig=se,y(de),Je({algorithm:V,days:null==Z?void 0:Z.days,confidence:U,score:$,timePolicy:X}),Y(de)}else{var ce=[],he=v.get("recommendation_apply_as_value")===Re.RECOMMENDATION_APPLY_AS_OPTIONS[0].value;_.forEach(i=>{var s=(0,ve.generateUUID)(),o=[[i[xe.KPI_AT_RESULTS_FIELDS.CRON_FIELD],parseInt(i[xe.KPI_AT_RESULTS_FIELDS.DURATION_FIELD],10)]],h=(0,Se.getUserTimezoneOffset)("sec"),y=(0,_e.getPolicyTitleFromTimeBlock)(o,h),_=i[xe.KPI_AT_RESULTS_FIELDS.THRESHOLDS_FIELD],S=parseFloat(i[xe.KPI_AT_RESULTS_FIELDS.MEAN_FIELD]),T=parseFloat(i[xe.KPI_AT_RESULTS_FIELDS.STD_FIELD]),x=_.replace(/'/g,'"'),R=JSON.parse(x),P=vt(R,!0,S,T);ce.push({Algorithm:i[xe.KPI_AT_RESULTS_FIELDS.ALGORITHM_FIELD],Confidence:i[xe.KPI_AT_RESULTS_FIELDS.CONFIDENCE_FIELD],"Cron Expression":i[xe.KPI_AT_RESULTS_FIELDS.CRON_FIELD],Duration:i[xe.KPI_AT_RESULTS_FIELDS.DURATION_FIELD].toString(),"Recommendation Flag":i[xe.KPI_AT_RESULTS_FIELDS.RECOMMENDATION_FIELD],Score:i[xe.KPI_AT_RESULTS_FIELDS.SCORE_FIELD].toString(),Sensitivity:i[xe.KPI_AT_RESULTS_FIELDS.SENSITIVITY_FIELD].toString(),"Threshold Direction":i[xe.KPI_AT_RESULTS_FIELDS.THRESHOLD_DIRECTION_FIELD],Thresholds:i[xe.KPI_AT_RESULTS_FIELDS.THRESHOLDS_FIELD],"Time Policy Description":i[xe.KPI_AT_RESULTS_FIELDS.TIME_POLICY_DESCRIPTION_FIELD],itsi_kpi_id:K._key,Mean:i[xe.KPI_AT_RESULTS_FIELDS.MEAN_FIELD],Std:i[xe.KPI_AT_RESULTS_FIELDS.STD_FIELD]});var L=v.get("threshold_direction")!==Re.THRESHOLD_CONFIGURATION_OPTIONS[2].value?Ce.BASE_CRITICAL_THRESHOLDS:Ce.BASE_NORMAL_THRESHOLDS;ie[s]={_key:s,title:y,aggregate_thresholds:_objectSpread(_objectSpread({},L),{},{thresholdLevels:P}),entity_thresholds:Ce.BASE_NORMAL_THRESHOLDS,policy_type:he?i[xe.KPI_AT_RESULTS_FIELDS.ALGORITHM_FIELD]:Re.RECOMMENDATION_APPLY_AS_OPTIONS[1].value,time_blocks:o}});var ue=_[0][xe.KPI_AT_RESULTS_FIELDS.SENSITIVITY_FIELD]!==Re.OUTLIER_NO_RECOMMENDATION;v.set("adaptive_thresholds_is_enabled",he),v.set("aggregate_outlier_detection_enabled",ue),v.set("did_load_recommendation",!0),v.set("time_variate_thresholds",!0),v.set("time_variate_thresholds_specification",{policies:ie}),v.set("threshold_direction",ee),v.set("threshold_recommendations",ce);var ge=_objectSpread({},K);Je({algorithm:V,days:null==Z?void 0:Z.days,confidence:U,score:$,timePolicy:X}),ge.isAdaptiveThresholdsEnabled=he,ge.isOutlierDetectionEnabled=ue,ge.isTimeVariateThresholds=!0,ge.timeVariateThresholdsSpecification={policies:ie},_[0][xe.KPI_AT_RESULTS_FIELDS.SENSITIVITY_FIELD]!==Re.OUTLIER_NO_RECOMMENDATION&&(v.set("outlier_detection_algo",Re.OUTLIER_RECOMMENDATION_DETECTION_ALGORITHM),v.set("outlier_detection_sensitivity",Number(_[0][xe.KPI_AT_RESULTS_FIELDS.SENSITIVITY_FIELD])),ge.outlierDetectionAlgorithm=Re.OUTLIER_RECOMMENDATION_DETECTION_ALGORITHM,ge.outlierDetectionSensitivity=Number(_[0][xe.KPI_AT_RESULTS_FIELDS.SENSITIVITY_FIELD])),y(ge),Y(ge)}}else{var ye=(0,pe.sprintf)((0,fe.gettext)("Recommendation failed to be generated. No results returned. %(searchMsg)s"),{searchMsg:L});handleLoadRecommendationsNoRecommendation(ye)}x()}else P!==Te.HEALTH_ANALYTICS_RECOMMENDATIONS_SEARCH_RETRIEVE_STATUS.IN_PROGRESS&&P!==Te.HEALTH_ANALYTICS_RECOMMENDATIONS_RESULTS_RETRIEVE_STATUS.IN_PROGRESS||(Ze(!0),me(!0));j===ke.THRESHOLD_RECOMMENDATION_KPI_DATA_AVAILABILITY_SEARCH_RETRIEVE_STATUS.SUCCESS?handleLoadRecommendationsKPIDataSearchResponse(!0,W.results):j===ke.THRESHOLD_RECOMMENDATION_KPI_DATA_AVAILABILITY_SEARCH_RETRIEVE_STATUS.ERROR&&handleLoadRecommendationsKPIDataSearchResponse(!1,{})},[T,x,R,P,N,V,j,W]);var yt=(0,U.useCallback)(()=>{X(!1),v.get("recommendation_training_window")||v.set("recommendation_training_window",Re.ANALYSIS_WINDOW_OPTIONS[2].value),v.get("recommendation_start_date")||v.set("recommendation_start_date",(0,ne.default)().subtract(Re.ANALYSIS_WINDOW_OPTIONS[2].days,"days").unix()),v.get("recommendation_apply_as_value")||v.set("recommendation_apply_as_value",Re.RECOMMENDATION_APPLY_AS_OPTIONS[0].value),v.get("threshold_direction")||v.set("threshold_direction",Re.THRESHOLD_CONFIGURATION_OPTIONS[0].value),v.set("is_entity_level_thresholding",!1);var i=v.get("recommendation_training_window")||"30d",s=v.get("recommendation_start_date")?ne.default.unix(v.get("recommendation_start_date")):ne.default.unix((0,ne.default)().subtract(i.match(/\d+/g)[0],"days").unix()),o=s.clone(),h=i.match(/\d+/g)[0];o.add(h,"days");var y={search:(0,Me.getRecommendedThresholdSearchForKPIs)([K._key],null,v.get("threshold_direction")||"auto"),earliest:"-".concat((0,ne.default)().diff(s,"day"),"d"),latest:(0,ne.default)().isSame(o,"day")?"now":"-".concat((0,ne.default)().diff(o,"day"),"d")};Je({}),S(y)},[S,K._key,v]),_t=(0,U.useCallback)(()=>{it(!0)},[]),St=(0,U.useCallback)(()=>{it(!1)},[]),bt=(0,U.useCallback)((i,s)=>{var o=_objectSpread({},K);"all"===i?(o.isKpiCustomAlertingEnabled=!1,o.kpiCustomAlertRules=[],v.set({aggregate_thresholds_custom_alert_rules:[],aggregate_thresholds_custom_alert_enabled:!1})):(o.isKpiCustomAlertingEnabled=!0,o.kpiCustomAlertRules=s,v.set({aggregate_thresholds_custom_alert_rules:s,aggregate_thresholds_custom_alert_enabled:!0})),Y(o)},[K,v]),Tt=(0,U.useMemo)(()=>ge?(0,fe.gettext)("Loading recommended threshold configuration based on an analysis of your KPI..."):(0,fe.gettext)("Applying adaptive thresholds based on an analysis of your KPI..."),[ge]);return U.default.createElement("div",null,U.default.createElement(Pe.default,{isPSCInstalled:o,isPSCDisabled:s,onLoadRecommendationsClick:gt,onRecommendationControlsChange:st,recommendationSettingsObject:at}),U.default.createElement(Oe.default,{kpiData:K,onThresholdingTypeChange:lt,onKpiAlertingToggle:ot,onTrainingWindowChange:dt,onKpiAlertingRulesClick:_t,onOutlierExclusionToggle:ct,onOutlierExclusionAlgoChange:ht,onOutlierExclusionSensitivityChange:ut,onUpdateAdaptiveThresholding:pt,isUpdatingAdaptiveThresholds:be}),Xe&&$e&&!(0,ae.default)($e)&&U.default.createElement(Ke,null,U.default.createElement(Fe,{appearance:"fill",type:"info","data-test-itsi":"health-analytics-thresholding-config-container-at-recommendations-container"},U.default.createElement(he.default,{as:"p",weight:"bold"},(0,fe.gettext)("Splunk AI recommendations")),U.default.createElement(le.default,null,U.default.createElement(Ue,{"data-test-itsi":"health-analytics-thresholding-config-container-time-policy-item"},U.default.createElement(ze,{viewBox:"0 0 18 18"}),U.default.createElement(he.default,{as:"p",weight:"bold"},(0,pe.sprintf)((0,fe.gettext)("Time policies are %(areTimePoliciesEnabled)s"),{areTimePoliciesEnabled:K.isTimeVariateThresholds?(0,fe.gettext)("active"):(0,fe.gettext)("inactive")})),U.default.createElement(Ye,null,"-"),U.default.createElement(ce.default,null,(0,fe.gettext)("based on analysis of KPI behavior over time."))),K.isAdaptiveThresholdsEnabled&&U.default.createElement(Ue,{"data-test-itsi":"health-analytics-thresholding-config-container-at-item"},U.default.createElement(ze,{viewBox:"0 0 18 18"}),U.default.createElement(he.default,{as:"p",weight:"bold"},(0,pe.sprintf)((0,fe.gettext)("Adaptive thresholding with a %(days)s day analysis window using the %(algorithm)s algorithm"),{days:$e.days,algorithm:$e.algorithm})," "),U.default.createElement(Ye,null,"-"),U.default.createElement(ce.default,null,(0,fe.gettext)("this setting automatically adjusts threshold values by analyzing historical KPI behavior, and the algorithm method calculates threshold values that fit your data's behavior."))),K.isAdaptiveThresholdsEnabled&&U.default.createElement(Ue,{"data-test-itsi":"health-analytics-thresholding-config-container-outlier-item"},U.default.createElement(ze,{viewBox:"0 0 18 18"}),U.default.createElement(he.default,{as:"p",weight:"bold"},(0,pe.sprintf)((0,fe.gettext)("Outlier exclusion is active using %(outlierAlgo)s"),{outlierAlgo:Re.OUTLIER_ALGORITHM_LABEL_MAP[K.outlierDetectionAlgorithm]})," "),U.default.createElement(Ye,null,"-"),U.default.createElement(ce.default,null,(0,fe.gettext)("this setting defines outlier data points to exclude from adaptive threshold calculations to avoid data skews."))),U.default.createElement(Ue,{"data-test-itsi":"health-analytics-thresholding-config-container-description-item"},U.default.createElement(ze,{viewBox:"0 0 18 18"}),U.default.createElement(he.default,{as:"p",weight:"bold"},(0,pe.sprintf)((0,fe.gettext)("%(description)s recommended with %(confidence)s confidence (Confidence Score = %(score)s%%)"),{description:$e.timePolicy.charAt(0).toUpperCase()+$e.timePolicy.slice(1),confidence:$e.confidence,score:(100*$e.score).toFixed(2)})),U.default.createElement(Ye,null,"-"),U.default.createElement(ce.default,null,(0,fe.gettext)("settings that describe your data's patterns and are reflected in the recommendation.")))))),U.default.createElement(Ve,null,U.default.createElement(Ne,null,ge||be?U.default.createElement(He,null,U.default.createElement(Be,null,Tt),U.default.createElement(je,{size:"large"})):U.default.createElement(U.default.Fragment,null,U.default.createElement(De.default,{isEntityLevelPreview:!1,thresholdData:K,getTimeInIso:!0,useRawSearch:_}),U.default.createElement(Le.default,{isEntityLevelPreview:!1,thresholdObj:K,onThresholdUpdate:rt,isReadOnly:h,width:1055})))),U.default.createElement(Ae.default,{hideCloseButton:oe,disablePrimaryClick:oe,disableCancelClick:oe,modalDataTestItsi:"aggregate-load-recommendations-modal",cancelButtonDataTestItsi:"aggregate-load-recommendations-modal-cancel-button",primaryButtonDataTestItsi:"aggregate-load-recommendations-modal-confirm-button",showCancel:!oe,open:$,title:(0,fe.gettext)("Load Recommendations"),primaryButtonLabel:(0,fe.gettext)("Confirm"),primaryButtonClicked:yt,secondaryButtonClicked:mt,beforeClose:mt},!oe&&(0,fe.gettext)("Loading recommendations will cause all existing threshold settings to be overwritten. Are you sure you want to load recommendations?"),Z),U.default.createElement(Ie.default,{isModelOpen:tt,isCustomAlertingEnabled:K.isKpiCustomAlertingEnabled,customAlertingRules:K.kpiCustomAlertRules,handleAlertRulesUpdate:bt,handleRequestClose:St}))}KpiThresholdingSectionContainer.propTypes={isPSCDisabled:X.default.bool,isPSCInstalled:X.default.bool,isReadOnly:X.default.bool,kpiModel:X.default.object.isRequired,onThresholdUpdate:X.default.func.isRequired,useRawSearch:X.default.bool.isRequired,healthAnalyticsConsoleRecommendationsSearchRetrieveAction:X.default.func.isRequired,healthAnalyticsConsoleRecommendationsResultsRetrieveAction:X.default.func.isRequired,healthAnalyticsConsoleRecommendationsSearchResetAction:X.default.func.isRequired,recommendationSearchSid:X.default.string.isRequired,recommendationSearchStatus:X.default.string.isRequired,recommendationSearchErrorMessage:X.default.string.isRequired,recommendationResults:X.default.object.isRequired,thresholdRecommendationKPIDataAvailabilitySearchRetrieveAction:X.default.func.isRequired,thresholdRecommendationKPIDataAvailabilitySearchStatus:X.default.string.isRequired,thresholdRecommendationKPIDataAvailabilitySearchResults:X.default.object.isRequired},KpiThresholdingSectionContainer.defaultProps={isPSCDisabled:!1,isPSCInstalled:!0,isReadOnly:!1};var $e=(0,Y.connect)(i=>({recommendationSearchSid:i.healthAnalyticsConsole.recommendationSearchSid,recommendationSearchStatus:i.healthAnalyticsConsole.recommendationSearchStatus,recommendationSearchErrorMessage:i.healthAnalyticsConsole.recommendationSearchErrorMessage,recommendationResults:i.healthAnalyticsConsole.recommendationResults,thresholdRecommendationKPIDataAvailabilitySearchStatus:i.serviceDefinition.thresholdRecommendationKPIDataAvailabilitySearchStatus,thresholdRecommendationKPIDataAvailabilitySearchResults:i.serviceDefinition.thresholdRecommendationKPIDataAvailabilitySearchResults}),i=>(0,$.bindActionCreators)({healthAnalyticsConsoleRecommendationsSearchRetrieveAction:be.healthAnalyticsConsoleRecommendationsSearchRetrieve,healthAnalyticsConsoleRecommendationsResultsRetrieveAction:be.healthAnalyticsConsoleRecommendationsResultsRetrieve,healthAnalyticsConsoleRecommendationsSearchResetAction:be.healthAnalyticsConsoleRecommendationsSearchReset,thresholdRecommendationKPIDataAvailabilitySearchRetrieveAction:Ee.thresholdRecommendationKPIDataAvailabilitySearchRetrieve},i))(KpiThresholdingSectionContainer);s.default=$e,i.exports=s.default},3056:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_=h(o(9)),S=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),T=h(o(3)),x=h(o(2)),R=h(o(101)),P=h(o(252)),L=h(o(47)),N=h(o(360)),V=h(o(39)),j=h(o(56)),W=h(o(33)),K=h(o(107)),U=h(o(454)),Y=o(40),$=o(5),X=o(68),Z=o(135),ee=h(o(3057));function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}var te=(0,T.default)(K.default)(v||(v=(0,_.default)(["\n width: 720px;\n max-height: 600px;\n"]))),ie=(0,T.default)(V.default)(y||(y=(0,_.default)(["\n color: ",";\n margin-top: 10px;\n margin-left: ","px;\n"])),Y.variables.linkColor,i=>i.leftMargin),ae=S.default.createElement(N.default,null);function KpiAlertingOptionsModal(i){var{customAlertingRules:s,isCustomAlertingEnabled:o,isModelOpen:h,handleRequestClose:v,handleAlertRulesUpdate:y}=i,_=(0,S.useCallback)(()=>s&&0!==s.length&&o?"custom":"all",[s,o]),T=(0,S.useCallback)(()=>{var i=(0,Z.getSortedThresholdValues)().map(i=>i.value),o=s.map(i=>i.change_to);return(0,P.default)(i,o)},[s]),[x,L]=(0,S.useState)(T()),[N,Y]=(0,S.useState)(_()),[ne,re]=(0,S.useState)(s),[se,le]=(0,S.useState)(!1),oe=(0,S.useCallback)(()=>{L(T()),Y(_()),re(s),v()},[s,T,_,v]),de=(0,S.useCallback)(()=>"custom"!==N||ne.every(i=>i.change_from.length>0),[ne,N]),ce=(0,S.useCallback)(()=>{de()?(le(!1),y(N,ne),v()):le(!0)},[ne,y,v,N,de]),computeAvailableSeverities=i=>{var s=(0,Z.getSortedThresholdValues)().map(i=>i.value),o=i.map(i=>i.change_to);return(0,P.default)(s,o)},he=(0,S.useCallback)((i,s)=>{var{value:o}=s;if(Y(o),"all"===o)re([]);else{var h=[{change_to:"critical",change_from:["high","medium","low","normal","info"]}],v=computeAvailableSeverities(h);L(v),re(h)}},[]),onClickRemoveRule=i=>{var s=ne.filter(s=>s.change_to!==i),o=computeAvailableSeverities(s);L(o),re(s)},onUpdateToSeverity=(i,s)=>{var o=(0,R.default)(ne),h=o.findIndex(s=>s.change_to===i);o[h].change_to=s,o[h].change_from=o[h].change_from.filter(i=>i!==s);var v=computeAvailableSeverities(o);L(v),re(o)},onUpdateFromSeverityRule=(i,s)=>{var o=(0,R.default)(ne),h=o.findIndex(s=>s.change_to===i);o[h].change_from=s;var v=computeAvailableSeverities(o);L(v),re(o)},ue=(0,S.useCallback)(()=>{if(x.length>0){var i=(0,R.default)(ne);i.push({change_to:x[0],change_from:[]});var s=computeAvailableSeverities(i);L(s),re(i)}},[ne,x]);return S.default.createElement(te,{"data-test-itsi":"kpi-alerting-options-modal",open:h,onRequestClose:oe},S.default.createElement(K.default.Header,{"data-test-itsi":"kpi-alerting-options-modal-header",title:(0,$.gettext)("KPI alert rules"),onRequestClose:oe}),S.default.createElement(K.default.Body,null,se&&S.default.createElement(W.default,{appearance:"fill","data-test-itsi":"kpi-alerting-options-missing-rule-value-error-message",type:"error"},(0,$.gettext)("All KPI alerting rules must have a corresponding value.")),S.default.createElement(j.default,{"data-test-itsi":"kpi-alerting-options-control-group",label:(0,$.gettext)("Trigger a notable event for"),labelWidth:X.LABEL_WIDTHS.LongPlus},S.default.createElement(U.default,{"data-test-itsi":"kpi-alerting-options-radio",value:N,onChange:he},S.default.createElement(U.default.Option,{"data-test-itsi":"kpi-alerting-all-option",value:"all"},(0,$.gettext)("All KPI severity changes")),S.default.createElement(U.default.Option,{"data-test-itsi":"kpi-alerting-custom-option",value:"custom"},(0,$.gettext)("Specific severity changes")))),"custom"===N&&(ne&&0!==ne.length?ne.map(i=>S.default.createElement(ee.default,{availableSeverityValues:x,fromSeverityValues:i.change_from,onClickRemoveRule:onClickRemoveRule,toSeverityValue:i.change_to,key:i.change_to,onUpdateToSeverity:onUpdateToSeverity,updateRule:onUpdateFromSeverityRule})):null),"custom"===N&&x.length>0&&S.default.createElement(ie,{"data-test-itsi":"add-kpi-alerting-rule-button",icon:ae,label:(0,$.gettext)("Add rule"),appearance:"pill",onClick:ue})),S.default.createElement(K.default.Footer,null,S.default.createElement(V.default,{appearance:"secondary","data-test-itsi":"kpi-alerting-modal-cancel-button",onClick:oe,label:(0,$.gettext)("Cancel")}),S.default.createElement(V.default,{appearance:"primary","data-test-itsi":"kpi-alerting-modal-save-button",onClick:ce,label:(0,$.gettext)("Save"),leftMargin:X.LABEL_WIDTHS.LongPlus})))}KpiAlertingOptionsModal.propTypes={customAlertingRules:x.default.array,handleAlertRulesUpdate:x.default.func,handleRequestClose:x.default.func,isCustomAlertingEnabled:x.default.bool,isModelOpen:x.default.bool},KpiAlertingOptionsModal.defaultProps={customAlertingRules:[],handleAlertRulesUpdate:L.default,handleRequestClose:L.default,isCustomAlertingEnabled:!1,isModelOpen:!1};var ne=KpiAlertingOptionsModal;s.default=ne,i.exports=s.default},3057:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_=h(o(9)),S=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),T=h(o(2)),x=h(o(3)),R=h(o(160)),P=h(o(252)),L=h(o(47)),N=h(o(388)),V=h(o(1283)),j=h(o(39)),W=h(o(56)),K=h(o(238)),U=h(o(82)),Y=o(5),$=o(68),X=o(135);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}var Z=(0,x.default)(N.default)(v||(v=(0,_.default)(["\n color: ",";\n"])),i=>i.color),ee=(0,x.default)(j.default)(y||(y=(0,_.default)(["\n margin-left: 10px;\n"]))),te=S.default.createElement(V.default,{screenReaderText:(0,Y.gettext)("Remove KPI alerting rule")});function KpiAlertingCustomRule(i){var s,{availableSeverityValues:o,fromSeverityValues:h,onClickRemoveRule:v,toSeverityValue:y,onUpdateToSeverity:_,updateRule:T}=i,[x,L]=(0,S.useState)(y),[N,V]=(0,S.useState)(h),getSeverityObject=i=>X.THRESHOLDS.find(s=>s.value===i),j=(0,S.useCallback)((i,s)=>{var{value:o}=s;_(x,o),L(o)},[_,x]),ie=(0,S.useCallback)((i,s)=>{var{values:o}=s;T(x,o),V(o)},[x,T]),ae=(0,S.useCallback)(()=>{v(x)},[v,x]);return S.default.createElement(S.default.Fragment,null,S.default.createElement(W.default,{controlsLayout:"none","data-test-itsi":"kpi-alerting-change-to-control-group",label:(0,Y.gettext)("KPI severity changes to"),labelWidth:$.LABEL_WIDTHS.LongPlus},S.default.createElement(U.default,{"data-test-itsi":"kpi-alerting-change-to-select",value:x,onChange:j},((s=(0,R.default)(o)).includes(x)||s.push(x),s.map(i=>{var s,o=getSeverityObject(i),h=(s=o.boxFilledColor,S.default.createElement(Z,{color:s}));return S.default.createElement(U.default.Option,{"data-test-itsi":"kpi-alerting-severity-select-option",icon:o.boxFilledColor?h:null,label:o.label,value:o.value,key:o.value})})))),S.default.createElement(W.default,{"data-test-itsi":"kpi-alerting-change-from-control-group",label:(0,Y.gettext)("from"),labelWidth:$.LABEL_WIDTHS.LongPlus,labelFor:"kpi-alerting-change-from-multiselect"},S.default.createElement(K.default,{"data-test-itsi":"kpi-alerting-change-from-multiselect",inputId:"kpi-alerting-change-from-multiselect",values:N,onChange:ie,inline:!0},(0,P.default)(X.THRESHOLDS,[getSeverityObject(x)]).map(i=>S.default.createElement(K.default.Option,{"data-test-itsi":"kpi-alerting-multiselect-option",label:i.label,value:i.value,key:i.value}))),S.default.createElement(ee,{appearance:"pill","data-test-itsi":"kpi-alerting-rule-remove-button",icon:te,onClick:ae})))}KpiAlertingCustomRule.propTypes={availableSeverityValues:T.default.array.isRequired,fromSeverityValues:T.default.array.isRequired,onClickRemoveRule:T.default.func,toSeverityValue:T.default.string.isRequired,onUpdateToSeverity:T.default.func,updateRule:T.default.func},KpiAlertingCustomRule.defaultProps={onClickRemoveRule:L.default,onUpdateToSeverity:L.default,updateRule:L.default};var ie=KpiAlertingCustomRule;s.default=ie,i.exports=s.default},3058:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_,S,T,x,R=h(o(9)),P=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),L=h(o(3)),N=h(o(2)),V=h(o(62)),j=h(o(47)),W=h(o(39)),K=h(o(56)),U=h(o(87)),Y=h(o(82)),$=h(o(806)),X=h(o(132)),Z=o(5),ee=o(76),te=o(137);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}var ie=L.default.div(v||(v=(0,R.default)(["\n margin: 16px 10px;\n"]))),ae=(0,L.default)(K.default)(y||(y=(0,R.default)(["\n margin-left: 16px;\n"]))),ne=(0,L.default)(W.default)(_||(_=(0,R.default)(["\n margin-top: 11px;\n"]))),re=L.default.div(S||(S=(0,R.default)(["\n display: flex;\n"]))),se=(0,L.default)(U.default)(T||(T=(0,R.default)(["\n margin-top: 10px;\n width: 150px;\n"]))),le=(0,L.default)(Y.default)(x||(x=(0,R.default)(["\n width: 220px !important;\n"])));function KpiThresholdingControls(i){var{kpiData:s,onThresholdingTypeChange:o,onKpiAlertingRulesClick:h,onKpiAlertingToggle:v,onTrainingWindowChange:y,onOutlierExclusionToggle:_,onOutlierExclusionAlgoChange:S,onOutlierExclusionSensitivityChange:T,onUpdateAdaptiveThresholding:x,isUpdatingAdaptiveThresholds:R}=i,L=(0,P.useMemo)(()=>s.isTimeVariateThresholds?s.isAdaptiveThresholdsEnabled?"adaptive":"time":"static",[s.isAdaptiveThresholdsEnabled,s.isTimeVariateThresholds]),N=(0,P.useCallback)((i,s)=>{var{value:h}=s;o(h)},[o]),j=(0,P.useCallback)(()=>{v(!s.isKpiAlertingEnabled)},[s.isKpiAlertingEnabled,v]),U=(0,P.useCallback)((i,s)=>{var{value:o}=s;y(o)},[y]),oe=(0,P.useCallback)((i,s)=>{var{value:o}=s;S(o)},[S]),de=(0,P.useCallback)(()=>{_(!s.isOutlierDetectionEnabled)},[s.isOutlierDetectionEnabled,_]),ce=(0,P.useCallback)((i,s)=>{var{value:o}=s;T(o)},[T]);return P.default.createElement(ie,null,P.default.createElement(re,null,P.default.createElement(se,{"data-test-itsi":"kpi-threshold-control-threshold-settings-header",level:4},(0,Z.gettext)("Settings")),P.default.createElement(K.default,{"data-test-itsi":"threshold-type-control-group",label:(0,Z.gettext)("Thresholding type"),labelPosition:"top",required:!0},P.default.createElement(le,{"data-test-itsi":"threshold-type-select",value:L,onChange:N},te.THRESHOLD_TYPE_OPTIONS.map(i=>P.default.createElement(Y.default.Option,{"data-test-itsi":"threshold-type-select-option",label:i.label,value:i.value,key:i.value})))),P.default.createElement(ae,{"data-test-itsi":"kpi-alerting-control-group",label:(0,Z.gettext)("KPI alerting"),labelPosition:"top"},P.default.createElement(X.default,{"data-test-itsi":"kpi-alerting-switch",key:"kpi-alerting-switch",value:"kpi-alerting-switch",onClick:j,selected:s.isKpiAlertingEnabled,appearance:"toggle"},s.isKpiAlertingEnabled&&(0,Z.gettext)("Active")),s.isKpiAlertingEnabled&&P.default.createElement(W.default,{"data-test-itsi":"kpi-alerting-alert-rules-button",onClick:h,label:(0,Z.gettext)("Alert rules")}))),"adaptive"===L&&P.default.createElement(re,null,P.default.createElement(se,{"data-test-itsi":"kpi-threshold-control-threshold-at-settings-header",level:4},(0,Z.gettext)("AT Settings")),P.default.createElement(K.default,{"data-test-itsi":"training-window-control-group",label:(0,Z.gettext)("Training window"),labelPosition:"top",required:!0},P.default.createElement(le,{"data-test-itsi":"training-window-select",value:s.adaptiveTrainingWindow,onChange:U},ee.KPI_TIME_PRESETS.map(i=>P.default.createElement(Y.default.Option,{"data-test-itsi":"training-window-select-option",label:i.label,value:i.value,key:i.value})))),P.default.createElement(ae,{"data-test-itsi":"outlier-switch-control-group",label:(0,Z.gettext)("Outlier exclusion"),labelPosition:"top"},P.default.createElement(X.default,{"data-test-itsi":"outlier-exclusion-switch",key:"outlier-exclusion-switch",value:"outlier-exclusion-switch",onClick:de,selected:s.isOutlierDetectionEnabled,appearance:"toggle"})),s.isOutlierDetectionEnabled&&P.default.createElement(P.default.Fragment,null,P.default.createElement(ae,{"data-test-itsi":"outlier-algo-control-group",label:(0,Z.gettext)("Outlier method/algorithm"),labelPosition:"top"},P.default.createElement(le,{"data-test-itsi":"outlier-algo-select",value:s.outlierDetectionAlgorithm,onChange:oe},(0,V.default)(te.OUTLIER_ALGORITHM_LABEL_MAP).map(i=>P.default.createElement(Y.default.Option,{"data-test-itsi":"outlier-algo-select-option",label:te.OUTLIER_ALGORITHM_LABEL_MAP[i],value:i,key:i})))),P.default.createElement(ae,{"data-test-itsi":"outlier-sensitivity-control-group",label:(0,Z.gettext)("Trigger outlier threshold"),labelPosition:"top"},P.default.createElement($.default,{"data-test-itsi":"outlier-sensitivity-slider-control",min:1,max:30,step:1,onChange:ce,value:s.outlierDetectionSensitivity,stepMarks:"always",inline:!0}))),P.default.createElement(ae,{"data-test-itsi":"preview-at-control-group",label:" ",labelPosition:"top"},P.default.createElement(ne,{"data-test-itsi":"preview-at-button-control",label:R?(0,Z.gettext)("Applying adaptive thresholds..."):(0,Z.gettext)("Update adaptive thresholding"),onClick:x,disabled:R}))))}KpiThresholdingControls.propTypes={kpiData:N.default.object.isRequired,onThresholdingTypeChange:N.default.func,onKpiAlertingRulesClick:N.default.func,onKpiAlertingToggle:N.default.func,onTrainingWindowChange:N.default.func,onOutlierExclusionToggle:N.default.func,onOutlierExclusionAlgoChange:N.default.func,onOutlierExclusionSensitivityChange:N.default.func,onUpdateAdaptiveThresholding:N.default.func,isUpdatingAdaptiveThresholds:N.default.bool},KpiThresholdingControls.defaultProps={onThresholdingTypeChange:j.default,onKpiAlertingRulesClick:j.default,onKpiAlertingToggle:j.default,onTrainingWindowChange:j.default,onOutlierExclusionToggle:j.default,onOutlierExclusionAlgoChange:j.default,onOutlierExclusionSensitivityChange:j.default,onUpdateAdaptiveThresholding:j.default,isUpdatingAdaptiveThresholds:!1};var oe=KpiThresholdingControls;s.default=oe,i.exports=s.default},3059:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_,S,T=h(o(11)),x=h(o(9)),R=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),P=h(o(2)),L=h(o(3)),N=h(o(39)),V=h(o(56)),j=h(o(107)),W=h(o(89)),K=h(o(33)),U=h(o(290)),Y=o(5);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function ownKeys(i,s){var o=Object.keys(i);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(i);s&&(h=h.filter((function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable}))),o.push.apply(o,h)}return o}function _objectSpread(i){for(var s=1;s<arguments.length;s++){var o=null!=arguments[s]?arguments[s]:{};s%2?ownKeys(Object(o),!0).forEach((function(s){(0,T.default)(i,s,o[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(o,s))}))}return i}var $=(0,L.default)(U.default)(v||(v=(0,x.default)(["\n width: 100% !important;\n"]))),X=L.default.div(y||(y=(0,x.default)(["\n width: 550px;\n"]))),Z=(0,L.default)(j.default)(_||(_=(0,x.default)(["\n max-width: 600px;\n"]))),ee=(0,L.default)(V.default)(S||(S=(0,x.default)(["\n width: 550px;\n"])));function KpiThresholdingTemplateModal(i){var{validateKpiThresholdTitle:s,open:o,handleClose:h,handleSave:v,apiErrorMessage:y,isApiInProgress:_}=i,[S,T]=(0,R.useState)({}),[x,P]=(0,R.useState)(!0),[L,V]=(0,R.useState)("");(0,R.useEffect)(()=>{o||T({})},[o]);var U=(0,R.useCallback)((i,s)=>{var{value:o,name:h}=s;T(_objectSpread(_objectSpread({},S),{},{[h]:o}))},[S]),te=(0,R.useCallback)(()=>{var i=S.title||"",o=S.description||"",h=s(i);h.isValid?(v(i,o),P(!0),V("")):(P(!1),V(h.message))},[v,S.description,S.title,s]),ie=(0,R.useCallback)(()=>{P(!0),h()},[h]);return R.default.createElement(Z,{"data-test-itsi":"kpi-threshold-template-modal",onRequestClose:ie,open:o},R.default.createElement(j.default.Header,{title:(0,Y.gettext)("Edit Title or Description"),onRequestClose:ie}),R.default.createElement(j.default.Body,null,y?R.default.createElement(K.default,{"data-test-itsi":"kpi-threshold-template-error-message",type:"error"},y):"",R.default.createElement(X,null,R.default.createElement(ee,{label:(0,Y.gettext)("Title"),"data-test-itsi":"kpi-threshold-template-title-control-group",controlsLayout:"none",labelWidth:120,help:L,error:!x},R.default.createElement(W.default,{"data-test-itsi":"kpi-threshold-template-title-control",error:!x,onChange:U,placeholder:(0,Y.gettext)("required"),value:S.title||"",name:"title"})),R.default.createElement(ee,{label:(0,Y.gettext)("Description"),"data-test-itsi":"kpi-threshold-template-description-control-group",controlsLayout:"none",labelWidth:120},R.default.createElement($,{"data-test-itsi":"kpi-threshold-template-description-control",inline:!0,onChange:U,placeholder:(0,Y.gettext)("optional"),value:S.description||"",name:"description"})))),R.default.createElement(j.default.Footer,null,R.default.createElement(N.default,{appearance:"secondary","data-test-itsi":"kpi-threshold-template-modal-cancel-button",onClick:ie,label:(0,Y.gettext)("Cancel")}),R.default.createElement(N.default,{appearance:"primary","data-test-itsi":"kpi-threshold-template-modal-save-button",label:(0,Y.gettext)("Save"),onClick:te,disabled:_})))}KpiThresholdingTemplateModal.propTypes={validateKpiThresholdTitle:P.default.func.isRequired,open:P.default.bool.isRequired,handleClose:P.default.func.isRequired,handleSave:P.default.func.isRequired,apiErrorMessage:P.default.string.isRequired,isApiInProgress:P.default.bool.isRequired};var te=KpiThresholdingTemplateModal;s.default=te,i.exports=s.default},3060:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(66)),y=h(o(18)),_=h(o(17)),S=h(o(30)),T=h(o(21)),x=h(o(22)),R=h(o(20)),P=h(o(11)),L=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),N=h(o(2)),V=h(o(252)),j=h(o(42)),W=h(o(65)),K=h(o(1283)),U=h(o(39)),Y=h(o(238)),$=h(o(82)),X=h(o(148)),Z=o(5),ee=o(93),te=o(135),ie=h(o(388));function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,R.default)(i);if(s){var v=(0,R.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,x.default)(this,o)}}o(29);var ae=function(i){(0,T.default)(KpiAlertingCustomRule,i);var s=_createSuper(KpiAlertingCustomRule);function KpiAlertingCustomRule(i){var o;(0,_.default)(this,KpiAlertingCustomRule);for(var h=arguments.length,y=new Array(h>1?h-1:0),T=1;T<h;T++)y[T-1]=arguments[T];return o=s.call(this,i,...y),(0,P.default)((0,S.default)(o),"generateSeverityOptions",()=>{var i=[],s=o.props.getAvailableSeverityValues();return(0,W.default)(s,o.state.toSeverity)||s.push(o.state.toSeverity),s.map(s=>{var h=o.getSeverityObject(s);i.push(L.default.createElement($.default.Option,{"data-test-itsi":"kpi-alerting-severity-select-option",icon:h.boxFilledColor?L.default.createElement(ie.default,{style:{color:h.boxFilledColor}}):null,label:h.label,value:h.value,key:h.value}))}),i}),(0,P.default)((0,S.default)(o),"getSeverityObject",i=>te.THRESHOLDS.find(s=>s.value===i)),(0,P.default)((0,S.default)(o),"generateMultiselectOptions",()=>(0,V.default)(te.THRESHOLDS,[o.getSeverityObject(o.state.toSeverity)]).map(i=>L.default.createElement(Y.default.Option,{"data-test-itsi":"kpi-alerting-multiselect-option",label:i.label,value:i.value,key:i.value}))),(0,P.default)((0,S.default)(o),"handleToSeverityChange",(i,s)=>{var{value:h}=s;o.props.onUpdateToSeverity(o.state.toSeverity,h),o.setState({toSeverity:h})}),(0,P.default)((0,S.default)(o),"handleMultiSelectChange",(i,s)=>{var{values:h}=s;o.props.updateRule(o.state.toSeverity,h),o.setState({fromSeverityValues:h})}),(0,P.default)((0,S.default)(o),"handleRemoveRule",()=>{o.props.removeRuleFromKpiModel(o.state.toSeverity)}),(0,P.default)((0,S.default)(o),"getFromSeveritiesAsString",i=>{var s="";return(0,j.default)(i,i=>{var h=o.getSeverityObject(i),v=h?h.label+", ":"";s+=v}),s=s.slice(0,-2)}),(0,P.default)((0,S.default)(o),"render",()=>{var{isReadOnly:i}=o.props,{fromSeverityValues:s,toSeverity:h}=o.state,y=o.generateSeverityOptions(),_=o.generateMultiselectOptions(),S=o.getSeverityObject(o.state.toSeverity);return L.default.createElement("div",(0,v.default)({style:{paddingTop:"10px"}},(0,ee.createITSITestHook)(o.constructor.name)),L.default.createElement("div",{"data-test-itsi":"kpi-alerting-change-to-text",style:{display:"inline-block",paddingRight:"10px"}},(0,Z.gettext)("KPI severity changes to")),i?L.default.createElement(X.default,{"data-test-itsi":"kpi-alerting-change-to-severity",style:{display:"inline-block",whiteSpace:"nowrap",paddingLeft:0,paddingRight:0}},S?S.label:""):L.default.createElement($.default,{"data-test-itsi":"kpi-alerting-severity-select",value:h,onChange:o.handleToSeverityChange},y),L.default.createElement("div",{"data-test-itsi":"kpi-alerting-from-text",style:{display:"inline-block",padding:"0 10px"}},(0,Z.gettext)("from")),i?L.default.createElement(X.default,{"data-test-itsi":"kpi-alerting-change-from-severity",style:{display:"inline-block",paddingLeft:0,paddingRight:0}},o.getFromSeveritiesAsString(s)):L.default.createElement(L.Fragment,null,L.default.createElement(Y.default,{"data-test-itsi":"kpi-alerting-multiselect",values:s,onChange:o.handleMultiSelectChange,inline:!0},_),L.default.createElement(U.default,{appearance:"pill","data-test-itsi":"remove-kpi-alerting-rule",icon:L.default.createElement(K.default,{screenReaderText:(0,Z.gettext)("Remove KPI alerting rule")}),onClick:o.handleRemoveRule,style:{marginLeft:"10px"}})))}),o.state={toSeverity:o.props.toSeverity,fromSeverityValues:o.props.fromSeverityValues},o}return(0,y.default)(KpiAlertingCustomRule)}(L.Component);(0,P.default)(ae,"propTypes",{getAvailableSeverityValues:N.default.func.isRequired,updateRule:N.default.func.isRequired,removeRuleFromKpiModel:N.default.func.isRequired,toSeverity:N.default.string.isRequired,fromSeverityValues:N.default.array.isRequired,onUpdateToSeverity:N.default.func.isRequired,isReadOnly:N.default.bool}),(0,P.default)(ae,"defaultProps",{isReadOnly:!1});var ne=ae;s.default=ne,i.exports=s.default},3061:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_,S,T,x,R,P,L,N,V,j,W,K=h(o(17)),U=h(o(18)),Y=h(o(30)),$=h(o(21)),X=h(o(22)),Z=h(o(20)),ee=h(o(11)),te=h(o(9)),ie=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),ae=h(o(2)),ne=h(o(3)),re=h(o(39)),se=h(o(407)),le=h(o(56)),oe=h(o(473)),de=h(o(43)),ce=h(o(33)),he=h(o(669)),ue=h(o(454)),pe=h(o(82)),fe=h(o(590)),ge=h(o(110)),me=o(5),ve=o(40),ye=o(405),_e=o(404),Se=o(25),be=o(68),Te=o(77),Ee=o(135),ke=o(688),Ce=o(137),xe=o(76),we=h(o(568));function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,Z.default)(i);if(s){var v=(0,Z.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,X.default)(this,o)}}o(29);var Me=(0,ne.default)(se.default)(v||(v=(0,te.default)(["\n\tmargin-left: 10px;\n"]))),Re=(0,ne.default)(de.default)(y||(y=(0,te.default)(["\n\tmargin-left: 10px;\n"]))),Ae=(0,ne.default)(pe.default)(_||(_=(0,te.default)(["\n\tmargin-left: 10px;\n\twidth: 300px;\n"]))),Ie=ne.default.div(S||(S=(0,te.default)(["\n\tmargin-bottom: 15px;\n"]))),Oe=ie.default.createElement(we.default,{"data-test-itsi":"kpi-threshold-recommended-ai-chip-icon",viewBox:"0 0 18 18"}),Pe=(0,ne.default)(le.default)(T||(T=(0,te.default)(["\n\tdiv[data-test='controls'] {\n\t\twidth: max-content;\n\t}\n"]))),De=(0,ne.default)(fe.default)(x||(x=(0,te.default)(["\n\tcolor: ",";\n"])),ve.variables.contentColorMuted),Le=ne.default.div(R||(R=(0,te.default)(["\n\tdisplay: flex;\n\tflex-direction: column;\n\twidth: 1120px;\n"]))),Ne=ne.default.div(P||(P=(0,te.default)(["\n\tdisplay: flex;\n"]))),Ve=ne.default.div(L||(L=(0,te.default)(["\n\tdisplay: inline;\n\ttext-align: right;\n"]))),He=(0,ne.default)(pe.default)(N||(N=(0,te.default)(["\n\twidth: 365px !important;\n"]))),Be=(0,ne.default)(pe.default)(V||(V=(0,te.default)(["\n\twidth: 100px !important;\n"]))),je=(0,ne.default)(pe.default)(j||(j=(0,te.default)(["\n\twidth: 196px !important;\n"]))),We=ne.default.div(W||(W=(0,te.default)(["\n\tdisplay: flex;\n"]))),Ke={analysisWindowValue:ae.default.string,analysisWindowStartDate:ae.default.number,canWriteOnGlobalTeam:ae.default.bool,disabled:ae.default.bool,exportAction:ae.default.func,hasTimeVariateThresholds:ae.default.bool,hideRecommendedThresholding:ae.default.bool,isPSCDisabled:ae.default.bool,isPSCInstalled:ae.default.bool,isRecommendedThresholdSearchInProgress:ae.default.bool.isRequired,onAnalysisWindowChange:ae.default.func.isRequired,onAnalysisWindowStartDateChange:ae.default.func.isRequired,onApplyAsValueChange:ae.default.func.isRequired,onApplyToValueChange:ae.default.func.isRequired,onLoadRecommendationsClick:ae.default.func.isRequired,onRadioChange:ae.default.func.isRequired,onSelectChange:ae.default.func.isRequired,onThresholdConfigChange:ae.default.func.isRequired,radioValue:ae.default.string,recommendationApplyToValue:ae.default.string,recommendationApplyAsValue:ae.default.string,selectOptions:ae.default.arrayOf(ae.default.shape({label:ae.default.string,value:ae.default.string})).isRequired,selectValue:ae.default.string,showEntityLevelAdaptiveThresholding:ae.default.bool,thresholdConfigValue:ae.default.string},Fe={analysisWindowValue:Ce.ANALYSIS_WINDOW_OPTIONS[1].value,analysisWindowStartDate:(0,ge.default)().subtract(Ce.ANALYSIS_WINDOW_OPTIONS[1].value.match(/\d+/g)[0],"days").unix(),canWriteOnGlobalTeam:!0,disabled:!1,exportAction:null,hasTimeVariateThresholds:!0,hideRecommendedThresholding:!1,isPSCDisabled:!1,isPSCInstalled:!1,radioValue:"",recommendationApplyToValue:Ce.RECOMMENDATION_APPLY_TO_OPTIONS[0].value,recommendationApplyAsValue:Ce.RECOMMENDATION_APPLY_AS_OPTIONS[0].value,selectValue:"",showEntityLevelAdaptiveThresholding:!0,thresholdConfigValue:Ce.THRESHOLD_CONFIGURATION_OPTIONS[0].value},Ge=function(i){(0,$.default)(KpiThresholdingRadioList,i);var s=_createSuper(KpiThresholdingRadioList);function KpiThresholdingRadioList(i){var o;return(0,K.default)(this,KpiThresholdingRadioList),o=s.call(this,i),(0,ee.default)((0,Y.default)(o),"_onRadioChange",(i,s)=>{var{value:h}=s,{onRadioChange:v}=o.props;o.setState({radioValue:h}),v(h)}),(0,ee.default)((0,Y.default)(o),"_onAnalysisWindowChange",(i,s)=>{var{value:h}=s,{onRadioChange:v,onAnalysisWindowChange:y,onAnalysisWindowStartDateChange:_}=o.props,{radioValue:S}=o.state,T=(0,ge.default)().subtract(h.match(/\d+/g)[0],"days").unix();o.setState({analysisWindowValue:h,analysisWindowStartDate:T}),S!==Ee.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED&&(o.setState({radioValue:Ee.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED}),v(Ee.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED)),y(h),_(T)}),(0,ee.default)((0,Y.default)(o),"_onAnalysisWindowStartDateChange",(i,s)=>{var{value:h}=s,{onRadioChange:v,onAnalysisWindowStartDateChange:y}=o.props,{radioValue:_}=o.state,S=(0,ge.default)(h).unix();o.setState({analysisWindowStartDate:S}),_!==Ee.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED&&(o.setState({radioValue:Ee.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED}),v(Ee.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED)),y(S)}),(0,ee.default)((0,Y.default)(o),"_onRecommendationApplyToValueChange",(i,s)=>{var{value:h}=s,{onApplyToValueChange:v,onRadioChange:y}=o.props,{radioValue:_}=o.state;o.setState({recommendationApplyToValue:h}),_!==Ee.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED&&(o.setState({radioValue:Ee.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED}),y(Ee.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED)),v(h)}),(0,ee.default)((0,Y.default)(o),"_onRecommendationApplyAsValueChange",(i,s)=>{var{value:h}=s,{onApplyAsValueChange:v,onRadioChange:y}=o.props,{radioValue:_}=o.state;o.setState({recommendationApplyAsValue:h}),_!==Ee.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED&&(o.setState({radioValue:Ee.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED}),y(Ee.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED)),v(h)}),(0,ee.default)((0,Y.default)(o),"_onThresholdConfigChange",(i,s)=>{var{value:h}=s,{onRadioChange:v,onThresholdConfigChange:y}=o.props,{radioValue:_}=o.state;o.setState({thresholdConfigValue:h}),_!==Ee.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED&&(o.setState({radioValue:Ee.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED}),v(Ee.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED)),y(h)}),(0,ee.default)((0,Y.default)(o),"_onSelectChange",(i,s)=>{var{value:h}=s,{onRadioChange:v,onSelectChange:y}=o.props,{radioValue:_}=o.state;o.setState({selectValue:h}),_!==Ee.KPI_THRESHOLD_TEMPLATE_TYPES.TEMPLATE&&(o.setState({radioValue:Ee.KPI_THRESHOLD_TEMPLATE_TYPES.TEMPLATE}),v(Ee.KPI_THRESHOLD_TEMPLATE_TYPES.TEMPLATE)),y(h)}),(0,ee.default)((0,Y.default)(o),"handleLoadRecommendationsClick",()=>{var{onRadioChange:i,onLoadRecommendationsClick:s}=o.props,{radioValue:h}=o.state;h!==Ee.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED&&(o.setState({radioValue:Ee.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED}),i(Ee.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED)),s()}),o.state={radioValue:i.radioValue,selectValue:i.selectValue,analysisWindowValue:i.analysisWindowValue,analysisWindowStartDate:i.analysisWindowStartDate,recommendationApplyToValue:i.recommendationApplyToValue,recommendationApplyAsValue:i.recommendationApplyAsValue,thresholdConfigValue:i.thresholdConfigValue},o}return(0,U.default)(KpiThresholdingRadioList,[{key:"componentDidUpdate",value:function componentDidUpdate(i){i.radioValue!==this.props.radioValue&&this.setState({radioValue:this.props.radioValue}),i.selectValue!==this.props.selectValue&&this.setState({selectValue:this.props.selectValue})}},{key:"render",value:function render(){var i,{canWriteOnGlobalTeam:s,disabled:o,exportAction:h,hasTimeVariateThresholds:v,hideRecommendedThresholding:y,isPSCDisabled:_,isPSCInstalled:S,isRecommendedThresholdSearchInProgress:T,selectOptions:x,showEntityLevelAdaptiveThresholding:R}=this.props,{analysisWindowValue:P,analysisWindowStartDate:L,radioValue:N,recommendationApplyAsValue:V,recommendationApplyToValue:j,selectValue:W,thresholdConfigValue:K}=this.state,U=(0,me.gettext)("Select the time window over which the thresholding recommendation should run. The analysis window will be used as the training window for adaptive thresholding."),Y=(0,me.gettext)("Choose the normality for thresholding your KPI from three options. Determine if your KPI should stay above a certain level, below a certain level, or constrained to a specific range"),$=W&&W!==Ee.KPI_THRESHOLD_TEMPLATE_TYPES.CUSTOM,X=N===Ee.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED,Z=!S||_,ee=P.match(/\d+/g)[0],te=(0,ge.default)().subtract(ee,"day"),ae=ge.default.unix(L).isBefore(te),ne=ge.default.unix(L).format(Te.MOMENT_FORMAT).toString(),se=(!N||N===Ee.KPI_THRESHOLD_TEMPLATE_TYPES.CUSTOM)&&v&&s,fe="";return S?_&&(fe=xe.AT_RECOMMENDATION_PSC_DISABLED_MESSAGE,i="warning"):(fe=xe.AT_RECOMMENDATION_PSC_NOT_INSTALLED_MESSAGE,i="error"),ie.default.createElement("div",null,ie.default.createElement(ue.default,{"data-test-itsi":"kpi-thresholding-radio-list",disabled:o||T,onChange:this._onRadioChange.bind(this),value:N},!y&&ie.default.createElement(ue.default.Option,{"data-test-itsi":"kpi-thresholding-recommended-radio-list-option",value:Ee.KPI_THRESHOLD_TEMPLATE_TYPES.RECOMMENDED},ie.default.createElement(Ie,null,(0,me.gettext)("Use Recommended Thresholding Configuration"),ie.default.createElement(Me,{"data-test-itsi":"kpi-threshold-recommended-ai-chip",icon:Oe},(0,me.gettext)("Powered by Splunk AI"))," ",ie.default.createElement(De,{as:"span","data-test-itsi":"kpi-threshold-recommended-info-text",variant:"smallBody",weight:400},(0,me.gettext)("Start with values configured based on a unique AI-driven analysis of this KPI.")))),!y&&!Z&&X&&ie.default.createElement(Le,null,ie.default.createElement(Pe,{"data-test-itsi":"kpi-threshold-recommended-thresholding-direction",label:(0,me.gettext)("Thresholding Direction"),tooltip:Y,labelWidth:be.LABEL_WIDTHS.Massive},ie.default.createElement(He,{"data-test-itsi":"kpi-threshold-recommended-thresholding-direction-select",disabled:o||Z||T,value:K,onChange:this._onThresholdConfigChange.bind(this)},Ce.THRESHOLD_CONFIGURATION_OPTIONS.map(i=>ie.default.createElement(pe.default.Option,{"data-test-itsi":"kpi-threshold-recommended-thresholding-direction-select-option",description:i.description,label:i.label,value:i.value,key:i.value})))),ie.default.createElement(Ne,null,ie.default.createElement(Pe,{"data-test-itsi":"kpi-threshold-recommended-analysis-window",label:(0,me.gettext)("Analysis Window"),labelFor:"kpi-threshold-recommended-analysis-window-select",tooltip:U,labelWidth:be.LABEL_WIDTHS.Massive,controlsLayout:"none"},ie.default.createElement(Be,{"data-test-itsi":"kpi-threshold-recommended-analysis-window-select",disabled:o||Z||T,inputId:"kpi-threshold-recommended-analysis-window-select",value:P,onChange:this._onAnalysisWindowChange.bind(this)},Ce.ANALYSIS_WINDOW_OPTIONS.map(i=>ie.default.createElement(pe.default.Option,{"data-test-itsi":"kpi-threshold-recommended-analysis-window-select-option",label:i.label,value:i.value,key:i.value})))),ie.default.createElement(le.default,{"data-test-itsi":"kpi-threshold-recommended-start-date-control-group",label:(0,me.gettext)("starting on"),labelWidth:be.LABEL_WIDTHS.Short,error:!ae&&(0,me.gettext)("Selected analysis window and date will exceed today's date")},ie.default.createElement(oe.default,{"data-test-itsi":"kpi-threshold-recommended-start-date",disabled:o||Z||T,value:ne,onChange:this._onAnalysisWindowStartDateChange}))),R&&ie.default.createElement(We,null,ie.default.createElement(Pe,{"data-test-itsi":"kpi-threshold-recommended-apply-to-control",label:(0,me.gettext)("Apply AI recommendations to"),labelFor:"kpi-threshold-recommended-apply-to-radio-bar",labelWidth:be.LABEL_WIDTHS.Massive},ie.default.createElement(he.default,{"data-test-itsi":"kpi-threshold-recommended-apply-to-radio-bar",onChange:this._onRecommendationApplyToValueChange,value:j},Ce.RECOMMENDATION_APPLY_TO_OPTIONS.map(i=>ie.default.createElement(he.default.Option,{"data-test-itsi":"kpi-threshold-recommended-apply-to-radio-bar-option",label:i.label,value:i.value,key:i.value})))),ie.default.createElement(le.default,{"data-test-itsi":"kpi-threshold-recommended-apply-as-control",label:(0,me.gettext)("Apply As"),labelWidth:be.LABEL_WIDTHS.Short},ie.default.createElement(je,{"data-test-itsi":"kpi-threshold-recommended-apply-as-select",onChange:this._onRecommendationApplyAsValueChange,value:V},Ce.RECOMMENDATION_APPLY_AS_OPTIONS.map(i=>ie.default.createElement(pe.default.Option,{"data-test-itsi":"kpi-threshold-recommended-apply-as-select-option",description:i.description,label:i.label,value:i.value,key:i.value}))))),ie.default.createElement(Ve,null,ie.default.createElement(re.default,{appearance:"primary","data-test-itsi":"kpi-threshold-load-recommendations-button",disabled:o||Z||T||!ae,onClick:this.handleLoadRecommendationsClick.bind(this),label:(0,me.gettext)("Load Recommendations")}))),!y&&Z&&X&&ie.default.createElement(ce.default,{type:i,"data-test-itsi":"kpi-thresholding-install-psc-".concat(i,"-message")},fe," ",!S&&ie.default.createElement(ie.default.Fragment,null,(0,me.gettext)("Download the app for "),ie.default.createElement(de.default,{"data-test-itsi":"kpi-thresholding-psc-app-install-link-linux",to:(0,_e.getSplunkBaseURL)(ye.SPLUNKBASE_APPS.Python_Scientific_Linux.id),openInNewContext:!0},(0,me.gettext)("Linux 64-bit")),(0,me.gettext)(", "),ie.default.createElement(de.default,{"data-test-itsi":"kpi-thresholding-psc-app-install-link-windows",to:(0,_e.getSplunkBaseURL)(ye.SPLUNKBASE_APPS.Python_Scientific_Windows.id),openInNewContext:!0},(0,me.gettext)("Windows 64-bit")),(0,me.gettext)(", or "),ie.default.createElement(de.default,{"data-test-itsi":"kpi-thresholding-psc-app-install-link-mac",to:(0,_e.getSplunkBaseURL)(ye.SPLUNKBASE_APPS.Python_Scientific_Mac.id),openInNewContext:!0},(0,me.gettext)("Mac Intel"))),S&&_&&ie.default.createElement(de.default,{"data-test-itsi":"kpi-thresholding-psc-app-enable-link",to:(0,_e.manageAppsURL)({search:ye.PYTHON_SCIENTIFIC_APP_NAME_PREFIX}),openInNewContext:!0},(0,me.gettext)("Enable the app here"))),ie.default.createElement(ue.default.Option,{"data-test-itsi":"kpi-thresholding-template-radio-list-option",value:Ee.KPI_THRESHOLD_TEMPLATE_TYPES.TEMPLATE},(0,me.gettext)("Use Thresholding Template"),ie.default.createElement(Ae,{"data-test-itsi":"kpi-threshold-template-select",disabled:o||T,inline:!0,filter:!0,placeholder:(0,me.gettext)("Select a thresholding template"),onChange:this._onSelectChange.bind(this),truncate:!0,value:W},x.map(i=>ie.default.createElement(pe.default.Option,{"data-test-itsi":"kpi-threshold-template-select-option",key:i.value,label:i.label,value:i.value}))),$&&ie.default.createElement(Re,{"data-test-itsi":"threshold-template-edit-link",openInNewContext:!0,to:(0,ke.uiEditURL)(W)},s?(0,me.gettext)("Edit Template"):(0,me.gettext)("View Template")),ie.default.createElement(Re,{"data-test-itsi":"threshold-timezones-external-link",openInNewContext:!0,to:(0,Se.makeDocsURL)("app.itsi.threshold_timezones")},(0,me.gettext)("Learn more"))),ie.default.createElement(ue.default.Option,{"data-test-itsi":"kpi-thresholding-custom-radio-list-option",value:Ee.KPI_THRESHOLD_TEMPLATE_TYPES.CUSTOM},(0,me.gettext)("Set Custom Thresholds"),se&&ie.default.createElement(Re,{"data-test-itsi":"thresholding-template-export-link",openInNewContext:!0,onClick:h},(0,me.gettext)("Save as template")))))}}]),KpiThresholdingRadioList}(ie.Component);Ge.propTypes=Ke,Ge.defaultProps=Fe;var Ue=Ge;s.default=Ue,i.exports=s.default},3062:function(i,s){i.exports='<div class="kpi-thresholding-panel-upper-section">\n\t<div class="kpi-thresholding-panel-custom-threshold-window-content">\n\t\t<div class="kpi-thresholding-panel-custom-threshold-window-status"></div>\n\t\t<div class="kpi-thresholding-panel-custom-threshold-window-link"></div>\n\t</div>\n\t<div class="kpi-thresholding-panel-config-container">\n\t\t<div class="thresholding-template-selector-control-container">\n\t\t\t<div class="thresholding-template-custom-control">\n\t\t\t\t<div class="thresholding-template-radio-control"></div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="thresholding-recommendation-progress-control"></div>\n\t\t<div class="thresholding-recommendation-error-container"></div>\n\t\t<div class="thresholding-recommendation-info-container"></div>\n\t\t<div class="thresholding-enable-time-policy-control"></div>\n\t</div>\n</div>\n<div class="kpi-thresholding-panel-lower-section">\n\t<% if (vars.isServiceTemplate) { %>\n\t\t<div class="thresholding-configure-preview-controls">\n\t\t\t<div class="thresholding-configure-error-state" style="display: none;"></div>\n\t\t\t<div class="thresholding-configure-preview-service"></div>\n\t\t</div>\n\t<% } %>\n\t<div class="thresholding-configure-aggregate-entity-toggle"></div>\n\t<div class="thresholding-configure-settings">\n\t\t<div class="thresolding-adaptive-thresholding-controls">\n\t\t\t<div class="thresholding-enable-adaptive-thresholding"></div>\n\t\t\t<div class="thresholding-adaptive-thresholding-training"></div>\n\t\t\t<div class="thresholding-adaptive-thresholding-explanation" style="display:none;"></div>\n\t\t</div>\n\t\t<div class="thresholding-timezone-warning"></div>\n\t\t<div class="thresholding-enable-outlier-detection"></div>\n\t\t<div class="thresholding-apply-adaptive-thresholding"></div>\n\t\t<div class="kpi-alerting-enable-disable-control"></div>\n\t\t<div class="kpi-alerting-options"></div>\n\t\t<div class="kpi-alerting-custom-rules" style="display:none;"></div>\n\t</div>\n\t<div class="thresholding-default-container">\n\t\t<div class="thresholding-default-preview-container">\n\t\t\t<div class="thresholding-entity-side-panel-container"></div>\n\t\t\t<div class="thresholding-default-preview"></div>\n\t\t</div>\n\t\t<div class="thresholding-default-settings"></div>\n\t</div>\n\t<div class="thresholding-time-policy-container"></div>\n\t<div class="thresholding-confirmation-dialog"></div>\n</div>\n'},3063:function(i,s,o){(s=o(37)(!1)).push([i.i,".kpi-thresholding-panel-upper-section,\n.thresholding-alert-on-control {\n\tpadding: 10px 0 0 20px;\n}\n\n.thresholding-timezone-warning {\n\tbackground-color: #f2f4f5; /* theme.backgroundColorHover */\n}\n\n.thresholding-timezone-warning > .alert {\n\tmargin-bottom: 0;\n}\n\n.kpi-thresholding-panel-custom-threshold-window-content {\n\tmargin-bottom: 10px;\n\tpadding: 5px 0;\n}\n\n.kpi-thresholding-panel-custom-threshold-window-content.hide {\n\tdisplay: none;\n\tmargin: 0;\n\tpadding: 0;\n}\n\n.kpi-thresholding-panel-custom-threshold-window-content .kpi-thresholding-panel-custom-threshold-window-status {\n\tdisplay: inline-block;\n\tmargin-right: 15px;\n}\n\n.kpi-thresholding-panel-custom-threshold-window-content .kpi-thresholding-panel-custom-threshold-window-link {\n\tdisplay: inline-block;\n}\n\n.kpi-thresholding-panel-upper-section.fixed {\n\tposition: fixed;\n\ttop: 0;\n\tz-index: 419;\n}\n\n.kpi-thresholding-panel-lower-section {\n\tpadding: 0 0 20px 20px;\n}\n\n.thresolding-adaptive-thresholding-controls {\n\tdisplay: flex;\n}\n\n.thresholding-enable-time-policy-control,\n.thresholding-enable-adaptive-thresholding,\n.thresholding-adaptive-thresholding-training {\n\tpadding-right: 25px;\n}\n\n.thresholding-adaptive-thresholding-explanation {\n\tdisplay: inline-block;\n\tline-height: 20px;\n\tmargin-bottom: 15px;\n}\n\n.thresholding-default-container {\n\tmargin-top: 20px;\n}\n\n.thresholding-template-selector-control-container {\n\tpadding-top: 8px;\n}\n\n.thresholding-configure-preview-service {\n\tdisplay: inline-block;\n}\n\n.thresholding-template-radio-control {\n\tmargin-bottom: 15px;\n}\n\n.thresholding-configure-settings {\n\tpadding-top: 10px;\n}\n\n.thresholding-configure-settings > .kpi-alerting-options,\n.thresholding-configure-settings > .kpi-alerting-custom-rules {\n\tdisplay: block;\n\tpadding: 10px 0 0 20px;\n}\n\n.thresholding-configure-settings > .kpi-alerting-custom-rules > .kpi-alerting-custom-rule {\n\tpadding-bottom: 10px;\n}\n\n.thresholding-configure-settings > .kpi-alerting-add-rule {\n\tpadding: 10px 0 0 20px;\n}\n\n.enable-disable-time-policies,\n.enable-disable-adaptive-thresholding {\n\tvertical-align: baseline !important;\n}\n\n.thresholding-configure-aggregate-entity-toggle {\n\tmargin-bottom: 10px;\n}\n\n.thresholding-default-preview-container {\n\tdisplay: flex;\n\tflex-direction: row;\n}\n\n.thresholding-default-preview {\n\tpadding-bottom: 20px;\n}\n",""]),i.exports=s},3064:function(i,s,o){var h=o(3065);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},3065:function(i,s,o){(s=o(37)(!1)).push([i.i,".kpi-thresholding-panel {\n\tmargin-top: 2px;\n}\n",""]),i.exports=s},3066:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=o(5),y=o(1635),_=h(o(415)),S=h(o(3067)),T=h(o(146));o(3084);var x=_.default.extend({tagName:"div",className:"kpi-anomaly-panel",initialize:function initialize(i){(i=i||{}).dataTestItsi="service-anomaly-detection-collapsible-panel",i.panelId="anomaly",i.panelTitle=(0,v.gettext)("Anomaly Detection"),i.contentViewOptions={kpiModel:i.kpiModel,serviceModel:i.serviceModel},i.ContentView=S.default,_.default.prototype.initialize.apply(this,arguments)},_onPanelExpanded:function _onPanelExpanded(){_.default.prototype._onPanelExpanded.apply(this,arguments),(0,y.isJavaAvailable)().then(()=>{}).catch(()=>{new T.default({dataTestItsi:"kpi-anomaly-detection-java-error-modal",errorMessage:(0,v.gettext)("Java version installed on this search head does not support anomaly detection, Java version 1.8 or greater is required. You will still be able to enable AD on the KPI, but AD will not run properly."),onHiddenRemove:!0}).render()})}});s.default=x,i.exports=s.default},3067:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_=h(o(9)),S=o(49),T=h(o(15)),x=h(o(0)),R=h(o(36)),P=h(o(3)),L=h(o(42)),N=h(o(45)),V=h(o(118)),j=h(o(99)),W=h(o(86)),K=h(o(96)),U=o(5),Y=o(16),$=o(1138),X=o(68),Z=o(154),ee=o(77),te=o(174),ie=h(o(90)),ae=h(o(79)),ne=h(o(114)),re=h(o(52)),se=o(203),le=h(o(3068)),oe=h(o(3072)),de=h(o(3073)),ce=h(o(3077)),he=h(o(1610)),ue=h(o(3078)),pe=h(o(3079)),fe=h(o(3080)),ge=h(o(3081));o(3082);var me=(0,P.default)(W.default)(v||(v=(0,_.default)(["\n\tmargin-right: 5px;\n"]))),ve=(0,P.default)(j.default)(y||(y=(0,_.default)(["\n\tmargin-left: 5px;\n"]))),ye={COHESIVE_NOT_MIN_ENTITIES:(0,U.gettext)("Not enough entities to run the cohesive analysis."),COHESIVE_NOT_MAX_ENTITIES:(0,U.gettext)("Too many entities to run the cohesive analysis."),INSUFFICIENT_DATA:(0,U.gettext)("Insufficient data to produce recommendation."),NO_RECOMMENDATION:(0,U.gettext)("No recommendation.")},_e=(0,S.template)(pe.default,null,{variable:"vars"}),Se=(0,S.template)(fe.default,null,{variable:"vars"}),be=(0,S.template)(ge.default,null,{variable:"vars"}),Te=x.default.createElement(x.default.Fragment,null,x.default.createElement("svg",{width:"285px",height:"76px",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-test-itsi":"kpi-ad-cohesive-tooltip"},x.default.createElement("title",null,"cohesive-image"),x.default.createElement("desc",null,"Created with Sketch."),x.default.createElement("defs",null),x.default.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},x.default.createElement("g",{id:"cohesive-image-tooltip",transform:"translate(-22.000000, -7.000000)"},x.default.createElement("g",{id:"cohesive-image",transform:"translate(10.000000, 0.000000)"},x.default.createElement("g",{id:"image",transform:"translate(10.000000, 7.000000)"},x.default.createElement("path",{d:"M101.5,13.5 L101.5,36.5",id:"Line",stroke:se.backgroundColor,strokeLinecap:"square",strokeDasharray:"2"}),x.default.createElement("path",{d:"M134.5,34.5 L134.5,45.5",id:"Line-Copy-6",stroke:se.backgroundColor,strokeLinecap:"square",strokeDasharray:"2"}),x.default.createElement("path",{d:"M68.5,12.5 L68.5,43.5",id:"Line-Copy-5",stroke:se.backgroundColor,strokeLinecap:"square",strokeDasharray:"2"}),x.default.createElement("g",{id:"Group-7",transform:"translate(0.000000, 33.000000)",strokeLinecap:"square",strokeOpacity:"0.7",stroke:se.backgroundColor},x.default.createElement("polyline",{id:"Line",points:"3.5 21.5 37.3138313 12.5268731 70.1353536 19.2911773 102.990545 3.58832829 135.812066 18.5664304 169.150422 11.0773793 202.522449 19.2911773 240.46537 17.0549034"}),x.default.createElement("polyline",{id:"Line-Copy",points:"3.5 23.5 37.3138313 11.5268731 70.1353536 14.2911773 102.990545 9.58832829 135.812066 20.5664304 169.150422 11.0773793 202.522449 21.2911773 239.693391 22.0727684"}),x.default.createElement("polyline",{id:"Line-Copy-2",points:"3.5 16.5 37.3138313 16.5268731 70.1353536 12.2911773 102.990545 19.5883283 135.812066 13.5664304 169.150422 14.0773793 202.522449 24.2911773 239.693391 25.1606853"}),x.default.createElement("polyline",{id:"Line-Copy-3",points:"3.5 19.5 37.3138313 19.5268731 70.1353536 15.2911773 102.990545 22.5883283 135.812066 16.5664304 169.150422 17.0773793 202.522449 27.2911773 240.07938 18.2128722"}),x.default.createElement("polyline",{id:"Line-Copy-4",points:"3.5 18.5 37.3138313 22.5268731 70.1353536 14.2911773 102.990545 15.5883283 135.812066 15.5664304 169.150422 23.0773793 202.522449 22.2911773 240.46537 22.0727684"})),x.default.createElement("g",{id:"Group-5"},x.default.createElement("polyline",{id:"Line",stroke:se.infoColor,strokeWidth:"2",strokeLinecap:"square",points:"3.5 48.5 37.5 38.5 68.9425236 6.03977872 102.840452 7.6444144 135.334325 32.716847 168.429936 49.9666805 201.926706 53.9782698 238.535422 47.3529761"}),x.default.createElement("g",{id:"alert",transform:"translate(96.000000, 2.000000)"},x.default.createElement("g",{id:"Group-2"},x.default.createElement("circle",{id:"Oval",fill:se.errorColor,cx:"6",cy:"6",r:"6"}),x.default.createElement("text",{id:"!",fontFamily:"Roboto-Bold, Roboto",fontSize:"9",fontWeight:"bold",fill:se.backgroundColor},x.default.createElement("tspan",{x:"4.80000019",y:"9"},"!")))),x.default.createElement("g",{id:"alert",transform:"translate(62.000000, 0.000000)"},x.default.createElement("g",{id:"Group-2"},x.default.createElement("circle",{id:"Oval",fill:se.errorColor,cx:"6",cy:"6",r:"6"}),x.default.createElement("text",{id:"!",fontFamily:"Roboto-Bold, Roboto",fontSize:"9",fontWeight:"bold",fill:se.backgroundColor},x.default.createElement("tspan",{x:"4.80000019",y:"9"},"!"))))),x.default.createElement("g",{id:"good",transform:"translate(129.000000, 27.000000)"},x.default.createElement("g",null,x.default.createElement("circle",{id:"Oval",fill:se.successColor,cx:"6",cy:"6",r:"6"}),x.default.createElement("polyline",{id:"Line",stroke:se.backgroundColor,strokeWidth:"1.5",strokeLinecap:"square",points:"3.5 6.5 5.5 8.5 8.15163777 4.30905335"})))),x.default.createElement("path",{d:"M156,12 L166,12",id:"Line",stroke:se.infoColor,strokeWidth:"1.5",strokeLinecap:"square"}),x.default.createElement("path",{d:"M156,29 L166,29",id:"Line-Copy-2",stroke:se.backgroundColor,strokeWidth:"1.5",strokeLinecap:"square"}),x.default.createElement("text",{id:"Anomalous-entity",fontFamily:"Roboto-Regular, Roboto",fontSize:"11",fontWeight:"normal",fill:se.backgroundColor},x.default.createElement("tspan",{x:"170",y:"16"},(0,U.gettext)("Anomalous entity"))),x.default.createElement("text",{id:"Non-anomalous-entity",fontFamily:"Roboto-Regular, Roboto",fontSize:"11",fontWeight:"normal",fill:se.backgroundColor},x.default.createElement("tspan",{x:"170",y:"33"},(0,U.gettext)("Non-anomalous entities"))))))),x.default.createElement("div",{className:"kpi-ad-tooltip-description","data-test-itsi":"kpi-ad-cohesive-tooltip-description"},x.default.createElement("span",null,(0,U.gettext)("Entity Cohesion Anomaly Detection compares the behavior of each entity contributing to the KPI value. If any entity diverges from the common behavior, an anomaly is flagged.")))),Ee=x.default.createElement(x.default.Fragment,null,x.default.createElement("svg",{width:"285px",height:"76px",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-test-itsi":"kpi-ad-trending-tooltip"},x.default.createElement("title",null,"trending-image"),x.default.createElement("desc",null,"Created with Sketch."),x.default.createElement("defs",null),x.default.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},x.default.createElement("g",{id:"trending-image-tooltip",transform:"translate(-17.000000, -7.000000)"},x.default.createElement("g",{id:"trending-image",transform:"translate(5.000000, 0.000000)"},x.default.createElement("g",{id:"image"},x.default.createElement("path",{d:"M79.5,53.5 L79.5,64.5",id:"Line",stroke:se.backgroundColor,strokeLinecap:"square",strokeDasharray:"2"}),x.default.createElement("path",{d:"M113.5,14.5 L113.5,49.5570946",id:"Line",stroke:se.backgroundColor,strokeLinecap:"square",strokeDasharray:"2"}),x.default.createElement("path",{d:"M145.5,19.5 L146.5,63.5570946",id:"Line-Copy-5",stroke:se.backgroundColor,strokeLinecap:"square",strokeDasharray:"2"}),x.default.createElement("polyline",{id:"Line",stroke:se.backgroundColor,strokeWidth:"1.5",strokeLinecap:"square",strokeDasharray:"3",points:"13.5 69.5 47.3138313 60.5268731 80.1353536 67.2911773 112.990545 51.5883283 145.812066 66.5664304 179.150422 59.0773793 212.522449 67.2911773 245.211442 67.2087461"}),x.default.createElement("polyline",{id:"Line-Copy",stroke:se.infoColor,strokeWidth:"1.5",strokeLinecap:"square",points:"13.5 66.5 47.3138313 63.5268731 80.1353536 51.2911773 112.990545 12.5883283 145.812066 15.5664304 179.150422 61.0773793 212.522449 64.2911773 244.885398 61.6660027"}),x.default.createElement("g",{id:"alert",transform:"translate(107.000000, 7.000000)"},x.default.createElement("g",{id:"Group-2"},x.default.createElement("circle",{id:"Oval",fill:se.errorColor,cx:"6",cy:"6",r:"6"}),x.default.createElement("text",{id:"!",fontFamily:"Roboto-Bold, Roboto",fontSize:"9",fontWeight:"bold",fill:se.backgroundColor},x.default.createElement("tspan",{x:"4.80000019",y:"9"},"!")))),x.default.createElement("g",{id:"good",transform:"translate(73.000000, 44.000000)"},x.default.createElement("g",null,x.default.createElement("circle",{id:"Oval",fill:se.successColor,cx:"6",cy:"6",r:"6"}),x.default.createElement("polyline",{id:"Line",stroke:se.backgroundColor,strokeWidth:"1.5",strokeLinecap:"square",points:"3.5 6.5 5.5 8.5 8.15163777 4.30905335"}))),x.default.createElement("g",{id:"alert",transform:"translate(140.000000, 9.000000)"},x.default.createElement("g",{id:"Group-2"},x.default.createElement("circle",{id:"Oval",fill:se.errorColor,cx:"6",cy:"6",r:"6"}),x.default.createElement("text",{id:"!",fontFamily:"Roboto-Bold, Roboto",fontSize:"9",fontWeight:"bold",fill:se.backgroundColor},x.default.createElement("tspan",{x:"4.80000019",y:"9"},"!"))))),x.default.createElement("path",{d:"M216,16 L225,16",id:"Line",stroke:se.infoColor,strokeWidth:"1.5",strokeLinecap:"square"}),x.default.createElement("path",{d:"M216,33 L226,33",id:"Line-Copy-2",stroke:se.backgroundColor,strokeWidth:"1.5",strokeLinecap:"square",strokeDasharray:"3"}),x.default.createElement("text",{id:"KPI-Value",fontFamily:"Roboto-Regular, Roboto",fontSize:"11",fontWeight:"normal",fill:se.backgroundColor},x.default.createElement("tspan",{x:"230",y:"20"},(0,U.gettext)("KPI Value"))),x.default.createElement("text",{id:"KPI-Trend",fontFamily:"Roboto-Regular, Roboto",fontSize:"11",fontWeight:"normal",fill:se.backgroundColor},x.default.createElement("tspan",{x:"230",y:"37"},(0,U.gettext)("KPI Trend"))))))),x.default.createElement("div",{className:"kpi-ad-tooltip-description","data-test-itsi":"kpi-ad-trending-tooltip-description"},x.default.createElement("span",null,(0,U.gettext)("Trending Anomaly Detection compares the aggregated value of the KPI to its historical trend. If the value diverges from the trend too much, an anomaly is flagged.")))),ke=T.default.View.extend({tagName:"div",className:"kpi-anomaly-content-panel",currPageLabelWidth:X.LABEL_WIDTHS.ExtraLong,initialize:function initialize(i){if(!(i=i||{}).kpiModel)throw"Must provide kpiModel";if(this.model=i.kpiModel,!i.serviceModel)throw"Must provide serviceModel";this.serviceModel=i.serviceModel,this._trendingAnomaliesExpected=.1,this._cohesiveAnomaliesExpected=.1,this._cohesiveKpiEntityMinLimit=4,this._analysisNew=!0,this._analysisModel=new T.default.Model({earliestTime:"-7d",latestTime:"now",trending:!1,cohesive:!1}),this._trendingResultsModel=new T.default.Model({freshAnalysis:!0,fractionAnomaliesDetected:0,analysisTimeWindow:""}),this._cohesiveResultsModel=new T.default.Model({freshAnalysis:!0,entitiesAnalyzed:0,entitiesWithAnomalies:0,averageAnomaliesPerEntity:0,fractionAnomaliesDetected:0,analysisTimeWindow:""}),this.listenTo(this._analysisModel,"change:trending change:cohesive",this._checkOverallAnalysisStatus),T.default.View.prototype.initialize(this,arguments),this.children||(this.children={}),this.children.analyzeButton=new ae.default({appearance:"primary",dataTestItsi:"analyze-kpi-data-button",label:(0,U.gettext)("Analyze KPI Data"),onClick:this.onAnalyze.bind(this)});var s=(0,U.gettext)("Run KPI Analysis to get recommendation");this.children.trendingMessageView=new ne.default({content:s,dataTestItsi:"kpi-anomaly-panel-trending-info-message",style:{marginBottom:0},type:"info"}),this.children.cohesiveMessageView=new ne.default({content:this.model.get("is_entity_breakdown")?s:(0,U.gettext)("Enable split by entities from Search and Calculate section and Save the KPI, in order to be able to enable Cohesive Anomaly Detection."),dataTestItsi:"kpi-anomaly-panel-cohesive-info-message",style:{marginBottom:0},type:this.model.get("is_entity_breakdown")?"info":"error"})},onAnalyze:function onAnalyze(){this._analysisNew?this._toggleAnalysisResults("processing"):this._toggleAnalysisResults("redo")},_checkOverallAnalysisStatus:function _checkOverallAnalysisStatus(){this._analysisModel.get("trending")&&this._analysisModel.get("cohesive")&&this._enableAnalysisButton()},_enableAnalysisButton:function _enableAnalysisButton(){var i;null===(i=this.children)||void 0===i||i.analyzeButton.enable()},_disableAnalysisButton:function _disableAnalysisButton(){var i;null===(i=this.children)||void 0===i||i.analyzeButton.disable()},_toggleAnalysisResults:function _toggleAnalysisResults(i){if(!(0,N.default)(i)&&i){var s=(0,U.gettext)("Analyzing KPI..."),o=(0,U.gettext)("Analyzing KPI. Depending on the number of entities, this might take a few minutes...");if("processing"!==i&&"redo"!==i)throw"Invalid mode passed in while toggling the analysis process";if(this._disableAnalysisButton(),"processing"===i){this.$(".kpi-anomaly-panel-trending-analysis-config-result-pane-start").toggle(),this.$(".kpi-anomaly-panel-trending-analysis-config-result-pane-processing").toggle();var h=this.$(".kpi-anomaly-panel-trending-analysis-config-result-processing");if(R.default.unmountComponentAtNode(h.get(0)),R.default.render(x.default.createElement(re.default,null,x.default.createElement(me,{"data-test-itsi":"trending-wait-spinner"}),s),h.get(0)),this.model.get("is_entity_breakdown")){this.$(".kpi-anomaly-panel-cohesive-analysis-config-result-pane-start").toggle(),this.$(".kpi-anomaly-panel-cohesive-analysis-config-result-pane-processing").toggle();var v=this.$(".kpi-anomaly-panel-cohesive-analysis-config-result-processing");R.default.unmountComponentAtNode(v.get(0)),R.default.render(x.default.createElement(re.default,null,x.default.createElement(me,{"data-test-itsi":"cohesive-wait-spinner"}),o),v.get(0))}this._analysisNew=!1}else if("redo"===i){this.$(".kpi-anomaly-panel-trending-analysis-config-result-pane-start").hide(),this.$(".kpi-anomaly-panel-trending-analysis-config-result-pane-end").hide(),this.$(".kpi-anomaly-panel-trending-analysis-config-result-pane-processing *").show();var y=this.$(".kpi-anomaly-panel-trending-analysis-config-result-processing");if(R.default.unmountComponentAtNode(y.get(0)),R.default.render(x.default.createElement(re.default,null,x.default.createElement(me,{"data-test-itsi":"trending-wait-spinner"}),s),y.get(0)),this.model.get("is_entity_breakdown")){this.$(".kpi-anomaly-panel-cohesive-analysis-config-result-pane-start").hide(),this.$(".kpi-anomaly-panel-cohesive-analysis-config-result-pane-end").hide(),this.$(".kpi-anomaly-panel-cohesive-analysis-config-result-pane-processing *").show();var _=this.$(".kpi-anomaly-panel-cohesive-analysis-config-result-processing");R.default.unmountComponentAtNode(_.get(0)),R.default.render(x.default.createElement(re.default,null,x.default.createElement(me,{"data-test-itsi":"cohesive-wait-spinner"}),o),_.get(0))}this._disposeAll(),(0,te.safeRemoveView)(this,this._trendingAnalysisBreakdownViewPanel),(0,te.safeRemoveView)(this,this._cohesiveAnalysisBreakdownViewPanel),this._analysisModel.set({trending:!1,cohesive:!1})}this._dispatchKpiAnomalyDetectionSearches()}},_findSearchAnalysisTimeWindow:function _findSearchAnalysisTimeWindow(i){return ee.ALGORITHM_TIME_PERIOD_SELECT_LIST.filter((function(s){return s.value===i}))[0].label},_dispatchKpiAnomalyDetectionSearches:function _dispatchKpiAnomalyDetectionSearches(){var i=this.model.id,s=this._analysisModel.get("earliestTime");this._trendingAnomalyDetectionSearchJobSid=null,this.cleanSearchJobSubscriptions(this._trendingAnomalyDetectionSearchJob,this._trendingAnomalyDetectionSearchSubscription),this._trendingAnomalyDetectionSearchJob=K.default.create({id:(0,Z.createUniqueSearchId)("trending-ad-analysis"),earliest_time:s,latest_time:"now",cache:600,status_buckets:500,sample_ratio:null,search:"`get_itsi_summary_index` itsi_kpi_id=".concat(i," ")+"indexed_is_service_aggregate::1 indexed_is_service_max_severity_event::0 | fields - _raw | table alert_value, itsi_kpi_id,_time",time_format:"%s.%Q",auto_cancel:300}),this._trendingAnomalyDetectionSearchSidSubscription=this._trendingAnomalyDetectionSearchJob.getSid().subscribe(i=>{this._trendingAnomalyDetectionSearchJobSid=i}),this._trendingAnomalyDetectionSearchSubscription=this._trendingAnomalyDetectionSearchJob.getResults({offset:0,count:0}).subscribe({next:i=>{var s;this._checkTrendingDataSufficiency(null==i||null===(s=i.results)||void 0===s?void 0:s.length)},error:()=>{this._showSearchManagerErrorMessageForAnalysis($.MAD_ALGORITHM_TYPES.TRENDING)}}),this.model.get("is_entity_breakdown")?(this._cohesiveAnomalyDetectionSearchJobSid=null,this.cleanSearchJobSubscriptions(this._cohesiveAnomalyDetectionSearchJob,this._cohesiveAnomalyDetectionSearchSubscription),this._cohesiveAnomalyDetectionSearchJob=K.default.create({id:(0,Z.createUniqueSearchId)("cohesive-ad-analysis"),earliest_time:s,latest_time:"now",cache:600,status_buckets:500,sample_ratio:null,search:"`get_itsi_summary_index` itsi_kpi_id=".concat(i," ")+'indexed_is_service_aggregate::0 indexed_is_service_max_severity_event::0 | `escape_entity_key` | eval entity_id=if(entity_key=="N/A", entity_title, entity_key) | fields - _raw | table alert_value, itsi_kpi_id, _time, entity_id',time_format:"%s.%Q",auto_cancel:300}),this._cohesiveAnomalyDetectionSearchSidSubscription=this._cohesiveAnomalyDetectionSearchJob.getSid().subscribe(i=>{this._cohesiveAnomalyDetectionSearchJobSid=i}),this._cohesiveAnomalyDetectionSearchSubscription=this._cohesiveAnomalyDetectionSearchJob.getResults({offset:0,count:0}).subscribe({next:i=>{var s;this._checkCohesiveDataSufficiency(null==i||null===(s=i.results)||void 0===s?void 0:s.length)},error:()=>{this._showSearchManagerErrorMessageForAnalysis($.MAD_ALGORITHM_TYPES.COHESIVE)}})):this._analysisModel.set({cohesive:!0})},_checkTrendingDataSufficiency:function _checkTrendingDataSufficiency(i){i<1440/this.model.get("alert_period")?this._showTrendingInsufficientData(ye.INSUFFICIENT_DATA,(0,U.gettext)("At least 24 hours of service data is required. Enable backfill for the KPI or try again in a day.")):this._runTrendingLoadJobSearchManager()},_checkCohesiveDataSufficiency:function _checkCohesiveDataSufficiency(i){var s=1440/this.model.get("alert_period"),o=this._analysisModel.get("earliestTime"),h=(0,U.gettext)("At least 24 hours of service data is required. Enable backfill for the KPI or try again in a day.");i&&i>0?(this.cleanSearchJobSubscriptions(this._cohesiveEntityCountLoadJobSearchJob,this._cohesiveEntityCountLoadJobSearchSubscription),this._cohesiveEntityCountLoadJobSearchJob=K.default.create({id:(0,Z.createUniqueSearchId)("cohesive-ad-entity-count"),earliest_time:o,latest_time:"now",cache:600,status_buckets:0,sample_ratio:null,search:"| loadjob ".concat(this._cohesiveAnomalyDetectionSearchJobSid," | stats count by entity_id | sort - count"),time_format:"%s.%Q",auto_cancel:90}),this._cohesiveEntityCountLoadJobSearchSubscription=this._cohesiveEntityCountLoadJobSearchJob.getResults({offset:0,count:0}).subscribe({next:i=>{var o;if(this._cohesiveResultsModel.set("entitiesAnalyzed",null==i||null===(o=i.results)||void 0===o?void 0:o.length),this._checkCohesiveKpiEntityMinLimit()){var v=[];if(i.results.length===this._cohesiveResultsModel.get("entitiesAnalyzed")){v=i.results.slice(0,this._cohesiveKpiEntityMinLimit);var y=!1;(0,L.default)(v,i=>{parseInt(i.count,10)<s&&(y=!0)}),y?this._showCohesiveInsufficientData(ye.INSUFFICIENT_DATA,h):this._checkCohesiveKpiEntityLimit()}else this._showCohesiveInsufficientData(ye.COHESIVE_NOT_MIN_ENTITIES,(0,Y.sprintf)((0,U.gettext)("Minimum entities required is %s, but found %s."),this._cohesiveKpiEntityMinLimit,this._cohesiveResultsModel.get("entitiesAnalyzed")))}},error:()=>{this._showSearchManagerErrorMessageForAnalysis($.MAD_ALGORITHM_TYPES.COHESIVE)}})):this._showCohesiveInsufficientData(ye.INSUFFICIENT_DATA,h)},_checkCohesiveKpiEntityMinLimit:function _checkCohesiveKpiEntityMinLimit(){return!(this._cohesiveResultsModel.get("entitiesAnalyzed")<this._cohesiveKpiEntityMinLimit)||(this._showCohesiveInsufficientData(ye.COHESIVE_NOT_MIN_ENTITIES,(0,Y.sprintf)((0,U.gettext)("Minimum entities required is %s, but found %s."),this._cohesiveKpiEntityMinLimit,this._cohesiveResultsModel.get("entitiesAnalyzed"))),!1)},_showCohesiveInsufficientData:function _showCohesiveInsufficientData(i,s){this.$(".kpi-anomaly-panel-cohesive-analysis-config-result-processing",this.$el).hide(),this.$(".kpi-anomaly-panel-cohesive-analysis-config-result-pane-start",this.$el).empty().show(),this.children.cohesiveMessageView=new ne.default({content:x.default.createElement(x.default.Fragment,null,i,x.default.createElement(ve,{"data-test-itsi":"kpi-anomaly-panel-cohesive-analysis-error-tooltip",content:s})),dataTestItsi:"kpi-anomaly-panel-cohesive-error-message",style:{marginBottom:0},type:"error"}),this.$(".kpi-anomaly-panel-cohesive-analysis-config-result-pane-start",this.$el).append(this.children.cohesiveMessageView.render().$el),this._analysisModel.set({cohesive:!0})},_showTrendingInsufficientData:function _showTrendingInsufficientData(i,s){this.$(".kpi-anomaly-panel-trending-analysis-config-result-processing",this.$el).hide(),this.$(".kpi-anomaly-panel-trending-analysis-config-result-pane-start",this.$el).empty().show(),this.children.trendingMessageView=new ne.default({content:x.default.createElement(x.default.Fragment,null,i,x.default.createElement(ve,{"data-test-itsi":"kpi-anomaly-panel-trending-analysis-error-tooltip",content:s})),dataTestItsi:"kpi-anomaly-panel-trending-error-message",style:{marginBottom:0},type:"error"}),this.$(".kpi-anomaly-panel-trending-analysis-config-result-pane-start",this.$el).append(this.children.trendingMessageView.render().$el),this._analysisModel.set({trending:!0})},_checkCohesiveKpiEntityLimit:function _checkCohesiveKpiEntityLimit(){var i=this._analysisModel.get("earliestTime");this.cleanSearchJobSubscriptions(this._cohesiveRestKpiEntityLimitSearchJob,this._cohesiveRestKpiEntityLimitSearchSubscription),this._cohesiveRestKpiEntityLimitSearchJob=K.default.create({id:(0,Z.createUniqueSearchId)("cohesive-ad-kpi-entity-limit"),earliest_time:i,latest_time:"now",cache:600,status_buckets:500,sample_ratio:null,search:"| rest servicesNS/nobody/SA-ITSI-MetricAD/configs/conf-mad/cohesive splunk_server=local | fields metrics_maximum",time_format:"%s.%Q",auto_cancel:90}),this._cohesiveRestKpiEntityLimitSearchSubscription=this._cohesiveRestKpiEntityLimitSearchJob.getResults({offset:0,count:0}).subscribe({next:i=>{var s;if(0===(null==i||null===(s=i.results)||void 0===s?void 0:s.length))this._showCohesiveInsufficientData(ye.NO_RECOMMENDATION,(0,U.gettext)("The per KPI entity count limit for anomaly detection is not set in mad.conf."));else{var o=parseInt(i.results[0].metrics_maximum,10);o?this._cohesiveKpiEntityMinLimit<=this._cohesiveResultsModel.get("entitiesAnalyzed")&&this._cohesiveResultsModel.get("entitiesAnalyzed")<=o?this._runCohesiveLoadJobSearchManager():this._showCohesiveInsufficientData(ye.COHESIVE_NOT_MAX_ENTITIES,(0,Y.sprintf)((0,U.gettext)("Cohesive analysis can be done with maximum %s entities, but found %s."),o,this._cohesiveResultsModel.get("entitiesAnalyzed"))):this._showCohesiveInsufficientData(ye.NO_RECOMMENDATION,(0,U.gettext)("The per KPI entity count limit for anomaly detection is not set in mad.conf."))}},error:()=>{this._showSearchManagerErrorMessageForAnalysis($.MAD_ALGORITHM_TYPES.COHESIVE)}})},_showSearchManagerErrorMessageForAnalysis:function _showSearchManagerErrorMessageForAnalysis(i){var s=(0,U.gettext)("One or more Splunk searches ran to perform the analysis timed out, or was cancelled, or failed with error(s).");if(i)switch(i){case $.MAD_ALGORITHM_TYPES.COHESIVE:this._showCohesiveInsufficientData(ye.NO_RECOMMENDATION,s);break;case $.MAD_ALGORITHM_TYPES.TRENDING:this._showTrendingInsufficientData(ye.NO_RECOMMENDATION,s);break;default:var o=(0,U.gettext)("There is not enough data to make the recommendation at this time.");this._showCohesiveInsufficientData(ye.INSUFFICIENT_DATA,o),this._showTrendingInsufficientData(ye.INSUFFICIENT_DATA,o)}},_renderTrendingSummary:function _renderTrendingSummary(){this._trendingAnomalyDetectionLoadjobPostProcessSearchSubscription=this._trendingAnomalyDetectionLoadjobSearchJob.getResults({search:"where sensitivity_".concat(this._trendingAdSettingsModel.get("sensitivity"),"=1"),offset:0,count:0}).subscribe({next:i=>{this._trendingAlertTrueResultCount=i.results.length,this._checkRecommendation($.MAD_ALGORITHM_TYPES.TRENDING);var s=this._findSearchAnalysisTimeWindow(this._analysisModel.get("earliestTime"));this._trendingResultsModel.set({fractionAnomaliesDetected:this._trendingAlertTrueResultCount/this._trendingAlertTotalResultCount,analysisTimeWindow:s}),!0===this._trendingResultsModel.get("freshAnalysis")&&this._renderAnalysisBreakdown($.MAD_ALGORITHM_TYPES.TRENDING),this._analysisModel.set({trending:!0})},error:()=>{this._showSearchManagerErrorMessageForAnalysis($.MAD_ALGORITHM_TYPES.TRENDING)}})},_runTrendingLoadJobSearchManager:function _runTrendingLoadJobSearchManager(){var i=this.model.get("alert_period"),s=this.model.id,o=this._analysisModel.get("earliestTime");this.cleanSearchJobSubscriptions(this._trendingAnomalyDetectionLoadjobSearchJob,this._trendingAnomalyDetectionLoadjobSearchSubscription),this._trendingAnomalyDetectionLoadjobSearchJob=K.default.create({id:(0,Z.createUniqueSearchId)("trending-ad-mad-analysis"),earliest_time:o,latest_time:"now",cache:600,status_buckets:0,sample_ratio:null,search:"| loadjob ".concat(this._trendingAnomalyDetectionSearchJobSid," | reverse | mad trending alert_value span=")+i+"m itsi_kpi_id="+s+' | naccum algorithm=trending | foreach sensitivity_* [eval <<FIELD>>=if (<<FIELD>>=="true", 1, 0)]',time_format:"%s.%Q",auto_cancel:300}),this._trendingAnomalyDetectionLoadjobSearchSubscription=this._trendingAnomalyDetectionLoadjobSearchJob.getResults({offset:0,count:0}).subscribe({next:i=>{var s;this._trendingAlertTotalResultCount=null==i||null===(s=i.results)||void 0===s?void 0:s.length,this._trendingResultsModel.set("freshAnalysis",!0),this._renderTrendingSummary(),this.listenTo(this._trendingAdSettingsModel,"change:sensitivity",()=>{this._trendingResultsModel.set("freshAnalysis",!1),this._renderTrendingSummary()})},error:()=>{this._showSearchManagerErrorMessageForAnalysis($.MAD_ALGORITHM_TYPES.TRENDING)}})},_renderCohesiveSummary:function _renderCohesiveSummary(){this.cleanSearchJobSubscriptions(this._cohesiveAnomalyDetectionLoadjobPostProcessSearchJob,this._cohesiveAnomalyDetectionLoadjobPostProcessSearchSubscription),this._cohesiveAnomalyDetectionLoadjobPostProcessSearchJob=K.default.create({id:(0,Z.createUniqueSearchId)("cohesive-ad-mad-analysis-alert"),earliest_time:this._analysisModel.get("earliestTime"),latest_time:"now",cache:600,status_buckets:0,sample_ratio:null,search:"| loadjob ".concat(this._cohesiveAnomalyDetectionLoadjobSearchJobSid)+" | where sensitivity_"+this._cohesiveAdSettingsModel.get("sensitivity")+"=1 | stats count by entity_id",time_format:"%s.%Q",auto_cancel:90}),this._cohesiveAnomalyDetectionLoadjobPostProcessSearchSubscription=this._cohesiveAnomalyDetectionLoadjobPostProcessSearchJob.getResults({offset:0,count:0}).subscribe({next:i=>{var s;this._cohesiveResultsModel.set("entitiesWithAnomalies",null==i||null===(s=i.results)||void 0===s?void 0:s.length);var o={};if(i.results&&(o.rows=i.results.map(i=>Object.values(i))),0===this._cohesiveResultsModel.get("entitiesWithAnomalies")){this._cohesiveAlertTrueResultCount=0,this._cohesiveResultsModel.set("averageAnomaliesPerEntity",0),this._checkRecommendation($.MAD_ALGORITHM_TYPES.COHESIVE);var h=this._findSearchAnalysisTimeWindow(this._analysisModel.get("earliestTime"));this._cohesiveResultsModel.set({fractionAnomaliesDetected:this._cohesiveAlertTrueResultCount/this._cohesiveAlertTotalResultCount,analysisTimeWindow:h}),!0===this._cohesiveResultsModel.get("freshAnalysis")&&this._renderAnalysisBreakdown($.MAD_ALGORITHM_TYPES.COHESIVE),this._analysisModel.set({cohesive:!0})}else{if(this._cohesiveAlertTrueResultCount=0,o.rows&&o.rows.length>0){(0,L.default)(i.results,function(i){this._cohesiveAlertTrueResultCount+=parseInt(i[1])}.bind(this));var v=this._cohesiveResultsModel.get("averageAnomaliesPerEntity");this._cohesiveResultsModel.set("averageAnomaliesPerEntity",v/o.rows.length)}this._checkRecommendation($.MAD_ALGORITHM_TYPES.COHESIVE),h=this._findSearchAnalysisTimeWindow(this._analysisModel.get("earliestTime")),this._cohesiveResultsModel.set({fractionAnomaliesDetected:this._cohesiveAlertTrueResultCount/this._cohesiveAlertTotalResultCount,analysisTimeWindow:h}),!0===this._cohesiveResultsModel.get("freshAnalysis")&&this._renderAnalysisBreakdown($.MAD_ALGORITHM_TYPES.COHESIVE),this._analysisModel.set({cohesive:!0})}},error:()=>{this._showSearchManagerErrorMessageForAnalysis($.MAD_ALGORITHM_TYPES.COHESIVE)}})},_runCohesiveLoadJobSearchManager:function _runCohesiveLoadJobSearchManager(){var i=this.model.get("alert_period"),s=this.model.id,o=this._analysisModel.get("earliestTime");this._cohesiveAnomalyDetectionLoadjobSearchJobSid=null,this.cleanSearchJobSubscriptions(this._cohesiveAnomalyDetectionLoadjobSearchJob,this._cohesiveAnomalyDetectionLoadjobSearchSubscription),this._cohesiveAnomalyDetectionLoadjobSearchSidSubscription&&this._cohesiveAnomalyDetectionLoadjobSearchSidSubscription.unsubscribe(),this._cohesiveAnomalyDetectionLoadjobSearchJob=K.default.create({id:(0,Z.createUniqueSearchId)("cohesive-ad-mad-analysis"),earliest_time:o,latest_time:"now",cache:600,status_buckets:0,sample_ratio:null,search:"| loadjob ".concat(this._cohesiveAnomalyDetectionSearchJobSid," | reverse ")+"| mad cohesive alert_value group_by=entity_id span="+i+"m itsi_kpi_id="+s+' | naccum algorithm=cohesive group_by=entity_id | foreach sensitivity_* [eval <<FIELD>>=if (<<FIELD>>=="true", 1, 0)]',time_format:"%s.%Q",auto_cancel:300}),this._cohesiveAnomalyDetectionLoadjobSearchSidSubscription=this._cohesiveAnomalyDetectionLoadjobSearchJob.getSid().subscribe(i=>{this._cohesiveAnomalyDetectionLoadjobSearchJobSid=i}),this._cohesiveAnomalyDetectionLoadjobSearchSubscription=this._cohesiveAnomalyDetectionLoadjobSearchJob.getResults({offset:0,count:0}).subscribe({next:i=>{var s;this._cohesiveAlertTotalResultCount=null==i||null===(s=i.results)||void 0===s?void 0:s.length,this._cohesiveResultsModel.set("freshAnalysis",!0),this._renderCohesiveSummary(),this.listenTo(this._cohesiveAdSettingsModel,"change:sensitivity",()=>{this._cohesiveResultsModel.set("freshAnalysis",!1),this._renderCohesiveSummary()})},error:()=>{this._showSearchManagerErrorMessageForAnalysis($.MAD_ALGORITHM_TYPES.COHESIVE)}})},cleanSearchJobSubscriptions:function cleanSearchJobSubscriptions(i,s){s&&s.unsubscribe(),i&&i.cancel()},_disposeAll:function _disposeAll(){this.disposeAllTrendingSearchJobs(),this.disposeAllCohesiveSearchJobs()},disposeAllTrendingSearchJobs:function disposeAllTrendingSearchJobs(){this._trendingAnomalyDetectionLoadjobPostProcessSearchSubscription&&this._trendingAnomalyDetectionLoadjobPostProcessSearchSubscription.unsubscribe(),this.cleanSearchJobSubscriptions(this._trendingAnomalyDetectionLoadjobSearchJob,this._trendingAnomalyDetectionLoadjobSearchSubscription),this._trendingAnomalyDetectionSearchSidSubscription&&this._trendingAnomalyDetectionSearchSidSubscription.unsubscribe(),this.cleanSearchJobSubscriptions(this._trendingAnomalyDetectionSearchJob,this._trendingAnomalyDetectionSearchSubscription)},disposeAllCohesiveSearchJobs:function disposeAllCohesiveSearchJobs(){this.cleanSearchJobSubscriptions(this._cohesiveAnomalyDetectionLoadjobPostProcessSearchJob,this._cohesiveAnomalyDetectionLoadjobPostProcessSearchSubscription),this._cohesiveAnomalyDetectionLoadjobSearchSidSubscription&&this._cohesiveAnomalyDetectionLoadjobSearchSidSubscription.unsubscribe(),this.cleanSearchJobSubscriptions(this._cohesiveAnomalyDetectionLoadjobSearchJob,this._cohesiveAnomalyDetectionLoadjobSearchSubscription),this.cleanSearchJobSubscriptions(this._cohesiveRestKpiEntityLimitSearchJob,this._cohesiveRestKpiEntityLimitSearchSubscription),this.cleanSearchJobSubscriptions(this._cohesiveEntityCountLoadJobSearchJob,this._cohesiveEntityCountLoadJobSearchSubscription),this._cohesiveAnomalyDetectionSearchSidSubscription&&this._cohesiveAnomalyDetectionSearchSidSubscription.unsubscribe(),this.cleanSearchJobSubscriptions(this._cohesiveAnomalyDetectionSearchJob,this._cohesiveAnomalyDetectionSearchSubscription)},_checkRecommendation:function _checkRecommendation(i){if(!((0,N.default)(i)||i!==$.MAD_ALGORITHM_TYPES.TRENDING&&i!==$.MAD_ALGORITHM_TYPES.COHESIVE)){var s,o,h=(0,U.gettext)("Check the Analysis Breakdown for more information."),v=!0,y=!0;switch(i){case $.MAD_ALGORITHM_TYPES.TRENDING:if(!(0,V.default)(this._trendingAlertTotalResultCount)||!(0,V.default)(this._trendingAlertTrueResultCount))return;this.$(".kpi-anomaly-panel-trending-analysis-config-result-processing",this.$el).hide(),this._trendingAlertTrueResultCount/this._trendingAlertTotalResultCount<this._trendingAnomaliesExpected?o=(0,U.gettext)("Recommended"):(v=!1,o=(0,U.gettext)("Not Recommended")),this.$(".kpi-anomaly-panel-trending-analysis-config-result-end",this.$el).empty(),this.children.trendingMessageView=new ne.default({content:x.default.createElement(x.default.Fragment,null,o,x.default.createElement(ve,{"data-test-itsi":v?"kpi-anomaly-panel-trending-result-recommended-tooltip":"kpi-anomaly-panel-trending-result-not-recommended-tooltip",content:h})),dataTestItsi:"kpi-anomaly-panel-trending-error-message",style:{marginBottom:0},type:v?"success":"error"}),this.$(".kpi-anomaly-panel-trending-analysis-config-result-end",this.$el).append(this.children.trendingMessageView.render().el),this.$(".kpi-anomaly-panel-trending-analysis-config-result-pane-end",this.$el).show();break;case $.MAD_ALGORITHM_TYPES.COHESIVE:if(!(0,V.default)(this._cohesiveAlertTotalResultCount)||!(0,V.default)(this._cohesiveAlertTrueResultCount))return;this._cohesiveAlertTrueResultCount/this._cohesiveAlertTotalResultCount<this._cohesiveAnomaliesExpected?s=(0,U.gettext)("Recommended"):(y=!1,s=(0,U.gettext)("Not Recommended")),this.$(".kpi-anomaly-panel-cohesive-analysis-config-result-processing",this.$el).hide(),this.children.cohesiveMessageView=new ne.default({content:x.default.createElement(x.default.Fragment,null,s,x.default.createElement(ve,{"data-test-itsi":v?"kpi-anomaly-panel-cohesive-result-recommended-tooltip":"kpi-anomaly-panel-cohesive-result-not-recommended-tooltip",content:h})),dataTestItsi:"kpi-anomaly-panel-trending-error-message",style:{marginBottom:0},type:y?"success":"error"}),this.$(".kpi-anomaly-panel-cohesive-analysis-config-result-end",this.$el).empty(),this.$(".kpi-anomaly-panel-cohesive-analysis-config-result-end",this.$el).append(this.children.cohesiveMessageView.render().el),this.$(".kpi-anomaly-panel-cohesive-analysis-config-result-pane-end",this.$el).show();break;default:console.log("Unknown AD algorithm!")}}},render:function render(){var i;return this.$el.html(_e),this.$(".kpi-anomaly-panel-explanation-container").text((0,U.gettext)("ITSI Anomaly Detection learns the normal patterns of KPIs continuously in real-time, triggering a notable event when a KPI departs from its expected behavior. Certain types of data are not suitable for use with anomaly detection because they produce too many false positives. We recommend that you analyze the KPI data first to check its compatibility with ITSI's anomaly detection algorithms.")),(0,te.safeRemoveView)(this,this.analysisTimeWindow),this.analysisTimeWindow=new ie.default({controlType:"SyntheticSelect",controlOptions:{dataTestItsi:"kpi-anomaly-earliest-select",items:ee.ALGORITHM_TIME_PERIOD_SELECT_LIST,model:this._analysisModel,modelAttribute:"earliestTime"},dataTestItsi:"kpi-anomaly-earliest-control-group",inline:!0,label:(0,U.gettext)("Analysis Time Window"),labelWidth:this.currPageLabelWidth}),(0,te.safeRemoveView)(this,this.trendingAnalysisHeading),this.trendingAnalysisHeading=new he.default({dataTestItsi:"trending-anomaly-detection-text-label",label:(0,U.gettext)("Trending Anomaly Detection"),tooltip:Ee}),(0,te.safeRemoveView)(this,this.cohesiveAnalysisHeading),this.cohesiveAnalysisHeading=new he.default({dataTestItsi:"cohesion-anomaly-detection-text-label",label:(0,U.gettext)("Entity Cohesion Anomaly Detection"),tooltip:Te}),(0,te.safeRemoveView)(this,this.trendingAnalysisConfig),this.trendingAnalysisConfig=new ie.default({controlType:"SyntheticRadio",controlOptions:{dataTestItsi:"anomaly-detection-status-radio",items:[{label:(0,U.gettext)("Yes"),value:!0},{label:(0,U.gettext)("No"),value:!1}],model:this.model,modelAttribute:"anomaly_detection_is_enabled"},dataTestItsi:"kpi-anomaly-detection-status-control-group",label:(0,U.gettext)("Enable Trending AD Algorithm"),labelWidth:this.currPageLabelWidth}),this._trendingAdSettingsModel=this.model.get("trending_ad"),(0,te.safeRemoveView)(this,this.trendingSensitivity),this._trendingAdSettingsModel.fetchMadSettings().done(function(){this.trendingSensitivity=new ie.default({controlType:"Number",controlOptions:{dataTestItsi:"trending-algorithm-sensitivity-number-control",listenForModelChanges:!0,max:this._trendingAdSettingsModel.get("sensitivity_max")||10,min:this._trendingAdSettingsModel.get("sensitivity_min")||0,model:this._trendingAdSettingsModel,modelAttribute:"sensitivity",placeholder:(0,U.gettext)("required")},dataTestItsi:"trending-algorithm-sensitivity-control-group",label:(0,U.gettext)("Algorithm Sensitivity"),labelWidth:this.currPageLabelWidth,tooltip:(0,U.gettext)("Sensitivity to variance in data.")}),(0,te.safeRemoveView)(this,this.trendingSensitivitySlider),this.trendingSensitivitySlider=new ue.default({dataTestItsi:"trending-sensitivity-slider",max:this._trendingAdSettingsModel.get("sensitivity_max")||10,min:this._trendingAdSettingsModel.get("sensitivity_min")||0,model:this._trendingAdSettingsModel,modelAttribute:"sensitivity",step:1}),this.$(".kpi-anomaly-panel-trending-analysis-config",this.$el).append(this.trendingSensitivity.render().el),this.trendingSensitivity.$el.find('[data-test="controls"]').prepend(this.trendingSensitivitySlider.render().el)}.bind(this)),(0,te.safeRemoveView)(this,this.cohesiveAnalysisConfig),this.cohesiveAnalysisConfig=new ie.default({controlType:"SyntheticRadio",controlOptions:{dataTestItsi:"cohesive-anomaly-detection-status-radio",items:[{label:(0,U.gettext)("Yes"),value:!0},{label:(0,U.gettext)("No"),value:!1}],model:this.model,modelAttribute:"cohesive_anomaly_detection_is_enabled"},dataTestItsi:"cohesive-anomaly-detection-status-control-group",label:(0,U.gettext)("Enable Cohesive AD Algorithm"),labelWidth:this.currPageLabelWidth}),this._cohesiveAdSettingsModel=this.model.get("cohesive_ad"),this._cohesiveAdSettingsModel.fetchMadSettings().done(function(){(0,te.safeRemoveView)(this,this.cohesiveSensitivity),this.cohesiveSensitivity=new ie.default({controlType:"Number",controlOptions:{dataTestItsi:"cohesive-algorithm-sensitivity-number-control",listenForModelChanges:!0,max:this._cohesiveAdSettingsModel.get("sensitivity_max"),min:this._cohesiveAdSettingsModel.get("sensitivity_min")||0,model:this._cohesiveAdSettingsModel,modelAttribute:"sensitivity",placeholder:(0,U.gettext)("required")},dataTestItsi:"cohesive-algorithm-sensitivity-control-group",label:(0,U.gettext)("Algorithm Sensitivity"),labelWidth:this.currPageLabelWidth,tooltip:(0,U.gettext)("Sensitivity to variance in data.")}),(0,te.safeRemoveView)(this,this.cohesiveSensitivitySlider),this.cohesiveSensitivitySlider=new ue.default({dataTestItsi:"cohesive-sensitivity-slider",max:this._cohesiveAdSettingsModel.get("sensitivity_max")||10,min:this._cohesiveAdSettingsModel.get("sensitivity_min")||0,model:this._cohesiveAdSettingsModel,modelAttribute:"sensitivity",step:1}),this.model.get("is_entity_breakdown")&&(this.$(".kpi-anomaly-panel-cohesive-analysis-config",this.$el).append(this.cohesiveSensitivity.render().el),this.cohesiveSensitivity.$el.find('[data-test="controls"]').prepend(this.cohesiveSensitivitySlider.render().el))}.bind(this)),this.$(".kpi-anomaly-panel-analysis-window-config-container",this.$el).append(this.analysisTimeWindow.render().el),this.$(".kpi-anomaly-panel-analysis-window-config-container",this.$el).append(null===(i=this.children)||void 0===i?void 0:i.analyzeButton.render().$el),this.$(".kpi-anomaly-panel-trending-analysis-container",this.$el).prepend(this.trendingAnalysisHeading.render().el),this.$(".kpi-anomaly-panel-trending-analysis-config-result-label",this.$el).text((0,U.gettext)("Algorithm Analysis Result")),this.$(".kpi-anomaly-panel-trending-analysis-config-result-pane-start",this.$el).append(this.children.trendingMessageView.render().$el),this.$(".kpi-anomaly-panel-trending-analysis-config",this.$el).append(this.trendingAnalysisConfig.render().el),this.$(".kpi-anomaly-panel-cohesive-analysis-container",this.$el).prepend(this.cohesiveAnalysisHeading.render().el),this.$(".kpi-anomaly-panel-cohesive-analysis-config-result-label",this.$el).text((0,U.gettext)("Algorithm Analysis Result")),this.$(".kpi-anomaly-panel-cohesive-analysis-config-result-pane-start",this.$el).append(this.children.cohesiveMessageView.render().$el),this.model.get("is_entity_breakdown")?this.$(".kpi-anomaly-panel-cohesive-analysis-config",this.$el).append(this.cohesiveAnalysisConfig.render().el):(this.$(".kpi-anomaly-panel-cohesive-analysis-config",this.$el).append(this.cohesiveAnalysisConfig.render().el),this.cohesiveAnalysisConfig.disable()),this.listenTo(this.model,"change:anomaly_detection_is_enabled change:cohesive_anomaly_detection_is_enabled",this._setKpiAnomalyDetectionAlerting),this},_renderAnalysisBreakdown:function _renderAnalysisBreakdown(i){if(!((0,N.default)(i)||i!==$.MAD_ALGORITHM_TYPES.TRENDING&&i!==$.MAD_ALGORITHM_TYPES.COHESIVE))switch(i){case $.MAD_ALGORITHM_TYPES.TRENDING:this.$(".kpi-anomaly-panel-trending-analysis-preview-container").html(""),this.$(".kpi-anomaly-panel-trending-analysis-preview-container").html(Se),(0,te.safeRemoveView)(this,this._trendingAnalysisBreakdownViewPanel),this._trendingAnalysisBreakdownViewPanel=new oe.default({ContentView:le.default,contentViewOptions:{searchJob:this._trendingAnomalyDetectionLoadjobSearchJob,el:this.$(".kpi-anomaly-trending-search-preview-chart"),percAnomaliesExpected:this._trendingAnomaliesExpected,algorithmType:i,trendingResultsModel:this._trendingResultsModel,trendingAdSettingsModel:this._trendingAdSettingsModel}}),this.$(".kpi-anomaly-panel-trending-analysis-preview-container").html(this._trendingAnalysisBreakdownViewPanel.render().$el);break;case $.MAD_ALGORITHM_TYPES.COHESIVE:this.$(".kpi-anomaly-panel-cohesive-analysis-preview-container").html(""),this.$(".kpi-anomaly-panel-cohesive-analysis-preview-container").html(be),(0,te.safeRemoveView)(this,this._cohesiveAnalysisBreakdownViewPanel),this._cohesiveAnalysisBreakdownViewPanel=new ce.default({ContentView:de.default,contentViewOptions:{el:this.$(".kpi-anomaly-cohesive-search-preview-chart"),percAnomaliesExpected:this._cohesiveAnomaliesExpected,algorithmType:i,earliestTime:this._analysisModel.get("earliestTime"),parentSearchSid:this._cohesiveAnomalyDetectionLoadjobSearchJobSid,cohesiveResultsModel:this._cohesiveResultsModel,cohesiveAdSettingsModel:this._cohesiveAdSettingsModel}}),this.$(".kpi-anomaly-panel-cohesive-analysis-preview-container").html(this._cohesiveAnalysisBreakdownViewPanel.render().$el);break;default:console.log("Unknown AD algorithm!"),this._analysisModel.set({trending:!0}),this._analysisModel.set({cohesive:!0})}},_setKpiAnomalyDetectionAlerting:function _setKpiAnomalyDetectionAlerting(){this.model.get("anomaly_detection_is_enabled")||this.model.get("cohesive_anomaly_detection_is_enabled")?this.model.set({anomaly_detection_alerting_enabled:!0}):this.model.set({anomaly_detection_alerting_enabled:!1})},remove:function remove(){this._disposeAll(),(0,te.safeRemoveView)(this,this.analysisTimeWindow),(0,te.safeRemoveView)(this,this.trendingAnalysisHeading),(0,te.safeRemoveView)(this,this.cohesiveAnalysisHeading),(0,te.safeRemoveView)(this,this.trendingAnalysisConfig),(0,te.safeRemoveView)(this,this.cohesiveAnalysisConfig),(0,te.safeRemoveView)(this,this.children.cohesiveMessageView),(0,te.safeRemoveView)(this,this.children.trendingMessageView),(0,te.safeRemoveView)(this,this.children.analyzeButton),(0,te.safeRemoveView)(this,this._trendingAnalysisBreakdownViewPanel),(0,te.safeRemoveView)(this,this._cohesiveAnalysisBreakdownViewPanel),(0,te.safeRemoveView)(this,this.trendingSensitivitySlider),(0,te.safeRemoveView)(this,this.trendingSensitivity),(0,te.safeRemoveView)(this,this.cohesiveSensitivitySlider),(0,te.safeRemoveView)(this,this.cohesiveSensitivity)}});s.default=ke,i.exports=s.default},3068:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=o(49),y=h(o(15)),_=h(o(42)),S=h(o(118)),T=h(o(53)),x=o(5),R=o(16),P=o(174),L=o(203),N=h(o(1654)),V=h(o(3069));o(3070);var j=(0,v.template)(V.default,null,{variable:"vars"}),W=y.default.View.extend({initialize:function initialize(i){if(!(i=i||{}).searchJob)throw"Must provide searchJob option";if(!i.percAnomaliesExpected&&0!==i.percAnomaliesExpected)throw"Must provide percAnomaliesExpected option";if(this.percAnomaliesExpected=i.percAnomaliesExpected,!i.trendingResultsModel)throw"Must provide trending results option";if(this.trendingResultsModel=i.trendingResultsModel,!i.trendingAdSettingsModel)throw"Trending AD settings model must be provided.";this.trendingAdSettingsModel=i.trendingAdSettingsModel,this.searchJob=i.searchJob,this._renderResultsChart(),y.default.View.prototype.initialize(this,arguments)},_renderResultsSummary:function _renderResultsSummary(){var i=this.trendingResultsModel.get("fractionAnomaliesDetected"),s="0";if(!(0,S.default)(this.percAnomaliesExpected)||!(0,S.default)(i))throw"Passed in percAnomaliesExpected and fractionAnomaliesDetected must be valid numbers.";s=i<.01&&0!==i?(0,R.sprintf)((0,x.gettext)("<1%% (Recommended <%s%%)"),Math.round(100*this.percAnomaliesExpected*100)/100):(0,R.sprintf)((0,x.gettext)("%s%% (Recommended <%s%%)"),Math.round(100*i*100)/100,Math.round(100*this.percAnomaliesExpected*100)/100),this.$(".kpi-anomaly-panel-trending-analysis-description-anomalies-info-value").text(s);var o=(0,R.sprintf)((0,x.gettext)("KPI Value for %s"),this.trendingResultsModel.get("analysisTimeWindow"));this.$(".kpi-anomaly-panel-trending-analysis-description-preview-info").text(o)},_renderResultsChart:function _renderResultsChart(){var i=this.trendingAdSettingsModel.getSensitivityValues(),s=(0,T.default)(i,(function(i){return"max(sensitivity_"+i+') AS "sensitivity_'+i+'"'}));s=s.join(" "),this.analysisBreakdownPostProcessSearchSubscription&&this.analysisBreakdownPostProcessSearchSubscription.unsubscribe(),this.analysisBreakdownPostProcessSearchSubscription=this.searchJob.getResults({search:'timechart bins=1000 avg(input_value) AS "alert_value" '.concat(s),offset:0,count:0}).subscribe({next:s=>{this._timeDataXAxis=[],this._alertValueDataYAxis=[],this._anomalyDataYAxis={},(0,_.default)(i,function(i){this._anomalyDataYAxis["sensitivity_"+i]=[]}.bind(this)),(0,_.default)(s.results,function(i){this._timeDataXAxis.push(new Date(i._time).toLocaleString()),i.alert_value?this._alertValueDataYAxis.push(Math.round(100*parseFloat(i.alert_value))/100):this._alertValueDataYAxis.push(0),(0,_.default)(this._anomalyDataYAxis,function(s,o){i[o]?1===parseInt(i[o])?i.alert_value?this._anomalyDataYAxis[o].push(Math.round(100*parseFloat(i.alert_value))/100):this._anomalyDataYAxis[o].push(0):(0!==parseInt(i[o])&&console.log("Anomaly value is not 0 when it should be!"),this._anomalyDataYAxis[o].push(Math.round(100*parseInt(i[o]))/100)):this._anomalyDataYAxis[o].push(0)}.bind(this))}.bind(this)),requestAnimationFrame(()=>{this._renderHighChart()}),this.listenTo(this.trendingAdSettingsModel,"change:sensitivity",(function(){this._renderHighChart()}))},error:()=>{}})},render:function render(){var i=j({percAnomaliesDetectedString:"",labelString:(0,x.gettext)("Percentage of Data Points with Anomalies:"),analysisTimeWindowString:""},{variable:"vars"});return this.$el.prepend(i),this._renderResultsSummary(),this.listenTo(this.trendingResultsModel,"change",(function(){this._renderResultsSummary()})),this},_renderHighChart:function _renderHighChart(){var i=y.default.Model.extend({}),s=y.default.Collection.extend({model:i}),o="sensitivity_"+parseInt(this.trendingAdSettingsModel.get("sensitivity"),10),h=new s([{name:"KPI Value",data:this._alertValueDataYAxis,color:L.linkColor,lineWidth:1.5,marker:{radius:0}},{name:"Detected Anomaly",data:this._anomalyDataYAxis[o],lineWidth:0,marker:{enabled:!0,fillColor:L.anomalyColor,radius:4}}]);h.length>0&&(this.highChart=new N.default({el:"#kpi-anomaly-trending-search-preview-highchart-view",data:h,time:this._timeDataXAxis}),this.highChart.render())},remove:function remove(){return(0,P.safeRemoveView)(this,this.highChart),this.analysisBreakdownPostProcessSearchSubscription&&this.analysisBreakdownPostProcessSearchSubscription.unsubscribe(),this.searchJob&&this.searchJob.cancel(),y.default.View.prototype.remove.apply(this,arguments)}});s.default=W,i.exports=s.default},3069:function(i,s){i.exports='<div class="kpi-anomaly-panel-trending-analysis-description">\n <div class="kpi-anomaly-panel-trending-analysis-description-anomalies-info">\n <span class="kpi-anomaly-panel-trending-analysis-description-anomalies-info-label" data-test-itsi="kpi-anomaly-panel-trending-analysis-description-anomalies-info-label">\n <%- vars.labelString %>\n </span>\n <span class="kpi-anomaly-panel-trending-analysis-description-anomalies-info-value" data-test-itsi="kpi-anomaly-panel-trending-analysis-description-anomalies-info-value">\n <%- vars.percAnomaliesDetectedString %>\n </span>\n </div>\n <div class="kpi-anomaly-panel-trending-analysis-description-preview-info" data-test-itsi="kpi-anomaly-panel-trending-analysis-description-preview-info">\n <%- vars.analysisTimeWindowString %>\n </div>\n</div>'},3070:function(i,s,o){var h=o(3071);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},3071:function(i,s,o){(s=o(37)(!1)).push([i.i,".kpi-anomaly-panel-trending-analysis-description-anomalies-info {\n\tpadding-bottom: 20px;\n}\n\n.kpi-anomaly-panel-trending-analysis-description-preview-info {\n\tpadding-bottom: 10px;\n}",""]),i.exports=s},3072:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=o(5),y=h(o(415)),_=y.default.extend({tagName:"div",className:"kpi-anomaly-panel-trending-analysis-preview",initialize:function initialize(i){(i=i||{}).dataTestItsi="service-definition-trending-analysis-breakdown-collapsible-panel",i.expanded=!0,i.panelId="trendingAnalysisBreakdown",i.panelTitle=(0,v.gettext)("Analysis Breakdown"),y.default.prototype.initialize.apply(this,arguments)}});s.default=_,i.exports=s.default},3073:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=o(49),y=h(o(15)),_=h(o(42)),S=h(o(88)),T=h(o(118)),x=h(o(670)),R=h(o(96)),P=o(5),L=o(16),N=o(154),V=o(174),j=o(203),W=h(o(1654)),K=h(o(3074));o(3075);var U=(0,v.template)(K.default,null,{variable:"vars"}),Y=y.default.View.extend({initialize:function initialize(i){if(!(i=i||{}).percAnomaliesExpected&&0!==i.percAnomaliesExpected)throw"Must provide percAnomaliesExpected option";if(this.percAnomaliesExpected=i.percAnomaliesExpected,!i.cohesiveResultsModel)throw"Must provide cohesive results option";if(this.cohesiveResultsModel=i.cohesiveResultsModel,!i.parentSearchSid)throw"Must pass parentSearchSid";if(this.parentSearchSid=i.parentSearchSid,this.earliestTime=i.earliestTime,!i.cohesiveAdSettingsModel)throw"Cohesive AD settings model must be provided.";this.cohesiveAdSettingsModel=i.cohesiveAdSettingsModel,this.total_random_entities_to_show=3,this.algorithmType=i.algorithmType,this._dataValueAllZero=(0,x.default)(this.total_random_entities_to_show).map((function(){return!0})),this._entityFillColors=["#00A85D","#FFB400","#705AA0"],this._renderResultsChart(),y.default.View.prototype.initialize(this,arguments)},_renderResultsSummary:function _renderResultsSummary(){this.$(".analyzed").text(this.cohesiveResultsModel.get("entitiesAnalyzed")),this.$(".anomalies").text(this.cohesiveResultsModel.get("entitiesWithAnomalies")),this.$(".anomalies-per-entity").text(this.cohesiveResultsModel.get("averageAnomaliesPerEntity"));var i="0",s=this.cohesiveResultsModel.get("fractionAnomaliesDetected");if(!(0,T.default)(this.percAnomaliesExpected)||!(0,T.default)(s))throw"Passed in percAnomaliesExpected and fractionAnomaliesDetected must be valid numbers.";i=s<.01&&0!==s?(0,L.sprintf)((0,P.gettext)("<1%% (Recommended <%s%%)"),Math.round(100*this.percAnomaliesExpected*100)/100):(0,L.sprintf)((0,P.gettext)("%s%% (Recommended <%s%%)"),Math.round(100*s*100)/100,Math.round(100*this.percAnomaliesExpected*100)/100),this.$(".perc-anomalies").text(i);var o=(0,P.gettext)("Not enough data to generate the preview chart.");0!==this.cohesiveResultsModel.get("entitiesWithAnomalies")&&(o=(0,L.sprintf)((0,P.gettext)("%s Anomalous Entity KPI values for %s"),this.total_random_entities_to_show,this.cohesiveResultsModel.get("analysisTimeWindow"))),this.$(".kpi-anomaly-panel-cohesive-analysis-description-preview-info").text(o)},_renderResultsChart:function _renderResultsChart(){this.anomalyXYSeries={};var i=this.cohesiveAdSettingsModel.getSensitivityValues();(0,_.default)(i,function(i){this.anomalyXYSeries[i]={},this.analysisBreakdownLoadjobSearchJob=R.default.create({id:(0,N.createUniqueSearchId)("cohesive-ad-per-entity-analysis-".concat(i)),earliest_time:this.earliestTime,latest_time:"now",cache:600,status_buckets:0,sample_ratio:null,search:"| loadjob ".concat(this.parentSearchSid," | bin _time bins=1000 ")+"| stats avg(input_value) as value sum(sensitivity_"+i+") as alert by entity_id, _time | eventstats max(alert) as has_alert by entity_id | where has_alert>0 | xyseries _time entity_id alert,value",time_format:"%s.%Q",auto_cancel:90}),this.analysisBreakdownLoadjobSearchSubscription=this.analysisBreakdownLoadjobSearchJob.getResults({offset:0,count:0}).subscribe({next:s=>{var o=s,h={};if(s.results&&(h.rows=s.results.map(i=>Object.values(i))),s.fields&&(h.fields=s.fields.map(i=>i.name)),0===o.resultCount);else if(h.rows.length===o.resultCount){for(var v=h.fields.length-1,y=0,_=!0,S=[[]],T=[[]],x=[],R=[!0,!0,!0];y<this.total_random_entities_to_show&&_;){S[y]=[],T[y]=[],R[y]=!1;for(var P=0;P<o.resultCount;P++){var L=h.rows[P],N=L[y+1+(h.fields.length-1)/2];N||(N=0);var V=parseFloat(L[y+1]);V>0&&(V=N),S[y].push(parseFloat(N)),T[y].push(parseFloat(V)),x.length!==o.resultCount&&x.push(new Date(L[0]).toLocaleString())}0===(v-=2)&&(_=!1),y++}y<this.total_random_entities_to_show&&console.log("Found "+y+"(<"+this.total_random_entities_to_show+") entities with anomalies."),this.anomalyXYSeries[i]={dataValueAllZero:R,alertValues:S,alertAnomalies:T,timeDataXAxis:x}}else this.anomalyXYSeries[i]={dataValueAllZero:[],alertValues:[[]],alertAnomalies:[[]],timeDataXAxis:[]};parseInt(this.cohesiveAdSettingsModel.get("sensitivity"),10)===i&&this._renderHighChart()},error:()=>{this.$(".kpi-anomaly-panel-cohesive-analysis-description-preview-info").text((0,P.gettext)("Not enough data to generate the preview chart."))}})}.bind(this)),this.listenTo(this.cohesiveAdSettingsModel,"change:sensitivity",(function(){this._renderHighChart()}))},render:function render(){var i=U({entitiesAnalyzedLabel:(0,P.gettext)("Entities Analyzed:"),entitiesAnalyzed:"",entitiesWithAnomaliesLabel:(0,P.gettext)("Entities with Detected Anomalies:"),entitiesWithAnomalies:"",averageAnomaliesPerEntityLabel:(0,P.gettext)("Average Anomalies Per Entity:"),averageAnomaliesPerEntity:"",percAnomaliesDetectedString:"",labelString:(0,P.gettext)("Percentage of Data Points with Anomalies:"),analysisTimeWindowString:""},{variable:"vars"});return this.$el.prepend(i),this._renderResultsSummary(),this.listenTo(this.cohesiveResultsModel,"change",(function(){this._renderResultsSummary()})),this},_renderHighChart:function _renderHighChart(){for(var i,s,o=y.default.Model.extend({}),h=new(y.default.Collection.extend({model:o})),v=this.anomalyXYSeries[parseInt(this.cohesiveAdSettingsModel.get("sensitivity"),10)]||{},_=0;_<this.total_random_entities_to_show;_++)if((0,S.default)(v.dataValueAllZero)&&v.dataValueAllZero.length>_&&!v.dataValueAllZero[_]){var T=[];(0,S.default)(v.alertValues)&&v.alertValues.length>_&&(T=v.alertValues[_]),h.add(new o({name:(0,L.sprintf)((0,P.gettext)("Entity %s Value"),_+1),data:T,color:this._entityFillColors[_],lineWidth:1.5,marker:{radius:0}}));var x=[];(0,S.default)(v.alertAnomalies)&&v.alertAnomalies.length>_&&(x=v.alertAnomalies[_]),h.add(new o({name:(0,L.sprintf)((0,P.gettext)("Entity %s Anomaly"),_+1),data:x,lineWidth:0,marker:{enabled:!0,fillColor:j.anomalyColor,radius:4}}))}h.length>0?(this.highChart&&this.highChart.$el.show(),this.highChart=new W.default({el:"#kpi-anomaly-cohesive-search-preview-highchart-view",data:h,time:v.timeDataXAxis}),this.highChart.render()):null===(i=this.highChart)||void 0===i||null===(s=i.$el)||void 0===s||s.hide()},cleanupSearchJob:function cleanupSearchJob(){this.analysisBreakdownLoadjobSearchSubscription&&this.analysisBreakdownLoadjobSearchSubscription.unsubscribe(),this.analysisBreakdownLoadjobSearchJob&&this.analysisBreakdownLoadjobSearchJob.cancel()},remove:function remove(){return this.anomalyXYSeries={},this.cleanupSearchJob(),(0,V.safeRemoveView)(this,this.highChart),y.default.View.prototype.remove.apply(this,arguments)}});s.default=Y,i.exports=s.default},3074:function(i,s){i.exports='<div class="kpi-anomaly-panel-cohesive-analysis-description">\n <div class="kpi-anomaly-panel-trending-analysis-description-anomalies-info">\n <div class="kpi-anomaly-panel-cohesive-analysis-description">\n <span class="kpi-anomaly-panel-cohesive-analysis-description-anomalies-info-label" data-test-itsi="kpi-anomaly-panel-cohesive-analysis-description-anomalies-info-label">\n <%- vars.entitiesAnalyzedLabel %>\n </span>\n <span class="kpi-anomaly-panel-cohesive-analysis-description-anomalies-info-value analyzed" data-test-itsi="kpi-anomaly-panel-cohesive-analysis-description-anomalies-info-value-analyzed">\n <%- vars.entitiesAnalyzed %>\n </span>\n </div>\n <div class="kpi-anomaly-panel-cohesive-analysis-description">\n <span class="kpi-anomaly-panel-cohesive-analysis-description-anomalies-info-label" data-test-itsi="kpi-anomaly-panel-cohesive-analysis-description-anomalies-info-label">\n <%- vars.entitiesWithAnomaliesLabel %>\n </span>\n <span class="kpi-anomaly-panel-cohesive-analysis-description-anomalies-info-value anomalies" data-test-itsi="kpi-anomaly-panel-cohesive-analysis-description-anomalies-info-value-anomalies">\n <%- vars.entitiesWithAnomalies %>\n </span>\n </div>\n <div class="kpi-anomaly-panel-cohesive-analysis-description">\n <span class="kpi-anomaly-panel-cohesive-analysis-description-anomalies-info-label" data-test-itsi="kpi-anomaly-panel-cohesive-analysis-description-anomalies-info-label">\n <%- vars.averageAnomaliesPerEntityLabel %>\n </span>\n <span class="kpi-anomaly-panel-cohesive-analysis-description-anomalies-info-value anomalies-per-entity" data-test-itsi="kpi-anomaly-panel-cohesive-analysis-description-anomalies-info-value-anomalies-per-entity">\n <%- vars.averageAnomaliesPerEntity %>\n </span>\n </div>\n <div>\n <span class="kpi-anomaly-panel-cohesive-analysis-description-anomalies-info-label" data-test-itsi="kpi-anomaly-panel-cohesive-analysis-description-anomalies-info-label">\n <%- vars.labelString %>\n </span>\n <span class="kpi-anomaly-panel-cohesive-analysis-description-anomalies-info-value perc-anomalies" data-test-itsi="kpi-anomaly-panel-cohesive-analysis-description-anomalies-info-value-perc-anomalies">\n <%- vars.percAnomaliesDetectedString %>\n </span>\n </div>\n </div>\n <div class="kpi-anomaly-panel-cohesive-analysis-description-preview-info" data-test-itsi="kpi-anomaly-panel-cohesive-analysis-description-preview-info">\n <%- vars.analysisTimeWindowString %>\n </div>\n</div>'},3075:function(i,s,o){var h=o(3076);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},3076:function(i,s,o){(s=o(37)(!1)).push([i.i,".kpi-anomaly-panel-cohesive-analysis-description-anomalies-info {\n\tpadding-bottom: 20px;\n}\n\n.kpi-anomaly-panel-cohesive-analysis-description-preview-info {\n\tpadding-bottom: 10px;\n}\n\n.kpi-anomaly-panel-cohesive-analysis-description {\n\tpadding-bottom: 10px;\n}",""]),i.exports=s},3077:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=o(5),y=h(o(415)),_=y.default.extend({tagName:"div",className:"kpi-anomaly-panel-cohesive-analysis-preview",initialize:function initialize(i){(i=i||{}).dataTestItsi="service-definition-cohesive-analysis-breakdown-collapsible-panel",i.expanded=!0,i.panelId="cohesiveAnalysisBreakdown",i.panelTitle=(0,v.gettext)("Analysis Breakdown"),y.default.prototype.initialize.apply(this,arguments)}});s.default=_,i.exports=s.default},3078:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(15)),y=h(o(0)),_=h(o(36)),S=o(25),T=h(o(1608)),x=h(o(52)),R=v.default.View.extend({attributes:{"data-test-itsi":"slider-view"},tagName:"div",className:"slider-container",initialize:function initialize(i){if(v.default.View.prototype.initialize.apply(this,arguments),!i)throw"Must provide all required options";if((0,S.isUndefinedOrNull)(i.min))throw"Must provide min option";if((0,S.isUndefinedOrNull)(i.max))throw"Must provide max option";(0,S.isUndefinedOrNull)(i.step)&&(i.step=1),this.options=i,this.sliderRef=null,this.listenTo(this.model,"change:"+this.options.modelAttribute,this.updateSlider)},handleChange:function handleChange(i){this.model.set(this.options.modelAttribute,i)},updateSlider:function updateSlider(){this.sliderRef.setValue(Number(this.model.get(this.options.modelAttribute)))},render:function render(){return this.$el.html('<div class="slider-placeholder"></div>'),_.default.unmountComponentAtNode(this.$el.find(".slider-placeholder").get(0)),_.default.render(y.default.createElement(x.default,null,y.default.createElement(T.default,{dataTestItsi:this.options.dataTestItsi,initialValue:Number(this.model.get(this.options.modelAttribute)),min:this.options.min,max:this.options.max,onChange:this.handleChange.bind(this),ref:i=>this.sliderRef=i,step:this.options.step})),this.$el.find(".slider-placeholder").get(0)),this}});s.default=R,i.exports=s.default},3079:function(i,s){i.exports='<div class="kpi-anomaly-panel-upper-section">\n\t<div class="kpi-anomaly-panel-explanation-container" data-test-itsi="kpi-anomaly-panel-explanation-container"></div>\n\t<div class="kpi-anomaly-panel-analysis-window-config-container"></div>\n\t<div class="kpi-anomaly-panel-analysis-container">\n\t\t<div class="kpi-anomaly-panel-trending-analysis-container">\n\t\t\t<div class="kpi-anomaly-panel-trending-analysis-result">\n\t\t\t\t<div class="kpi-anomaly-panel-trending-analysis-config-result-label" data-test-itsi="kpi-anomaly-panel-trending-analysis-config-result-label"></div>\n\t\t\t\t<div class="kpi-anomaly-panel-trending-analysis-config-result-pane kpi-anomaly-panel-trending-analysis-config-result-pane-start" data-test-itsi="kpi-anomaly-panel-trending-analysis-config-result-pane-start"></div>\n\t\t\t\t<div class="kpi-anomaly-panel-trending-analysis-config-result-pane kpi-anomaly-panel-trending-analysis-config-result-pane-processing" data-test-itsi="kpi-anomaly-panel-trending-analysis-config-result-pane-processing" style="display:none">\n\t\t\t\t\t<div class="kpi-anomaly-panel-analysis-config-result kpi-anomaly-panel-trending-analysis-config-result-processing" data-test-itsi="kpi-anomaly-panel-trending-analysis-config-result-processing"></div>\n\t\t\t\t</div>\n\t\t\t\t <div class="kpi-anomaly-panel-trending-analysis-config-result-pane kpi-anomaly-panel-trending-analysis-config-result-pane-end" data-test-itsi="kpi-anomaly-panel-trending-analysis-config-result-pane-end" style="display:none">\n\t\t\t\t\t<div class="kpi-anomaly-panel-analysis-config-result kpi-anomaly-panel-trending-analysis-config-result-end" data-test-itsi="kpi-anomaly-panel-trending-analysis-config-result-end"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="kpi-anomaly-panel-trending-analysis-config kpi-anomaly-panel-ad-config" data-test-itsi="kpi-anomaly-panel-trending-analysis-config"></div>\n\t\t\t<div class="kpi-anomaly-panel-analysis-preview-container kpi-anomaly-panel-trending-analysis-preview-container" data-test-itsi="kpi-anomaly-panel-trending-analysis-preview-container"></div>\n\t\t</div>\n\t\t<div class="kpi-anomaly-panel-cohesive-analysis-container">\n\t\t\t<div class="kpi-anomaly-panel-cohesive-analysis-result">\n\t\t\t\t<div class="kpi-anomaly-panel-cohesive-analysis-config-result-label" data-test-itsi="kpi-anomaly-panel-cohesive-analysis-config-result-label"></div>\n\t\t\t\t<div class="kpi-anomaly-panel-cohesive-analysis-config-result-pane kpi-anomaly-panel-cohesive-analysis-config-result-pane-start" data-test-itsi="kpi-anomaly-panel-cohesive-analysis-config-result-pane-start"></div>\n\t\t\t\t<div class="kpi-anomaly-panel-cohesive-analysis-config-result-pane kpi-anomaly-panel-cohesive-analysis-config-result-pane-processing" data-test-itsi="kpi-anomaly-panel-cohesive-analysis-config-result-pane-processing" style="display:none">\n\t\t\t\t\t<div class="kpi-anomaly-panel-analysis-config-result kpi-anomaly-panel-cohesive-analysis-config-result-processing" data-test-itsi="kpi-anomaly-panel-cohesive-analysis-config-result-processing"></div>\n\t\t\t\t</div>\n\t\t\t\t <div class="kpi-anomaly-panel-cohesive-analysis-config-result-pane kpi-anomaly-panel-cohesive-analysis-config-result-pane-end" data-test-itsi="kpi-anomaly-panel-cohesive-analysis-config-result-pane-end" style="display:none">\n\t\t\t\t\t<div class="kpi-anomaly-panel-analysis-config-result kpi-anomaly-panel-cohesive-analysis-config-result-end" data-test-itsi="kpi-anomaly-panel-cohesive-analysis-config-result-end"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="kpi-anomaly-panel-cohesive-analysis-config kpi-anomaly-panel-ad-config" data-test-itsi="kpi-anomaly-panel-cohesive-analysis-config"></div>\n\t\t\t<div class="kpi-anomaly-panel-analysis-preview-container kpi-anomaly-panel-cohesive-analysis-preview-container" data-test-itsi="kpi-anomaly-panel-cohesive-analysis-preview-container"></div>\n\t\t</div>\n\t</div>\n</div>\n'},3080:function(i,s){i.exports='<div class="kpi-anomaly-trending-search-preview-chart">\n <div id="kpi-anomaly-trending-search-preview-highchart-view" class="dashboard-element chart" style="width: 100%"></div>\n</div>'},3081:function(i,s){i.exports='<div class="kpi-anomaly-cohesive-search-preview-chart">\n <div id="kpi-anomaly-cohesive-search-preview-highchart-view" class="dashboard-element chart" style="width: 100%"></div>\n</div>'},3082:function(i,s,o){var h=o(3083);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},3083:function(i,s,o){(s=o(37)(!1)).push([i.i,'.kpi-anomaly-panel-upper-section {\n\tbackground-color: #ffffff; /* theme.backgroundColor */\n\tpadding: 15px 20px 30px 20px;\n}\n\n.kpi-anomaly-panel-analysis-window-config-container {\n\tdisplay: inline-block;\n\tvertical-align: top;\n}\n\n.kpi-anomaly-panel-analysis-window-config-container div[data-test="controls"] {\n\tdisplay: block;\n\tmargin-right: 10px;\n}\n\n.kpi-anomaly-panel-analysis-container {\n\tdisplay: flex;\n\twidth: 100%;\n}\n\n.kpi-anomaly-panel-ad-config .slider-container {\n\tpadding-right: 15px;\n\tpadding-left: 8px;\n}\n\n.kpi-anomaly-panel-trending-analysis-container {\n\tmargin-right: 20px;\n}\n.kpi-anomaly-panel-trending-analysis-container,\n.kpi-anomaly-panel-cohesive-analysis-container {\n\twidth: 50%;\n}\n\n/* SWC.control-group still used */\n.kpi-anomaly-panel-trending-analysis-container > .control-group,\n.kpi-anomaly-panel-cohesive-analysis-container > .control-group {\n\tmargin: 12px 0 12px 0;\n}\n\n.kpi-anomaly-panel-trending-analysis-config-result-label,\n.kpi-anomaly-panel-cohesive-analysis-config-result-label {\n\tdisplay: inline-block;\n\tmin-width: 176px; /* Min width to have align with the control group below */\n\tvertical-align: top;\n\tline-height: 40px;\n}\n\n.kpi-anomaly-panel-trending-analysis-config-result-pane,\n.kpi-anomaly-panel-cohesive-analysis-config-result-pane {\n\tdisplay: inline-block;\n}\n\n.kpi-anomaly-panel-config-result-pane-alert {\n\tpadding-right: 0; /*Over-ride alert right padding*/\n}\n\n.kpi-anomaly-panel-analysis-config-result {\n\tdisplay: inline-block;\n\tvertical-align: top;\n\tmax-width: 325px;\n\tmargin-bottom: 12px;\n}\n\n.kpi-anomaly-panel-trending-analysis-config .slider-container,\n.kpi-anomaly-panel-cohesive-analysis-config .slider-container {\n\tflex-grow: 1;\n\tmin-width: 215px;\n}\n.kpi-anomaly-panel-trending-analysis-config-result-processing {\n\tmargin-top: 10px;\n}\n.kpi-anomaly-panel-cohesive-analysis-config-result-processing {\n\tpadding-bottom: 8px;\n\tmargin-bottom: 16px;\n}\n.kpi-anomaly-panel-config-container {\n\tdisplay: block;\n\tvertical-align: top;\n}\n\n/* SWC.control-label still used */\n.kpi-anomaly-panel-config-container .control-label {\n\tvertical-align: top;\n\tpadding-top: 8px;\n}\n\n.kpi-anomaly-panel-explanation-container {\n\tdisplay: inline-block;\n\tmax-width: 100%;\n\tvertical-align: top;\n\tpadding-bottom: 20px;\n}\n\n/* SWC.control-label still used */\n.kpi-anomaly-panel-upper-section .control-label,\n.kpi-anomaly-panel-lower-section .control-group,\n.kpi-anomaly-panel-lower-section .control-label {\n\tdisplay: inline-block;\n}\n\n/* SWC.controls still used */\n.kpi-anomaly-panel-upper-section .controls,\n.kpi-anomaly-panel-lower-section .controls {\n\tdisplay: inline-block;\n\tmargin-left: 10px;\n}\n\n.kpi-anomaly-panel-upper-section .kpi-anomaly-show-training-preview,\n.kpi-anomaly-panel-upper-section .kpi-anomaly-show-tuning-window {\n\tmargin-top: 10px;\n}\n\n.kpi-anomaly-panel-lower-section {\n\tpadding-top: 15px;\n\tpadding-bottom: 10px;\n\tpadding-left: 20px;\n\tbackground-color: #FFFFFF; /* theme.backgroundColor */\n}\n\n.show-training-data-link {\n\tdisplay: inline-block;\n\tmargin-left: 20px;\n}\n\n.kpi-anomaly-search-preview-controls-container {\n\tmargin-bottom: 10px;\n}\n\n.kpi-anomaly-panel-lower-section .kpi-anomaly-sensitivity-text-input {\n\tdisplay: inline-block;\n\twidth: 36px !important;\n\tpadding-right: 0 !important;\n}\n\n.kpi-anomaly-panel-lower-section .kpi-anomaly-sensitivity-slider-container {\n\tmargin-bottom: 10px;\n}\n\n/* SWC.checkbox still used */\n.kpi-anomaly-panel-lower-section .control label.checkbox {\n\tpadding-bottom: 0;\n}\n\n.kpi-ad-tooltip-description {\n\ttext-align: left;\n\tpadding-left: 5px;\n}\n\n.tooltip-inner {\n\tmax-width: 290px;\n\twidth: auto;\n\tfont-size: 12px;\n}',""]),i.exports=s},3084:function(i,s,o){var h=o(3085);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},3085:function(i,s,o){(s=o(37)(!1)).push([i.i,".kpi-anomaly-panel {\n\tmargin-top: 2px;\n}",""]),i.exports=s},3086:function(i,s,o){var h=o(3087);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},3087:function(i,s,o){(s=o(37)(!1)).push([i.i,".kpi-main-content {\n\tmargin: 15px 0 0 15px;\n\tmax-width: 1400px;\n}\n\n.kpi-main-content .collapsible-panel-layout {\n\tmargin: 5px 25px 60px 0;\n}\n",""]),i.exports=s},3088:function(i,s,o){var h=o(3089);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},3089:function(i,s,o){(s=o(37)(!1)).push([i.i,".sidebar-layout-header {\n\tdisplay: none;\n}\n.kpi-no-selection {\n\tmargin-left: 10px;\n\tpadding-top: 3px;\n}",""]),i.exports=s},3090:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=o(49),y=h(o(0)),_=h(o(36)),S=h(o(56)),T=h(o(148)),x=o(5),R=o(16),P=o(68),L=o(76),N=o(200),V=h(o(52)),j=h(o(603)),W=h(o(888)),K=h(o(689)),U=h(o(1642)),Y=h(o(3091)),$=h(o(1643)),X=h(o(3095));o(3096);var Z=(0,v.template)(X.default,null,{variable:"vars"}),ee=function renderControlGroup(i,s,o,h,v){i.length>0&&(_.default.unmountComponentAtNode(i.get(0)),_.default.render(y.default.createElement(V.default,null,y.default.createElement(S.default,{"data-test-itsi":s,label:o,labelWidth:P.LABEL_WIDTHS.Massive},y.default.createElement(T.default,{"data-test-itsi":h},v))),i.get(0)))},te=$.default.extend({_checkIfBackfillIsNeeded:function _checkIfBackfillIsNeeded(){this._checkBackfillProgress()},_renderBackfillControls:function _renderBackfillControls(i,s){var o,h=this.kpiModel.get("backfill_earliest_time");o=i?K.default.renderBackfillStatus(s,h):(0,R.sprintf)((0,x.gettext)("Backfill has been configured for %(timeValue)s."),{timeValue:h}),ee(this.backfillView.summaryView.$el,"backfill-field-read-only-control-group",(0,x.gettext)("Backfill"),"backfill-read-only-value",o)},_checkBackfillProgress:function _checkBackfillProgress(){this.kpiModel._cachedBackfillProgressStatus&&void 0!==this.kpiModel._cachedBackfillProgressStatus.progress&&void 0!==this.kpiModel._cachedBackfillProgressStatus.status?this._renderBackfillControls(this.kpiModel._cachedBackfillProgressStatus.progress,this.kpiModel._cachedBackfillProgressStatus.status):K.default.getBackfillDataForKpi(this.kpiModel.get("_key")).done((i,s)=>{this._renderBackfillControls(i,s)})}}),ie=U.default.extend({initialize:function initialize(i){U.default.prototype.initialize.apply(this,arguments),this.hideAnomalyDetectionPanel=i.hideAnomalyDetectionPanel,this.isBaseServiceTemplate=this.serviceModel.get("object_type")===N.OBJECT_TYPE,this.kpiThresholdingContentReadOnlyView=new Y.default({appsData:i.appsData,service:this.serviceModel,hideRecommendedThresholding:i.hideRecommendedThresholding,linkedServices:this.linkedServices,kpiModel:this.kpiModel,serviceTemplate:i.serviceTemplate,featureFlags:i.featureFlags,permissions:i.permissions,thresholdTemplateCollection:i.thresholdTemplateCollection,userData:i.userData}),this.kpiSearchPanelContentReadOnlyView=new te({serviceModel:this.serviceModel,kpiModel:this.kpiModel,isReadOnly:!0}).render(),this.childViews.lockIcon=new j.default({dataTestItsi:"search-and-calculate-linked-to-st-icon",style:{fontSize:15,marginLeft:8,verticalAlign:"baseline"},type:"lock"})},setupPanelViews:function setupPanelViews(){},setupHeader:function setupHeader(){this.childViews.kpiTitleControl=new W.default({dataTestItsi:"kpi-title-read-only-text-control",model:this.kpiModel,modelAttribute:"title",isReadOnly:!0,placeholder:(0,x.gettext)("KPI title")}),this.childViews.kpiDescriptionControl=new W.default({dataTestItsi:"kpi-description-read-only-text-control",model:this.kpiModel,modelAttribute:"description",isReadOnly:!0,placeholder:(0,x.gettext)("KPI description")})},setupServiceDefinitionHeader:function setupServiceDefinitionHeader(){this.childViews.kpiTitleControl=new W.default({dataTestItsi:"kpi-title-read-only-text-control",model:this.kpiModel,modelAttribute:"title",isReadOnly:!0,placeholder:(0,x.gettext)("KPI title")}),this.childViews.kpiDescriptionControl=new W.default({dataTestItsi:"kpi-description-read-only-text-control",model:this.kpiModel,modelAttribute:"description",isReadOnly:!0,placeholder:(0,x.gettext)("KPI description")})},render:function render(){U.default.prototype.render.apply(this,arguments),this.$el.append(Z({gettext:x.gettext,isLinkedToServiceTemplate:!!this.serviceModel.get("base_service_template_id"),hideAnomalyDetectionPanel:this.hideAnomalyDetectionPanel,isBaseServiceTemplate:this.isBaseServiceTemplate},{variable:"vars"})),this.serviceModel.get("base_service_template_id")&&this.$el.find("h3.kpi-info-container-header").append(this.childViews.lockIcon.render().$el);var i=this.kpiSearchPanelContentReadOnlyView.sourceView.summaryView.$el,s=(0,v.findWhere)(L.KPI_SOURCE_TYPES,{value:this.kpiModel.get("search_type")});return i.prepend('<div class="kpi-source-control-group-container"></div>'),ee(i.find(".kpi-source-control-group-container"),"kpi-source-control-group",(0,x.gettext)("KPI Source"),"kpi-source-value",s?s.label:""),this.$(".kpi-search-info-container").append(i),this.$(".kpi-entity-info-container").append(this.kpiSearchPanelContentReadOnlyView.entityView.summaryView.$el),"not-filtering-entities-value"===this.$(".kpi-entity-info-container .input-label").attr("data-test-itsi")&&this.$(".kpi-entity-info-container .input-label").css({"margin-left":"-80px"}),this.$(".kpi-calculation-info-container").append(this.kpiSearchPanelContentReadOnlyView.calculationView.summaryView.$el),this.$(".kpi-units-info-container").append(this.kpiSearchPanelContentReadOnlyView.unitView.summaryView.$el),this.isBaseServiceTemplate||this.$(".kpi-backfill-info-container").append(this.kpiSearchPanelContentReadOnlyView.backfillView.summaryView.$el),this.$(".kpi-thresholding-info").append(this.kpiThresholdingContentReadOnlyView.render().$el),this.hideAnomalyDetectionPanel||this.renderAnomalyDetection(),this},renderAnomalyDetection:function renderAnomalyDetection(){this.$(".kpi-anomaly-detection-info .form-horizontal").append('<div class="anomaly-detection-container"></div><div class="trending-algorithm-container"></div><div class="cohesion-anomaly-container"></div><div class="cohesion-algorithm-container"></div>'),ee(this.$(".anomaly-detection-container"),"anomaly-detection-control-group",(0,x.gettext)("Enable Trending Anomaly Detection"),"anomaly-detection-value",this.kpiModel.get("anomaly_detection_is_enabled")?(0,x.gettext)("Yes"):(0,x.gettext)("No")),ee(this.$(".trending-algorithm-container"),"algorithm-sensitivity-control-group",(0,x.gettext)("Trending Algorithm Sensitivity"),"algorithm-sensitivity-value",this.kpiModel.get("trending_ad").get("sensitivity")),ee(this.$(".cohesion-anomaly-container"),"cohesion-anomaly-control-group",(0,x.gettext)("Enable Entity Cohesion Anomaly Detection"),"cohesion-anomaly-value",this.kpiModel.get("cohesive_anomaly_detection_is_enabled")?(0,x.gettext)("Yes"):(0,x.gettext)("No")),ee(this.$(".cohesion-algorithm-container"),"cohesion-anomaly-sensitivity-control-group",(0,x.gettext)("Entity Cohesion Algorithm Sensitivity"),"cohesion-anomaly-sensitivity-value",this.kpiModel.get("cohesive_ad").get("sensitivity"))}});s.default=ie,i.exports=s.default},3091:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=o(49),y=h(o(28)),_=h(o(0)),S=h(o(36)),T=o(5),x=o(16),R=o(77),P=o(135),L=o(137),N=h(o(90)),V=h(o(52)),j=h(o(1651)),W=h(o(1652)),K=h(o(2052)),U=h(o(2938)),Y=h(o(1634)),$=h(o(1647)),X=h(o(3092));o(1653),o(3093);var Z=$.default.extend({KpiSingleThresholdingView:K.default,KpiTimeVariantThresholdingView:U.default,compiledTemplate:(0,v.template)(X.default,null,{variable:"vars"}),initialize:function initialize(i){$.default.prototype.initialize.call(this,i);var s,o=this.kpiModel.get("kpi_threshold_template_id"),h=this.kpiModel.get("is_recommended_time_policies");if(s=h?(0,T.gettext)("Using Splunk recommended thresholds"):o===P.KPI_THRESHOLD_TEMPLATE_TYPES.CUSTOM?(0,T.gettext)("Using custom thresholds"):(0,T.gettext)("Using threshold template"),this.childViews={},this.childViews.useThresholdingTemplateControl=new N.default({controlType:"Label",controlOptions:{dataTestItsi:"use-thresholding-template-label",defaultValue:s},dataTestItsi:"kpi-threshold-template-control-group",label:(0,T.gettext)("Thresholding Option"),labelWidth:this.currPageLabelWidth}),h){var y=this.kpiModel.get("recommendation_training_window"),_=L.ANALYSIS_WINDOW_OPTIONS.filter(i=>i.value===y),S=_.length?_[0].label:"",V=this.kpiModel.get("recommendation_start_date");S=S&&V?(0,x.sprintf)((0,T.gettext)("%s starting on %s"),S,(0,R.convertEpochToDateString)(V)):S,this.childViews.recommendationAnalysisWindow=new N.default({controlType:"Label",controlOptions:{dataTestItsi:"recommendation-analysis-window-label",defaultValue:S},dataTestItsi:"kpi-recommendation-analysis-window-control-group",label:(0,T.gettext)("Recommendation Analysis Window"),labelWidth:this.currPageLabelWidth});var j=this.kpiModel.get("threshold_direction"),W=L.THRESHOLD_CONFIGURATION_OPTIONS.filter(i=>i.value===j);this.childViews.recommendationThresholdDirection=new N.default({controlType:"Label",controlOptions:{dataTestItsi:"recommendation-threshold-direction-label",defaultValue:W.length?W[0].label:""},dataTestItsi:"kpi-recommendation-threshold-direction-control-group",label:(0,T.gettext)("Recommendation Threshold Direction"),labelWidth:this.currPageLabelWidth})}this.childViews.enableTimePoliciesControl=new N.default({controlType:"Label",controlOptions:{dataTestItsi:"enable-time-policies-label",defaultValue:this.kpiModel.get("time_variate_thresholds")?(0,T.gettext)("Yes"):(0,T.gettext)("No")},dataTestItsi:"kpi-time-policies-template-control-group",label:(0,T.gettext)("Enable Time Policies"),labelWidth:this.currPageLabelWidth}),this.childViews.enableAdaptiveThresholdingControl=new N.default({controlType:"Label",controlOptions:{dataTestItsi:"enable-adaptive-thresholding-label",defaultValue:this._configSettingsModel.get("adaptive_thresholds_is_enabled")?(0,T.gettext)("Yes"):(0,T.gettext)("No")},dataTestItsi:"kpi-enable-adaptive-thresholding-control-group",label:(0,T.gettext)("Enable Adaptive Thresholding"),labelWidth:this.currPageLabelWidth});var K=(0,v.findWhere)(this.kpiTimePresetsList,{value:this._configSettingsModel.get("adaptive_thresholding_training_window")}).label||"";this.childViews.trainingWindowControl=new N.default({controlType:"Label",controlOptions:{dataTestItsi:"kpi-training-window-label",defaultValue:K},dataTestItsi:"kpi-training-window-control-group",label:(0,T.gettext)("Training Window"),labelWidth:this.currPageLabelWidth})},_createKpiAlertingSwitchControl:function _createKpiAlertingSwitchControl(){var i=this.kpiModel.get("aggregate_thresholds_alert_enabled"),s=(0,y.default)("<div></div>").css({display:"inline-block","vertical-align":"top"});return S.default.unmountComponentAtNode(s.get(0)),S.default.render(_.default.createElement(V.default,null,_.default.createElement(j.default,{enabled:i,onChange:this._onEnableDisableAlerting,size:"medium",isReadOnly:!0,isEntityBreakDown:this.kpiModel.get("is_entity_breakdown")})),s.get(0)),i&&(this.$(".kpi-alerting-options").show(),this.$(".kpi-alerting-options").html(this._createKpiAlertingOptions())),s},_createKpiAlertingOptions:function _createKpiAlertingOptions(){var i=(0,y.default)('<div style="margin-left: '.concat(this.currPageLabelWidth,'px"></div>'));S.default.unmountComponentAtNode(i.get(0));var s=this.kpiModel.get("aggregate_thresholds_custom_alert_rules"),o=2;return s&&this.kpiModel.get("aggregate_thresholds_custom_alert_enabled")&&0!==s.length||(o=1),S.default.render(_.default.createElement(V.default,null,_.default.createElement(W.default,{selectedAdvancedOption:o,getCurrentRules:this.getCurrentRules,getAvailableSeverityValues:this.getAvailableSeveritiesForDropdown,handleKpiAlertingOptionChange:this.handleKpiAlertingOptionChange,addOrUpdateRuleToKpiModel:this.addOrUpdateRuleToKpiModel,removeRuleFromKpiModel:this.removeRuleFromKpiModel,removeAndAddRuleToKpiModel:this.removeAndAddRuleToKpiModel,isReadOnly:!0})),i.get(0)),i},_renderOutlierDetectionControls:function _renderOutlierDetectionControls(){var i=this.kpiModel.get("aggregate_outlier_detection_enabled"),s=this.kpiModel.get("outlier_detection_algo"),o=this.kpiModel.get("outlier_detection_sensitivity"),h=this.$(".thresholding-enable-outlier-detection").css({display:"inline-block","vertical-align":"top"});return S.default.unmountComponentAtNode(h.get(0)),S.default.render(_.default.createElement(V.default,null,_.default.createElement(Y.default,{enabled:i,algo:s,sensitivity:o,onChange:this._onEnableDisableOutlierDetection,isReadOnly:!0,size:"medium",isEntityBreakDown:this.kpiModel.get("is_entity_breakdown")})),h.get(0)),h},_renderKpiThresholdingContentView:function _renderKpiThresholdingContentView(){return $.default.prototype._renderKpiThresholdingContentView.apply(this,arguments),this.$(".kpi-thresholding-panel-info-container").append(this.childViews.useThresholdingTemplateControl.render().$el),this.childViews.recommendationAnalysisWindow&&this.$(".kpi-thresholding-panel-info-container").append(this.childViews.recommendationAnalysisWindow.render().$el),this.childViews.recommendationThresholdDirection&&this.$(".kpi-thresholding-panel-info-container").append(this.childViews.recommendationThresholdDirection.render().$el),this.$(".kpi-thresholding-panel-info-container").append(this.childViews.enableTimePoliciesControl.render().$el),this.$(".kpi-thresholding-panel-info-container").append(this.childViews.enableAdaptiveThresholdingControl.render().$el),this.$(".kpi-thresholding-panel-info-container").append(this.childViews.trainingWindowControl.render().$el),this}});s.default=Z,i.exports=s.default},3092:function(i,s){i.exports='<div class="kpi-thresholding-panel-upper-section read-only">\n\t<div class="kpi-thresholding-panel-custom-threshold-window-content">\n\t\t<div class="kpi-thresholding-panel-custom-threshold-window-status"></div>\n\t\t<div class="kpi-thresholding-panel-custom-threshold-window-link"></div>\n\t</div>\n</div>\n<div class="kpi-thresholding-panel-info-container form-horizontal"></div>\n<div class="kpi-thresholding-panel-lower-section read-only">\n\t<% if (vars.isServiceTemplate) { %>\n\t\t<div class="thresholding-configure-preview-controls">\n\t\t\t<div class="thresholding-configure-error-state" style="display: none;"></div>\n\t\t\t<div class="thresholding-configure-preview-service"></div>\n\t\t</div>\n\t<% } %>\n\t<div class="thresholding-configure-aggregate-entity-toggle"></div>\n\t<div class="thresholding-configure-settings">\n\t\t<div class="thresholding-enable-outlier-detection"></div>\n\t\t<div class="kpi-alerting-enable-disable-control"></div>\n\t\t<div class="kpi-alerting-options"></div>\n\t\t<div class="kpi-alerting-custom-rules" style="display:none;"></div>\n\t</div>\n\t<div class="thresholding-default-container"></div>\n\t<div class="thresholding-time-policy-container"></div>\n</div>\n'},3093:function(i,s,o){var h=o(3094);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},3094:function(i,s,o){(s=o(37)(!1)).push([i.i,".read-only .kpi-thresholding-panel-custom-threshold-window-content .kpi-thresholding-panel-custom-threshold-window-status {\n\tmargin-bottom: 10px;\n}\n.kpi-thresholding-panel-lower-section.read-only {\n\tpadding: 0 0 20px 0;\n}\n.read-only .thresholding-configure-settings > .kpi-alerting-options {\n\tpadding: 0 0 0 20px;\n}",""]),i.exports=s},3095:function(i,s){i.exports='<div class="kpi-info-container">\n\t<div class="kpi-search-calculate-info form-horizontal">\n\t\t<h3 class="kpi-info-container-header" data-test-itsi="kpi-read-only-info-container-header">\n\t\t\t<%- vars.gettext(\'Search And Calculate\') %>\n\t\t</h3>\n\t\t<div class="kpi-search-info-container"></div>\n\t\t<div class="kpi-entity-info-container"></div>\n\t\t<div class="kpi-calculation-info-container"></div>\n\t\t<div class="kpi-units-info-container"></div>\n\t\t<% if (!vars.isBaseServiceTemplate) { %>\n\t\t\t<div class="kpi-backfill-info-container"></div>\n\t\t<% } %>\n\t</div>\n\t<div class="kpi-thresholding-info">\n\t\t<h3 class="kpi-info-container-header" data-test-itsi="kpi-read-only-info-thresholding-header"><%- vars.gettext(\'Thresholding\') %></h3>\n\t</div>\n\t<% if (!vars.hideAnomalyDetectionPanel) { %>\n\t\t<div class="kpi-anomaly-detection-info">\n\t\t\t<h3 class="kpi-info-container-header" data-test-itsi="kpi-read-only-info-anomaly-detection-header"><%- vars.gettext(\'Anomaly Detection\') %></h3>\n\t\t\t<div class="kpi-anomaly-detection-explanation" data-test-itsi="kpi-anomaly-detection-explanation">\n\t\t\t\t<%- vars.gettext(\'ITSI Anomaly Detection learns the normal patterns of KPIs continuously in real-time, triggering a notable event when a KPI departs from its expected behavior. Certain types of data are not suitable for use with anomaly detection because they produce too many false positives. We recommend that you analyze the KPI data first to check its compatibility with ITSI\\\'s anomaly detection algorithms.\') %>\n\t\t\t</div>\n\t\t\t<div class="form-horizontal"></div>\n\t\t</div>\n\t<% } %>\n</div>\n'},3096:function(i,s,o){var h=o(3097);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},3097:function(i,s,o){(s=o(37)(!1)).push([i.i,".kpi-info-container {\n\tpadding: 15px;\n\tpadding-top: 5px;\n}\n\n.kpi-info-container .kpi-search-calculate-info {\n\twidth: 800px;\n}\n\n.kpi-info-container .kpi-info-container-subheader {\n\tpadding-left: 15px;\n}\n\n.kpi-info-container .kpi-thresholding-info .time-variant-thresholding-view {\n\tmargin-left: 0;\n}\n\n.kpi-anomaly-detection-info .form-horizontal {\n\tmargin-top: 20px;\n}\n\n/* SWC.control-label still used */\n.kpi-anomaly-detection-info .form-horizontal .control-label {\n\twidth: 230px;\n}\n\n/* SWC.controls still used */\n.kpi-anomaly-detection-info .form-horizontal .controls {\n\tmargin-left: 250px;\n}\n\n.kpi-search-info-container .summary-view .control-group,\n.kpi-entity-info-container .summary-view .control-group,\n.kpi-calculation-info-container .summary-view .control-group,\n.kpi-units-info-container .summary-view .control-group,\n.kpi-backfill-info-container .summary-view .control-group {\n\tmargin-left: 80px;\n}\n",""]),i.exports=s},3098:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=o(49),y=o(5),_=h(o(1301)),S=h(o(3099)),T=h(o(3103));o(3104);var x=_.default.extend({compiledTemplate:(0,v.template)(T.default,null,{variable:"vars"}),entityRuleGroupJoin:'<div class="entity-rule-group-or-join" data-test-itsi="rule-group-or-join">'+(0,y.gettext)("OR")+"</div>",_addRuleGroupImpl:function _addRuleGroupImpl(i){var s=new S.default({rulesGroupModel:i,ruleFieldsBlockList:this._ruleFieldsBlockList});this.ruleGroupViews.push(s),this.$(".rules-view-container").append(s.render().$el)}});s.default=x,i.exports=s.default},3099:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=o(5),y=h(o(1616)),_=h(o(3100)),S=y.default.extend({events:{},compiledGroupMarkup:'<div class="rules-outer-container"><div class="rules-container" data-test-itsi="rules-container-read-only"></div></div>',entityRuleItemJoin:'<div class="entity-rule-and-join" data-test-itsi="entity-rule-and-join">'+(0,v.gettext)("AND")+"</div>",_addRuleImpl:function _addRuleImpl(i){var s=new _.default({rulesItemModel:i,ruleFieldsBlockList:this._ruleFieldsBlockList});this.collection.add(s.rulesItemModel),this.ruleItems.push(s),this.$(".rules-container").append(s.render().$el)},addRuleLink:function addRuleLink(){}});s.default=S,i.exports=s.default},3100:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(15)),y=h(o(73)),_=h(o(45)),S=h(o(118)),T=o(5),x=h(o(888)),R=h(o(1617));o(3101);var P=R.default.extend({blankPlaceholder:(0,T.gettext)("N/A"),events:{},inputDefaults:{isReadOnly:!0,clickToEdit:!1,placeholder:(0,T.gettext)("N/A")},setupInputControlsAndHandlers:function setupInputControlsAndHandlers(){this._deleteEmptyValueToInvokePlaceholder(),this._fieldTypeSelectControl=new x.default((0,y.default)({},this.inputDefaults,{dataTestItsi:"field-type-read-only-text-control",modelAttribute:"field_type",model:this.rulesItemModel})),this._tempRulesItemModel=this.rulesItemModel.clone(),this._tempRulesItemModel.set("field",'"'+this._tempRulesItemModel.get("field")+'"'),this._fieldSelectControl=new x.default((0,y.default)({},this.inputDefaults,{dataTestItsi:"field-select-read-only-text-control",modelAttribute:"field",model:this.rulesItemModel}));var i=this.rulesItemModel.get("rule_type");switch(i){case"matches":this.rulesItemModel.set("readable_rule_type",(0,T.gettext)("matches"));break;case"not":this.rulesItemModel.set("readable_rule_type",(0,T.gettext)("does not match"));break;case"matchesblank":this.rulesItemModel.set("readable_rule_type",(0,T.gettext)("matches a value to be defined in the service"));break;case"notmatchesblank":this.rulesItemModel.set("readable_rule_type",(0,T.gettext)("does not match a value to be defined in the service"));break;default:this.rulesItemModel.set("readable_rule_type",i)}this._staticOrRulesSelector=new x.default((0,y.default)({},this.inputDefaults,{dataTestItsi:"static-or-rules-read-only-text-control",modelAttribute:"readable_rule_type",model:this.rulesItemModel}));var s=this.rulesItemModel.get("value");s||(0,S.default)(s)||"matchesblank"===i||"notmatchesblank"===i||this.rulesItemModel.set("value","<empty>",{silent:!0}),this._staticRulesControl=new x.default((0,y.default)({},this.inputDefaults,{dataTestItsi:"static-rules-read-only-text-control",modelAttribute:"value",model:this.rulesItemModel})),this._staticRulesControl.setUrl=function(i){return i},this._fieldSelectControl.setAutoCompleteFields=function(i){return i},v.default.View.prototype.initialize.apply(this,arguments)},renderFieldsMultiSelect:function renderFieldsMultiSelect(){},renderValuesMultiSelect:function renderValuesMultiSelect(){},_deleteEmptyValueToInvokePlaceholder:function _deleteEmptyValueToInvokePlaceholder(){(0,_.default)(this.rulesItemModel.get("value"))&&delete this.rulesItemModel.attributes.value},render:function render(){this.$el.append(this._fieldTypeSelectControl.render().$el),this.$el.append('<div class="fields-multi-select-placeholder" style="display:none"></div>');var i=this._fieldSelectControl.render().$el;this.$el.append(i),i.find("label").addClass("entity-rule-item-value"),this.$el.append(this._staticOrRulesSelector.render().$el),this.$el.append('<div class="values-multi-select-placeholder" style="display:none"></div>');var s=this._staticRulesControl.render().$el;return this.$el.append(s),s.find("label").addClass("entity-rule-item-value"),this._updateToFieldType(this.rulesItemModel.get("field_type")),this}});s.default=P,i.exports=s.default},3101:function(i,s,o){var h=o(3102);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},3102:function(i,s,o){(s=o(37)(!1)).push([i.i,".entity-rule-item-value {\n\tfont-weight: bold;\n}\n.entity-rule-and-join,\n.entity-rule-group-or-join {\n\tmargin-left: 5px;\n}\n.entity-rule-group-or-join {\n\tmargin-bottom: 13px;\n}\n.rules-container .inline-text-control {\n\tmargin-right: 5px;\n}",""]),i.exports=s},3103:function(i,s){i.exports='<div class="rules-view-outer-container" data-test-itsi="rules-view-outer-container-read-only">\n <div class="rules-view-container"></div>\n</div>\n'},3104:function(i,s,o){var h=o(3105);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},3105:function(i,s,o){(s=o(37)(!1)).push([i.i,".specify-entity-rules-main-view {\n\tpadding-bottom: 0px;\n}",""]),i.exports=s},4298:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(2992)),y=h(o(4299)),_=h(o(4300)),S=h(o(4301)),T=h(o(4303)),x=h(o(4304)),R=h(o(2994));o(8310);var P=v.default.extend({tabLayoutDataTestItsi:"service-definition-tab-layout",EntitiesTabView:y.default,KpiTabView:S.default,DependencyTabView:T.default,ServiceSettingsTabView:_.default,PredictiveAnalyticsTabView:x.default,initialize:function initialize(i){this.appsData=i.appsData,this.featureFlags=i.featureFlags,this.globalTeamData=i.globalTeamData,this.permissions=i.permissions,this.thresholdTemplateCollection=i.thresholdTemplateCollection,this.userData=i.userData,this.serviceTemplate=i.serviceTemplate,this.sdDispatcher=i.sdDispatcher,this.servicesCollectionData=i.servicesCollectionData,this.serviceKpiBackfillMapping=i.serviceKpiBackfillMapping,this.severityLabels=i.severityLabels,this.tabToShow=i.tabToShow,this.kpiToShow=i.kpiToShow,v.default.prototype.initialize.apply(this,arguments),this.renderTabs(),this.childViews.tabViews.tabs=[this.infoTab,this.kpiTab,this.dependencyTab,this.settingsTab,this.predictiveAnalyticsTab]},render:function render(){return this.$el.html('<div class="service-info-header"></div><div class="service-tab-container"></div>'),this.$(".service-tab-container").append(this.childViews.tabViews.render().$el),this},renderTabs:function renderTabs(){this.infoTab=new this.EntitiesTabView({service:this.modelClone,ContentView:R.default,serviceTemplate:this.serviceTemplate}),this.kpiTab=new this.KpiTabView({featureFlags:this.featureFlags,appsData:this.appsData,kpiToShow:this.kpiToShow,service:this.modelClone,serviceTemplate:this.serviceTemplate,sdDispatcher:this.sdDispatcher,serviceKpiBackfillMapping:this.serviceKpiBackfillMapping,severityLabels:this.severityLabels,permissions:this.permissions,thresholdTemplateCollection:this.thresholdTemplateCollection,userData:this.userData}),this.dependencyTab=new this.DependencyTabView({globalTeamData:this.globalTeamData,servicesCollectionData:this.servicesCollectionData,service:this.modelClone}),this.settingsTab=new _.default({service:this.modelClone,servicesCollectionData:this.servicesCollectionData,serviceTemplate:this.serviceTemplate,sdDispatcher:this.sdDispatcher}),this.predictiveAnalyticsTab=new x.default({service:this.modelClone,sdDispatcher:this.sdDispatcher})},refreshModel:function refreshModel(){this.infoTab.refreshModel(),this.kpiTab.refreshModel(),this.dependencyTab.refreshModel(),this.settingsTab.refreshModel(),this.predictiveAnalyticsTab.refreshModel()}});s.default=P,i.exports=s.default},4299:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=o(76),y=h(o(2993)),_=h(o(2994)),S=y.default.extend({dataTestItsi:"service-definition-entities-tab",initialize:function initialize(i){if(!(i=i||{}).service)throw"Must provide service";i.tabId=v.SERVICE_DEFINITION_TABS.INFO,i.contentViewOptions={service:i.service,serviceTemplate:i.serviceTemplate},i.ContentView||(i.ContentView=_.default),y.default.prototype.initialize.apply(this,arguments)}});s.default=S,i.exports=s.default},4300:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(2997)),y=h(o(8282)),_=v.default.extend({dataTestItsi:"service-definition-settings-tab",initialize:function initialize(i){if(!(i=i||{}).service)throw"Must provide service";i.contentViewOptions={service:i.service,isReadOnly:i.readOnly,servicesCollectionData:i.servicesCollectionData,serviceTemplate:i.serviceTemplate,sdDispatcher:i.sdDispatcher},i.ContentView=y.default,v.default.prototype.initialize.call(this,i)}});s.default=_,i.exports=s.default},4301:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(3013)),y=h(o(4302)),_=v.default.extend({dataTestItsi:"service-definition-kpis-tab",initialize:function initialize(i){if(!(i=i||{}).service)throw"Must provide service";this.featureFlags=i.featureFlags,this.appsData=i.appsData,this.permissions=i.permissions,this.thresholdTemplateCollection=i.thresholdTemplateCollection,this.userData=i.userData,this.readOnly=i.readOnly,this.service=i.service,this.serviceTemplate=i.serviceTemplate,this.sdDispatcher=i.sdDispatcher,this.serviceKpiBackfillMapping=i.serviceKpiBackfillMapping,this.severityLabels=i.severityLabels,this.kpiToShow=i.kpiToShow,i.ContentView=i.ContentView||y.default,i.contentViewOptions={featureFlags:this.featureFlags,appsData:this.appsData,kpiToShow:this.kpiToShow,service:this.service,readOnly:this.readOnly,serviceTemplate:this.serviceTemplate,sdDispatcher:this.sdDispatcher,serviceKpiBackfillMapping:this.serviceKpiBackfillMapping,severityLabels:this.severityLabels,permissions:this.permissions,thresholdTemplateCollection:this.thresholdTemplateCollection,userData:this.userData},v.default.prototype.initialize.apply(this,arguments)}});s.default=_,i.exports=s.default},4302:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(3014)),y=v.default.extend({initialize:function initialize(i){if(!(i=i||{}).service)throw"Must provide service";this.serviceObj=i.service,v.default.prototype.initialize.apply(this,arguments)}});s.default=y,i.exports=s.default},4303:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=o(5),y=o(76),_=h(o(294)),S=h(o(8283)),T=_.default.extend({dataTestItsi:"service-definition-dependencies-tab",initialize:function initialize(i){(i=i||{}).tabId=y.SERVICE_DEFINITION_TABS.DEPENDENCY,i.tabLabel=(0,v.gettext)("Service Dependencies"),i.ContentView=S.default,i.contentViewOptions={globalTeamData:i.globalTeamData,servicesCollectionData:i.servicesCollectionData,service:i.service,isReadOnly:i.readOnly},_.default.prototype.initialize.apply(this,arguments)}});s.default=T,i.exports=s.default},4304:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(8293)),y=h(o(8294)),_=v.default.extend({dataTestItsi:"service-definition-pa-tab",initialize:function initialize(i){if(!(i=i||{}).service)throw"Must provide service";i.contentViewOptions={service:i.service,isReadOnly:i.readOnly,sdDispatcher:i.sdDispatcher},i.ContentView=y.default,v.default.prototype.initialize.call(this,i)}});s.default=_,i.exports=s.default},4305:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(17)),y=h(o(18)),_=h(o(30)),S=h(o(21)),T=h(o(22)),x=h(o(20)),R=h(o(11)),P=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),L=h(o(2)),N=h(o(39)),V=h(o(325)),j=h(o(687)),W=h(o(99)),K=o(5),U=o(461);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,x.default)(i);if(s){var v=(0,x.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,T.default)(this,o)}}o(29);var Y=function(i){(0,S.default)(PredictiveAnalyticsResultsCard,i);var s=_createSuper(PredictiveAnalyticsResultsCard);function PredictiveAnalyticsResultsCard(i){var o;(0,v.default)(this,PredictiveAnalyticsResultsCard);for(var h=arguments.length,y=new Array(h>1?h-1:0),S=1;S<h;S++)y[S-1]=arguments[S];return o=s.call(this,i,...y),(0,R.default)((0,_.default)(o),"getCardHeader",i=>U.PANELS.filter(s=>s.value===i).map(s=>{var h=i===U.PANEL_TYPE.WORST_HEALTHSCORE||i===U.PANEL_TYPE.WORST_SEVERITY;return P.default.createElement(V.default.Header,{title:s.label,key:s.value,subtitle:s.subtitle},P.default.createElement("div",null,P.default.createElement(W.default,{"data-test-itsi":"pa-results-card-description-tooltip",content:P.default.createElement("div",{style:{display:"block",width:"350px"}},s.description)}),P.default.createElement(W.default,{"data-test-itsi":"pa-results-card-open-in-search-tooltip",style:{float:"right"},content:P.default.createElement("span",{style:{whiteSpace:"nowrap"}},(0,K.gettext)("Open in Search"))},P.default.createElement(N.default,{"aria-label":(0,K.gettext)("Open in Search"),"data-test-itsi":"pa-open-in-search-button",disabled:o.props.getDisabledState(s.value),onClick:o.props.openInSearch(s.value),appearance:"pill",style:{padding:"0"},icon:P.default.createElement(j.default,{screenReaderText:(0,K.gettext)("Open in Search"),height:"16",width:"16"})})),h?P.default.createElement(W.default,{"data-test-itsi":"pa-results-card-create-alert-tooltip",style:{float:"right"},content:P.default.createElement("span",{style:{whiteSpace:"nowrap"}},o.props.serviceUpdated?(0,K.gettext)("Save service before creating Correlation Search"):(0,K.gettext)("Create a Correlation Search"))},o.props.createAlertObject):null))})),o.state={},o}return(0,y.default)(PredictiveAnalyticsResultsCard,[{key:"render",value:function render(){var i=this.getCardHeader(this.props.panelType);return this.props.fillCard?P.default.createElement(V.default,{"data-test-itsi":"pa-results-fill-card",style:{margin:"5px",minHeight:"150px"}},i,this.props.body):P.default.createElement(V.default,{"data-test-itsi":"pa-results-card",style:{margin:"5px",minHeight:"150px"}},i,P.default.createElement(V.default.Body,{style:{margin:this.props.isCompleted?"":"0 auto"}},this.props.body))}}]),PredictiveAnalyticsResultsCard}(P.Component);(0,R.default)(Y,"propTypes",{isCompleted:L.default.bool.isRequired,panelType:L.default.number.isRequired,body:L.default.object,getDisabledState:L.default.func.isRequired,openInSearch:L.default.func.isRequired,fillCard:L.default.bool,createAlertObject:L.default.object,serviceUpdated:L.default.bool}),(0,R.default)(Y,"defaultProps",{body:P.default.createElement("div",null),fillCard:!1,createAlertObject:null,serviceUpdated:!1});var $=Y;s.default=$,i.exports=s.default},461:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.VIZ_COLORS=s.TRAIN_TEST_WORKFLOW_STEP=s.TOOLTIP_CONTENT_STYLE=s.TEST_DATA_SPLIT_MESSAGES=s.SERVICE_CONFIGURATION_TEXT=s.SEARCH_TYPE=s.SEARCH_PROGRESS_ELEMENTS=s.SEARCHES=s.RANK_IGNORED=s.PREDICTIVE_ANALYTICS_ALGORITHM_TYPE=s.PREDICTIVE_ANALYTICS_ALGORITHM_NAMES=s.PREDICTIVE_ANALYTICS_ALGORITHMS=s.PREDICTED_HEALTH_STATE_TOOLTIP=s.PREDICTED_HEALTH_SCORE_TOOLTIP=s.PLOTLINE_VIZ_COLOR=s.PANEL_TYPE=s.PANELS=s.NUM_ROOT_CAUSE_KPI=s.MODEL_MISSING_MESSAGES=s.MODEL_MISSING_MESSAGE=s.MATH_UTILS=s.LOOKUP_FILE_TYPES=s.LOAD_STATE=s.KPI_MODEL_TTL=s.KPI_FORECAST_TYPE=s.DEFAULT_SPLUNK_SEARCH_ERROR_MESSAGE=s.CLASSIFICATION_STATES=s.ALGO_TYPES=s.ALERT_ERROR_MESSAGES=void 0,s.classificationAlgorithmCategoryColor=function classificationAlgorithmCategoryColor(i){var s=(0,X.getSeverityColor)(6),o=se.filter(s=>s.type===i);(0,P.default)(o)||(s=o[0].color);return s},s.confirmationModalBody=function confirmationModalBody(){return T.default.createElement(j.default.Body,null,T.default.createElement(V.default,{"data-test-itsi":"cs-create-success-message",type:"success"},(0,K.gettext)("Correlation search successfully created. To view the search, go to the")+" ",T.default.createElement(N.default,{"data-test-itsi":"correlation-searches-lister-link",to:Z.uiListerURL,openInNewContext:!0},(0,K.gettext)("Correlation Searches lister page."))))},s.formatMissingModels=function formatMissingModels(i,s){return he.filter(s=>s.value in i).map((i,o)=>o===s-1?T.default.createElement("span",{key:i.value},T.default.createElement("b",null,i.label)," "+(0,K.gettext)("model")):o===s-2?T.default.createElement("span",{key:i.value},T.default.createElement("b",null,i.label)," "+(0,K.gettext)("model, and")+" "):T.default.createElement("span",{key:i.value},T.default.createElement("b",null,i.label)," "+(0,K.gettext)("model")+", "))},s.getAlgorithmLabelLabel=function getAlgorithmLabelLabel(i){switch(i){case ce.LINEAR_REGRESSION.key:return ce.LINEAR_REGRESSION.name;case ce.RANDOM_FOREST.key:return ce.RANDOM_FOREST.name;case ce.GRADIENT_BOOSTING.key:return ce.GRADIENT_BOOSTING.name;case ce.LOGISTIC_REGRESSION.key:return ce.LOGISTIC_REGRESSION.name;default:return(0,K.gettext)(i)}},s.getAlgorithmTypeFromModelId=getAlgorithmTypeFromModelId,s.getAvailableModelSet=function getAvailableModelSet(i){var s=new Set;return(0,R.default)(i.filter(i=>1===parseInt(i.avg)&&1===parseInt(i.ss)&&1===parseInt(i.worst)),i=>{s.add(i.name)}),s},s.getKpiIdFromFieldName=function getKpiIdFromFieldName(i){var s={rank:999,kpiId:""};if(!i.length)return s;var o=i.trim(),h=o.split("_");return o.startsWith(ge.ACTUAL)||o.startsWith(ge.PREDICTED)?{rank:h[1],kpiId:h.slice(2).join("_")}:s},s.getPredictionActualLabel=function getPredictionActualLabel(i){return(0,K.gettext)(i)},s.getPredictionErrorMessage=function getPredictionErrorMessage(i){if(i.includes("Model does not exist"))return fe.PANEL;return i},s.getSavedAlgorithmModel=function getSavedAlgorithmModel(i,s){var o="";if(!i||!s)return o;var h=i.get("algorithms");if(h){var v=h.get(s);o=v.get("modelId")}return o},s.isValidAlgorithmModel=function isValidAlgorithmModel(i,s){var o=!1;if(!i||!s)return o;if(i&&s.length){s.filter(s=>s.detail.modelId===i).length&&(o=!0)}return o},s.isValidTimePeriod=function isValidTimePeriod(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"0",s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"0"===i&&""===s||(""===i&&"0"!==s&&""!==s||("0"!==i&&""!==i&&""===s||!!i&&!!s))},s.loadMissingMLTKElement=function loadMissingMLTKElement(){return T.default.createElement(ne,null,T.default.createElement(V.default,{"data-test-itsi":"install-mltk-error-message",type:"error"},(0,K.gettext)("You must install Splunk Machine Learning Toolkit to use Predictive Analytics. Download the MLTK")+" ",T.default.createElement(N.default,{"data-test-itsi":"pa-mltk-app-link",to:(0,Y.getSplunkBaseDetailsURL)(U.SPLUNKBASE_APPS.Machine_Learning_Toolkit.id),openInNewContext:!0},(0,K.gettext)("here"))))},s.openInSearch=function openInSearch(i){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(!i)return;var h={q:i,earliest:s,latest:o},v=(0,te.uiEditURL)(h);window.open(v,"_blank")},s.outputCategoryColor=function outputCategoryColor(i){var s=[(0,X.getSeverityColor)(6),(0,X.getSeverityColor)(6),(0,X.getSeverityColor)(5),(0,X.getSeverityColor)(2)];return i>1||i<0?s[0]:(0,ee.getSeverityColorFromColorRangeTable)(100*i,s)};var v,y,_,S=h(o(9)),T=h(o(0)),x=h(o(3)),R=h(o(403)),P=h(o(45)),L=h(o(385)),N=h(o(43)),V=h(o(33)),j=h(o(107)),W=h(o(86)),K=o(5),U=o(405),Y=o(404),$=o(25),X=o(111),Z=o(527),ee=o(1173),te=o(142);o(29);var ie=(0,x.default)(V.default)(v||(v=(0,S.default)(["\n\tmargin: 0 auto;\n\tposition: relative;\n"]))),ae=(0,x.default)(W.default)(y||(y=(0,S.default)(["\n\tdisplay: inline-block;\n"]))),ne=x.default.div(_||(_=(0,S.default)(["\n\tpadding: 10px 20px;\n"])));s.VIZ_COLORS=["#000000","#006d9c","#4fa484","#ec9960","#5a4575","#b6c75a"];s.PLOTLINE_VIZ_COLOR="#a8a8a8";var re={REGRESSION:1,CLASSIFICATION:2};s.ALGO_TYPES=re;s.LOOKUP_FILE_TYPES={CSV:".csv",MLMODEL:".mlmodel"};var se=[{type:"Critical",label:(0,K.gettext)("Critical"),color:(0,X.getSeverityColor)(6)},{type:"Medium",label:(0,K.gettext)("Medium"),color:(0,X.getSeverityColor)(5)},{type:"Normal",label:(0,K.gettext)("Normal"),color:(0,X.getSeverityColor)(2)}];s.CLASSIFICATION_STATES=se;s.LOAD_STATE={FIRST_LOAD:0,NORMAL:1,MISSING:2,LOADING_MODELS:3};s.SEARCH_TYPE={HEALTHSCORE_SEARCH:"healthScore",KPI_OVER_TIME_SEARCH:"kpiOverTime"};var le=(0,K.gettext)("An error occurred while executing the search. Refer to the Splunk logs for more information.");s.DEFAULT_SPLUNK_SEARCH_ERROR_MESSAGE=le;var oe={R2:1,RMSE:2,HEALTHSCORE_COMPARISON:3,RESIDUAL_ERROR:4,AVG_HEALTHSCORE:5,WORST_HEALTHSCORE:6,PRECISION:7,RECALL:8,ACCURACY:9,F1:10,CONFUSION:11,WORST_SEVERITY:12,AVG_SEVERITY:13};s.PANEL_TYPE=oe;s.TRAIN_TEST_WORKFLOW_STEP={TRAIN_TO_TEST:0,TEST:1,IN_TRAIN:2};var de=[{name:"Regression",value:re.REGRESSION,label:(0,K.gettext)("Regression"),labelLowerCase:(0,K.gettext)("regression")},{name:"Classification",value:re.CLASSIFICATION,label:(0,K.gettext)("Classification"),labelLowerCase:(0,K.gettext)("classification")}];s.PREDICTIVE_ANALYTICS_ALGORITHM_TYPE=de;var ce={LINEAR_REGRESSION:{key:"LinearRegression",name:(0,K.gettext)("Linear Regression")},RANDOM_FOREST:{key:"RandomForestRegressor",name:(0,K.gettext)("Random Forest Regressor")},GRADIENT_BOOSTING:{key:"GradientBoostingRegressor",name:(0,K.gettext)("Gradient Boosting Regressor")},LOGISTIC_REGRESSION:{key:"LogisticRegression",name:(0,K.gettext)("Logistic Regression")}};s.PREDICTIVE_ANALYTICS_ALGORITHM_NAMES=ce;var he=[{value:ce.LINEAR_REGRESSION.key,label:ce.LINEAR_REGRESSION.name,type:re.REGRESSION},{value:ce.RANDOM_FOREST.key,label:ce.RANDOM_FOREST.name,type:re.REGRESSION},{value:ce.GRADIENT_BOOSTING.key,label:ce.GRADIENT_BOOSTING.name,type:re.REGRESSION},{value:ce.LOGISTIC_REGRESSION.key,label:ce.LOGISTIC_REGRESSION.name,type:re.CLASSIFICATION}];s.PREDICTIVE_ANALYTICS_ALGORITHMS=he;var ue={NEGATIVE:(0,K.gettext)("Input value cannot be less than 0."),MIN_ERROR:(0,K.gettext)("Minimum range cannot be greater than maximum value."),MAX_ERROR:(0,K.gettext)("Maximum range cannot be less than minimum value."),INTEGER:(0,K.gettext)("Input value must be a positive integer."),HUNDRED:(0,K.gettext)("Input value cannot be greater than 100."),ERROR_SAVING:(0,K.gettext)("Could not save correlation search."),EMPTY:(0,K.gettext)("Input value is required."),SEARCH_NAME:(0,K.gettext)("Search name is required."),EMPTY_TITLE:(0,K.gettext)("Notable event title is required.")};s.ALERT_ERROR_MESSAGES=ue;var pe={TEST_ALL_DATA:(0,K.gettext)("All data within the selected time period will be used for testing."),TEST_NO_DATA:(0,K.gettext)("Do not change the time range while a model is being trained.")};s.TEST_DATA_SPLIT_MESSAGES=pe;var fe={CREATION_DASHBOARD:" "+(0,K.gettext)("of this type has been deleted. If it was deleted by accident, retrain it above."),CREATION_DASHBOARD_PLURAL:" "+(0,K.gettext)("of this type have been deleted. If they were deleted by accident, retrain them above."),USAGE_DASHBOARD:" "+(0,K.gettext)("of this type has been deleted. If it was deleted by accident, retrain it in")+" ",USAGE_DASHBOARD_PLURAL:" "+(0,K.gettext)("of this type have been deleted. If they were deleted by accident, retrain them in")+" ",PANEL:(0,K.gettext)("One or more models in use has been deleted. If they were deleted by accident, retrain them again.")};s.MODEL_MISSING_MESSAGES=fe;var ge={ACTUAL:"actual_",PREDICTED:"predicted_"};s.KPI_FORECAST_TYPE=ge;var me=(0,K.gettext)("Predicted health score in 20-30 minutes");s.PREDICTED_HEALTH_SCORE_TOOLTIP=me;var ve=(0,K.gettext)("Predicted health state in 20-30 minutes");s.PREDICTED_HEALTH_STATE_TOOLTIP=ve;s.TOOLTIP_CONTENT_STYLE={display:"block",width:"450px"};var ye=(0,K.gettext)("This model has been deleted. If it was deleted by accident,")+" ";s.MODEL_MISSING_MESSAGE=ye;var _e=(0,K.gettext)("Service Configuration");s.SERVICE_CONFIGURATION_TEXT=_e;var Se=[{value:oe.R2,label:"R^2",subtitle:"",description:(0,K.gettext)("R^2 is a measure of how well the model approximates the real data points. This value ranges from 0 to 1. In general, the higher the R^2, the better the prediction.")},{value:oe.RMSE,label:"RMSE",subtitle:"",description:(0,K.gettext)("RMSE (Root Mean Squared Error) is a measure of the average difference between the predicted and observed service health scores. This value depends on the output distribution of the created model, but in general a smaller value is better.")},{value:oe.HEALTHSCORE_COMPARISON,label:(0,K.gettext)("Actual vs. Predicted Service Health Score"),subtitle:"",description:(0,K.gettext)("A scatterplot of the actual versus predicted results. The dots represent the actual values graphed against the predicted values. If a predicted value equals the actual value, the dot will fall exactly on the line. The greater the distance from the line, the farther off the prediction. It is best if there are more dots closer to the line.")},{value:oe.RESIDUAL_ERROR,label:(0,K.gettext)("Residual Error Histogram"),subtitle:"",description:(0,K.gettext)("A histogram of the residual error of each service health score during the test period. The residual error is the difference between the observed service health score and the estimated score predicted by the model. It is better if this graph has a normal (bell-shaped) distribution with values closer to 0.")},{value:oe.AVG_HEALTHSCORE,label:(0,K.gettext)("Predicted Average Case Service Health Score"),subtitle:me,description:(0,K.gettext)("The average predicted health score within the prediction window.")},{value:oe.WORST_HEALTHSCORE,label:(0,K.gettext)("Predicted Worst Case Service Health Score"),subtitle:me,description:(0,K.gettext)("The lowest possible predicted health score value within the prediction window.")},{value:oe.WORST_SEVERITY,label:(0,K.gettext)("Predicted Worst Case Severity"),subtitle:ve,description:(0,K.gettext)("The worst case predicted severity within the prediction window.")},{value:oe.AVG_SEVERITY,label:(0,K.gettext)("Predicted Average Case Severity"),subtitle:ve,description:(0,K.gettext)("The average predicted severity within the prediction window.")},{value:oe.PRECISION,label:(0,K.gettext)("Precision"),subtitle:"",description:(0,K.gettext)("The percentage of time a model identifies only the relevant data points.")},{value:oe.RECALL,label:(0,K.gettext)("Recall"),subtitle:"",description:(0,K.gettext)("The percentage of time the correct severity is predicted.")},{value:oe.ACCURACY,label:(0,K.gettext)("Accuracy"),subtitle:"",description:(0,K.gettext)("The overall percentage of correct predictions.")},{value:oe.F1,label:(0,K.gettext)("F1"),subtitle:"",description:(0,K.gettext)("The weighted average of precision and recall, based on a scale from zero to one. The closer the statistic is to one, the better the fit of the model.")},{value:oe.CONFUSION,label:(0,K.gettext)("Classification Results (Confusion Matrix)"),subtitle:"",description:(0,K.gettext)("The number of actual results against predicted results. The diagonal numbers should be closer to 100%, while the other numbers should be closer to 0.")}];s.PANELS=Se;s.KPI_MODEL_TTL=864e6;s.NUM_ROOT_CAUSE_KPI=5;s.RANK_IGNORED=999;s.MATH_UTILS={isEvenNumber:function isEvenNumber(i){return i%2==0},isOddNumber:function isOddNumber(i){return i%2==1}};var be={currentModelName:"",getCreateModelSearch:function getCreateModelSearch(i,s,o,h){if(!(i&&s&&o&&(0,L.default)(h).length))return"";var v=s.split(/(?=[A-Z])/).join("_").toLowerCase();return"`train_and_test("+i+","+(o===re.REGRESSION?"health_score":"health_score_level")+","+v+",app:"+this.getAlgorithmModelName(i,s)+","+h+")`"},getSampleCreateModelSearch:function getSampleCreateModelSearch(i,s,o,h){if(!(i&&s&&o&&(0,L.default)(h).length))return"";var v="itsi_predict_sample_model_"+s,y="",_="";switch(s){case ce.LINEAR_REGRESSION.key:_="| fit "+(y=s+" fit_intercept=true")+' next30m_avg_hs from\n"SS_*" "this_date_*" last30m_avg_hs now_avg_hs into '+v+"_avg\n| fit "+y+' next30m_min_hs from\n"SS_*" "this_date_*" last30m_min_hs now_min_hs into '+v+"_worst";break;case ce.RANDOM_FOREST.key:case ce.GRADIENT_BOOSTING.key:_="| fit "+(y=s)+' next30m_avg_hs from\n "SS_*" "this_date_*" last30m_avg_hs now_avg_hs into '+v+"_avg\n | fit "+y+' next30m_min_hs from\n "SS_*" "this_date_*" last30m_min_hs now_min_hs into '+v+"_worst";break;case ce.LOGISTIC_REGRESSION.key:_="| fit "+(y=s+" fit_intercept=true")+' next30m_avg_hsl from\n"SS_*" "this_date_*" last30m_avg_hsl now_avg_hsl into '+v+"_avg\n| fit "+y+' next30m_max_hsl from\n"SS_*" "this_date_*" last30m_max_hsl now_max_hsl into '+v+"_worst"}return"`itsi_summary_with_dependence("+i+')`\n| timechart limit=0 span=5m avg(alert_value) as value_avg\nmin(alert_value) as value_min\nmax(alert_value) as value_max\navg(alert_value) as value_avg\nstdev(alert_value) as value_std\navg(alert_level) as level_avg\nmax(alert_level) as level_max\navg(eval(if(is_service_max_severity_event=1, alert_value, null))) as value_ms_avg\nmin(eval(if(is_service_max_severity_event=1, alert_value, null))) as value_ms_min\nmax(eval(if(is_service_max_severity_event=1, alert_value, null))) as value_ms_max by kpiid\n| rename "value_avg: SHKPI-'+i+'" as now_avg_hs,\n"value_min: SHKPI-'+i+'" as now_min_hs,\n"level_avg: SHKPI-'+i+'" as now_avg_hsl,\n"level_max: SHKPI-'+i+'" as now_max_hsl\n| search now_avg_hs=*\n| eval now_avg_hsl=case(now_avg_hsl>=5, "Critical", now_avg_hsl>=3, "Medium", true(), "Normal"),\nnow_max_hsl=case(now_max_hsl>=5, "Critical", now_max_hsl>=3, "Medium", true(), "Normal")\n| eval this_date_day = strftime(_time, "%w"),\nthis_date_hour = strftime(_time, "%H")\n| filldown\n| streamstats window=6 current=f\nfirst("now_avg_hs") as last30m_avg_hs,\nfirst("now_min_hs") as last30m_min_hs,\nfirst("now_avg_hsl") as last30m_avg_hsl,\nfirst("now_min_hsl") as last30m_min_hsl\n| reverse\n| streamstats window=6 current=f\nfirst("now_avg_hs") as next30m_avg_hs,\nfirst("now_min_hs") as next30m_min_hs,\nfirst("now_avg_hsl") as next30m_avg_hsl,\nfirst("now_max_hsl") as next30m_max_hsl\n| where _time < now() - 300\n| fit StandardScaler "value_*" with_mean=true with_std=true into '+v+'_ss\n| sample seed=1001 partitions=100 fieldname="pn"\n| search pn<'+h+"\n"+_},getMLTKModelLookFileNames:function getMLTKModelLookFileNames(i,s,o){var h="__mlspl_"+this.getAlgorithmModelName(i,s);return{avg:h+"_avg"+o,worst:h+"_worst"+o,ss:h+"_ss"+o}},getAlgorithmModelName:function getAlgorithmModelName(i,s){return void 0!==this.currentModelName&&""!==this.currentModelName||(this.currentModelName="itsi_predict_"+i.replace(/-/g,"_")+"_"+s+"_"+(0,$.generateUUID)()+"_"+(new Date).getTime()),this.currentModelName},resetModelName:function resetModelName(){this.currentModelName=""},getHealthScoreSearch:function getHealthScoreSearch(i){return"`health_score_histogram("+i+")`"},getKpiOverTimeSearch:function getKpiOverTimeSearch(i){return"`kpi_values_over_time("+i+")`"},getModelSearch:function getModelSearch(i){return"| `listmodels_by_type("+("itsi_predict_"+i.toLowerCase().split("-").join("_"))+")`"},getPredictHealthScoreSearch:function getPredictHealthScoreSearch(i,s,o){var h=getAlgorithmTypeFromModelId(s),v=o?"itsi_predict_one_number":"itsi_predict";return h.type===re.REGRESSION?"`"+v+"("+i+",health_score,app:"+s+")`":h.type===re.CLASSIFICATION?"`"+v+"("+i+",health_score_level,app:"+s+")`":""},getComparisonSearch:function getComparisonSearch(i,s,o){return"`predict_actual_vs_predicted("+i+", app:"+s+", "+o+")`"},getResidualSearch:function getResidualSearch(i,s,o){return"`predict_residual_error("+i+", app:"+s+", "+o+")`"},getWorstHealthScoreSearch:function getWorstHealthScoreSearch(i,s){return"`only_health_score_prediction_output("+i+", app:"+s+")`"},getWorstHealthSeveritySearch:function getWorstHealthSeveritySearch(i,s){return"`only_health_score_level_prediction_output("+i+", app:"+s+")`"},getConfusionMatrixSearch:function getConfusionMatrixSearch(i,s){return"`apply_model("+i+", app:"+s+')` | rename "next30m_avg_hsl" as actual_hsl, "predicted(next30m_avg_hsl)" as predict_hsl, next30m_worst_hsl as actual_mhsl "predicted(next30m_worst_hsl)" as predict_mhsl| fields actual_hsl, predict_hsl, actual_mhsl, predict_mhsl| appendpipe [fields actual_mhsl, predict_mhsl | rename actual_mhsl as actual_hsl, predict_mhsl as predict_hsl]| search actual_hsl!="" AND predict_hsl!="" | `itsi_confusionmatrix(actual_hsl,predict_hsl)`'},getKpiForecastsSearch:function getKpiForecastsSearch(i,s){return""===s&&(s=i.toLowerCase().split("-").join("_")),"`root_cause_analysis("+i+","+s+",5)`"},getKpiForecastsR2Search:function getKpiForecastsR2Search(i){return"| `r2_for_kpi_trends("+i.toLowerCase().split("-").join("_")+")`"},getKpiModelsCountsSearch:function getKpiModelsCountsSearch(i){var s=i.toLowerCase().split("-").join("_");return"| `itsi_check_model_count("+i+","+s+")`"},getTrainKpiTrendsSearchData:function getTrainKpiTrendsSearchData(i){var s=i.toLowerCase().split("-").join("_")+"_"+(0,$.generateUUID)()+"_"+(new Date).getTime(),o={};return o.search="`train_kpi_trends("+i+","+s+")`",o.suffix=s,o}};s.SEARCHES=be;var Te={getSearchInfoElement:function getSearchInfoElement(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,K.gettext)("Select a time range");return T.default.createElement(ie,{"data-test-itsi":"pa-search-info-message",type:"info"},i)},getSearchInProgressElement:function getSearchInProgressElement(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,K.gettext)("Waiting for results..."),s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{paddingLeft:"10px",display:"inline-block"};return T.default.createElement("div",{style:s},T.default.createElement(ae,{"data-test-itsi":"pa-utils-wait-spinner"}),T.default.createElement("div",{style:o},i))},getNoResultsElement:function getNoResultsElement(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,K.gettext)("No results found."),s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T.default.createElement("div",{style:s},T.default.createElement(V.default,{"data-test-itsi":"pa-no-results-warning-message",type:"warning",style:o},i))},getErrorMessageElement:function getErrorMessageElement(i){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{width:"100%",height:"100%",justifyContent:"center",alignItems:"center"},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i||(i=(0,K.gettext)("An error occurred during the execution of the search.")),T.default.createElement("div",{style:s},T.default.createElement(V.default,{"data-test-itsi":"pa-error-message",type:"error",style:o},i))},getCancelledMessageElement:function getCancelledMessageElement(i){return i||(i=(0,K.gettext)("The search was cancelled.")),T.default.createElement(V.default,{"data-test-itsi":"pa-search-cancelled-message",type:"info"},i)}};function getAlgorithmTypeFromModelId(i){var s=he.filter(s=>i.includes(s.value));return 1===s.length?s[0]:{}}s.SEARCH_PROGRESS_ELEMENTS=Te},8267:function(i,s,o){o.p=function getPath(){function getConfigValue(i,s){if(window.$C&&window.$C.hasOwnProperty(i))return window.$C[i];if(void 0!==s)return s;throw new Error("getConfigValue - "+i+" not set, no default provided")}return function make_url(){for(var i,s,o="",h=0,v=arguments.length;h<v;h++)(s=(i=arguments[h].toString()).length)>1&&"/"==i.charAt(s-1)&&(i=i.substring(0,s-1)),"/"!=i.charAt(0)?o+="/"+i:o+=i;if("/"!=o){var y=o.split("/"),_=y[1];if("static"==_||"modules"==_){var S=o.substring(_.length+2,o.length);o="/"+_,window.$C.BUILD_NUMBER&&(o+="/@"+window.$C.BUILD_NUMBER),window.$C.BUILD_PUSH_NUMBER&&(o+="."+window.$C.BUILD_PUSH_NUMBER),"app"==y[2]&&(o+=":"+getConfigValue("APP_BUILD",0)),o+="/"+S}}var T=getConfigValue("MRSPARKLE_ROOT_PATH","/"),x=getConfigValue("LOCALE","en-US"),R="/"+x+o;return""==T||"/"==T?R:T+R}("/static/app/itsi/build/pages")+"/"}();var h=o(1),v=h(o(73)),y=h(o(309)),_=h(o(28)),S=h(o(15)),T=h(o(0)),x=o(5),R=o(16),P=o(358),L=o(405),N=o(404),V=o(106),j=o(77),W=o(58),K=o(199),U=o(291),Y=o(76),$=o(119),X=o(149),Z=o(283),ee=o(327),te=o(489),ie=o(514),ae=h(o(571)),ne=o(129),re=h(o(302)),se=h(o(146)),le=h(o(2945)),oe=h(o(8268));o(260);var de=(0,v.default)({},S.default.Events);S.default.listenTo(de,"rendered",(function implementPageContent(){(0,_.default)("#app-main-layout").html('<div class="service-definition-body"></div>');var i,s=function showError(i,s){new se.default({dataTestItsi:"service-definition-error-modal",errorMessage:s,htmlResponse:(0,ne.extractErrorMsgFromResponse)(i)}).render()},o=null,h={},v={},S=new le.default,T={},P={},ae={},de=function initRouter(s){new s({appsData:h,featureFlags:i,globalTeamData:v,permissions:T,serviceBaseModel:o,servicesCollectionData:ae,thresholdTemplateCollection:S,userData:P})},ce=null,he=(0,W.getHash)();if(he){var ue=(he=he.slice(1)).split("/");if(ue.length>=2)ce=ue[0];else{var pe=(0,W.queryStringToProp)(he);ce=pe.serviceId}}else{var fe=(0,W.queryStringToProp)();ce=fe.serviceId}if(ce=(0,W.sanitizeURLParam)(ce),(0,y.default)(ce))(0,ie.retrieveIsUserCapable)(Y.OBJECT_TYPE,ee.OPERATIONS.WRITE).then(i=>i.data).then(i=>{Object.prototype.hasOwnProperty.call(i,"is_capable")?s("",(0,x.gettext)("Could not fetch 'service' object. Verify that the URL is correct.")):s("",(0,x.gettext)("Could not fetch capabilities. 'is_capable' schema may have changed."))}).catch(i=>{s(i,(0,x.gettext)("Could not check if user has write capability for 'service' objects."))});else{o=new re.default({_key:ce});var ge=_.default.Deferred(),me=_.default.Deferred(),ve=_.default.Deferred(),ye=_.default.Deferred();(0,K.retrieveFeatureFlags)().then(i=>(0,U.formatResponse)(i.data)).then(s=>{i=s,ge.resolve()}).catch(i=>{s(i,(0,x.gettext)("Could not retrieve feature flags.")),ge.reject()});var _e={count:-1,output_mode:"json",search:L.PYTHON_SCIENTIFIC_APP_NAME_PREFIX};L.PYTHON_SCIENTIFIC_APP_NAMES.forEach(i=>{h[i]={},h[i].isInstalled=!1,h[i].isDisabled=!1}),(0,N.retrieveApps)(_e).then(i=>i.data).then(i=>{i&&i.entry&&i.entry.forEach(i=>{L.PYTHON_SCIENTIFIC_APP_NAMES.includes(i.name)&&(0,V.versionCompare)(i.content.version,"3.0.0")>=0&&(h[i.name].isInstalled=!0,i.content&&i.content.disabled&&(h[i.name].isDisabled=!0))}),me.resolve()}).catch(()=>{me.reject()});var Se=new Promise((i,s)=>{(0,$.retrieveServices)({count:0,fields:"_key,identifying_name,title,base_service_template_id,service_tags,kpis.title,kpis._key,kpis.type,kpis.urgency,services_depending_on_me,services_depends_on",offset:0,sort_dir:"asc",sort_key:"identifying_name"}).then(i=>i.data).then(s=>{ae=s,i()}).catch(()=>{s([])})});(0,Z.retrieveTeam)(X.GLOBAL_TEAM_KEY).then(i=>i.data).then(i=>{v=i,T.canWriteOnGlobalTeam=i.permissions.write,ve.resolve()}).catch(()=>{T.canWriteOnGlobalTeam=!1,ve.reject()}),(0,te.retrieveUser)().then(i=>i.data).then(i=>{P.timezone=(0,j.convertToTimezoneObject)(i&&i.entry&&i.entry[0]&&i.entry[0].content&&i.entry[0].content.tz),ye.resolve()}).catch(()=>{ye.reject()}),Promise.all([o.fetch(),ge,me,ve,ye,S.fetch(),Se]).then(()=>{!function loadServiceDefinitionPage(i){oe.default.loadView(i,function(i){de(i)}.bind(this))}(!o.canWrite())}).catch(i=>{s(i,(0,R.sprintf)((0,x.gettext)("Could not find 'service' object with key: %s. Object may not exist or may have been deleted. Verify that the URL is correct."),ce))})}})),(0,P.createLayout)(T.default.createElement(ae.default,{pageEventDispatcher:de}),{pageTitle:(0,W.buildPageTitle)((0,x.gettext)("Service Definition"))})},8268:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(8269)),y={loadView:function loadView(i,s){if(!s)throw"ServiceDefinitionViewLoader expects a callback function";s(v.default)}};s.default=y,i.exports=s.default},8269:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(177)),y=h(o(42)),_=h(o(73)),S=h(o(53)),T=h(o(28)),x=h(o(15)),R=o(5),P=o(58),L=o(76),N=o(119),V=o(1983),j=h(o(302)),W=h(o(751)),K=h(o(2991)),U=h(o(689)),Y=h(o(8270)),$=h(o(8271)),X=h(o(8272)),Z=h(o(146)),ee=h(o(4298)),te=K.default.extend({ServiceView:ee.default,ServiceDefinitionConfigurationLayoutHeaderView:$.default,initialize:function initialize(i){i=i||{},this.featureFlags=i.featureFlags,this.appsData=i.appsData,this.permissions=i.permissions,this.globalTeamData=i.globalTeamData,this.servicesCollectionData=i.servicesCollectionData,this.thresholdTemplateCollection=i.thresholdTemplateCollection,this.userData=i.userData;var s=i&&i.serviceBaseModel&&i.serviceBaseModel.canWrite();s||(this.ServiceView=X.default,i.configurationLayoutViewOptions={readOnly:!0,headerViewOptions:{isReadOnly:!0,clickToEdit:!1},dockedFooterViewOptions:{isReadOnly:!0,checkForFirstTimeSave:!1}}),this.sdDispatcher=(0,_.default)({},x.default.Events),this.listenTo(this.sdDispatcher,"unsetBaseServiceTemplateId",this._unsetBaseServiceTemplate),this.severityLabelsDfd=this.fetchSeverityLabels(),K.default.prototype.initialize.apply(this,arguments),this.handleHash()},_unsetBaseServiceTemplate:function _unsetBaseServiceTemplate(i){i.get("base_service_template_id")&&(i.unset("base_service_template_id"),i.unset("last_synced_timestamp")),(0,y.default)(i.get("kpis").models,function(i){i.get("base_service_template_id")&&i.unset("base_service_template_id")}.bind(this))},handleHash:function handleHash(){var i,s,o,h=(0,P.getHash)(),v=[];if(h){if(1===(v=(h=h.slice(1)).split("/")).length){var y=(0,P.queryStringToProp)(h);v=[y.serviceId,y.tab],y.kpiId&&v.push(y.kpiId)}}else{var _=(0,P.queryStringToProp)();v.push(_.serviceId),v.push(_.tab),_.kpiId&&v.push(_.kpiId)}if(v.length>=2){switch(i=v[0],s=v[1]||L.SERVICE_DEFINITION_TABS.KPI,o=v[2],s){case L.SERVICE_DEFINITION_TABS.INFO:this.tabToShow=s;break;case L.SERVICE_DEFINITION_TABS.KPI:this.tabToShow=s,this.kpiToShow=o;break;case L.SERVICE_DEFINITION_TABS.DEPENDENCY:case L.SERVICE_DEFINITION_TABS.SETTINGS:case L.SERVICE_DEFINITION_TABS.PREDICTIVE_ANALYTICS:this.tabToShow=s;break;default:new Z.default({dataTestItsi:"service-definition-router-error-modal",errorMessage:(0,R.gettext)("Could not load the requested service.")}).render()}this.setServiceId(i)}},tabActivated:function tabActivated(i){var s=(0,P.createITSIURL)(N.uiURL);-1===s.indexOf("?")?s+="?":s+="&",s+=this.serviceDefinitionView.getUrl(i),this.navigate(s,{trigger:!1,replace:!0}),i===L.SERVICE_DEFINITION_TABS.PREDICTIVE_ANALYTICS&&this.layoutView.childViews.contentView.predictiveAnalyticsTab.contentView.callSearchRenderers()},setServiceId:function setServiceId(i){var s=T.default.Deferred();return this.serviceId===i?(s.resolve(),s):(this.serviceId=i,this.serviceDefinitionView?s.resolve():("new"===this.serviceId?this._createServiceDefinitionView(new j.default):this._createServiceDefinitionView(this.cachedServiceBaseModel)).done((function(){s.resolve()})),s)},_createAndRenderView:function _createAndRenderView(i){this.layoutView=new Y.default((0,v.default)({headerControlsDataTestItsiPrefix:"service-definition-header",footerButtonsDataTestItsiPrefix:"service-definition-docked-footer",el:(0,T.default)(".service-definition-body"),model:i,ContentView:this.ServiceView,HeaderView:this.ServiceDefinitionConfigurationLayoutHeaderView,headerViewOptions:{serviceTemplate:this.baseServiceTemplateModel},dockedFooterViewOptions:{checkForFirstTimeSave:!0},contentViewOptions:{appsData:this.appsData,featureFlags:this.featureFlags,globalTeamData:this.globalTeamData,serviceTemplate:this.baseServiceTemplateModel,sdDispatcher:this.sdDispatcher,serviceKpiBackfillMapping:this.serviceKpiBackfillMapping||{},severityLabels:this.severityLabels,tabToShow:this.tabToShow,kpiToShow:this.kpiToShow,permissions:this.permissions,servicesCollectionData:this.servicesCollectionData,thresholdTemplateCollection:this.thresholdTemplateCollection,userData:this.userData}},this.configurationLayoutViewOptions)),this.serviceDefinitionView=this.layoutView.getContentView(),this.listenTo(this.serviceDefinitionView,"tabactivated",this.tabActivated),this.listenTo(this.serviceDefinitionView,"kpiselected",(function(){this.tabActivated(L.SERVICE_DEFINITION_TABS.KPI)})),this.layoutView.render()},_createServiceDefinitionView:function _createServiceDefinitionView(i){var s=T.default.Deferred(),o=i.get("base_service_template_id");return T.default.when(this.severityLabelsDfd).done(()=>{o?(this.baseServiceTemplateModel=new W.default({_key:o}),this.baseServiceTemplateModel.fetch().done(()=>{this._createAndRenderView(i),s.resolve()}).fail(i=>{s.reject(i.responseJSON)})):(this.serviceKpiBackfillMapping=U.default.getKpiBackfillStatus(i),this._createAndRenderView(i),s.resolve())}).fail(()=>{}),s},fetchSeverityLabels:function fetchSeverityLabels(){var i=T.default.Deferred();return this.severityLabels=[],(0,V.retrieveThresholdLabels)().then(i=>i.data).then(s=>{var o=s.entry.sort((i,s)=>i.content.threshold_level<s.content.threshold_level?-1:i.content.threshold_level>s.content.threshold_level?1:0);this.severityLabels=(0,S.default)(o,i=>({label:i.name,color:i.content.color,lightcolor:i.content.lightcolor})),i.resolve()}).catch(()=>{i.reject()}),i}});s.default=te,i.exports=s.default},8270:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(28)),y=h(o(36)),_=h(o(0)),S=h(o(42)),T=h(o(163)),x=h(o(65)),R=o(5),P=o(16),L=o(125),N=h(o(33)),V=h(o(96)),j=h(o(110)),W=h(o(178)),K=o(106),U=o(25),Y=o(68),$=o(154),X=o(76),Z=o(119),ee=o(185),te=o(129),ie=h(o(1297)),ae=h(o(52)),ne=o(1285),re=ie.default.extend({initialize:function initialize(i){if(!(i=i||{}).contentViewOptions)throw"Must provide contentViewOptions";this.serviceTemplate=i.contentViewOptions.serviceTemplate,this.sdDispatcher=i.contentViewOptions.sdDispatcher,this.serviceKpiBackfillMapping=i.contentViewOptions.serviceKpiBackfillMapping,this.kpiConfigsForAsyncSearch=[],this.sdDispatcher&&(this.listenTo(this.sdDispatcher,"unlink",this._removeServiceTemplate),this.listenTo(this.sdDispatcher,"modelTraining",this._handleModelTraining)),ie.default.prototype.initialize.apply(this,arguments)},_removeServiceTemplate:function _removeServiceTemplate(){this.$(".linked-service-template",this.$el).css({display:"none"})},_handleModelTraining:function _handleModelTraining(i){var s=!!this.modelClone.get("cloneChangedSinceLastSave");i&&this.childViews.dockedFooter.checkPrimaryButtonsEnabled()&&s&&this.childViews.dockedFooter.disable(),!1===i&&s&&this.childViews.dockedFooter.enable()},_getWarning:function _getWarning(i){var s=i.get("entity_rules"),o=!1;return s.forEach(i=>{i.get("rule_items").forEach(i=>{""===i.get("value")&&(o=!0)})}),o},_displayWarningModal:function _displayWarningModal(i,s){var o=(0,v.default)("<div></div>").css({display:"inline-block","vertical-align":"top"});y.default.unmountComponentAtNode(o.get(0)),y.default.render(_.default.createElement(ae.default,null,_.default.createElement(W.default,{title:(0,R.gettext)("Warning"),modalDataTestItsi:"entity-filter-warning-modal",cancelButtonDataTestItsi:"entity-filter-warning-modal-cancel-button",primaryButtonDataTestItsi:"entity-filter-warning-modal-confirm-button",primaryButtonLabel:(0,R.gettext)("Confirm"),open:!0,showCancel:!0,primaryButtonClicked:()=>{!i&&s?this._checkForFirstTimeSave():this._save()}},_.default.createElement(N.default,{"data-test-itsi":"entity-filter-warning-modal-message",type:"warning"},(0,R.gettext)("One or more entity filter rules in the service has an empty value. Provide values in the entity filter rules with empty values to filter the specific set of entities."),_.default.createElement("br",null),_.default.createElement("br",null),(0,R.gettext)("Are you sure you want to continue?")))),o.get(0))},_sendModifiedRecommendationTelemetry:function _sendModifiedRecommendationTelemetry(){var i=(0,ne.getRecommendationModifications)(this.modelClone);0!==Object.keys(i).length&&(0,S.default)(Object.keys(i),s=>{var o=i[s].modifications,h=i[s].recommendationsInfo;JSON.stringify(o).length<9e3&&JSON.stringify(h).length<9e3&&((0,U.sendInteractionTelemetryData)("AssistedKpiThresholding","Recommendation Modifications",{modifications:o}),(0,U.sendInteractionTelemetryData)("AssistedKpiThresholding","Recommendation Info",{recommendationInfo:h}))})},_onSaveStart:function _onSaveStart(){this.childViews.dockedFooter.setErrorMessage();var i,s=this._getWarning(this.modelClone),o=this.model.validate(this.modelClone.attributes);if(o)return i=o instanceof Array&&o.length?o.join("; "):o,void this.childViews.dockedFooter.setErrorMessage(i);s?this._displayWarningModal(this.modelClone.get("enabled"),this.dockedFooterViewOptions.checkForFirstTimeSave):!this.modelClone.get("enabled")&&this.dockedFooterViewOptions.checkForFirstTimeSave?this._checkForFirstTimeSave():(this._sendModifiedRecommendationTelemetry(),this._save())},_getKpiConfigForEntityThresholdGenerateSearch:function _getKpiConfigForEntityThresholdGenerateSearch(){var i=[];return(0,S.default)(this.modelClone.get("kpis").models,s=>{var o=s.get("_key");if(!(0,x.default)(o,X.HEALTH_SCORE_KPI_PREFIX)){if(s.get("is_entity_recommendation_async_job_required")||!1){var h=(0,ee.getRecommendedEntityThresholdAsyncSearchForKpi)(o,null,s.get("entity_threshold_direction"),s.get("entity_recommendation_apply_as_value"),s.get("entity_recommendation_training_window")),v=j.default.unix(s.get("entity_recommendation_start_date")).clone(),y=s.get("entity_recommendation_training_window").match(/\d+/g)[0];v.add(y,"days"),i.push({kpiId:o,search:h,earliestTime:j.default.unix(s.get("entity_recommendation_start_date")),latestTime:v})}s.unsetEntityAsyncJobAttrBeforeSave()}}),i},_getChangedEntityThresholdConfig:function _getChangedEntityThresholdConfig(){var i=[];return(0,S.default)(this.modelClone.get("kpis").models,s=>{s.unsetEntityThresholdRecommendationAttrBeforeSave();var o=s.get("_key");if(!(0,x.default)(o,X.HEALTH_SCORE_KPI_PREFIX)){var h=s.get("entity_threshold_configuration")||{};Object.keys(h).length&&i.extend(Object.values(h))}}),i},_updateKpiWithAsyncSearchFlag:function _updateKpiWithAsyncSearchFlag(){var i=[];(0,S.default)(this.kpiConfigsForAsyncSearch,s=>{i.push(s.kpiId)}),i.length&&(0,S.default)(this.modelClone.get("kpis").models,s=>{var o=s.get("_key");(0,x.default)(i,o)&&s.set("is_entity_recommendation_async_job_required",{silent:!0})}),this.kpiConfigsForAsyncSearch=[]},_save:function _save(){var i=this.loadingMaskMessage||(0,R.gettext)("Saving...");this.modelClone.set({isFirstTimeSaveDone:!0}),this.loadingMask.show(i),this.modelClone.unset("cloneChangedSinceLastSave",{silent:!0}),this.kpiConfigsForAsyncSearch=this._getKpiConfigForEntityThresholdGenerateSearch();var s=this._getChangedEntityThresholdConfig();new Promise((i,o)=>{s.length?(0,Z.bulkUpdateEntitiesConfig)(s).then(()=>{(0,S.default)(this.modelClone.get("kpis").models,i=>{var s=i.get("_key");(0,x.default)(s,X.HEALTH_SCORE_KPI_PREFIX)||i.unsetEntityThresholdConfigAttrBeforeSave()}),i()}).catch(i=>{this._updateKpiWithAsyncSearchFlag(),this.childViews.dockedFooter.setErrorMessage(i instanceof Object?(0,te.extractErrorMsgFromResponse)(i):i),this.childViews.dockedFooter.enable(),this.loadingMask.hide(),o()}):i()}).then(()=>this.modelClone.save().done(function(){this.model.clear({silent:!0}),this.model.set(this.model.parse(JSON.parse(JSON.stringify(this.modelClone.toJSON()))),{silent:!0}),this.modelClone.clear({silent:!0}),this.modelClone.set(this.modelClone.parse(JSON.parse(JSON.stringify(this.model.toJSON()))),{silent:!0}),this._onSaveEnd(),this.childViews.dockedFooter.hide(),this.loadingMask.hide()}.bind(this)).fail(function(i){this._updateKpiWithAsyncSearchFlag(),this.childViews.dockedFooter.setErrorMessage(i instanceof Object?(0,te.extractErrorMsgFromResponse)(i):i),this.childViews.dockedFooter.enable(),this.loadingMask.hide()}.bind(this)))},_runEntityThresholdGenerateAsyncSearch:function _runEntityThresholdGenerateAsyncSearch(){(0,S.default)(this.kpiConfigsForAsyncSearch,i=>{var s={id:(0,$.createUniqueSearchId)("kpi-entity-threshold-async-search"),search:i.search,earliest_time:"-".concat((0,j.default)().diff(i.earliestTime,"day"),"d"),latest_time:(0,j.default)().isSame(i.latestTime,"day")?"now":"-".concat((0,j.default)().diff(i.latestTime,"day"),"d"),autostart:!0},o={app:(0,K.getShortAppName)(!0),owner:L.username};V.default.create(s,o)}),this.kpiConfigsForAsyncSearch=[]},_onSaveEnd:function _onSaveEnd(){this._runEntityThresholdGenerateAsyncSearch(),this.modelClone.unset("cloneChangedSinceLastSave",{silent:!0}),this.loadingMask.hide(),this.childViews.contentView.refreshModel&&this.childViews.contentView.refreshModel(this.modelClone,{type:"save"})},_checkForFirstTimeSave:function _checkForFirstTimeSave(){if(this.modelClone.get("isFirstTimeSaveDone"))this._sendModifiedRecommendationTelemetry(),this._save();else{var i=(0,v.default)('<div class="service-save-modal-container"></div>');y.default.unmountComponentAtNode(i.get(0)),y.default.render(_.default.createElement(ae.default,null,_.default.createElement(W.default,{title:(0,R.gettext)("Save Service"),modalDataTestItsi:"service-definition-save-modal",cancelButtonDataTestItsi:"service-definition-cancel-button",primaryButtonDataTestItsi:"service-definition-save-and-enable-button",thirdButtonDataTestItsi:"service-definition-save-button",primaryButtonLabel:(0,R.gettext)("Save and Enable"),open:!0,showCancel:!0,modalStyles:Y.CONFIRMATION_MODAL_STYLE,primaryButtonClicked:()=>{this.modelClone.set({isFirstTimeSaveDone:!0});var i={enabled:1};this.modelClone.set(i),this._sendModifiedRecommendationTelemetry(),this._save()},thirdButtonLabel:(0,R.gettext)("Save"),thirdButtonClicked:()=>{this.modelClone.set({isFirstTimeSaveDone:!0}),this._sendModifiedRecommendationTelemetry(),this._save()}},_.default.createElement("span",{"data-test-itsi":"first-time-save-message"},(0,P.sprintf)((0,R.gettext)("Do you want to enable %s?"),(0,T.default)(this.modelClone.get("title"))),_.default.createElement("br",null),_.default.createElement("br",null),(0,R.gettext)("Enabling the service will start running the KPI searches.")))),i.get(0))}},_onCancelChanges:function _onCancelChanges(){var i=this.model.get("algorithms");i&&this.sdDispatcher.trigger("resetModelOnCancel"),ie.default.prototype._onCancelChanges.apply(this,arguments)}});s.default=re,i.exports=s.default},8271:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_,S=h(o(9)),T=h(o(0)),x=h(o(36)),R=h(o(3)),P=h(o(43)),L=h(o(99)),N=h(o(862)),V=h(o(1298)),j=h(o(52)),W=(0,R.default)(L.default)(v||(v=(0,S.default)(['\n\t& [data-test="toggle"] {\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\tmax-width: ',"\n\t}\n"])),i=>"".concat(i.tooltipToggleWidth,"px")),K=(0,R.default)(P.default)(y||(y=(0,S.default)(["\n\tfont-size: 20px;\n\twhite-space: nowrap;\n"]))),U=(0,R.default)(N.default)(_||(_=(0,S.default)(["\n\tvertical-align: baseline\n"]))),Y=V.default.extend({initialize:function initialize(i){i=i||{},this.serviceTemplate=i.serviceTemplate,V.default.prototype.initialize.apply(this,arguments)},_renderTooltip:function _renderTooltip(){var i=this.$el.find(".linked-service-template");if(i.length){var s=this.serviceTemplate.get("title"),o=s;s.length>50&&(o=s.slice(0,50)+"..."),x.default.unmountComponentAtNode(i.get(0)),x.default.render(T.default.createElement(j.default,null,T.default.createElement(W,{content:s,"data-test-itsi":"linked-service-template-external-link-row-view-title-tooltip",tooltipToggleWidth:"500"},T.default.createElement(K,{"data-test-itsi":"linked-service-template-external-link",to:this.serviceTemplate.getEditUrl(),openInNewContext:!0},T.default.createElement(U,null)," ",o))),i.get(0))}},render:function render(){V.default.prototype.render.apply(this),this.serviceTemplate&&(this.$el.prepend('<div style="float:right;" class="linked-service-template"></div>'),this._renderTooltip())}});s.default=Y,i.exports=s.default},8272:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(4298)),y=h(o(4299)),_=h(o(4300)),S=h(o(4301)),T=h(o(8312)),x=h(o(4303)),R=h(o(8313)),P=h(o(4304)),L=v.default.extend({renderTabs:function renderTabs(){this.infoTab=new y.default({service:this.modelClone,ContentView:R.default}),this.kpiTab=new S.default({kpiToShow:this.kpiToShow,service:this.modelClone,ContentView:T.default,serviceTemplate:this.serviceTemplate,featureFlags:this.featureFlags,readOnly:!0}),this.dependencyTab=new x.default({globalTeamData:this.globalTeamData,servicesCollectionData:this.servicesCollectionData,service:this.modelClone,readOnly:!0}),this.settingsTab=new _.default({service:this.modelClone,servicesCollectionData:this.servicesCollectionData,serviceTemplate:this.serviceTemplate,sdDispatcher:this.sdDispatcher,readOnly:!0}),this.predictiveAnalyticsTab=new P.default({service:this.modelClone,readOnly:!0})}});s.default=L,i.exports=s.default},8273:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(15)),y=o(5),_=o(76),S=h(o(1301)),T=h(o(2995));o(8274);var x=v.default.View.extend({tagName:"div",className:"entities-content-view",entityRulesHeader:"<div>"+(0,y.gettext)("Entity Rules allow for the optional, dynamic filtering of KPIs and can help in root cause analysis. A service need not define any Entity Rules and is not limited to only the entities matching Entity Rules.")+"</div>",initialize:function initialize(i){if(!(i=i||{}).service){if(!i.serviceTemplate)throw"Must provide service or service template";i.service=i.serviceTemplate}this.service=i.service,this.initEntityRulesView(),this.listenTo(this.specifyEntityRulesView,"ruleschange",this._rulesChanged),this.service.get("object_type")===_.OBJECT_TYPE&&(this.matchedEntitiesView=new T.default({service:this.service})),v.default.View.prototype.initialize.apply(this,arguments)},initEntityRulesView:function initEntityRulesView(){this.specifyEntityRulesView=new S.default({rulesContainerModel:this.service,ruleFieldsBlockList:["services"]})},render:function render(){return this.$el.html(this.entityRulesHeader),this.$el.append(this.specifyEntityRulesView.render().$el),this.$el.append('<h3 class="matched-entities-title" data-test-itsi="matched-entities-title">'+(0,y.gettext)("Matched Entities")+"</h3>"),this.matchedEntitiesView&&this.$el.append(this.matchedEntitiesView.render().$el),this},remove:function remove(){return this.specifyEntityRulesView.remove(),this.matchedEntitiesView&&this.matchedEntitiesView.remove(),v.default.View.prototype.remove.apply(this,arguments)},_rulesChanged:function _rulesChanged(i,s){var o=0===s.length;this.service.unset("entity_rules",{silent:!o}),o?this.service.get("kpis").each((function(i){"shared_base"!==i.get("search_type")&&i.set("is_service_entity_filter",!1)})):this.service.set("entity_rules",s),this.matchedEntitiesView&&this.matchedEntitiesView.refresh()},refreshModel:function refreshModel(){this.specifyEntityRulesView.refreshModel(),this.matchedEntitiesView&&this.matchedEntitiesView.refresh()}});s.default=x,i.exports=s.default},8274:function(i,s,o){var h=o(8275);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},8275:function(i,s,o){(s=o(37)(!1)).push([i.i,".entities-content-view {\n\tpadding: 15px 20px;\n}\n\n.matched-entities-title {\n\tmargin-top: 25px; /* Just some neat separation between the rules and matched entities table */\n}\n\n.entities-content-view td.tableData {\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}",""]),i.exports=s},8276:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(2749)),y=h(o(2750)),_=h(o(1301)),S=h(o(8277)),T=_.default.extend({initialize:function initialize(i){i=i||{},this.serviceTemplateTitle=i.serviceTemplateTitle,_.default.prototype.initialize.apply(this,arguments)},_setupEntityRulesCollection:function _setupEntityRulesCollection(){return new v.default},_addRuleGroupImpl:function _addRuleGroupImpl(i){var s=new S.default({rulesGroupModel:i,ruleFieldsBlockList:this._ruleFieldsBlockList,_aliasFields:this._aliasFields,_infoFields:this._infoFields,serviceTemplateTitle:this.serviceTemplateTitle});this.ruleGroupViews.push(s),this.$(".rules-view-container").append(s.render().$el)},_addRuleGroup:function _addRuleGroup(){var i=new y.default;this.entityRulesCollection.add(i),this._addRuleGroupImpl(i)}});s.default=T,i.exports=s.default},8277:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(2751)),y=h(o(1616)),_=h(o(8278)),S=y.default.extend({initialize:function initialize(i){i=i||{},this.serviceTemplateTitle=i.serviceTemplateTitle,y.default.prototype.initialize.apply(this,arguments)},_setupEntityRuleItemModel:function _setupEntityRuleItemModel(){return new v.default},_addRuleImpl:function _addRuleImpl(i){var s=new _.default({rulesItemModel:i,ruleFieldsBlockList:this._ruleFieldsBlockList,_aliasFields:this._aliasFields,_infoFields:this._infoFields,serviceTemplateTitle:this.serviceTemplateTitle});this.collection.add(s.rulesItemModel),this.ruleItems.push(s),this.$(".rules-container").append(s.render().$el)}});s.default=S,i.exports=s.default},8278:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(0)),y=h(o(28)),_=o(5),S=o(16),T=o(25),x=o(227),R=h(o(1617)),P=h(o(90)),L=h(o(603)),N=h(o(2751)),V=h(o(2750)),j=R.default.extend({initialize:function initialize(i){i=i||{},this.serviceTemplateTitle=i.serviceTemplateTitle,this.showFillInEmptyRulesWarning=!1,R.default.prototype.initialize.apply(this,arguments),this.children.tooltipWarningIcon=new L.default({dataTestItsi:"service-fill-in-rule-icon",dataTestItsiTooltip:"service-fill-in-rule-tooltip",hasTooltip:!0,tooltipContent:this.serviceTemplateTitle?v.default.createElement("div",{style:{width:250}},(0,S.sprintf)((0,_.gettext)("The entity filter rule has an empty value which might be coming from %s service template. Provide values to filter the specific set of entities."),this.serviceTemplateTitle)):v.default.createElement("div",{style:{width:250}},(0,_.gettext)("Provide values for empty entity rules to filter the service to a specific set of entities.")),type:"warning"})},_setupNewEntityRuleModel:function _setupNewEntityRuleModel(){return new N.default},_setupStaticOrRulesSelector:function _setupStaticOrRulesSelector(){var i=this.rulesItemModel.get("rule_type"),s=this.rulesItemModel.get("value");"notmatchesblank"===i?this._tempRulesItemModel.set({rule_type:"not"}):"matchesblank"===i&&this._tempRulesItemModel.set({rule_type:"matches"}),""===s&&(this.showFillInEmptyRulesWarning=!0),this._staticOrRulesSelector=new P.default({controlType:"SyntheticSelect",controlOptions:{dataTestItsi:"service-entity-rule-type-select",items:x.MATCH_CRITERIA_OPTIONS,label:"",model:this._tempRulesItemModel,modelAttribute:"rule_type"},hasControlGroup:!1}),this.listenTo(this._tempRulesItemModel,"change:rule_type",this._handleRuleTypeChange)},_handleRuleTypeChange:function _handleRuleTypeChange(i,s){this.rulesItemModel.set({rule_type:s})},_setupEventHandlersForRuleValue:function _setupEventHandlersForRuleValue(){this.listenTo(this._tempRulesItemModel,"change:value",function(){var i=this._tempRulesItemModel.get("rule_type"),s=this._tempRulesItemModel.get("value"),o=i;"notmatchesblank"===i?o="not":"matchesblank"===i&&(o="matches");var h=this.$(".fill-in-empty-rule-message-container");""===s?h.length||((0,y.default)('<div class="fill-in-empty-rule-message-container"></div>').insertAfter(this.$(".entity-type-info-container")),this.$(".fill-in-empty-rule-message-container").append(this.children.tooltipWarningIcon.render().$el)):h.length&&this.$(".fill-in-empty-rule-message-container").remove(),this.rulesItemModel.set({value:(0,T.removeEnclosingQuotes)(this._tempRulesItemModel.get("value")),rule_type:o})}.bind(this))},renderExtraStuff:function renderExtraStuff(){this.showFillInEmptyRulesWarning&&(this.$el.append('<div class="fill-in-empty-rule-message-container"></div>'),this.$(".fill-in-empty-rule-message-container").append(this.children.tooltipWarningIcon.render().$el))},_addRuleGroup:function _addRuleGroup(){var i=new V.default;this.entityRulesCollection.add(i),this._addRuleGroupImpl(i)}});s.default=j,i.exports=s.default},8279:function(i,s){i.exports='<div class="entity-description-header">\n\t<div data-test-itsi="entity-rules-description-text"><%- vars.entityRulesDescription %></div>\n\t<% if (vars.showWarningMessage) { %>\n\t\t<div class="show-warning-message-container"></div>\n\t<% } %>\n</div>'},8280:function(i,s,o){var h=o(8281);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},8281:function(i,s,o){(s=o(37)(!1)).push([i.i,".entity-description-header {\n\tpadding: 10px 0;\n}\n.matched-entities-table-view .actionable-row td {\n\tcolor: #006eaa; /* theme.linkColor */\n}\n.matched-entities-table-view .actionable-row td:hover {\n\ttext-decoration: underline;\n}\n.matched-entities-table-view table {\n\tmargin-top: 10px;\n}\n.matched-entities-table-view .count-container {\n\tdisplay: inline;\n}\n.show-warning-message-container {\n\twidth: max-content;\n}\n.fill-in-empty-rule-message-container {\n\tmargin-left: 10px;\n}\n",""]),i.exports=s},8282:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(2998)),y=v.default.extend({tagName:"div",className:v.default.prototype.className+" service-definition-settings-content-view"});s.default=y,i.exports=s.default},8283:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(28)),y=o(5),_=h(o(2054)),S=h(o(8284)),T=_.default.extend({initialize:function initialize(i){this.service=i.service||null,this.globalTeamData=i.globalTeamData||{},this.servicesCollectionData=i.servicesCollectionData||[],this.isReadOnly=i.isReadOnly||!1,this.children={views:{},controls:{}},this.children.views.dependencyView=new S.default({globalTeamData:this.globalTeamData,servicesCollectionData:this.servicesCollectionData,service:this.service,isReadOnly:this.isReadOnly})},value:"dependency",label:(0,y.gettext)("Dependency"),render:function render(){return this.$el.html(this.children.views.dependencyView.render().el),this},validate:function validate(i){var s=v.default.Deferred();return i===this&&s.reject(),s.resolve(),s},refreshModel:function refreshModel(){this.children.views.dependencyView.render()},save:function save(){return this.children.views.dependencyView?this.children.views.dependencyView.save():v.default.Deferred().resolve()}});s.default=T,i.exports=s.default},8284:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(15)),y=h(o(8285)),_=v.default.View.extend({initialize:function initialize(i){this.service=i.service,v.default.View.prototype.initialize.apply(this,arguments),this.dependingMainBodyView=new y.default({globalTeamData:i.globalTeamData,servicesCollectionData:i.servicesCollectionData,service:this.service,isReadOnly:i.isReadOnly})},render:function render(){return this.$el.html(""),this.$el.append(this.dependingMainBodyView.render().el),this},remove:function remove(){return this.dependingMainBodyView.remove(),v.default.View.prototype.remove.apply(this,arguments)}});s.default=_,i.exports=s.default},8285:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=o(49),y=h(o(28)),_=h(o(15)),S=h(o(0)),T=h(o(36)),x=h(o(70)),R=h(o(198)),P=o(5),L=o(149),N=o(1292),V=o(185),j=h(o(8286)),W=h(o(79)),K=h(o(114)),U=h(o(968)),Y=h(o(52)),$=h(o(8287)),X=h(o(8289)),Z=h(o(8290));o(8291);var ee=(0,v.template)(Z.default,null,{variable:"vars"}),te=_.default.View.extend({initialize:function initialize(i){this.service=i.service,this.globalTeamData=i.globalTeamData,this.servicesCollectionData=i.servicesCollectionData,this.children={controls:{},views:{}},this.isReadOnly=i.isReadOnly||!1,this.hasCycles=!1,_.default.View.prototype.initialize.apply(this,arguments),this.children.controls.removeDependencyButton=new W.default({dataTestItsi:"remove-selected-dependencies-button",disabled:!0,label:(0,P.gettext)("Remove selected dependencies"),onClick:this._removeSelectedDependencies.bind(this),style:{float:"left"}}),this.children.controls.addDependencyButton=new W.default({appearance:"primary",dataTestItsi:"add-dependencies-button",label:(0,P.gettext)("Add dependencies"),onClick:this._addDependencies.bind(this),wrapperStyle:"float:right"}),this.selectedServices=[]},_loadDependencies:function _loadDependencies(){this.serviceObjs=this.servicesCollectionData;var i=null;this.service.get("sec_grp")!==L.GLOBAL_TEAM_KEY?(this.teamModel=new U.default({_key:this.service.get("sec_grp")}),i=this.teamModel.fetch()):(this.teamModel=new U.default(this.globalTeamData),i=y.default.Deferred().resolve()),i.done(()=>{this._renderDependencies()}).fail((function(){console.error("Could not fetch the team model.")}))},_buildDependencyCollection:function _buildDependencyCollection(){this.dependencyCollection=new _.default.Collection,this.dependencyCollection.comparator=function(i){return i.get("title")},this.dependencyCollection.sort();for(var i=this.service.get("services_depends_on"),s=0;s<i.length;++s){var o=i[s],h=o.serviceid,y=(0,v.findWhere)(this.serviceObjs,{_key:h});if(y)for(var S=y.kpis,T=o.kpis_depending_on,x=0;x<T.length;++x){var R=T[x],P=(0,v.findWhere)(S,{_key:R});P&&this.dependencyCollection.add({serviceId:h,serviceTitle:y.title,_key:R,title:P.title})}}},onRequestToggle:function onRequestToggle(i){var s=this.selectedServices.map(i=>i.kpiId).indexOf(i.kpiId);s>-1?this.selectedServices.splice(s,1):this.selectedServices.push(i),this.updateRemoveButton(),this._createDependencyTable()},onRequestToggleAllRows:function onRequestToggleAllRows(i){0===this.selectedServices.length||i.length!==this.selectedServices.length?this.selectedServices=i:this.selectedServices=[],this.updateRemoveButton(),this._createDependencyTable()},updateRemoveButton:function updateRemoveButton(){var i,s,o,h,v,y;this.selectedServices&&0!==this.selectedServices.length?null===(i=this.children)||void 0===i||null===(s=i.controls)||void 0===s||null===(o=s.removeDependencyButton)||void 0===o||o.enable():null===(h=this.children)||void 0===h||null===(v=h.controls)||void 0===v||null===(y=v.removeDependencyButton)||void 0===y||y.disable()},_removeSelectedDependencies:function _removeSelectedDependencies(){if(this.selectedServices&&0!==this.selectedServices.length){for(var i=this.service.get("services_depends_on"),s=0;s<this.selectedServices.length;++s){var o=this.selectedServices[s],h=(0,x.default)(i,(function(i){return o.serviceId===i.serviceid}));h?(h.kpis_depending_on=(0,R.default)(h.kpis_depending_on,o.kpiId),Object.prototype.hasOwnProperty.call(h,"overloaded_urgencies")&&Object.prototype.hasOwnProperty.call(h,o.kpiId)&&delete h.overloaded_urgencies[o.kpiId],0===h.kpis_depending_on.length&&(i=(0,R.default)(i,(0,v.findWhere)(i,{serviceid:o.serviceId})))):console.log("Could not find service dependencies configured on service")}this.service.set("services_depends_on",i),this.service.trigger("changeDependencies"),this.service.trigger("change",this.service),this.selectedServices=[],this.updateRemoveButton(),this._renderDependencies()}},_checkIfThereWillBeCycles:function _checkIfThereWillBeCycles(i,s){var o=this.service.get("services_depends_on")||[],h={};o.forEach(i=>{h[i.serviceid]=!0}),s.forEach(i=>{h[i.get("serviceId")]=!0});var v=Object.keys(h).map(i=>({serviceid:i})),y=[{_key:i,title:this.service.get("title"),services_depends_on:v}],_={filter:JSON.stringify([i]),services:JSON.stringify(y)};return(0,N.retrieveServiceTree)(_)},_createDependencyTable:function _createDependencyTable(){var i=this.$el.find(".service-dep-body-table");i.length&&(T.default.unmountComponentAtNode(i.get(0)),T.default.render(S.default.createElement(Y.default,null,S.default.createElement(j.default,{isReadOnly:this.isReadOnly,serviceData:this.dependencyCollection,onRequestToggle:this.onRequestToggle.bind(this),onRequestToggleAllRows:this.onRequestToggleAllRows.bind(this),selectedRows:this.selectedServices})),i.get(0)))},_createWarningModal:function _createWarningModal(){var i=(0,y.default)('<div class="service-analyzer-react-message-banner"></div>');return T.default.unmountComponentAtNode(i.get(0)),T.default.render(S.default.createElement(Y.default,null,S.default.createElement(X.default,{handleSaveDependencies:this._saveDependencies.bind(this),newDependentServices:this._newDependencies,thisService:this.service.get("title")})),i.get(0)),i},_saveDependencies:function _saveDependencies(){for(var i=this.service.get("services_depends_on"),s=0;s<this._newDependencies.length;++s){var o=this._newDependencies[s].get("serviceId"),h=this._newDependencies[s].get("_key"),v=(0,x.default)(i,(function(i){return o===i.serviceid}));if(v)(0,x.default)(v.kpis_depending_on,(function(i){return i===h}))||v.kpis_depending_on.push(h);else v={serviceid:o,kpis_depending_on:[h]},i.push(v)}this.service.set("services_depends_on",i),this.service.trigger("changeDependencies"),this.service.trigger("change"),this._renderDependencies()},_addDependenciesImpl:function _addDependenciesImpl(){this._checkIfThereWillBeCycles(this.service.get("_key"),this._newDependencies).then(i=>i.data).then(i=>{if(this.hasCycles=(0,V.serviceTopologyHasCycles)(i),this.hasCycles){var s=this._createWarningModal();this.$el.append(s)}else this._saveDependencies()}).catch(()=>{})},_renderDependencies:function _renderDependencies(){this._buildDependencyCollection(),this.$el.html(ee({isReadOnly:this.isReadOnly},{variable:"vars"})),this.$(".service-dep-header-controls").append(this.children.controls.removeDependencyButton.render().$el),this.$(".service-dep-header-controls").append(this.children.controls.addDependencyButton.render().$el),this._createDependencyTable(),this.delegateEvents()},render:function render(){var i=new K.default({content:(0,P.gettext)("Loading service dependencies..."),dataTestItsi:"service-dependencies-loading-message",type:"info",style:{margin:10}});return this.$el.html(i.render().$el),this._loadDependencies(),this},_addDependencies:function _addDependencies(){var i=new $.default({blockedServiceID:this.service.get("_key"),serviceObjs:this.serviceObjs,teamModel:this.teamModel,onHiddenRemove:!0});this.listenTo(i,"dependenciesadded",(function(i){this._newDependencies=i,this._addDependenciesImpl()})),(0,y.default)("body").append(i.render().el),i.show()}});s.default=te,i.exports=s.default},8286:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.getDependenciesCountLabel=s.default=s.columnsData=s.cellData=void 0;var v,y,_,S=h(o(9)),T=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),x=h(o(2)),R=h(o(3)),P=h(o(33)),L=h(o(152)),N=h(o(104)),V=o(5),j=o(16),W=h(o(789)),K=o(25),U=o(161);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}var Y=[{dataTestItsi:"service-dependency-body-table-title-column-header",name:(0,V.gettext)("Title")},{dataTestItsi:"service-dependency-body-table-service-column-header",name:(0,V.gettext)("Service")}];s.columnsData=Y;var $=[{dataTestItsi:"service-dependency-body-table-title-cell",stringValueDataTestItsi:"service-dependency-body-table-title",stringValueTooltipDataTestItsi:"service-dependency-body-table-title-tooltip"},{dataTestItsi:"service-dependency-body-table-service-cell",stringValueDataTestItsi:"service-dependency-body-table-service",stringValueTooltipDataTestItsi:"service-dependency-body-table-service-tooltip"}];s.cellData=$;var X=R.default.div(v||(v=(0,S.default)(["\n line-height: 32px;\n margin-bottom: 5px;\n"]))),Z=R.default.div(y||(y=(0,S.default)(["\n float: right;\n"]))),ee=R.default.div(_||(_=(0,S.default)(["\n display: inline;\n"]))),getDependenciesCountLabel=i=>(0,j.sprintf)((0,K.ungettext)("%(totalCount)d Dependency","%(totalCount)d Dependencies",i.length),{totalCount:i.length});s.getDependenciesCountLabel=getDependenciesCountLabel;function ServiceDependencyTable(i){var{isReadOnly:s,serviceData:o,onRequestToggle:h,onRequestToggleAllRows:v,selectedRows:y}=i,_=o.length,S=Math.ceil(_/20),[x,R]=(0,T.useState)(1),handleToggle=(i,s)=>{var o={serviceId:s.get("serviceId"),kpiId:s.get("_key")};h(o)};if(o&&o.length){var j=o.models.slice(20*(x-1),20*x),K=s?{"data-test-itsi":"service-kpis-dependencies-table",stripeRows:!0}:{"data-test-itsi":"service-kpis-dependencies-table",onRequestToggleAllRows:()=>{var i=o.models.map(i=>({serviceId:i.get("serviceId"),kpiId:i.get("_key")}));v(i)},rowSelection:0===y.length?U.SELECTED_NONE:o&&y.length===o.models.length?U.SELECTED_ALL:U.SELECTED_SOME,stripeRows:!0};return T.default.createElement(T.default.Fragment,null,T.default.createElement(X,null,T.default.createElement(ee,{"data-test-itsi":"service-dependency-body-table-count"},getDependenciesCountLabel(o)),S>1&&T.default.createElement(Z,null,T.default.createElement(L.default,{"data-test-itsi":"service-dependency-body-table-paginator",current:x,onChange:(i,s)=>{var{page:o}=s;R(o)},totalPages:S}))),T.default.createElement(N.default,K,T.default.createElement(N.default.Head,{"data-test-itsi":"service-dependency-body-table-head"},Y.map(i=>T.default.createElement(N.default.HeadCell,{"data-test-itsi":i.dataTestItsi,key:i.dataTestItsi},i.name))),T.default.createElement(N.default.Body,null,j.map(i=>{var o=y.map(i=>i.kpiId).indexOf(i.get("_key"))>-1,h=s?{"data-test-itsi":"service-dependency-body-table-row",key:"".concat(i.get("serviceId"),"-").concat(i.get("_key"),"-row")}:{"data-test-itsi":"service-dependency-body-table-row",data:i,key:"".concat(i.get("serviceId"),"-").concat(i.get("_key"),"-row"),onRequestToggle:handleToggle,selected:o};return T.default.createElement(N.default.Row,h,T.default.createElement(N.default.Cell,{"data-test-itsi":$[0].dataTestItsi,key:"".concat(i.get("serviceId"),"-").concat(i.get("_key"),"-kpi")},T.default.createElement(W.default,{dataTestItsi:$[0].stringValueDataTestItsi,maxWidth:500,tooltipDataTestItsi:$[0].stringValueTooltipDataTestItsi,value:i.get("title")})),T.default.createElement(N.default.Cell,{"data-test-itsi":$[1].dataTestItsi,key:"".concat(i.get("serviceId"),"-").concat(i.get("_key"),"-service")},T.default.createElement(W.default,{dataTestItsi:$[1].stringValueDataTestItsi,maxWidth:500,tooltipDataTestItsi:$[1].stringValueTooltipDataTestItsi,value:i.get("serviceTitle")})))}))))}return T.default.createElement(P.default,{"data-test-itsi":"no-dependencies-info-message",type:"info"},(0,V.gettext)("No dependencies defined."))}ServiceDependencyTable.propTypes={isReadOnly:x.default.bool.isRequired,serviceData:x.default.object,onRequestToggle:x.default.func.isRequired,onRequestToggleAllRows:x.default.func.isRequired,selectedRows:x.default.array},ServiceDependencyTable.defaultProps={serviceData:{},selectedRows:[]};var te=ServiceDependencyTable;s.default=te},8287:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(28)),y=h(o(15)),_=h(o(0)),S=h(o(36)),T=h(o(42)),x=h(o(182)),R=h(o(236)),P=o(5),L=h(o(1831)),N=o(76),V=o(119),j=h(o(8288)),W=o(2746),K=h(o(150)),U=h(o(114)),Y=h(o(1325)),$=h(o(79)),X=h(o(52));o(2065);var Z=K.default.extend({attributes:v.default.extend({},K.default.DEFAULT_ATTRIBUTES,{"data-test-itsi":"add-service-dependency-modal"}),className:"add-service-dependency-modal fetch-list-on-scroll-modal "+K.default.CLASS_NAME+" "+K.default.CLASS_MODAL_WIDE,initialize:function initialize(i){K.default.prototype.initialize.apply(this,arguments),this.blockedServiceID=i.blockedServiceID||[],this.teamModel=i.teamModel,this.layout=new Y.default({sidebarContent:this.sidebarTemplate,mainContent:this.mainTemplate});var s=y.default.Model.extend({idAttribute:"_key"}),o=y.default.Collection.extend({model:s});this.kpiCollection=new o,this.selectedKPIs=[],this.children.cancelButton=new $.default({dataDismiss:"modal",dataTestItsi:"service-dependency-modal-cancel-button",label:(0,P.gettext)("Cancel")}),this.children.saveButton=new $.default({appearance:"primary",dataTestItsi:"service-dependency-modal-primary-button",label:(0,P.gettext)("Done"),onClick:this._saveKpis.bind(this),style:{marginLeft:10}})},_createScrollableServiceList:function _createScrollableServiceList(i){var s={_key:{$ne:this.blockedServiceID}},o=(0,v.default)('<div class="field-value-react-dropdown" data-test-itsi="add-service-dependency-list"></div>');return S.default.unmountComponentAtNode(o.get(0)),S.default.render(_.default.createElement(X.default,null,_.default.createElement(L.default,{objectsCollectionCountPath:"".concat(V.baseURL,"/count"),objectsCollectionPath:V.baseURL,handleItemSelect:this.handleServiceSelect.bind(this),handleItemDeselect:this.handleServiceDeselect.bind(this),filterPlaceholder:(0,P.gettext)("Filter services"),fields:"title,_key,kpis.title,kpis._key,kpis.type,services_depending_on_me,services_depends_on",addedFilters:[i,s],searchBarStyle:{width:"250px"},isSearchBarInline:!1,itemTitle:N.OBJECT_NAMES})),o.get(0)),o},onRequestToggle:function onRequestToggle(i){var s=this.selectedKPIs.indexOf(i);s>-1?this.selectedKPIs.splice(s,1):this.selectedKPIs.push(i),this.renderAddKPIDependencyTable()},onRequestToggleAllRows:function onRequestToggleAllRows(i){0===this.selectedKPIs.length||(0,x.default)(i,this.selectedKPIs).length!==this.selectedKPIs.length?this.selectedKPIs=this.kpiCollection.models.map(i=>i.get("_key")):this.selectedKPIs=[],this.renderAddKPIDependencyTable()},renderAddKPIDependencyTable:function renderAddKPIDependencyTable(){if(this.$(".kpi-main-list").length){S.default.unmountComponentAtNode(this.$(".kpi-main-list").get(0));var i=this.kpiCollection.models.map(i=>({_key:i.get("_key"),description:i.get("description"),title:i.get("title"),serviceTitle:i.get("serviceTitle")}));S.default.render(_.default.createElement(X.default,null,_.default.createElement(j.default,{kpiData:i,onRequestToggle:this.onRequestToggle.bind(this),onRequestToggleAllRows:this.onRequestToggleAllRows.bind(this),selectedKPIs:this.selectedKPIs})),this.$(".kpi-main-list").get(0))}},handleServiceSelect:function handleServiceSelect(i){for(var s=i.kpis,o=0;o<s.length;o++)this.kpiCollection.add({serviceId:i._key,serviceTitle:i.title,_key:s[o]._key,title:s[o].title,description:s[o].description});this.renderAddKPIDependencyTable()},handleServiceDeselect:function handleServiceDeselect(i){var s=[];i.kpis.forEach((function(i){i.type===N.KPI_TYPES.PRIMARY&&s.push(i)})),s.forEach(i=>{var s=this.selectedKPIs.indexOf(i._key);s>-1&&this.selectedKPIs.splice(s,1)});var o=i._key,h=this.kpiCollection.where({serviceId:o});this.kpiCollection.remove(h),this.renderAddKPIDependencyTable()},_saveKpis:function _saveKpis(){if(0===this.selectedKPIs.length)return this.children.errorMessage?this.children.errorMessage.show():this.children.errorMessage=new U.default({content:(0,P.gettext)("Must select at least one KPI."),dataTestItsi:"service-dependency-none-selected-error-message",isInline:!0,type:"error"}),void this.$(K.default.FOOTER_SELECTOR).prepend(this.children.errorMessage.render().$el);this.children.errorMessage&&this.children.errorMessage.hide();var i=[];(0,T.default)(this.selectedKPIs,function(s){var o=this.kpiCollection.where({_key:s});o&&o.length>0&&i.push(o[0])}.bind(this)),this.trigger("dependenciesadded",i),this.hide(),this.remove()},render:function render(){var i,s=[];(0,T.default)(this.teamModel.get("parents"),i=>{(0,R.default)(i)&&s.push(i._key)}),i=(0,W.createJSONFilterTeam)(this.teamModel.get("_key"),s),this.fetchServiceObjectView=this._createScrollableServiceList(i),this._renderModal()},_renderModal:function _renderModal(){return this.$el.html(K.default.TEMPLATE),this.$(K.default.HEADER_TITLE_SELECTOR).html((0,P.gettext)("Add dependencies")),this.$(K.default.BODY_SELECTOR).append(this.layout.render().$el),this.$(".sidebar-layout-header").hide(),this.$(".service-list").append(this.fetchServiceObjectView),this.renderAddKPIDependencyTable(),this.$(K.default.FOOTER_SELECTOR).append(this.children.cancelButton.render().$el),this.$(K.default.FOOTER_SELECTOR).append(this.children.saveButton.render().$el),this},sidebarTemplate:'<div class="service-list"></div>',mainTemplate:'<div class="kpi-main-list"></div>'});s.default=Z,i.exports=s.default},8288:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=s.columnsData=s.cellData=void 0;var v,y=h(o(9)),_=h(o(0)),S=h(o(2)),T=h(o(3)),x=h(o(33)),R=h(o(104)),P=h(o(99)),L=o(5),N=o(161),V=(0,T.default)(R.default)(v||(v=(0,y.default)(["\n width: 100%;\n"]))),j=[{dataTestItsi:"add-service-dependencies-table-kpi-title-column-header",label:(0,L.gettext)("KPI Title")},{dataTestItsi:"add-service-dependencies-table-kpi-service-title-column-header",label:(0,L.gettext)("Service Title")}];s.columnsData=j;var W=[{dataTestItsi:"add-service-dependencies-table-kpi-title-cell"},{dataTestItsi:"add-service-dependencies-table-kpi-service-title-cell"}];s.cellData=W;function AddKPIDependencyTable(i){var{kpiData:s,onRequestToggle:o,onRequestToggleAllRows:h,selectedKPIs:v}=i,onRequestToggleInternal=(i,s)=>{o(s)},limitCellContentSize=(i,s)=>!i||i.length<=25?i:_.default.createElement(P.default,{"data-test-itsi":s,content:i,key:"".concat(i,"-").concat(s)},"".concat(i.slice(0,25),"..."));return s&&s.length?_.default.createElement(V,{"data-test-itsi":"add-service-dependencies-table",stripeRows:!0,onRequestToggleAllRows:()=>{h(s.map(i=>i._key))},rowSelection:0===v.length?N.SELECTED_NONE:v.length===s.length?N.SELECTED_ALL:N.SELECTED_SOME},_.default.createElement(R.default.Head,{"data-test-itsi":"add-service-dependencies-table-head"},j.map(i=>_.default.createElement(R.default.HeadCell,{"data-test-itsi":i.dataTestItsi,key:i.dataTestItsi},i.label))),_.default.createElement(R.default.Body,null,s.map(i=>_.default.createElement(R.default.Row,{"data-test-itsi":"add-service-dependencies-table-row",key:"".concat(i._key,"-").concat(i.title,"-row"),onRequestToggle:onRequestToggleInternal,data:i._key,selected:v.indexOf(i._key)>-1},_.default.createElement(R.default.Cell,{"data-test-itsi":W[0].dataTestItsi,key:"".concat(i._key,"-").concat(i.title,"-kpi-title-cell")},limitCellContentSize(i.title,"add-service-dependencies-table-kpi-title-tooltip")),_.default.createElement(R.default.Cell,{"data-test-itsi":W[1].dataTestItsi,key:"".concat(i._key,"-").concat(i.title,"-service-title-cell")},limitCellContentSize(i.serviceTitle,"add-service-dependencies-table-service-title-tooltip")))))):_.default.createElement(x.default,{"data-test-itsi":"add-service-dependencies-table-none-message",type:"info"},(0,L.gettext)("No KPIs to display. Select service(s) on the left panel."))}AddKPIDependencyTable.propTypes={kpiData:S.default.arrayOf(S.default.shape({_key:S.default.string,description:S.default.string,title:S.default.string,serviceTitle:S.default.string})),onRequestToggle:S.default.func.isRequired,onRequestToggleAllRows:S.default.func.isRequired,selectedKPIs:S.default.array},AddKPIDependencyTable.defaultProps={kpiData:[],selectedKPIs:[]};var K=AddKPIDependencyTable;s.default=K},8289:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y=h(o(17)),_=h(o(18)),S=h(o(30)),T=h(o(21)),x=h(o(22)),R=h(o(20)),P=h(o(11)),L=h(o(9)),N=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),V=h(o(2)),j=h(o(3)),W=h(o(107)),K=h(o(33)),U=h(o(39)),Y=o(5);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,R.default)(i);if(s){var v=(0,R.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,x.default)(this,o)}}o(29);var $=(0,j.default)(W.default)(v||(v=(0,L.default)(["\n\twidth: 600px;\n"]))),X={handleSaveDependencies:V.default.func.isRequired,newDependentServices:V.default.array.isRequired,thisService:V.default.string.isRequired},Z=function(i){(0,T.default)(CyclicDependencyWarningModal,i);var s=_createSuper(CyclicDependencyWarningModal);function CyclicDependencyWarningModal(i,o){var h;return(0,y.default)(this,CyclicDependencyWarningModal),h=s.call(this,i,o),(0,P.default)((0,S.default)(h),"handleRequestOpen",()=>{h.setState({open:!0})}),(0,P.default)((0,S.default)(h),"handleRequestClose",()=>{h.setState({open:!1})}),(0,P.default)((0,S.default)(h),"submit",()=>{h.props.handleSaveDependencies(),h.handleRequestClose()}),h.state={open:!0},h}return(0,_.default)(CyclicDependencyWarningModal,[{key:"render",value:function render(){var{thisService:i,newDependentServices:s}=this.props,o=1===s.length?s[0].get("serviceTitle"):s.map((function(i){return i.get("serviceTitle")})).join(", ");return N.default.createElement("div",null,N.default.createElement($,{"data-test-itsi":"cyclic-dependency-warning-modal",onRequestClose:this.handleRequestClose,open:this.state.open},N.default.createElement(W.default.Header,{title:(0,Y.gettext)("Warning"),onRequestClose:this.handleRequestClose}),N.default.createElement(W.default.Body,null,N.default.createElement(K.default,{"data-test-itsi":"cyclic-dependency-warning-message",type:"warning"},(0,Y.gettext)("Adding one or more of")+" ",N.default.createElement("b",null,o)," "+(0,Y.gettext)("as dependent service(s) of")+" ",N.default.createElement("b",null,i)," "+(0,Y.gettext)("will cause a cyclic dependency loop. This could result in miscalculation of the service health score. Do you want to continue adding this dependency?"))),N.default.createElement(W.default.Footer,null,N.default.createElement(U.default,{appearance:"secondary","data-test-itsi":"service-cyclic-dependency-modal-no-button",onClick:this.handleRequestClose,label:(0,Y.gettext)("No")}),N.default.createElement(U.default,{appearance:"primary","data-test-itsi":"service-cyclic-dependency-modal-yes-button",onClick:this.submit,label:(0,Y.gettext)("Yes")}))))}}]),CyclicDependencyWarningModal}(N.Component);Z.propTypes=X;var ee=Z;s.default=ee,i.exports=s.default},8290:function(i,s){i.exports='<div class="service-dep">\n\t<% if (!vars.isReadOnly) { %>\n\t<div class="service-dep-header clearfix">\n\t\t<div class="service-dep-header-controls"></div>\n\t</div>\n\t<% } %>\n\t<div class="service-dep-body">\n\t\t<div class="service-dep-body-table" data-test-itsi="service-dep-body-table-container"></div>\n\t</div>\n</div>'},8291:function(i,s,o){var h=o(8292);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},8292:function(i,s,o){(s=o(37)(!1)).push([i.i,".service-dep-header {\n\tpadding: 10px 10px 10px 0;\n}\n.service-dep-header-controls {\n\tpadding: 10px 20px;\n}\n.service-dep-body {\n\tpadding: 10px 20px;\n}\n.service-dep-footer-controls {\n\tpadding: 10px;\n}",""]),i.exports=s},8293:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=o(5),y=o(76),_=h(o(294)),S=_.default.extend({dataTestItsi:"base-service-pa-tab",initialize:function initialize(i){(i=i||{}).tabId=y.SERVICE_DEFINITION_TABS.PREDICTIVE_ANALYTICS,i.tabLabel=(0,v.gettext)("Predictive Analytics"),_.default.prototype.initialize.call(this,i)}});s.default=S,i.exports=s.default},8294:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(8295)),y=v.default.extend({tagName:"div",className:v.default.prototype.className+" service-definition-predictive-analytics-content-view"});s.default=y,i.exports=s.default},8295:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(28)),y=h(o(15)),_=h(o(0)),S=h(o(36)),T=o(49),x=h(o(309)),R=o(203),P=h(o(52)),L=h(o(8296)),N=h(o(8307));o(8308);var V=(0,T.template)(N.default,null,{variable:"vars"}),j=y.default.View.extend({tagName:"div",className:"predictive-analytics-content-view",initialize:function initialize(i){if(!(i=i||{}).service)throw"Must provide service";this.serviceModelClone=i.service,this.sdDispatcher=i.sdDispatcher,this.isReadOnly=i.isReadOnly||!1,this.prevInfo={},this.currentAlgoSavedModelId=null,this.handleTrainingInProgress=this.handleTrainingInProgress.bind(this),this.saveLoadedInfo=this.saveLoadedInfo.bind(this),this.handleShowPanda=this.handleShowPanda.bind(this),this.setCurrentAlgoSavedModelId=this.setCurrentAlgoSavedModelId.bind(this),this.resetCancel=this.resetCancel.bind(this),this.cancelChanges=!1,this.sdDispatcher&&this.listenTo(this.sdDispatcher,"resetModelOnCancel",this.resetModelOnCancel.bind(this)),y.default.View.prototype.initialize.apply(this,arguments)},callSearchRenderers:function callSearchRenderers(){this.predictiveAnalyticsContent&&this.predictiveAnalyticsContent.executeTrainInputSearches()},handleTrainingInProgress:function handleTrainingInProgress(i){this.sdDispatcher.trigger("modelTraining",i)},resetModelOnCancel:function resetModelOnCancel(){this.cancelChanges=!0},resetCancel:function resetCancel(){this.cancelChanges=!1},handleShowPanda:function handleShowPanda(i){(0,x.default)(i)||(this.$("#svg-object-panda").length&&this.$("#svg-object-panda").remove(),i?this.triggerHappy():this.triggerSad(),setTimeout(function(){this.$("#svg-object-panda").remove()}.bind(this),5e3))},triggerSad:function triggerSad(){this.$el.append(V({backgroundColor:R.backgroundColor,legacyDarkColor:R.legacyDarkColor,syntaxBlue:R.syntaxBlue,syntaxRed:R.syntaxRed},{variable:"vars"})),this.$("#svg-object-panda").attr("class","activepanda"),this.$("#hand").attr("class","wavehand"),this.$("#heart").css({display:"none"}),this.$("#tear").attr("class","tear")},triggerHappy:function triggerHappy(){this.$el.append(V({backgroundColor:R.backgroundColor,legacyDarkColor:R.legacyDarkColor,syntaxBlue:R.syntaxBlue,syntaxRed:R.syntaxRed},{variable:"vars"})),this.$("#svg-object-panda").attr("class","activepanda"),this.$("#lips").attr("class","happypandalips"),this.$("#hand").attr("class","wavehand"),this.$("#tear").css({display:"none"}),this.$("#heart").attr("class","heart")},saveLoadedInfo:function saveLoadedInfo(i,s,o){this.prevInfo={previousModel:i,previousEarliest:s,previousLatest:o}},setCurrentAlgoSavedModelId:function setCurrentAlgoSavedModelId(i){this.currentAlgoSavedModelId=i},render:function render(){return this.contentView=this._createContentView(),this.$el.html(this.contentView),this},_createContentView:function _createContentView(){var i=(0,v.default)('<div class="predictive-analytics-create-view"></div>');S.default.unmountComponentAtNode(i.get(0));var s=void 0!==this.predictiveAnalyticsContent&&!this.cancelChanges;return this.predictiveAnalyticsContent=null,S.default.render(_.default.createElement(P.default,null,_.default.createElement(L.default,{service:this.serviceModelClone,handleTrainingInProgress:this.handleTrainingInProgress,isReadOnly:this.isReadOnly,saveSelectedInfo:this.saveLoadedInfo,savedService:s,prevInfo:this.prevInfo,currentAlgoSavedModelId:this.currentAlgoSavedModelId,handleShowPanda:this.handleShowPanda,setCurrentAlgoSavedModelId:this.setCurrentAlgoSavedModelId,cancelChanges:this.cancelChanges,resetCancel:this.resetCancel,ref:i=>this.predictiveAnalyticsContent=i})),i.get(0)),i},refreshModel:function refreshModel(){this.render()}});s.default=j,i.exports=s.default},8296:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y=h(o(17)),_=h(o(18)),S=h(o(30)),T=h(o(21)),x=h(o(22)),R=h(o(20)),P=h(o(11)),L=h(o(9)),N=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),V=h(o(2)),j=h(o(45)),W=h(o(309)),K=h(o(406)),U=h(o(3)),Y=h(o(665)),$=h(o(725)),X=h(o(87)),Z=h(o(33)),ee=h(o(99)),te=o(40),ie=o(16),ae=o(5),ne=o(77),re=o(1173),se=h(o(8297)),le=h(o(8305)),oe=h(o(8306)),de=o(461);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,R.default)(i);if(s){var v=(0,R.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,x.default)(this,o)}}o(29);var ce=(0,U.default)(Y.default)(v||(v=(0,L.default)(["\n\tcolor: ",";\n\tfont-size: 22px;\n"])),te.variables.infoColor),he=function(i){(0,T.default)(PredictiveAnalyticsCreateMain,i);var s=_createSuper(PredictiveAnalyticsCreateMain);function PredictiveAnalyticsCreateMain(i){var o;(0,y.default)(this,PredictiveAnalyticsCreateMain);for(var h=arguments.length,v=new Array(h>1?h-1:0),_=1;_<h;_++)v[_-1]=arguments[_];return o=s.call(this,i,...v),(0,P.default)((0,S.default)(o),"componentDidMount",()=>{o.checkMLTKPromise.then(()=>{o.setState({predictiveAnalyticsLoadState:de.LOAD_STATE.NORMAL})}).catch(()=>{o.setState({predictiveAnalyticsLoadState:de.LOAD_STATE.MISSING})}),o.props.cancelChanges&&!(0,W.default)(o.props.currentAlgoSavedModelId)?(o.updateTrainedModelId(o.props.currentAlgoSavedModelId),o.setTestPeriods(o.props.prevInfo.previousEarliest,o.props.prevInfo.previousLatest),o.props.resetCancel()):(0,K.default)(o.props.prevInfo)>0&&o.props.prevInfo.previousModel&&o.props.savedService&&(o.updateTrainedModelId(o.props.prevInfo.previousModel),o.setTestPeriods(o.props.prevInfo.previousEarliest,o.props.prevInfo.previousLatest))}),(0,P.default)((0,S.default)(o),"executeTrainInputSearches",()=>{o.setState({runTrainInputSearches:!0})}),(0,P.default)((0,S.default)(o),"handleTrainInputSearchesDone",()=>{o.setState({runTrainInputSearches:!1})}),(0,P.default)((0,S.default)(o),"handleModelCreation",(i,s,h,v,y,_,S,T,x,R,P,L)=>{s=s||"now",o.setState({testPeriodEarliest:i,testPeriodLatest:s,trainingSplit:h,testDataSplitMessage:(0,ie.sprintf)((0,ae.gettext)("%d percent of the data in the selected time period will be used for testing."),100-h),disableWhileTraining:!1,trainedModelId:v,modelType:y,trainTestWorkflowStep:_,next30AverageHealthScore:S,next30WorstSeverity:x,next30AverageSeverity:T,next30MinHealthScore:R,createModelSearch:P,service:L})}),(0,P.default)((0,S.default)(o),"handleTrainError",()=>{o.setState({trainTestWorkflowStep:de.TRAIN_TEST_WORKFLOW_STEP.TEST,testDataSplitMessage:de.TEST_DATA_SPLIT_MESSAGES.TEST_ALL_DATA,disableWhileTraining:!1})}),(0,P.default)((0,S.default)(o),"handleTrainTestWorkflowStepUpdate",i=>{o.setState({trainTestWorkflowStep:i})}),(0,P.default)((0,S.default)(o),"updateTestTimePickerAttributes",(i,s,h)=>{o.setState({testPeriodEarliest:i,testPeriodLatest:s,testDataSplitMessage:h})}),(0,P.default)((0,S.default)(o),"updateTrainedModelId",i=>{var s={};o.state.testDataSplitMessage!==de.TEST_DATA_SPLIT_MESSAGES.TEST_ALL_DATA&&(s.testDataSplitMessage=de.TEST_DATA_SPLIT_MESSAGES.TEST_ALL_DATA);var h=(0,de.getAlgorithmTypeFromModelId)(i);s.modelType=(0,j.default)(h)?de.ALGO_TYPES.REGRESSION:h.type,s.trainedModelId=i,o.setState(s)}),(0,P.default)((0,S.default)(o),"handleTrainProgress",i=>{i&&o.setState({testDataSplitMessage:de.TEST_DATA_SPLIT_MESSAGES.TEST_NO_DATA,disableWhileTraining:!0,trainedModelId:""})}),(0,P.default)((0,S.default)(o),"setMissingModels",(i,s)=>{de.ALGO_TYPES.REGRESSION===i?o.setState({missingRegressionModels:s}):de.ALGO_TYPES.CLASSIFICATION===i&&o.setState({missingClassificationModels:s})}),(0,P.default)((0,S.default)(o),"setTestPeriods",(i,s)=>{o.setState({testPeriodEarliest:i,testPeriodLatest:s})}),(0,P.default)((0,S.default)(o),"renderPredictiveAnalyticsState",()=>{var i=N.default.createElement("div",null),s=100-o.state.trainingSplit,h=(0,ae.gettext)("The predictions and forecasts displayed here are based on the underlying data that is passed to the algorithms for training purposes. Because historical accuracy is not a guarantee of future accuracy, the predictions might not always be 100% accurate. Please ensure that a human validates the accuracy of the predictions before acting on them.");switch(o.state.predictiveAnalyticsLoadState){case de.LOAD_STATE.FIRST_LOAD:break;case de.LOAD_STATE.NORMAL:i=N.default.createElement("div",null,N.default.createElement("div",{"data-test-itsi":"pa-create-main-description",style:{padding:"20px 20px 10px 20px",marginBottom:0}},(0,ae.gettext)("ITSI Predictive Analytics uses machine learning algorithms to predict the future health score of your service. You can train and test different machine learning algorithms to determine which one will give the most accurate prediction. Expand the INSTRUCTIONS section to get started."),N.default.createElement(ee.default,{"data-test-itsi":"pa-create-main-tooltip",style:{paddingLeft:"10px"},content:N.default.createElement("span",{style:de.TOOLTIP_CONTENT_STYLE},h)},N.default.createElement(ce,null))),N.default.createElement($.default,{"data-test-itsi":"pa-create-main-collapsible-panel",title:(0,ae.gettext)("INSTRUCTIONS"),style:{padding:"0 20px 20px 20px"}},N.default.createElement(oe.default,{isReadOnly:o.props.isReadOnly,serviceId:o.props.service.get("_key")})),o.props.isReadOnly&&N.default.createElement(Z.default,{"data-test-itsi":"pa-write-access-info-message",type:"info",style:{display:"inline-block",marginLeft:"20px"}},(0,ae.gettext)("You must have write access to this service to train models.")),!1===o.props.isReadOnly&&N.default.createElement(le.default,{isValidTimePeriod:de.isValidTimePeriod,service:o.props.service,runTrainInputSearches:o.state.runTrainInputSearches,handleTrainInputSearchesDone:o.handleTrainInputSearchesDone,timePickerAttributes:ne.TIME_PICKER_ATTRIBUTES,handleModelCreation:o.handleModelCreation,handleTrainProgress:o.handleTrainProgress,trainingSplit:o.state.trainingSplit,handleTrainTestWorkflowStepUpdate:o.handleTrainTestWorkflowStepUpdate,handleTrainError:o.handleTrainError,handleTrainingInProgress:o.props.handleTrainingInProgress,savedService:o.props.savedService,setCurrentAlgoSavedModelId:o.props.setCurrentAlgoSavedModelId,cancelChanges:o.props.cancelChanges,missingRegressionModels:o.state.missingRegressionModels,missingClassificationModels:o.state.missingClassificationModels,setMissingModels:o.setMissingModels}),N.default.createElement(X.default,{"data-test-itsi":"test-a-model-heading",level:2,style:{paddingLeft:"20px",paddingTop:"12px",marginTop:"0"},id:"test-a-model"},(0,ae.gettext)("Test a Model")),N.default.createElement(se.default,{isValidTimePeriod:de.isValidTimePeriod,service:o.props.service,timePickerAttributes:ne.TIME_PICKER_ATTRIBUTES,testPeriodEarliest:o.state.testPeriodEarliest,testPeriodLatest:o.state.testPeriodLatest,testDataSplit:s,testDataSplitMessage:o.state.testDataSplitMessage,trainedModelId:o.state.trainedModelId,modelAlgorithmType:o.state.modelType,updateTestTimePickerAttributes:o.updateTestTimePickerAttributes,updateTrainedModelId:o.updateTrainedModelId,trainTestWorkflowStep:o.state.trainTestWorkflowStep,handleTrainTestWorkflowStepUpdate:o.handleTrainTestWorkflowStepUpdate,next30AverageHealthScore:o.state.next30AverageHealthScore,next30WorstSeverity:o.state.next30WorstSeverity,next30AverageSeverity:o.state.next30AverageSeverity,next30MinHealthScore:o.state.next30MinHealthScore,createModelSearch:o.state.createModelSearch,disableWhileTraining:o.state.disableWhileTraining,isReadOnly:o.props.isReadOnly,saveSelectedInfo:o.props.saveSelectedInfo,didSaveService:o.props.savedService,handleShowPanda:o.props.handleShowPanda,cancelChanges:o.props.cancelChanges,missingRegressionModels:o.state.missingRegressionModels,missingClassificationModels:o.state.missingClassificationModels,setMissingModels:o.setMissingModels}));break;case de.LOAD_STATE.MISSING:i=(0,de.loadMissingMLTKElement)()}return i}),o.checkMLTKPromise=(0,re.retrieveMLToolkitApp)(),o.state={service:o.props.service,runTrainInputSearches:!1,predictiveAnalyticsLoadState:de.LOAD_STATE.FIRST_LOAD,testPeriodEarliest:"-24h@h",trainingSplit:70,testDataSplitMessage:de.TEST_DATA_SPLIT_MESSAGES.TEST_ALL_DATA,trainedModelId:"",modelType:de.ALGO_TYPES.REGRESSION,trainTestWorkflowStep:de.TRAIN_TEST_WORKFLOW_STEP.TEST,next30AverageHealthScore:null,next30WorstSeverity:null,next30AverageSeverity:null,next30MinHealthScore:null,createModelSearch:"",disableWhileTraining:!1,missingRegressionModels:[],missingClassificationModels:[]},o}return(0,_.default)(PredictiveAnalyticsCreateMain,[{key:"render",value:function render(){return N.default.createElement("div",null,this.renderPredictiveAnalyticsState())}}]),PredictiveAnalyticsCreateMain}(N.Component);(0,P.default)(he,"propTypes",{service:V.default.object.isRequired,handleTrainingInProgress:V.default.func.isRequired,isReadOnly:V.default.bool.isRequired,saveSelectedInfo:V.default.func.isRequired,savedService:V.default.bool.isRequired,prevInfo:V.default.object.isRequired,handleShowPanda:V.default.func,currentAlgoSavedModelId:V.default.string,setCurrentAlgoSavedModelId:V.default.func.isRequired,cancelChanges:V.default.bool.isRequired,resetCancel:V.default.func.isRequired}),(0,P.default)(he,"defaultProps",{handleShowPanda:function handleShowPanda(){},currentAlgoSavedModelId:null});var ue=he;s.default=ue,i.exports=s.default},8297:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_,S,T=h(o(17)),x=h(o(18)),R=h(o(30)),P=h(o(21)),L=h(o(22)),N=h(o(20)),V=h(o(11)),j=h(o(9)),W=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),K=h(o(2)),U=h(o(403)),Y=h(o(45)),$=h(o(105)),X=h(o(3)),Z=h(o(455)),ee=h(o(325)),te=h(o(56)),ie=h(o(33)),ae=o(5),ne=h(o(96)),re=o(106),se=o(25),le=o(154),oe=o(1591),de=h(o(723)),ce=o(129),he=h(o(2756)),ue=h(o(2757)),pe=h(o(3987)),fe=h(o(1967)),ge=h(o(8298)),me=h(o(8299)),ve=h(o(8300)),ye=h(o(8301)),_e=h(o(8303)),Se=o(461);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,N.default)(i);if(s){var v=(0,N.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,L.default)(this,o)}}o(29);var be=X.default.div(v||(v=(0,j.default)(["\n\tpadding: 0 20px 10px;\n"]))),Te=X.default.div(y||(y=(0,j.default)(["\n\tdisplay:inline-block;\n\tpadding: 0 10px;\n"]))),Ee=(0,X.default)(ie.default)(_||(_=(0,j.default)(["\n\tdisplay: inline-block;\n"]))),ke=(0,X.default)(te.default)(S||(S=(0,j.default)(["\n\twidth: 150px;\n\tdisplay: inline-block;\n\tmargin-right: 10px;\n"]))),Ce=function(i){(0,P.default)(PredictiveAnalyticsTestPane,i);var s=_createSuper(PredictiveAnalyticsTestPane);function PredictiveAnalyticsTestPane(i){var o;(0,T.default)(this,PredictiveAnalyticsTestPane);for(var h=arguments.length,v=new Array(h>1?h-1:0),y=1;y<h;y++)v[y-1]=arguments[y];return o=s.call(this,i,...v),(0,V.default)((0,R.default)(o),"updateVisualizationsWithTrainedData",i=>{o.resetVisualizations(),o.props.modelAlgorithmType===Se.ALGO_TYPES.CLASSIFICATION?(o.setState({predictedHealthProgress:le.SEARCH_PROGRESS.COMPLETED,testResultsSearch:o.props.createModelSearch,averagePredictedSeverityData:o.props.next30AverageSeverity,worstPredictedSeverityData:o.props.next30WorstSeverity,accuracyData:i.get("accuracy"),precisionData:i.get("precision"),recallData:i.get("recall"),f1Data:i.get("f1_score"),testDataSplit:o.props.testDataSplit}),o.performConfusionMatrixSearch(o.serviceId,o.props.trainedModelId,o.props.testPeriodEarliest,o.props.testPeriodLatest)):(o.setState({predictedHealthProgress:le.SEARCH_PROGRESS.COMPLETED,rsquaredData:i.get("rSquared"),rmseData:i.get("RMSE"),averagePredictedHealthData:o.props.next30AverageHealthScore,worstPredictedHealthData:o.props.next30MinHealthScore,testResultsSearch:o.props.createModelSearch,testDataSplit:o.props.testDataSplit}),o.performHealthScoreComparisonSearch(o.serviceId,o.props.trainedModelId,o.props.testPeriodEarliest,o.props.testPeriodLatest),o.performResidualErrorSearch(o.serviceId,o.props.trainedModelId,o.props.testPeriodEarliest,o.props.testPeriodLatest))}),(0,V.default)((0,R.default)(o),"convertDataToVizFormat",i=>{if((0,Y.default)(i.results))return[];var s=i.fields,o=i.results,h={};(0,U.default)(s,(i,s)=>{h[s]=i.name});var v=s.length,y=[];return(0,U.default)(o,i=>{for(var s=0;s<v;s++){y[s]||(y[s]=[]);var o=i[h[s]];y[s].push((0,$.default)(o)?"":o)}}),y}),(0,V.default)((0,R.default)(o),"triggerVisualizationSearches",(i,s,h,v,y)=>{o.performHealthScorePredictionSearch(i,s,h,v,y),y===Se.ALGO_TYPES.CLASSIFICATION?o.performConfusionMatrixSearch(i,s,h,v):(o.performHealthScoreComparisonSearch(i,s,h,v),o.performResidualErrorSearch(i,s,h,v))}),(0,V.default)((0,R.default)(o),"handleTimeRangeChange",(i,s)=>{o.props.testPeriodEarliest===i&&o.props.testPeriodLatest===s||o.props.trainedModelId&&(o.resetVisualizations(),o.triggerVisualizationSearches(o.serviceId,o.props.trainedModelId,i,s,o.props.modelAlgorithmType)),o.props.updateTestTimePickerAttributes(i,s,Se.TEST_DATA_SPLIT_MESSAGES.TEST_ALL_DATA)}),(0,V.default)((0,R.default)(o),"onModelSelection",(i,s)=>{var h=s.model_name;if(h!==o.props.trainedModelId){o.resetVisualizations();var v=(0,Se.getAlgorithmTypeFromModelId)(h);o.triggerVisualizationSearches(o.serviceId,h,o.props.testPeriodEarliest,o.props.testPeriodLatest,v.type),o.props.updateTrainedModelId(h)}}),(0,V.default)((0,R.default)(o),"openPredictHealthScoreSearch",()=>{o.onOpenInSearch(o.state.testResultsSearch)}),(0,V.default)((0,R.default)(o),"openConfusionMatrixSearch",()=>{o.onOpenInSearch(Se.SEARCHES.getConfusionMatrixSearch(o.serviceId,o.props.trainedModelId))}),(0,V.default)((0,R.default)(o),"openComparisonSearch",()=>{o.onOpenInSearch(Se.SEARCHES.getComparisonSearch(o.serviceId,o.props.trainedModelId,o.state.testDataSplit))}),(0,V.default)((0,R.default)(o),"openResidualErrorSearch",()=>{o.onOpenInSearch(Se.SEARCHES.getResidualSearch(o.serviceId,o.props.trainedModelId,o.state.testDataSplit))}),(0,V.default)((0,R.default)(o),"onOpenInSearch",i=>{(0,Se.openInSearch)(i,o.props.testPeriodEarliest,o.props.testPeriodLatest)}),(0,V.default)((0,R.default)(o),"getSearchErrorMessage",i=>i.toLowerCase().includes("model does not exist")?Se.MODEL_MISSING_MESSAGE+(0,ae.gettext)("retrain it above."):i),(0,V.default)((0,R.default)(o),"paEasterEgg",(i,s)=>{if("fluffy"===o.props.service.get("identifying_name")){var h;switch(s){case Se.ALGO_TYPES.CLASSIFICATION:h="Normal"===i;break;case Se.ALGO_TYPES.REGRESSION:h=!(isNaN(i)||i<80);break;default:h=null}o.props.handleShowPanda(h)}}),(0,V.default)((0,R.default)(o),"performHealthScorePredictionSearch",(i,s,h,v,y)=>{(0,ce.cleanSearchJobSubscriptions)(o.healthScorePredictionManager,o.healthScorePredictionResultSubscription),o.healthScorePredictionManager=ne.default.create({search:Se.SEARCHES.getPredictHealthScoreSearch(i,s,!1),earliest_time:h,latest_time:v},{app:(0,re.getShortAppName)(!0)}),o.healthScorePredictionResultSubscription=o.healthScorePredictionManager.getResults({offset:0,count:0}).subscribe({next:h=>{h.fields?y===Se.ALGO_TYPES.CLASSIFICATION?(o.setState({predictedHealthProgress:le.SEARCH_PROGRESS.COMPLETED,recallData:parseFloat(h.results[0].recall),accuracyData:parseFloat(h.results[0].accuracy),precisionData:parseFloat(h.results[0].precision),f1Data:parseFloat(h.results[0].f1),averagePredictedSeverityData:h.results[0].next30m_avg_hsl,worstPredictedSeverityData:h.results[0].next30m_worst_hsl,testResultsSearch:Se.SEARCHES.getPredictHealthScoreSearch(i,s,!1)}),o.paEasterEgg(h.results[0].next30m_avg_hsl,y)):(o.setState({predictedHealthProgress:le.SEARCH_PROGRESS.COMPLETED,rsquaredData:parseFloat(h.results[0].rSquared),rmseData:parseFloat(h.results[0].RMSE),averagePredictedHealthData:parseFloat(h.results[0].next30m_avg_hs),worstPredictedHealthData:parseFloat(h.results[0].next30m_worst_hs),testResultsSearch:Se.SEARCHES.getPredictHealthScoreSearch(i,s,!1)}),o.paEasterEgg(h.results[0].next30m_avg_hs,y)):o.setState({predictedHealthProgress:le.SEARCH_PROGRESS.NO_RESULTS,testResultsSearch:Se.SEARCHES.getPredictHealthScoreSearch(i,s,!1)})},error:h=>{o.setState({predictedHealthErrorMessage:o.getSearchErrorMessage(h.message),predictedHealthProgress:le.SEARCH_PROGRESS.ERROR,testResultsSearch:Se.SEARCHES.getPredictHealthScoreSearch(i,s,!1)})},complete:()=>{}}),o.setState({predictedHealthProgress:le.SEARCH_PROGRESS.IN_PROGRESS})}),(0,V.default)((0,R.default)(o),"performHealthScoreComparisonSearch",(i,s,h,v)=>{(0,ce.cleanSearchJobSubscriptions)(o.healthScoreComparisonSearchManager,o.healthScoreComparisonResultSubscription),o.healthScoreComparisonSearchManager=ne.default.create({search:Se.SEARCHES.getComparisonSearch(i,s,o.state.testDataSplit),earliest_time:h,latest_time:v},{app:(0,re.getShortAppName)(!0)}),o.healthScoreComparisonResultSubscription=o.healthScoreComparisonSearchManager.getResults({offset:0,count:0}).subscribe({next:i=>{o.healthScoreComparisonData=i},error:i=>{o.setState({healthScoreComparisonErrorMessage:o.getSearchErrorMessage(i.message),healthScoreComparisonProgress:le.SEARCH_PROGRESS.ERROR})},complete:()=>{var i=o.convertDataToVizFormat(o.healthScoreComparisonData);(0,Y.default)(i)?o.setState({healthScoreComparisonProgress:le.SEARCH_PROGRESS.NO_RESULTS}):o.setState({healthScoreComparisonProgress:le.SEARCH_PROGRESS.COMPLETED,healthScoreComparisonData:{fields:o.healthScoreComparisonData.fields,columns:i}})}}),o.setState({healthScoreComparisonProgress:le.SEARCH_PROGRESS.IN_PROGRESS})}),(0,V.default)((0,R.default)(o),"performResidualErrorSearch",(i,s,h,v)=>{(0,ce.cleanSearchJobSubscriptions)(o.residualErrorSearchManager,o.residualErrorResultSubscription),o.residualErrorSearchManager=ne.default.create({search:Se.SEARCHES.getResidualSearch(i,s,o.state.testDataSplit),earliest_time:h,latest_time:v},{app:(0,re.getShortAppName)(!0)}),o.residualErrorResultSubscription=o.residualErrorSearchManager.getResults({offset:0,count:0}).subscribe({next:i=>{o.residualErrorData=i},error:i=>{o.setState({residualErrorErrorMessage:o.getSearchErrorMessage(i.message),residualErrorProgress:le.SEARCH_PROGRESS.ERROR})},complete:()=>{var i=o.convertDataToVizFormat(o.residualErrorData);(0,Y.default)(i)?o.setState({residualErrorProgress:le.SEARCH_PROGRESS.NO_RESULTS}):o.setState({residualErrorProgress:le.SEARCH_PROGRESS.COMPLETED,residualErrorData:{fields:o.residualErrorData.fields,columns:i}})}}),o.setState({residualErrorProgress:le.SEARCH_PROGRESS.IN_PROGRESS})}),(0,V.default)((0,R.default)(o),"performConfusionMatrixSearch",(i,s,h,v)=>{(0,ce.cleanSearchJobSubscriptions)(o.confusionMatrixSearchManager,o.confusionMatrixResultSubscription),o.confusionMatrixSearchManager=ne.default.create({search:Se.SEARCHES.getConfusionMatrixSearch(i,s),earliest_time:h,latest_time:v},{app:(0,re.getShortAppName)(!0)}),o.confusionMatrixResultSubscription=o.confusionMatrixSearchManager.getResults({offset:0,count:0}).subscribe({next:i=>{o.confusionMatrixData=i},error:i=>{o.setState({confusionMatrixErrorMessage:o.getSearchErrorMessage(i.message),confusionMatrixProgress:le.SEARCH_PROGRESS.ERROR})},complete:()=>{(0,Y.default)(o.confusionMatrixData)?o.setState({confusionMatrixProgress:le.SEARCH_PROGRESS.NO_RESULTS}):o.setState({confusionMatrixProgress:le.SEARCH_PROGRESS.COMPLETED,confusionMatrixData:o.confusionMatrixData.results})}}),o.setState({confusionMatrixProgress:le.SEARCH_PROGRESS.IN_PROGRESS})}),(0,V.default)((0,R.default)(o),"updateAlgorithmCollection",i=>{var s=[],h=[],v=JSON.parse(JSON.stringify(o.props.service.get("algorithms").toJSON())),y=new he.default(v,{parse:!0}),_=(0,Se.getAvailableModelSet)(i);(0,U.default)(y.toJSON(),(i,o)=>{if(i instanceof fe.default){var v=i.get("modelId");v&&!_.has(v)&&(y.get(o).set("modelId",""),i instanceof pe.default?h[o]=!0:i instanceof ue.default&&(s[o]=!0))}}),o.props.setMissingModels(Se.ALGO_TYPES.REGRESSION,s),o.props.setMissingModels(Se.ALGO_TYPES.CLASSIFICATION,h)}),(0,V.default)((0,R.default)(o),"performListModelSearch",(i,s,h)=>{(0,ce.cleanSearchJobSubscriptions)(o.listModelSearchManager,o.listModelResultSubscription),o.listModelSearchManager=ne.default.create({search:Se.SEARCHES.getModelSearch(i),earliest_time:s,latest_time:h},{app:(0,re.getShortAppName)(!0)}),o.listModelResultSubscription=o.listModelSearchManager.getResults({offset:0,count:0}).subscribe({next:i=>{o.updateAlgorithmCollection(i.results)},error:i=>{o.setState({listingModelErrorMessage:(0,Se.getPredictionErrorMessage)(i.message),listingModelProgress:le.SEARCH_PROGRESS.ERROR})},complete:()=>{o.setState({listingModelProgress:le.SEARCH_PROGRESS.COMPLETED})}}),o.setState({listingModelProgress:le.SEARCH_PROGRESS.IN_PROGRESS})}),(0,V.default)((0,R.default)(o),"openInSearch",i=>{var s;switch(i){case Se.PANEL_TYPE.R2:case Se.PANEL_TYPE.RMSE:s=o.openPredictHealthScoreSearch;break;case Se.PANEL_TYPE.HEALTHSCORE_COMPARISON:s=o.openComparisonSearch;break;case Se.PANEL_TYPE.RESIDUAL_ERROR:s=o.openResidualErrorSearch;break;case Se.PANEL_TYPE.AVG_HEALTHSCORE:case Se.PANEL_TYPE.WORST_HEALTHSCORE:case Se.PANEL_TYPE.PRECISION:case Se.PANEL_TYPE.RECALL:case Se.PANEL_TYPE.ACCURACY:case Se.PANEL_TYPE.F1:s=o.openPredictHealthScoreSearch;break;case Se.PANEL_TYPE.CONFUSION:s=o.openConfusionMatrixSearch;break;case Se.PANEL_TYPE.AVG_SEVERITY:case Se.PANEL_TYPE.WORST_SEVERITY:s=o.openPredictHealthScoreSearch}return s}),(0,V.default)((0,R.default)(o),"getDisabledState",i=>{var s=!0,h=o.state.predictedHealthProgress===le.SEARCH_PROGRESS.ERROR||o.state.predictedHealthProgress===le.SEARCH_PROGRESS.NO_RESULTS,v=o.state.healthScoreComparisonProgress===le.SEARCH_PROGRESS.ERROR||o.state.healthScoreComparisonProgress===le.SEARCH_PROGRESS.NO_RESULTS,y=o.state.residualErrorProgress===le.SEARCH_PROGRESS.ERROR||o.state.residualErrorProgress===le.SEARCH_PROGRESS.NO_RESULTS;switch(i){case Se.PANEL_TYPE.R2:s=!h&&(0,se.isUndefinedOrNull)(o.state.rsquaredData);break;case Se.PANEL_TYPE.RMSE:s=!h&&(0,se.isUndefinedOrNull)(o.state.rmseData);break;case Se.PANEL_TYPE.HEALTHSCORE_COMPARISON:s=!v&&(0,se.isUndefinedOrNull)(o.state.healthScoreComparisonData);break;case Se.PANEL_TYPE.RESIDUAL_ERROR:s=!y&&(0,se.isUndefinedOrNull)(o.state.residualErrorData);break;case Se.PANEL_TYPE.AVG_HEALTHSCORE:s=!h&&(0,se.isUndefinedOrNull)(o.state.averagePredictedHealthData);break;case Se.PANEL_TYPE.WORST_HEALTHSCORE:s=!h&&(0,se.isUndefinedOrNull)(o.state.worstPredictedHealthData);break;case Se.PANEL_TYPE.PRECISION:s=(0,se.isUndefinedOrNull)(o.state.precisionData);break;case Se.PANEL_TYPE.RECALL:s=(0,se.isUndefinedOrNull)(o.state.recallData);break;case Se.PANEL_TYPE.ACCURACY:s=(0,se.isUndefinedOrNull)(o.state.accuracyData);break;case Se.PANEL_TYPE.F1:s=(0,se.isUndefinedOrNull)(o.state.f1Data);break;case Se.PANEL_TYPE.CONFUSION:s=(0,se.isUndefinedOrNull)(o.state.confusionMatrixData);break;case Se.PANEL_TYPE.AVG_SEVERITY:s=(0,se.isUndefinedOrNull)(o.state.averagePredictedSeverityData);break;case Se.PANEL_TYPE.WORST_SEVERITY:s=(0,se.isUndefinedOrNull)(o.state.worstPredictedSeverityData)}return s}),(0,V.default)((0,R.default)(o),"generateRegressionModelTable",()=>{var i=(0,ae.gettext)("The recommended model is the model that most closely predicts a service's health score. The recommendation might not be accurate if you change the test period."),s=W.default.createElement(ge.default,{tableDataTestItsi:"pa-regression-models-table",trainedModelId:o.props.trainedModelId,data:o.props.service.get("algorithms"),hasRecommendation:!0,loadSelection:o.onModelSelection,tooltipText:i,algoType:oe.ALGORITHM_TYPES.REGRESSION,disableRows:o.props.disableWhileTraining,listingModelProgress:o.state.listingModelProgress,listingModelErrorMessage:o.state.listingModelErrorMessage,missingModels:o.props.missingRegressionModels});return W.default.createElement(ee.default,{"data-test-itsi":"regression-models-card"},W.default.createElement(ee.default.Header,{title:(0,ae.gettext)("Regression Models")}),s)}),(0,V.default)((0,R.default)(o),"generateClassificationModelTable",()=>{var i=W.default.createElement(ge.default,{tableDataTestItsi:"pa-classification-models-table",trainedModelId:o.props.trainedModelId,data:o.props.service.get("algorithms"),hasRecommendation:!1,loadSelection:o.onModelSelection,algoType:oe.ALGORITHM_TYPES.CLASSIFICATION,disableRows:o.props.disableWhileTraining,listingModelProgress:o.state.listingModelProgress,listingModelErrorMessage:o.state.listingModelErrorMessage,missingModels:o.props.missingClassificationModels});return W.default.createElement(ee.default,{"data-test-itsi":"classification-models-card"},W.default.createElement(ee.default.Header,{title:(0,ae.gettext)("Classification Models")}),i)}),(0,V.default)((0,R.default)(o),"resetVisualizations",()=>{o.setState({rsquaredData:null,rmseData:null,averagePredictedHealthData:null,worstPredictedHealthData:null,worstPredictedSeverityData:null,averagePredictedSeverityData:null,healthScoreComparisonData:null,healthScoreComparisonProgress:le.SEARCH_PROGRESS.NOT_STARTED,healthScoreComparisonErrorMessage:"",residualErrorData:null,residualErrorProgress:le.SEARCH_PROGRESS.NOT_STARTED,residualErrorErrorMessage:"",f1Data:null,recallData:null,accuracyData:null,precisionData:null,confusionMatrixData:null,confusionMatrixErrorMessage:"",confusionMatrixProgress:le.SEARCH_PROGRESS.NOT_STARTED,testDataSplit:100})}),(0,V.default)((0,R.default)(o),"getMessageElement",()=>{var i=o.props.testDataSplitMessage===Se.TEST_DATA_SPLIT_MESSAGES.TEST_NO_DATA?"warning":"info";return W.default.createElement(Ee,{"data-test-itsi":"pa-test-pane-message",type:i},o.props.testDataSplitMessage)}),(0,V.default)((0,R.default)(o),"handleAlertRequestOpen",()=>{o.setState({alertOpen:!0})}),(0,V.default)((0,R.default)(o),"handleAlertRequestClose",()=>{o.setState({alertOpen:!1})}),o.state={displayModelTable:!1,rsquaredData:null,rmseData:null,averagePredictedHealthData:null,worstPredictedHealthData:null,worstPredictedSeverityData:null,averagePredictedSeverityData:null,predictedHealthProgress:le.SEARCH_PROGRESS.NOT_STARTED,predictedHealthErrorMessage:"",healthScoreComparisonData:null,healthScoreComparisonProgress:le.SEARCH_PROGRESS.NOT_STARTED,healthScoreComparisonErrorMessage:"",residualErrorData:null,residualErrorProgress:le.SEARCH_PROGRESS.NOT_STARTED,residualErrorErrorMessage:"",testResultsSearch:"",alertOpen:!1,accuracyData:null,precisionData:null,recallData:null,f1Data:null,confusionMatrixData:null,confusionMatrixProgress:le.SEARCH_PROGRESS.NOT_STARTED,confusionMatrixErrorMessage:"",testDataSplit:100,listingModelProgress:le.SEARCH_PROGRESS.NOT_STARTED,listingModelErrorMessage:""},o.serviceId=o.props.service.get("_key"),o}return(0,x.default)(PredictiveAnalyticsTestPane,[{key:"componentDidUpdate",value:function componentDidUpdate(){if(this.props.trainTestWorkflowStep===Se.TRAIN_TEST_WORKFLOW_STEP.TRAIN_TO_TEST){var i=this.props.service.get("algorithms"),s=(0,Se.getAlgorithmTypeFromModelId)(this.props.trainedModelId),o=i.get(s.value);this.updateVisualizationsWithTrainedData(o),this.props.handleTrainTestWorkflowStepUpdate(Se.TRAIN_TEST_WORKFLOW_STEP.TEST)}this.state.predictedHealthProgress===le.SEARCH_PROGRESS.COMPLETED&&this.props.saveSelectedInfo(this.props.trainedModelId,this.props.testPeriodEarliest,this.props.testPeriodLatest),this.state.listingModelProgress===le.SEARCH_PROGRESS.NOT_STARTED&&this.performListModelSearch(this.serviceId,this.props.testPeriodEarliest,this.props.testPeriodLatest)}},{key:"componentWillUnmount",value:function componentWillUnmount(){(0,ce.cleanSearchJobSubscriptions)(this.healthScorePredictionManager,this.healthScorePredictionResultSubscription),(0,ce.cleanSearchJobSubscriptions)(this.healthScoreComparisonSearchManager,this.healthScoreComparisonResultSubscription),(0,ce.cleanSearchJobSubscriptions)(this.residualErrorSearchManager,this.residualErrorResultSubscription),(0,ce.cleanSearchJobSubscriptions)(this.confusionMatrixSearchManager,this.confusionMatrixResultSubscription),(0,ce.cleanSearchJobSubscriptions)(this.listModelSearchManager,this.listModelResultSubscription)}},{key:"componentDidMount",value:function componentDidMount(){this.resetVisualizations(),(this.props.didSaveService||this.props.cancelChanges)&&this.props.trainedModelId&&this.triggerVisualizationSearches(this.serviceId,this.props.trainedModelId,this.props.testPeriodEarliest,this.props.testPeriodLatest,this.props.modelAlgorithmType)}},{key:"render",value:function render(){var i=(0,ae.gettext)("The span of time available to test the model created from training."),s=this.props.isValidTimePeriod(this.props.testPeriodEarliest,this.props.testPeriodLatest)&&this.serviceId,o=!(!this.props.trainedModelId||!s),h=this.getMessageElement();return W.default.createElement(be,{className:"predictive-analytics-create-test-container"},W.default.createElement(be,null,W.default.createElement(Te,null,W.default.createElement(ke,{"data-test-itsi":"pa-test-period-control-group",label:(0,ae.gettext)("Test Period"),tooltip:i,labelPosition:"top"},W.default.createElement(de.default,{advancedInputTypes:this.props.timePickerAttributes.advancedInputTypes,disabled:this.props.disableWhileTraining,handleTimeRangeChange:this.handleTimeRangeChange,earliest:this.props.testPeriodEarliest,formInputTypes:this.props.timePickerAttributes.formInputTypes,latest:this.props.testPeriodLatest,skipRealTimePresets:!0})),this.props.disableWhileTraining||this.props.isReadOnly?"":h),W.default.createElement("div",null,W.default.createElement(Z.default,{"data-test-itsi":"pa-test-panel-card-layout"},this.generateRegressionModelTable(),this.generateClassificationModelTable()))),this.props.modelAlgorithmType===Se.ALGO_TYPES.REGRESSION&&W.default.createElement("div",null,W.default.createElement(ye.default,{service:this.props.service,showVisualizations:o,openInSearch:this.openInSearch,getDisabledState:this.getDisabledState,rsquaredData:this.state.rsquaredData,rmseData:this.state.rmseData,healthScoreComparisonData:this.state.healthScoreComparisonData,healthScoreComparisonProgress:this.state.healthScoreComparisonProgress,healthScoreComparisonErrorMessage:this.state.healthScoreComparisonErrorMessage,residualErrorData:this.state.residualErrorData,residualErrorProgress:this.state.residualErrorProgress,residualErrorErrorMessage:this.state.residualErrorErrorMessage,predictedHealthProgress:this.state.predictedHealthProgress,predictedHealthErrorMessage:this.state.predictedHealthErrorMessage,averagePredictedHealthData:this.state.averagePredictedHealthData,worstPredictedHealthData:this.state.worstPredictedHealthData,handleAlertRequestOpen:this.handleAlertRequestOpen}),W.default.createElement(me.default,{minHealthScore:parseFloat(this.state.worstPredictedHealthData),service:this.props.service,modelId:this.props.trainedModelId,alertSearch:Se.SEARCHES.getWorstHealthScoreSearch(this.serviceId,this.props.trainedModelId),openState:this.state.alertOpen,handleClose:this.handleAlertRequestClose})),this.props.modelAlgorithmType===Se.ALGO_TYPES.CLASSIFICATION&&W.default.createElement("div",null,W.default.createElement(_e.default,{service:this.props.service,showVisualizations:o,openInSearch:this.openInSearch,getDisabledState:this.getDisabledState,predictedHealthProgress:this.state.predictedHealthProgress,predictedHealthErrorMessage:this.state.predictedHealthErrorMessage,averagePredictedSeverityData:this.state.averagePredictedSeverityData,worstPredictedSeverityData:this.state.worstPredictedSeverityData,accuracyData:this.state.accuracyData,precisionData:this.state.precisionData,recallData:this.state.recallData,f1Data:this.state.f1Data,confusionMatrixData:this.state.confusionMatrixData,confusionMatrixProgress:this.state.confusionMatrixProgress,confusionMatrixErrorMessage:this.state.confusionMatrixErrorMessage,handleAlertRequestOpen:this.handleAlertRequestOpen}),W.default.createElement(ve.default,{worstHealthSeverity:this.state.worstPredictedSeverityData,service:this.props.service,modelId:this.props.trainedModelId,alertSearch:Se.SEARCHES.getWorstHealthSeveritySearch(this.serviceId,this.props.trainedModelId),openState:this.state.alertOpen,handleClose:this.handleAlertRequestClose})))}}]),PredictiveAnalyticsTestPane}(W.Component);(0,V.default)(Ce,"propTypes",{isValidTimePeriod:K.default.func.isRequired,service:K.default.object.isRequired,createModelSearch:K.default.string.isRequired,disableWhileTraining:K.default.bool.isRequired,saveSelectedInfo:K.default.func.isRequired,didSaveService:K.default.bool.isRequired,isReadOnly:K.default.bool.isRequired,testDataSplit:K.default.number.isRequired,testDataSplitMessage:K.default.string.isRequired,trainedModelId:K.default.string.isRequired,modelAlgorithmType:K.default.number.isRequired,updateTestTimePickerAttributes:K.default.func.isRequired,updateTrainedModelId:K.default.func.isRequired,trainTestWorkflowStep:K.default.number.isRequired,handleTrainTestWorkflowStepUpdate:K.default.func.isRequired,timePickerAttributes:K.default.object.isRequired,testPeriodEarliest:K.default.string.isRequired,testPeriodLatest:K.default.string,next30AverageHealthScore:K.default.number,next30WorstSeverity:K.default.string,next30AverageSeverity:K.default.string,next30MinHealthScore:K.default.number,handleShowPanda:K.default.func,cancelChanges:K.default.bool.isRequired,missingRegressionModels:K.default.array,missingClassificationModels:K.default.array,setMissingModels:K.default.func.isRequired}),(0,V.default)(Ce,"defaultProps",{testPeriodLatest:"now",next30AverageHealthScore:null,next30MinHealthScore:null,next30WorstSeverity:null,next30AverageSeverity:null,handleShowPanda:function handleShowPanda(){},missingRegressionModels:[],missingClassificationModels:[]});var xe=Ce;s.default=xe,i.exports=s.default},8298:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(17)),y=h(o(18)),_=h(o(30)),S=h(o(21)),T=h(o(22)),x=h(o(20)),R=h(o(11)),P=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),L=h(o(2)),N=o(16),V=o(5),j=h(o(325)),W=h(o(805)),K=h(o(33)),U=h(o(104)),Y=h(o(99)),$=o(40),X=h(o(256)),Z=o(154),ee=o(461);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,x.default)(i);if(s){var v=(0,x.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,T.default)(this,o)}}o(29);var te=function(i){(0,S.default)(PredictiveAnalyticsModelTable,i);var s=_createSuper(PredictiveAnalyticsModelTable);function PredictiveAnalyticsModelTable(i){var o;(0,v.default)(this,PredictiveAnalyticsModelTable);for(var h=arguments.length,y=new Array(h>1?h-1:0),S=1;S<h;S++)y[S-1]=arguments[S];return o=s.call(this,i,...y),(0,R.default)((0,_.default)(o),"getSelectedRowStyle",i=>o.props.trainedModelId===i?{backgroundColor:$.variables.accentColorL50}:{}),(0,R.default)((0,_.default)(o),"getTableRows",i=>{var s=o.props.data&&o.props.data.getAlgorithmsByType(o.props.algoType).filter(i=>""!==i.model_name)||[];if(s.length<1){var h=ee.PREDICTIVE_ANALYTICS_ALGORITHM_TYPE.find(i=>i.name===o.props.algoType),v=(0,N.sprintf)((0,V.gettext)("No models found. Train and create a %(algoName)s model above."),{algoName:h?h.labelLowerCase:(0,V.gettext)("not found")});return P.default.createElement(U.default.Row,{"data-test-itsi":"pa-model-table-row-empty",key:"no-models-found"},P.default.createElement(U.default.Cell,{"data-test-itsi":"pa-model-table-cell-empty"},v))}return s.map(s=>{if(!(s.algorithm_name in o.props.missingModels)){var h=o.getSelectedRowStyle(s.model_name);return o.props.disableRows?P.default.createElement(U.default.Row,{"data-test-itsi":"pa-models-table-row",key:s.model_name,data:s,style:h},P.default.createElement(U.default.Cell,{"data-test-itsi":"pa-models-table-algorithm-cell"},(0,ee.getAlgorithmLabelLabel)(s.algorithm_name)),i?P.default.createElement(U.default.Cell,{"data-test-itsi":"pa-models-table-recommended-cell"},s.recommended?P.default.createElement(W.default,null):""):null):P.default.createElement(U.default.Row,{"data-test-itsi":"pa-models-table-row",key:s.model_name,data:s,onClick:o.props.loadSelection,style:h},P.default.createElement(U.default.Cell,{"data-test-itsi":"pa-models-table-algorithm-cell"},(0,ee.getAlgorithmLabelLabel)(s.algorithm_name)),i?P.default.createElement(U.default.Cell,{"data-test-itsi":"pa-models-table-recommended-cell"},s.recommended?P.default.createElement(W.default,null):""):null)}})}),(0,R.default)((0,_.default)(o),"generateModelListTable",()=>{var i;switch(o.props.listingModelProgress){case Z.SEARCH_PROGRESS.NOT_STARTED:break;case Z.SEARCH_PROGRESS.IN_PROGRESS:i=ee.SEARCH_PROGRESS_ELEMENTS.getSearchInProgressElement();break;case Z.SEARCH_PROGRESS.ERROR:i=ee.SEARCH_PROGRESS_ELEMENTS.getErrorMessageElement(o.props.listingModelErrorMessage);break;case Z.SEARCH_PROGRESS.NO_RESULTS:case Z.SEARCH_PROGRESS.COMPLETED:var s=o.props.tooltipText,h=o.props.hasRecommendation,v=o.getTableRows(h);i=P.default.createElement(U.default,{"data-test-itsi":o.props.tableDataTestItsi,stripeRows:!0},P.default.createElement(U.default.Head,null,P.default.createElement(U.default.HeadCell,{"data-test-itsi":"pa-models-table-algorithm-column-header"},(0,V.gettext)("Algorithm")),h?P.default.createElement(U.default.HeadCell,{"data-test-itsi":"pa-models-table-recommended-column-header"},(0,V.gettext)("Recommended"),P.default.createElement(Y.default,{content:P.default.createElement("span",{style:ee.TOOLTIP_CONTENT_STYLE},s),"data-test-itsi":"pa-model-algorithm-tooltip",style:{marginLeft:5}})):null),P.default.createElement(U.default.Body,null,v))}return i}),(0,R.default)((0,_.default)(o),"getMissingModelMessageElement",()=>{var i=Object.keys(o.props.missingModels).length;return 0===i?null:P.default.createElement(K.default,{"data-test-itsi":"pa-model-table-warning-message",type:"warning",style:{display:"inline-block"}},(0,ee.formatMissingModels)(o.props.missingModels,i),1===i?ee.MODEL_MISSING_MESSAGES.CREATION_DASHBOARD:ee.MODEL_MISSING_MESSAGES.CREATION_DASHBOARD_PLURAL)}),o.state={},o}return(0,y.default)(PredictiveAnalyticsModelTable,[{key:"render",value:function render(){return P.default.createElement(j.default.Body,null,this.getMissingModelMessageElement(),this.generateModelListTable())}}]),PredictiveAnalyticsModelTable}(P.Component);(0,R.default)(te,"propTypes",{trainedModelId:L.default.string.isRequired,tableDataTestItsi:L.default.string.isRequired,data:L.default.object.isRequired,hasRecommendation:L.default.bool.isRequired,loadSelection:L.default.func.isRequired,tooltipText:L.default.string,algoType:L.default.string.isRequired,disableRows:L.default.bool.isRequired,listingModelProgress:L.default.number.isRequired,listingModelErrorMessage:L.default.string.isRequired,missingModels:L.default.array.isRequired}),(0,R.default)(te,"defaultProps",{data:null,errorMessage:"",tooltipText:""});var ie=(0,X.default)(te);s.default=ie,i.exports=s.default},8299:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_,S,T,x,R,P,L,N=h(o(17)),V=h(o(18)),j=h(o(30)),W=h(o(21)),K=h(o(22)),U=h(o(20)),Y=h(o(11)),$=h(o(9)),X=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),Z=h(o(2)),ee=h(o(53)),te=h(o(172)),ie=h(o(3)),ae=o(16),ne=o(5),re=h(o(388)),se=h(o(39)),le=h(o(56)),oe=h(o(33)),de=h(o(107)),ce=h(o(82)),he=h(o(75)),ue=h(o(89)),pe=o(40),fe=o(1602),ge=o(201),me=o(129),ve=h(o(1143)),ye=h(o(208)),_e=o(461);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,U.default)(i);if(s){var v=(0,U.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,K.default)(this,o)}}o(29);var Se=(0,ie.default)(ce.default)(v||(v=(0,$.default)(["\n\twidth: 100%;\n"]))),be=(0,ie.default)(ue.default)(y||(y=(0,$.default)(["\n\twidth: 50px;\n\tborder-top-right-radius: 3px;\n\tborder-bottom-right-radius: 3px;\n\tborder-right: 1px solid ",";\n"])),pe.variables.borderColor),Te=(0,ie.default)(ue.default)(_||(_=(0,$.default)(["\n\twidth: 50px;\n"]))),Ee=(0,ie.default)(re.default)(S||(S=(0,$.default)(["\n\tcolor: ",";\n"])),i=>i.color),getBoxFilled=i=>X.default.createElement(Ee,{color:i}),ke=(0,ie.default)(he.default)(T||(T=(0,$.default)(["\n\tpadding: 5px 10px;\n\tmargin: auto;\n"]))),Ce=(0,ie.default)(le.default)(x||(x=(0,$.default)(['\n\tbutton[data-test="clickable"] {\n\t\tmargin-bottom: 5px;\n\t}\n']))),xe=(0,ie.default)(ue.default)(R||(R=(0,$.default)(["\n\tspan > textarea {\n\t\tpadding: 5px 10px !important;\n\t}\n"]))),we=(0,ie.default)(ue.default)(P||(P=(0,$.default)(["\n\tspan > div {\n\t\tdisplay: none;\n\t}\n"]))),Me=(0,ie.default)(de.default)(L||(L=(0,$.default)(["\n\twidth: 650px;\n"]))),Re={LESS_THAN:{symbol:"<",label:(0,ne.gettext)("less than")},LESS_EQUAL:{symbol:"<=",label:(0,ne.gettext)("less than or equal to")},BETWEEN:{symbol:"<<",label:(0,ne.gettext)("between")},BETWEEN_EQUAL:{symbol:"<=<=",label:(0,ne.gettext)("between (inclusive)")}},Ae=0,Ie=1,Oe=2,Pe=3,De=function(i){(0,W.default)(PredictiveAnalyticsCreateAlert,i);var s=_createSuper(PredictiveAnalyticsCreateAlert);function PredictiveAnalyticsCreateAlert(i){var o;(0,N.default)(this,PredictiveAnalyticsCreateAlert);for(var h=arguments.length,v=new Array(h>1?h-1:0),y=1;y<h;y++)v[y-1]=arguments[y];return o=s.call(this,i,...v),(0,Y.default)((0,j.default)(o),"componentDidMount",()=>{ye.default.getNotableEventsConfigsInfo().done(function(i){this.setState({notableEventSeverities:i.severities})}.bind((0,j.default)(o)))}),(0,Y.default)((0,j.default)(o),"componentDidUpdate",i=>{o.props.openState&&i.openState!==o.props.openState&&""===o.state.maxInputValue&&""===o.state.notableEventTitle&&o.setTitleAndTrigger(),o.props.modelId&&i.modelId!==o.props.modelId&&o.setState({customTitle:!1,maxInputValue:"",notableEventTitle:""}),o.props.openState||i.openState===o.props.openState||o.resetDefaults()}),(0,Y.default)((0,j.default)(o),"createCorrelationSearch",()=>{if(""===o.state.maxInputValue)o.setState({maxInputError:!0,alertState:Oe,alertErrorMessage:_e.ALERT_ERROR_MESSAGES.EMPTY});else if(o.state.triggerOperator!==Re.BETWEEN.symbol&&o.state.triggerOperator!==Re.BETWEEN_EQUAL.symbol||""!==o.state.minInputValue)if(""===o.state.searchName)o.setState({searchNameError:!0,alertState:Oe,alertErrorMessage:_e.ALERT_ERROR_MESSAGES.SEARCH_NAME});else if(""===o.state.notableEventTitle)o.setState({notableEventTitleError:!0,alertState:Oe,alertErrorMessage:_e.ALERT_ERROR_MESSAGES.EMPTY_TITLE});else{o.setCorrelationSearch();var i=o.correlationSearchModel.save();o.setState({alertState:Ie}),i.done(function(){this.setState({alertState:Pe})}.bind((0,j.default)(o))).fail(function(i){var s=(0,me.extractErrorMsgFromResponse)(i);this.setState({alertErrorMessage:(0,ae.sprintf)(_e.ALERT_ERROR_MESSAGES.ERROR_SAVING+" %s.",s),alertState:Oe}),s.includes("already exists")&&this.setState({searchNameError:!0})}.bind((0,j.default)(o)))}else o.setState({minInputError:!0,alertState:Oe,alertErrorMessage:_e.ALERT_ERROR_MESSAGES.EMPTY})}),(0,Y.default)((0,j.default)(o),"setCorrelationSearch",()=>{var i=o.props.alertSearch+" | where next30m_worst_hs ";o.state.triggerOperator===Re.BETWEEN.symbol?i+=Re.LESS_THAN.symbol+" "+o.state.maxInputValue+" AND next30m_worst_hs > "+o.state.minInputValue:o.state.triggerOperator===Re.BETWEEN_EQUAL.symbol?i+=Re.LESS_EQUAL.symbol+" "+o.state.maxInputValue+" AND next30m_worst_hs >= "+o.state.minInputValue:i+=o.state.triggerOperator+" "+o.state.maxInputValue;var s=(0,fe.uiEditURL)("predictive_analytics_usage",{model_id:o.props.modelId,service_id:o.serviceId,auto_load:!0});o.correlationSearchModel.set({search:i,name:o.state.searchName,cron_schedule:o.state.schedule,"dispatch.earliest_time":"-1h","action.itsi_event_generator.param.drilldown_uri":s,"action.itsi_event_generator.param.title":o.state.notableEventTitle,"action.itsi_event_generator.param.severity":o.state.eventSeverity,"action.itsi_event_generator.param.drilldown_title":(0,ae.sprintf)((0,ne.gettext)("Predictive Analytics %s Dashboard"),o.serviceName),"action.itsi_event_generator.param.service_ids":o.serviceId})}),(0,Y.default)((0,j.default)(o),"handleInputSearchName",(i,s)=>{var{value:h}=s;o.setState({searchName:h}),o.state.searchNameError&&o.setState({searchNameError:!1,alertState:Ae})}),(0,Y.default)((0,j.default)(o),"handleComparison",(i,s)=>{var{value:h}=s;o.setNotableEventTitle(o.state.minInputValue,o.state.maxInputValue,h),o.setState({triggerOperator:h})}),(0,Y.default)((0,j.default)(o),"handleInputTitle",(i,s)=>{var{value:h}=s;o.setState({customTitle:!0,notableEventTitle:h}),o.state.notableEventTitleError&&o.setState({notableEventTitleError:!1,alertState:Ae})}),(0,Y.default)((0,j.default)(o),"handleSchedulingSelection",(i,s)=>{var{value:h}=s;o.setState({schedule:h})}),(0,Y.default)((0,j.default)(o),"handleSeveritySelection",(i,s)=>{var{value:h}=s;o.setState({eventSeverity:h})}),(0,Y.default)((0,j.default)(o),"onMaxTriggerInput",(i,s)=>{var{value:h}=s,v=parseFloat(h);isNaN(h)||v<=0?o.setState({maxInputValue:h,maxInputError:!0,alertState:Oe,alertErrorMessage:_e.ALERT_ERROR_MESSAGES.INTEGER}):v>100?o.setState({maxInputValue:h,maxInputError:!0,alertState:Oe,alertErrorMessage:_e.ALERT_ERROR_MESSAGES.HUNDRED}):v<parseFloat(o.state.minInputValue)?o.setState({maxInputValue:h,maxInputError:!0,alertState:Oe,alertErrorMessage:_e.ALERT_ERROR_MESSAGES.MAX_ERROR}):(o.setState({maxInputValue:h}),o.state.maxInputError&&o.setState({maxInputError:!1,alertState:Ae}),o.state.minInputError&&o.setState({minInputError:!1})),o.setNotableEventTitle(o.state.minInputValue,h,o.state.triggerOperator)}),(0,Y.default)((0,j.default)(o),"onMinTriggerInput",(i,s)=>{var{value:h}=s,v=parseFloat(h);isNaN(h)?o.setState({minInputValue:h,minInputError:!0,alertState:Oe,alertErrorMessage:_e.ALERT_ERROR_MESSAGES.INTEGER}):v<0?o.setState({minInputValue:h,minInputError:!0,alertState:Oe,alertErrorMessage:_e.ALERT_ERROR_MESSAGES.NEGATIVE}):v>parseFloat(o.state.maxInputValue)?o.setState({minInputValue:h,minInputError:!0,alertState:Oe,alertErrorMessage:_e.ALERT_ERROR_MESSAGES.MIN_ERROR}):(o.setState({minInputValue:h}),o.state.minInputError&&o.setState({minInputError:!1,alertState:Ae}),o.state.maxInputError&&o.setState({maxInputError:!1})),o.setNotableEventTitle(h,o.state.maxInputValue,o.state.triggerOperator)}),(0,Y.default)((0,j.default)(o),"renderTriggerText",i=>{var s=[];return s.push(X.default.createElement(Te,{"data-test-itsi":"pa-create-alert-max-text",error:o.state.maxInputError,key:"input-trigger-max",value:o.state.maxInputValue,onChange:o.onMaxTriggerInput})),i!==Re.BETWEEN_EQUAL.symbol&&i!==Re.BETWEEN.symbol||(s.unshift(X.default.createElement(ke,{key:"and-separator"}," ",(0,ne.gettext)("and")," ")),s.unshift(X.default.createElement(be,{"data-test-itsi":"trigger-min-text",error:o.state.minInputError,key:"input-trigger-min",value:o.state.minInputValue,onChange:o.onMinTriggerInput}))),s}),(0,Y.default)((0,j.default)(o),"renderTrigger",()=>X.default.createElement(le.default,{"data-test-itsi":"pa-trigger-operator",label:(0,ne.gettext)("Create a notable event when predicted health score is"),labelWidth:o.labelTextWidth,controlsLayout:"fillJoin"},X.default.createElement(ce.default,{"data-test-itsi":"pa-trigger-operator-select",value:o.state.triggerOperator,onChange:o.handleComparison},(0,ee.default)(Re,i=>X.default.createElement(ce.default.Option,{"data-test-itsi":"pa-trigger-operator-select-option",key:i.label,label:i.label,value:i.symbol}))),o.renderTriggerText(o.state.triggerOperator))),(0,Y.default)((0,j.default)(o),"renderRunSchedule",()=>X.default.createElement(Se,{"data-test-itsi":"pa-scheduling-select",value:o.state.schedule,onChange:o.handleSchedulingSelection},(0,ee.default)(ge.BASIC_CRON_SCHEDULE_ARRAY,(function(i){return X.default.createElement(ce.default.Option,{"data-test-itsi":"pa-scheduling-select-option",key:i.value,label:i.label,value:i.value})})))),(0,Y.default)((0,j.default)(o),"setNotableEventTitle",(i,s,h)=>{if(!o.state.customTitle)switch(h){case Re.LESS_THAN.symbol:o.setState({notableEventTitle:(0,ae.sprintf)((0,ne.gettext)("%s's health score is predicted to drop below %s in 30 minutes"),o.serviceName,s)});break;case Re.LESS_EQUAL.symbol:o.setState({notableEventTitle:(0,ae.sprintf)((0,ne.gettext)("%s's health score is predicted to hit or drop below %s in 30 minutes"),o.serviceName,s)});break;case Re.BETWEEN.symbol:o.setState({notableEventTitle:(0,ae.sprintf)((0,ne.gettext)("%s's health score is predicted to drop between %s and %s in 30 minutes"),o.serviceName,i,s)});break;case Re.BETWEEN_EQUAL.symbol:o.setState({notableEventTitle:(0,ae.sprintf)((0,ne.gettext)("%s's health score is predicted to drop between %s and %s (inclusive) in 30 minutes"),o.serviceName,i,s)})}}),(0,Y.default)((0,j.default)(o),"renderSeverityOptions",()=>{var i=o.state.notableEventSeverities;return i=(0,te.default)(i,"value"),X.default.createElement(Se,{"data-test-itsi":"pa-event-severity-select",value:o.state.eventSeverity,onChange:o.handleSeveritySelection},(0,ee.default)(i,(function(i){return X.default.createElement(ce.default.Option,{"data-test-itsi":"pa-event-severity-select-option",key:i.value,label:i.label,icon:getBoxFilled(i.color),value:i.value})})))}),(0,Y.default)((0,j.default)(o),"resetDefaults",()=>{o.setState({searchName:(0,ae.sprintf)((0,ne.gettext)("Predicted worst case health score for %s service"),o.serviceName),searchNameError:!1,maxInputError:!1,maxInputValue:"",minInputError:!1,minInputValue:"0",triggerOperator:Re.LESS_EQUAL.symbol,alertErrorMessage:"",alertState:Ae,notableEventTitle:"",notableEventTitleError:!1,schedule:"*/5 * * * *",eventSeverity:"6",customTitle:!1})}),(0,Y.default)((0,j.default)(o),"setTitleAndTrigger",()=>{o.setState({maxInputValue:o.props.minHealthScore.toFixed(2),notableEventTitle:(0,ae.sprintf)((0,ne.gettext)("%s's health score is predicted to hit or drop below %s in 30 minutes"),o.serviceName,o.props.minHealthScore.toFixed(2))})}),(0,Y.default)((0,j.default)(o),"renderModalBody",()=>o.state.alertState===Pe?(0,_e.confirmationModalBody)():X.default.createElement(de.default.Body,null,o.state.alertState===Oe&&X.default.createElement(oe.default,{"data-test-itsi":"pa-create-alert-error-message",type:"error"},o.state.alertErrorMessage),X.default.createElement(le.default,{"data-test-itsi":"pa-create-alert-search-name",label:(0,ne.gettext)("Search Name"),labelWidth:o.labelTextWidth},X.default.createElement(we,{"data-test-itsi":"pa-create-alert-search-name-text",value:o.state.searchName,error:o.state.searchNameError,onChange:o.handleInputSearchName,canClear:!0})),o.renderTrigger(),X.default.createElement(Ce,{"data-test-itsi":"pa-create-alert-title",label:(0,ne.gettext)("Notable Event Title"),labelWidth:o.labelTextWidth,tooltip:(0,ne.gettext)("The title automatically updates with input value(s) unless you manually change it.")},X.default.createElement(xe,{"data-test-itsi":"pa-create-alert-input-title-text",value:o.state.notableEventTitle,onChange:o.handleInputTitle,error:o.state.notableEventTitleError})),X.default.createElement(le.default,{"data-test-itsi":"predictive-analytics-notable-event-run-every",label:(0,ne.gettext)("Run Every"),labelWidth:o.labelTextWidth,controlsLayout:"none"},o.renderRunSchedule()),X.default.createElement(le.default,{"data-test-itsi":"predictive-analytics-notable-event-severity",label:(0,ne.gettext)("Severity"),tooltip:(0,ne.gettext)("The initial severity of a newly created notable event."),labelWidth:o.labelTextWidth,controlsLayout:"none"},o.renderSeverityOptions()))),(0,Y.default)((0,j.default)(o),"renderFooter",()=>{var i=o.state.maxInputError||o.state.minInputError||o.state.searchNameError||o.state.alertState===Ie;return o.state.alertState===Pe?X.default.createElement(de.default.Footer,null,X.default.createElement(se.default,{appearance:"primary","data-test-itsi":"pa-create-alert-ok-button",onClick:o.props.handleClose,label:(0,ne.gettext)("OK")})):o.state.alertState===Ie?X.default.createElement(de.default.Footer,null,X.default.createElement(se.default,{"data-test-itsi":"pa-create-alert-save-button",disabled:i,appearance:"primary",label:(0,ne.gettext)("Saving...")})):X.default.createElement(de.default.Footer,null,X.default.createElement(se.default,{appearance:"secondary","data-test-itsi":"pa-create-alert-cancel-button",onClick:o.props.handleClose,label:(0,ne.gettext)("Cancel")}),X.default.createElement(se.default,{appearance:"primary","data-test-itsi":"pa-create-alert-create-button",disabled:i,onClick:o.createCorrelationSearch,label:(0,ne.gettext)("Create")}))}),o.serviceId=o.props.service.get("_key"),o.serviceName=o.props.service.get("title"),o.state={alertState:Ae,searchName:(0,ae.sprintf)((0,ne.gettext)("Predicted worst case health score for %s service"),o.serviceName),searchNameError:!1,maxInputValue:"",maxInputError:!1,minInputValue:"0",minInputError:!1,triggerOperator:Re.LESS_EQUAL.symbol,alertErrorMessage:"",notableEventTitle:"",notableEventTitleError:!1,customTitle:!1,schedule:"*/5 * * * *",eventSeverity:"6",notableEventSeverities:null},o.labelTextWidth="180px",o.correlationSearchModel=new ve.default,o}return(0,V.default)(PredictiveAnalyticsCreateAlert,[{key:"render",value:function render(){return X.default.createElement("div",null,X.default.createElement(Me,{"data-test-itsi":"pa-create-alert-modal",onRequestClose:this.props.handleClose,open:this.props.openState},X.default.createElement(de.default.Header,{title:(0,ne.gettext)("Create Correlation Search"),onRequestClose:this.props.handleClose}),this.renderModalBody(),this.renderFooter()))}}]),PredictiveAnalyticsCreateAlert}(X.Component);(0,Y.default)(De,"propTypes",{service:Z.default.object.isRequired,modelId:Z.default.string.isRequired,alertSearch:Z.default.string.isRequired,openState:Z.default.bool.isRequired,handleClose:Z.default.func.isRequired,minHealthScore:Z.default.number}),(0,Y.default)(De,"defaultProps",{minHealthScore:0});var Le=De;s.default=Le,i.exports=s.default},8300:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_,S,T=h(o(17)),x=h(o(18)),R=h(o(30)),P=h(o(21)),L=h(o(22)),N=h(o(20)),V=h(o(11)),j=h(o(9)),W=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),K=h(o(2)),U=h(o(53)),Y=h(o(172)),$=h(o(3)),X=o(16),Z=o(5),ee=h(o(388)),te=h(o(39)),ie=h(o(56)),ae=h(o(33)),ne=h(o(107)),re=h(o(82)),se=h(o(89)),le=o(1602),oe=o(201),de=o(129),ce=h(o(1143)),he=h(o(208)),ue=o(461);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,N.default)(i);if(s){var v=(0,N.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,L.default)(this,o)}}o(29);var pe={MEDIUM:(0,Z.gettext)("Medium"),CRITICAL:(0,Z.gettext)("Critical"),BOTH:(0,Z.gettext)("Medium or Critical")},fe=0,ge=1,me=2,ve=3,ye=(0,$.default)(ee.default)(v||(v=(0,j.default)(["\n\tcolor: ",";\n"])),i=>i.color),getBoxFilled=i=>W.default.createElement(ye,{color:i}),_e=(0,$.default)(ie.default)(y||(y=(0,j.default)(['\n\tbutton[data-test="clickable"] {\n\t\tmargin-bottom: 5px;\n\t}\n']))),Se=(0,$.default)(se.default)(_||(_=(0,j.default)(["\n\tspan {\n\t\tpadding: 5px 10px !important;\n\t}\n"]))),be=(0,$.default)(ne.default)(S||(S=(0,j.default)(["\n\twidth: 650px;\n"]))),Te=function(i){(0,P.default)(PredictiveAnalyticsCreateClassificationAlert,i);var s=_createSuper(PredictiveAnalyticsCreateClassificationAlert);function PredictiveAnalyticsCreateClassificationAlert(i){var o;(0,T.default)(this,PredictiveAnalyticsCreateClassificationAlert);for(var h=arguments.length,v=new Array(h>1?h-1:0),y=1;y<h;y++)v[y-1]=arguments[y];return o=s.call(this,i,...v),(0,V.default)((0,R.default)(o),"componentDidMount",()=>{he.default.getNotableEventsConfigsInfo().done(function(i){this.setState({notableEventSeverities:i.severities})}.bind((0,R.default)(o)))}),(0,V.default)((0,R.default)(o),"componentDidUpdate",i=>{o.props.openState&&i.openState!==o.props.openState&&""===o.state.severityInputValue&&""===o.state.notableEventTitle&&o.setTitleAndTrigger(),o.props.modelId&&i.modelId!==o.props.modelId&&o.setState({customTitle:!1,severityInputValue:"",notableEventTitle:""}),o.props.openState||i.openState===o.props.openState||o.resetDefaults()}),(0,V.default)((0,R.default)(o),"createCorrelationSearch",()=>{if(""===o.state.searchName)o.setState({searchNameError:!0,alertState:me,alertErrorMessage:ue.ALERT_ERROR_MESSAGES.SEARCH_NAME});else if(""===o.state.notableEventTitle)o.setState({notableEventTitleError:!0,alertState:me,alertErrorMessage:ue.ALERT_ERROR_MESSAGES.EMPTY_TITLE});else{o.setCorrelationSearch();var i=o.correlationSearchModel.save();o.setState({alertState:ge}),i.done(function(){this.setState({alertState:ve})}.bind((0,R.default)(o))).fail(function(i){var s=(0,de.extractErrorMsgFromResponse)(i);this.setState({alertErrorMessage:(0,X.sprintf)(ue.ALERT_ERROR_MESSAGES.ERROR_SAVING+" %s.",s),alertState:me}),s.includes("already exists")&&this.setState({searchNameError:!0})}.bind((0,R.default)(o)))}}),(0,V.default)((0,R.default)(o),"setCorrelationSearch",()=>{var i=o.props.alertSearch+' | where next30m_worst_hsl="';o.state.severityInputValue===pe.BOTH?i+=pe.MEDIUM+'" OR next30m_worst_hsl="'+pe.CRITICAL+'"':i+=o.state.severityInputValue+'"';var s=(0,le.uiEditURL)("predictive_analytics_usage",{model_id:o.props.modelId,service_id:o.serviceId,auto_load:!0});o.correlationSearchModel.set({search:i,name:o.state.searchName,cron_schedule:o.state.schedule,"dispatch.earliest_time":"-1h","action.itsi_event_generator.param.drilldown_uri":s,"action.itsi_event_generator.param.title":o.state.notableEventTitle,"action.itsi_event_generator.param.severity":o.state.eventSeverity,"action.itsi_event_generator.param.drilldown_title":(0,X.sprintf)((0,Z.gettext)("Predictive Analytics %s Dashboard"),o.serviceName),"action.itsi_event_generator.param.service_ids":o.serviceId})}),(0,V.default)((0,R.default)(o),"handleInputSearchName",(i,s)=>{var{value:h}=s;o.setState({searchName:h}),o.state.searchNameError&&o.setState({searchNameError:!1,alertState:fe})}),(0,V.default)((0,R.default)(o),"handleStateComparison",(i,s)=>{var{value:h}=s;o.setNotableEventTitle(h),o.setState({severityInputValue:h})}),(0,V.default)((0,R.default)(o),"handleInputTitle",(i,s)=>{var{value:h}=s;o.setState({customTitle:!0,notableEventTitle:h}),o.state.notableEventTitleError&&o.setState({notableEventTitleError:!1,alertState:fe})}),(0,V.default)((0,R.default)(o),"handleSchedulingSelection",(i,s)=>{var{value:h}=s;o.setState({schedule:h})}),(0,V.default)((0,R.default)(o),"handleSeveritySelection",(i,s)=>{var{value:h}=s;o.setState({eventSeverity:h})}),(0,V.default)((0,R.default)(o),"renderTrigger",()=>{var i=o.state.severityInputValue;return i.toLowerCase()==="Normal".toLowerCase()&&(i=pe.BOTH),W.default.createElement(ie.default,{"data-test-itsi":"pa-classification-notable-event",label:(0,Z.gettext)("Create a notable event when predicted health state is"),labelWidth:o.labelTextWidth,controlsLayout:"fillJoin"},W.default.createElement(re.default,{"data-test-itsi":"pa-state-comparison-select",value:i,onChange:o.handleStateComparison},(0,U.default)(pe,i=>W.default.createElement(re.default.Option,{"data-test-itsi":"pa-state-comparison-select-option",key:i,label:i,value:i}))))}),(0,V.default)((0,R.default)(o),"renderRunSchedule",()=>W.default.createElement(re.default,{"data-test-itsi":"pa-scheduling-selection-select",value:o.state.schedule,onChange:o.handleSchedulingSelection},(0,U.default)(oe.BASIC_CRON_SCHEDULE_ARRAY,(function(i){return W.default.createElement(re.default.Option,{"data-test-itsi":"pa-scheduling-selection-select-option",key:i.value,label:i.label,value:i.value})})))),(0,V.default)((0,R.default)(o),"setNotableEventTitle",i=>{if(!o.state.customTitle)if(i===pe.BOTH){var s=(0,Z.gettext)('"Medium" or "Critical"');o.setState({notableEventTitle:(0,X.sprintf)((0,Z.gettext)("The health state of %s is predicted to become either %s in 30 minutes"),o.serviceName,s)})}else o.setState({notableEventTitle:(0,X.sprintf)((0,Z.gettext)('The health state of %s is predicted to become "%s" in 30 minutes'),o.serviceName,i)})}),(0,V.default)((0,R.default)(o),"renderSeverityOptions",()=>{var i=o.state.notableEventSeverities;return i=(0,Y.default)(i,"value"),W.default.createElement(re.default,{"data-test-itsi":"pa-severity-selection-select",value:o.state.eventSeverity,onChange:o.handleSeveritySelection},(0,U.default)(i,(function(i){return W.default.createElement(re.default.Option,{"data-test-itsi":"pa-severity-selection-select-option",key:i.value,label:i.label,icon:getBoxFilled(i.color),value:i.value})})))}),(0,V.default)((0,R.default)(o),"resetDefaults",()=>{o.setState({searchName:(0,X.sprintf)((0,Z.gettext)("Predicted worst case health state for %s service"),o.serviceName),searchNameError:!1,severityInputValue:"",alertErrorMessage:"",alertState:fe,notableEventTitle:"",notableEventTitleError:!1,schedule:"*/5 * * * *",eventSeverity:"6",customTitle:!1})}),(0,V.default)((0,R.default)(o),"setTitleAndTrigger",()=>{var i=pe.BOTH;o.props.worstHealthSeverity.toLowerCase()!=="Normal".toLowerCase()&&(i=o.props.worstHealthSeverity),o.setState({severityInputValue:i}),o.setNotableEventTitle(i)}),(0,V.default)((0,R.default)(o),"renderModalBody",()=>o.state.alertState===ve?(0,ue.confirmationModalBody)():W.default.createElement(ne.default.Body,null,o.state.alertState===me&&W.default.createElement(ae.default,{"data-test-itsi":"pa-create-classification-error-message",type:"error"},o.state.alertErrorMessage),W.default.createElement(ie.default,{"data-test-itsi":"pa-create-classification-search-name",label:(0,Z.gettext)("Search Name"),labelWidth:o.labelTextWidth},W.default.createElement(se.default,{"data-test-itsi":"pa-create-classification-search-name-text",value:o.state.searchName,error:o.state.searchNameError,onChange:o.handleInputSearchName,canClear:!0})),o.renderTrigger(),W.default.createElement(_e,{"data-test-itsi":"pa-create-classification-notable-event-title",label:(0,Z.gettext)("Notable Event Title"),labelWidth:o.labelTextWidth,tooltip:(0,Z.gettext)("The title automatically updates with input value unless you manually change it.")},W.default.createElement(Se,{"data-test-itsi":"pa-create-classification-input-title-text",value:o.state.notableEventTitle,onChange:o.handleInputTitle,error:o.state.notableEventTitleError})),W.default.createElement(ie.default,{"data-test-itsi":"pa-create-classification-notable-event-run-every",label:(0,Z.gettext)("Run Every"),labelWidth:o.labelTextWidth,controlsLayout:"none"},o.renderRunSchedule()),W.default.createElement(ie.default,{"data-test-itsi":"pa-create-classification-notable-event-severity",label:(0,Z.gettext)("Severity"),tooltip:(0,Z.gettext)("The initial severity of a newly created notable event."),labelWidth:o.labelTextWidth,controlsLayout:"none"},o.renderSeverityOptions()))),(0,V.default)((0,R.default)(o),"renderFooter",()=>{var i=o.state.maxInputError||o.state.minInputError||o.state.searchNameError||o.state.alertState===ge;return o.state.alertState===ve?W.default.createElement(ne.default.Footer,null,W.default.createElement(te.default,{appearance:"primary","data-test-itsi":"pa-create-classification-alert-ok-button",onClick:o.props.handleClose,label:(0,Z.gettext)("OK")})):o.state.alertState===ge?W.default.createElement(ne.default.Footer,null,W.default.createElement(te.default,{"data-test-itsi":"pa-create-classification-alert-save-button",disabled:i,appearance:"primary",label:(0,Z.gettext)("Saving...")})):W.default.createElement(ne.default.Footer,null,W.default.createElement(te.default,{appearance:"secondary","data-test-itsi":"pa-create-classification-alert-cancel-button",onClick:o.props.handleClose,label:(0,Z.gettext)("Cancel")}),W.default.createElement(te.default,{appearance:"primary","data-test-itsi":"pa-create-classification-alert-create-button",disabled:i,onClick:o.createCorrelationSearch,label:(0,Z.gettext)("Create")}))}),o.serviceId=o.props.service.get("_key"),o.serviceName=o.props.service.get("title"),o.state={alertState:fe,searchName:(0,X.sprintf)((0,Z.gettext)("Predicted worst case health state for %s service"),o.serviceName),searchNameError:!1,severityInputValue:"",alertErrorMessage:"",notableEventTitle:"",customTitle:!1,schedule:"*/5 * * * *",eventSeverity:"6",notableEventSeverities:null},o.labelTextWidth="200px",o.correlationSearchModel=new ce.default,o}return(0,x.default)(PredictiveAnalyticsCreateClassificationAlert,[{key:"render",value:function render(){return W.default.createElement("div",null,W.default.createElement(be,{"data-test-itsi":"pa-create-classification-alert-modal",onRequestClose:this.props.handleClose,open:this.props.openState},W.default.createElement(ne.default.Header,{title:(0,Z.gettext)("Create Correlation Search"),onRequestClose:this.props.handleClose}),this.renderModalBody(),this.renderFooter()))}}]),PredictiveAnalyticsCreateClassificationAlert}(W.Component);(0,V.default)(Te,"propTypes",{service:K.default.object.isRequired,modelId:K.default.string.isRequired,alertSearch:K.default.string.isRequired,openState:K.default.bool.isRequired,handleClose:K.default.func.isRequired,worstHealthSeverity:K.default.string}),(0,V.default)(Te,"defaultProps",{worstHealthSeverity:pe.CRITICAL});var Ee=Te;s.default=Ee,i.exports=s.default},8301:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(0)),y=h(o(2)),_=h(o(309)),S=h(o(1500)),T=h(o(39)),x=h(o(455)),R=h(o(1553)),P=o(5),L=o(68),N=o(154),V=o(111),j=o(1173),W=h(o(2064)),K=h(o(4305)),U=h(o(8302)),Y=o(461);o(29);var $={service:y.default.object.isRequired,showVisualizations:y.default.bool.isRequired,getDisabledState:y.default.func.isRequired,openInSearch:y.default.func.isRequired,healthScoreComparisonProgress:y.default.number.isRequired,healthScoreComparisonErrorMessage:y.default.string.isRequired,residualErrorProgress:y.default.number.isRequired,residualErrorErrorMessage:y.default.string.isRequired,predictedHealthProgress:y.default.number.isRequired,predictedHealthErrorMessage:y.default.string.isRequired,handleAlertRequestOpen:y.default.func.isRequired,rsquaredData:y.default.number,rmseData:y.default.number,healthScoreComparisonData:y.default.object,residualErrorData:y.default.object,averagePredictedHealthData:y.default.number,worstPredictedHealthData:y.default.number};function PredictiveAnalyticsRegressionPanels(i){var s,o,h,y;return v.default.createElement("div",{style:{padding:"0 20px",display:i.showVisualizations?"block":"none"}},v.default.createElement(x.default,{"data-test-itsi":"pa-regression-panels-widgets-card-layout"},(s=(0,Y.outputCategoryColor)(i.rsquaredData),o=(0,L.getContrastingColor)(s),h=i.predictedHealthProgress===N.SEARCH_PROGRESS.COMPLETED,y=v.default.createElement(W.default,{widgetSeverity:s,color:o,data:i.rsquaredData,searchProgress:i.predictedHealthProgress,errorMessage:i.predictedHealthErrorMessage}),v.default.createElement(K.default,{isCompleted:h,panelType:Y.PANEL_TYPE.R2,body:y,getDisabledState:i.getDisabledState,openInSearch:i.openInSearch,fillCard:!0})),(()=>{var s=(0,V.getSeverityColor)(-1),o=(0,L.getContrastingColor)(s),h=i.predictedHealthProgress===N.SEARCH_PROGRESS.COMPLETED,y=v.default.createElement(W.default,{widgetSeverity:s,color:o,data:i.rmseData,searchProgress:i.predictedHealthProgress,errorMessage:i.predictedHealthErrorMessage});return v.default.createElement(K.default,{isCompleted:h,panelType:Y.PANEL_TYPE.RMSE,body:y,getDisabledState:i.getDisabledState,openInSearch:i.openInSearch,fillCard:!0})})()),v.default.createElement(x.default,{"data-test-itsi":"pa-regression-panels-chart-card-layout"},(()=>{var s,o=i.healthScoreComparisonProgress===N.SEARCH_PROGRESS.COMPLETED,h=(0,P.gettext)("Actual vs. Predicted");switch(i.healthScoreComparisonProgress){case N.SEARCH_PROGRESS.NOT_STARTED:break;case N.SEARCH_PROGRESS.IN_PROGRESS:s=Y.SEARCH_PROGRESS_ELEMENTS.getSearchInProgressElement();break;case N.SEARCH_PROGRESS.ERROR:s=Y.SEARCH_PROGRESS_ELEMENTS.getErrorMessageElement(i.healthScoreComparisonErrorMessage);break;case N.SEARCH_PROGRESS.NO_RESULTS:s=Y.SEARCH_PROGRESS_ELEMENTS.getNoResultsElement((0,P.gettext)("No results found."));break;case N.SEARCH_PROGRESS.COMPLETED:s=v.default.createElement("div",null,v.default.createElement(U.default,{data:i.healthScoreComparisonData,containerId:"healthscore-actual-vs-predict",scatterPointName:h}))}return v.default.createElement(K.default,{isCompleted:o,panelType:Y.PANEL_TYPE.HEALTHSCORE_COMPARISON,body:s,getDisabledState:i.getDisabledState,openInSearch:i.openInSearch})})(),(()=>{var s,o=i.residualErrorProgress===N.SEARCH_PROGRESS.COMPLETED;switch(i.residualErrorProgress){case N.SEARCH_PROGRESS.NOT_STARTED:break;case N.SEARCH_PROGRESS.IN_PROGRESS:s=Y.SEARCH_PROGRESS_ELEMENTS.getSearchInProgressElement();break;case N.SEARCH_PROGRESS.ERROR:s=Y.SEARCH_PROGRESS_ELEMENTS.getErrorMessageElement(i.residualErrorErrorMessage);break;case N.SEARCH_PROGRESS.NO_RESULTS:s=Y.SEARCH_PROGRESS_ELEMENTS.getNoResultsElement((0,P.gettext)("No results found."));break;case N.SEARCH_PROGRESS.COMPLETED:s=v.default.createElement("div",null,v.default.createElement(R.default,{options:{},dataSources:{primary:{data:i.residualErrorData}}}))}return v.default.createElement(K.default,{isCompleted:o,panelType:Y.PANEL_TYPE.RESIDUAL_ERROR,body:s,getDisabledState:i.getDisabledState,openInSearch:i.openInSearch})})()),v.default.createElement(x.default,{"data-test-itsi":"pa-regression-panels-health-score-card-layout"},(()=>{var s=(0,j.getSeverityColorFromColorRangeTable)(parseFloat(i.averagePredictedHealthData)),o=(0,L.getContrastingColor)(s),h=i.predictedHealthProgress===N.SEARCH_PROGRESS.COMPLETED,y=i.predictedHealthProgress,S=(0,_.default)(i.averagePredictedHealthData)||!i.averagePredictedHealthData.toString().length;h&&S&&(y=N.SEARCH_PROGRESS.NO_RESULTS);var T=v.default.createElement(W.default,{widgetSeverity:s,color:o,data:i.averagePredictedHealthData,searchProgress:y,errorMessage:i.predictedHealthErrorMessage});return v.default.createElement(K.default,{isCompleted:h,panelType:Y.PANEL_TYPE.AVG_HEALTHSCORE,body:T,getDisabledState:i.getDisabledState,openInSearch:i.openInSearch,fillCard:!0})})(),(()=>{var s=(0,j.getSeverityColorFromColorRangeTable)(parseFloat(i.worstPredictedHealthData)),o=(0,L.getContrastingColor)(s),h=i.predictedHealthProgress===N.SEARCH_PROGRESS.COMPLETED,y=i.predictedHealthProgress,x=i.predictedHealthProgress===N.SEARCH_PROGRESS.NO_RESULTS,R=i.predictedHealthProgress===N.SEARCH_PROGRESS.ERROR,V=(0,_.default)(i.worstPredictedHealthData)||!i.worstPredictedHealthData.toString().length;h&&V&&(y=N.SEARCH_PROGRESS.NO_RESULTS,x=!0);var U=v.default.createElement(W.default,{widgetSeverity:s,color:o,data:i.worstPredictedHealthData,searchProgress:y,errorMessage:i.predictedHealthErrorMessage}),$=x||R||!!i.service.get("cloneChangedSinceLastSave")||i.getDisabledState(Y.PANEL_TYPE.WORST_HEALTHSCORE),X=v.default.createElement(T.default,{"aria-label":(0,P.gettext)("Create alert"),"data-test-itsi":"pa-create-alert-button",disabled:$,onClick:i.handleAlertRequestOpen,appearance:"pill",style:{padding:"0"},icon:v.default.createElement(S.default,{screenReaderText:(0,P.gettext)("Create alert"),height:"16",width:"16"})});return v.default.createElement(K.default,{isCompleted:h,panelType:Y.PANEL_TYPE.WORST_HEALTHSCORE,body:U,getDisabledState:i.getDisabledState,openInSearch:i.openInSearch,fillCard:!0,createAlertObject:X,serviceUpdated:!!i.service.get("cloneChangedSinceLastSave")})})()))}var X=PredictiveAnalyticsRegressionPanels;s.default=X,PredictiveAnalyticsRegressionPanels.defaultProps={rsquaredData:null,rmseData:null,averagePredictedHealthData:null,worstPredictedHealthData:null,residualErrorData:null,healthScoreComparisonData:null},PredictiveAnalyticsRegressionPanels.propTypes=$,i.exports=s.default},8302:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(17)),y=h(o(18)),_=h(o(30)),S=h(o(21)),T=h(o(22)),x=h(o(20)),R=h(o(11)),P=h(o(28)),L=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),N=h(o(2)),V=h(o(97)),j=h(o(475)),W=h(o(1134)),K=o(5),U=h(o(256)),Y=o(203);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,x.default)(i);if(s){var v=(0,x.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,T.default)(this,o)}}o(29);var $=function(i){(0,S.default)(PredictiveAnalyticsScatterLineVisualization,i);var s=_createSuper(PredictiveAnalyticsScatterLineVisualization);function PredictiveAnalyticsScatterLineVisualization(i){var o;(0,v.default)(this,PredictiveAnalyticsScatterLineVisualization);for(var h=arguments.length,y=new Array(h>1?h-1:0),S=1;S<h;S++)y[S-1]=arguments[S];return o=s.call(this,i,...y),(0,R.default)((0,_.default)(o),"formatData",(i,s)=>{if(!i||!i.columns)return null;s=s<0?0:s;var o=null,h=null,v=[];return(0,j.default)(...i.columns).forEach((function(i){var y=+parseFloat(i[0]).toFixed(s),_=+parseFloat(i[1]).toFixed(s);isNaN(y)||isNaN(_)||(v.push([y,_]),o=null===o?y:Math.min(o,y),h=null===h?y:Math.max(h,y))})),{points:v,minValue:o,maxValue:h}}),(0,R.default)((0,_.default)(o),"generateScatterLineChart",()=>{o.chart&&(o.chart.destroy(),o.chart=null);var i=o.formatData(o.props.data,o.props.numValueDigits),s=(0,P.default)("#"+o.props.containerId).get(0);null!==i&&void 0!==s&&(o.chart=W.default.chart({chart:{renderTo:s,height:o.props.chartHeight},legend:{enabled:!1},credits:!1,lang:{noData:(0,K.gettext)("Unable to render chart due to lack of data.")},title:{text:""},xAxis:{title:{text:o.props.data.fields[0].name}},yAxis:{title:{text:o.props.data.fields[1].name}},plotOptions:{series:{animation:!1}},series:[{type:"line",data:[[i.minValue,i.minValue],[i.maxValue,i.maxValue]],stats:{hover:{lineWidth:0}},enableMouseTracking:!1,color:Y.warningColor},{type:"scatter",name:o.props.scatterPointName,data:i.points,marker:{radius:3},color:Y.linkColor,tooltip:{backgroundColor:Y.legacyDarkColor,borderColor:Y.legacyDarkColor,style:{color:Y.backgroundColor},animation:!1,hideDelay:0,crosshairs:{color:Y.gray60Color,dashStyle:"solid"},shared:!1,pointFormat:"<b>"+(0,K.gettext)("Actual:")+"</b> {point.x}<br><b>"+(0,K.gettext)("Predicted:")+"</b> {point.y}"}}]}))}),o.chart=null,o.generateChart=(0,V.default)(o.generateScatterLineChart).bind((0,_.default)(o)),o}return(0,y.default)(PredictiveAnalyticsScatterLineVisualization,[{key:"render",value:function render(){return this.generateChart(),L.default.createElement("div",{id:this.props.containerId})}}]),PredictiveAnalyticsScatterLineVisualization}(L.Component);(0,R.default)($,"propTypes",{data:N.default.object.isRequired,containerId:N.default.string.isRequired,scatterPointName:N.default.string.isRequired,numValueDigits:N.default.number,chartHeight:N.default.number}),(0,R.default)($,"defaultProps",{numValueDigits:2,chartHeight:250});var X=(0,U.default)($);s.default=X,i.exports=s.default},8303:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(0)),y=h(o(2)),_=h(o(1500)),S=h(o(39)),T=h(o(455)),x=o(5),R=o(68),P=o(144),L=o(154),N=h(o(2064)),V=h(o(4305)),j=h(o(8304)),W=o(461);o(29);var K={service:y.default.object.isRequired,showVisualizations:y.default.bool.isRequired,getDisabledState:y.default.func.isRequired,openInSearch:y.default.func.isRequired,predictedHealthProgress:y.default.number.isRequired,predictedHealthErrorMessage:y.default.string.isRequired,confusionMatrixProgress:y.default.number.isRequired,confusionMatrixErrorMessage:y.default.string.isRequired,handleAlertRequestOpen:y.default.func.isRequired,averagePredictedSeverityData:y.default.string,worstPredictedSeverityData:y.default.string,accuracyData:y.default.number,precisionData:y.default.number,recallData:y.default.number,f1Data:y.default.number,confusionMatrixData:y.default.array};function PredictiveAnalyticsClassificationPanels(i){var s,o,h,y;return v.default.createElement("div",{style:{padding:"0 20px",display:i.showVisualizations?"block":"none"}},v.default.createElement(T.default,{"data-test-itsi":"pa-classification-panels-widgets-card-layout"},(s=(0,W.outputCategoryColor)(i.precisionData),o=(0,R.getContrastingColor)(s),h=i.predictedHealthProgress===L.SEARCH_PROGRESS.COMPLETED,y=v.default.createElement(N.default,{widgetSeverity:s,color:o,data:i.precisionData,searchProgress:i.predictedHealthProgress,errorMessage:i.predictedHealthErrorMessage}),v.default.createElement(V.default,{isCompleted:h,panelType:W.PANEL_TYPE.PRECISION,body:y,getDisabledState:i.getDisabledState,openInSearch:i.openInSearch,fillCard:!0})),(()=>{var s=(0,W.outputCategoryColor)(i.recallData),o=(0,R.getContrastingColor)(s),h=i.predictedHealthProgress===L.SEARCH_PROGRESS.COMPLETED,y=v.default.createElement(N.default,{widgetSeverity:s,color:o,data:i.recallData,searchProgress:i.predictedHealthProgress,errorMessage:i.predictedHealthErrorMessage});return v.default.createElement(V.default,{isCompleted:h,panelType:W.PANEL_TYPE.RECALL,body:y,getDisabledState:i.getDisabledState,openInSearch:i.openInSearch,fillCard:!0})})(),(()=>{var s=(0,W.outputCategoryColor)(i.accuracyData),o=(0,R.getContrastingColor)(s),h=i.predictedHealthProgress===L.SEARCH_PROGRESS.COMPLETED,y=v.default.createElement(N.default,{widgetSeverity:s,color:o,data:i.accuracyData,searchProgress:i.predictedHealthProgress,errorMessage:i.predictedHealthErrorMessage});return v.default.createElement(V.default,{isCompleted:h,panelType:W.PANEL_TYPE.ACCURACY,body:y,getDisabledState:i.getDisabledState,openInSearch:i.openInSearch,fillCard:!0})})(),(()=>{var s=(0,W.outputCategoryColor)(i.f1Data),o=(0,R.getContrastingColor)(s),h=i.predictedHealthProgress===L.SEARCH_PROGRESS.COMPLETED,y=v.default.createElement(N.default,{widgetSeverity:s,color:o,data:i.f1Data,searchProgress:i.predictedHealthProgress,errorMessage:i.predictedHealthErrorMessage});return v.default.createElement(V.default,{isCompleted:h,panelType:W.PANEL_TYPE.F1,body:y,getDisabledState:i.getDisabledState,openInSearch:i.openInSearch,fillCard:!0})})()),v.default.createElement(T.default,{"data-test-itsi":"pa-classification-panels-confusion-matrix-card-layout"},(()=>{var s=i.confusionMatrixProgress===L.SEARCH_PROGRESS.COMPLETED,o=v.default.createElement(j.default,{confusionMatrixData:i.confusionMatrixData,confusionMatrixProgress:i.confusionMatrixProgress,confusionMatrixErrorMessage:i.confusionMatrixErrorMessage,openInSearch:i.openInSearch});return v.default.createElement(V.default,{isCompleted:s,panelType:W.PANEL_TYPE.CONFUSION,body:o,getDisabledState:i.getDisabledState,openInSearch:i.openInSearch})})()),v.default.createElement(T.default,{"data-test-itsi":"pa-classification-panels-severity-card-layout"},(()=>{var s=(0,W.classificationAlgorithmCategoryColor)(i.averagePredictedSeverityData),o=(0,R.getContrastingColor)(s),h=i.predictedHealthProgress===L.SEARCH_PROGRESS.COMPLETED,y=(0,P.getSeverityLabel)(i.averagePredictedSeverityData),_=i.predictedHealthProgress;h&&!i.averagePredictedSeverityData&&(_=L.SEARCH_PROGRESS.NO_RESULTS);var S=v.default.createElement(N.default,{widgetSeverity:s,color:o,data:y,searchProgress:_,errorMessage:i.predictedHealthErrorMessage});return v.default.createElement(V.default,{isCompleted:h,panelType:W.PANEL_TYPE.AVG_SEVERITY,body:S,getDisabledState:i.getDisabledState,openInSearch:i.openInSearch,fillCard:!0})})(),(()=>{var s=(0,W.classificationAlgorithmCategoryColor)(i.worstPredictedSeverityData),o=(0,R.getContrastingColor)(s),h=i.predictedHealthProgress===L.SEARCH_PROGRESS.COMPLETED,y=(0,P.getSeverityLabel)(i.worstPredictedSeverityData),T=i.predictedHealthProgress,j=i.predictedHealthProgress===L.SEARCH_PROGRESS.NO_RESULTS,K=i.predictedHealthProgress===L.SEARCH_PROGRESS.ERROR;h&&!i.worstPredictedSeverityData&&(T=L.SEARCH_PROGRESS.NO_RESULTS);var U=v.default.createElement(N.default,{widgetSeverity:s,color:o,data:y,searchProgress:T,errorMessage:i.predictedHealthErrorMessage}),Y=j||K||!!i.service.get("cloneChangedSinceLastSave")||i.getDisabledState(W.PANEL_TYPE.WORST_SEVERITY),$=v.default.createElement(S.default,{"aria-label":(0,x.gettext)("Create alert"),"data-test-itsi":"pa-create-alert-button",disabled:Y,onClick:i.handleAlertRequestOpen,appearance:"pill",style:{padding:"0"},icon:v.default.createElement(_.default,{screenReaderText:(0,x.gettext)("Create alert"),height:"16",width:"16"})});return v.default.createElement(V.default,{isCompleted:h,panelType:W.PANEL_TYPE.WORST_SEVERITY,body:U,getDisabledState:i.getDisabledState,openInSearch:i.openInSearch,fillCard:!0,createAlertObject:$,serviceUpdated:!!i.service.get("cloneChangedSinceLastSave")})})()))}var U=PredictiveAnalyticsClassificationPanels;s.default=U,PredictiveAnalyticsClassificationPanels.defaultProps={averagePredictedSeverityData:null,worstPredictedSeverityData:null,accuracyData:null,precisionData:null,recallData:null,f1Data:null,confusionMatrixData:null},PredictiveAnalyticsClassificationPanels.propTypes=K,i.exports=s.default},8304:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(17)),y=h(o(18)),_=h(o(30)),S=h(o(21)),T=h(o(22)),x=h(o(20)),R=h(o(11)),P=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),L=h(o(2)),N=h(o(45)),V=o(5),j=h(o(104)),W=o(154),K=o(461);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,x.default)(i);if(s){var v=(0,x.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,T.default)(this,o)}}o(29);var U=function(i){(0,S.default)(PredictiveAnalyticsConfusionMatrix,i);var s=_createSuper(PredictiveAnalyticsConfusionMatrix);function PredictiveAnalyticsConfusionMatrix(){var i;(0,v.default)(this,PredictiveAnalyticsConfusionMatrix);for(var o=arguments.length,h=new Array(o),y=0;y<o;y++)h[y]=arguments[y];return i=s.call(this,...h),(0,R.default)((0,_.default)(i),"processMatrixData",()=>{if(!(0,N.default)(i.props.confusionMatrixData))return i.props.confusionMatrixData.map(i=>{var s=K.CLASSIFICATION_STATES.filter(s=>s.type===i["Predicted actual"]).map(i=>i.label);return P.default.createElement(j.default.Row,{"data-test-itsi":"pa-confusion-matrix-table-row",key:s},P.default.createElement(j.default.Cell,null,(0,K.getPredictionActualLabel)(i["Predicted actual"])),P.default.createElement(j.default.Cell,null,i["Predicted Critical"]),P.default.createElement(j.default.Cell,null,i["Predicted Medium"]),P.default.createElement(j.default.Cell,null,i["Predicted Normal"]))})}),i}return(0,y.default)(PredictiveAnalyticsConfusionMatrix,[{key:"render",value:function render(){var i="<div></div>";switch(this.props.confusionMatrixProgress){case W.SEARCH_PROGRESS.NOT_STARTED:i=K.SEARCH_PROGRESS_ELEMENTS.getSearchInfoElement();break;case W.SEARCH_PROGRESS.IN_PROGRESS:i=K.SEARCH_PROGRESS_ELEMENTS.getSearchInProgressElement();break;case W.SEARCH_PROGRESS.ERROR:i=K.SEARCH_PROGRESS_ELEMENTS.getErrorMessageElement(this.props.confusionMatrixErrorMessage);break;case W.SEARCH_PROGRESS.NO_RESULTS:i=K.SEARCH_PROGRESS_ELEMENTS.getNoResultsElement((0,V.gettext)("No results found."));break;case W.SEARCH_PROGRESS.COMPLETED:i=P.default.createElement(j.default,{"data-test-itsi":"pa-confusion-matrix-table",stripeRows:!0},P.default.createElement(j.default.Head,null,P.default.createElement(j.default.HeadCell,{"data-test-itsi":"pa-confusion-matrix-table-actual-predicted-head-cell"},(0,V.gettext)("Actual/Predicted")),P.default.createElement(j.default.HeadCell,{"data-test-itsi":"pa-confusion-matrix-table-critical-head-cell"},(0,V.gettext)("Critical")),P.default.createElement(j.default.HeadCell,{"data-test-itsi":"pa-confusion-matrix-table-medium-head-cell"},(0,V.gettext)("Medium")),P.default.createElement(j.default.HeadCell,{"data-test-itsi":"pa-confusion-matrix-table-normal-head-cell"},(0,V.gettext)("Normal"))),P.default.createElement(j.default.Body,null,this.processMatrixData()))}return i}}]),PredictiveAnalyticsConfusionMatrix}(P.Component);(0,R.default)(U,"propTypes",{confusionMatrixProgress:L.default.number.isRequired,confusionMatrixErrorMessage:L.default.string.isRequired,confusionMatrixData:L.default.array}),(0,R.default)(U,"defaultProps",{confusionMatrixData:null});var Y=U;s.default=Y,i.exports=s.default},8305:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_,S,T,x,R,P,L,N,V,j,W,K,U,Y,$,X=h(o(17)),Z=h(o(18)),ee=h(o(30)),te=h(o(21)),ie=h(o(22)),ae=h(o(20)),ne=h(o(11)),re=h(o(9)),se=h(o(28)),le=_interopRequireWildcard(o(0)),oe=h(o(2)),de=h(o(403)),ce=h(o(65)),he=h(o(45)),ue=h(o(78)),pe=h(o(105)),fe=_interopRequireWildcard(o(3)),ge=h(o(39)),me=h(o(455)),ve=h(o(325)),ye=h(o(1553)),_e=h(o(56)),Se=h(o(1242)),be=h(o(43)),Te=h(o(33)),Ee=h(o(687)),ke=h(o(82)),Ce=h(o(806)),xe=h(o(99)),we=h(o(86)),Me=h(o(96)),Re=o(16),Ae=o(5),Ie=o(190),Oe=o(106),Pe=o(144),De=o(154),Le=o(267),Ne=o(142),Ve=o(327),He=h(o(723)),Be=o(129),je=h(o(2757)),We=h(o(2756)),Ke=o(461);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}return h.default=i,o&&o.set(i,h),h}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,ae.default)(i);if(s){var v=(0,ae.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,ie.default)(this,o)}}o(29);var Fe=fe.default.div(v||(v=(0,re.default)(["\n\tdisplay: block;\n\tpadding-left: 40px;\n"]))),Ge=fe.default.div(y||(y=(0,re.default)(["\n\tpadding: 0 20px;\n\tdisplay: block;\n"]))),Ue=(0,fe.css)(_||(_=(0,re.default)(['\n display: inline-block;\n\n button[data-test="clickable"] {\n margin-bottom: 5px;\n }\n']))),ze=(0,fe.default)(_e.default)(S||(S=(0,re.default)(["\n\t",";\n\tmargin-left: 20px;\n"])),Ue),Ye=(0,fe.default)(_e.default)(T||(T=(0,re.default)(["\n\t",";\n\tmargin-left: 10px;\n\tvertical-align: top;\n"])),Ue),qe=(0,fe.default)(_e.default)(x||(x=(0,re.default)(["\n\t",";\n\tmargin-left: 20px;\n\tvertical-align: top;\n"])),Ue),$e={},Je=le.default.createElement("span",{style:Ke.TOOLTIP_CONTENT_STYLE},(0,Ae.gettext)("A graph of the input data (KPIs and service health scores) over the selected training period.")),Xe=le.default.createElement("span",{style:Ke.TOOLTIP_CONTENT_STYLE},(0,Ae.gettext)("Shows how often each health score occurs over time. In general, it is best to have evenly distributed data.")),Ze=fe.default.span(R||(R=(0,re.default)(["\n\twhite-space: nowrap;\n"]))),Qe=le.default.createElement(Ze,null,(0,Ae.gettext)("Open in Search")),et=(0,fe.default)(xe.default)(P||(P=(0,re.default)(["\n\tflex: none;\n"]))),tt=(0,fe.default)(ke.default)(L||(L=(0,re.default)(["\n\twidth: 200px;\n"]))),it=(0,fe.default)(ge.default)(N||(N=(0,re.default)(["\n\tpadding: 0;\n"]))),at=(0,fe.default)(ge.default)(V||(V=(0,re.default)(["\n\tmargin: 20px 0 20px 20px;\n\tvertical-align: bottom;\n"]))),buttonIcon=i=>le.default.createElement(Ee.default,{screenReaderText:(0,Ae.gettext)("Open in Search"),height:"16",width:"16",disabled:i}),nt=(0,fe.default)(ve.default.Body)(j||(j=(0,re.default)(["\n\tmargin: ",";\n"])),i=>i.isCompleted?"":"0 auto"),rt=le.default.createElement("span",{style:Ke.TOOLTIP_CONTENT_STYLE},(0,Ae.gettext)("Randomly divides a percentage of the data to train the algorithm and the other percentage to test it. 70/30 is a generally agreed upon standard. However, be sure to tune this ratio based on your data volume and the time period.")),st=le.default.createElement("span",{style:Ke.TOOLTIP_CONTENT_STYLE},(0,Ae.gettext)("The data used to build the final model comes from this time period. The default is not a recommended value. In general, a longer time period is better.")),lt=le.default.createElement("span",{style:Ke.TOOLTIP_CONTENT_STYLE},(0,Ae.gettext)("Regression predicts a numerical health score. Classification predicts a relative health state.")),ot=fe.default.span(W||(W=(0,re.default)(["\n\tpadding-right: 3px;\n"]))),dt=fe.default.span(K||(K=(0,re.default)(["\n\tpadding-left: 3px;\n"]))),ct=fe.default.span(U||(U=(0,re.default)(["\n\tpadding-left: 4px;\n"]))),ht=(0,fe.default)(we.default)(Y||(Y=(0,re.default)(["\n\tdisplay: inline-block;\n"]))),ut=fe.default.div($||($=(0,re.default)(["\n\tpadding-left: 10px;\n\tdisplay: inline-block;\n"]))),pt=function(i){(0,te.default)(PredictiveAnalyticsCreateTrainPaneView,i);var s=_createSuper(PredictiveAnalyticsCreateTrainPaneView);function PredictiveAnalyticsCreateTrainPaneView(i){var o;(0,X.default)(this,PredictiveAnalyticsCreateTrainPaneView);for(var h=arguments.length,v=new Array(h>1?h-1:0),y=1;y<h;y++)v[y-1]=arguments[y];return o=s.call(this,i,...v),(0,ne.default)((0,ee.default)(o),"fillDataGaps",i=>{for(var s=[],o=[],h=[],v=[],y=i[0],_=i[1],S=y[0],T=y[y.length-1],x=S.split("-"),R=T.split("-"),P=+x[0],L=+R[0],N=0;N<=100;N++)N<P?(s.push((0,Re.sprintf)("%s-%s",N,N+1)),o.push("0")):N>L&&(h.push((0,Re.sprintf)("%s-%s",N,N+1)),v.push("0"));return[s.concat(y).concat(h),o.concat(_).concat(v)]}),(0,ne.default)((0,ee.default)(o),"updateSearchJobs",(i,s)=>{(0,Be.cleanSearchJobSubscriptions)(o.kpisOverTimeSearchJob,o.kpisOverTimeResultsSubscription),o.kpisOverTimeSearchJob=Me.default.create({search:Ke.SEARCHES.getKpiOverTimeSearch(o.serviceId),earliest_time:i,latest_time:s},{app:(0,Oe.getShortAppName)(!0)}),o.kpisOverTimeResultsSubscription=o.kpisOverTimeSearchJob.getResults({offset:0,count:0}).subscribe({next:i=>{o.kpisOverTimeResults=i},error:i=>{o.setState({kpiSearchResultsErrorMessage:i.message,kpiSearchProgress:De.SEARCH_PROGRESS.ERROR}),o.props.handleTrainInputSearchesDone()},complete:()=>{var i=o.getResultsForCharting(o.kpisOverTimeResults);(0,he.default)(i)?o.setState({kpiSearchProgress:De.SEARCH_PROGRESS.NO_RESULTS}):o.setState({kpiSearchProgress:De.SEARCH_PROGRESS.COMPLETED,kpiValuesOverTimeData:{fields:o.kpisOverTimeResults.fields,columns:i}}),o.props.handleTrainInputSearchesDone()}}),o.setState({kpiSearchProgress:De.SEARCH_PROGRESS.IN_PROGRESS}),(0,Be.cleanSearchJobSubscriptions)(o.healthScoreSearchJob,o.healthScoreResultsSubscription),o.healthScoreSearchJob=Me.default.create({search:Ke.SEARCHES.getHealthScoreSearch(o.serviceId),earliest_time:i,latest_time:s},{app:(0,Oe.getShortAppName)(!0)}),o.healthScoreResultsSubscription=o.healthScoreSearchJob.getResults({offset:0,count:0}).subscribe({next:i=>{o.healthScoreResults=i},error:i=>{o.setState({healthScoreResultsErrorMessage:i.message,healthScoreProgress:De.SEARCH_PROGRESS.ERROR})},complete:()=>{var i=o.getResultsForCharting(o.healthScoreResults);if((0,he.default)(i))o.setState({healthScoreProgress:De.SEARCH_PROGRESS.NO_RESULTS});else{var s=o.fillDataGaps(i);o.setState({healthScoreProgress:De.SEARCH_PROGRESS.COMPLETED,healthScoreData:{fields:o.healthScoreResults.fields,columns:s}})}}}),o.setState({healthScoreProgress:De.SEARCH_PROGRESS.IN_PROGRESS})}),(0,ne.default)((0,ee.default)(o),"setAlgorithmProperties",(i,s,o)=>{var h=i.get(s);if((0,de.default)(o,(function(i,s){h.set(s,i)})),h instanceof je.default){var v,y=Number.MIN_VALUE;(0,de.default)(i.attributes,(function(i,s){s&&i instanceof je.default&&(i.set("recommended",!1),i.get("rSquared")>y&&(y=i.get("rSquared"),v=i))})),v&&v.set("recommended",!0)}return i.set(s,h),i}),(0,ne.default)((0,ee.default)(o),"getResultsForCharting",i=>{if((0,he.default)(i.results))return[];var s=i.fields,o=i.results,h={};(0,de.default)(s,(i,s)=>{h[s]=i.name});var v=s.length,y=[];return(0,de.default)(o,i=>{for(var s=0;s<v;s++){y[s]||(y[s]=[]);var o=i[h[s]];y[s].push((0,pe.default)(o)?"":o)}}),y}),(0,ne.default)((0,ee.default)(o),"checkAndUpdateSearch",(i,s)=>{!!o.serviceId&&o.props.isValidTimePeriod(i,s)&&o.updateSearchJobs(i,s)}),(0,ne.default)((0,ee.default)(o),"handleSliderChange",(i,s)=>{var{value:h}=s;o.setState({trainingSplit:h})}),(0,ne.default)((0,ee.default)(o),"handleAlgoTypeChange",(i,s)=>{var{value:h}=s,v=o.isTrainEnabled(h,"",o.state.trainingPeriodEarliest,o.state.trainingPeriodLatest);o.setState({algoType:h,algo:"",toTrain:v})}),(0,ne.default)((0,ee.default)(o),"handleAlgoChange",(i,s)=>{var{value:h}=s,v=o.isTrainEnabled(o.state.algoType,h,o.state.trainingPeriodEarliest,o.state.trainingPeriodLatest);o.setState({algo:h,toTrain:v})}),(0,ne.default)((0,ee.default)(o),"handleTimeRangeChange",(i,s)=>{var h=o.isTrainEnabled(o.state.algoType,o.state.algo,i,s);o.checkAndUpdateSearch(i,s),o.setState({trainingPeriodEarliest:i,trainingPeriodLatest:s,toTrain:h})}),(0,ne.default)((0,ee.default)(o),"getPermissionData",()=>{var i=o.props.service.get("permissions").user;return{"perms.read":Le.ROLES.ITOA_USER,sharing:Ve.PERMISSIONS.APP,owner:i}}),(0,ne.default)((0,ee.default)(o),"makeModelReadAll",()=>{var i=Ke.SEARCHES.getMLTKModelLookFileNames(o.serviceId,o.state.algo,o.lookupFileType),s=o.getPermissionData(),h=[],v=se.default.ajax({url:(0,Ie.createRESTURL)("/servicesNS/"+s.owner+"/itsi/data/lookup-table-files/"+i.avg+"/acl"),type:"POST",data:s});h.push(v);var y=se.default.ajax({url:(0,Ie.createRESTURL)("/servicesNS/"+s.owner+"/itsi/data/lookup-table-files/"+i.worst+"/acl"),type:"POST",data:s});h.push(y);var _=se.default.ajax({url:(0,Ie.createRESTURL)("/servicesNS/"+s.owner+"/itsi/data/lookup-table-files/"+i.ss+"/acl"),type:"POST",data:s});return h.push(_),h}),(0,ne.default)((0,ee.default)(o),"getXHRsForKpiModelReadAll",(i,s)=>{var h=o.getPermissionData(),v=[];(0,de.default)(i,i=>{var s=se.default.ajax({url:(0,Ie.createRESTURL)("/servicesNS/"+h.owner+"/itsi/data/lookup-table-files/__mlspl_"+i+o.lookupFileType+"/acl"),type:"POST",data:h});v.push(s)});var y=se.default.ajax({url:(0,Ie.createRESTURL)("/servicesNS/"+h.owner+"/itsi/data/lookup-table-files/__mlspl_itsi_predict_kpi_ss_"+s+o.lookupFileType+"/acl"),type:"POST",data:h});v.push(y);var _=se.default.ajax({url:(0,Ie.createRESTURL)("/servicesNS/"+h.owner+"/itsi/data/lookup-table-files/__mlspl_itsi_predict_kpi_hs_"+s+o.lookupFileType+"/acl"),type:"POST",data:h});return v.push(_),v}),(0,ne.default)((0,ee.default)(o),"updateStateOnTrainError",i=>{var s=i;if(i&&"string"==typeof i&&(0,ce.default)(i.toLowerCase(),"solver needs samples of at least 2 classes")){var h=i.split(":"),v=h[h.length-1]||"";s=(0,Re.sprintf)((0,Ae.gettext)("The training dataset needs at least 2 classes, but the data contains only one class: %s"),v)}o.setState({trainResultsErrorMessage:s,trainSearchProgress:De.SEARCH_PROGRESS.ERROR,toTrain:!0,disableTrainInputs:!1}),o.props.handleTrainError(),o.props.handleTrainingInProgress(!1),Ke.SEARCHES.resetModelName()}),(0,ne.default)((0,ee.default)(o),"updateStateOnTrainCompletion",(i,s,h,v,y,_,S)=>{var T=(0,Ke.getAlgorithmTypeFromModelId)(i),x=T.type;o.props.handleModelCreation(o.state.trainingPeriodEarliest,o.state.trainingPeriodLatest,o.state.trainingSplit,i,x,Ke.TRAIN_TEST_WORKFLOW_STEP.TRAIN_TO_TEST,s,h,v,y,_,S),o.setState({trainSearchProgress:De.SEARCH_PROGRESS.COMPLETED,toTrain:!0,disableTrainInputs:!1});var R=x===Ke.ALGO_TYPES.REGRESSION?o.props.missingRegressionModels:o.props.missingClassificationModels;T.value in R&&delete R[T.value],o.props.setMissingModels(x,R),o.props.handleTrainingInProgress(!1)}),(0,ne.default)((0,ee.default)(o),"trainKpiModels",i=>{var s=Ke.SEARCHES.getTrainKpiTrendsSearchData(o.serviceId);o.kpiModelSuffix=s.suffix,o.trainKpiModelsJob=Me.default.create({search:s.search,earliest_time:o.state.trainingPeriodEarliest,latest_time:o.state.trainingPeriodLatest},{app:(0,Oe.getShortAppName)(!0)});var h=[];o.trainKpiModelsJobSubscription=o.trainKpiModelsJob.getResults({offset:0,count:0}).subscribe({next:i=>{i.fields&&(0,de.default)(i.results,i=>{h.push(i.modelname)})},error:i=>{var s=(0,Re.sprintf)((0,Ae.gettext)("Failed to train KPI models: %s"),i.message);o.updateStateOnTrainError(s)},complete:()=>{var v=o.getXHRsForKpiModelReadAll(h,s.suffix);se.default.when.apply(se.default,v).done(i.bind((0,ee.default)(o))).fail(function(i){var s=(0,Re.sprintf)((0,Ae.gettext)("An error occurred while setting permissions on the created KPI models. Status code : %s, Error: %s"),i.status,(0,Be.extractErrorMsgFromResponse)(i));this.updateStateOnTrainError(s)}.bind((0,ee.default)(o)))}})}),(0,ne.default)((0,ee.default)(o),"checkLookupFileExtension",(i,s,o)=>{var h="__mlspl_"+Ke.SEARCHES.getAlgorithmModelName(i,s),v=(0,Ie.createRESTURL)("/servicesNS/"+o+"/itsi/data/lookup-table-files/"+h);return{getCsvXhr:se.default.ajax({url:v+"_avg"+Ke.LOOKUP_FILE_TYPES.CSV,type:"GET"}),getMlmodelXhr:se.default.ajax({url:v+"_avg"+Ke.LOOKUP_FILE_TYPES.MLMODEL,type:"GET"})}}),(0,ne.default)((0,ee.default)(o),"onClickTrain",()=>{var i=Ke.SEARCHES.getCreateModelSearch(o.serviceId,o.state.algo,o.state.algoType,o.state.trainingSplit);(0,Be.cleanSearchJobSubscriptions)(o.trainSearchJob,o.trainResultsSubscription),o.props.handleTrainingInProgress(!0),o.trainSearchJob=Me.default.create({search:i,earliest_time:o.state.trainingPeriodEarliest,latest_time:o.state.trainingPeriodLatest},{app:(0,Oe.getShortAppName)(!0)});var s=(0,Ke.getSavedAlgorithmModel)(o.props.service,o.state.algo);(0,ue.default)(s)&&o.props.setCurrentAlgoSavedModelId(s);var h,v,y,_=Ke.SEARCHES.getAlgorithmModelName(o.serviceId,o.state.algo),S=0,T=(0,Pe.getSeverityLabel)("Critical"),x=JSON.parse(JSON.stringify(o.props.service.get("algorithms").toJSON())),R=new We.default(x,{parse:!0});o.trainResultsSubscription=o.trainSearchJob.getResults({offset:0,count:0}).subscribe({next:i=>{i.fields&&R&&(o.state.algoType===Ke.ALGO_TYPES.REGRESSION?(y=o.setAlgorithmProperties(R,o.state.algo,{modelId:Ke.SEARCHES.getAlgorithmModelName(o.serviceId,o.state.algo),rSquared:parseFloat(i.results[0].rSquared),RMSE:parseFloat(i.results[0].RMSE)}),h=parseFloat(i.results[0].next30m_avg_hs),S=parseFloat(i.results[0].next30m_worst_hs)):(y=o.setAlgorithmProperties(R,o.state.algo,{modelId:Ke.SEARCHES.getAlgorithmModelName(o.serviceId,o.state.algo),precision:parseFloat(i.results[0].precision),recall:parseFloat(i.results[0].recall),accuracy:parseFloat(i.results[0].accuracy),f1_score:parseFloat(i.results[0].f1)}),v=i.results[0].next30m_avg_hsl,T=i.results[0].next30m_worst_hsl))},error:i=>{var s=(0,Ae.gettext)("An error occurred while training the model. Try again, or check the logs for details.");s=i.message.includes("No valid fields to fit or apply model to")?(0,Ae.gettext)("Error in fit command: Insufficient data to train the model."):i.message,o.updateStateOnTrainError(s)},complete:()=>{var s=se.default.Deferred(),P=o.checkLookupFileExtension(o.serviceId,o.state.algo,o.props.service.get("permissions").user);P.getCsvXhr.done((function(){s.resolve(Ke.LOOKUP_FILE_TYPES.CSV)})).fail(function(){P.getMlmodelXhr.done((function(){s.resolve(Ke.LOOKUP_FILE_TYPES.MLMODEL)})).fail((function(i){s.reject(i)}))}.bind((0,ee.default)(o))),s.done(function(s){this.lookupFileType=s;var o=this.makeModelReadAll();se.default.when.apply(se.default,o).done(function(){var s=x.kpiModelsCreatedAt,onTrainKpiModelsDone=()=>{y||(y=R),y=y.set({kpiModelsCreatedAt:(new Date).getTime(),kpiModelSuffix:this.kpiModelSuffix}),this.props.service.set("algorithms",y),this.updateStateOnTrainCompletion(_,h,v,T,S,i,this.props.service)};if(!s||s+Ke.KPI_MODEL_TTL<(new Date).getTime())this.trainKpiModels(onTrainKpiModelsDone);else{var o=Ke.SEARCHES.getKpiModelsCountsSearch(this.serviceId);this.checkModelsJob=Me.default.create({search:o,earliest_time:this.state.trainingPeriodEarliest,latest_time:this.state.trainingPeriodLatest},{app:(0,Oe.getShortAppName)(!0)});var P=!1;this.checkModelsSubscription=this.checkModelsJob.getResults({offset:0,count:0}).subscribe({next:i=>{i.fields&&parseInt(i.results[0].modelcount)<parseInt(i.results[0].kpicount)+2&&(P=!0)},error:i=>{var s=(0,Re.sprintf)((0,Ae.gettext)("Failed to check KPI models: %s"),i.message);this.updateStateOnTrainError(s)},complete:()=>{P?this.trainKpiModels(onTrainKpiModelsDone):(this.props.service.set("algorithms",y),this.updateStateOnTrainCompletion(_,h,v,T,S,i,this.props.service))}})}}.bind(this)).fail(function(i){this.onErrorWithSetPermissions(i)}.bind(this)),Ke.SEARCHES.resetModelName()}.bind((0,ee.default)(o))).fail(function(i){this.onErrorWithSetPermissions(i)}.bind((0,ee.default)(o)))}}),o.props.handleTrainProgress(!0),o.setState({trainSearchProgress:De.SEARCH_PROGRESS.IN_PROGRESS,toTrain:!1,disableTrainInputs:!0}),o.props.handleTrainTestWorkflowStepUpdate(Ke.TRAIN_TEST_WORKFLOW_STEP.IN_TRAIN)}),(0,ne.default)((0,ee.default)(o),"onErrorWithSetPermissions",i=>{var s=(0,Re.sprintf)((0,Ae.gettext)("An error occurred while setting permissions on the created health score prediction models. Status code : %s, Error: %s"),i.status,(0,Be.extractErrorMsgFromResponse)(i));o.updateStateOnTrainError(s)}),(0,ne.default)((0,ee.default)(o),"isTrainEnabled",(i,s,h,v)=>!!(o.serviceId&&i&&s&&o.props.isValidTimePeriod(h,v))),(0,ne.default)((0,ee.default)(o),"runKpiOverTimeSearchInTab",()=>{o.runSearchInTab(Ke.SEARCH_TYPE.KPI_OVER_TIME_SEARCH)}),(0,ne.default)((0,ee.default)(o),"runHealthScoreSearchInTab",()=>{o.runSearchInTab(Ke.SEARCH_TYPE.HEALTHSCORE_SEARCH)}),(0,ne.default)((0,ee.default)(o),"runSearchInTab",i=>{var s;switch(i){case Ke.SEARCH_TYPE.HEALTHSCORE_SEARCH:s=Ke.SEARCHES.getHealthScoreSearch(o.serviceId);break;case Ke.SEARCH_TYPE.KPI_OVER_TIME_SEARCH:s=Ke.SEARCHES.getKpiOverTimeSearch(o.serviceId);break;default:s=""}(0,Ke.openInSearch)(s,o.state.trainingPeriodEarliest,o.state.trainingPeriodLatest)}),(0,ne.default)((0,ee.default)(o),"generateAlgorithmSelectOptions",()=>Ke.PREDICTIVE_ANALYTICS_ALGORITHMS.filter(i=>i.type===o.state.algoType).map(i=>le.default.createElement(ke.default.Option,{"data-test-itsi":"pa-algorithm-select-option",label:i.label,value:i.value,key:i.value}))),(0,ne.default)((0,ee.default)(o),"generateAlgorithmTypeSelectOptions",()=>Ke.PREDICTIVE_ANALYTICS_ALGORITHM_TYPE.map(i=>le.default.createElement(ke.default.Option,{"data-test-itsi":"pa-algorithm-type-select-option",label:i.label,value:i.value,key:i.value}))),(0,ne.default)((0,ee.default)(o),"getChart",i=>{var s;switch(i){case Ke.SEARCH_TYPE.HEALTHSCORE_SEARCH:switch(o.state.healthScoreProgress){case De.SEARCH_PROGRESS.NO_RESULTS:s=Ke.SEARCH_PROGRESS_ELEMENTS.getNoResultsElement();break;case De.SEARCH_PROGRESS.NOT_STARTED:s=Ke.SEARCH_PROGRESS_ELEMENTS.getSearchInfoElement();break;case De.SEARCH_PROGRESS.IN_PROGRESS:s=Ke.SEARCH_PROGRESS_ELEMENTS.getSearchInProgressElement();break;case De.SEARCH_PROGRESS.ERROR:s=Ke.SEARCH_PROGRESS_ELEMENTS.getErrorMessageElement(o.state.healthScoreResultsErrorMessage);break;case De.SEARCH_PROGRESS.COMPLETED:s=le.default.createElement(ye.default,{options:$e,dataSources:{primary:{data:o.state.healthScoreData}}});break;default:s="<div></div>"}break;case Ke.SEARCH_TYPE.KPI_OVER_TIME_SEARCH:switch(o.state.kpiSearchProgress){case De.SEARCH_PROGRESS.NO_RESULTS:s=Ke.SEARCH_PROGRESS_ELEMENTS.getNoResultsElement();break;case De.SEARCH_PROGRESS.NOT_STARTED:s=Ke.SEARCH_PROGRESS_ELEMENTS.getSearchInfoElement();break;case De.SEARCH_PROGRESS.IN_PROGRESS:s=Ke.SEARCH_PROGRESS_ELEMENTS.getSearchInProgressElement();break;case De.SEARCH_PROGRESS.ERROR:s=Ke.SEARCH_PROGRESS_ELEMENTS.getErrorMessageElement(o.state.kpiSearchResultsErrorMessage);break;case De.SEARCH_PROGRESS.COMPLETED:s=le.default.createElement(Se.default,{options:$e,dataSources:{primary:{data:o.state.kpiValuesOverTimeData}}});break;default:s="<div></div>"}break;default:s=""}return s}),(0,ne.default)((0,ee.default)(o),"getKpiOverTimeChart",i=>{var s=o.getChart(Ke.SEARCH_TYPE.KPI_OVER_TIME_SEARCH),h=!!o.serviceId&&o.props.isValidTimePeriod(o.state.trainingPeriodEarliest,o.state.trainingPeriodLatest),v=o.state.kpiSearchProgress===De.SEARCH_PROGRESS.COMPLETED;return le.default.createElement(me.default,{"data-test-itsi":"pa-create-train-kpi-over-time-card-layout"},le.default.createElement(ve.default,{"data-test-itsi":"pa-create-train-kpi-over-time-card"},le.default.createElement(ve.default.Header,{title:(0,Ae.gettext)("Service Health Score and KPIs over time")},le.default.createElement(xe.default,{"data-test-itsi":"service-health-score-tooltip",content:Je}),le.default.createElement(et,{"data-test-itsi":"service-health-score-open-in-search-tooltip",content:Qe},le.default.createElement(it,{"aria-label":(0,Ae.gettext)("Open in Search"),"data-test-itsi":"pa-create-train-kpi-ot-open-in-search-button",disabled:!i,onClick:o.runKpiOverTimeSearchInTab,appearance:"pill",icon:buttonIcon(h)}))),le.default.createElement(nt,{isCompleted:v},s)))}),(0,ne.default)((0,ee.default)(o),"getHealthScoreChart",i=>{var s=o.getChart(Ke.SEARCH_TYPE.HEALTHSCORE_SEARCH),h=!!o.serviceId&&o.props.isValidTimePeriod(o.state.trainingPeriodEarliest,o.state.trainingPeriodLatest),v=o.state.healthScoreProgress===De.SEARCH_PROGRESS.COMPLETED;return le.default.createElement(me.default,{"data-test-itsi":"pa-create-train-health-score-card-layout"},le.default.createElement(ve.default,{"data-test-itsi":"pa-create-train-health-score-card"},le.default.createElement(ve.default.Header,{title:(0,Ae.gettext)("Distribution of Service Health Score Values")},le.default.createElement(xe.default,{"data-test-itsi":"distribution-service-health-score-tooltip",content:Xe}),le.default.createElement(et,{"data-test-itsi":"distribution-service-health-score-open-in-search-tooltip",content:Qe},le.default.createElement(it,{"aria-label":(0,Ae.gettext)("Open in Search"),"data-test-itsi":"pa-create-train-hs-open-in-search-button",disabled:!i,onClick:o.runHealthScoreSearchInTab,appearance:"pill",icon:buttonIcon(h)}))),le.default.createElement(nt,{isCompleted:v},s)))}),(0,ne.default)((0,ee.default)(o),"scrollToTest",()=>((0,se.default)("html,body").animate({scrollTop:(0,se.default)("#test-a-model").offset().top},"slow"),!1)),(0,ne.default)((0,ee.default)(o),"getTrainResultElement",()=>{var i,s={q:Ke.SEARCHES.getSampleCreateModelSearch(o.serviceId,o.state.algo,o.state.algoType,o.state.trainingSplit),earliest:o.state.trainingPeriodEarliest,latest:o.state.trainingPeriodLatest},h=(0,Ne.uiEditURL)(s);switch(o.state.trainSearchProgress){case De.SEARCH_PROGRESS.IN_PROGRESS:i=le.default.createElement("div",null,le.default.createElement(ht,{"data-test-itsi":"pa-create-train-wait-spinner"}),le.default.createElement(ut,{"data-test-itsi":"creating-model-message-text"},(0,Ae.gettext)("Creating model...")));break;case De.SEARCH_PROGRESS.COMPLETED:i=le.default.createElement(Te.default,{"data-test-itsi":"search-completed-info-message",type:"info"},le.default.createElement(ot,null,(0,Ae.gettext)("Model created. See")),le.default.createElement(be.default,{"data-test-itsi":"test-a-model-link",onClick:o.scrollToTest},(0,Ae.gettext)("Test a Model")),le.default.createElement(dt,null,(0,Ae.gettext)("below for details.")),le.default.createElement(be.default,{"data-test-itsi":"run-sample-search-link",to:h,openInNewContext:!0},le.default.createElement(ct,null,(0,Ae.gettext)("Run sample search"))));break;case De.SEARCH_PROGRESS.ERROR:i=le.default.createElement(Te.default,{"data-test-itsi":"pa-create-train-error-message",type:"error"},o.state.trainResultsErrorMessage);break;default:i=le.default.createElement("div",null)}return i}),o.serviceId=o.props.service.get("_key"),o.lookupFileType=Ke.LOOKUP_FILE_TYPES.CSV,o.state={trainingSplit:o.props.trainingSplit,trainingPeriodEarliest:"-14d@d",trainingPeriodLatest:"now",toTrain:!1,algoType:"",algo:"",trainingTestPeriodEarliest:"",kpiValuesOverTimeData:{},healthScoreData:{},kpiSearchResultsErrorMessage:"",kpiSearchProgress:De.SEARCH_PROGRESS.NOT_STARTED,healthScoreResultsErrorMessage:"",healthScoreProgress:De.SEARCH_PROGRESS.NOT_STARTED,trainResultsErrorMessage:"",trainSearchProgress:De.SEARCH_PROGRESS.NOT_STARTED,disableTrainInputs:!1},o}return(0,Z.default)(PredictiveAnalyticsCreateTrainPaneView,[{key:"componentDidUpdate",value:function componentDidUpdate(i){this.props.runTrainInputSearches&&i.runTrainInputSearches!==this.props.runTrainInputSearches&&this.checkAndUpdateSearch(this.state.trainingPeriodEarliest,this.state.trainingPeriodLatest)}},{key:"componentDidMount",value:function componentDidMount(){(this.props.runTrainInputSearches||this.props.savedService||this.props.cancelChanges)&&this.checkAndUpdateSearch(this.state.trainingPeriodEarliest,this.state.trainingPeriodLatest)}},{key:"componentWillUnmount",value:function componentWillUnmount(){(0,Be.cleanSearchJobSubscriptions)(this.kpisOverTimeSearchJob,this.kpisOverTimeResultsSubscription),(0,Be.cleanSearchJobSubscriptions)(this.trainSearchJob,this.trainResultsSubscription),(0,Be.cleanSearchJobSubscriptions)(this.healthScoreSearchJob,this.healthScoreResultsSubscription),(0,Be.cleanSearchJobSubscriptions)(this.trainKpiModelsJob,this.trainKpiModelsJobSubscription),(0,Be.cleanSearchJobSubscriptions)(this.checkModelsJob,this.checkModelsSubscription)}},{key:"render",value:function render(){var i=this.generateAlgorithmTypeSelectOptions(),s=this.generateAlgorithmSelectOptions(),o=(0,Re.sprintf)((0,Ae.gettext)("Split for Training/Test: %s/%s"),this.state.trainingSplit,100-this.state.trainingSplit),h=!!this.serviceId&&this.props.isValidTimePeriod(this.state.trainingPeriodEarliest,this.state.trainingPeriodLatest),v=this.getKpiOverTimeChart(h),y=this.getHealthScoreChart(h),_=this.getTrainResultElement();return le.default.createElement("div",null,le.default.createElement(Ge,null,le.default.createElement(Ye,{"data-test-itsi":"pa-create-train-time-period",label:(0,Ae.gettext)("Time Period"),tooltip:st,labelPosition:"top"},le.default.createElement(He.default,{advancedInputTypes:this.props.timePickerAttributes.advancedInputTypes,handleTimeRangeChange:this.handleTimeRangeChange,disabled:this.state.disableTrainInputs,earliest:this.state.trainingPeriodEarliest,formInputTypes:this.props.timePickerAttributes.formInputTypes,latest:this.state.trainingPeriodLatest,skipRealTimePresets:!0})),le.default.createElement(ze,{"data-test-itsi":"pa-create-train-algorithm-type",label:(0,Ae.gettext)("Algorithm Type"),tooltip:lt,labelPosition:"top"},le.default.createElement(tt,{"data-test-itsi":"pa-algorithm-type-select",inline:!0,disabled:this.state.disableTrainInputs,onChange:this.handleAlgoTypeChange},i)),le.default.createElement(ze,{"data-test-itsi":"pa-create-train-algorithm",label:(0,Ae.gettext)("Algorithm"),tooltip:(0,Ae.gettext)("The algorithm to use for the health score prediction."),labelPosition:"top"},le.default.createElement(tt,{inline:!0,"data-test-itsi":"pa-algorithm-select",disabled:!this.state.algoType||this.state.disableTrainInputs,onChange:this.handleAlgoChange},s)),le.default.createElement(qe,{"data-test-itsi":"pa-create-train-test-split",label:o,tooltip:rt,labelPosition:"top"},le.default.createElement(Ce.default,{"data-test-itsi":"pa-create-train-test-split-slider-control",min:10,max:90,step:10,disabled:this.state.disableTrainInputs,onChange:this.handleSliderChange,value:this.state.trainingSplit})),le.default.createElement(at,{"data-test-itsi":"pa-train-button",label:(0,Ae.gettext)("Train"),disabled:!this.state.toTrain,appearance:"primary",onClick:this.onClickTrain})),le.default.createElement(Fe,null,_),le.default.createElement(Ge,null,le.default.createElement("div",null,le.default.createElement("div",null,v),le.default.createElement("div",null,y))))}}]),PredictiveAnalyticsCreateTrainPaneView}(le.Component);(0,ne.default)(pt,"propTypes",{isValidTimePeriod:oe.default.func.isRequired,service:oe.default.object.isRequired,runTrainInputSearches:oe.default.bool.isRequired,timePickerAttributes:oe.default.object.isRequired,handleModelCreation:oe.default.func.isRequired,handleTrainProgress:oe.default.func.isRequired,trainingSplit:oe.default.number.isRequired,handleTrainInputSearchesDone:oe.default.func.isRequired,handleTrainTestWorkflowStepUpdate:oe.default.func.isRequired,handleTrainError:oe.default.func.isRequired,handleTrainingInProgress:oe.default.func.isRequired,savedService:oe.default.bool.isRequired,setCurrentAlgoSavedModelId:oe.default.func.isRequired,cancelChanges:oe.default.bool.isRequired,missingRegressionModels:oe.default.array.isRequired,missingClassificationModels:oe.default.array.isRequired,setMissingModels:oe.default.func.isRequired});var ft=pt;s.default=ft,i.exports=s.default},8306:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v,y,_,S=h(o(17)),T=h(o(18)),x=h(o(21)),R=h(o(22)),P=h(o(20)),L=h(o(11)),N=h(o(9)),V=h(o(2)),j=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),W=h(o(3)),K=h(o(455)),U=h(o(325)),Y=h(o(87)),$=h(o(43)),X=h(o(336)),Z=h(o(75)),ee=o(5),te=o(190),ie=o(25),ae=o(1602),ne=o(461);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,P.default)(i);if(s){var v=(0,P.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,R.default)(this,o)}}o(29);var re=W.default.img(v||(v=(0,N.default)(["\n\theight: 150px;\n\twidth: 200px;\n"]))),se=(0,W.default)(Z.default)(y||(y=(0,N.default)(["\n\tmargin-top: 20px;\n"]))),le=(0,W.default)(U.default)(_||(_=(0,N.default)(["\n\tborder: none;\n"]))),oe=function(i){(0,x.default)(PredictiveAnalyticsInstructionsPane,i);var s=_createSuper(PredictiveAnalyticsInstructionsPane);function PredictiveAnalyticsInstructionsPane(i){(0,S.default)(this,PredictiveAnalyticsInstructionsPane);for(var o=arguments.length,h=new Array(o>1?o-1:0),v=1;v<o;v++)h[v-1]=arguments[v];return s.call(this,i,...h)}return(0,T.default)(PredictiveAnalyticsInstructionsPane,[{key:"getUsageDashboardUrl",value:function getUsageDashboardUrl(){return(0,ae.uiEditURL)("predictive_analytics_usage",{service_id:this.props.serviceId})}},{key:"render",value:function render(){return j.default.createElement("div",{className:"instructionsContainer"},!1===this.props.isReadOnly&&j.default.createElement(Y.default,{"data-test-itsi":"pa-train-heading",level:4},(0,ee.gettext)("TRAIN")),!1===this.props.isReadOnly&&j.default.createElement(X.default,{"data-test-itsi":"pa-instructions-list",type:"decimal"},j.default.createElement(X.default.Item,{"data-test-itsi":"pa-instructions-list-item"},(0,ee.gettext)("Select a training period.")),j.default.createElement(X.default.Item,{"data-test-itsi":"pa-instructions-list-item"},(0,ee.gettext)("Select an algorithm type.")),j.default.createElement(X.default.Item,{"data-test-itsi":"pa-instructions-list-item"},(0,ee.gettext)("Select the algorithm. Algorithm details are listed below."),j.default.createElement(K.default,{"data-test-itsi":"pa-instructions-pane-linear-reg-card-layout"},j.default.createElement(le,{"data-test-itsi":"linear-regression-card"},j.default.createElement(U.default.Header,{title:ne.PREDICTIVE_ANALYTICS_ALGORITHM_NAMES.LINEAR_REGRESSION.name}),j.default.createElement(U.default.Body,null,j.default.createElement(re,{"data-test-itsi":"linear-regression-img",src:(0,te.createURL)("/static/app/itsi/images/predictive_analytics/LinearRegression.png"),alt:ne.PREDICTIVE_ANALYTICS_ALGORITHM_NAMES.LINEAR_REGRESSION.name}),j.default.createElement("div",null,j.default.createElement(se,{"data-test-itsi":"algorithm-linear-line-paragraph"},(0,ee.gettext)("This algorithm fits a linear line to your data, using each input (KPIs and historical service health scores) as an additional dimension. It assumes that your data is normal and is highly scalable."))))),j.default.createElement(le,{"data-test-itsi":"random-forest-card"},j.default.createElement(U.default.Header,{title:ne.PREDICTIVE_ANALYTICS_ALGORITHM_NAMES.RANDOM_FOREST.name}),j.default.createElement(U.default.Body,null,j.default.createElement(re,{"data-test-itsi":"random-forest-img",src:(0,te.createURL)("/static/app/itsi/images/predictive_analytics/RandomForest.png"),alt:ne.PREDICTIVE_ANALYTICS_ALGORITHM_NAMES.RANDOM_FOREST.name}),j.default.createElement("div",null,j.default.createElement(se,{"data-test-itsi":"algorithm-historical-paragraph"},(0,ee.gettext)('This algorithm takes the inputs (KPIs and historical service health scores) and forms a random decision tree (a "forest") to determine the output value. This model makes no assumptions about the normalcy of your data, but requires more processing power and takes longer to run.'))))),j.default.createElement(le,{"data-test-itsi":"gradient-boosting-card"},j.default.createElement(U.default.Header,{title:ne.PREDICTIVE_ANALYTICS_ALGORITHM_NAMES.GRADIENT_BOOSTING.name}),j.default.createElement(U.default.Body,null,j.default.createElement(re,{"data-test-itsi":"gradient-boosting-img",src:(0,te.createURL)("/static/app/itsi/images/predictive_analytics/GradientBoosting.png"),alt:ne.PREDICTIVE_ANALYTICS_ALGORITHM_NAMES.GRADIENT_BOOSTING.name}),j.default.createElement("div",null,j.default.createElement(se,{"data-test-itsi":"algorithm-loss-function-paragraph"},(0,ee.gettext)("This algorithm uses a loss function to fit a line to your data, a decision tree, and an additive model to predict the service health score value. Think of this as a combination of the Random Forest Regressor and Linear Regression."))))),j.default.createElement(le,{"data-test-itsi":"logistic-regression-card"},j.default.createElement(U.default.Header,{title:ne.PREDICTIVE_ANALYTICS_ALGORITHM_NAMES.LOGISTIC_REGRESSION.name}),j.default.createElement(U.default.Body,null,j.default.createElement(re,{"data-test-itsi":"logistic-regression-img",src:(0,te.createURL)("/static/app/itsi/images/predictive_analytics/LogisticRegression.png"),alt:ne.PREDICTIVE_ANALYTICS_ALGORITHM_NAMES.LOGISTIC_REGRESSION.name}),j.default.createElement("div",null,j.default.createElement(se,{"data-test-itsi":"algorithm-predictive-paragraph"},(0,ee.gettext)("This algorithm predicts a service health state (Normal, Medium, or Critical) rather than a numerical value. Use this algorithm if you have tuned KPI importance values or adaptive thresholds to normalize your service health scores."))))))),j.default.createElement(X.default.Item,{"data-test-itsi":"pa-instructions-list-item"},(0,ee.gettext)("Configure the train/test ratio to divide your data into separate training and testing sets.")),j.default.createElement(X.default.Item,{"data-test-itsi":"pa-instructions-list-item"},(0,ee.gettext)("Click")," ",j.default.createElement("b",null,(0,ee.gettext)("Train"))," ",(0,ee.gettext)("to generate a model."))),j.default.createElement(Y.default,{"data-test-itsi":"pa-test-heading",level:4},(0,ee.gettext)("TEST")),j.default.createElement(X.default,{"data-test-itsi":"pa-test-instructions-list",type:"decimal"},j.default.createElement(X.default.Item,{"data-test-itsi":"pa-test-instructions-list-item"},(0,ee.gettext)("Select a model to test.")),j.default.createElement(X.default.Item,{"data-test-itsi":"pa-test-instructions-list-item"},(0,ee.gettext)("Review the average predicted health score and worst-case scenario.")),j.default.createElement(X.default.Item,{"data-test-itsi":"pa-test-instructions-list-item"},(0,ee.gettext)("Click")," ",j.default.createElement("b",null,(0,ee.gettext)("Save"))," ",(0,ee.gettext)("to save the model into the service definition.")),j.default.createElement(X.default.Item,{"data-test-itsi":"pa-test-instructions-list-item"},(0,ee.gettext)("(Optional) Create an alert to be notified if the health score reaches the predicted worst-case level.")+" ",j.default.createElement($.default,{"data-test-itsi":"predictive-analytics-create-pa-alert-learn-more-link",to:(0,ie.makeDocsURL)("app.itsi.create_pa_alert"),openInNewContext:!0},(0,ee.gettext)("Learn more")))),j.default.createElement(Z.default,{"data-test-itsi":"use-models-rca-paragraph"},(0,ee.gettext)("To use these models to perform root cause analysis on a specific health score prediction, see the")+" ",j.default.createElement($.default,{"data-test-itsi":"pa-dashboard-link",to:this.getUsageDashboardUrl(),openInNewContext:!0},(0,ee.gettext)("Predictive Analytics Dashboard"))),j.default.createElement(Z.default,{"data-test-itsi":"add-pa-models-gt-paragraph"},(0,ee.gettext)("You can also add predictive models to glass tables.")+" ",j.default.createElement($.default,{"data-test-itsi":"predictive-analytics-pa-gt-learn-more-link",to:(0,ie.makeDocsURL)("app.itsi.add_pa_glass_table"),openInNewContext:!0},(0,ee.gettext)("Learn more"))))}}]),PredictiveAnalyticsInstructionsPane}(j.Component);(0,L.default)(oe,"propTypes",{isReadOnly:V.default.bool.isRequired,serviceId:V.default.string.isRequired});var de=oe;s.default=de,i.exports=s.default},8307:function(i,s){i.exports='<svg width="384px" height="256px" viewBox="0 0 430 256" id="svg-object-panda">\n\t\t<g id="panda" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n\t\t\t<g fill-rule="nonzero">\n\t\t\t\t<g id="head" transform="translate(0.817390, 0.685989)">\n\t\t\t\t\t<g id="ears" fill="<%- vars.legacyDarkColor %>">\n\t\t\t\t\t\t<circle id="left-ear" cx="48" cy="48" r="48"></circle>\n\t\t\t\t\t\t<circle id="right-ear" cx="284" cy="48" r="48"></circle>\n\t\t\t\t\t</g>\n\t\t\t\t\t<path d="M164.103978,247.480262 C235.58525,247.480262 277.284882,232.958631 296.397582,206.391254 C304.306519,195.397532 308.454162,182.244846 309.52341,166.499205 C310.406489,153.495068 309.265078,139.579898 306.294973,120.944352 C301.538884,91.1028714 285.44967,62.479303 261.238262,41.3671528 C235.29087,18.7412399 201.707705,6 164.220191,6 C126.731192,6 93.1394036,18.7424443 67.1885434,41.3674888 C42.9700495,62.482184 26.8839892,91.1060792 22.1459316,120.94106 C19.0004732,140.747634 17.7860088,155.020052 18.6288306,168.21226 C19.641047,184.055906 23.7530558,197.069283 31.6667392,207.84507 C50.5799027,233.598467 92.1797275,247.480262 164.103978,247.480262 Z" id="face" stroke="<%- vars.legacyDarkColor %>" stroke-width="12" fill="<%- vars.backgroundColor %>"></path>\n\t\t\t\t\t<g id="eyes" transform="translate(48.000000, 60.000000)" fill="<%- vars.legacyDarkColor %>">\n\t\t\t\t\t\t<path d="M37.5547514,92.2496213 C14.3587919,92.2496213 -2.33534898,71.5988402 0.267344078,46.1248106 C2.87003714,20.6507811 23.7839772,0 46.9799367,0 C70.1758962,0 86.8700371,20.6507811 84.2673441,46.1248106 C81.664651,71.5988402 60.7507109,92.2496213 37.5547514,92.2496213 Z M52,60 C56.418278,60 60,56.418278 60,52 C60,47.581722 56.418278,44 52,44 C47.581722,44 44,47.581722 44,52 C44,56.418278 47.581722,60 52,60 Z" id="left-eye"></path>\n\t\t\t\t\t\t<path d="M185.554751,92.2496213 C162.358792,92.2496213 145.664651,71.5988402 148.267344,46.1248106 C150.870037,20.6507811 171.783977,0 194.979937,0 C218.175896,0 234.870037,20.6507811 232.267344,46.1248106 C229.664651,71.5988402 208.750711,92.2496213 185.554751,92.2496213 Z M200,60 C204.418278,60 208,56.418278 208,52 C208,47.581722 204.418278,44 200,44 C195.581722,44 192,47.581722 192,52 C192,56.418278 195.581722,60 200,60 Z" id="right-eye" transform="translate(190.267344, 46.124811) scale(-1, 1) translate(-190.267344, -46.124811) "></path>\n\t\t\t\t\t</g>\n\t\t\t\t\t<path d="M97,179.485281 C97,170.47005 94.6666667,162.308289 90,155 C85.3333333,162.308289 83,170.47005 83,179.485281 C83,193.008129 97,193.008129 97,179.485281 Z" id="tear" fill="<%- vars.syntaxBlue %>"></path>\n\t\t\t\t\t<path d="M168,191.755534 L168,216 L160,216 L160,191.755534 C155.799638,191.09579 151.649194,189.392955 147.548668,186.647029 C145.331007,185.161966 144,182.668776 144,179.9998 L144,176 C144,171.581722 147.581722,168 152,168 L176,168 C180.418278,168 184,171.581722 184,176 L183.999998,179.999803 C183.999998,182.668779 182.668991,185.16197 180.451329,186.647031 C176.350804,189.392956 172.200361,191.09579 168,191.755534 Z" id="nose" fill="<%- vars.legacyDarkColor %>"></path>\n\t\t\t\t\t<path d="M146,222 C151.984069,216.352463 157.984069,213.528695 164,213.528695 C170.015931,213.528695 176.015931,216.352463 182,222" id="lips" stroke="<%- vars.legacyDarkColor %>" stroke-width="12" stroke-linecap="round" stroke-linejoin="round"></path>\n\t\t\t\t</g>\n\t\t\t\t<rect id="hand" fill="<%- vars.legacyDarkColor %>" x="332" y="166" width="52" height="78" rx="26"></rect>\n\t\t\t</g>\n\t\t\t<path d="M367.451214,89.8784068 C367.337111,86.7976247 365.017015,84.4775296 362.050336,84.4775296 C360.148619,84.4775296 358.399039,85.4664226 357.410146,87.1018995 C356.421253,85.5044569 354.671673,84.4775296 352.769956,84.4775296 C349.765242,84.4775296 347.445147,86.7976247 347.369079,89.8784068 C347.254976,92.9591889 349.651139,95.6596275 357.258009,100.984436 C357.296043,101.02247 357.334077,101.02247 357.372112,101.02247 L357.524249,101.02247 C357.562284,101.02247 357.600318,101.02247 357.638352,100.984436 C365.169153,95.6596275 367.565317,92.9591889 367.451214,89.8784068 Z" id="heart" fill="<%- vars.syntaxRed %>" fill-rule="nonzero"></path>\n\t\t</g>\n\t</svg>\n'},8308:function(i,s,o){var h=o(8309);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},8309:function(i,s,o){(s=o(37)(!1)).push([i.i,"@keyframes showup {\n\t0% {\n\t\tposition: fixed;\n\t\tbottom: -400px;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, -50%);\n\t}\n\t20% {\n\t\tbottom: -22px;\n\t}\n\t80% {\n\t\tbottom: -22px;\n\t}\n\t100% {\n\t\tposition: fixed;\n\t\tbottom: -400px;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, -50%);\n\t}\n}\n\n@keyframes wave {\n\t0% {\n\t\ttransform: rotate(0deg);\n\t}\n\t10% {\n\t\ttransform: rotate(40deg);\n\t}\n\t20% {\n\t\ttransform: rotate(0deg);\n\t}\n\t30% {\n\t\ttransform: rotate(-40deg);\n\t}\n\t40% {\n\t\ttransform: rotate(0deg);\n\t}\n\t50% {\n\t\ttransform: rotate(40deg);\n\t}\n\t60% {\n\t\ttransform: rotate(0deg);\n\t}\n\t70% {\n\t\ttransform: rotate(-40deg);\n\t}\n\t80% {\n\t\ttransform: rotate(0deg);\n\t}\n\t100% {\n\t\ttransform: rotate(0deg);\n\t}\n}\n\n@keyframes cry {\n\t0% {\n\t\ttransform: translate(0, 0);\n\t}\n\t50% {\n\t\ttransform: translate(0, 30px);\n\t}\n\t100% {\n\t\ttransform: translate(0, 30px);\n\t}\n}\n\n@keyframes pump {\n\t0% {\n\t\ttransform: scale(1, 1);\n\t}\n\t50% {\n\t\ttransform: scale(2.5, 2.5);\n\t}\n\t100% {\n\t\ttransform: scale(1.8, 1.8);\n\t}\n}\n\n#svg-object-panda {\n\tposition: fixed;\n\tbottom: -400px;\n\tleft: 50%;\n\ttransform: translate(-50%, -50%);\n}\n\n.happypandalips{\n\ttransform: rotate(180deg);\n\ttransform-origin: 164px 214px;\n}\n.activepanda {\n\tanimation: showup 4s cubic-bezier(0.715, 0.000, 0.400, 1.000) 1;\n}\n.wavehand {\n\ttransform-origin: 358px 244px;\n\tanimation: wave 2s linear 1;\n\tanimation-delay: 1s;\n}\n\n.tear {\n\tdisplay: block;\n\tanimation: cry 2s linear forwards;\n\tanimation-delay: 0.6s;\n}\n\n.heart {\n\tdisplay: block;\n\ttransform-origin: 357px 92.75px;\n\tanimation: pump 1s cubic-bezier(0.715, 0.000, 0.400, 1.000) forwards;\n\tanimation-delay: 0.6s;\n}\n\n",""]),i.exports=s},8310:function(i,s,o){var h=o(8311);"string"==typeof h&&(h=[[i.i,h,""]]);var v={hmr:!0,transform:void 0,insertInto:void 0};o(38)(h,v);h.locals&&(i.exports=h.locals)},8311:function(i,s,o){(s=o(37)(!1)).push([i.i,".service-definition-body .tab-layout-container {\n\tdisplay: block; /** The flex layout on IE is causing an issue */\n}\n.service-definition-body td {\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}",""]),i.exports=s},8312:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(3090)),y=h(o(1639)),_=h(o(4302)).default.extend({KpiMainContentView:v.default,ServiceHealthView:y.default});s.default=_,i.exports=s.default},8313:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(2994)),y=h(o(3098)),_=v.default.extend({initEntityRulesView:function initEntityRulesView(){this.specifyEntityRulesView=new y.default({rulesContainerModel:this.service,ruleFieldsBlockList:["services"]})}});s.default=_,i.exports=s.default},895:function(i,s,o){"use strict";var h=o(1);Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var v=h(o(17)),y=h(o(18)),_=h(o(30)),S=h(o(21)),T=h(o(22)),x=h(o(20)),R=h(o(11)),P=function _interopRequireWildcard(i,s){if(!s&&i&&i.__esModule)return i;if(null===i||"object"!=typeof i&&"function"!=typeof i)return{default:i};var o=_getRequireWildcardCache(s);if(o&&o.has(i))return o.get(i);var h={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in i)if("default"!==y&&Object.prototype.hasOwnProperty.call(i,y)){var _=v?Object.getOwnPropertyDescriptor(i,y):null;_&&(_.get||_.set)?Object.defineProperty(h,y,_):h[y]=i[y]}h.default=i,o&&o.set(i,h);return h}(o(0)),L=h(o(2)),N=h(o(39)),V=h(o(43)),j=h(o(33)),W=h(o(107)),K=o(16),U=o(5),Y=o(93);function _getRequireWildcardCache(i){if("function"!=typeof WeakMap)return null;var s=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(i){return i?o:s})(i)}function _createSuper(i){var s=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(i){return!1}}();return function _createSuperInternal(){var o,h=(0,x.default)(i);if(s){var v=(0,x.default)(this).constructor;o=Reflect.construct(h,arguments,v)}else o=h.apply(this,arguments);return(0,T.default)(this,o)}}o(29);var $=function(i){(0,S.default)(ServiceUnlinkWarningModal,i);var s=_createSuper(ServiceUnlinkWarningModal);function ServiceUnlinkWarningModal(i){var o;(0,v.default)(this,ServiceUnlinkWarningModal);for(var h=arguments.length,y=new Array(h>1?h-1:0),S=1;S<h;S++)y[S-1]=arguments[S];return o=s.call(this,i,...y),(0,R.default)((0,_.default)(o),"handleRequestClose",()=>{var{handleDeclineToUnlink:i}=o.props;i&&i(),o.setState({isModalOpen:!1})}),(0,R.default)((0,_.default)(o),"handleUnlinkConfirm",()=>{o.props.handleAcceptToUnlink(),o.setState({isModalOpen:!1})}),o.state={isModalOpen:o.props.isModalOpen},o}return(0,y.default)(ServiceUnlinkWarningModal,[{key:"render",value:function render(){var i=(0,K.sprintf)((0,U.gettext)("Unlink Service - %s"),this.props.modalTitleSubstring);return P.default.createElement("div",(0,Y.createITSITestHook)(this.constructor.name),P.default.createElement(W.default,{"data-test-itsi":"service-unlink-warning-modal",onRequestClose:this.handleRequestClose,open:this.state.isModalOpen,style:{width:"600px"}},P.default.createElement(W.default.Header,{title:i,onRequestClose:this.handleRequestClose}),P.default.createElement(W.default.Body,null,P.default.createElement(j.default,{"data-test-itsi":"unlink-service-warning-message",type:"warning",style:{paddingBottom:"0px"}},P.default.createElement("div",null,(0,K.sprintf)((0,U.gettext)("The following action will unlink %s service from its template"),this.props.serviceTitle)," (",P.default.createElement(V.default,{"data-test-itsi":"unlink-service-template-link",to:this.props.serviceTemplateUrl,openInNewContext:!0},this.props.serviceTemplateTitle)," ) ",(0,U.gettext)("upon saving the service."))),P.default.createElement("div",{style:{paddingTop:"10px"}},(0,U.gettext)("Are you sure you want to proceed?"))),P.default.createElement(W.default.Footer,null,P.default.createElement(N.default,{"data-test-itsi":"service-unlink-modal-no-button",onClick:this.handleRequestClose,label:(0,U.gettext)("No")}),P.default.createElement(N.default,{appearance:"primary","data-test-itsi":"service-unlink-modal-yes-button",onClick:this.handleUnlinkConfirm,label:(0,U.gettext)("Yes")}))))}}]),ServiceUnlinkWarningModal}(P.Component);(0,R.default)($,"propTypes",{handleAcceptToUnlink:L.default.func.isRequired,handleDeclineToUnlink:L.default.func,isModalOpen:L.default.bool,modalTitleSubstring:L.default.string.isRequired,serviceTitle:L.default.string.isRequired,serviceTemplateTitle:L.default.string.isRequired,serviceTemplateUrl:L.default.string.isRequired}),(0,R.default)($,"defaultProps",{isModalOpen:!1,handleDeclineToUnlink:null});var X=$;s.default=X,i.exports=s.default}});