@spinnaker/kayenta 2.3.0 → 2025.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/index-70b2ac83.js +2 -0
- package/build/dist/{index-ccf7a9a8.js.map → index-70b2ac83.js.map} +1 -1
- package/build/dist/index.js +1 -1
- package/build/dist/{lazy-c9b39d81.js → lazy-1f6a42b8.js} +2 -2
- package/build/dist/{lazy-c9b39d81.js.map → lazy-1f6a42b8.js.map} +1 -1
- package/build/dist/{semioticGraph-b661061c.js → semioticGraph-d687462f.js} +2 -2
- package/build/dist/{semioticGraph-b661061c.js.map → semioticGraph-d687462f.js.map} +1 -1
- package/build.gradle +67 -0
- package/gradle.properties +0 -0
- package/package.json +6 -3
- package/src/kayenta/stages/kayentaStage/kayentaStage.html +254 -212
- package/src/kayenta/stages/kayentaStage/kayentaStageExecutionDetails.html +25 -12
- package/.github/workflows/ci.yml +0 -75
- package/.github/workflows/publish_lib.yml +0 -26
- package/.husky/pre-commit +0 -6
- package/build/dist/index-ccf7a9a8.js +0 -2
- package/build_scripts/assert_package_bump.sh +0 -93
- package/build_scripts/publish_github_actions.sh +0 -40
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as e,G as t,m as n,a as r,b as a,C as i,d as o,s as l,e as s,f as c,g as u,l as p,h as d,L as m,S as f,i as h,j as b,u as g,k as v,n as y,D as E,o as w,p as x,q as N,r as S,t as C,v as O,w as _,x as k,y as T,z as j,A,B as I,E as M,F as P,U as D,H as R,I as F,K as L,J as $,M as z,N as V,O as G,P as q,Q as U,R as Y,T as K,V as B,W,X as H,Y as J,Z,_ as Q,$ as X,a0 as ee,a1 as te,a2 as ne,a3 as re,a4 as ae,a5 as ie,a6 as oe,a7 as le,a8 as se,a9 as ce,aa as ue,ab as pe,ac as de,ad as me,ae as fe,af as he,ag as be,ah as ge,ai as ve,aj as ye,ak as Ee,al as we,am as xe,an as Ne,ao as Se,ap as Ce,aq as Oe,ar as _e,as as ke,at as Te,au as je,av as Ae,aw as Ie,ax as Me,ay as Pe,az as De,aA as Re,aB as Fe,aC as Le,aD as $e,aE as ze,aF as Ve,aG as Ge,aH as qe,aI as Ue,aJ as Ye,aK as Ke,aL as Be,aM as We,aN as He,aO as Je,aP as Ze,aQ as Qe,aR as Xe,aS as et,aT as tt,aU as nt,aV as rt,aW as at,aX as it,aY as ot,aZ as lt,a_ as st,a$ as ct,b0 as ut,b1 as pt,b2 as dt,b3 as mt,b4 as ft,b5 as ht,b6 as bt,b7 as gt,b8 as vt,b9 as yt,ba as Et,bb as wt,bc as xt,bd as Nt,be as St,bf as Ct,bg as Ot,bh as _t,bi as kt,bj as Tt,bk as jt,bl as At,bm as It,bn as Mt,bo as Pt,bp as Dt,bq as Rt}from"./index-ccf7a9a8.js";import*as Ft from"react";import{Suspense as Lt}from"react";import{Spinner as $t,REST as zt,ReactInjector as Vt,timestamp as Gt,HelpField as qt,robotToHuman as Ut,noop as Yt,Tooltip as Kt,UUIDGenerator as Bt,SubmitButton as Wt,HoverablePopover as Ht,SETTINGS as Jt,CopyToClipboard as Zt,BreakString as Qt,ReactModal as Xt,ModalClose as en,TetheredSelect as tn,MapEditor as nn,relativeTime as rn}from"@spinnaker/core";import{UIView as an,UISref as on,useSref as ln}from"@uirouter/react";import{UIRouter as sn}from"@uirouter/core";import{get as cn,isString as un,isEmpty as pn,values as dn,isNull as mn,cloneDeep as fn,chain as hn,isNumber as bn,uniq as gn,flatMap as vn,sortBy as yn,round as En,isEqual as wn}from"lodash";import{Modal as xn}from"react-bootstrap";import{Formik as Nn,Form as Sn,Field as Cn}from"formik";import"angular";import"react-dom";import"prop-types";import"react-select";const On=({columns:t,className:n})=>Ft.createElement("div",{className:e("horizontal",n)},t.map(((t,n)=>Ft.createElement("div",{key:t.label||n,className:`flex-${t.width}`},!t.hide&&Ft.createElement("h6",{className:e("heading-6","uppercase","color-text-primary",t.labelClassName)},t.label)))));function _n({rows:t,columns:n,rowKey:r,tableBodyClassName:a,rowClassName:i,onRowClick:o,customRow:l,className:s,headerClassName:c}){const u=({row:t})=>Ft.createElement("li",{onClick:o?()=>o(t):null,className:e({horizontal:!i,"table-row":!i},i&&i(t))},n.map(((e,n)=>Ft.createElement("div",{key:e.label||n,className:`flex-${e.width}`},!e.hide&&e.getContent(t)))));return Ft.createElement("div",{className:s},Ft.createElement("ul",{className:e(a,"list-group")},Ft.createElement(On,{columns:n,className:e("table-header","sticky-header",c)}),t.map((e=>l&&l(e)?Ft.createElement("div",{key:r(e)},l(e)):Ft.createElement(u,{key:r(e),row:e})))))}function kn(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}var Tn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};const jn=Ft.lazy((()=>import(/* webpackChunkName: "Lazy-KayentaGraphs" */"./semioticGraph-b661061c.js"))),An=[t.TimeSeries,t.Histogram,t.BoxPlot];n.register({name:"semiotic",handlesGraphType:e=>An.includes(e),getGraph:()=>e=>Ft.createElement(Lt,{fallback:Ft.createElement($t,null)},Ft.createElement(jn,Object.assign({},e)))});var In=r((function(e,t){!function(e){function t(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function n(e,t){Object.defineProperty(this,"kind",{value:e,enumerable:!0}),t&&t.length&&Object.defineProperty(this,"path",{value:t,enumerable:!0})}function r(e,t,n){r.super_.call(this,"E",e),Object.defineProperty(this,"lhs",{value:t,enumerable:!0}),Object.defineProperty(this,"rhs",{value:n,enumerable:!0})}function i(e,t){i.super_.call(this,"N",e),Object.defineProperty(this,"rhs",{value:t,enumerable:!0})}function o(e,t){o.super_.call(this,"D",e),Object.defineProperty(this,"lhs",{value:t,enumerable:!0})}function l(e,t,n){l.super_.call(this,"A",e),Object.defineProperty(this,"index",{value:t,enumerable:!0}),Object.defineProperty(this,"item",{value:n,enumerable:!0})}function s(e,t,n){var r=e.slice((n||t)+1||e.length);return e.length=t<0?e.length+t:t,e.push.apply(e,r),e}function c(e){var t=void 0===e?"undefined":j(e);return"object"!==t?t:e===Math?"math":null===e?"null":Array.isArray(e)?"array":"[object Date]"===Object.prototype.toString.call(e)?"date":"function"==typeof e.toString&&/^\/.*\//.test(e.toString())?"regexp":"object"}function u(e,t,n,a,p,d,m){m=m||[];var f=(p=p||[]).slice(0);if(void 0!==d){if(a){if("function"==typeof a&&a(f,d))return;if("object"===(void 0===a?"undefined":j(a))){if(a.prefilter&&a.prefilter(f,d))return;if(a.normalize){var h=a.normalize(f,d,e,t);h&&(e=h[0],t=h[1])}}}f.push(d)}"regexp"===c(e)&&"regexp"===c(t)&&(e=e.toString(),t=t.toString());var b=void 0===e?"undefined":j(e),g=void 0===t?"undefined":j(t),v="undefined"!==b||m&&m[m.length-1].lhs&&m[m.length-1].lhs.hasOwnProperty(d),y="undefined"!==g||m&&m[m.length-1].rhs&&m[m.length-1].rhs.hasOwnProperty(d);if(!v&&y)n(new i(f,t));else if(!y&&v)n(new o(f,e));else if(c(e)!==c(t))n(new r(f,e,t));else if("date"===c(e)&&e-t!=0)n(new r(f,e,t));else if("object"===b&&null!==e&&null!==t)if(m.filter((function(t){return t.lhs===e})).length)e!==t&&n(new r(f,e,t));else{if(m.push({lhs:e,rhs:t}),Array.isArray(e)){var E;for(e.length,E=0;E<e.length;E++)E>=t.length?n(new l(f,E,new o(void 0,e[E]))):u(e[E],t[E],n,a,f,E,m);for(;E<t.length;)n(new l(f,E,new i(void 0,t[E++])))}else{var w=Object.keys(e),x=Object.keys(t);w.forEach((function(r,i){var o=x.indexOf(r);o>=0?(u(e[r],t[r],n,a,f,r,m),x=s(x,o)):u(e[r],void 0,n,a,f,r,m)})),x.forEach((function(e){u(void 0,t[e],n,a,f,e,m)}))}m.length=m.length-1}else e!==t&&("number"===b&&isNaN(e)&&isNaN(t)||n(new r(f,e,t)))}function p(e,t,n,r){return r=r||[],u(e,t,(function(e){e&&r.push(e)}),n),r.length?r:void 0}function d(e,t,n){if(n.path&&n.path.length){var r,a=e[t],i=n.path.length-1;for(r=0;r<i;r++)a=a[n.path[r]];switch(n.kind){case"A":d(a[n.path[r]],n.index,n.item);break;case"D":delete a[n.path[r]];break;case"E":case"N":a[n.path[r]]=n.rhs}}else switch(n.kind){case"A":d(e[t],n.index,n.item);break;case"D":e=s(e,t);break;case"E":case"N":e[t]=n.rhs}return e}function m(e,t,n){if(e&&t&&n&&n.kind){for(var r=e,a=-1,i=n.path?n.path.length-1:0;++a<i;)void 0===r[n.path[a]]&&(r[n.path[a]]="number"==typeof n.path[a]?[]:{}),r=r[n.path[a]];switch(n.kind){case"A":d(n.path?r[n.path[a]]:r,n.index,n.item);break;case"D":delete r[n.path[a]];break;case"E":case"N":r[n.path[a]]=n.rhs}}}function f(e,t,n){if(n.path&&n.path.length){var r,a=e[t],i=n.path.length-1;for(r=0;r<i;r++)a=a[n.path[r]];switch(n.kind){case"A":f(a[n.path[r]],n.index,n.item);break;case"D":case"E":a[n.path[r]]=n.lhs;break;case"N":delete a[n.path[r]]}}else switch(n.kind){case"A":f(e[t],n.index,n.item);break;case"D":case"E":e[t]=n.lhs;break;case"N":e=s(e,t)}return e}function h(e,t,n){if(e&&t&&n&&n.kind){var r,a,i=e;for(a=n.path.length-1,r=0;r<a;r++)void 0===i[n.path[r]]&&(i[n.path[r]]={}),i=i[n.path[r]];switch(n.kind){case"A":f(i[n.path[r]],n.index,n.item);break;case"D":case"E":i[n.path[r]]=n.lhs;break;case"N":delete i[n.path[r]]}}}function b(e,t,n){e&&t&&u(e,t,(function(r){n&&!n(e,t,r)||m(e,t,r)}))}function g(e){return"color: "+M[e].color+"; font-weight: bold"}function v(e){var t=e.kind,n=e.path,r=e.lhs,a=e.rhs,i=e.index,o=e.item;switch(t){case"E":return[n.join("."),r,"→",a];case"N":return[n.join("."),a];case"D":return[n.join(".")];case"A":return[n.join(".")+"["+i+"]",o];default:return[]}}function y(e,t,n,r){var a=p(e,t);try{r?n.groupCollapsed("diff"):n.group("diff")}catch(e){n.log("diff")}a?a.forEach((function(e){var t=e.kind,r=v(e);n.log.apply(n,["%c "+M[t].text,g(t)].concat(A(r)))})):n.log("—— no diff ——");try{n.groupEnd()}catch(e){n.log("—— diff end —— ")}}function E(e,t,n,r){switch(void 0===e?"undefined":j(e)){case"object":return"function"==typeof e[r]?e[r].apply(e,A(n)):e[r];case"function":return e(t);default:return e}}function w(e){var t=e.timestamp,n=e.duration;return function(e,r,a){var i=["action"];return i.push("%c"+String(e.type)),t&&i.push("%c@ "+r),n&&i.push("%c(in "+a.toFixed(2)+" ms)"),i.join(" ")}}function x(e,t){var n=t.logger,r=t.actionTransformer,a=t.titleFormatter,i=void 0===a?w(t):a,o=t.collapsed,l=t.colors,s=t.level,c=t.diff,u=void 0===t.titleFormatter;e.forEach((function(a,p){var d=a.started,m=a.startedTime,f=a.action,h=a.prevState,b=a.error,g=a.took,v=a.nextState,w=e[p+1];w&&(v=w.prevState,g=w.started-d);var x=r(f),N="function"==typeof o?o((function(){return v}),f,a):o,S=k(m),C=l.title?"color: "+l.title(x)+";":"",O=["color: gray; font-weight: lighter;"];O.push(C),t.timestamp&&O.push("color: gray; font-weight: lighter;"),t.duration&&O.push("color: gray; font-weight: lighter;");var _=i(x,S,g);try{N?l.title&&u?n.groupCollapsed.apply(n,["%c "+_].concat(O)):n.groupCollapsed(_):l.title&&u?n.group.apply(n,["%c "+_].concat(O)):n.group(_)}catch(e){n.log(_)}var T=E(s,x,[h],"prevState"),j=E(s,x,[x],"action"),A=E(s,x,[b,h],"error"),I=E(s,x,[v],"nextState");if(T)if(l.prevState){var M="color: "+l.prevState(h)+"; font-weight: bold";n[T]("%c prev state",M,h)}else n[T]("prev state",h);if(j)if(l.action){var P="color: "+l.action(x)+"; font-weight: bold";n[j]("%c action ",P,x)}else n[j]("action ",x);if(b&&A)if(l.error){var D="color: "+l.error(b,h)+"; font-weight: bold;";n[A]("%c error ",D,b)}else n[A]("error ",b);if(I)if(l.nextState){var R="color: "+l.nextState(v)+"; font-weight: bold";n[I]("%c next state",R,v)}else n[I]("next state",v);c&&y(h,v,n,N);try{n.groupEnd()}catch(e){n.log("—— log end ——")}}))}function N(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},P,e),n=t.logger,r=t.stateTransformer,a=t.errorTransformer,i=t.predicate,o=t.logErrors,l=t.diffPredicate;if(void 0===n)return function(){return function(e){return function(t){return e(t)}}};if(e.getState&&e.dispatch)return console.error("[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware:\n// Logger with default options\nimport { logger } from 'redux-logger'\nconst store = createStore(\n reducer,\n applyMiddleware(logger)\n)\n// Or you can create your own logger with custom options http://bit.ly/redux-logger-options\nimport createLogger from 'redux-logger'\nconst logger = createLogger({\n // ...options\n});\nconst store = createStore(\n reducer,\n applyMiddleware(logger)\n)\n"),function(){return function(e){return function(t){return e(t)}}};var s=[];return function(e){var n=e.getState;return function(e){return function(c){if("function"==typeof i&&!i(n,c))return e(c);var u={};s.push(u),u.started=T.now(),u.startedTime=new Date,u.prevState=r(n()),u.action=c;var p=void 0;if(o)try{p=e(c)}catch(e){u.error=a(e)}else p=e(c);u.took=T.now()-u.started,u.nextState=r(n());var d=t.diff&&"function"==typeof l?l(n,c):t.diff;if(x(s,Object.assign({},t,{diff:d})),s.length=0,u.error)throw u.error;return p}}}}var S,C,O=function(e,t){return new Array(t+1).join(e)},_=function(e,t){return O("0",t-e.toString().length)+e},k=function(e){return _(e.getHours(),2)+":"+_(e.getMinutes(),2)+":"+_(e.getSeconds(),2)+"."+_(e.getMilliseconds(),3)},T="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance:Date,j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)},I=[];S="object"===(void 0===a?"undefined":j(a))&&a?a:"undefined"!=typeof window?window:{},(C=S.DeepDiff)&&I.push((function(){void 0!==C&&S.DeepDiff===p&&(S.DeepDiff=C,C=void 0)})),t(r,n),t(i,n),t(o,n),t(l,n),Object.defineProperties(p,{diff:{value:p,enumerable:!0},observableDiff:{value:u,enumerable:!0},applyDiff:{value:b,enumerable:!0},applyChange:{value:m,enumerable:!0},revertChange:{value:h,enumerable:!0},isConflict:{value:function(){return void 0!==C},enumerable:!0},noConflict:{value:function(){return I&&(I.forEach((function(e){e()})),I=null),p},enumerable:!0}});var M={E:{color:"#2196F3",text:"CHANGED:"},N:{color:"#4CAF50",text:"ADDED:"},D:{color:"#F44336",text:"DELETED:"},A:{color:"#2196F3",text:"ARRAY:"}},P={level:"log",logger:console,logErrors:!0,collapsed:void 0,predicate:void 0,duration:!1,timestamp:!0,stateTransformer:function(e){return e},actionTransformer:function(e){return e},errorTransformer:function(e){return e},colors:{title:function(){return"inherit"},prevState:function(){return"#9E9E9E"},action:function(){return"#03A9F4"},nextState:function(){return"#4CAF50"},error:function(){return"#F20404"}},diff:!1,diffPredicate:void 0,transformer:void 0},D=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dispatch,n=e.getState;return"function"==typeof t||"function"==typeof n?N()({dispatch:t,getState:n}):void console.error("\n[redux-logger v3] BREAKING CHANGE\n[redux-logger v3] Since 3.0.0 redux-logger exports by default logger with default settings.\n[redux-logger v3] Change\n[redux-logger v3] import createLogger from 'redux-logger'\n[redux-logger v3] to\n[redux-logger v3] import { createLogger } from 'redux-logger'\n")};e.defaults=P,e.createLogger=N,e.logger=D,e.default=D,Object.defineProperty(e,"__esModule",{value:!0})}(t)}));var Mn="undefined"!=typeof window&&window,Pn="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,Dn=Mn||void 0!==a&&a||Pn,Rn=Dn;!function(){if(!Dn)throw new Error("RxJS could not find any global context (window, self, global)")}();var Fn={root:Rn};var Ln={isFunction:function(e){return"function"==typeof e}},$n={isArray:Array.isArray||function(e){return e&&"number"==typeof e.length}};var zn,Vn={isObject:function(e){return null!=e&&"object"==typeof e}},Gn={errorObject:{e:{}}};function qn(){try{return zn.apply(this,arguments)}catch(e){return Gn.errorObject.e=e,Gn.errorObject}}var Un={tryCatch:function(e){return zn=e,qn}},Yn=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},Kn={UnsubscriptionError:function(e){function t(t){e.call(this),this.errors=t;var n=Error.call(this,t?t.length+" errors occurred during unsubscription:\n "+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"");this.name=n.name="UnsubscriptionError",this.stack=n.stack,this.message=n.message}return Yn(t,e),t}(Error)},Bn=function(){function e(e){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,e&&(this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var e,t=!1;if(!this.closed){var n=this,r=n._parent,a=n._parents,i=n._unsubscribe,o=n._subscriptions;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;for(var l=-1,s=a?a.length:0;r;)r.remove(this),r=++l<s&&a[l]||null;if(Ln.isFunction(i))Un.tryCatch(i).call(this)===Gn.errorObject&&(t=!0,e=e||(Gn.errorObject.e instanceof Kn.UnsubscriptionError?Wn(Gn.errorObject.e.errors):[Gn.errorObject.e]));if($n.isArray(o))for(l=-1,s=o.length;++l<s;){var c=o[l];if(Vn.isObject(c))if(Un.tryCatch(c.unsubscribe).call(c)===Gn.errorObject){t=!0,e=e||[];var u=Gn.errorObject.e;u instanceof Kn.UnsubscriptionError?e=e.concat(Wn(u.errors)):e.push(u)}}if(t)throw new Kn.UnsubscriptionError(e)}},e.prototype.add=function(t){if(!t||t===e.EMPTY)return e.EMPTY;if(t===this)return this;var n=t;switch(typeof t){case"function":n=new e(t);case"object":if(n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if("function"!=typeof n._addParent){var r=n;(n=new e)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}return(this._subscriptions||(this._subscriptions=[])).push(n),n._addParent(this),n},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},e.prototype._addParent=function(e){var t=this._parent,n=this._parents;t&&t!==e?n?-1===n.indexOf(e)&&n.push(e):this._parents=[e]:this._parent=e},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}();function Wn(e){return e.reduce((function(e,t){return e.concat(t instanceof Kn.UnsubscriptionError?t.errors:t)}),[])}var Hn={Subscription:Bn},Jn={closed:!0,next:function(e){},error:function(e){throw e},complete:function(){}},Zn=r((function(e,t){var n=Fn.root.Symbol;t.rxSubscriber="function"==typeof n&&"function"==typeof n.for?n.for("rxSubscriber"):"@@rxSubscriber",t.$$rxSubscriber=t.rxSubscriber})),Qn=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},Xn=function(e){function t(n,r,a){switch(e.call(this),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=Jn;break;case 1:if(!n){this.destination=Jn;break}if("object"==typeof n){n instanceof t?(this.destination=n,this.destination.add(this)):(this.syncErrorThrowable=!0,this.destination=new tr(this,n));break}default:this.syncErrorThrowable=!0,this.destination=new tr(this,n,r,a)}}return Qn(t,e),t.prototype[Zn.rxSubscriber]=function(){return this},t.create=function(e,n,r){var a=new t(e,n,r);return a.syncErrorThrowable=!1,a},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parent,t=this._parents;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=e,this._parents=t,this},t}(Hn.Subscription),er=Xn,tr=function(e){function t(t,n,r,a){var i;e.call(this),this._parentSubscriber=t;var o=this;Ln.isFunction(n)?i=n:n&&(i=n.next,r=n.error,a=n.complete,n!==Jn&&(o=Object.create(n),Ln.isFunction(o.unsubscribe)&&this.add(o.unsubscribe.bind(o)),o.unsubscribe=this.unsubscribe.bind(this))),this._context=o,this._next=i,this._error=r,this._complete=a}return Qn(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber;if(this._error)t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else{if(!t.syncErrorThrowable)throw this.unsubscribe(),e;t.syncErrorValue=e,t.syncErrorThrown=!0,this.unsubscribe()}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var n=function(){return e._complete.call(e._context)};t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){throw this.unsubscribe(),e}},t.prototype.__tryOrSetError=function(e,t,n){try{t.call(this._context,n)}catch(t){return e.syncErrorValue=t,e.syncErrorThrown=!0,!0}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(Xn),nr={Subscriber:er};var rr={toSubscriber:function(e,t,n){if(e){if(e instanceof nr.Subscriber)return e;if(e[Zn.rxSubscriber])return e[Zn.rxSubscriber]()}return e||t||n?new nr.Subscriber(e,t,n):new nr.Subscriber(Jn)}},ar=r((function(e,t){function n(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}t.getSymbolObservable=n,t.observable=n(Fn.root),t.$$observable=t.observable}));var ir={noop:function(){}};function or(e){return e?1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}:ir.noop}var lr={pipe:function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return or(e)},pipeFromArray:or},sr=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this.operator,a=rr.toSubscriber(e,t,n);if(r?r.call(a,this.source):a.add(this.source?this._subscribe(a):this._trySubscribe(a)),a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.syncErrorThrown=!0,e.syncErrorValue=t,e.error(t)}},e.prototype.forEach=function(e,t){var n=this;if(t||(Fn.root.Rx&&Fn.root.Rx.config&&Fn.root.Rx.config.Promise?t=Fn.root.Rx.config.Promise:Fn.root.Promise&&(t=Fn.root.Promise)),!t)throw new Error("no Promise impl found");return new t((function(t,r){var a;a=n.subscribe((function(t){if(a)try{e(t)}catch(e){r(e),a.unsubscribe()}else e(t)}),r,t)}))},e.prototype._subscribe=function(e){return this.source.subscribe(e)},e.prototype[ar.observable]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return 0===e.length?this:lr.pipeFromArray(e)(this)},e.prototype.toPromise=function(e){var t=this;if(e||(Fn.root.Rx&&Fn.root.Rx.config&&Fn.root.Rx.config.Promise?e=Fn.root.Rx.config.Promise:Fn.root.Promise&&(e=Fn.root.Promise)),!e)throw new Error("no Promise impl found");return new e((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}(),cr=sr,ur={Observable:cr},pr=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},dr={ObjectUnsubscribedError:function(e){function t(){var t=e.call(this,"object unsubscribed");this.name=t.name="ObjectUnsubscribedError",this.stack=t.stack,this.message=t.message}return pr(t,e),t}(Error)},mr=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},fr={SubjectSubscription:function(e){function t(t,n){e.call(this),this.subject=t,this.subscriber=n,this.closed=!1}return mr(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}},t}(Hn.Subscription)},hr=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},br=function(e){function t(t){e.call(this,t),this.destination=t}return hr(t,e),t}(nr.Subscriber),gr=function(e){function t(){e.call(this),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}return hr(t,e),t.prototype[Zn.rxSubscriber]=function(){return new br(this)},t.prototype.lift=function(e){var t=new yr(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new dr.ObjectUnsubscribedError;if(!this.isStopped)for(var t=this.observers,n=t.length,r=t.slice(),a=0;a<n;a++)r[a].next(e)},t.prototype.error=function(e){if(this.closed)throw new dr.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,n=t.length,r=t.slice(),a=0;a<n;a++)r[a].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new dr.ObjectUnsubscribedError;this.isStopped=!0;for(var e=this.observers,t=e.length,n=e.slice(),r=0;r<t;r++)n[r].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(this.closed)throw new dr.ObjectUnsubscribedError;return e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){if(this.closed)throw new dr.ObjectUnsubscribedError;return this.hasError?(e.error(this.thrownError),Hn.Subscription.EMPTY):this.isStopped?(e.complete(),Hn.Subscription.EMPTY):(this.observers.push(e),new fr.SubjectSubscription(this,e))},t.prototype.asObservable=function(){var e=new ur.Observable;return e.source=this,e},t.create=function(e,t){return new yr(e,t)},t}(ur.Observable),vr=gr,yr=function(e){function t(t,n){e.call(this),this.destination=t,this.source=n}return hr(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):Hn.Subscription.EMPTY},t}(gr),Er=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};var wr=function(e,t){return function(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new xr(e,t))}},xr=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new Sr(e,this.project,this.thisArg))},e}(),Nr=xr,Sr=function(e){function t(t,n,r){e.call(this,t),this.project=n,this.count=0,this.thisArg=r||this}return Er(t,e),t.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(nr.Subscriber),Cr={map:wr,MapOperator:Nr};var Or=function(e,t){return Cr.map(e,t)(this)},_r={map:Or},kr=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},Tr={OuterSubscriber:function(e){function t(){e.apply(this,arguments)}return kr(t,e),t.prototype.notifyNext=function(e,t,n,r,a){this.destination.next(t)},t.prototype.notifyError=function(e,t){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(nr.Subscriber)},jr=function(e){return e&&"number"==typeof e.length};var Ar={isPromise:function(e){return e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}},Ir=r((function(e,t){function n(e){var t=e.Symbol;if("function"==typeof t)return t.iterator||(t.iterator=t("iterator polyfill")),t.iterator;var n=e.Set;if(n&&"function"==typeof(new n)["@@iterator"])return"@@iterator";var r=e.Map;if(r)for(var a=Object.getOwnPropertyNames(r.prototype),i=0;i<a.length;++i){var o=a[i];if("entries"!==o&&"size"!==o&&r.prototype[o]===r.prototype.entries)return o}return"@@iterator"}t.symbolIteratorPonyfill=n,t.iterator=n(Fn.root),t.$$iterator=t.iterator})),Mr=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},Pr={InnerSubscriber:function(e){function t(t,n,r){e.call(this),this.parent=t,this.outerValue=n,this.outerIndex=r,this.index=0}return Mr(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)},t.prototype._error=function(e){this.parent.notifyError(e,this),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(nr.Subscriber)};var Dr={subscribeToResult:function(e,t,n,r){var a=new Pr.InnerSubscriber(e,n,r);if(a.closed)return null;if(t instanceof ur.Observable)return t._isScalar?(a.next(t.value),a.complete(),null):(a.syncErrorThrowable=!0,t.subscribe(a));if(jr(t)){for(var i=0,o=t.length;i<o&&!a.closed;i++)a.next(t[i]);a.closed||a.complete()}else{if(Ar.isPromise(t))return t.then((function(e){a.closed||(a.next(e),a.complete())}),(function(e){return a.error(e)})).then(null,(function(e){Fn.root.setTimeout((function(){throw e}))})),a;if(t&&"function"==typeof t[Ir.iterator])for(var l=t[Ir.iterator]();;){var s=l.next();if(s.done){a.complete();break}if(a.next(s.value),a.closed)break}else if(t&&"function"==typeof t[ar.observable]){var c=t[ar.observable]();if("function"==typeof c.subscribe)return c.subscribe(new Pr.InnerSubscriber(e,n,r));a.error(new TypeError("Provided object does not correctly implement Symbol.observable"))}else{var u="You provided "+(Vn.isObject(t)?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.";a.error(new TypeError(u))}}return null}},Rr=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};var Fr=function(e,t){return function(n){return n.lift(new Lr(e,t))}},Lr=function(){function e(e,t){this.project=e,this.resultSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new $r(e,this.project,this.resultSelector))},e}(),$r=function(e){function t(t,n,r){e.call(this,t),this.project=n,this.resultSelector=r,this.index=0}return Rr(t,e),t.prototype._next=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(e){return void this.destination.error(e)}this._innerSub(t,e,n)},t.prototype._innerSub=function(e,t,n){var r=this.innerSubscription;r&&r.unsubscribe(),this.add(this.innerSubscription=Dr.subscribeToResult(this,e,t,n))},t.prototype._complete=function(){var t=this.innerSubscription;t&&!t.closed||e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.innerSubscription=null},t.prototype.notifyComplete=function(t){this.remove(t),this.innerSubscription=null,this.isStopped&&e.prototype._complete.call(this)},t.prototype.notifyNext=function(e,t,n,r,a){this.resultSelector?this._tryNotifyNext(e,t,n,r):this.destination.next(t)},t.prototype._tryNotifyNext=function(e,t,n,r){var a;try{a=this.resultSelector(e,t,n,r)}catch(e){return void this.destination.error(e)}this.destination.next(a)},t}(Tr.OuterSubscriber),zr={switchMap:Fr};var Vr=function(e,t){return zr.switchMap(e,t)(this)},Gr=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},qr={ScalarObservable:function(e){function t(t,n){e.call(this),this.value=t,this.scheduler=n,this._isScalar=!0,n&&(this._isScalar=!1)}return Gr(t,e),t.create=function(e,n){return new t(e,n)},t.dispatch=function(e){var t=e.done,n=e.value,r=e.subscriber;t?r.complete():(r.next(n),r.closed||(e.done=!0,this.schedule(e)))},t.prototype._subscribe=function(e){var n=this.value,r=this.scheduler;if(r)return r.schedule(t.dispatch,0,{done:!1,value:n,subscriber:e});e.next(n),e.closed||e.complete()},t}(ur.Observable)},Ur=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},Yr={EmptyObservable:function(e){function t(t){e.call(this),this.scheduler=t}return Ur(t,e),t.create=function(e){return new t(e)},t.dispatch=function(e){e.subscriber.complete()},t.prototype._subscribe=function(e){var n=this.scheduler;if(n)return n.schedule(t.dispatch,0,{subscriber:e});e.complete()},t}(ur.Observable)};var Kr={isScheduler:function(e){return e&&"function"==typeof e.schedule}},Br=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},Wr={ArrayObservable:function(e){function t(t,n){e.call(this),this.array=t,this.scheduler=n,n||1!==t.length||(this._isScalar=!0,this.value=t[0])}return Br(t,e),t.create=function(e,n){return new t(e,n)},t.of=function(){for(var e=[],n=0;n<arguments.length;n++)e[n-0]=arguments[n];var r=e[e.length-1];Kr.isScheduler(r)?e.pop():r=null;var a=e.length;return a>1?new t(e,r):1===a?new qr.ScalarObservable(e[0],r):new Yr.EmptyObservable(r)},t.dispatch=function(e){var t=e.array,n=e.index,r=e.count,a=e.subscriber;n>=r?a.complete():(a.next(t[n]),a.closed||(e.index=n+1,this.schedule(e)))},t.prototype._subscribe=function(e){var n=this.array,r=n.length,a=this.scheduler;if(a)return a.schedule(t.dispatch,0,{array:n,index:0,count:r,subscriber:e});for(var i=0;i<r&&!e.closed;i++)e.next(n[i]);e.complete()},t}(ur.Observable)},Hr=Wr.ArrayObservable.of,Jr={of:Hr},Zr=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};function Qr(e){var t=e.value,n=e.subscriber;n.closed||(n.next(t),n.complete())}function Xr(e){var t=e.err,n=e.subscriber;n.closed||n.error(t)}var ea={PromiseObservable:function(e){function t(t,n){e.call(this),this.promise=t,this.scheduler=n}return Zr(t,e),t.create=function(e,n){return new t(e,n)},t.prototype._subscribe=function(e){var t=this,n=this.promise,r=this.scheduler;if(null==r)this._isScalar?e.closed||(e.next(this.value),e.complete()):n.then((function(n){t.value=n,t._isScalar=!0,e.closed||(e.next(n),e.complete())}),(function(t){e.closed||e.error(t)})).then(null,(function(e){Fn.root.setTimeout((function(){throw e}))}));else if(this._isScalar){if(!e.closed)return r.schedule(Qr,0,{value:this.value,subscriber:e})}else n.then((function(n){t.value=n,t._isScalar=!0,e.closed||e.add(r.schedule(Qr,0,{value:n,subscriber:e}))}),(function(t){e.closed||e.add(r.schedule(Xr,0,{err:t,subscriber:e}))})).then(null,(function(e){Fn.root.setTimeout((function(){throw e}))}))},t}(ur.Observable)},ta=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},na=function(e){function t(t,n){if(e.call(this),this.scheduler=n,null==t)throw new Error("iterator cannot be null.");this.iterator=oa(t)}return ta(t,e),t.create=function(e,n){return new t(e,n)},t.dispatch=function(e){var t=e.index,n=e.hasError,r=e.iterator,a=e.subscriber;if(n)a.error(e.error);else{var i=r.next();i.done?a.complete():(a.next(i.value),e.index=t+1,a.closed?"function"==typeof r.return&&r.return():this.schedule(e))}},t.prototype._subscribe=function(e){var n=this.iterator,r=this.scheduler;if(r)return r.schedule(t.dispatch,0,{index:0,iterator:n,subscriber:e});for(;;){var a=n.next();if(a.done){e.complete();break}if(e.next(a.value),e.closed){"function"==typeof n.return&&n.return();break}}},t}(ur.Observable),ra=na,aa=function(){function e(e,t,n){void 0===t&&(t=0),void 0===n&&(n=e.length),this.str=e,this.idx=t,this.len=n}return e.prototype[Ir.iterator]=function(){return this},e.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.str.charAt(this.idx++)}:{done:!0,value:void 0}},e}(),ia=function(){function e(e,t,n){void 0===t&&(t=0),void 0===n&&(n=function(e){var t=+e.length;if(isNaN(t))return 0;if(0===t||(n=t,"number"!=typeof n||!Fn.root.isFinite(n)))return t;var n;if((t=function(e){var t=+e;if(0===t)return t;if(isNaN(t))return t;return t<0?-1:1}(t)*Math.floor(Math.abs(t)))<=0)return 0;if(t>la)return la;return t}(e)),this.arr=e,this.idx=t,this.len=n}return e.prototype[Ir.iterator]=function(){return this},e.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.arr[this.idx++]}:{done:!0,value:void 0}},e}();function oa(e){var t=e[Ir.iterator];if(!t&&"string"==typeof e)return new aa(e);if(!t&&void 0!==e.length)return new ia(e);if(!t)throw new TypeError("object is not iterable");return e[Ir.iterator]()}var la=Math.pow(2,53)-1;var sa={IteratorObservable:ra},ca=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},ua={ArrayLikeObservable:function(e){function t(t,n){e.call(this),this.arrayLike=t,this.scheduler=n,n||1!==t.length||(this._isScalar=!0,this.value=t[0])}return ca(t,e),t.create=function(e,n){var r=e.length;return 0===r?new Yr.EmptyObservable:1===r?new qr.ScalarObservable(e[0],n):new t(e,n)},t.dispatch=function(e){var t=e.arrayLike,n=e.index,r=e.length,a=e.subscriber;a.closed||(n>=r?a.complete():(a.next(t[n]),e.index=n+1,this.schedule(e)))},t.prototype._subscribe=function(e){var n=this.arrayLike,r=this.scheduler,a=n.length;if(r)return r.schedule(t.dispatch,0,{arrayLike:n,index:0,length:a,subscriber:e});for(var i=0;i<a&&!e.closed;i++)e.next(n[i]);e.complete()},t}(ur.Observable)},pa={Notification:function(){function e(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue="N"===e}return e.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},e.prototype.do=function(e,t,n){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return n&&n()}},e.prototype.accept=function(e,t,n){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,n)},e.prototype.toObservable=function(){switch(this.kind){case"N":return ur.Observable.of(this.value);case"E":return ur.Observable.throw(this.error);case"C":return ur.Observable.empty()}throw new Error("unexpected notification kind value")},e.createNext=function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}()},da=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};var ma=function(e,t){return void 0===t&&(t=0),function(n){return n.lift(new fa(e,t))}},fa=function(){function e(e,t){void 0===t&&(t=0),this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return t.subscribe(new ba(e,this.scheduler,this.delay))},e}(),ha=fa,ba=function(e){function t(t,n,r){void 0===r&&(r=0),e.call(this,t),this.scheduler=n,this.delay=r}return da(t,e),t.dispatch=function(e){var t=e.notification,n=e.destination;t.observe(n),this.unsubscribe()},t.prototype.scheduleMessage=function(e){this.add(this.scheduler.schedule(t.dispatch,this.delay,new ga(e,this.destination)))},t.prototype._next=function(e){this.scheduleMessage(pa.Notification.createNext(e))},t.prototype._error=function(e){this.scheduleMessage(pa.Notification.createError(e))},t.prototype._complete=function(){this.scheduleMessage(pa.Notification.createComplete())},t}(nr.Subscriber),ga=function(e,t){this.notification=e,this.destination=t},va={observeOn:ma,ObserveOnOperator:ha,ObserveOnSubscriber:ba,ObserveOnMessage:ga},ya=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},Ea={FromObservable:function(e){function t(t,n){e.call(this,null),this.ish=t,this.scheduler=n}return ya(t,e),t.create=function(e,n){if(null!=e){if("function"==typeof e[ar.observable])return e instanceof ur.Observable&&!n?e:new t(e,n);if($n.isArray(e))return new Wr.ArrayObservable(e,n);if(Ar.isPromise(e))return new ea.PromiseObservable(e,n);if("function"==typeof e[Ir.iterator]||"string"==typeof e)return new sa.IteratorObservable(e,n);if(jr(e))return new ua.ArrayLikeObservable(e,n)}throw new TypeError((null!==e&&typeof e||e)+" is not observable")},t.prototype._subscribe=function(e){var t=this.ish,n=this.scheduler;return null==n?t[ar.observable]().subscribe(e):t[ar.observable]().subscribe(new va.ObserveOnSubscriber(e,n,0))},t}(ur.Observable)}.FromObservable.create,wa={from:Ea},xa=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};var Na=function(e,t){return function(n){return n.lift(new Sa(e,t))}},Sa=function(){function e(e,t){this.predicate=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new Ca(e,this.predicate,this.thisArg))},e}(),Ca=function(e){function t(t,n,r){e.call(this,t),this.predicate=n,this.thisArg=r,this.count=0}return xa(t,e),t.prototype._next=function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}t&&this.destination.next(e)},t}(nr.Subscriber),Oa={filter:Na};var _a=function(e,t){return Oa.filter(e,t)(this)},ka={filter:_a},Ta=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var ja=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.source=e,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,cr),Ta(t,null,[{key:"of",value:function(){return new this(Hr.apply(void 0,arguments))}},{key:"from",value:function(e,t){return new this(Ea(e,t))}}]),Ta(t,[{key:"lift",value:function(e){var n=new t(this);return n.operator=e,n}},{key:"ofType",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return _a.call(this,(function(e){var n=e.type,r=t.length;if(1===r)return n===t[0];for(var a=0;a<r;a++)if(t[a]===n)return!0;return!1}))}}]),t}(),Aa="@@redux-observable/EPIC_END",Ia=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ma={adapter:{input:function(e){return e},output:function(e){return e}}};var Pa=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};var Da=function(e,t,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),function(r){return"number"==typeof t&&(n=t,t=null),r.lift(new Ra(e,t,n))}},Ra=function(){function e(e,t,n){void 0===n&&(n=Number.POSITIVE_INFINITY),this.project=e,this.resultSelector=t,this.concurrent=n}return e.prototype.call=function(e,t){return t.subscribe(new La(e,this.project,this.resultSelector,this.concurrent))},e}(),Fa=Ra,La=function(e){function t(t,n,r,a){void 0===a&&(a=Number.POSITIVE_INFINITY),e.call(this,t),this.project=n,this.resultSelector=r,this.concurrent=a,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return Pa(t,e),t.prototype._next=function(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)},t.prototype._tryNext=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(e){return void this.destination.error(e)}this.active++,this._innerSub(t,e,n)},t.prototype._innerSub=function(e,t,n){this.add(Dr.subscribeToResult(this,e,t,n))},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete()},t.prototype.notifyNext=function(e,t,n,r,a){this.resultSelector?this._notifyResultSelector(e,t,n,r):this.destination.next(t)},t.prototype._notifyResultSelector=function(e,t,n,r){var a;try{a=this.resultSelector(e,t,n,r)}catch(e){return void this.destination.error(e)}this.destination.next(a)},t.prototype.notifyComplete=function(e){var t=this.buffer;this.remove(e),this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(Tr.OuterSubscriber),$a={mergeMap:Da,MergeMapOperator:Fa,MergeMapSubscriber:La};var za={identity:function(e){return e}};var Va={mergeAll:function(e){return void 0===e&&(e=Number.POSITIVE_INFINITY),$a.mergeMap(za.identity,null,e)}};function Ga(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];var n=Number.POSITIVE_INFINITY,r=null,a=e[e.length-1];return Kr.isScheduler(a)?(r=e.pop(),e.length>1&&"number"==typeof e[e.length-1]&&(n=e.pop())):"number"==typeof a&&(n=e.pop()),null===r&&1===e.length&&e[0]instanceof ur.Observable?e[0]:Va.mergeAll(n)(new Wr.ArrayObservable(e,r))}var qa={merge:function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return function(t){return t.lift.call(Ga.apply(void 0,[t].concat(e)))}},mergeStatic:Ga};var Ua={mergeStatic:qa.mergeStatic,merge:function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return qa.merge.apply(void 0,e)(this)}}.mergeStatic;function Ya(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var Ka={concatAll:function(){return Va.mergeAll(1)}};var Ba={concat:function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return 1===e.length||2===e.length&&Kr.isScheduler(e[1])?wa.from(e[0]):Ka.concatAll()(Jr.of.apply(void 0,e))}};ur.Observable.concat=Ba.concat;var Wa=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},Ha=function(e){function t(t,n){e.call(this),this.sources=t,this.resultSelector=n}return Wa(t,e),t.create=function(){for(var e=[],n=0;n<arguments.length;n++)e[n-0]=arguments[n];if(null===e||0===arguments.length)return new Yr.EmptyObservable;var r=null;return"function"==typeof e[e.length-1]&&(r=e.pop()),1===e.length&&$n.isArray(e[0])&&(e=e[0]),0===e.length?new Yr.EmptyObservable:new t(e,r)},t.prototype._subscribe=function(e){return new Ja(e,this.sources,this.resultSelector)},t}(ur.Observable),Ja=function(e){function t(t,n,r){e.call(this,t),this.sources=n,this.resultSelector=r,this.completed=0,this.haveValues=0;var a=n.length;this.total=a,this.values=new Array(a);for(var i=0;i<a;i++){var o=n[i],l=Dr.subscribeToResult(this,o,null,i);l&&(l.outerIndex=i,this.add(l))}}return Wa(t,e),t.prototype.notifyNext=function(e,t,n,r,a){this.values[n]=t,a._hasValue||(a._hasValue=!0,this.haveValues++)},t.prototype.notifyComplete=function(e){var t=this.destination,n=this,r=n.haveValues,a=n.resultSelector,i=n.values,o=i.length;if(e._hasValue){if(this.completed++,this.completed===o){if(r===o){var l=a?a.apply(this,i):i;t.next(l)}t.complete()}}else t.complete()},t}(Tr.OuterSubscriber),Za={forkJoin:{ForkJoinObservable:Ha}.ForkJoinObservable.create};ur.Observable.forkJoin=Za.forkJoin;var Qa={fromPromise:ea.PromiseObservable.create};ur.Observable.fromPromise=Qa.fromPromise;var Xa=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};var ei=function(e){return function(t){var n=new ti(e),r=t.lift(n);return n.caught=r}},ti=function(){function e(e){this.selector=e}return e.prototype.call=function(e,t){return t.subscribe(new ni(e,this.selector,this.caught))},e}(),ni=function(e){function t(t,n,r){e.call(this,t),this.selector=n,this.caught=r}return Xa(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=void 0;try{n=this.selector(t,this.caught)}catch(t){return void e.prototype.error.call(this,t)}this._unsubscribeAndRecycle(),this.add(Dr.subscribeToResult(this,n))}},t}(Tr.OuterSubscriber),ri={catchError:ei};var ai={_catch:function(e){return ri.catchError(e)(this)}};ur.Observable.prototype.catch=ai._catch,ur.Observable.prototype._catch=ai._catch;var ii={concatMap:function(e,t){return $a.mergeMap(e,t,1)}};var oi={concatMap:function(e,t){return ii.concatMap(e,t)(this)}};ur.Observable.prototype.concatMap=oi.concatMap;var li=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},si={Action:function(e){function t(t,n){e.call(this)}return li(t,e),t.prototype.schedule=function(e,t){return this},t}(Hn.Subscription)},ci=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},ui={AsyncAction:function(e){function t(t,n){e.call(this,t,n),this.scheduler=t,this.work=n,this.pending=!1}return ci(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e,this.pending=!0;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),Fn.root.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return t;Fn.root.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n=!1,r=void 0;try{this.work(e)}catch(e){n=!0,r=!!e&&e||new Error(e)}if(n)return this.unsubscribe(),r},t.prototype._unsubscribe=function(){var e=this.id,t=this.scheduler,n=t.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null},t}(si.Action)},pi={Scheduler:function(){function e(t,n){void 0===n&&(n=e.now),this.SchedulerAction=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(n,t)},e.now=Date.now?Date.now:function(){return+new Date},e}()},di=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},mi={async:new({AsyncScheduler:function(e){function t(){e.apply(this,arguments),this.actions=[],this.active=!1,this.scheduled=void 0}return di(t,e),t.prototype.flush=function(e){var t=this.actions;if(this.active)t.push(e);else{var n;this.active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(pi.Scheduler)}.AsyncScheduler)(ui.AsyncAction)},fi=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};var hi=function(e,t){return void 0===t&&(t=mi.async),function(n){return n.lift(new bi(e,t))}},bi=function(){function e(e,t){this.dueTime=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new gi(e,this.dueTime,this.scheduler))},e}(),gi=function(e){function t(t,n,r){e.call(this,t),this.dueTime=n,this.scheduler=r,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}return fi(t,e),t.prototype._next=function(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(vi,this.dueTime,this))},t.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},t.prototype.debouncedNext=function(){this.clearDebounce(),this.hasValue&&(this.destination.next(this.lastValue),this.lastValue=null,this.hasValue=!1)},t.prototype.clearDebounce=function(){var e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)},t}(nr.Subscriber);function vi(e){e.debouncedNext()}var yi={debounceTime:hi};var Ei={debounceTime:function(e,t){return void 0===t&&(t=mi.async),yi.debounceTime(e,t)(this)}};ur.Observable.prototype.debounceTime=Ei.debounceTime,ur.Observable.prototype.filter=ka.filter,ur.Observable.prototype.map=_r.map;var wi=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};var xi=function(e){return function(t){return t.lift(new Ni(e))}},Ni=function(){function e(e){this.value=e}return e.prototype.call=function(e,t){return t.subscribe(new Si(e,this.value))},e}(),Si=function(e){function t(t,n){e.call(this,t),this.value=n}return wi(t,e),t.prototype._next=function(e){this.destination.next(this.value)},t}(nr.Subscriber),Ci={mapTo:xi};var Oi={mapTo:function(e){return Ci.mapTo(e)(this)}};ur.Observable.prototype.mapTo=Oi.mapTo;const _i=(...e)=>t=>e.includes(t.type),ki=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return Ua.apply(void 0,Ya(t.map((function(e){var t=e.apply(void 0,n);if(!t)throw new TypeError('combineEpics: one of the provided Epics "'+(e.name||"<anonymous>")+"\" does not return a stream. Double check you're not missing a return statement!");return t}))))}}((e=>e.filter(_i(J,H)).concatMap((e=>cr.fromPromise(u(e.payload.id)).map((e=>p({config:e}))).catch((e=>cr.of(d({error:e}))))))),(e=>e.filter(_i(m)).map((e=>l({config:e.payload.config})))),((e,t)=>e.filter(_i(f)).concatMap((()=>{const e=h(t.getState());let n;return e.isNew?(delete e.isNew,n=b(e)):n=g(e),cr.fromPromise(n).concatMap((({canaryConfigId:e})=>cr.forkJoin(Vt.$state.go("^.configDetail",{id:e,copy:!1,new:!1}),t.getState().data.application.getDataSource("canaryConfigs").refresh(!0)).mapTo(v({id:e})))).catch((e=>cr.of(y({error:e}))))}))),((e,t)=>e.filter(_i(E)).concatMap((()=>cr.fromPromise(w(t.getState().selectedConfig.config.id)).mapTo(x()).catch((e=>cr.of(N({error:e}))))))),((e,t)=>e.filter(_i(S)).concatMap((()=>cr.forkJoin(Vt.$state.go("^.configDefault"),t.getState().data.application.getDataSource("canaryConfigs").refresh(!0)))).mapTo(C())),(e=>e.filter(_i(O)).concatMap((e=>cr.fromPromise(_(e.payload.configId,e.payload.runId)).map((e=>k({run:e}))).catch((e=>cr.of(T({error:e}))))))),((e,t)=>e.filter(_i(j)).concatMap((e=>{const n=A(t.getState());return cr.fromPromise(I(n.metricSetPairListId,e.payload.pairId)).map((e=>M({metricSetPair:e}))).catch((e=>cr.of(P({error:e}))))}))),((e,t)=>e.filter(_i($)).filter((e=>e.payload.filter&&e.payload.filter.length>2)).debounceTime(200).map((e=>{const[n]=t.getState().data.kayentaAccounts.data.filter((e=>e.supportedTypes.includes(L.MetricsStore)&&"graphite"===e.type)).map((e=>e.name));return R({filter:e.payload.filter,metricsAccountName:n})}))),(e=>e.filter(_i(D)).filter((e=>e.payload.filter&&e.payload.filter.length>2)).debounceTime(200).map((e=>R({filter:e.payload.filter,metricsAccountName:e.payload.metricsAccountName})))),((e,t)=>e.filter(_i(F)).filter((e=>e.payload.filter&&e.payload.filter.length>2)).debounceTime(200).map((e=>{const[n]=t.getState().data.kayentaAccounts.data.filter((e=>e.supportedTypes.includes(L.MetricsStore)&&"stackdriver"===e.metricsStoreType)).map((e=>e.name));return R({filter:e.payload.filter,metricsAccountName:n})}))),((e,t)=>e.filter(_i(z)).filter((e=>e.payload.filter&&e.payload.filter.length>2)).debounceTime(200).map((e=>{const[n]=t.getState().data.kayentaAccounts.data.filter((e=>e.supportedTypes.includes(L.MetricsStore)&&"datadog"===e.type)).map((e=>e.name));return R({filter:e.payload.filter,metricsAccountName:n})}))),(e=>e.filter(_i(V)).concatMap((e=>cr.fromPromise(((e,t)=>zt("/v2/canaries/metadata/metricsService").query({filter:e,metricsAccountName:t}).get())(e.payload.filter,e.payload.metricsAccountName)).map((e=>G({data:e}))).catch((e=>cr.of(q({error:e}))))))),(e=>e.filter(_i(Y,U)).concatMap((()=>cr.fromPromise(K()).map((e=>B({accounts:e}))).catch((e=>cr.of(W({error:e})))))))),Ti=[function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ma;if("function"!=typeof e)throw new TypeError("You must provide a root Epic to createEpicMiddleware");t=Ia({},Ma,t);var n=new vr,r=t.adapter.input(new ja(n)),a=new vr,i=void 0,o=function(o){return i=o,function(o){var l;return(l=Or.call(a,(function(e){var n="dependencies"in t?e(r,i,t.dependencies):e(r,i);if(!n)throw new TypeError('Your root Epic "'+(e.name||"<anonymous>")+"\" does not return a stream. Double check you're not missing a return statement!");return n})),Vr).call(l,(function(e){return t.adapter.output(e)})).subscribe(i.dispatch),a.next(e),function(e){var t=o(e);return n.next(e),t}}};return o.replaceEpic=function(e){i.dispatch({type:Aa}),a.next(e)},o}(ki),e=>t=>n=>{switch(n.type){case s:{const n=c(e.getState()),r=l({config:n});return t(r)}case i:{const n=o(e.getState()),r=l({config:n});return t(r)}default:return t(n)}},e=>t=>n=>{let r=!1,a=[];const i=()=>{a.forEach((t=>e.dispatch(t))),a=[]},o=t(Object.assign(Object.assign({},n),{asyncDispatch:e=>{a.push(e),r&&i()}}));return r=!0,i(),o}],ji=Z(X,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n,r,a){var i,o=e(n,r,a),l=o.dispatch,s={getState:o.getState,dispatch:function(e){return l(e)}};return i=t.map((function(e){return e(s)})),l=kn.apply(void 0,i)(o.dispatch),Tn({},o,{dispatch:l})}}}(...Q.reduxLogger?[...Ti,In.logger]:Ti));class Ai extends Ft.Component{constructor(e){super(e),this.store=ji,this.initializeAppState(e.app)}componentWillReceiveProps(e){this.props.app.name!==e.app.name&&this.initializeAppState(e.app)}initializeAppState(e){this.store.dispatch({type:U,state:{data:{application:e,configSummaries:e.getDataSource("canaryConfigs").data,judges:e.getDataSource("canaryJudges").data}}})}render(){return Ft.createElement(ee,{className:"kayenta-root vertical"},Ft.createElement(te,{store:this.store},Ft.createElement("div",{className:"vertical flex-1"},Ft.createElement(an,Object.assign({},{wrap:!1},{name:"canary"})))))}}class Ii{onRequesting(e){return this.requesting=e,this}onFulfilled(e){return this.fulfilled=e,this}onFailed(e){return this.failed=e,this}build(){return({state:e})=>{switch(e){case se.Requesting:return this.requesting||Ft.createElement("div",{className:"horizontal center middle spinner-container"},Ft.createElement($t,null));case se.Fulfilled:return this.fulfilled;case se.Failed:return this.failed}}}}function Mi({dateIso:e}){return e?Ft.createElement("span",null,Gt(new Date(e).getTime())):Ft.createElement("span",null,"N/A")}var Pi=ce((function(e){return{disabled:cn(e.selectedConfig,"config.isNew")||e.app.disableConfigEdit||Q.disableConfigEdit}}))((function({disabled:e}){return Ft.createElement(on,{to:"^.configDetail",params:{copy:!0}},Ft.createElement("button",{className:"passive",disabled:e},Ft.createElement("i",{className:"fa fa-copy"}),Ft.createElement("span",null,"Copy")))}));var Di=ce(null,(function(e){return{openConfigJsonModal:()=>e(pe())}}))((function({openConfigJsonModal:e}){return Ft.createElement("div",null,Ft.createElement("button",{className:"passive",onClick:e},Ft.createElement("i",{className:"far fa-file-code"}),Ft.createElement("span",null,"JSON")),Ft.createElement(ue,null))}));var Ri=ce((function(e){return{show:e.app.deleteConfigModalOpen,selectedConfigName:e.selectedConfig.config?e.selectedConfig.config.name:null,deleteConfigState:e.selectedConfig.destroy.state,deleteConfigErrorMessage:e.selectedConfig.destroy.error}}),(function(e){return{closeDeleteConfigModal:()=>e(C()),deleteConfig:()=>e(de())}}))((function({show:t,selectedConfigName:n,deleteConfigState:r,deleteConfigErrorMessage:a,closeDeleteConfigModal:i,deleteConfig:o}){return Ft.createElement(xn,{show:t,onHide:null},Ft.createElement(ee,null,Ft.createElement(xn.Header,null,Ft.createElement(xn.Title,null,"Really delete ",n,"?")),r===se.Failed&&Ft.createElement(xn.Body,null,Ft.createElement("span",{className:e("alert","alert-danger")},function(e){const t="The was an error deleting your config";return e?t+`: ${e}.`:t+"."}(a))),Ft.createElement(xn.Footer,null,Ft.createElement("ul",{className:"list-inline pull-right"},Ft.createElement("li",null,Ft.createElement("button",{className:"passive",onClick:i},"Cancel")),Ft.createElement("li",null,Ft.createElement("button",{className:"primary",onClick:o},"Delete"))))))}));var Fi=ce((function(e){return{disabled:e.selectedConfig.config&&e.selectedConfig.config.isNew||Q.disableConfigEdit}}),(function(e){return{openDeleteConfigModal:()=>e(he())}}))((function({openDeleteConfigModal:e,disabled:t}){return Ft.createElement("div",null,Ft.createElement(me,{className:"passive",disabled:t||Q.disableConfigEdit,onClick:e,disabledStateKeys:[fe]},Ft.createElement("i",{className:"fa fa-trash"}),Ft.createElement("span",null,"Delete")),Ft.createElement(Ri,null))}));function Li(){return Ft.createElement("ul",{className:"list-inline pull-right"},Ft.createElement("li",null,Ft.createElement(Di,null)),Ft.createElement("li",null,Ft.createElement(Pi,null)),Ft.createElement("li",null,Ft.createElement(Fi,null)))}const $i=({owners:e})=>Ft.createElement("div",{className:"horizontal middle well-compact alert alert-warning config-detail-edit-warning"},Ft.createElement("i",{className:"fa fa-exclamation-triangle sp-margin-m-right"}),Ft.createElement("span",null,Ft.createElement("b",null,"Editing is disabled because this config is owned by"," ",e.length>1?`${e.length} other applications`:"another application",".")," ","To edit, view in ",(e=>{if(1===e.length)return Ft.createElement(on,{to:".",params:{application:e[0]}},Ft.createElement("a",null,e[0]));{const t=e.length-1;return e.map(((n,r)=>Ft.createElement(Ft.Fragment,{key:n},r===t?"or ":"",Ft.createElement(on,{to:".",params:{application:n}},Ft.createElement("a",null,n)),r<t&&2===e.length?" ":"",r<t&&e.length>2?", ":"")))}})(e))),zi=()=>Ft.createElement("div",{className:"horizontal middle well-compact alert alert-warning config-detail-edit-warning"},Ft.createElement("i",{className:"fa fa-exclamation-triangle sp-margin-m-right"}),Ft.createElement("span",null,Ft.createElement("b",null,"Canary config is locked and does not allow modification")));var Vi=ce((function(e){return{selectedConfig:h(e),editingDisabled:e.app.disableConfigEdit,disableConfigEdit:Q.disableConfigEdit}}))((function({selectedConfig:e,editingDisabled:t,disableConfigEdit:n}){return Ft.createElement("div",{className:"vertical"},Ft.createElement("div",{className:"horizontal config-detail-header"},Ft.createElement("div",{className:"flex-3"},Ft.createElement("h1",{className:"heading-1 color-text-primary"},e?e.name:"")),Ft.createElement("div",{className:"flex-1"},Ft.createElement("h5",{className:"heading-5"},Ft.createElement("strong",null,"Edited:")," ",Ft.createElement(Mi,{dateIso:e?e.updatedTimestampIso:""}))),Ft.createElement("div",{className:"flex-2"},Ft.createElement(Li,null))),e&&t&&!n&&Ft.createElement($i,{owners:e.applications}),e&&n&&Ft.createElement(zi,null))}));var Gi=ce((function(e){var t,n,r,a,i,o;return{metricId:e.selectedConfig.editingMetric.id,direction:null!==(r=null===(n=null===(t=e.selectedConfig.editingMetric.analysisConfigurations)||void 0===t?void 0:t.canary)||void 0===n?void 0:n.direction)&&void 0!==r?r:"either",disabled:e.app.disableConfigEdit||Q.disableConfigEdit,effectSizes:null!==(o=null===(i=null===(a=e.selectedConfig.editingMetric.analysisConfigurations)||void 0===a?void 0:a.canary)||void 0===i?void 0:i.effectSize)&&void 0!==o?o:{}}}),(function(e){return{updateEffectSize:(t,n)=>e(ye({id:t,value:n}))}}))((function({effectSizes:e={},updateEffectSize:t,direction:n,metricId:r,disabled:a}){const[i,o]=Ft.useState(!!Object.keys(e).length),[l]=Ft.useState("cles"===e.measure),s=Ft.createElement("p",null,'Effect sizes should be used when your canary data produces a lot of metrics that flag as "high", but where you only want the test to fail if they are sufficiently larger or smaller than the control data.');if(!i&&a)return null;if(!i)return Ft.createElement(be,{label:"Effect Sizes"},s,Ft.createElement("button",{className:"passive",onClick:()=>o(!0)},"Configure effect sizes"));const c="cles"===e.measure,u=c?.5:1,{allowedIncrease:p=u,criticalIncrease:d=u,allowedDecrease:m=u,criticalDecrease:f=u,measure:h="meanRatio"}=e,b=n=>{t(r,Object.assign(Object.assign({},e),{measure:n.target.value}))},g=(e,t)=>{const n=Number(t)/100;return e.endsWith("Increase")?1+n:1-n},v=(e,t)=>{const n=t.endsWith("Increase")?e-1:1-e;return Math.round(100*n)},y=Ft.createElement(Ft.Fragment,null,"CLES ",Ft.createElement(qt,{id:"canary.config.effectSize.cles"})),E=(n,a)=>Ft.createElement("div",{className:"form-group flex-1"},Ft.createElement("label",null,Ut(n)),Ft.createElement("div",{className:"row"},Ft.createElement("div",{className:"col-md-4"},Ft.createElement("div",{className:"input-group effect-size-wrapper"},Ft.createElement(ve,{className:"form-control input-sm",type:"number",min:0,step:c?.01:1,onChange:a=>((n,a)=>{const i=c?Number(a):g(n,a),o=Object.assign(Object.assign({},e),{[n]:i});i===u&&delete o[n],t(r,o)})(n,a.target.value),value:c?a:v(a,n),disabled:Q.disableConfigEdit,disabledStateKeys:[fe]}),!c&&Ft.createElement("div",{className:"input-group-addon"},"%")))),a===u?Ft.createElement(qt,{expand:!0,content:"(will not affect metric evaluation)"}):null);return Ft.createElement(be,{label:"Effect Sizes"},s,Ft.createElement("div",{className:"vertical",style:{marginTop:"5px"}},l&&Ft.createElement("div",{className:"form-group vertical"},Ft.createElement("label",null,"Measurement Type"),Ft.createElement("div",null,Ft.createElement(ge,{value:"meanRatio",label:"Mean (default)",name:"measure",current:h,action:b}),Ft.createElement(ge,{value:"cles",label:y,name:"measure",current:h,action:b}))),Ft.createElement("label",{className:"sp-margin-m-top"},"Allowed Effects"),Ft.createElement("p",null,"If the canary surpasses the baseline by the supplied (non-zero) percentage, the ",Ft.createElement("em",null,"metric")," will fail."),Ft.createElement("div",{className:"horizontal"},"increase"!==n&&E("allowedDecrease",m),"decrease"!==n&&E("allowedIncrease",p)),Ft.createElement("label",{className:"sp-margin-m-top"},"Critical Effects"),Ft.createElement("p",null,"If the canary surpasses the baseline by the supplied (non-zero) percentage, the ",Ft.createElement("em",null,"entire analysis")," will fail with a score of 0."),Ft.createElement("div",{className:"horizontal"},"increase"!==n&&E("criticalDecrease",f),"decrease"!==n&&E("criticalIncrease",d))))}));Ee(".template-editor-textarea {\n min-width: 100%;\n max-width: 100%;\n}\n.template-editor-value-formatted {\n margin: 0;\n}\n.filter-template-option {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n");class qi extends Ft.Component{constructor(){super(...arguments),this.getOptions=()=>{const e=Object.keys(this.props.templates).map((e=>({value:e,label:e,requestingNew:!1})));return e.push({value:null,label:null,requestingNew:!0}),e},this.optionRenderer=e=>e.requestingNew?Ft.createElement("span",null,"Create new..."):Ft.createElement("span",{className:"filter-template-option"},Ft.createElement("span",null,e.label),Ft.createElement("span",null,Ft.createElement("button",{className:"link",onMouseDown:t=>this.props.deleteTemplate(t,e.value)},"Delete"),Ft.createElement("button",{className:"link",onMouseDown:t=>this.props.editTemplateBegin(t,e.value,this.props.templates[e.value])},"Edit")))}render(){const{editedTemplateName:e,editedTemplateValue:t,editTemplateCancel:n,editTemplateConfirm:r,editTemplateName:a,editTemplateValue:i,selectTemplate:o,selectedTemplateName:l,templates:s,validation:c}=this.props,u=un(e)&&un(t);return Ft.createElement(Ft.Fragment,null,Ft.createElement(be,{label:"Filter Template",helpId:"canary.config.filterTemplate",inputOnly:!0},!u&&Ft.createElement(we,{value:l,disabledStateKeys:[fe],disabled:Q.disableConfigEdit,onChange:o,options:this.getOptions(),optionRenderer:this.optionRenderer})),u&&Ft.createElement(Ft.Fragment,null,Ft.createElement(be,{label:"Name",error:cn(c,"errors.templateName.message"),inputOnly:!0},Ft.createElement(ve,{disabledStateKeys:[fe],disabled:Q.disableConfigEdit,onChange:a,value:e})),Ft.createElement(be,{label:"Template",inputOnly:!0,error:cn(c,"errors.templateValue.message"),warning:cn(c,"warnings.template.message")},Ft.createElement(xe,{className:"template-editor-textarea",disabledStateKeys:[fe],disabled:Q.disableConfigEdit,onChange:i,value:t})),Ft.createElement(be,null,Ft.createElement("div",{className:"horizontal pull-right"},Ft.createElement("button",{className:"link",onClick:n},"Cancel"),Ft.createElement("button",{className:"link",disabled:[c.errors.templateName,c.errors.templateValue].some((e=>null!=e)),onClick:r},"Save")))),!u&&l&&Ft.createElement(be,null,Ft.createElement("pre",{className:"template-editor-value-formatted"},s[l])))}}var Ui=ce((e=>({editedTemplateName:cn(Ne(e),"editedName"),editedTemplateValue:cn(Ne(e),"editedValue"),selectedTemplateName:Se(e),templates:Ce(e),validation:Oe(e)})),(e=>({deleteTemplate:(t,n)=>{t.stopPropagation(),e(_e({name:null})),e(ke({name:n}))},editTemplateBegin:(t,n,r)=>{t.stopPropagation(),e(_e({name:n})),e(Te({name:n,value:r}))},editTemplateCancel:()=>e(je()),editTemplateConfirm:()=>e(Ae()),editTemplateName:t=>e(Ie({name:t.target.value})),editTemplateValue:t=>e(Me({value:t.target.value})),selectTemplate:t=>{t&&!0===t.requestingNew?(e(_e({name:null})),e(Pe())):e(_e({name:t?t.value:null}))}})))(qi);var Yi=ce((function(e){return{templateValue:De(e),transformValueForSave:Re(e)}}),(function(e){return{editTemplateValue:t=>e(Fe({value:t}))}}))((function({editTemplateValue:e,templateValue:t,transformValueForSave:n}){return Ft.createElement(be,{label:"Template",inputOnly:!0,helpId:"canary.config.filterTemplate",error:pn(t)&&"Template is required"},Ft.createElement(xe,{className:"template-editor-textarea",disabledStateKeys:[fe],disabled:Q.disableConfigEdit,onChange:t=>e(n(t.target.value)),value:t}))}));var Ki=ce((function(e){return{editingMetric:e.selectedConfig.editingMetric}}))((function({editingMetric:e}){const t=Le.getDelegate(e.query.type);if(t&&t.metricConfigurer){const e=t.metricConfigurer;return Ft.createElement(e,null)}return Ft.createElement("p",null,"Metric configuration has not been implemented for ",e.query.type,".")}));Ee(".kayenta-edit-metric-modal .modal-content {\n overflow: visible;\n}\n.kayenta-edit-metric-modal .effect-size-wrapper {\n width: 100px;\n}\n");var Bi=ce((function(e){return{metric:e.selectedConfig.editingMetric,groups:e.selectedConfig.group.list.sort(),isTemplateValid:Be(e),useInlineTemplateEditor:We(e),disableEdit:e.app.disableConfigEdit||Q.disableConfigEdit,validationErrors:He(e)}}),(function(e){return{rename:t=>{e(ze({id:t.target.dataset.id,name:t.target.value}))},changeGroup:t=>{e(Ve({id:t.target.dataset.id,group:t.target.value}))},cancel:()=>{e(Ge()),e(je())},confirm:()=>{e(qe()),e(je())},updateDirection:({target:t})=>{e(Ue({id:t.dataset.id,direction:t.value}))},updateNanStrategy:({target:t})=>{e(Ye({id:t.dataset.id,strategy:t.value}))},updateCriticality:({target:t})=>{e(Ke({id:t.dataset.id,critical:Boolean(t.checked)}))}}}))((function({metric:t,rename:n,changeGroup:r,groups:a,confirm:i,cancel:o,isTemplateValid:l,updateDirection:s,updateNanStrategy:c,updateCriticality:u,useInlineTemplateEditor:p,disableEdit:d,validationErrors:m}){var f,h,b,g,v,y,E,w,x,N,S;if(!t)return null;const C=null!==(b=null===(h=null===(f=t.analysisConfigurations)||void 0===f?void 0:f.canary)||void 0===h?void 0:h.direction)&&void 0!==b?b:"either",O=null!==(y=null===(v=null===(g=t.analysisConfigurations)||void 0===g?void 0:g.canary)||void 0===v?void 0:v.nanStrategy)&&void 0!==y?y:"default",_=null!==(x=null===(w=null===(E=t.analysisConfigurations)||void 0===E?void 0:E.canary)||void 0===w?void 0:w.critical)&&void 0!==x&&x,k=!l||d||Q.disableConfigEdit||dn(m).some((e=>!mn(e))),T=t.groups.length?t.groups[0]:a[0],j=Le.getDelegate(t.query.type)&&Le.getDelegate(t.query.type).useTemplates&&Q.templatesEnabled;return Ft.createElement(xn,{bsSize:"large",show:!0,onHide:Yt,className:e("kayenta-edit-metric-modal")},Ft.createElement(ee,null,Ft.createElement(xn.Header,null,Ft.createElement(xn.Title,null,d||Q.disableConfigEdit?"Metric Details":"Configure Metric")),Ft.createElement(xn.Body,null,Ft.createElement(be,{label:"Group",inputOnly:!0},t.groups.length>1&&Ft.createElement(ve,{type:"text",value:t.groups,"data-id":t.id,onChange:r,disabled:Q.disableConfigEdit,disabledStateKeys:[fe]}),t.groups.length<2&&Ft.createElement($e,{value:T,onChange:r,className:"form-control input-sm",disabled:Q.disableConfigEdit,disabledStateKeys:[fe]},a.map((e=>Ft.createElement("option",{key:e,value:e},e))))),Ft.createElement(be,{label:"Name",error:null!==(S=null===(N=null==m?void 0:m.name)||void 0===N?void 0:N.message)&&void 0!==S?S:null,inputOnly:!0},Ft.createElement(ve,{type:"text",value:t.name,"data-id":t.id,onChange:n,disabled:Q.disableConfigEdit,disabledStateKeys:[fe]})),Ft.createElement(be,{label:"Fail on"},Ft.createElement(ge,{value:"increase",label:"Increase",name:"direction",current:C,action:s}),Ft.createElement(ge,{value:"decrease",label:"Decrease",name:"direction",current:C,action:s}),Ft.createElement(ge,{value:"either",label:"Either",name:"direction",current:C,action:s})),Ft.createElement(be,{label:"Criticality",checkbox:!0},Ft.createElement("label",null,Ft.createElement(ve,{type:"checkbox",checked:_,onChange:u,disabled:Q.disableConfigEdit,disabledStateKeys:[fe]}),"Fail the canary if this metric fails")),Ft.createElement(be,{label:"NaN Strategy",helpId:"canary.config.nanStrategy"},Ft.createElement(ge,{value:"default",label:"Default (remove)",name:"nanStrategy",current:O,action:c}),Ft.createElement(ge,{value:"replace",label:"Replace with zero",name:"nanStrategy",current:O,action:c}),Ft.createElement(ge,{value:"remove",label:"Remove",name:"nanStrategy",current:O,action:c})),Ft.createElement(Gi,null),Ft.createElement(Ki,null),j&&!p&&Ft.createElement(Ui,null),j&&p&&Ft.createElement(Yi,null)),Ft.createElement(xn.Footer,null,Ft.createElement("ul",{className:"list-inline pull-right"},Ft.createElement("li",null,Ft.createElement("button",{className:"passive",onClick:o},"Cancel")),Ft.createElement("li",null,Ft.createElement("button",{className:"primary",disabled:k,onClick:i},"OK"))))))}));function Wi({title:e,children:t}){return Ft.createElement("section",{className:"pod open titled-section"},Ft.createElement("div",{className:"header horizontal middle"},Ft.createElement("div",{className:"flex-1 heading-2 uppercase"},e)),Ft.createElement("div",{className:"contents vertical"},t))}Ee(".kayenta .titled-section {\n margin-bottom: 1em;\n}\n.kayenta .titled-section .contents {\n margin: 10px 10px 0 10px;\n background-color: var(--color-white);\n border: 1px solid var(--color-cirrus);\n padding: 15px;\n}\n.kayenta .titled-section .contents .list-group {\n margin-bottom: 5px;\n}\n");var Hi=ce((function(e,{metric:t}){return{groups:e.selectedConfig.group.list.filter((e=>t.groups.length>1||!t.groups.includes(e))),toGroup:e.selectedConfig.changeMetricGroup.toGroup}}),(function(e,{metric:t}){return{select:t=>{e(Je({group:t.target.value||null}))},clear:()=>{e(Ze({metricId:null}))},confirm:()=>{e(Ze({metricId:t.id}))}}}))((function({groups:e,toGroup:t,confirm:n,clear:r,select:a}){return Ft.createElement(xn,{show:!0,onHide:Yt},Ft.createElement(ee,null,Ft.createElement(xn.Header,null,Ft.createElement(xn.Title,null,"Change Metric Group")),Ft.createElement(xn.Body,null,Ft.createElement($e,{value:t||"",onChange:a,className:"form-control input-sm",disabled:Q.disableConfigEdit,disabledStateKeys:[fe]},Ft.createElement("option",{value:""},"-- select group --"),e.map((e=>Ft.createElement("option",{key:e,value:e},e))))),Ft.createElement(xn.Footer,null,Ft.createElement("ul",{className:"list-inline pull-right"},Ft.createElement("li",null,Ft.createElement("button",{className:"passive",onClick:r},"Cancel")),Ft.createElement("li",null,Ft.createElement("button",{className:"primary",disabled:!t,onClick:n},"OK"))))))}));function Ji({metric:t}){var n,r,a,i;const o=null===(r=null===(n=t.analysisConfigurations)||void 0===n?void 0:n.canary)||void 0===r?void 0:r.direction,l=null===(i=null===(a=t.analysisConfigurations)||void 0===a?void 0:a.canary)||void 0===i?void 0:i.critical,s=l?"(critical — if this metric fails, the entire canary will fail)":"",c=e("metric-fail-on-icon","fas","sp-margin-xs-right",{critical:l});return"decrease"===o?Ft.createElement(Kt,{value:`decrease ${s}`},Ft.createElement("i",{className:`fa-caret-square-down ${c}`})):"increase"===o?Ft.createElement(Kt,{value:`increase ${s}`},Ft.createElement("i",{className:`fa-caret-square-up ${c}`})):Ft.createElement(Kt,{value:`increase OR decrease ${s}`},Ft.createElement("span",null,Ft.createElement("i",{className:`fa-caret-square-down ${c}`}),Ft.createElement("i",{className:`fa-caret-square-up ${c}`})))}Ee(".metrics-action-buttons .link {\n padding: 0 12px;\n}\n.metric-filter-options label {\n font-weight: 600;\n margin: 6px;\n padding: 6px 12px;\n border: 1px solid var(--color-divider);\n}\n.metric-fail-on-icon {\n color: var(--color-warning);\n}\n.metric-fail-on-icon.critical {\n color: var(--color-danger);\n}\n");var Zi=ce((function(e){const t=e.selectedConfig.group.selected,n=e.selectedConfig.metricList,r=t?e=>e.groups.includes(t):()=>!0;return{selectedGroup:t,groupList:e.selectedConfig.group.list,metrics:n.filter(r),showGroups:!t||n.filter(r).some((e=>e.groups.length>1)),changingGroupMetric:e.selectedConfig.metricList.find((t=>t.id===e.selectedConfig.changeMetricGroup.metric)),metricStore:e.selectedConfig.selectedStore,disableEdit:e.app.disableConfigEdit||Q.disableConfigEdit}}),(function(e){return{addMetric:t=>{const n=t.target.dataset.group||t.target.dataset.default;e(Xe({metric:{id:"[new]",analysisConfigurations:{},name:"",query:{type:t.target.dataset.metricStore,serviceType:t.target.dataset.metricStore},groups:n?[n]:[],scopeName:"default",isNew:!0}}))},copyMetric:t=>{const n=fn(t);n.id="[new]",n.isNew=!0,n.name="",e(Xe({metric:n}))},editMetric:t=>{e(et({id:t.target.dataset.id}))},removeMetric:t=>{e(tt({id:t.target.dataset.id}))},openChangeMetricGroupModal:t=>e(nt({id:t.target.dataset.id}))}}))((function({metrics:e,groupList:t,selectedGroup:n,showGroups:r,addMetric:a,editMetric:i,copyMetric:o,removeMetric:l,changingGroupMetric:s,openChangeMetricGroupModal:c,metricStore:u,disableEdit:p}){const d=[{label:"Metric Name",getContent:e=>Ft.createElement("span",null,e.name||"(new)")},{label:"Fail On",getContent:e=>Ft.createElement(Ji,{metric:e})},{label:"Groups",getContent:e=>Ft.createElement("span",null,e.groups.join(", ")),hide:()=>!r},{getContent:e=>Ft.createElement("div",{className:"horizontal pull-right metrics-action-buttons"},Ft.createElement("button",{className:"link","data-id":e.id,onClick:i},p||Q.disableConfigEdit?"View":"Edit"),Ft.createElement("button",{className:"link","data-id":e.id,disabled:p||Q.disableConfigEdit,onClick:c},"Move Group"),Ft.createElement("button",{className:"link","data-id":e.id,disabled:p||Q.disableConfigEdit,onClick:()=>o(e)},"Copy"),Ft.createElement("button",{className:"link","data-id":e.id,disabled:p||Q.disableConfigEdit,onClick:l},"Delete"))}];return Ft.createElement(Ft.Fragment,null,Ft.createElement(Qe,{columns:d,rows:e,rowKey:e=>e.id,className:"header-white"}),!e.length&&n?Ft.createElement("p",null,"This group is empty! The group will be not be present the next time the config is loaded unless it is saved with at least one metric in it."):null,s&&Ft.createElement(Hi,{metric:s}),Ft.createElement(me,{className:"passive self-left","data-group":n,"data-default":t[0],"data-metric-store":u,onClick:a,disabled:Q.disableConfigEdit,disabledStateKeys:[fe]},"Add Metric"))}));function Qi({children:e}){return Ft.createElement("ul",{className:"list-group"},Ft.Children.map(e,(e=>e&&Ft.createElement("li",{className:"list-unstyled"},Ft.createElement("form",{role:"form",className:"form-horizontal container-fluid"},Ft.createElement("div",{className:"col-md-12"},e))))))}var Xi=ce((e=>({stores:hn(e.data.kayentaAccounts.data).filter((e=>e.supportedTypes.includes(L.MetricsStore))).map((e=>e.metricsStoreType||e.type)).uniq().sort().valueOf(),selectedStore:e.selectedConfig.selectedStore})),(e=>({select:t=>e(rt({store:t.target.value}))})))((({stores:e,selectedStore:t,select:n})=>e.length<2?null:Ft.createElement(be,{label:"Metric Store",inputOnly:!0},Ft.createElement($e,{value:t||"",onChange:n,className:"form-control input-sm",disabled:Q.disableConfigEdit,disabledStateKeys:[fe]},e.map((e=>Ft.createElement("option",{key:e,value:e},e)))))));var eo=ce((function(e){return e.selectedConfig.config?{name:e.selectedConfig.config.name,description:e.selectedConfig.config.description}:{name:"",description:""}}),(function(e){return{changeName:t=>{e(at({name:t.target.value}))},changeDescription:t=>{e(it({description:t.target.value}))}}}))((function({name:e,description:t,changeName:n,changeDescription:r}){return Ft.createElement(Qi,null,Ft.createElement(be,{label:"Configuration Name",inputOnly:!0},Ft.createElement(ve,{type:"text",value:e,onChange:n,disabled:Q.disableConfigEdit,disabledStateKeys:[fe]})),Ft.createElement(Xi,null),Ft.createElement(be,{label:"Description",inputOnly:!0},Ft.createElement(xe,{className:"form-control input-sm",value:t,onChange:r,disabled:Q.disableConfigEdit,disabledStateKeys:[fe]})))}));function to({title:e,children:t,helpKey:n}){return Ft.createElement("section",{className:"titled-subsection"},Ft.createElement("h5",{className:"heading-5"},e," ",n&&Ft.createElement(qt,{id:n})),Ft.createElement("hr",null),t)}Ee(".kayenta .titled-subsection h5 {\n font-weight: 600;\n}\n.kayenta .titled-subsection hr {\n margin-top: 0;\n}\n");var no=ce((function(e,t){return Object.assign(Object.assign({},t),{config:h(e)})}),(function(e,{group:t}){return{handleInputChange:n=>{e(ot({group:t,weight:n.target.value?parseInt(n.target.value,10):null}))}}}))((function({group:e,config:t,handleInputChange:n}){const r=function(e){return cn(e,"classifier.groupWeights",{})}(t)[e];return Ft.createElement(be,{label:e,inputOnly:!0},Ft.createElement(ve,{type:"number",value:bn(r)?r:"",onChange:n,min:0,max:100,disabled:Q.disableConfigEdit,disabledStateKeys:[fe]}))}));var ro=ce((function(e){const t=h(e),n=t?t.metrics:[];return{groups:gn(vn(n,(e=>e.groups||[])))}}))((function({groups:e}){const t=e.length>0;return Ft.createElement("section",null,t?e.map((e=>Ft.createElement(no,{key:e,group:e}))):Ft.createElement("p",{key:"no-groups"},"You have not configured any grouped metrics."))}));var ao=ce((function(e){return{renderJudgeSelect:e.selectedConfig.judge.renderState!==st.None}}))((function({renderJudgeSelect:e}){return Ft.createElement(Qi,null,e&&Ft.createElement(to,{title:"Judge"},Ft.createElement(lt,null)),Ft.createElement(to,{title:"Metric Group Weights",helpKey:"canary.config.metricGroupWeights"},Ft.createElement(ro,null)))}));function io(){return Ft.createElement("section",{className:"config-detail"},Ft.createElement(Vi,null),Ft.createElement(Wi,{title:"Name and Description"},Ft.createElement(eo,null)),Ft.createElement(Wi,{title:"Metrics"},Ft.createElement(ct,null),Ft.createElement(Zi,null),Ft.createElement(Bi,null)),Ft.createElement(Wi,{title:"Scoring"},Ft.createElement(ao,null)))}function oo({children:e}){return Ft.createElement("div",{className:"row"},Ft.createElement("div",{className:"col-sm-offset-4"},e))}var lo=ce((function(e){return{configLoadState:e.selectedConfig.load.state}}))((function({configLoadState:e}){const t=(new Ii).onFulfilled(Ft.createElement(io,null)).onFailed(Ft.createElement(oo,null,Ft.createElement("h3",{className:"heading-3"},"Could not load canary config."))).build();return Ft.createElement(t,{state:e})}));class so extends Ft.Component{constructor(e){const{configNameStream:t,loadConfig:n}=e;super(e),this.subscription=t.subscribe(n)}componentWillUnmount(){this.subscription.unsubscribe()}render(){return Ft.createElement(lo,null)}}var co=ce(null,(function(e){return{loadConfig:t=>{t.copy?e(ut()):t.new?e(pt()):t.id&&e(dt({id:t.id}))}}}))(so);var uo=ce((function(e){return{disabled:e.selectedConfig.config&&e.selectedConfig.config.isNew||Q.disableConfigEdit}}))((function({disabled:e}){return Ft.createElement(on,{to:".configDetail",params:{id:Bt.generateUuid(),new:!0}},Ft.createElement("button",{className:"zombie text-left form-control",disabled:e},Ft.createElement("i",{className:"fa fa-plus-circle"}),Ft.createElement("span",null,"Add configuration")))}));const po=({owningApplications:e,currentApplication:t})=>{return e.length<2&&e.includes(t)?null:Ft.createElement("span",null,"Owned by: ",e.join(", ")," ",Ft.createElement(qt,{placement:"right",content:(n=e,0===n.length?null:1===n.length?`This config can only be edited from within the application <strong>${n[0]}.</strong>`:`This config can only be edited from within the following applications: <strong>${n.join(", ")}.</strong>`)}));var n};Ee(".config-list > .tabs-vertical > li {\n padding: 0;\n}\n.config-list > .tabs-vertical > li > a {\n padding: 18px 12px;\n}\n");var mo=ce((function(e){const t=e.selectedConfig.config?e.selectedConfig.config.id:null,n=e.data.application.name;return{selectedConfigId:t,configs:yn(e.data.configSummaries,"name"),application:n}}))((function({configs:e,selectedConfigId:t,application:n}){return Ft.createElement("section",{className:"config-list"},Ft.createElement("ul",{className:"tabs-vertical list-unstyled ",style:{wordBreak:"break-all"}},e.map((e=>Ft.createElement("li",{key:e.id,className:e.id===t?"selected":""},Ft.createElement(on,{to:".configDetail",params:{id:e.id,new:!1,copy:!1}},Ft.createElement("a",null,Ft.createElement("div",{className:"heading-4 color-text-primary"},e.name),Ft.createElement("div",{className:"body-small color-text-caption caption",style:{marginTop:"5px",marginBottom:"0"}},"Edited: ",Ft.createElement(Mi,{dateIso:e.updatedTimestampIso}),Ft.createElement("br",null),Ft.createElement(po,{owningApplications:e.applications,currentApplication:n})))))))),Ft.createElement(uo,null))}));function fo({children:t}){return Ft.createElement("div",{className:e("row","canary-footer")},t)}function ho({className:t,list:n,listWidth:r=2,detail:a,detailWidth:i=10,listClass:o,detailClass:l}){return Ft.createElement("div",{className:e("list-detail","horizontal",t)},Ft.createElement("div",{className:e(`col-md-${r}`,o)},n),Ft.createElement("div",{className:e(`col-md-${i}`,l)},a))}function bo(){const e=Ft.createElement(mo,null),t={wrap:!1},n=Ft.createElement(an,Object.assign({},t,{name:"detail"}));return Ft.createElement("div",{className:"vertical flex-1"},Ft.createElement(ho,{list:e,detail:n,className:"flex-1",detailClass:"vertical flex-1"}),Ft.createElement(fo,null,Ft.createElement(an,Object.assign({},t,{name:"footer"}))))}Ee(".canary-footer {\n position: fixed;\n z-index: 4;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: #ffffff;\n margin: 0;\n border-top: 1px solid #d9d9d9;\n}\n.canary-footer .col-sm-12 {\n padding: 5px;\n}\n.canary-footer .alert {\n display: inline-block;\n margin-bottom: 0;\n margin-right: 5px;\n padding: 6px 12px;\n vertical-align: middle;\n}\n.canary-footer .fa.fa-exclamation-triangle {\n font-size: 125%;\n color: var(--color-danger);\n opacity: 1;\n margin-left: 5px;\n padding: 0 2px;\n}\n");var go=ce((function(e){const t=!!e.selectedConfig.validationErrors.length||Q.disableConfigEdit;return{saveConfigState:e.selectedConfig.save.state,inSyncWithServer:e.selectedConfig.isInSyncWithServer,disable:t}}),(function(e){return{saveConfig:()=>{e(mt())}}}))((function({saveConfigState:e,inSyncWithServer:t,saveConfig:n,disable:r}){return t&&e!==se.Requesting?Ft.createElement("span",{className:"btn btn-link disabled"},Ft.createElement("i",{className:"far fa-check-circle"})," In sync with server"):Ft.createElement(Wt,{label:"Save Changes",onClick:n,isDisabled:r||Q.disableConfigEdit,submitting:e===se.Requesting})}));var vo=ce((function(e){return{saveConfigState:e.selectedConfig.save.state,saveConfigErrorMessage:e.selectedConfig.save.error}}),(function(e){return{dismissError:()=>{e(ft())}}}))((function({saveConfigState:t,saveConfigErrorMessage:n,dismissError:r}){return t===se.Failed&&Ft.createElement("span",{className:e("alert","alert-danger")},function(e){const t="There was an error saving your config";return e?t+`: ${e}.`:t+"."}(n),Ft.createElement("a",{className:e("alert-dismiss","clickable"),onClick:r}," ","[dismiss]"))}));var yo=ce((e=>({errors:e.selectedConfig.validationErrors.map((e=>e.message))})))((({errors:e})=>{if(!e||!e.length)return null;const t=Ft.createElement("section",null,Ft.createElement("p",null,"The following errors may prevent this config from working properly:"),Ft.createElement("ul",null,e.map((e=>Ft.createElement("li",{key:e},e)))));return Ft.createElement(Ht,{placement:"left",template:t},Ft.createElement("button",{className:"btn btn-link"},Ft.createElement("i",{className:"fa fa-exclamation-triangle"})))}));function Eo(){return Ft.createElement("div",{className:e("col-sm-12","text-right")},Ft.createElement(yo,null),Ft.createElement(vo,null),Ft.createElement(go,null))}function wo(){return Ft.createElement(oo,null,Ft.createElement("h3",{className:"heading-3"},"Click a configuration to edit."))}const xo=e=>{const t=ht(e).id,n=A(e),r=n.id;let a=`${Jt.gateUrl}/v2/canaries/canary/${t}/${r}`;const i=n.storageAccountName||Q.storageAccountName;return i&&(a+=`?storageAccountName=${i}`),a},No=e=>{const t=A(e),{metricSetPairListId:n}=t;if(!n)return null;let r=`${Jt.gateUrl}/v2/canaries/metricSetPairList/${n}`;const a=t.storageAccountName||Q.storageAccountName;return a&&(r+=`?storageAccountName=${a}`),r};var So=ce((e=>({reportUrl:xo(e),metricListUrl:No(e)})))((({reportUrl:e,metricListUrl:t})=>Ft.createElement("ul",{className:"list-unstyled small"},Ft.createElement("li",null,Ft.createElement("a",{target:"_blank",href:e},"Report")),t&&Ft.createElement("li",null,Ft.createElement("p",null,Ft.createElement("a",{target:"_blank",href:t},"Metrics"))))));const Co=({label:e,extraClass:t})=>Ft.createElement("label",{className:`label uppercase color-text-primary ${t}`},e);var Oo=ce((e=>({run:e.selectedRun.run})))((({run:e})=>{const{thresholds:{marginal:t,pass:n}}=e.canaryExecutionRequest,r=(e=>{const t=e.canaryExecutionRequest,n=Object.values(t.scopes);if(n.length>1)return null;const{controlScope:{step:r,location:a,scope:i},experimentScope:{start:o,end:l,location:s,scope:c}}=n[0];return[{label:"baseline",entries:[{label:"scope",popover:!0,getContent:()=>Ft.createElement("p",{className:"kayenta-scope"},i)},{label:"location",getContent:()=>Ft.createElement("p",null,a)}]},{label:"canary",entries:[{label:"scope",popover:!0,getContent:()=>Ft.createElement("p",{className:"kayenta-scope"},c)},{label:"location",getContent:()=>Ft.createElement("p",null,s)}]},{label:"time",entries:[{label:"start",getContent:()=>Ft.createElement("p",null,Ft.createElement(Mi,{dateIso:o}))},{label:"end",getContent:()=>Ft.createElement("p",null,Ft.createElement(Mi,{dateIso:l}))},{label:"step",getContent:()=>{const e=r/60;return Ft.createElement("p",null,e," min",1===e?"":"s")}}]}]})(e)||[];return r.push({label:"threshold",entries:[{label:"marginal",getContent:()=>Ft.createElement("p",null,t)},{label:"pass",getContent:()=>Ft.createElement("p",null,n)}]}),Ft.createElement("section",{className:"report-metadata"},r.map(((e,t)=>Ft.createElement("div",{className:`group group-${e.label}`,key:e.label||t},Ft.createElement(Co,{label:e.label||"",extraClass:"label-lg"}),Ft.createElement("ul",{className:"list-unstyled"},e.entries.map((e=>Ft.createElement("li",{key:e.label||t},Ft.createElement(Co,{label:e.label}),e.popover?Ft.createElement(Ht,{template:e.getContent()},e.getContent()):Ft.createElement(Ft.Fragment,null,e.getContent())))))))),Ft.createElement("div",{className:"group group-source",key:"source"},Ft.createElement(Co,{label:"Source",extraClass:"label-lgf"}),Ft.createElement(So,null)))}));const _o=e=>e.classification===gt.Pass?{health:null,result:"success"}:e.classification===gt.Fail?{health:"unhealthy",result:null}:{health:null,result:null};var ko=({score:e,showClassification:t,inverse:n})=>Ft.createElement(bt,{className:"score-report",score:En(e.score,2),result:_o(e).result,health:_o(e).health,classification:t?e.classification:null,inverse:n});Ee(".report-header {\n margin-bottom: 10px;\n align-items: center;\n}\n.report-header h1 {\n flex: 1 0 200px;\n align-items: center;\n margin: 0;\n padding: 0;\n word-break: break-all;\n}\n.report-header .report-score-wrapper {\n padding: 5px 20px 0 0;\n margin-left: 15px;\n border-right: 1px solid var(--color-titanium);\n text-align: center;\n flex: 0 0 200px;\n}\n.report-header .report-metadata {\n flex: 0 1 auto;\n display: flex;\n overflow: hidden;\n padding-left: 20px;\n padding-top: 10px;\n width: 100%;\n}\n.report-header .report-metadata .group {\n flex: 1 1 200px;\n margin-right: 20px;\n overflow: hidden;\n}\n.report-header .report-metadata .group.group-time {\n flex: 0 0 150px;\n}\n.report-header .report-metadata .group.group-threshold {\n flex: 0 0 80px;\n}\n.report-header .report-metadata .group.group-source {\n flex: 0 0 64px;\n margin-right: 0;\n}\n.report-header .report-metadata ul {\n margin-bottom: 0;\n}\n.report-header .report-metadata .label {\n padding-left: 0;\n}\n.report-header .report-metadata .label.label-lg {\n font-size: 85%;\n}\n.report-header .kayenta-scope {\n width: 100%;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.popover .kayenta-scope {\n word-break: break-all;\n}\n");var To=ce((e=>({id:ht(e).id,name:ht(e).name,score:vt(e).score})))((({id:e,name:t,score:n})=>Ft.createElement("section",{className:"horizontal report-header"},Ft.createElement("div",{className:"report-score-wrapper"},Ft.createElement(ko,{score:n,showClassification:!0}),Ft.createElement("h1",{className:"heading-2 color-text-primary"},Ft.createElement(on,{to:"^.^.canaryConfig.configDetail",params:{id:e}},Ft.createElement("a",{className:"clickable color-text-primary"}," ",t)))),Ft.createElement(Oo,null))));const jo=["semiotic"];var Ao=ce((e=>{const t=e.selectedRun.selectedMetric;return{pair:e.selectedRun.metricSetPair.pair,result:yt(e).find((e=>e.id===t)),graphType:e.selectedRun.graphType}}))((({pair:e,result:t,graphType:r})=>{const a=jo.map((e=>n.getDelegate(e))).filter((e=>!!e)).find((e=>e.handlesGraphType(r)));if(!a)return Ft.createElement("h3",{className:"heading-3"},"Could not load graph.");const i=a.getGraph();return Ft.createElement(i,{metricSetPair:e,result:t,type:r})}));Ee(".graph-type-selector {\n margin-left: 60px;\n margin-top: 6px;\n}\n");var Io=ce((e=>({selected:e.selectedRun.graphType})),(e=>({selectGraphType:t=>e(Et({type:t}))})))((({selected:e,selectGraphType:n})=>Ft.createElement("ul",{className:"list-inline graph-type-selector"},Ft.createElement("li",null,Ft.createElement("label",{className:"label uppercase color-text-primary",style:{paddingLeft:0}},"Graph:")),Object.values(t).map((t=>Ft.createElement("li",{style:e===t?{textDecoration:"underline"}:null,key:t,onClick:()=>n(t)},Ft.createElement("a",{className:"small clickable"},t)))))));Ee(".metric-result-actions .actions-layout {\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n margin: 12px 4px;\n}\n.metric-result-actions .action {\n padding-left: 8px;\n}\n.metric-result-actions .copy-button-container {\n display: flex;\n flex-direction: row;\n align-items: center;\n position: relative;\n}\n.metric-result-actions .copy-button-container .clipboard-btn {\n width: 100%;\n height: 100%;\n opacity: 0;\n z-index: 2;\n position: absolute;\n}\n.metric-result-actions .copy-button-container .copy-button .copy-icon {\n top: -1px;\n}\n");var Mo=ce((e=>({metricConfig:wt(e),metricSetPair:e.selectedRun.metricSetPair.pair})))((({metricSetPair:e,metricConfig:t})=>{const n=(e=>{const{attributes:t,scopes:n,values:r,tags:a}=e,{atlasGraphBaseUrl:i}=Q;let o="";Object.keys(a).length&&(o=` (${Object.keys(a).map((e=>`$${e}`)).join("|")})`);const l=encodeURIComponent(t.control.baseURL),s=`${encodeURIComponent(t.experiment.query)},Canary${o},:legend,:freeze,${encodeURIComponent(t.control.query)},Baseline${o},:legend`,c=Math.min(n.control.startTimeMillis,n.experiment.startTimeMillis),u=n.control.startTimeMillis+r.control.length*n.control.stepMillis,p=n.experiment.startTimeMillis+r.experiment.length*n.experiment.stepMillis;return`${i}?backend=${l}&g.q=${s}&g.s=${c}&g.e=${Math.max(u,p)}&g.w=651&mode=png&axis=0`})(e),r=Le.getDelegate(t.query.type).queryFinder(t),a=[Ft.createElement("div",{className:"copy-button-container"},Ft.createElement(Zt,{displayText:!1,text:r,toolTip:null}),Ft.createElement("button",{className:"primary copy-button",key:"copy-link"},Ft.createElement("i",{className:"glyphicon glyphicon-copy copy-icon"}),"Copy metric query")),Ft.createElement("a",{href:n,target:"_blank"},Ft.createElement("button",{className:"primary"},Ft.createElement("i",{className:"fas fa-chart-line"}),"Explore more data in Atlas"))].map(((e,t)=>Ft.createElement("li",{className:"action",key:t},e)));return Ft.createElement("div",{className:"metric-result-actions"},Ft.createElement("ul",{className:"actions-layout list-inline"},a))}));Ee(".metric-stats .label {\n padding-left: 0;\n}\n.metric-stats p {\n margin: 0;\n}\n");const Po=(e,t,n)=>{const r=e.result.judgeResult.results.find((e=>e.id===t));return"experiment"===n?r.experimentMetadata.stats:"control"===n?r.controlMetadata.stats:null},Do=({row:e})=>e.getContent()?Ft.createElement("div",null,Ft.createElement("label",{className:"label uppercase color-text-primary"},e.label),e.getContent()):null;var Ro=ce((e=>({metricConfig:wt(e),metricSetPair:e.selectedRun.metricSetPair.pair,run:A(e),service:wt(e).query.type})))((({metricConfig:e,metricSetPair:t,run:n})=>{const r=[{getContent:e=>Ft.createElement("span",null,"control"===e?"Baseline":"Canary")},{label:"start",getContent:e=>Ft.createElement(Mi,{dateIso:t.scopes[e].startTimeIso}),hide:()=>{const r=n.canaryExecutionRequest,a=r.scopes[e.scopeName].controlScope.start,i=t.scopes.control.startTimeIso,o=r.scopes[e.scopeName].experimentScope.start,l=t.scopes.experiment.startTimeIso;return a===i&&o===l}},{label:"count",getContent:e=>Ft.createElement("span",null,Po(n,t.id,e).count)},{label:"avg",getContent:e=>Ft.createElement("span",null,En(Po(n,t.id,e).mean,3))},{label:"max",getContent:e=>Ft.createElement("span",null,En(Po(n,t.id,e).max,3))},{label:"min",getContent:e=>Ft.createElement("span",null,En(Po(n,t.id,e).min,3))}],a=[{label:"classification reason",getContent:()=>{const e=n.result.judgeResult.results.find((e=>e.id===t.id));return e.classificationReason?Ft.createElement("p",null,e.classificationReason):null}}];return Ft.createElement("div",{className:"metric-stats vertical"},a.map((e=>Ft.createElement(Do,{row:e,key:e.label}))),Ft.createElement(Qe,{columns:r,rows:["control","experiment"],rowKey:e=>e}))})),Fo=()=>Ft.createElement("section",{className:"vertical flex-1 sp-padding-xl-bottom",style:{overflowY:"auto"}},Ft.createElement(Io,null),Ft.createElement(Ao,null),Ft.createElement(Mo,null),Ft.createElement(Ro,null));var Lo=ce((e=>({state:e.selectedRun.metricSetPair.load})))((({state:e})=>{const t=(new Ii).onFulfilled(Ft.createElement(Fo,null)).onFailed(Ft.createElement("h3",{className:"heading-3 text-center"},"Could not load metrics.")).build();return Ft.createElement(t,{state:e})})),$o=({result:e})=>e?Ft.createElement(Lo,null):Ft.createElement("h3",{className:"heading-3 text-center"},"Select a metric result.");var zo=ce((e=>({metricFilters:e.selectedRun.metricFilters})),((e,t)=>Object.assign({toggle:t=>e(Nt({classification:t}))},t)))((({results:e,metricFilters:t,toggle:n})=>{const r=[xt.Error,xt.High,xt.Low,xt.Nodata,xt.Pass].map((t=>({classification:t,count:e.filter((e=>e.classification===t)).length}))).filter((e=>e.count)).map((e=>Ft.createElement("label",{key:e.classification},Ft.createElement("input",{type:"checkbox",checked:t.includes(e.classification),onChange:()=>n(e.classification)})," ",e.classification," (",e.count,")"," ")));return Ft.createElement("div",{className:"metric-filter-options horizontal center"},r)}));const Vo="var(--color-success)",Go="var(--color-danger)",qo="var(--color-text-caption)",Uo="var(--color-warning)",Yo=e=>({[xt.High]:Go,[xt.Low]:Go,[xt.Error]:Uo,[xt.Nodata]:qo,[xt.Pass]:Vo}[e]),Ko=(e,t)=>"number"!=typeof e.score?Uo:e.score>t.pass?Vo:e.score>t.marginal?qo:Go,Bo=e=>({backgroundColor:Yo(e)});var Wo=({classification:t,className:n})=>Ft.createElement("div",{className:e("pill","metric-result-classification",n),style:Bo(t)},Ft.createElement("span",{style:{color:"var(--color-text-on-dark)"}},t));var Ho=({ratio:e,className:t})=>e&&Ft.createElement("span",{className:t,style:{color:"var(--color-text-caption"}},(e=>"number"!=typeof e?"N/A":1===e?"0%":e<1?(100*(e-1)).toFixed(1)+"%":"+"+(100*(e-1)).toFixed(1)+"%")(e));const Jo=[{label:"metric name",getContent:({metricName:e})=>Ft.createElement(Qt,null,e),width:5},{label:"deviation",getContent:({results:e})=>e[0].resultMetadata&&Ft.createElement(Ho,{ratio:e[0].resultMetadata.ratio}),width:1},{label:"result",getContent:({results:e})=>Ft.createElement(Wo,{classification:e[0].classification}),width:1}];var Zo=ce((e=>({selectedResult:St(e)})),((e,t)=>Object.assign(Object.assign({},t),{select:t=>e(Ct({metricId:t}))})))((({results:t,select:n,selectedResult:r})=>{let a=hn(t).flatMap((e=>Object.keys(e.tags||{}))).uniq().value().map((e=>({label:e,width:5,getContent:t=>Ft.createElement(Qt,null,t.tags[e])})));return a=a.concat([{width:1,getContent:({resultMetadata:e})=>e&&Ft.createElement(Ho,{ratio:e.ratio})},{width:1,getContent:({classification:e})=>Ft.createElement(Wo,{classification:e})}]),Ft.createElement(_n,{rows:t,columns:a,className:"multiple-results-table",headerClassName:"sticky-header-2",rowClassName:t=>e("horizontal",{selected:t.id===r}),rowKey:e=>Object.entries(e.tags||{}).map((([e,t])=>`${e}:${t}`)).join(":"),onRowClick:e=>n(e.id)})}));Ee(".metric-results-list .table-header h6 {\n padding-left: 5px;\n}\n.metric-results-list .tabs-vertical {\n overflow-y: auto;\n display: block;\n}\n.metric-results-list .tabs-vertical li {\n padding: 8px 0 8px 5px;\n}\n.metric-results-list .metric-result-classification {\n margin-right: 3px;\n}\n.metric-results-list .table-row {\n cursor: pointer;\n}\n.metric-results-list .list-group {\n margin-bottom: 0;\n}\n.metric-results-list li.multiple-results {\n padding-bottom: 0;\n border: none;\n}\n.metric-results-list li.multiple-results:hover {\n border: none;\n}\n.metric-results-list .multiple-results-table {\n padding-left: 8px;\n}\n.metric-results-list .multiple-results-table h6 {\n margin-top: 7px;\n}\n");const Qo=e=>e.hasMultipleRows?Ft.createElement("li",{className:"horizontal multiple-results"},Ft.createElement("section",{className:"vertical flex-fill"},Ft.createElement("div",null,e.metricName),Ft.createElement(Zo,{results:e.results}))):null;var Xo=ce((e=>({selectedMetric:e.selectedRun.selectedMetric,metricFilters:e.selectedRun.metricFilters})),((e,t)=>Object.assign({select:t=>e(Ct({metricId:t}))},t)))((({results:t,select:n,selectedMetric:r,metricFilters:a})=>{const i=((e,t)=>{const n=e.reduce(((e,t)=>(e.has(t.name)||e.set(t.name,0),e.set(t.name,e.get(t.name)+1),e)),new Map),r=e.filter((e=>!t.length||t.includes(e.classification))).reduce(((e,t)=>e.has(t.name)?e.set(t.name,{metricName:t.name,results:e.get(t.name).results.concat(t),hasMultipleRows:n.get(t.name)>1}):e.set(t.name,{metricName:t.name,results:[t],hasMultipleRows:n.get(t.name)>1})),new Map);return Array.from(r.values())})(t,a);return Ft.createElement("section",{className:"vertical metric-results-list flex-1"},Ft.createElement(zo,{results:t}),Ft.createElement(_n,{rowKey:e=>e.metricName,tableBodyClassName:"list-unstyled tabs-vertical flex-1 sp-padding-xl-bottom",rowClassName:t=>e("horizontal",{selected:t.results[0].id===r}),rows:i,columns:Jo,onRowClick:e=>n(e.results[0].id),className:"flex-1 vertical",customRow:Qo}))}));Ee(".metric-results:after {\n content: '';\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 8px;\n box-shadow: inset 0px -8px 4px -4px #fff;\n z-index: 2;\n}\n");var el=ce((e=>{const{selectedRun:{selectedGroup:t,selectedMetric:n}}=e,r=vt(e),a=t?e=>e.groups.includes(t):()=>!0;return{metricResults:Object.values(r.results).filter(a),selectedMetricResult:Object.values(r.results).find((e=>e.id===n))}}))((({metricResults:e,selectedMetricResult:t})=>{const n=Ft.createElement(Xo,{results:e}),r=Ft.createElement($o,{result:t});return Ft.createElement(ho,{list:n,listClass:"vertical",listWidth:5,detail:r,detailClass:"vertical",detailWidth:9,className:"metric-results flex-1"})}));Ee(".report-explanation {\n background-color: var(--color-warning);\n height: 30px;\n margin-bottom: 5px;\n margin-left: 15px;\n padding-top: 4px;\n font-weight: bold;\n font-size: 14px;\n text-align: center;\n}\n");var tl=ce((e=>({exception:e.selectedRun.run.exception})))((({exception:e})=>{const t=[];if(e.details){const{error:n,errors:r}=e.details;n&&t.push(n),(null==r?void 0:r.length)&&r.forEach((e=>t.push(e)))}return t.length||t.push('No error message provided. Click the "Report" link to see more details.'),Ft.createElement(Ft.Fragment,null,Ft.createElement("h3",{className:"text-center"},"Canary report failed"),Ft.createElement("dl",null,Ft.createElement("dt",null,"Details"),Ft.createElement("dd",null,t.map(((e,t)=>Ft.createElement("div",{key:t},Ft.createElement("code",null,e))))),Ft.createElement("dt",null,"Source"),Ft.createElement("dd",null,Ft.createElement(So,null))))}));var nl=ce((e=>({run:e.selectedRun.run})))((({run:e})=>{const t=(e=>{var t,n,r,a;return null!==(a=null===(r=null===(n=null===(t=null==e?void 0:e.result)||void 0===t?void 0:t.judgeResult)||void 0===n?void 0:n.score)||void 0===r?void 0:r.classificationReason)&&void 0!==a?a:null})(e);return t?Ft.createElement("section",null,Ft.createElement("div",{className:"report-explanation"},t)):null}));var rl=({arrowColor:t,className:n})=>Ft.createElement("div",{className:e("arrow-down",n),style:{borderTopColor:t}}),al=({className:t,onClick:n,score:r,scoreThresholds:a})=>Ft.createElement("section",{className:t},Ft.createElement("div",{onClick:n,style:{backgroundColor:Ko(r,a)},className:e("clickable","text-center","all-metric-results-header")},Ft.createElement("h3",{className:"heading-3 label"},"ALL"),Ft.createElement(rl,{className:"outer",arrowColor:"var(--color-titanium)"}),Ft.createElement(rl,{className:"inner",arrowColor:Ko(r,a)}))),il=({label:t,onClick:n,style:r,className:a})=>Ft.createElement("section",{style:r,onClick:n,className:e("clickable","text-center","group-score",a)},Ft.createElement("h3",{className:"heading-3 uppercase label"},t),Ft.createElement(rl,{arrowColor:r.backgroundColor}));var ol=ce((e=>({selectedGroup:e.selectedRun.selectedGroup,groupWeights:Ot(e),scoreThresholds:_t(e).thresholds})),((e,t)=>Object.assign({select:t=>e(kt({group:t}))},t)))((({groups:t,groupWeights:n,scoreThresholds:r,className:a,select:i,selectedGroup:o})=>Ft.createElement("section",{className:e("horizontal",a)},t.map((t=>Ft.createElement(il,{key:t.name,style:{width:`${n[t.name]}%`,backgroundColor:Ko(t,r)},onClick:()=>i(t.name),label:t.name,className:e("report-score",{active:t.name===o})}))))));Ee(".report-scores {\n height: 40px;\n margin-bottom: 20px;\n}\n.report-scores .group-score,\n.report-scores .all-metric-results-header {\n height: 30px;\n color: white;\n border-right: 1px solid white;\n padding-top: 4px;\n}\n.report-scores .group-score h3,\n.report-scores .all-metric-results-header h3 {\n font-weight: 600;\n}\n.report-scores .group-score:last-of-type {\n border-right: none;\n}\n.report-scores .report-score.active .arrow-down {\n width: 0;\n height: 0;\n margin: 5px auto 0 auto;\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-top: 8px solid transparent;\n}\n.report-scores .all-metric-results-header {\n border: 1px solid var(--color-titanium);\n width: 70%;\n margin: 0 auto;\n}\n.report-scores .all-metric-results-header .arrow-down.inner {\n margin-top: -9px;\n}\n.report-scores .all-metric-results-header .arrow-down.outer {\n margin-top: 4px;\n}\n");var ll=ce((e=>({groups:yn(vt(e).groupScores,[t=>-Ot(e)[t.name],"name"]),score:vt(e).score,scoreThresholds:e.selectedRun.run.canaryExecutionRequest.thresholds,selectedGroup:e.selectedRun.selectedGroup})),(e=>({clearSelectedGroup:()=>e(kt({group:null}))})))((({groups:t,isExpanded:n,selectedGroup:r,clearSelectedGroup:a,score:i,scoreThresholds:o,toggleHeader:l})=>{const s={transform:n?"rotate(90deg)":"rotate(0deg)",transition:"all ease 0.15s"};return Ft.createElement("section",{className:"horizontal report-scores"},Ft.createElement(al,{onClick:a,score:i,scoreThresholds:o,className:e("flex-1","report-score",{active:!r})}),Ft.createElement(ol,{groups:t,className:"flex-12"}),Ft.createElement("div",{className:"kayenta-overview-toggle horizontal middle",onClick:()=>l()},n?Ft.createElement("p",null,"hide details"):Ft.createElement("p",null,"show details"),Ft.createElement("span",{className:"glyphicon glyphicon-chevron-right",style:s})))}));Ee(".kayenta-overview-toggle {\n height: 30px;\n line-height: 30px;\n cursor: pointer;\n padding-right: 0 10px;\n}\n.kayenta-overview-toggle p {\n height: 100%;\n text-transform: uppercase;\n margin: 0 10px;\n}\n.kayenta-overview-toggle span {\n margin-bottom: 4px;\n}\n");var sl=ce((e=>({run:e.selectedRun.run})))((function({run:e}){var t,n;const[r,a]=Ft.useState(!0);return!(null===(n=null===(t=e.result)||void 0===t?void 0:t.judgeResult.results)||void 0===n?void 0:n.length)&&e.exception?Ft.createElement(tl,null):Ft.createElement(Ft.Fragment,null,Ft.createElement("div",{className:"vertical flex-1"},r&&Ft.createElement(To,null),Ft.createElement(nl,null),Ft.createElement(ll,{isExpanded:r,toggleHeader:()=>{a(!r)}}),Ft.createElement(el,null)))}));var cl=ce((e=>({loadState:e.selectedRun.load})))((({loadState:e})=>{const t=(new Ii).onFulfilled(Ft.createElement(sl,null)).onFailed(Ft.createElement(oo,null,Ft.createElement("h3",{className:"heading-3"},"Could not load canary report."))).build();return Ft.createElement(t,{state:e})}));class ul extends Ft.Component{constructor(e){super(e);const{resultIdStream:t,loadResult:n}=e;this.subscription=t.subscribe(n)}componentWillUnmount(){this.subscription.unsubscribe()}render(){return Ft.createElement(cl,null)}}var pl=ce(null,(e=>({loadResult:t=>e(Tt({configId:t.configId,runId:t.runId}))})))(ul);const dl={prometheus:[{label:"",value:""},{label:"gce_instance",value:"gce_instance"},{label:"aws_ec2_instance",value:"aws_ec2_instance"}],stackdriver:[{label:"gce_instance",value:"gce_instance"},{label:"aws_ec2_instance",value:"aws_ec2_instance"},{label:"gae_app",value:"gae_app"},{label:"k8s_container",value:"k8s_container"},{label:"k8s_pod",value:"k8s_pod"},{label:"k8s_node",value:"k8s_node"},{label:"gke_container",value:"gke_container"},{label:"https_lb_rule",value:"https_lb_rule"},{label:"global",value:"global"}]};class ml extends Ft.Component{constructor(e){var t;super(e),this.validate=e=>{const t={};let n,r;if(e.configId||(t.configId="You must choose a canary config"),e.startTime)try{n=new Date(e.startTime).getTime()}catch(e){t.startTime="Invalid start time. Time must be in ISO-8601 format, e.g. 2018-07-12T22:28:29Z"}else t.startTime="You must provide a start time";if(e.endTime)try{r=new Date(e.endTime).getTime()}catch(e){t.endTime="Invalid start time. Time must be in ISO-8601 format, e.g. 2018-07-12T22:28:29Z"}else t.endTime="You must provide an end time";n&&r&&r<=n&&(t.endTime="End time must be after start time"),e.step?parseInt(e.step,10)<1&&(t.step="Invalid step value"):t.step="You must provide a step value",e.baselineScope||(t.baselineScope="You must provide a baseline scope"),e.canaryScope||(t.canaryScope="You must provide a canary scope"),e.baselineLocation||(t.baselineLocation="You must provide a baseline location"),e.canaryLocation||(t.canaryLocation="You must provide a canary location");const a=parseInt(e.marginalThreshold,10),i=parseInt(e.passThreshold,10);return e.marginalThreshold?a>i?t.marginalThreshold="Marginal threshold must be greater than passing threshold":a<1&&(t.marginalThreshold="Marginal threshold must be positive"):t.marginalThreshold="You must provide a marginal score threshold",e.passThreshold?i>100&&(t.passThreshold="Passing threshold cannot be greater than 100"):t.passThreshold="You must provide a passing score threshold",e.metricsAccountName||(t.metricsAccountName="You must choose a metrics account"),e.storageAccountName||(t.storageAccountName="You must choose a storage account"),t},this.submit=(e,t)=>{const{configId:n,metricsAccountName:r,storageAccountName:a}=e,{application:i,accounts:o}=this.props,l=((e,t)=>{var n;const r=parseInt(e.step,10),a=parseInt(e.passThreshold,10),i=parseInt(e.marginalThreshold,10),o=t.find((({name:t})=>e.metricsAccountName===t)),l={};e.resourceType&&(l.resourceType=e.resourceType),"atlas"!==o.type||(null===(n=e.extendedScopeParams)||void 0===n?void 0:n.type)||(l.type="cluster");const s=Object.assign(Object.assign({},e.extendedScopeParams),l);return{scopes:{default:{controlScope:{scope:e.baselineScope,start:e.startTime,end:e.endTime,location:e.baselineLocation,step:r,extendedScopeParams:s},experimentScope:{scope:e.canaryScope,start:e.startTime,end:e.endTime,location:e.canaryLocation,step:r,extendedScopeParams:s}}},thresholds:{pass:a,marginal:i}}})(e,o);jt(n,l,{application:i.name,metricsAccountName:r,storageAccountName:a}).then((()=>{t.setSubmitting(!1),t.setStatus({succeeded:!0})})).catch((e=>{t.setSubmitting(!1),t.setStatus({succeeded:!1,error:e})}))};const{initialValues:n,accounts:r}=e,a=r.find((({name:e})=>n.metricsAccountName===e)),i=null!==(t=null==a?void 0:a.recommendedLocations)&&void 0!==t?t:[];this.state={showAllControlLocations:!i.includes(n.baselineLocation),showAllExperimentLocations:!i.includes(n.canaryLocation)}}static show(e){return Xt.show(ml,e,{dialogClassName:"modal-lg"})}render(){const{dismissModal:e,title:t,application:n,accounts:r,initialValues:a}=this.props,{showAllControlLocations:i,showAllExperimentLocations:o}=this.state,l=n.getDataSource("canaryConfigs").data.slice().sort(((e,t)=>e.name.localeCompare(t.name))),s=r.filter((({supportedTypes:e})=>e.includes(L.MetricsStore))),c=r.filter((({supportedTypes:e})=>e.includes(L.ObjectStore))),u=s.length>1||c.length>1;return Ft.createElement(Nn,{initialValues:Object.assign(Object.assign({},a),{metricsAccountName:cn(s[0],"name",""),storageAccountName:cn(c[0],"name","")}),onSubmit:this.submit,validate:this.validate,isInitialValid:!!a.configId,render:({values:n,touched:r,isValid:p,isSubmitting:d,status:m,setFieldValue:f,setFieldTouched:h,errors:b})=>{if(!0===cn(m,"succeeded"))return Ft.createElement(Ft.Fragment,null,Ft.createElement(en,{dismiss:e}),Ft.createElement(xn.Header,null,Ft.createElement("h3",null,"Analysis Started")),Ft.createElement(xn.Body,null,Ft.createElement("p",null,"Analysis started — check the list of reports in a few minutes to view results")),Ft.createElement(xn.Footer,{className:"horizontal right"},Ft.createElement("button",{className:"btn btn-primary",onClick:e,type:"button"},"Got it")));const g=s.find((({name:e})=>n.metricsAccountName===e)),v=c.find((({name:e})=>n.storageAccountName===e)),y=cn(g,"recommendedLocations",[]),{canaryLocation:E,baselineLocation:w}=a,x=cn(g,"locations",[]);E&&!x.includes(E)&&x.push(E),w&&!x.includes(w)&&x.push(w);const N=y.length>0||x.length>0;return Ft.createElement(Sn,{className:"form-horizontal"},Ft.createElement(en,{dismiss:e}),Ft.createElement(xn.Header,null,t&&Ft.createElement("h3",null,t)),Ft.createElement(xn.Body,null,Ft.createElement("div",{className:"row"},Ft.createElement("div",{className:"col-md-12"},Ft.createElement("div",{className:"container-fluid form-horizontal"},Ft.createElement("h5",null,"Analysis Configuration"),Ft.createElement("div",{className:"horizontal-rule"}),Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"Config Name"),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(tn,{value:n.configId,options:l.map((({id:e,name:t})=>({label:t,value:e}))),onChange:e=>f("configId",e&&e.value||null)}))),Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"Start Time ",Ft.createElement(qt,{id:"pipeline.config.canary.startTimeIso"})),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(yl,{errors:b,touched:r,name:"startTime"}))),Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"End Time ",Ft.createElement(qt,{id:"pipeline.config.canary.endTimeIso"})),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(yl,{errors:b,touched:r,name:"endTime"}))),Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"Step"),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(yl,{errors:b,touched:r,type:"number",style:{width:"60px",display:"inline-block"},name:"step"}),Ft.createElement("span",{className:"form-control-static"}," seconds"))),Ft.createElement("h5",null,"Baseline + Canary Pair"),Ft.createElement("div",{className:"horizontal-rule"}),Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"Baseline ",Ft.createElement(qt,{id:"pipeline.config.canary.baselineGroup"})),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(yl,{name:"baselineScope",errors:b,touched:r}))),Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"Baseline Location ",Ft.createElement(qt,{id:"pipeline.config.canary.baselineLocation"})),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(bl,{hasLocationChoices:N,showAll:i,recommendedLocations:y,locations:x,value:n.baselineLocation,field:"baselineLocation",errors:b,touched:r,onChange:e=>{h("baselineLocation",!0),f("baselineLocation",e)},onShowAllChange:e=>this.setState({showAllControlLocations:e})}))),Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"Canary ",Ft.createElement(qt,{id:"pipeline.config.canary.canaryGroup"})),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(yl,{errors:b,touched:r,name:"canaryScope"}))),Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"Canary Location ",Ft.createElement(qt,{id:"pipeline.config.canary.canaryLocation"})),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(bl,{hasLocationChoices:N,showAll:o,recommendedLocations:y,locations:x,value:n.canaryLocation,field:"canaryLocation",errors:b,touched:r,onChange:e=>{h("canaryLocation",!0),f("canaryLocation",e)},onShowAllChange:e=>this.setState({showAllExperimentLocations:e})}))),Ft.createElement("h5",null,"Metric Scope"),Ft.createElement("div",{className:"horizontal-rule"}),dl.hasOwnProperty(cn(g,"type"))&&Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"Resource Type"),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(tn,{value:n.resourceType,options:dl[g.type],onChange:e=>f("resourceType",e&&e.value||"")}),Ft.createElement(vl,{field:"resourceType",errors:b,touched:r}))),Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"Extended Params ",Ft.createElement(qt,{id:"pipeline.config.canary.extendedScopeParams"})),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(nn,{model:n.extendedScopeParams,onChange:e=>f("extendedScopeParams",e),hiddenKeys:["resourceType"]}))),Ft.createElement("h5",null,"Scoring Thresholds"),Ft.createElement("div",{className:"horizontal-rule"}),Ft.createElement(At,{onChange:({unhealthyScore:e,successfulScore:t})=>{f("marginalThreshold",e),f("passThreshold",t)},successfulHelpFieldId:"pipeline.config.canary.passingScore",successfulLabel:"Pass ",successfulScore:n.passThreshold,unhealthyHelpFieldId:"pipeline.config.canary.marginalScore",unhealthyLabel:"Marginal ",unhealthyScore:n.marginalThreshold}),u&&Ft.createElement(gl,{metricsStores:s,selectedMetricsStore:g,objectStores:c,selectedObjectStore:v,onChange:f,errors:b,touched:r})))),cn(m,"error")&&Ft.createElement("div",{className:"row"},Ft.createElement("div",{className:"col-md-7 col-md-offset-3"},Ft.createElement("div",{className:"well-compact alert alert-danger"},Ft.createElement("b",null,"There was a problem starting your analysis:"),Ft.createElement("span",null,JSON.stringify(m.error.data)))))),Ft.createElement(xn.Footer,{className:"horizontal right"},Ft.createElement("button",{className:"btn btn-default",onClick:e,type:"button"},"Cancel"),Ft.createElement(fl,{isValid:p,isSubmitting:d,errors:b})))}})}}ml.defaultProps={closeModal:Yt,dismissModal:Yt,initialValues:{configId:null,startTime:"",endTime:"",step:"",baselineScope:"",canaryScope:"",baselineLocation:"",canaryLocation:"",extendedScopeParams:{},resourceType:"",marginalThreshold:"",passThreshold:"",metricsAccountName:"",storageAccountName:""}};const fl=({errors:e,isValid:t,isSubmitting:n})=>{const r=Ft.createElement(Wt,{isDisabled:!t,submitting:n,isFormSubmit:!0,label:"Start analysis"}),a=Object.values(e).map(((e,t)=>Ft.createElement("li",{key:t},e)));if(t||!a.length)return r;return Ft.createElement("div",{className:"sp-margin-s-left"},Ft.createElement(Ht,{Component:()=>Ft.createElement("div",null,"The following errors must be corrected before submitting:",Ft.createElement("ul",null,a))},r))},hl=(e,t,n)=>e?[...new Set(t.concat(n))]:t.length>0?t:n,bl=({hasLocationChoices:e,showAll:t,recommendedLocations:n,locations:r,value:a,onChange:i,onShowAllChange:o,errors:l,touched:s,field:c})=>{if(!e)return Ft.createElement(yl,{name:c,errors:l,touched:s});const u=hl(t,n,r).sort().map((e=>({label:e,value:e})));return Ft.createElement(Ft.Fragment,null,Ft.createElement(tn,{clearable:!1,value:a,options:u,onChange:e=>i(e&&e.value||"")}),Ft.createElement(vl,{field:c,errors:l,touched:s}),n.length>0&&r.length>0&&Ft.createElement("div",{className:"pull-right"},Ft.createElement("button",{type:"button",className:"link",onClick:()=>{o(!t),hl(!t,n,r).includes(a)||i("")}},t?"Only show recommended locations":"Show all locations")))},gl=({metricsStores:e,selectedMetricsStore:t,objectStores:n,selectedObjectStore:r,onChange:a,errors:i,touched:o})=>Ft.createElement(Ft.Fragment,null,Ft.createElement("h5",null,"Advanced Settings"),Ft.createElement("div",{className:"horizontal-rule"}),Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"Metrics Account ",Ft.createElement(qt,{id:"pipeline.config.metricsAccount"})),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(tn,{clearable:!1,value:cn(t,"name"),options:e.map((({name:e})=>({label:e,value:e}))),onChange:e=>a("metricsAccountName",e&&e.value||"")}),Ft.createElement(vl,{field:"metricsAccountName",errors:i,touched:o}))),Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"Storage Account ",Ft.createElement(qt,{id:"pipeline.config.storageAccount"})),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(tn,{clearable:!1,value:cn(r,"name"),options:n.map((({name:e})=>({label:e,value:e}))),onChange:e=>a("storageAccountName",e&&e.value||"")}),Ft.createElement(vl,{field:"storageAccountName",errors:i,touched:o})))),vl=({field:e,errors:t,touched:n})=>n[e]&&t[e]?Ft.createElement("div",{className:"error-message"},t[e]):null,yl=e=>{const{errors:t,name:n,touched:r}=e;return Ft.createElement(Ft.Fragment,null,Ft.createElement(Cn,Object.assign({},e,{className:"form-control input-sm",required:r[n],error:t[n]})),Ft.createElement(vl,{field:n,errors:t,touched:r}))};var El=ce(((e,t)=>Object.assign({configId:It(e,t.executionId)},t)))((({configId:e,configName:t})=>{const n=ln("^.^.canaryConfig.configDetail",{id:e});return Ft.createElement("a",Object.assign({},n),t)}));const wl=({parentPipelineExecutionId:e,application:t})=>{const n=ln("home.applications.application.pipelines.executionDetails.execution",{application:t,executionId:e});return Ft.createElement("a",Object.assign({},n),"Pipeline")};var xl=ce(((e,t)=>Object.assign({configId:It(e,t.executionId)},t)))((({configId:e,executionId:t,children:n})=>{const r=ln("^.reportDetail",{configId:e,runId:t});return Ft.createElement("a",Object.assign({},r),n)}));Ee(".execution-list-container {\n overflow-y: auto;\n}\n.execution-list-table {\n margin-bottom: 0;\n}\n");const Nl=(e,t)=>Object.keys(e).reduce(((n,r)=>{const{controlScope:a,experimentScope:i}=e[r],o=((e,t)=>t.some((({query:t,scopeName:n})=>n===e&&"atlas"===t.type)))(r,t);return o&&"global"===cn(a,"extendedScopeParams.dataset")?n.add("Global"):n.add(a.location),o&&"global"===cn(i,"extendedScopeParams.dataset")?n.add("Global"):n.add(i.location),n}),new Set),Sl=[{label:"Summary",getContent:e=>Ft.createElement("div",null,Ft.createElement(xl,{configName:e.config.name,executionId:e.pipelineId,application:e.application},Ft.createElement(ko,{score:e.result.judgeResult.score,showClassification:!1,inverse:!0})," ",Ft.createElement(Mi,{dateIso:e.startTimeIso})),e.startTimeIso&&Ft.createElement("div",{className:"color-text-caption body-small"},rn(new Date(e.startTimeIso).getTime())))},{label:"Locations",getContent:({canaryExecutionRequest:{scopes:e},config:{metrics:t}})=>{const n=[...Nl(e,t)];return Ft.createElement("div",{className:"vertical"},n.map((e=>Ft.createElement("span",{key:e},e))))}},{label:"Config",getContent:e=>Ft.createElement(El,{configName:e.config.name,executionId:e.pipelineId,application:e.application})},{label:"Scopes",getContent:({canaryExecutionRequest:{scopes:e}})=>{const t=Object.keys(e).reduce(((t,n)=>t.add(e[n].controlScope.scope)),new Set),n=Object.keys(e).reduce(((t,n)=>t.add(e[n].experimentScope.scope)),new Set),r={maxWidth:"350px",wordBreak:"break-all"};return wn(t,n)?Ft.createElement("div",{className:"vertical",style:r},[...n].map((e=>Ft.createElement("span",{key:e},e)))):Ft.createElement("div",{className:"vertical",style:r},Ft.createElement("span",{className:"heading-6 uppercase color-text-caption"},"Baseline"),[...t].map((e=>Ft.createElement("span",{key:e},e))),Ft.createElement("span",{className:"heading-6 uppercase color-text-caption",style:{marginTop:"5px"}},"Canary"),[...n].map((e=>Ft.createElement("span",{key:e},e))))}},{getContent:({parentPipelineExecutionId:e,application:t})=>e&&e!==Mt&&Ft.createElement(wl,{parentPipelineExecutionId:e,application:t})}],Cl=(e,t)=>Q.manualAnalysisEnabled?Sl.concat([{label:"Actions",getContent:n=>Ft.createElement(Kt,{value:"Re-run analysis"},Ft.createElement("button",{className:"link",onClick:()=>Ol(n,e,t)},Ft.createElement("i",{className:"fas fa-redo-alt"})))}]):Sl,Ol=(e,t,n)=>{var r;const{controlScope:a,experimentScope:i}=Object.values(e.canaryExecutionRequest.scopes)[0],o=`${null!==(r=a.step)&&void 0!==r?r:60}`;ml.show({title:"Start Manual Analysis",application:t,accounts:n,initialValues:{configId:e.canaryConfigId,startTime:a.start,endTime:a.end,step:o,baselineScope:a.scope,canaryScope:i.scope,baselineLocation:a.location,canaryLocation:i.location,extendedScopeParams:a.extendedScopeParams,resourceType:a.resourceType,marginalThreshold:`${e.canaryExecutionRequest.thresholds.marginal}`,passThreshold:`${e.canaryExecutionRequest.thresholds.pass}`,metricsAccountName:e.metricsAccountName,storageAccountName:e.storageAccountName}})},_l=({executions:e,application:t,accounts:n})=>t.getDataSource("canaryExecutions").loaded?e&&e.length?Ft.createElement(Qe,{rows:e,className:"flex-1 execution-list-table",columns:Cl(t,n),rowKey:e=>e.pipelineId}):Ft.createElement(oo,null,Ft.createElement("h3",{className:"heading-3"},"No canary execution history for this application.")):Ft.createElement(oo,null,Ft.createElement("div",{className:"horizontal center middle spinner-container"},Ft.createElement($t,null))),kl=e=>{Vt.$state.go(".",{count:Number(e.target.value)})};var Tl=ce((e=>({executions:Object.values(e.data.executions.data).filter((e=>e.result)),application:e.data.application,accounts:e.data.kayentaAccounts.data,executionsCount:e.app.executionsCount})))((({executions:e,application:t,accounts:n,executionsCount:r})=>{var a;Ft.useEffect((()=>{const e=t.getDataSource("canaryExecutions");return e.active||e.activate(),e.refresh(),()=>e.deactivate()}),[t,r]);const i=null!==(a=Q.executionsCountOptions)&&void 0!==a?a:[20,50,100,200];return i.includes(r)||(i.push(r),i.sort(((e,t)=>e-t))),Ft.createElement("div",{className:"vertical execution-list-container"},Ft.createElement("div",{className:"horizontal space-between form-inline"},Ft.createElement("div",{className:"form-group"},i.length>1&&Ft.createElement(Ft.Fragment,null,Ft.createElement("span",{className:"sp-margin-s-right"},"Showing"),Ft.createElement("select",{className:"form-control input-sm",onChange:kl},i.map((e=>Ft.createElement("option",{selected:r===e,value:e},e)))),Ft.createElement("span",{className:"sp-margin-s-left"},"most recent reports"))),Q.manualAnalysisEnabled&&Ft.createElement("button",{style:{alignSelf:"flex-end",flexShrink:0},className:"primary",onClick:()=>((e,t)=>{ml.show({title:"Start Manual Analysis",application:e,accounts:t})})(t,n)},Ft.createElement("i",{className:"fa fa-play"})," Start Manual Analysis")),Ft.createElement(_l,{executions:e,application:t,accounts:n}))}));var jl=ce((e=>({loadState:e.data.executions.load})))((({loadState:e})=>{const t=(new Ii).onFulfilled(Ft.createElement(Tl,null)).onFailed(Ft.createElement(oo,null,Ft.createElement("h3",{className:"heading-3"},"Could not load canary execution history."))).build();return Ft.createElement(t,{state:e})})),Al=()=>Ft.createElement("div",{className:"vertical flex-1"},Ft.createElement(an,Object.assign({},{wrap:!1},{name:"detail"})));function Il(e,t){const{stateRegistry:n}=t;var r;return n.get().filter((e=>e.name.match(/home.(project|applications).application.canary/))).sort(((e,t)=>t.name.length-e.name.length)).forEach((e=>n.deregister(e))),function(e,t){var n,r,a;const i={name:"canaryConfig",url:"/config",views:{canary:{component:bo,$type:"react"}},children:[{name:"configDefault",url:"",views:{detail:{component:wo,$type:"react"}}},{name:"configDetail",url:"/:id?copy&new",views:{detail:{component:co,$type:"react"},footer:{component:Eo,$type:"react"}},params:{copy:{type:"boolean",value:!1,squash:!0},new:{type:"boolean",value:!1,squash:!0}},resolve:[{token:"configNameStream",deps:[sn],resolveFn:e=>e.globals.params$}]}],redirectTo:e=>e.to().name+".configDefault"},o={name:"reportDetail",url:"/:configId/:runId",views:{detail:{component:pl,$type:"react"}},resolve:[{token:"resultIdStream",deps:[sn],resolveFn:e=>e.globals.params$}]},l={name:"reportDefault",url:"",views:{detail:{component:jl,$type:"react"}}},s={name:"report",url:"/report?count",views:{canary:{component:Al,$type:"react"}},params:{count:{type:"int",value:null!==(a=null!==(n=Q.defaultExecutionCount)&&void 0!==n?n:null===(r=Q.executionsCountOptions)||void 0===r?void 0:r[0])&&void 0!==a?a:20,squash:!0}},children:[o,l],redirectTo:e=>e.to().name+".reportDefault"},c={abstract:!0,name:"canary",url:"/canary",views:{insight:{component:Ai,$type:"react"}},data:{pageTitleSection:{title:"Canary"}},children:[i,s]};t.addChildState(c)}(0,e),(r=t).transitionService.onBefore({from:"**.configDetail.**",to:e=>!e.name.includes("configDetail")},(()=>{ji.dispatch(Pt())})),Dt.$rootScope.$on("$stateChangeStart",(e=>{const t=ji.getState();t.selectedConfig&&!t.selectedConfig.isInSyncWithServer&&(window.confirm("You have unsaved changes.\nAre you sure you want to navigate away from this page?")||e.preventDefault())})),r.transitionService.onEnter({to:"**.configDetail.**"},(()=>{window.onbeforeunload=()=>{const e=ji.getState();return e.selectedConfig&&!e.selectedConfig.isInSyncWithServer||null}})),r.transitionService.onExit({from:"**.configDetail.**"},(()=>{window.onbeforeunload=void 0})),r.transitionService.onSuccess({to:"**.report.**"},(e=>{e.params("from").count!==e.params("to").count&&ji.dispatch(Rt({count:e.params("to").count}))})),ne.afterConfigsLoaded=e=>{e===ji.getState().data.application&&ji.dispatch(re({configSummaries:e.getDataSource("canaryConfigs").data}))},ne.afterJudgesLoaded=e=>{e===ji.getState().data.application&&ji.dispatch(ae({judges:e.getDataSource("canaryJudges").data}))},ne.loadCanaryExecutions=e=>{const t=ie(e.name);return t.catch((e=>{ji.dispatch(oe({error:e}))})),t},ne.afterCanaryExecutionsLoaded=e=>{e===ji.getState().data.application&&ji.dispatch(le({executions:e.getDataSource("canaryExecutions").data}))},{}}export{Il as lazyInitializeKayenta};
|
|
2
|
-
//# sourceMappingURL=lazy-
|
|
1
|
+
import{c as e,G as t,m as n,a as r,b as a,C as i,d as o,s as l,e as s,f as c,g as u,l as p,h as d,L as m,S as f,i as h,j as b,u as g,k as v,n as y,D as E,o as w,p as x,q as N,r as S,t as C,v as O,w as _,x as k,y as T,z as j,A,B as I,E as M,F as P,U as D,H as R,I as F,K as L,J as $,M as z,N as V,O as G,P as q,Q as U,R as Y,T as K,V as B,W,X as H,Y as J,Z,_ as Q,$ as X,a0 as ee,a1 as te,a2 as ne,a3 as re,a4 as ae,a5 as ie,a6 as oe,a7 as le,a8 as se,a9 as ce,aa as ue,ab as pe,ac as de,ad as me,ae as fe,af as he,ag as be,ah as ge,ai as ve,aj as ye,ak as Ee,al as we,am as xe,an as Ne,ao as Se,ap as Ce,aq as Oe,ar as _e,as as ke,at as Te,au as je,av as Ae,aw as Ie,ax as Me,ay as Pe,az as De,aA as Re,aB as Fe,aC as Le,aD as $e,aE as ze,aF as Ve,aG as Ge,aH as qe,aI as Ue,aJ as Ye,aK as Ke,aL as Be,aM as We,aN as He,aO as Je,aP as Ze,aQ as Qe,aR as Xe,aS as et,aT as tt,aU as nt,aV as rt,aW as at,aX as it,aY as ot,aZ as lt,a_ as st,a$ as ct,b0 as ut,b1 as pt,b2 as dt,b3 as mt,b4 as ft,b5 as ht,b6 as bt,b7 as gt,b8 as vt,b9 as yt,ba as Et,bb as wt,bc as xt,bd as Nt,be as St,bf as Ct,bg as Ot,bh as _t,bi as kt,bj as Tt,bk as jt,bl as At,bm as It,bn as Mt,bo as Pt,bp as Dt,bq as Rt}from"./index-70b2ac83.js";import*as Ft from"react";import{Suspense as Lt}from"react";import{Spinner as $t,REST as zt,ReactInjector as Vt,timestamp as Gt,HelpField as qt,robotToHuman as Ut,noop as Yt,Tooltip as Kt,UUIDGenerator as Bt,SubmitButton as Wt,HoverablePopover as Ht,SETTINGS as Jt,CopyToClipboard as Zt,BreakString as Qt,ReactModal as Xt,ModalClose as en,TetheredSelect as tn,MapEditor as nn,relativeTime as rn}from"@spinnaker/core";import{UIView as an,UISref as on,useSref as ln}from"@uirouter/react";import{UIRouter as sn}from"@uirouter/core";import{get as cn,isString as un,isEmpty as pn,values as dn,isNull as mn,cloneDeep as fn,chain as hn,isNumber as bn,uniq as gn,flatMap as vn,sortBy as yn,round as En,isEqual as wn}from"lodash";import{Modal as xn}from"react-bootstrap";import{Formik as Nn,Form as Sn,Field as Cn}from"formik";import"angular";import"react-dom";import"prop-types";import"react-select";const On=({columns:t,className:n})=>Ft.createElement("div",{className:e("horizontal",n)},t.map(((t,n)=>Ft.createElement("div",{key:t.label||n,className:`flex-${t.width}`},!t.hide&&Ft.createElement("h6",{className:e("heading-6","uppercase","color-text-primary",t.labelClassName)},t.label)))));function _n({rows:t,columns:n,rowKey:r,tableBodyClassName:a,rowClassName:i,onRowClick:o,customRow:l,className:s,headerClassName:c}){const u=({row:t})=>Ft.createElement("li",{onClick:o?()=>o(t):null,className:e({horizontal:!i,"table-row":!i},i&&i(t))},n.map(((e,n)=>Ft.createElement("div",{key:e.label||n,className:`flex-${e.width}`},!e.hide&&e.getContent(t)))));return Ft.createElement("div",{className:s},Ft.createElement("ul",{className:e(a,"list-group")},Ft.createElement(On,{columns:n,className:e("table-header","sticky-header",c)}),t.map((e=>l&&l(e)?Ft.createElement("div",{key:r(e)},l(e)):Ft.createElement(u,{key:r(e),row:e})))))}function kn(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}var Tn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};const jn=Ft.lazy((()=>import(/* webpackChunkName: "Lazy-KayentaGraphs" */"./semioticGraph-d687462f.js"))),An=[t.TimeSeries,t.Histogram,t.BoxPlot];n.register({name:"semiotic",handlesGraphType:e=>An.includes(e),getGraph:()=>e=>Ft.createElement(Lt,{fallback:Ft.createElement($t,null)},Ft.createElement(jn,Object.assign({},e)))});var In=r((function(e,t){!function(e){function t(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function n(e,t){Object.defineProperty(this,"kind",{value:e,enumerable:!0}),t&&t.length&&Object.defineProperty(this,"path",{value:t,enumerable:!0})}function r(e,t,n){r.super_.call(this,"E",e),Object.defineProperty(this,"lhs",{value:t,enumerable:!0}),Object.defineProperty(this,"rhs",{value:n,enumerable:!0})}function i(e,t){i.super_.call(this,"N",e),Object.defineProperty(this,"rhs",{value:t,enumerable:!0})}function o(e,t){o.super_.call(this,"D",e),Object.defineProperty(this,"lhs",{value:t,enumerable:!0})}function l(e,t,n){l.super_.call(this,"A",e),Object.defineProperty(this,"index",{value:t,enumerable:!0}),Object.defineProperty(this,"item",{value:n,enumerable:!0})}function s(e,t,n){var r=e.slice((n||t)+1||e.length);return e.length=t<0?e.length+t:t,e.push.apply(e,r),e}function c(e){var t=void 0===e?"undefined":j(e);return"object"!==t?t:e===Math?"math":null===e?"null":Array.isArray(e)?"array":"[object Date]"===Object.prototype.toString.call(e)?"date":"function"==typeof e.toString&&/^\/.*\//.test(e.toString())?"regexp":"object"}function u(e,t,n,a,p,d,m){m=m||[];var f=(p=p||[]).slice(0);if(void 0!==d){if(a){if("function"==typeof a&&a(f,d))return;if("object"===(void 0===a?"undefined":j(a))){if(a.prefilter&&a.prefilter(f,d))return;if(a.normalize){var h=a.normalize(f,d,e,t);h&&(e=h[0],t=h[1])}}}f.push(d)}"regexp"===c(e)&&"regexp"===c(t)&&(e=e.toString(),t=t.toString());var b=void 0===e?"undefined":j(e),g=void 0===t?"undefined":j(t),v="undefined"!==b||m&&m[m.length-1].lhs&&m[m.length-1].lhs.hasOwnProperty(d),y="undefined"!==g||m&&m[m.length-1].rhs&&m[m.length-1].rhs.hasOwnProperty(d);if(!v&&y)n(new i(f,t));else if(!y&&v)n(new o(f,e));else if(c(e)!==c(t))n(new r(f,e,t));else if("date"===c(e)&&e-t!=0)n(new r(f,e,t));else if("object"===b&&null!==e&&null!==t)if(m.filter((function(t){return t.lhs===e})).length)e!==t&&n(new r(f,e,t));else{if(m.push({lhs:e,rhs:t}),Array.isArray(e)){var E;for(e.length,E=0;E<e.length;E++)E>=t.length?n(new l(f,E,new o(void 0,e[E]))):u(e[E],t[E],n,a,f,E,m);for(;E<t.length;)n(new l(f,E,new i(void 0,t[E++])))}else{var w=Object.keys(e),x=Object.keys(t);w.forEach((function(r,i){var o=x.indexOf(r);o>=0?(u(e[r],t[r],n,a,f,r,m),x=s(x,o)):u(e[r],void 0,n,a,f,r,m)})),x.forEach((function(e){u(void 0,t[e],n,a,f,e,m)}))}m.length=m.length-1}else e!==t&&("number"===b&&isNaN(e)&&isNaN(t)||n(new r(f,e,t)))}function p(e,t,n,r){return r=r||[],u(e,t,(function(e){e&&r.push(e)}),n),r.length?r:void 0}function d(e,t,n){if(n.path&&n.path.length){var r,a=e[t],i=n.path.length-1;for(r=0;r<i;r++)a=a[n.path[r]];switch(n.kind){case"A":d(a[n.path[r]],n.index,n.item);break;case"D":delete a[n.path[r]];break;case"E":case"N":a[n.path[r]]=n.rhs}}else switch(n.kind){case"A":d(e[t],n.index,n.item);break;case"D":e=s(e,t);break;case"E":case"N":e[t]=n.rhs}return e}function m(e,t,n){if(e&&t&&n&&n.kind){for(var r=e,a=-1,i=n.path?n.path.length-1:0;++a<i;)void 0===r[n.path[a]]&&(r[n.path[a]]="number"==typeof n.path[a]?[]:{}),r=r[n.path[a]];switch(n.kind){case"A":d(n.path?r[n.path[a]]:r,n.index,n.item);break;case"D":delete r[n.path[a]];break;case"E":case"N":r[n.path[a]]=n.rhs}}}function f(e,t,n){if(n.path&&n.path.length){var r,a=e[t],i=n.path.length-1;for(r=0;r<i;r++)a=a[n.path[r]];switch(n.kind){case"A":f(a[n.path[r]],n.index,n.item);break;case"D":case"E":a[n.path[r]]=n.lhs;break;case"N":delete a[n.path[r]]}}else switch(n.kind){case"A":f(e[t],n.index,n.item);break;case"D":case"E":e[t]=n.lhs;break;case"N":e=s(e,t)}return e}function h(e,t,n){if(e&&t&&n&&n.kind){var r,a,i=e;for(a=n.path.length-1,r=0;r<a;r++)void 0===i[n.path[r]]&&(i[n.path[r]]={}),i=i[n.path[r]];switch(n.kind){case"A":f(i[n.path[r]],n.index,n.item);break;case"D":case"E":i[n.path[r]]=n.lhs;break;case"N":delete i[n.path[r]]}}}function b(e,t,n){e&&t&&u(e,t,(function(r){n&&!n(e,t,r)||m(e,t,r)}))}function g(e){return"color: "+M[e].color+"; font-weight: bold"}function v(e){var t=e.kind,n=e.path,r=e.lhs,a=e.rhs,i=e.index,o=e.item;switch(t){case"E":return[n.join("."),r,"→",a];case"N":return[n.join("."),a];case"D":return[n.join(".")];case"A":return[n.join(".")+"["+i+"]",o];default:return[]}}function y(e,t,n,r){var a=p(e,t);try{r?n.groupCollapsed("diff"):n.group("diff")}catch(e){n.log("diff")}a?a.forEach((function(e){var t=e.kind,r=v(e);n.log.apply(n,["%c "+M[t].text,g(t)].concat(A(r)))})):n.log("—— no diff ——");try{n.groupEnd()}catch(e){n.log("—— diff end —— ")}}function E(e,t,n,r){switch(void 0===e?"undefined":j(e)){case"object":return"function"==typeof e[r]?e[r].apply(e,A(n)):e[r];case"function":return e(t);default:return e}}function w(e){var t=e.timestamp,n=e.duration;return function(e,r,a){var i=["action"];return i.push("%c"+String(e.type)),t&&i.push("%c@ "+r),n&&i.push("%c(in "+a.toFixed(2)+" ms)"),i.join(" ")}}function x(e,t){var n=t.logger,r=t.actionTransformer,a=t.titleFormatter,i=void 0===a?w(t):a,o=t.collapsed,l=t.colors,s=t.level,c=t.diff,u=void 0===t.titleFormatter;e.forEach((function(a,p){var d=a.started,m=a.startedTime,f=a.action,h=a.prevState,b=a.error,g=a.took,v=a.nextState,w=e[p+1];w&&(v=w.prevState,g=w.started-d);var x=r(f),N="function"==typeof o?o((function(){return v}),f,a):o,S=k(m),C=l.title?"color: "+l.title(x)+";":"",O=["color: gray; font-weight: lighter;"];O.push(C),t.timestamp&&O.push("color: gray; font-weight: lighter;"),t.duration&&O.push("color: gray; font-weight: lighter;");var _=i(x,S,g);try{N?l.title&&u?n.groupCollapsed.apply(n,["%c "+_].concat(O)):n.groupCollapsed(_):l.title&&u?n.group.apply(n,["%c "+_].concat(O)):n.group(_)}catch(e){n.log(_)}var T=E(s,x,[h],"prevState"),j=E(s,x,[x],"action"),A=E(s,x,[b,h],"error"),I=E(s,x,[v],"nextState");if(T)if(l.prevState){var M="color: "+l.prevState(h)+"; font-weight: bold";n[T]("%c prev state",M,h)}else n[T]("prev state",h);if(j)if(l.action){var P="color: "+l.action(x)+"; font-weight: bold";n[j]("%c action ",P,x)}else n[j]("action ",x);if(b&&A)if(l.error){var D="color: "+l.error(b,h)+"; font-weight: bold;";n[A]("%c error ",D,b)}else n[A]("error ",b);if(I)if(l.nextState){var R="color: "+l.nextState(v)+"; font-weight: bold";n[I]("%c next state",R,v)}else n[I]("next state",v);c&&y(h,v,n,N);try{n.groupEnd()}catch(e){n.log("—— log end ——")}}))}function N(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},P,e),n=t.logger,r=t.stateTransformer,a=t.errorTransformer,i=t.predicate,o=t.logErrors,l=t.diffPredicate;if(void 0===n)return function(){return function(e){return function(t){return e(t)}}};if(e.getState&&e.dispatch)return console.error("[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware:\n// Logger with default options\nimport { logger } from 'redux-logger'\nconst store = createStore(\n reducer,\n applyMiddleware(logger)\n)\n// Or you can create your own logger with custom options http://bit.ly/redux-logger-options\nimport createLogger from 'redux-logger'\nconst logger = createLogger({\n // ...options\n});\nconst store = createStore(\n reducer,\n applyMiddleware(logger)\n)\n"),function(){return function(e){return function(t){return e(t)}}};var s=[];return function(e){var n=e.getState;return function(e){return function(c){if("function"==typeof i&&!i(n,c))return e(c);var u={};s.push(u),u.started=T.now(),u.startedTime=new Date,u.prevState=r(n()),u.action=c;var p=void 0;if(o)try{p=e(c)}catch(e){u.error=a(e)}else p=e(c);u.took=T.now()-u.started,u.nextState=r(n());var d=t.diff&&"function"==typeof l?l(n,c):t.diff;if(x(s,Object.assign({},t,{diff:d})),s.length=0,u.error)throw u.error;return p}}}}var S,C,O=function(e,t){return new Array(t+1).join(e)},_=function(e,t){return O("0",t-e.toString().length)+e},k=function(e){return _(e.getHours(),2)+":"+_(e.getMinutes(),2)+":"+_(e.getSeconds(),2)+"."+_(e.getMilliseconds(),3)},T="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance:Date,j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)},I=[];S="object"===(void 0===a?"undefined":j(a))&&a?a:"undefined"!=typeof window?window:{},(C=S.DeepDiff)&&I.push((function(){void 0!==C&&S.DeepDiff===p&&(S.DeepDiff=C,C=void 0)})),t(r,n),t(i,n),t(o,n),t(l,n),Object.defineProperties(p,{diff:{value:p,enumerable:!0},observableDiff:{value:u,enumerable:!0},applyDiff:{value:b,enumerable:!0},applyChange:{value:m,enumerable:!0},revertChange:{value:h,enumerable:!0},isConflict:{value:function(){return void 0!==C},enumerable:!0},noConflict:{value:function(){return I&&(I.forEach((function(e){e()})),I=null),p},enumerable:!0}});var M={E:{color:"#2196F3",text:"CHANGED:"},N:{color:"#4CAF50",text:"ADDED:"},D:{color:"#F44336",text:"DELETED:"},A:{color:"#2196F3",text:"ARRAY:"}},P={level:"log",logger:console,logErrors:!0,collapsed:void 0,predicate:void 0,duration:!1,timestamp:!0,stateTransformer:function(e){return e},actionTransformer:function(e){return e},errorTransformer:function(e){return e},colors:{title:function(){return"inherit"},prevState:function(){return"#9E9E9E"},action:function(){return"#03A9F4"},nextState:function(){return"#4CAF50"},error:function(){return"#F20404"}},diff:!1,diffPredicate:void 0,transformer:void 0},D=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dispatch,n=e.getState;return"function"==typeof t||"function"==typeof n?N()({dispatch:t,getState:n}):void console.error("\n[redux-logger v3] BREAKING CHANGE\n[redux-logger v3] Since 3.0.0 redux-logger exports by default logger with default settings.\n[redux-logger v3] Change\n[redux-logger v3] import createLogger from 'redux-logger'\n[redux-logger v3] to\n[redux-logger v3] import { createLogger } from 'redux-logger'\n")};e.defaults=P,e.createLogger=N,e.logger=D,e.default=D,Object.defineProperty(e,"__esModule",{value:!0})}(t)}));var Mn="undefined"!=typeof window&&window,Pn="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,Dn=Mn||void 0!==a&&a||Pn,Rn=Dn;!function(){if(!Dn)throw new Error("RxJS could not find any global context (window, self, global)")}();var Fn={root:Rn};var Ln={isFunction:function(e){return"function"==typeof e}},$n={isArray:Array.isArray||function(e){return e&&"number"==typeof e.length}};var zn,Vn={isObject:function(e){return null!=e&&"object"==typeof e}},Gn={errorObject:{e:{}}};function qn(){try{return zn.apply(this,arguments)}catch(e){return Gn.errorObject.e=e,Gn.errorObject}}var Un={tryCatch:function(e){return zn=e,qn}},Yn=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},Kn={UnsubscriptionError:function(e){function t(t){e.call(this),this.errors=t;var n=Error.call(this,t?t.length+" errors occurred during unsubscription:\n "+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"");this.name=n.name="UnsubscriptionError",this.stack=n.stack,this.message=n.message}return Yn(t,e),t}(Error)},Bn=function(){function e(e){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,e&&(this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var e,t=!1;if(!this.closed){var n=this,r=n._parent,a=n._parents,i=n._unsubscribe,o=n._subscriptions;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;for(var l=-1,s=a?a.length:0;r;)r.remove(this),r=++l<s&&a[l]||null;if(Ln.isFunction(i))Un.tryCatch(i).call(this)===Gn.errorObject&&(t=!0,e=e||(Gn.errorObject.e instanceof Kn.UnsubscriptionError?Wn(Gn.errorObject.e.errors):[Gn.errorObject.e]));if($n.isArray(o))for(l=-1,s=o.length;++l<s;){var c=o[l];if(Vn.isObject(c))if(Un.tryCatch(c.unsubscribe).call(c)===Gn.errorObject){t=!0,e=e||[];var u=Gn.errorObject.e;u instanceof Kn.UnsubscriptionError?e=e.concat(Wn(u.errors)):e.push(u)}}if(t)throw new Kn.UnsubscriptionError(e)}},e.prototype.add=function(t){if(!t||t===e.EMPTY)return e.EMPTY;if(t===this)return this;var n=t;switch(typeof t){case"function":n=new e(t);case"object":if(n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if("function"!=typeof n._addParent){var r=n;(n=new e)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}return(this._subscriptions||(this._subscriptions=[])).push(n),n._addParent(this),n},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},e.prototype._addParent=function(e){var t=this._parent,n=this._parents;t&&t!==e?n?-1===n.indexOf(e)&&n.push(e):this._parents=[e]:this._parent=e},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}();function Wn(e){return e.reduce((function(e,t){return e.concat(t instanceof Kn.UnsubscriptionError?t.errors:t)}),[])}var Hn={Subscription:Bn},Jn={closed:!0,next:function(e){},error:function(e){throw e},complete:function(){}},Zn=r((function(e,t){var n=Fn.root.Symbol;t.rxSubscriber="function"==typeof n&&"function"==typeof n.for?n.for("rxSubscriber"):"@@rxSubscriber",t.$$rxSubscriber=t.rxSubscriber})),Qn=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},Xn=function(e){function t(n,r,a){switch(e.call(this),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=Jn;break;case 1:if(!n){this.destination=Jn;break}if("object"==typeof n){n instanceof t?(this.destination=n,this.destination.add(this)):(this.syncErrorThrowable=!0,this.destination=new tr(this,n));break}default:this.syncErrorThrowable=!0,this.destination=new tr(this,n,r,a)}}return Qn(t,e),t.prototype[Zn.rxSubscriber]=function(){return this},t.create=function(e,n,r){var a=new t(e,n,r);return a.syncErrorThrowable=!1,a},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parent,t=this._parents;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=e,this._parents=t,this},t}(Hn.Subscription),er=Xn,tr=function(e){function t(t,n,r,a){var i;e.call(this),this._parentSubscriber=t;var o=this;Ln.isFunction(n)?i=n:n&&(i=n.next,r=n.error,a=n.complete,n!==Jn&&(o=Object.create(n),Ln.isFunction(o.unsubscribe)&&this.add(o.unsubscribe.bind(o)),o.unsubscribe=this.unsubscribe.bind(this))),this._context=o,this._next=i,this._error=r,this._complete=a}return Qn(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber;if(this._error)t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else{if(!t.syncErrorThrowable)throw this.unsubscribe(),e;t.syncErrorValue=e,t.syncErrorThrown=!0,this.unsubscribe()}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var n=function(){return e._complete.call(e._context)};t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){throw this.unsubscribe(),e}},t.prototype.__tryOrSetError=function(e,t,n){try{t.call(this._context,n)}catch(t){return e.syncErrorValue=t,e.syncErrorThrown=!0,!0}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(Xn),nr={Subscriber:er};var rr={toSubscriber:function(e,t,n){if(e){if(e instanceof nr.Subscriber)return e;if(e[Zn.rxSubscriber])return e[Zn.rxSubscriber]()}return e||t||n?new nr.Subscriber(e,t,n):new nr.Subscriber(Jn)}},ar=r((function(e,t){function n(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}t.getSymbolObservable=n,t.observable=n(Fn.root),t.$$observable=t.observable}));var ir={noop:function(){}};function or(e){return e?1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}:ir.noop}var lr={pipe:function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return or(e)},pipeFromArray:or},sr=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this.operator,a=rr.toSubscriber(e,t,n);if(r?r.call(a,this.source):a.add(this.source?this._subscribe(a):this._trySubscribe(a)),a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.syncErrorThrown=!0,e.syncErrorValue=t,e.error(t)}},e.prototype.forEach=function(e,t){var n=this;if(t||(Fn.root.Rx&&Fn.root.Rx.config&&Fn.root.Rx.config.Promise?t=Fn.root.Rx.config.Promise:Fn.root.Promise&&(t=Fn.root.Promise)),!t)throw new Error("no Promise impl found");return new t((function(t,r){var a;a=n.subscribe((function(t){if(a)try{e(t)}catch(e){r(e),a.unsubscribe()}else e(t)}),r,t)}))},e.prototype._subscribe=function(e){return this.source.subscribe(e)},e.prototype[ar.observable]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return 0===e.length?this:lr.pipeFromArray(e)(this)},e.prototype.toPromise=function(e){var t=this;if(e||(Fn.root.Rx&&Fn.root.Rx.config&&Fn.root.Rx.config.Promise?e=Fn.root.Rx.config.Promise:Fn.root.Promise&&(e=Fn.root.Promise)),!e)throw new Error("no Promise impl found");return new e((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}(),cr=sr,ur={Observable:cr},pr=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},dr={ObjectUnsubscribedError:function(e){function t(){var t=e.call(this,"object unsubscribed");this.name=t.name="ObjectUnsubscribedError",this.stack=t.stack,this.message=t.message}return pr(t,e),t}(Error)},mr=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},fr={SubjectSubscription:function(e){function t(t,n){e.call(this),this.subject=t,this.subscriber=n,this.closed=!1}return mr(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}},t}(Hn.Subscription)},hr=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},br=function(e){function t(t){e.call(this,t),this.destination=t}return hr(t,e),t}(nr.Subscriber),gr=function(e){function t(){e.call(this),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}return hr(t,e),t.prototype[Zn.rxSubscriber]=function(){return new br(this)},t.prototype.lift=function(e){var t=new yr(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new dr.ObjectUnsubscribedError;if(!this.isStopped)for(var t=this.observers,n=t.length,r=t.slice(),a=0;a<n;a++)r[a].next(e)},t.prototype.error=function(e){if(this.closed)throw new dr.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,n=t.length,r=t.slice(),a=0;a<n;a++)r[a].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new dr.ObjectUnsubscribedError;this.isStopped=!0;for(var e=this.observers,t=e.length,n=e.slice(),r=0;r<t;r++)n[r].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(this.closed)throw new dr.ObjectUnsubscribedError;return e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){if(this.closed)throw new dr.ObjectUnsubscribedError;return this.hasError?(e.error(this.thrownError),Hn.Subscription.EMPTY):this.isStopped?(e.complete(),Hn.Subscription.EMPTY):(this.observers.push(e),new fr.SubjectSubscription(this,e))},t.prototype.asObservable=function(){var e=new ur.Observable;return e.source=this,e},t.create=function(e,t){return new yr(e,t)},t}(ur.Observable),vr=gr,yr=function(e){function t(t,n){e.call(this),this.destination=t,this.source=n}return hr(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):Hn.Subscription.EMPTY},t}(gr),Er=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};var wr=function(e,t){return function(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new xr(e,t))}},xr=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new Sr(e,this.project,this.thisArg))},e}(),Nr=xr,Sr=function(e){function t(t,n,r){e.call(this,t),this.project=n,this.count=0,this.thisArg=r||this}return Er(t,e),t.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(nr.Subscriber),Cr={map:wr,MapOperator:Nr};var Or=function(e,t){return Cr.map(e,t)(this)},_r={map:Or},kr=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},Tr={OuterSubscriber:function(e){function t(){e.apply(this,arguments)}return kr(t,e),t.prototype.notifyNext=function(e,t,n,r,a){this.destination.next(t)},t.prototype.notifyError=function(e,t){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(nr.Subscriber)},jr=function(e){return e&&"number"==typeof e.length};var Ar={isPromise:function(e){return e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}},Ir=r((function(e,t){function n(e){var t=e.Symbol;if("function"==typeof t)return t.iterator||(t.iterator=t("iterator polyfill")),t.iterator;var n=e.Set;if(n&&"function"==typeof(new n)["@@iterator"])return"@@iterator";var r=e.Map;if(r)for(var a=Object.getOwnPropertyNames(r.prototype),i=0;i<a.length;++i){var o=a[i];if("entries"!==o&&"size"!==o&&r.prototype[o]===r.prototype.entries)return o}return"@@iterator"}t.symbolIteratorPonyfill=n,t.iterator=n(Fn.root),t.$$iterator=t.iterator})),Mr=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},Pr={InnerSubscriber:function(e){function t(t,n,r){e.call(this),this.parent=t,this.outerValue=n,this.outerIndex=r,this.index=0}return Mr(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)},t.prototype._error=function(e){this.parent.notifyError(e,this),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(nr.Subscriber)};var Dr={subscribeToResult:function(e,t,n,r){var a=new Pr.InnerSubscriber(e,n,r);if(a.closed)return null;if(t instanceof ur.Observable)return t._isScalar?(a.next(t.value),a.complete(),null):(a.syncErrorThrowable=!0,t.subscribe(a));if(jr(t)){for(var i=0,o=t.length;i<o&&!a.closed;i++)a.next(t[i]);a.closed||a.complete()}else{if(Ar.isPromise(t))return t.then((function(e){a.closed||(a.next(e),a.complete())}),(function(e){return a.error(e)})).then(null,(function(e){Fn.root.setTimeout((function(){throw e}))})),a;if(t&&"function"==typeof t[Ir.iterator])for(var l=t[Ir.iterator]();;){var s=l.next();if(s.done){a.complete();break}if(a.next(s.value),a.closed)break}else if(t&&"function"==typeof t[ar.observable]){var c=t[ar.observable]();if("function"==typeof c.subscribe)return c.subscribe(new Pr.InnerSubscriber(e,n,r));a.error(new TypeError("Provided object does not correctly implement Symbol.observable"))}else{var u="You provided "+(Vn.isObject(t)?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.";a.error(new TypeError(u))}}return null}},Rr=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};var Fr=function(e,t){return function(n){return n.lift(new Lr(e,t))}},Lr=function(){function e(e,t){this.project=e,this.resultSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new $r(e,this.project,this.resultSelector))},e}(),$r=function(e){function t(t,n,r){e.call(this,t),this.project=n,this.resultSelector=r,this.index=0}return Rr(t,e),t.prototype._next=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(e){return void this.destination.error(e)}this._innerSub(t,e,n)},t.prototype._innerSub=function(e,t,n){var r=this.innerSubscription;r&&r.unsubscribe(),this.add(this.innerSubscription=Dr.subscribeToResult(this,e,t,n))},t.prototype._complete=function(){var t=this.innerSubscription;t&&!t.closed||e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.innerSubscription=null},t.prototype.notifyComplete=function(t){this.remove(t),this.innerSubscription=null,this.isStopped&&e.prototype._complete.call(this)},t.prototype.notifyNext=function(e,t,n,r,a){this.resultSelector?this._tryNotifyNext(e,t,n,r):this.destination.next(t)},t.prototype._tryNotifyNext=function(e,t,n,r){var a;try{a=this.resultSelector(e,t,n,r)}catch(e){return void this.destination.error(e)}this.destination.next(a)},t}(Tr.OuterSubscriber),zr={switchMap:Fr};var Vr=function(e,t){return zr.switchMap(e,t)(this)},Gr=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},qr={ScalarObservable:function(e){function t(t,n){e.call(this),this.value=t,this.scheduler=n,this._isScalar=!0,n&&(this._isScalar=!1)}return Gr(t,e),t.create=function(e,n){return new t(e,n)},t.dispatch=function(e){var t=e.done,n=e.value,r=e.subscriber;t?r.complete():(r.next(n),r.closed||(e.done=!0,this.schedule(e)))},t.prototype._subscribe=function(e){var n=this.value,r=this.scheduler;if(r)return r.schedule(t.dispatch,0,{done:!1,value:n,subscriber:e});e.next(n),e.closed||e.complete()},t}(ur.Observable)},Ur=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},Yr={EmptyObservable:function(e){function t(t){e.call(this),this.scheduler=t}return Ur(t,e),t.create=function(e){return new t(e)},t.dispatch=function(e){e.subscriber.complete()},t.prototype._subscribe=function(e){var n=this.scheduler;if(n)return n.schedule(t.dispatch,0,{subscriber:e});e.complete()},t}(ur.Observable)};var Kr={isScheduler:function(e){return e&&"function"==typeof e.schedule}},Br=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},Wr={ArrayObservable:function(e){function t(t,n){e.call(this),this.array=t,this.scheduler=n,n||1!==t.length||(this._isScalar=!0,this.value=t[0])}return Br(t,e),t.create=function(e,n){return new t(e,n)},t.of=function(){for(var e=[],n=0;n<arguments.length;n++)e[n-0]=arguments[n];var r=e[e.length-1];Kr.isScheduler(r)?e.pop():r=null;var a=e.length;return a>1?new t(e,r):1===a?new qr.ScalarObservable(e[0],r):new Yr.EmptyObservable(r)},t.dispatch=function(e){var t=e.array,n=e.index,r=e.count,a=e.subscriber;n>=r?a.complete():(a.next(t[n]),a.closed||(e.index=n+1,this.schedule(e)))},t.prototype._subscribe=function(e){var n=this.array,r=n.length,a=this.scheduler;if(a)return a.schedule(t.dispatch,0,{array:n,index:0,count:r,subscriber:e});for(var i=0;i<r&&!e.closed;i++)e.next(n[i]);e.complete()},t}(ur.Observable)},Hr=Wr.ArrayObservable.of,Jr={of:Hr},Zr=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};function Qr(e){var t=e.value,n=e.subscriber;n.closed||(n.next(t),n.complete())}function Xr(e){var t=e.err,n=e.subscriber;n.closed||n.error(t)}var ea={PromiseObservable:function(e){function t(t,n){e.call(this),this.promise=t,this.scheduler=n}return Zr(t,e),t.create=function(e,n){return new t(e,n)},t.prototype._subscribe=function(e){var t=this,n=this.promise,r=this.scheduler;if(null==r)this._isScalar?e.closed||(e.next(this.value),e.complete()):n.then((function(n){t.value=n,t._isScalar=!0,e.closed||(e.next(n),e.complete())}),(function(t){e.closed||e.error(t)})).then(null,(function(e){Fn.root.setTimeout((function(){throw e}))}));else if(this._isScalar){if(!e.closed)return r.schedule(Qr,0,{value:this.value,subscriber:e})}else n.then((function(n){t.value=n,t._isScalar=!0,e.closed||e.add(r.schedule(Qr,0,{value:n,subscriber:e}))}),(function(t){e.closed||e.add(r.schedule(Xr,0,{err:t,subscriber:e}))})).then(null,(function(e){Fn.root.setTimeout((function(){throw e}))}))},t}(ur.Observable)},ta=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},na=function(e){function t(t,n){if(e.call(this),this.scheduler=n,null==t)throw new Error("iterator cannot be null.");this.iterator=oa(t)}return ta(t,e),t.create=function(e,n){return new t(e,n)},t.dispatch=function(e){var t=e.index,n=e.hasError,r=e.iterator,a=e.subscriber;if(n)a.error(e.error);else{var i=r.next();i.done?a.complete():(a.next(i.value),e.index=t+1,a.closed?"function"==typeof r.return&&r.return():this.schedule(e))}},t.prototype._subscribe=function(e){var n=this.iterator,r=this.scheduler;if(r)return r.schedule(t.dispatch,0,{index:0,iterator:n,subscriber:e});for(;;){var a=n.next();if(a.done){e.complete();break}if(e.next(a.value),e.closed){"function"==typeof n.return&&n.return();break}}},t}(ur.Observable),ra=na,aa=function(){function e(e,t,n){void 0===t&&(t=0),void 0===n&&(n=e.length),this.str=e,this.idx=t,this.len=n}return e.prototype[Ir.iterator]=function(){return this},e.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.str.charAt(this.idx++)}:{done:!0,value:void 0}},e}(),ia=function(){function e(e,t,n){void 0===t&&(t=0),void 0===n&&(n=function(e){var t=+e.length;if(isNaN(t))return 0;if(0===t||(n=t,"number"!=typeof n||!Fn.root.isFinite(n)))return t;var n;if((t=function(e){var t=+e;if(0===t)return t;if(isNaN(t))return t;return t<0?-1:1}(t)*Math.floor(Math.abs(t)))<=0)return 0;if(t>la)return la;return t}(e)),this.arr=e,this.idx=t,this.len=n}return e.prototype[Ir.iterator]=function(){return this},e.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.arr[this.idx++]}:{done:!0,value:void 0}},e}();function oa(e){var t=e[Ir.iterator];if(!t&&"string"==typeof e)return new aa(e);if(!t&&void 0!==e.length)return new ia(e);if(!t)throw new TypeError("object is not iterable");return e[Ir.iterator]()}var la=Math.pow(2,53)-1;var sa={IteratorObservable:ra},ca=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},ua={ArrayLikeObservable:function(e){function t(t,n){e.call(this),this.arrayLike=t,this.scheduler=n,n||1!==t.length||(this._isScalar=!0,this.value=t[0])}return ca(t,e),t.create=function(e,n){var r=e.length;return 0===r?new Yr.EmptyObservable:1===r?new qr.ScalarObservable(e[0],n):new t(e,n)},t.dispatch=function(e){var t=e.arrayLike,n=e.index,r=e.length,a=e.subscriber;a.closed||(n>=r?a.complete():(a.next(t[n]),e.index=n+1,this.schedule(e)))},t.prototype._subscribe=function(e){var n=this.arrayLike,r=this.scheduler,a=n.length;if(r)return r.schedule(t.dispatch,0,{arrayLike:n,index:0,length:a,subscriber:e});for(var i=0;i<a&&!e.closed;i++)e.next(n[i]);e.complete()},t}(ur.Observable)},pa={Notification:function(){function e(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue="N"===e}return e.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},e.prototype.do=function(e,t,n){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return n&&n()}},e.prototype.accept=function(e,t,n){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,n)},e.prototype.toObservable=function(){switch(this.kind){case"N":return ur.Observable.of(this.value);case"E":return ur.Observable.throw(this.error);case"C":return ur.Observable.empty()}throw new Error("unexpected notification kind value")},e.createNext=function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}()},da=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};var ma=function(e,t){return void 0===t&&(t=0),function(n){return n.lift(new fa(e,t))}},fa=function(){function e(e,t){void 0===t&&(t=0),this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return t.subscribe(new ba(e,this.scheduler,this.delay))},e}(),ha=fa,ba=function(e){function t(t,n,r){void 0===r&&(r=0),e.call(this,t),this.scheduler=n,this.delay=r}return da(t,e),t.dispatch=function(e){var t=e.notification,n=e.destination;t.observe(n),this.unsubscribe()},t.prototype.scheduleMessage=function(e){this.add(this.scheduler.schedule(t.dispatch,this.delay,new ga(e,this.destination)))},t.prototype._next=function(e){this.scheduleMessage(pa.Notification.createNext(e))},t.prototype._error=function(e){this.scheduleMessage(pa.Notification.createError(e))},t.prototype._complete=function(){this.scheduleMessage(pa.Notification.createComplete())},t}(nr.Subscriber),ga=function(e,t){this.notification=e,this.destination=t},va={observeOn:ma,ObserveOnOperator:ha,ObserveOnSubscriber:ba,ObserveOnMessage:ga},ya=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},Ea={FromObservable:function(e){function t(t,n){e.call(this,null),this.ish=t,this.scheduler=n}return ya(t,e),t.create=function(e,n){if(null!=e){if("function"==typeof e[ar.observable])return e instanceof ur.Observable&&!n?e:new t(e,n);if($n.isArray(e))return new Wr.ArrayObservable(e,n);if(Ar.isPromise(e))return new ea.PromiseObservable(e,n);if("function"==typeof e[Ir.iterator]||"string"==typeof e)return new sa.IteratorObservable(e,n);if(jr(e))return new ua.ArrayLikeObservable(e,n)}throw new TypeError((null!==e&&typeof e||e)+" is not observable")},t.prototype._subscribe=function(e){var t=this.ish,n=this.scheduler;return null==n?t[ar.observable]().subscribe(e):t[ar.observable]().subscribe(new va.ObserveOnSubscriber(e,n,0))},t}(ur.Observable)}.FromObservable.create,wa={from:Ea},xa=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};var Na=function(e,t){return function(n){return n.lift(new Sa(e,t))}},Sa=function(){function e(e,t){this.predicate=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new Ca(e,this.predicate,this.thisArg))},e}(),Ca=function(e){function t(t,n,r){e.call(this,t),this.predicate=n,this.thisArg=r,this.count=0}return xa(t,e),t.prototype._next=function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}t&&this.destination.next(e)},t}(nr.Subscriber),Oa={filter:Na};var _a=function(e,t){return Oa.filter(e,t)(this)},ka={filter:_a},Ta=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var ja=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.source=e,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,cr),Ta(t,null,[{key:"of",value:function(){return new this(Hr.apply(void 0,arguments))}},{key:"from",value:function(e,t){return new this(Ea(e,t))}}]),Ta(t,[{key:"lift",value:function(e){var n=new t(this);return n.operator=e,n}},{key:"ofType",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return _a.call(this,(function(e){var n=e.type,r=t.length;if(1===r)return n===t[0];for(var a=0;a<r;a++)if(t[a]===n)return!0;return!1}))}}]),t}(),Aa="@@redux-observable/EPIC_END",Ia=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ma={adapter:{input:function(e){return e},output:function(e){return e}}};var Pa=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};var Da=function(e,t,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),function(r){return"number"==typeof t&&(n=t,t=null),r.lift(new Ra(e,t,n))}},Ra=function(){function e(e,t,n){void 0===n&&(n=Number.POSITIVE_INFINITY),this.project=e,this.resultSelector=t,this.concurrent=n}return e.prototype.call=function(e,t){return t.subscribe(new La(e,this.project,this.resultSelector,this.concurrent))},e}(),Fa=Ra,La=function(e){function t(t,n,r,a){void 0===a&&(a=Number.POSITIVE_INFINITY),e.call(this,t),this.project=n,this.resultSelector=r,this.concurrent=a,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return Pa(t,e),t.prototype._next=function(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)},t.prototype._tryNext=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(e){return void this.destination.error(e)}this.active++,this._innerSub(t,e,n)},t.prototype._innerSub=function(e,t,n){this.add(Dr.subscribeToResult(this,e,t,n))},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete()},t.prototype.notifyNext=function(e,t,n,r,a){this.resultSelector?this._notifyResultSelector(e,t,n,r):this.destination.next(t)},t.prototype._notifyResultSelector=function(e,t,n,r){var a;try{a=this.resultSelector(e,t,n,r)}catch(e){return void this.destination.error(e)}this.destination.next(a)},t.prototype.notifyComplete=function(e){var t=this.buffer;this.remove(e),this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(Tr.OuterSubscriber),$a={mergeMap:Da,MergeMapOperator:Fa,MergeMapSubscriber:La};var za={identity:function(e){return e}};var Va={mergeAll:function(e){return void 0===e&&(e=Number.POSITIVE_INFINITY),$a.mergeMap(za.identity,null,e)}};function Ga(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];var n=Number.POSITIVE_INFINITY,r=null,a=e[e.length-1];return Kr.isScheduler(a)?(r=e.pop(),e.length>1&&"number"==typeof e[e.length-1]&&(n=e.pop())):"number"==typeof a&&(n=e.pop()),null===r&&1===e.length&&e[0]instanceof ur.Observable?e[0]:Va.mergeAll(n)(new Wr.ArrayObservable(e,r))}var qa={merge:function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return function(t){return t.lift.call(Ga.apply(void 0,[t].concat(e)))}},mergeStatic:Ga};var Ua={mergeStatic:qa.mergeStatic,merge:function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return qa.merge.apply(void 0,e)(this)}}.mergeStatic;function Ya(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var Ka={concatAll:function(){return Va.mergeAll(1)}};var Ba={concat:function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return 1===e.length||2===e.length&&Kr.isScheduler(e[1])?wa.from(e[0]):Ka.concatAll()(Jr.of.apply(void 0,e))}};ur.Observable.concat=Ba.concat;var Wa=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},Ha=function(e){function t(t,n){e.call(this),this.sources=t,this.resultSelector=n}return Wa(t,e),t.create=function(){for(var e=[],n=0;n<arguments.length;n++)e[n-0]=arguments[n];if(null===e||0===arguments.length)return new Yr.EmptyObservable;var r=null;return"function"==typeof e[e.length-1]&&(r=e.pop()),1===e.length&&$n.isArray(e[0])&&(e=e[0]),0===e.length?new Yr.EmptyObservable:new t(e,r)},t.prototype._subscribe=function(e){return new Ja(e,this.sources,this.resultSelector)},t}(ur.Observable),Ja=function(e){function t(t,n,r){e.call(this,t),this.sources=n,this.resultSelector=r,this.completed=0,this.haveValues=0;var a=n.length;this.total=a,this.values=new Array(a);for(var i=0;i<a;i++){var o=n[i],l=Dr.subscribeToResult(this,o,null,i);l&&(l.outerIndex=i,this.add(l))}}return Wa(t,e),t.prototype.notifyNext=function(e,t,n,r,a){this.values[n]=t,a._hasValue||(a._hasValue=!0,this.haveValues++)},t.prototype.notifyComplete=function(e){var t=this.destination,n=this,r=n.haveValues,a=n.resultSelector,i=n.values,o=i.length;if(e._hasValue){if(this.completed++,this.completed===o){if(r===o){var l=a?a.apply(this,i):i;t.next(l)}t.complete()}}else t.complete()},t}(Tr.OuterSubscriber),Za={forkJoin:{ForkJoinObservable:Ha}.ForkJoinObservable.create};ur.Observable.forkJoin=Za.forkJoin;var Qa={fromPromise:ea.PromiseObservable.create};ur.Observable.fromPromise=Qa.fromPromise;var Xa=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};var ei=function(e){return function(t){var n=new ti(e),r=t.lift(n);return n.caught=r}},ti=function(){function e(e){this.selector=e}return e.prototype.call=function(e,t){return t.subscribe(new ni(e,this.selector,this.caught))},e}(),ni=function(e){function t(t,n,r){e.call(this,t),this.selector=n,this.caught=r}return Xa(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=void 0;try{n=this.selector(t,this.caught)}catch(t){return void e.prototype.error.call(this,t)}this._unsubscribeAndRecycle(),this.add(Dr.subscribeToResult(this,n))}},t}(Tr.OuterSubscriber),ri={catchError:ei};var ai={_catch:function(e){return ri.catchError(e)(this)}};ur.Observable.prototype.catch=ai._catch,ur.Observable.prototype._catch=ai._catch;var ii={concatMap:function(e,t){return $a.mergeMap(e,t,1)}};var oi={concatMap:function(e,t){return ii.concatMap(e,t)(this)}};ur.Observable.prototype.concatMap=oi.concatMap;var li=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},si={Action:function(e){function t(t,n){e.call(this)}return li(t,e),t.prototype.schedule=function(e,t){return this},t}(Hn.Subscription)},ci=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},ui={AsyncAction:function(e){function t(t,n){e.call(this,t,n),this.scheduler=t,this.work=n,this.pending=!1}return ci(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e,this.pending=!0;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),Fn.root.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return t;Fn.root.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n=!1,r=void 0;try{this.work(e)}catch(e){n=!0,r=!!e&&e||new Error(e)}if(n)return this.unsubscribe(),r},t.prototype._unsubscribe=function(){var e=this.id,t=this.scheduler,n=t.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null},t}(si.Action)},pi={Scheduler:function(){function e(t,n){void 0===n&&(n=e.now),this.SchedulerAction=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(n,t)},e.now=Date.now?Date.now:function(){return+new Date},e}()},di=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},mi={async:new({AsyncScheduler:function(e){function t(){e.apply(this,arguments),this.actions=[],this.active=!1,this.scheduled=void 0}return di(t,e),t.prototype.flush=function(e){var t=this.actions;if(this.active)t.push(e);else{var n;this.active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(pi.Scheduler)}.AsyncScheduler)(ui.AsyncAction)},fi=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};var hi=function(e,t){return void 0===t&&(t=mi.async),function(n){return n.lift(new bi(e,t))}},bi=function(){function e(e,t){this.dueTime=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new gi(e,this.dueTime,this.scheduler))},e}(),gi=function(e){function t(t,n,r){e.call(this,t),this.dueTime=n,this.scheduler=r,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}return fi(t,e),t.prototype._next=function(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(vi,this.dueTime,this))},t.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},t.prototype.debouncedNext=function(){this.clearDebounce(),this.hasValue&&(this.destination.next(this.lastValue),this.lastValue=null,this.hasValue=!1)},t.prototype.clearDebounce=function(){var e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)},t}(nr.Subscriber);function vi(e){e.debouncedNext()}var yi={debounceTime:hi};var Ei={debounceTime:function(e,t){return void 0===t&&(t=mi.async),yi.debounceTime(e,t)(this)}};ur.Observable.prototype.debounceTime=Ei.debounceTime,ur.Observable.prototype.filter=ka.filter,ur.Observable.prototype.map=_r.map;var wi=a&&a.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};var xi=function(e){return function(t){return t.lift(new Ni(e))}},Ni=function(){function e(e){this.value=e}return e.prototype.call=function(e,t){return t.subscribe(new Si(e,this.value))},e}(),Si=function(e){function t(t,n){e.call(this,t),this.value=n}return wi(t,e),t.prototype._next=function(e){this.destination.next(this.value)},t}(nr.Subscriber),Ci={mapTo:xi};var Oi={mapTo:function(e){return Ci.mapTo(e)(this)}};ur.Observable.prototype.mapTo=Oi.mapTo;const _i=(...e)=>t=>e.includes(t.type),ki=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return Ua.apply(void 0,Ya(t.map((function(e){var t=e.apply(void 0,n);if(!t)throw new TypeError('combineEpics: one of the provided Epics "'+(e.name||"<anonymous>")+"\" does not return a stream. Double check you're not missing a return statement!");return t}))))}}((e=>e.filter(_i(J,H)).concatMap((e=>cr.fromPromise(u(e.payload.id)).map((e=>p({config:e}))).catch((e=>cr.of(d({error:e}))))))),(e=>e.filter(_i(m)).map((e=>l({config:e.payload.config})))),((e,t)=>e.filter(_i(f)).concatMap((()=>{const e=h(t.getState());let n;return e.isNew?(delete e.isNew,n=b(e)):n=g(e),cr.fromPromise(n).concatMap((({canaryConfigId:e})=>cr.forkJoin(Vt.$state.go("^.configDetail",{id:e,copy:!1,new:!1}),t.getState().data.application.getDataSource("canaryConfigs").refresh(!0)).mapTo(v({id:e})))).catch((e=>cr.of(y({error:e}))))}))),((e,t)=>e.filter(_i(E)).concatMap((()=>cr.fromPromise(w(t.getState().selectedConfig.config.id)).mapTo(x()).catch((e=>cr.of(N({error:e}))))))),((e,t)=>e.filter(_i(S)).concatMap((()=>cr.forkJoin(Vt.$state.go("^.configDefault"),t.getState().data.application.getDataSource("canaryConfigs").refresh(!0)))).mapTo(C())),(e=>e.filter(_i(O)).concatMap((e=>cr.fromPromise(_(e.payload.configId,e.payload.runId)).map((e=>k({run:e}))).catch((e=>cr.of(T({error:e}))))))),((e,t)=>e.filter(_i(j)).concatMap((e=>{const n=A(t.getState());return cr.fromPromise(I(n.metricSetPairListId,e.payload.pairId)).map((e=>M({metricSetPair:e}))).catch((e=>cr.of(P({error:e}))))}))),((e,t)=>e.filter(_i($)).filter((e=>e.payload.filter&&e.payload.filter.length>2)).debounceTime(200).map((e=>{const[n]=t.getState().data.kayentaAccounts.data.filter((e=>e.supportedTypes.includes(L.MetricsStore)&&"graphite"===e.type)).map((e=>e.name));return R({filter:e.payload.filter,metricsAccountName:n})}))),(e=>e.filter(_i(D)).filter((e=>e.payload.filter&&e.payload.filter.length>2)).debounceTime(200).map((e=>R({filter:e.payload.filter,metricsAccountName:e.payload.metricsAccountName})))),((e,t)=>e.filter(_i(F)).filter((e=>e.payload.filter&&e.payload.filter.length>2)).debounceTime(200).map((e=>{const[n]=t.getState().data.kayentaAccounts.data.filter((e=>e.supportedTypes.includes(L.MetricsStore)&&"stackdriver"===e.metricsStoreType)).map((e=>e.name));return R({filter:e.payload.filter,metricsAccountName:n})}))),((e,t)=>e.filter(_i(z)).filter((e=>e.payload.filter&&e.payload.filter.length>2)).debounceTime(200).map((e=>{const[n]=t.getState().data.kayentaAccounts.data.filter((e=>e.supportedTypes.includes(L.MetricsStore)&&"datadog"===e.type)).map((e=>e.name));return R({filter:e.payload.filter,metricsAccountName:n})}))),(e=>e.filter(_i(V)).concatMap((e=>cr.fromPromise(((e,t)=>zt("/v2/canaries/metadata/metricsService").query({filter:e,metricsAccountName:t}).get())(e.payload.filter,e.payload.metricsAccountName)).map((e=>G({data:e}))).catch((e=>cr.of(q({error:e}))))))),(e=>e.filter(_i(Y,U)).concatMap((()=>cr.fromPromise(K()).map((e=>B({accounts:e}))).catch((e=>cr.of(W({error:e})))))))),Ti=[function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ma;if("function"!=typeof e)throw new TypeError("You must provide a root Epic to createEpicMiddleware");t=Ia({},Ma,t);var n=new vr,r=t.adapter.input(new ja(n)),a=new vr,i=void 0,o=function(o){return i=o,function(o){var l;return(l=Or.call(a,(function(e){var n="dependencies"in t?e(r,i,t.dependencies):e(r,i);if(!n)throw new TypeError('Your root Epic "'+(e.name||"<anonymous>")+"\" does not return a stream. Double check you're not missing a return statement!");return n})),Vr).call(l,(function(e){return t.adapter.output(e)})).subscribe(i.dispatch),a.next(e),function(e){var t=o(e);return n.next(e),t}}};return o.replaceEpic=function(e){i.dispatch({type:Aa}),a.next(e)},o}(ki),e=>t=>n=>{switch(n.type){case s:{const n=c(e.getState()),r=l({config:n});return t(r)}case i:{const n=o(e.getState()),r=l({config:n});return t(r)}default:return t(n)}},e=>t=>n=>{let r=!1,a=[];const i=()=>{a.forEach((t=>e.dispatch(t))),a=[]},o=t(Object.assign(Object.assign({},n),{asyncDispatch:e=>{a.push(e),r&&i()}}));return r=!0,i(),o}],ji=Z(X,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n,r,a){var i,o=e(n,r,a),l=o.dispatch,s={getState:o.getState,dispatch:function(e){return l(e)}};return i=t.map((function(e){return e(s)})),l=kn.apply(void 0,i)(o.dispatch),Tn({},o,{dispatch:l})}}}(...Q.reduxLogger?[...Ti,In.logger]:Ti));class Ai extends Ft.Component{constructor(e){super(e),this.store=ji,this.initializeAppState(e.app)}componentWillReceiveProps(e){this.props.app.name!==e.app.name&&this.initializeAppState(e.app)}initializeAppState(e){this.store.dispatch({type:U,state:{data:{application:e,configSummaries:e.getDataSource("canaryConfigs").data,judges:e.getDataSource("canaryJudges").data}}})}render(){return Ft.createElement(ee,{className:"kayenta-root vertical"},Ft.createElement(te,{store:this.store},Ft.createElement("div",{className:"vertical flex-1"},Ft.createElement(an,Object.assign({},{wrap:!1},{name:"canary"})))))}}class Ii{onRequesting(e){return this.requesting=e,this}onFulfilled(e){return this.fulfilled=e,this}onFailed(e){return this.failed=e,this}build(){return({state:e})=>{switch(e){case se.Requesting:return this.requesting||Ft.createElement("div",{className:"horizontal center middle spinner-container"},Ft.createElement($t,null));case se.Fulfilled:return this.fulfilled;case se.Failed:return this.failed}}}}function Mi({dateIso:e}){return e?Ft.createElement("span",null,Gt(new Date(e).getTime())):Ft.createElement("span",null,"N/A")}var Pi=ce((function(e){return{disabled:cn(e.selectedConfig,"config.isNew")||e.app.disableConfigEdit||Q.disableConfigEdit}}))((function({disabled:e}){return Ft.createElement(on,{to:"^.configDetail",params:{copy:!0}},Ft.createElement("button",{className:"passive",disabled:e},Ft.createElement("i",{className:"fa fa-copy"}),Ft.createElement("span",null,"Copy")))}));var Di=ce(null,(function(e){return{openConfigJsonModal:()=>e(pe())}}))((function({openConfigJsonModal:e}){return Ft.createElement("div",null,Ft.createElement("button",{className:"passive",onClick:e},Ft.createElement("i",{className:"far fa-file-code"}),Ft.createElement("span",null,"JSON")),Ft.createElement(ue,null))}));var Ri=ce((function(e){return{show:e.app.deleteConfigModalOpen,selectedConfigName:e.selectedConfig.config?e.selectedConfig.config.name:null,deleteConfigState:e.selectedConfig.destroy.state,deleteConfigErrorMessage:e.selectedConfig.destroy.error}}),(function(e){return{closeDeleteConfigModal:()=>e(C()),deleteConfig:()=>e(de())}}))((function({show:t,selectedConfigName:n,deleteConfigState:r,deleteConfigErrorMessage:a,closeDeleteConfigModal:i,deleteConfig:o}){return Ft.createElement(xn,{show:t,onHide:null},Ft.createElement(ee,null,Ft.createElement(xn.Header,null,Ft.createElement(xn.Title,null,"Really delete ",n,"?")),r===se.Failed&&Ft.createElement(xn.Body,null,Ft.createElement("span",{className:e("alert","alert-danger")},function(e){const t="The was an error deleting your config";return e?t+`: ${e}.`:t+"."}(a))),Ft.createElement(xn.Footer,null,Ft.createElement("ul",{className:"list-inline pull-right"},Ft.createElement("li",null,Ft.createElement("button",{className:"passive",onClick:i},"Cancel")),Ft.createElement("li",null,Ft.createElement("button",{className:"primary",onClick:o},"Delete"))))))}));var Fi=ce((function(e){return{disabled:e.selectedConfig.config&&e.selectedConfig.config.isNew||Q.disableConfigEdit}}),(function(e){return{openDeleteConfigModal:()=>e(he())}}))((function({openDeleteConfigModal:e,disabled:t}){return Ft.createElement("div",null,Ft.createElement(me,{className:"passive",disabled:t||Q.disableConfigEdit,onClick:e,disabledStateKeys:[fe]},Ft.createElement("i",{className:"fa fa-trash"}),Ft.createElement("span",null,"Delete")),Ft.createElement(Ri,null))}));function Li(){return Ft.createElement("ul",{className:"list-inline pull-right"},Ft.createElement("li",null,Ft.createElement(Di,null)),Ft.createElement("li",null,Ft.createElement(Pi,null)),Ft.createElement("li",null,Ft.createElement(Fi,null)))}const $i=({owners:e})=>Ft.createElement("div",{className:"horizontal middle well-compact alert alert-warning config-detail-edit-warning"},Ft.createElement("i",{className:"fa fa-exclamation-triangle sp-margin-m-right"}),Ft.createElement("span",null,Ft.createElement("b",null,"Editing is disabled because this config is owned by"," ",e.length>1?`${e.length} other applications`:"another application",".")," ","To edit, view in ",(e=>{if(1===e.length)return Ft.createElement(on,{to:".",params:{application:e[0]}},Ft.createElement("a",null,e[0]));{const t=e.length-1;return e.map(((n,r)=>Ft.createElement(Ft.Fragment,{key:n},r===t?"or ":"",Ft.createElement(on,{to:".",params:{application:n}},Ft.createElement("a",null,n)),r<t&&2===e.length?" ":"",r<t&&e.length>2?", ":"")))}})(e))),zi=()=>Ft.createElement("div",{className:"horizontal middle well-compact alert alert-warning config-detail-edit-warning"},Ft.createElement("i",{className:"fa fa-exclamation-triangle sp-margin-m-right"}),Ft.createElement("span",null,Ft.createElement("b",null,"Canary config is locked and does not allow modification")));var Vi=ce((function(e){return{selectedConfig:h(e),editingDisabled:e.app.disableConfigEdit,disableConfigEdit:Q.disableConfigEdit}}))((function({selectedConfig:e,editingDisabled:t,disableConfigEdit:n}){return Ft.createElement("div",{className:"vertical"},Ft.createElement("div",{className:"horizontal config-detail-header"},Ft.createElement("div",{className:"flex-3"},Ft.createElement("h1",{className:"heading-1 color-text-primary"},e?e.name:"")),Ft.createElement("div",{className:"flex-1"},Ft.createElement("h5",{className:"heading-5"},Ft.createElement("strong",null,"Edited:")," ",Ft.createElement(Mi,{dateIso:e?e.updatedTimestampIso:""}))),Ft.createElement("div",{className:"flex-2"},Ft.createElement(Li,null))),e&&t&&!n&&Ft.createElement($i,{owners:e.applications}),e&&n&&Ft.createElement(zi,null))}));var Gi=ce((function(e){var t,n,r,a,i,o;return{metricId:e.selectedConfig.editingMetric.id,direction:null!==(r=null===(n=null===(t=e.selectedConfig.editingMetric.analysisConfigurations)||void 0===t?void 0:t.canary)||void 0===n?void 0:n.direction)&&void 0!==r?r:"either",disabled:e.app.disableConfigEdit||Q.disableConfigEdit,effectSizes:null!==(o=null===(i=null===(a=e.selectedConfig.editingMetric.analysisConfigurations)||void 0===a?void 0:a.canary)||void 0===i?void 0:i.effectSize)&&void 0!==o?o:{}}}),(function(e){return{updateEffectSize:(t,n)=>e(ye({id:t,value:n}))}}))((function({effectSizes:e={},updateEffectSize:t,direction:n,metricId:r,disabled:a}){const[i,o]=Ft.useState(!!Object.keys(e).length),[l]=Ft.useState("cles"===e.measure),s=Ft.createElement("p",null,'Effect sizes should be used when your canary data produces a lot of metrics that flag as "high", but where you only want the test to fail if they are sufficiently larger or smaller than the control data.');if(!i&&a)return null;if(!i)return Ft.createElement(be,{label:"Effect Sizes"},s,Ft.createElement("button",{className:"passive",onClick:()=>o(!0)},"Configure effect sizes"));const c="cles"===e.measure,u=c?.5:1,{allowedIncrease:p=u,criticalIncrease:d=u,allowedDecrease:m=u,criticalDecrease:f=u,measure:h="meanRatio"}=e,b=n=>{t(r,Object.assign(Object.assign({},e),{measure:n.target.value}))},g=(e,t)=>{const n=Number(t)/100;return e.endsWith("Increase")?1+n:1-n},v=(e,t)=>{const n=t.endsWith("Increase")?e-1:1-e;return Math.round(100*n)},y=Ft.createElement(Ft.Fragment,null,"CLES ",Ft.createElement(qt,{id:"canary.config.effectSize.cles"})),E=(n,a)=>Ft.createElement("div",{className:"form-group flex-1"},Ft.createElement("label",null,Ut(n)),Ft.createElement("div",{className:"row"},Ft.createElement("div",{className:"col-md-4"},Ft.createElement("div",{className:"input-group effect-size-wrapper"},Ft.createElement(ve,{className:"form-control input-sm",type:"number",min:0,step:c?.01:1,onChange:a=>((n,a)=>{const i=c?Number(a):g(n,a),o=Object.assign(Object.assign({},e),{[n]:i});i===u&&delete o[n],t(r,o)})(n,a.target.value),value:c?a:v(a,n),disabled:Q.disableConfigEdit,disabledStateKeys:[fe]}),!c&&Ft.createElement("div",{className:"input-group-addon"},"%")))),a===u?Ft.createElement(qt,{expand:!0,content:"(will not affect metric evaluation)"}):null);return Ft.createElement(be,{label:"Effect Sizes"},s,Ft.createElement("div",{className:"vertical",style:{marginTop:"5px"}},l&&Ft.createElement("div",{className:"form-group vertical"},Ft.createElement("label",null,"Measurement Type"),Ft.createElement("div",null,Ft.createElement(ge,{value:"meanRatio",label:"Mean (default)",name:"measure",current:h,action:b}),Ft.createElement(ge,{value:"cles",label:y,name:"measure",current:h,action:b}))),Ft.createElement("label",{className:"sp-margin-m-top"},"Allowed Effects"),Ft.createElement("p",null,"If the canary surpasses the baseline by the supplied (non-zero) percentage, the ",Ft.createElement("em",null,"metric")," will fail."),Ft.createElement("div",{className:"horizontal"},"increase"!==n&&E("allowedDecrease",m),"decrease"!==n&&E("allowedIncrease",p)),Ft.createElement("label",{className:"sp-margin-m-top"},"Critical Effects"),Ft.createElement("p",null,"If the canary surpasses the baseline by the supplied (non-zero) percentage, the ",Ft.createElement("em",null,"entire analysis")," will fail with a score of 0."),Ft.createElement("div",{className:"horizontal"},"increase"!==n&&E("criticalDecrease",f),"decrease"!==n&&E("criticalIncrease",d))))}));Ee(".template-editor-textarea {\n min-width: 100%;\n max-width: 100%;\n}\n.template-editor-value-formatted {\n margin: 0;\n}\n.filter-template-option {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n");class qi extends Ft.Component{constructor(){super(...arguments),this.getOptions=()=>{const e=Object.keys(this.props.templates).map((e=>({value:e,label:e,requestingNew:!1})));return e.push({value:null,label:null,requestingNew:!0}),e},this.optionRenderer=e=>e.requestingNew?Ft.createElement("span",null,"Create new..."):Ft.createElement("span",{className:"filter-template-option"},Ft.createElement("span",null,e.label),Ft.createElement("span",null,Ft.createElement("button",{className:"link",onMouseDown:t=>this.props.deleteTemplate(t,e.value)},"Delete"),Ft.createElement("button",{className:"link",onMouseDown:t=>this.props.editTemplateBegin(t,e.value,this.props.templates[e.value])},"Edit")))}render(){const{editedTemplateName:e,editedTemplateValue:t,editTemplateCancel:n,editTemplateConfirm:r,editTemplateName:a,editTemplateValue:i,selectTemplate:o,selectedTemplateName:l,templates:s,validation:c}=this.props,u=un(e)&&un(t);return Ft.createElement(Ft.Fragment,null,Ft.createElement(be,{label:"Filter Template",helpId:"canary.config.filterTemplate",inputOnly:!0},!u&&Ft.createElement(we,{value:l,disabledStateKeys:[fe],disabled:Q.disableConfigEdit,onChange:o,options:this.getOptions(),optionRenderer:this.optionRenderer})),u&&Ft.createElement(Ft.Fragment,null,Ft.createElement(be,{label:"Name",error:cn(c,"errors.templateName.message"),inputOnly:!0},Ft.createElement(ve,{disabledStateKeys:[fe],disabled:Q.disableConfigEdit,onChange:a,value:e})),Ft.createElement(be,{label:"Template",inputOnly:!0,error:cn(c,"errors.templateValue.message"),warning:cn(c,"warnings.template.message")},Ft.createElement(xe,{className:"template-editor-textarea",disabledStateKeys:[fe],disabled:Q.disableConfigEdit,onChange:i,value:t})),Ft.createElement(be,null,Ft.createElement("div",{className:"horizontal pull-right"},Ft.createElement("button",{className:"link",onClick:n},"Cancel"),Ft.createElement("button",{className:"link",disabled:[c.errors.templateName,c.errors.templateValue].some((e=>null!=e)),onClick:r},"Save")))),!u&&l&&Ft.createElement(be,null,Ft.createElement("pre",{className:"template-editor-value-formatted"},s[l])))}}var Ui=ce((e=>({editedTemplateName:cn(Ne(e),"editedName"),editedTemplateValue:cn(Ne(e),"editedValue"),selectedTemplateName:Se(e),templates:Ce(e),validation:Oe(e)})),(e=>({deleteTemplate:(t,n)=>{t.stopPropagation(),e(_e({name:null})),e(ke({name:n}))},editTemplateBegin:(t,n,r)=>{t.stopPropagation(),e(_e({name:n})),e(Te({name:n,value:r}))},editTemplateCancel:()=>e(je()),editTemplateConfirm:()=>e(Ae()),editTemplateName:t=>e(Ie({name:t.target.value})),editTemplateValue:t=>e(Me({value:t.target.value})),selectTemplate:t=>{t&&!0===t.requestingNew?(e(_e({name:null})),e(Pe())):e(_e({name:t?t.value:null}))}})))(qi);var Yi=ce((function(e){return{templateValue:De(e),transformValueForSave:Re(e)}}),(function(e){return{editTemplateValue:t=>e(Fe({value:t}))}}))((function({editTemplateValue:e,templateValue:t,transformValueForSave:n}){return Ft.createElement(be,{label:"Template",inputOnly:!0,helpId:"canary.config.filterTemplate",error:pn(t)&&"Template is required"},Ft.createElement(xe,{className:"template-editor-textarea",disabledStateKeys:[fe],disabled:Q.disableConfigEdit,onChange:t=>e(n(t.target.value)),value:t}))}));var Ki=ce((function(e){return{editingMetric:e.selectedConfig.editingMetric}}))((function({editingMetric:e}){const t=Le.getDelegate(e.query.type);if(t&&t.metricConfigurer){const e=t.metricConfigurer;return Ft.createElement(e,null)}return Ft.createElement("p",null,"Metric configuration has not been implemented for ",e.query.type,".")}));Ee(".kayenta-edit-metric-modal .modal-content {\n overflow: visible;\n}\n.kayenta-edit-metric-modal .effect-size-wrapper {\n width: 100px;\n}\n");var Bi=ce((function(e){return{metric:e.selectedConfig.editingMetric,groups:e.selectedConfig.group.list.sort(),isTemplateValid:Be(e),useInlineTemplateEditor:We(e),disableEdit:e.app.disableConfigEdit||Q.disableConfigEdit,validationErrors:He(e)}}),(function(e){return{rename:t=>{e(ze({id:t.target.dataset.id,name:t.target.value}))},changeGroup:t=>{e(Ve({id:t.target.dataset.id,group:t.target.value}))},cancel:()=>{e(Ge()),e(je())},confirm:()=>{e(qe()),e(je())},updateDirection:({target:t})=>{e(Ue({id:t.dataset.id,direction:t.value}))},updateNanStrategy:({target:t})=>{e(Ye({id:t.dataset.id,strategy:t.value}))},updateCriticality:({target:t})=>{e(Ke({id:t.dataset.id,critical:Boolean(t.checked)}))}}}))((function({metric:t,rename:n,changeGroup:r,groups:a,confirm:i,cancel:o,isTemplateValid:l,updateDirection:s,updateNanStrategy:c,updateCriticality:u,useInlineTemplateEditor:p,disableEdit:d,validationErrors:m}){var f,h,b,g,v,y,E,w,x,N,S;if(!t)return null;const C=null!==(b=null===(h=null===(f=t.analysisConfigurations)||void 0===f?void 0:f.canary)||void 0===h?void 0:h.direction)&&void 0!==b?b:"either",O=null!==(y=null===(v=null===(g=t.analysisConfigurations)||void 0===g?void 0:g.canary)||void 0===v?void 0:v.nanStrategy)&&void 0!==y?y:"default",_=null!==(x=null===(w=null===(E=t.analysisConfigurations)||void 0===E?void 0:E.canary)||void 0===w?void 0:w.critical)&&void 0!==x&&x,k=!l||d||Q.disableConfigEdit||dn(m).some((e=>!mn(e))),T=t.groups.length?t.groups[0]:a[0],j=Le.getDelegate(t.query.type)&&Le.getDelegate(t.query.type).useTemplates&&Q.templatesEnabled;return Ft.createElement(xn,{bsSize:"large",show:!0,onHide:Yt,className:e("kayenta-edit-metric-modal")},Ft.createElement(ee,null,Ft.createElement(xn.Header,null,Ft.createElement(xn.Title,null,d||Q.disableConfigEdit?"Metric Details":"Configure Metric")),Ft.createElement(xn.Body,null,Ft.createElement(be,{label:"Group",inputOnly:!0},t.groups.length>1&&Ft.createElement(ve,{type:"text",value:t.groups,"data-id":t.id,onChange:r,disabled:Q.disableConfigEdit,disabledStateKeys:[fe]}),t.groups.length<2&&Ft.createElement($e,{value:T,onChange:r,className:"form-control input-sm",disabled:Q.disableConfigEdit,disabledStateKeys:[fe]},a.map((e=>Ft.createElement("option",{key:e,value:e},e))))),Ft.createElement(be,{label:"Name",error:null!==(S=null===(N=null==m?void 0:m.name)||void 0===N?void 0:N.message)&&void 0!==S?S:null,inputOnly:!0},Ft.createElement(ve,{type:"text",value:t.name,"data-id":t.id,onChange:n,disabled:Q.disableConfigEdit,disabledStateKeys:[fe]})),Ft.createElement(be,{label:"Fail on"},Ft.createElement(ge,{value:"increase",label:"Increase",name:"direction",current:C,action:s}),Ft.createElement(ge,{value:"decrease",label:"Decrease",name:"direction",current:C,action:s}),Ft.createElement(ge,{value:"either",label:"Either",name:"direction",current:C,action:s})),Ft.createElement(be,{label:"Criticality",checkbox:!0},Ft.createElement("label",null,Ft.createElement(ve,{type:"checkbox",checked:_,onChange:u,disabled:Q.disableConfigEdit,disabledStateKeys:[fe]}),"Fail the canary if this metric fails")),Ft.createElement(be,{label:"NaN Strategy",helpId:"canary.config.nanStrategy"},Ft.createElement(ge,{value:"default",label:"Default (remove)",name:"nanStrategy",current:O,action:c}),Ft.createElement(ge,{value:"replace",label:"Replace with zero",name:"nanStrategy",current:O,action:c}),Ft.createElement(ge,{value:"remove",label:"Remove",name:"nanStrategy",current:O,action:c})),Ft.createElement(Gi,null),Ft.createElement(Ki,null),j&&!p&&Ft.createElement(Ui,null),j&&p&&Ft.createElement(Yi,null)),Ft.createElement(xn.Footer,null,Ft.createElement("ul",{className:"list-inline pull-right"},Ft.createElement("li",null,Ft.createElement("button",{className:"passive",onClick:o},"Cancel")),Ft.createElement("li",null,Ft.createElement("button",{className:"primary",disabled:k,onClick:i},"OK"))))))}));function Wi({title:e,children:t}){return Ft.createElement("section",{className:"pod open titled-section"},Ft.createElement("div",{className:"header horizontal middle"},Ft.createElement("div",{className:"flex-1 heading-2 uppercase"},e)),Ft.createElement("div",{className:"contents vertical"},t))}Ee(".kayenta .titled-section {\n margin-bottom: 1em;\n}\n.kayenta .titled-section .contents {\n margin: 10px 10px 0 10px;\n background-color: var(--color-white);\n border: 1px solid var(--color-cirrus);\n padding: 15px;\n}\n.kayenta .titled-section .contents .list-group {\n margin-bottom: 5px;\n}\n");var Hi=ce((function(e,{metric:t}){return{groups:e.selectedConfig.group.list.filter((e=>t.groups.length>1||!t.groups.includes(e))),toGroup:e.selectedConfig.changeMetricGroup.toGroup}}),(function(e,{metric:t}){return{select:t=>{e(Je({group:t.target.value||null}))},clear:()=>{e(Ze({metricId:null}))},confirm:()=>{e(Ze({metricId:t.id}))}}}))((function({groups:e,toGroup:t,confirm:n,clear:r,select:a}){return Ft.createElement(xn,{show:!0,onHide:Yt},Ft.createElement(ee,null,Ft.createElement(xn.Header,null,Ft.createElement(xn.Title,null,"Change Metric Group")),Ft.createElement(xn.Body,null,Ft.createElement($e,{value:t||"",onChange:a,className:"form-control input-sm",disabled:Q.disableConfigEdit,disabledStateKeys:[fe]},Ft.createElement("option",{value:""},"-- select group --"),e.map((e=>Ft.createElement("option",{key:e,value:e},e))))),Ft.createElement(xn.Footer,null,Ft.createElement("ul",{className:"list-inline pull-right"},Ft.createElement("li",null,Ft.createElement("button",{className:"passive",onClick:r},"Cancel")),Ft.createElement("li",null,Ft.createElement("button",{className:"primary",disabled:!t,onClick:n},"OK"))))))}));function Ji({metric:t}){var n,r,a,i;const o=null===(r=null===(n=t.analysisConfigurations)||void 0===n?void 0:n.canary)||void 0===r?void 0:r.direction,l=null===(i=null===(a=t.analysisConfigurations)||void 0===a?void 0:a.canary)||void 0===i?void 0:i.critical,s=l?"(critical — if this metric fails, the entire canary will fail)":"",c=e("metric-fail-on-icon","fas","sp-margin-xs-right",{critical:l});return"decrease"===o?Ft.createElement(Kt,{value:`decrease ${s}`},Ft.createElement("i",{className:`fa-caret-square-down ${c}`})):"increase"===o?Ft.createElement(Kt,{value:`increase ${s}`},Ft.createElement("i",{className:`fa-caret-square-up ${c}`})):Ft.createElement(Kt,{value:`increase OR decrease ${s}`},Ft.createElement("span",null,Ft.createElement("i",{className:`fa-caret-square-down ${c}`}),Ft.createElement("i",{className:`fa-caret-square-up ${c}`})))}Ee(".metrics-action-buttons .link {\n padding: 0 12px;\n}\n.metric-filter-options label {\n font-weight: 600;\n margin: 6px;\n padding: 6px 12px;\n border: 1px solid var(--color-divider);\n}\n.metric-fail-on-icon {\n color: var(--color-warning);\n}\n.metric-fail-on-icon.critical {\n color: var(--color-danger);\n}\n");var Zi=ce((function(e){const t=e.selectedConfig.group.selected,n=e.selectedConfig.metricList,r=t?e=>e.groups.includes(t):()=>!0;return{selectedGroup:t,groupList:e.selectedConfig.group.list,metrics:n.filter(r),showGroups:!t||n.filter(r).some((e=>e.groups.length>1)),changingGroupMetric:e.selectedConfig.metricList.find((t=>t.id===e.selectedConfig.changeMetricGroup.metric)),metricStore:e.selectedConfig.selectedStore,disableEdit:e.app.disableConfigEdit||Q.disableConfigEdit}}),(function(e){return{addMetric:t=>{const n=t.target.dataset.group||t.target.dataset.default;e(Xe({metric:{id:"[new]",analysisConfigurations:{},name:"",query:{type:t.target.dataset.metricStore,serviceType:t.target.dataset.metricStore},groups:n?[n]:[],scopeName:"default",isNew:!0}}))},copyMetric:t=>{const n=fn(t);n.id="[new]",n.isNew=!0,n.name="",e(Xe({metric:n}))},editMetric:t=>{e(et({id:t.target.dataset.id}))},removeMetric:t=>{e(tt({id:t.target.dataset.id}))},openChangeMetricGroupModal:t=>e(nt({id:t.target.dataset.id}))}}))((function({metrics:e,groupList:t,selectedGroup:n,showGroups:r,addMetric:a,editMetric:i,copyMetric:o,removeMetric:l,changingGroupMetric:s,openChangeMetricGroupModal:c,metricStore:u,disableEdit:p}){const d=[{label:"Metric Name",getContent:e=>Ft.createElement("span",null,e.name||"(new)")},{label:"Fail On",getContent:e=>Ft.createElement(Ji,{metric:e})},{label:"Groups",getContent:e=>Ft.createElement("span",null,e.groups.join(", ")),hide:()=>!r},{getContent:e=>Ft.createElement("div",{className:"horizontal pull-right metrics-action-buttons"},Ft.createElement("button",{className:"link","data-id":e.id,onClick:i},p||Q.disableConfigEdit?"View":"Edit"),Ft.createElement("button",{className:"link","data-id":e.id,disabled:p||Q.disableConfigEdit,onClick:c},"Move Group"),Ft.createElement("button",{className:"link","data-id":e.id,disabled:p||Q.disableConfigEdit,onClick:()=>o(e)},"Copy"),Ft.createElement("button",{className:"link","data-id":e.id,disabled:p||Q.disableConfigEdit,onClick:l},"Delete"))}];return Ft.createElement(Ft.Fragment,null,Ft.createElement(Qe,{columns:d,rows:e,rowKey:e=>e.id,className:"header-white"}),!e.length&&n?Ft.createElement("p",null,"This group is empty! The group will be not be present the next time the config is loaded unless it is saved with at least one metric in it."):null,s&&Ft.createElement(Hi,{metric:s}),Ft.createElement(me,{className:"passive self-left","data-group":n,"data-default":t[0],"data-metric-store":u,onClick:a,disabled:Q.disableConfigEdit,disabledStateKeys:[fe]},"Add Metric"))}));function Qi({children:e}){return Ft.createElement("ul",{className:"list-group"},Ft.Children.map(e,(e=>e&&Ft.createElement("li",{className:"list-unstyled"},Ft.createElement("form",{role:"form",className:"form-horizontal container-fluid"},Ft.createElement("div",{className:"col-md-12"},e))))))}var Xi=ce((e=>({stores:hn(e.data.kayentaAccounts.data).filter((e=>e.supportedTypes.includes(L.MetricsStore))).map((e=>e.metricsStoreType||e.type)).uniq().sort().valueOf(),selectedStore:e.selectedConfig.selectedStore})),(e=>({select:t=>e(rt({store:t.target.value}))})))((({stores:e,selectedStore:t,select:n})=>e.length<2?null:Ft.createElement(be,{label:"Metric Store",inputOnly:!0},Ft.createElement($e,{value:t||"",onChange:n,className:"form-control input-sm",disabled:Q.disableConfigEdit,disabledStateKeys:[fe]},e.map((e=>Ft.createElement("option",{key:e,value:e},e)))))));var eo=ce((function(e){return e.selectedConfig.config?{name:e.selectedConfig.config.name,description:e.selectedConfig.config.description}:{name:"",description:""}}),(function(e){return{changeName:t=>{e(at({name:t.target.value}))},changeDescription:t=>{e(it({description:t.target.value}))}}}))((function({name:e,description:t,changeName:n,changeDescription:r}){return Ft.createElement(Qi,null,Ft.createElement(be,{label:"Configuration Name",inputOnly:!0},Ft.createElement(ve,{type:"text",value:e,onChange:n,disabled:Q.disableConfigEdit,disabledStateKeys:[fe]})),Ft.createElement(Xi,null),Ft.createElement(be,{label:"Description",inputOnly:!0},Ft.createElement(xe,{className:"form-control input-sm",value:t,onChange:r,disabled:Q.disableConfigEdit,disabledStateKeys:[fe]})))}));function to({title:e,children:t,helpKey:n}){return Ft.createElement("section",{className:"titled-subsection"},Ft.createElement("h5",{className:"heading-5"},e," ",n&&Ft.createElement(qt,{id:n})),Ft.createElement("hr",null),t)}Ee(".kayenta .titled-subsection h5 {\n font-weight: 600;\n}\n.kayenta .titled-subsection hr {\n margin-top: 0;\n}\n");var no=ce((function(e,t){return Object.assign(Object.assign({},t),{config:h(e)})}),(function(e,{group:t}){return{handleInputChange:n=>{e(ot({group:t,weight:n.target.value?parseInt(n.target.value,10):null}))}}}))((function({group:e,config:t,handleInputChange:n}){const r=function(e){return cn(e,"classifier.groupWeights",{})}(t)[e];return Ft.createElement(be,{label:e,inputOnly:!0},Ft.createElement(ve,{type:"number",value:bn(r)?r:"",onChange:n,min:0,max:100,disabled:Q.disableConfigEdit,disabledStateKeys:[fe]}))}));var ro=ce((function(e){const t=h(e),n=t?t.metrics:[];return{groups:gn(vn(n,(e=>e.groups||[])))}}))((function({groups:e}){const t=e.length>0;return Ft.createElement("section",null,t?e.map((e=>Ft.createElement(no,{key:e,group:e}))):Ft.createElement("p",{key:"no-groups"},"You have not configured any grouped metrics."))}));var ao=ce((function(e){return{renderJudgeSelect:e.selectedConfig.judge.renderState!==st.None}}))((function({renderJudgeSelect:e}){return Ft.createElement(Qi,null,e&&Ft.createElement(to,{title:"Judge"},Ft.createElement(lt,null)),Ft.createElement(to,{title:"Metric Group Weights",helpKey:"canary.config.metricGroupWeights"},Ft.createElement(ro,null)))}));function io(){return Ft.createElement("section",{className:"config-detail"},Ft.createElement(Vi,null),Ft.createElement(Wi,{title:"Name and Description"},Ft.createElement(eo,null)),Ft.createElement(Wi,{title:"Metrics"},Ft.createElement(ct,null),Ft.createElement(Zi,null),Ft.createElement(Bi,null)),Ft.createElement(Wi,{title:"Scoring"},Ft.createElement(ao,null)))}function oo({children:e}){return Ft.createElement("div",{className:"row"},Ft.createElement("div",{className:"col-sm-offset-4"},e))}var lo=ce((function(e){return{configLoadState:e.selectedConfig.load.state}}))((function({configLoadState:e}){const t=(new Ii).onFulfilled(Ft.createElement(io,null)).onFailed(Ft.createElement(oo,null,Ft.createElement("h3",{className:"heading-3"},"Could not load canary config."))).build();return Ft.createElement(t,{state:e})}));class so extends Ft.Component{constructor(e){const{configNameStream:t,loadConfig:n}=e;super(e),this.subscription=t.subscribe(n)}componentWillUnmount(){this.subscription.unsubscribe()}render(){return Ft.createElement(lo,null)}}var co=ce(null,(function(e){return{loadConfig:t=>{t.copy?e(ut()):t.new?e(pt()):t.id&&e(dt({id:t.id}))}}}))(so);var uo=ce((function(e){return{disabled:e.selectedConfig.config&&e.selectedConfig.config.isNew||Q.disableConfigEdit}}))((function({disabled:e}){return Ft.createElement(on,{to:".configDetail",params:{id:Bt.generateUuid(),new:!0}},Ft.createElement("button",{className:"zombie text-left form-control",disabled:e},Ft.createElement("i",{className:"fa fa-plus-circle"}),Ft.createElement("span",null,"Add configuration")))}));const po=({owningApplications:e,currentApplication:t})=>{return e.length<2&&e.includes(t)?null:Ft.createElement("span",null,"Owned by: ",e.join(", ")," ",Ft.createElement(qt,{placement:"right",content:(n=e,0===n.length?null:1===n.length?`This config can only be edited from within the application <strong>${n[0]}.</strong>`:`This config can only be edited from within the following applications: <strong>${n.join(", ")}.</strong>`)}));var n};Ee(".config-list > .tabs-vertical > li {\n padding: 0;\n}\n.config-list > .tabs-vertical > li > a {\n padding: 18px 12px;\n}\n");var mo=ce((function(e){const t=e.selectedConfig.config?e.selectedConfig.config.id:null,n=e.data.application.name;return{selectedConfigId:t,configs:yn(e.data.configSummaries,"name"),application:n}}))((function({configs:e,selectedConfigId:t,application:n}){return Ft.createElement("section",{className:"config-list"},Ft.createElement("ul",{className:"tabs-vertical list-unstyled ",style:{wordBreak:"break-all"}},e.map((e=>Ft.createElement("li",{key:e.id,className:e.id===t?"selected":""},Ft.createElement(on,{to:".configDetail",params:{id:e.id,new:!1,copy:!1}},Ft.createElement("a",null,Ft.createElement("div",{className:"heading-4 color-text-primary"},e.name),Ft.createElement("div",{className:"body-small color-text-caption caption",style:{marginTop:"5px",marginBottom:"0"}},"Edited: ",Ft.createElement(Mi,{dateIso:e.updatedTimestampIso}),Ft.createElement("br",null),Ft.createElement(po,{owningApplications:e.applications,currentApplication:n})))))))),Ft.createElement(uo,null))}));function fo({children:t}){return Ft.createElement("div",{className:e("row","canary-footer")},t)}function ho({className:t,list:n,listWidth:r=2,detail:a,detailWidth:i=10,listClass:o,detailClass:l}){return Ft.createElement("div",{className:e("list-detail","horizontal",t)},Ft.createElement("div",{className:e(`col-md-${r}`,o)},n),Ft.createElement("div",{className:e(`col-md-${i}`,l)},a))}function bo(){const e=Ft.createElement(mo,null),t={wrap:!1},n=Ft.createElement(an,Object.assign({},t,{name:"detail"}));return Ft.createElement("div",{className:"vertical flex-1"},Ft.createElement(ho,{list:e,detail:n,className:"flex-1",detailClass:"vertical flex-1"}),Ft.createElement(fo,null,Ft.createElement(an,Object.assign({},t,{name:"footer"}))))}Ee(".canary-footer {\n position: fixed;\n z-index: 4;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: #ffffff;\n margin: 0;\n border-top: 1px solid #d9d9d9;\n}\n.canary-footer .col-sm-12 {\n padding: 5px;\n}\n.canary-footer .alert {\n display: inline-block;\n margin-bottom: 0;\n margin-right: 5px;\n padding: 6px 12px;\n vertical-align: middle;\n}\n.canary-footer .fa.fa-exclamation-triangle {\n font-size: 125%;\n color: var(--color-danger);\n opacity: 1;\n margin-left: 5px;\n padding: 0 2px;\n}\n");var go=ce((function(e){const t=!!e.selectedConfig.validationErrors.length||Q.disableConfigEdit;return{saveConfigState:e.selectedConfig.save.state,inSyncWithServer:e.selectedConfig.isInSyncWithServer,disable:t}}),(function(e){return{saveConfig:()=>{e(mt())}}}))((function({saveConfigState:e,inSyncWithServer:t,saveConfig:n,disable:r}){return t&&e!==se.Requesting?Ft.createElement("span",{className:"btn btn-link disabled"},Ft.createElement("i",{className:"far fa-check-circle"})," In sync with server"):Ft.createElement(Wt,{label:"Save Changes",onClick:n,isDisabled:r||Q.disableConfigEdit,submitting:e===se.Requesting})}));var vo=ce((function(e){return{saveConfigState:e.selectedConfig.save.state,saveConfigErrorMessage:e.selectedConfig.save.error}}),(function(e){return{dismissError:()=>{e(ft())}}}))((function({saveConfigState:t,saveConfigErrorMessage:n,dismissError:r}){return t===se.Failed&&Ft.createElement("span",{className:e("alert","alert-danger")},function(e){const t="There was an error saving your config";return e?t+`: ${e}.`:t+"."}(n),Ft.createElement("a",{className:e("alert-dismiss","clickable"),onClick:r}," ","[dismiss]"))}));var yo=ce((e=>({errors:e.selectedConfig.validationErrors.map((e=>e.message))})))((({errors:e})=>{if(!e||!e.length)return null;const t=Ft.createElement("section",null,Ft.createElement("p",null,"The following errors may prevent this config from working properly:"),Ft.createElement("ul",null,e.map((e=>Ft.createElement("li",{key:e},e)))));return Ft.createElement(Ht,{placement:"left",template:t},Ft.createElement("button",{className:"btn btn-link"},Ft.createElement("i",{className:"fa fa-exclamation-triangle"})))}));function Eo(){return Ft.createElement("div",{className:e("col-sm-12","text-right")},Ft.createElement(yo,null),Ft.createElement(vo,null),Ft.createElement(go,null))}function wo(){return Ft.createElement(oo,null,Ft.createElement("h3",{className:"heading-3"},"Click a configuration to edit."))}const xo=e=>{const t=ht(e).id,n=A(e),r=n.id;let a=`${Jt.gateUrl}/v2/canaries/canary/${t}/${r}`;const i=n.storageAccountName||Q.storageAccountName;return i&&(a+=`?storageAccountName=${i}`),a},No=e=>{const t=A(e),{metricSetPairListId:n}=t;if(!n)return null;let r=`${Jt.gateUrl}/v2/canaries/metricSetPairList/${n}`;const a=t.storageAccountName||Q.storageAccountName;return a&&(r+=`?storageAccountName=${a}`),r};var So=ce((e=>({reportUrl:xo(e),metricListUrl:No(e)})))((({reportUrl:e,metricListUrl:t})=>Ft.createElement("ul",{className:"list-unstyled small"},Ft.createElement("li",null,Ft.createElement("a",{target:"_blank",href:e},"Report")),t&&Ft.createElement("li",null,Ft.createElement("p",null,Ft.createElement("a",{target:"_blank",href:t},"Metrics"))))));const Co=({label:e,extraClass:t})=>Ft.createElement("label",{className:`label uppercase color-text-primary ${t}`},e);var Oo=ce((e=>({run:e.selectedRun.run})))((({run:e})=>{const{thresholds:{marginal:t,pass:n}}=e.canaryExecutionRequest,r=(e=>{const t=e.canaryExecutionRequest,n=Object.values(t.scopes);if(n.length>1)return null;const{controlScope:{step:r,location:a,scope:i},experimentScope:{start:o,end:l,location:s,scope:c}}=n[0];return[{label:"baseline",entries:[{label:"scope",popover:!0,getContent:()=>Ft.createElement("p",{className:"kayenta-scope"},i)},{label:"location",getContent:()=>Ft.createElement("p",null,a)}]},{label:"canary",entries:[{label:"scope",popover:!0,getContent:()=>Ft.createElement("p",{className:"kayenta-scope"},c)},{label:"location",getContent:()=>Ft.createElement("p",null,s)}]},{label:"time",entries:[{label:"start",getContent:()=>Ft.createElement("p",null,Ft.createElement(Mi,{dateIso:o}))},{label:"end",getContent:()=>Ft.createElement("p",null,Ft.createElement(Mi,{dateIso:l}))},{label:"step",getContent:()=>{const e=r/60;return Ft.createElement("p",null,e," min",1===e?"":"s")}}]}]})(e)||[];return r.push({label:"threshold",entries:[{label:"marginal",getContent:()=>Ft.createElement("p",null,t)},{label:"pass",getContent:()=>Ft.createElement("p",null,n)}]}),Ft.createElement("section",{className:"report-metadata"},r.map(((e,t)=>Ft.createElement("div",{className:`group group-${e.label}`,key:e.label||t},Ft.createElement(Co,{label:e.label||"",extraClass:"label-lg"}),Ft.createElement("ul",{className:"list-unstyled"},e.entries.map((e=>Ft.createElement("li",{key:e.label||t},Ft.createElement(Co,{label:e.label}),e.popover?Ft.createElement(Ht,{template:e.getContent()},e.getContent()):Ft.createElement(Ft.Fragment,null,e.getContent())))))))),Ft.createElement("div",{className:"group group-source",key:"source"},Ft.createElement(Co,{label:"Source",extraClass:"label-lgf"}),Ft.createElement(So,null)))}));const _o=e=>e.classification===gt.Pass?{health:null,result:"success"}:e.classification===gt.Fail?{health:"unhealthy",result:null}:{health:null,result:null};var ko=({score:e,showClassification:t,inverse:n})=>Ft.createElement(bt,{className:"score-report",score:En(e.score,2),result:_o(e).result,health:_o(e).health,classification:t?e.classification:null,inverse:n});Ee(".report-header {\n margin-bottom: 10px;\n align-items: center;\n}\n.report-header h1 {\n flex: 1 0 200px;\n align-items: center;\n margin: 0;\n padding: 0;\n word-break: break-all;\n}\n.report-header .report-score-wrapper {\n padding: 5px 20px 0 0;\n margin-left: 15px;\n border-right: 1px solid var(--color-titanium);\n text-align: center;\n flex: 0 0 200px;\n}\n.report-header .report-metadata {\n flex: 0 1 auto;\n display: flex;\n overflow: hidden;\n padding-left: 20px;\n padding-top: 10px;\n width: 100%;\n}\n.report-header .report-metadata .group {\n flex: 1 1 200px;\n margin-right: 20px;\n overflow: hidden;\n}\n.report-header .report-metadata .group.group-time {\n flex: 0 0 150px;\n}\n.report-header .report-metadata .group.group-threshold {\n flex: 0 0 80px;\n}\n.report-header .report-metadata .group.group-source {\n flex: 0 0 64px;\n margin-right: 0;\n}\n.report-header .report-metadata ul {\n margin-bottom: 0;\n}\n.report-header .report-metadata .label {\n padding-left: 0;\n}\n.report-header .report-metadata .label.label-lg {\n font-size: 85%;\n}\n.report-header .kayenta-scope {\n width: 100%;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.popover .kayenta-scope {\n word-break: break-all;\n}\n");var To=ce((e=>({id:ht(e).id,name:ht(e).name,score:vt(e).score})))((({id:e,name:t,score:n})=>Ft.createElement("section",{className:"horizontal report-header"},Ft.createElement("div",{className:"report-score-wrapper"},Ft.createElement(ko,{score:n,showClassification:!0}),Ft.createElement("h1",{className:"heading-2 color-text-primary"},Ft.createElement(on,{to:"^.^.canaryConfig.configDetail",params:{id:e}},Ft.createElement("a",{className:"clickable color-text-primary"}," ",t)))),Ft.createElement(Oo,null))));const jo=["semiotic"];var Ao=ce((e=>{const t=e.selectedRun.selectedMetric;return{pair:e.selectedRun.metricSetPair.pair,result:yt(e).find((e=>e.id===t)),graphType:e.selectedRun.graphType}}))((({pair:e,result:t,graphType:r})=>{const a=jo.map((e=>n.getDelegate(e))).filter((e=>!!e)).find((e=>e.handlesGraphType(r)));if(!a)return Ft.createElement("h3",{className:"heading-3"},"Could not load graph.");const i=a.getGraph();return Ft.createElement(i,{metricSetPair:e,result:t,type:r})}));Ee(".graph-type-selector {\n margin-left: 60px;\n margin-top: 6px;\n}\n");var Io=ce((e=>({selected:e.selectedRun.graphType})),(e=>({selectGraphType:t=>e(Et({type:t}))})))((({selected:e,selectGraphType:n})=>Ft.createElement("ul",{className:"list-inline graph-type-selector"},Ft.createElement("li",null,Ft.createElement("label",{className:"label uppercase color-text-primary",style:{paddingLeft:0}},"Graph:")),Object.values(t).map((t=>Ft.createElement("li",{style:e===t?{textDecoration:"underline"}:null,key:t,onClick:()=>n(t)},Ft.createElement("a",{className:"small clickable"},t)))))));Ee(".metric-result-actions .actions-layout {\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n margin: 12px 4px;\n}\n.metric-result-actions .action {\n padding-left: 8px;\n}\n.metric-result-actions .copy-button-container {\n display: flex;\n flex-direction: row;\n align-items: center;\n position: relative;\n}\n.metric-result-actions .copy-button-container .clipboard-btn {\n width: 100%;\n height: 100%;\n opacity: 0;\n z-index: 2;\n position: absolute;\n}\n.metric-result-actions .copy-button-container .copy-button .copy-icon {\n top: -1px;\n}\n");var Mo=ce((e=>({metricConfig:wt(e),metricSetPair:e.selectedRun.metricSetPair.pair})))((({metricSetPair:e,metricConfig:t})=>{const n=(e=>{const{attributes:t,scopes:n,values:r,tags:a}=e,{atlasGraphBaseUrl:i}=Q;let o="";Object.keys(a).length&&(o=` (${Object.keys(a).map((e=>`$${e}`)).join("|")})`);const l=encodeURIComponent(t.control.baseURL),s=`${encodeURIComponent(t.experiment.query)},Canary${o},:legend,:freeze,${encodeURIComponent(t.control.query)},Baseline${o},:legend`,c=Math.min(n.control.startTimeMillis,n.experiment.startTimeMillis),u=n.control.startTimeMillis+r.control.length*n.control.stepMillis,p=n.experiment.startTimeMillis+r.experiment.length*n.experiment.stepMillis;return`${i}?backend=${l}&g.q=${s}&g.s=${c}&g.e=${Math.max(u,p)}&g.w=651&mode=png&axis=0`})(e),r=Le.getDelegate(t.query.type).queryFinder(t),a=[Ft.createElement("div",{className:"copy-button-container"},Ft.createElement(Zt,{displayText:!1,text:r,toolTip:null}),Ft.createElement("button",{className:"primary copy-button",key:"copy-link"},Ft.createElement("i",{className:"glyphicon glyphicon-copy copy-icon"}),"Copy metric query")),Ft.createElement("a",{href:n,target:"_blank"},Ft.createElement("button",{className:"primary"},Ft.createElement("i",{className:"fas fa-chart-line"}),"Explore more data in Atlas"))].map(((e,t)=>Ft.createElement("li",{className:"action",key:t},e)));return Ft.createElement("div",{className:"metric-result-actions"},Ft.createElement("ul",{className:"actions-layout list-inline"},a))}));Ee(".metric-stats .label {\n padding-left: 0;\n}\n.metric-stats p {\n margin: 0;\n}\n");const Po=(e,t,n)=>{const r=e.result.judgeResult.results.find((e=>e.id===t));return"experiment"===n?r.experimentMetadata.stats:"control"===n?r.controlMetadata.stats:null},Do=({row:e})=>e.getContent()?Ft.createElement("div",null,Ft.createElement("label",{className:"label uppercase color-text-primary"},e.label),e.getContent()):null;var Ro=ce((e=>({metricConfig:wt(e),metricSetPair:e.selectedRun.metricSetPair.pair,run:A(e),service:wt(e).query.type})))((({metricConfig:e,metricSetPair:t,run:n})=>{const r=[{getContent:e=>Ft.createElement("span",null,"control"===e?"Baseline":"Canary")},{label:"start",getContent:e=>Ft.createElement(Mi,{dateIso:t.scopes[e].startTimeIso}),hide:()=>{const r=n.canaryExecutionRequest,a=r.scopes[e.scopeName].controlScope.start,i=t.scopes.control.startTimeIso,o=r.scopes[e.scopeName].experimentScope.start,l=t.scopes.experiment.startTimeIso;return a===i&&o===l}},{label:"count",getContent:e=>Ft.createElement("span",null,Po(n,t.id,e).count)},{label:"avg",getContent:e=>Ft.createElement("span",null,En(Po(n,t.id,e).mean,3))},{label:"max",getContent:e=>Ft.createElement("span",null,En(Po(n,t.id,e).max,3))},{label:"min",getContent:e=>Ft.createElement("span",null,En(Po(n,t.id,e).min,3))}],a=[{label:"classification reason",getContent:()=>{const e=n.result.judgeResult.results.find((e=>e.id===t.id));return e.classificationReason?Ft.createElement("p",null,e.classificationReason):null}}];return Ft.createElement("div",{className:"metric-stats vertical"},a.map((e=>Ft.createElement(Do,{row:e,key:e.label}))),Ft.createElement(Qe,{columns:r,rows:["control","experiment"],rowKey:e=>e}))})),Fo=()=>Ft.createElement("section",{className:"vertical flex-1 sp-padding-xl-bottom",style:{overflowY:"auto"}},Ft.createElement(Io,null),Ft.createElement(Ao,null),Ft.createElement(Mo,null),Ft.createElement(Ro,null));var Lo=ce((e=>({state:e.selectedRun.metricSetPair.load})))((({state:e})=>{const t=(new Ii).onFulfilled(Ft.createElement(Fo,null)).onFailed(Ft.createElement("h3",{className:"heading-3 text-center"},"Could not load metrics.")).build();return Ft.createElement(t,{state:e})})),$o=({result:e})=>e?Ft.createElement(Lo,null):Ft.createElement("h3",{className:"heading-3 text-center"},"Select a metric result.");var zo=ce((e=>({metricFilters:e.selectedRun.metricFilters})),((e,t)=>Object.assign({toggle:t=>e(Nt({classification:t}))},t)))((({results:e,metricFilters:t,toggle:n})=>{const r=[xt.Error,xt.High,xt.Low,xt.Nodata,xt.Pass].map((t=>({classification:t,count:e.filter((e=>e.classification===t)).length}))).filter((e=>e.count)).map((e=>Ft.createElement("label",{key:e.classification},Ft.createElement("input",{type:"checkbox",checked:t.includes(e.classification),onChange:()=>n(e.classification)})," ",e.classification," (",e.count,")"," ")));return Ft.createElement("div",{className:"metric-filter-options horizontal center"},r)}));const Vo="var(--color-success)",Go="var(--color-danger)",qo="var(--color-text-caption)",Uo="var(--color-warning)",Yo=e=>({[xt.High]:Go,[xt.Low]:Go,[xt.Error]:Uo,[xt.Nodata]:qo,[xt.Pass]:Vo}[e]),Ko=(e,t)=>"number"!=typeof e.score?Uo:e.score>t.pass?Vo:e.score>t.marginal?qo:Go,Bo=e=>({backgroundColor:Yo(e)});var Wo=({classification:t,className:n})=>Ft.createElement("div",{className:e("pill","metric-result-classification",n),style:Bo(t)},Ft.createElement("span",{style:{color:"var(--color-text-on-dark)"}},t));var Ho=({ratio:e,className:t})=>e&&Ft.createElement("span",{className:t,style:{color:"var(--color-text-caption"}},(e=>"number"!=typeof e?"N/A":1===e?"0%":e<1?(100*(e-1)).toFixed(1)+"%":"+"+(100*(e-1)).toFixed(1)+"%")(e));const Jo=[{label:"metric name",getContent:({metricName:e})=>Ft.createElement(Qt,null,e),width:5},{label:"deviation",getContent:({results:e})=>e[0].resultMetadata&&Ft.createElement(Ho,{ratio:e[0].resultMetadata.ratio}),width:1},{label:"result",getContent:({results:e})=>Ft.createElement(Wo,{classification:e[0].classification}),width:1}];var Zo=ce((e=>({selectedResult:St(e)})),((e,t)=>Object.assign(Object.assign({},t),{select:t=>e(Ct({metricId:t}))})))((({results:t,select:n,selectedResult:r})=>{let a=hn(t).flatMap((e=>Object.keys(e.tags||{}))).uniq().value().map((e=>({label:e,width:5,getContent:t=>Ft.createElement(Qt,null,t.tags[e])})));return a=a.concat([{width:1,getContent:({resultMetadata:e})=>e&&Ft.createElement(Ho,{ratio:e.ratio})},{width:1,getContent:({classification:e})=>Ft.createElement(Wo,{classification:e})}]),Ft.createElement(_n,{rows:t,columns:a,className:"multiple-results-table",headerClassName:"sticky-header-2",rowClassName:t=>e("horizontal",{selected:t.id===r}),rowKey:e=>Object.entries(e.tags||{}).map((([e,t])=>`${e}:${t}`)).join(":"),onRowClick:e=>n(e.id)})}));Ee(".metric-results-list .table-header h6 {\n padding-left: 5px;\n}\n.metric-results-list .tabs-vertical {\n overflow-y: auto;\n display: block;\n}\n.metric-results-list .tabs-vertical li {\n padding: 8px 0 8px 5px;\n}\n.metric-results-list .metric-result-classification {\n margin-right: 3px;\n}\n.metric-results-list .table-row {\n cursor: pointer;\n}\n.metric-results-list .list-group {\n margin-bottom: 0;\n}\n.metric-results-list li.multiple-results {\n padding-bottom: 0;\n border: none;\n}\n.metric-results-list li.multiple-results:hover {\n border: none;\n}\n.metric-results-list .multiple-results-table {\n padding-left: 8px;\n}\n.metric-results-list .multiple-results-table h6 {\n margin-top: 7px;\n}\n");const Qo=e=>e.hasMultipleRows?Ft.createElement("li",{className:"horizontal multiple-results"},Ft.createElement("section",{className:"vertical flex-fill"},Ft.createElement("div",null,e.metricName),Ft.createElement(Zo,{results:e.results}))):null;var Xo=ce((e=>({selectedMetric:e.selectedRun.selectedMetric,metricFilters:e.selectedRun.metricFilters})),((e,t)=>Object.assign({select:t=>e(Ct({metricId:t}))},t)))((({results:t,select:n,selectedMetric:r,metricFilters:a})=>{const i=((e,t)=>{const n=e.reduce(((e,t)=>(e.has(t.name)||e.set(t.name,0),e.set(t.name,e.get(t.name)+1),e)),new Map),r=e.filter((e=>!t.length||t.includes(e.classification))).reduce(((e,t)=>e.has(t.name)?e.set(t.name,{metricName:t.name,results:e.get(t.name).results.concat(t),hasMultipleRows:n.get(t.name)>1}):e.set(t.name,{metricName:t.name,results:[t],hasMultipleRows:n.get(t.name)>1})),new Map);return Array.from(r.values())})(t,a);return Ft.createElement("section",{className:"vertical metric-results-list flex-1"},Ft.createElement(zo,{results:t}),Ft.createElement(_n,{rowKey:e=>e.metricName,tableBodyClassName:"list-unstyled tabs-vertical flex-1 sp-padding-xl-bottom",rowClassName:t=>e("horizontal",{selected:t.results[0].id===r}),rows:i,columns:Jo,onRowClick:e=>n(e.results[0].id),className:"flex-1 vertical",customRow:Qo}))}));Ee(".metric-results:after {\n content: '';\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 8px;\n box-shadow: inset 0px -8px 4px -4px #fff;\n z-index: 2;\n}\n");var el=ce((e=>{const{selectedRun:{selectedGroup:t,selectedMetric:n}}=e,r=vt(e),a=t?e=>e.groups.includes(t):()=>!0;return{metricResults:Object.values(r.results).filter(a),selectedMetricResult:Object.values(r.results).find((e=>e.id===n))}}))((({metricResults:e,selectedMetricResult:t})=>{const n=Ft.createElement(Xo,{results:e}),r=Ft.createElement($o,{result:t});return Ft.createElement(ho,{list:n,listClass:"vertical",listWidth:5,detail:r,detailClass:"vertical",detailWidth:9,className:"metric-results flex-1"})}));Ee(".report-explanation {\n background-color: var(--color-warning);\n height: 30px;\n margin-bottom: 5px;\n margin-left: 15px;\n padding-top: 4px;\n font-weight: bold;\n font-size: 14px;\n text-align: center;\n}\n");var tl=ce((e=>({exception:e.selectedRun.run.exception})))((({exception:e})=>{const t=[];if(e.details){const{error:n,errors:r}=e.details;n&&t.push(n),(null==r?void 0:r.length)&&r.forEach((e=>t.push(e)))}return t.length||t.push('No error message provided. Click the "Report" link to see more details.'),Ft.createElement(Ft.Fragment,null,Ft.createElement("h3",{className:"text-center"},"Canary report failed"),Ft.createElement("dl",null,Ft.createElement("dt",null,"Details"),Ft.createElement("dd",null,t.map(((e,t)=>Ft.createElement("div",{key:t},Ft.createElement("code",null,e))))),Ft.createElement("dt",null,"Source"),Ft.createElement("dd",null,Ft.createElement(So,null))))}));var nl=ce((e=>({run:e.selectedRun.run})))((({run:e})=>{const t=(e=>{var t,n,r,a;return null!==(a=null===(r=null===(n=null===(t=null==e?void 0:e.result)||void 0===t?void 0:t.judgeResult)||void 0===n?void 0:n.score)||void 0===r?void 0:r.classificationReason)&&void 0!==a?a:null})(e);return t?Ft.createElement("section",null,Ft.createElement("div",{className:"report-explanation"},t)):null}));var rl=({arrowColor:t,className:n})=>Ft.createElement("div",{className:e("arrow-down",n),style:{borderTopColor:t}}),al=({className:t,onClick:n,score:r,scoreThresholds:a})=>Ft.createElement("section",{className:t},Ft.createElement("div",{onClick:n,style:{backgroundColor:Ko(r,a)},className:e("clickable","text-center","all-metric-results-header")},Ft.createElement("h3",{className:"heading-3 label"},"ALL"),Ft.createElement(rl,{className:"outer",arrowColor:"var(--color-titanium)"}),Ft.createElement(rl,{className:"inner",arrowColor:Ko(r,a)}))),il=({label:t,onClick:n,style:r,className:a})=>Ft.createElement("section",{style:r,onClick:n,className:e("clickable","text-center","group-score",a)},Ft.createElement("h3",{className:"heading-3 uppercase label"},t),Ft.createElement(rl,{arrowColor:r.backgroundColor}));var ol=ce((e=>({selectedGroup:e.selectedRun.selectedGroup,groupWeights:Ot(e),scoreThresholds:_t(e).thresholds})),((e,t)=>Object.assign({select:t=>e(kt({group:t}))},t)))((({groups:t,groupWeights:n,scoreThresholds:r,className:a,select:i,selectedGroup:o})=>Ft.createElement("section",{className:e("horizontal",a)},t.map((t=>Ft.createElement(il,{key:t.name,style:{width:`${n[t.name]}%`,backgroundColor:Ko(t,r)},onClick:()=>i(t.name),label:t.name,className:e("report-score",{active:t.name===o})}))))));Ee(".report-scores {\n height: 40px;\n margin-bottom: 20px;\n}\n.report-scores .group-score,\n.report-scores .all-metric-results-header {\n height: 30px;\n color: white;\n border-right: 1px solid white;\n padding-top: 4px;\n}\n.report-scores .group-score h3,\n.report-scores .all-metric-results-header h3 {\n font-weight: 600;\n}\n.report-scores .group-score:last-of-type {\n border-right: none;\n}\n.report-scores .report-score.active .arrow-down {\n width: 0;\n height: 0;\n margin: 5px auto 0 auto;\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-top: 8px solid transparent;\n}\n.report-scores .all-metric-results-header {\n border: 1px solid var(--color-titanium);\n width: 70%;\n margin: 0 auto;\n}\n.report-scores .all-metric-results-header .arrow-down.inner {\n margin-top: -9px;\n}\n.report-scores .all-metric-results-header .arrow-down.outer {\n margin-top: 4px;\n}\n");var ll=ce((e=>({groups:yn(vt(e).groupScores,[t=>-Ot(e)[t.name],"name"]),score:vt(e).score,scoreThresholds:e.selectedRun.run.canaryExecutionRequest.thresholds,selectedGroup:e.selectedRun.selectedGroup})),(e=>({clearSelectedGroup:()=>e(kt({group:null}))})))((({groups:t,isExpanded:n,selectedGroup:r,clearSelectedGroup:a,score:i,scoreThresholds:o,toggleHeader:l})=>{const s={transform:n?"rotate(90deg)":"rotate(0deg)",transition:"all ease 0.15s"};return Ft.createElement("section",{className:"horizontal report-scores"},Ft.createElement(al,{onClick:a,score:i,scoreThresholds:o,className:e("flex-1","report-score",{active:!r})}),Ft.createElement(ol,{groups:t,className:"flex-12"}),Ft.createElement("div",{className:"kayenta-overview-toggle horizontal middle",onClick:()=>l()},n?Ft.createElement("p",null,"hide details"):Ft.createElement("p",null,"show details"),Ft.createElement("span",{className:"glyphicon glyphicon-chevron-right",style:s})))}));Ee(".kayenta-overview-toggle {\n height: 30px;\n line-height: 30px;\n cursor: pointer;\n padding-right: 0 10px;\n}\n.kayenta-overview-toggle p {\n height: 100%;\n text-transform: uppercase;\n margin: 0 10px;\n}\n.kayenta-overview-toggle span {\n margin-bottom: 4px;\n}\n");var sl=ce((e=>({run:e.selectedRun.run})))((function({run:e}){var t,n;const[r,a]=Ft.useState(!0);return!(null===(n=null===(t=e.result)||void 0===t?void 0:t.judgeResult.results)||void 0===n?void 0:n.length)&&e.exception?Ft.createElement(tl,null):Ft.createElement(Ft.Fragment,null,Ft.createElement("div",{className:"vertical flex-1"},r&&Ft.createElement(To,null),Ft.createElement(nl,null),Ft.createElement(ll,{isExpanded:r,toggleHeader:()=>{a(!r)}}),Ft.createElement(el,null)))}));var cl=ce((e=>({loadState:e.selectedRun.load})))((({loadState:e})=>{const t=(new Ii).onFulfilled(Ft.createElement(sl,null)).onFailed(Ft.createElement(oo,null,Ft.createElement("h3",{className:"heading-3"},"Could not load canary report."))).build();return Ft.createElement(t,{state:e})}));class ul extends Ft.Component{constructor(e){super(e);const{resultIdStream:t,loadResult:n}=e;this.subscription=t.subscribe(n)}componentWillUnmount(){this.subscription.unsubscribe()}render(){return Ft.createElement(cl,null)}}var pl=ce(null,(e=>({loadResult:t=>e(Tt({configId:t.configId,runId:t.runId}))})))(ul);const dl={prometheus:[{label:"",value:""},{label:"gce_instance",value:"gce_instance"},{label:"aws_ec2_instance",value:"aws_ec2_instance"}],stackdriver:[{label:"gce_instance",value:"gce_instance"},{label:"aws_ec2_instance",value:"aws_ec2_instance"},{label:"gae_app",value:"gae_app"},{label:"k8s_container",value:"k8s_container"},{label:"k8s_pod",value:"k8s_pod"},{label:"k8s_node",value:"k8s_node"},{label:"gke_container",value:"gke_container"},{label:"https_lb_rule",value:"https_lb_rule"},{label:"global",value:"global"}]};class ml extends Ft.Component{constructor(e){var t;super(e),this.validate=e=>{const t={};let n,r;if(e.configId||(t.configId="You must choose a canary config"),e.startTime)try{n=new Date(e.startTime).getTime()}catch(e){t.startTime="Invalid start time. Time must be in ISO-8601 format, e.g. 2018-07-12T22:28:29Z"}else t.startTime="You must provide a start time";if(e.endTime)try{r=new Date(e.endTime).getTime()}catch(e){t.endTime="Invalid start time. Time must be in ISO-8601 format, e.g. 2018-07-12T22:28:29Z"}else t.endTime="You must provide an end time";n&&r&&r<=n&&(t.endTime="End time must be after start time"),e.step?parseInt(e.step,10)<1&&(t.step="Invalid step value"):t.step="You must provide a step value",e.baselineScope||(t.baselineScope="You must provide a baseline scope"),e.canaryScope||(t.canaryScope="You must provide a canary scope"),e.baselineLocation||(t.baselineLocation="You must provide a baseline location"),e.canaryLocation||(t.canaryLocation="You must provide a canary location");const a=parseInt(e.marginalThreshold,10),i=parseInt(e.passThreshold,10);return e.marginalThreshold?a>i?t.marginalThreshold="Marginal threshold must be greater than passing threshold":a<1&&(t.marginalThreshold="Marginal threshold must be positive"):t.marginalThreshold="You must provide a marginal score threshold",e.passThreshold?i>100&&(t.passThreshold="Passing threshold cannot be greater than 100"):t.passThreshold="You must provide a passing score threshold",e.metricsAccountName||(t.metricsAccountName="You must choose a metrics account"),e.storageAccountName||(t.storageAccountName="You must choose a storage account"),t},this.submit=(e,t)=>{const{configId:n,metricsAccountName:r,storageAccountName:a}=e,{application:i,accounts:o}=this.props,l=((e,t)=>{var n;const r=parseInt(e.step,10),a=parseInt(e.passThreshold,10),i=parseInt(e.marginalThreshold,10),o=t.find((({name:t})=>e.metricsAccountName===t)),l={};e.resourceType&&(l.resourceType=e.resourceType),"atlas"!==o.type||(null===(n=e.extendedScopeParams)||void 0===n?void 0:n.type)||(l.type="cluster");const s=Object.assign(Object.assign({},e.extendedScopeParams),l);return{scopes:{default:{controlScope:{scope:e.baselineScope,start:e.startTime,end:e.endTime,location:e.baselineLocation,step:r,extendedScopeParams:s},experimentScope:{scope:e.canaryScope,start:e.startTime,end:e.endTime,location:e.canaryLocation,step:r,extendedScopeParams:s}}},thresholds:{pass:a,marginal:i}}})(e,o);jt(n,l,{application:i.name,metricsAccountName:r,storageAccountName:a}).then((()=>{t.setSubmitting(!1),t.setStatus({succeeded:!0})})).catch((e=>{t.setSubmitting(!1),t.setStatus({succeeded:!1,error:e})}))};const{initialValues:n,accounts:r}=e,a=r.find((({name:e})=>n.metricsAccountName===e)),i=null!==(t=null==a?void 0:a.recommendedLocations)&&void 0!==t?t:[];this.state={showAllControlLocations:!i.includes(n.baselineLocation),showAllExperimentLocations:!i.includes(n.canaryLocation)}}static show(e){return Xt.show(ml,e,{dialogClassName:"modal-lg"})}render(){const{dismissModal:e,title:t,application:n,accounts:r,initialValues:a}=this.props,{showAllControlLocations:i,showAllExperimentLocations:o}=this.state,l=n.getDataSource("canaryConfigs").data.slice().sort(((e,t)=>e.name.localeCompare(t.name))),s=r.filter((({supportedTypes:e})=>e.includes(L.MetricsStore))),c=r.filter((({supportedTypes:e})=>e.includes(L.ObjectStore))),u=s.length>1||c.length>1;return Ft.createElement(Nn,{initialValues:Object.assign(Object.assign({},a),{metricsAccountName:cn(s[0],"name",""),storageAccountName:cn(c[0],"name","")}),onSubmit:this.submit,validate:this.validate,isInitialValid:!!a.configId,render:({values:n,touched:r,isValid:p,isSubmitting:d,status:m,setFieldValue:f,setFieldTouched:h,errors:b})=>{if(!0===cn(m,"succeeded"))return Ft.createElement(Ft.Fragment,null,Ft.createElement(en,{dismiss:e}),Ft.createElement(xn.Header,null,Ft.createElement("h3",null,"Analysis Started")),Ft.createElement(xn.Body,null,Ft.createElement("p",null,"Analysis started — check the list of reports in a few minutes to view results")),Ft.createElement(xn.Footer,{className:"horizontal right"},Ft.createElement("button",{className:"btn btn-primary",onClick:e,type:"button"},"Got it")));const g=s.find((({name:e})=>n.metricsAccountName===e)),v=c.find((({name:e})=>n.storageAccountName===e)),y=cn(g,"recommendedLocations",[]),{canaryLocation:E,baselineLocation:w}=a,x=cn(g,"locations",[]);E&&!x.includes(E)&&x.push(E),w&&!x.includes(w)&&x.push(w);const N=y.length>0||x.length>0;return Ft.createElement(Sn,{className:"form-horizontal"},Ft.createElement(en,{dismiss:e}),Ft.createElement(xn.Header,null,t&&Ft.createElement("h3",null,t)),Ft.createElement(xn.Body,null,Ft.createElement("div",{className:"row"},Ft.createElement("div",{className:"col-md-12"},Ft.createElement("div",{className:"container-fluid form-horizontal"},Ft.createElement("h5",null,"Analysis Configuration"),Ft.createElement("div",{className:"horizontal-rule"}),Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"Config Name"),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(tn,{value:n.configId,options:l.map((({id:e,name:t})=>({label:t,value:e}))),onChange:e=>f("configId",e&&e.value||null)}))),Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"Start Time ",Ft.createElement(qt,{id:"pipeline.config.canary.startTimeIso"})),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(yl,{errors:b,touched:r,name:"startTime"}))),Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"End Time ",Ft.createElement(qt,{id:"pipeline.config.canary.endTimeIso"})),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(yl,{errors:b,touched:r,name:"endTime"}))),Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"Step"),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(yl,{errors:b,touched:r,type:"number",style:{width:"60px",display:"inline-block"},name:"step"}),Ft.createElement("span",{className:"form-control-static"}," seconds"))),Ft.createElement("h5",null,"Baseline + Canary Pair"),Ft.createElement("div",{className:"horizontal-rule"}),Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"Baseline ",Ft.createElement(qt,{id:"pipeline.config.canary.baselineGroup"})),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(yl,{name:"baselineScope",errors:b,touched:r}))),Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"Baseline Location ",Ft.createElement(qt,{id:"pipeline.config.canary.baselineLocation"})),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(bl,{hasLocationChoices:N,showAll:i,recommendedLocations:y,locations:x,value:n.baselineLocation,field:"baselineLocation",errors:b,touched:r,onChange:e=>{h("baselineLocation",!0),f("baselineLocation",e)},onShowAllChange:e=>this.setState({showAllControlLocations:e})}))),Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"Canary ",Ft.createElement(qt,{id:"pipeline.config.canary.canaryGroup"})),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(yl,{errors:b,touched:r,name:"canaryScope"}))),Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"Canary Location ",Ft.createElement(qt,{id:"pipeline.config.canary.canaryLocation"})),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(bl,{hasLocationChoices:N,showAll:o,recommendedLocations:y,locations:x,value:n.canaryLocation,field:"canaryLocation",errors:b,touched:r,onChange:e=>{h("canaryLocation",!0),f("canaryLocation",e)},onShowAllChange:e=>this.setState({showAllExperimentLocations:e})}))),Ft.createElement("h5",null,"Metric Scope"),Ft.createElement("div",{className:"horizontal-rule"}),dl.hasOwnProperty(cn(g,"type"))&&Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"Resource Type"),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(tn,{value:n.resourceType,options:dl[g.type],onChange:e=>f("resourceType",e&&e.value||"")}),Ft.createElement(vl,{field:"resourceType",errors:b,touched:r}))),Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"Extended Params ",Ft.createElement(qt,{id:"pipeline.config.canary.extendedScopeParams"})),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(nn,{model:n.extendedScopeParams,onChange:e=>f("extendedScopeParams",e),hiddenKeys:["resourceType"]}))),Ft.createElement("h5",null,"Scoring Thresholds"),Ft.createElement("div",{className:"horizontal-rule"}),Ft.createElement(At,{onChange:({unhealthyScore:e,successfulScore:t})=>{f("marginalThreshold",e),f("passThreshold",t)},successfulHelpFieldId:"pipeline.config.canary.passingScore",successfulLabel:"Pass ",successfulScore:n.passThreshold,unhealthyHelpFieldId:"pipeline.config.canary.marginalScore",unhealthyLabel:"Marginal ",unhealthyScore:n.marginalThreshold}),u&&Ft.createElement(gl,{metricsStores:s,selectedMetricsStore:g,objectStores:c,selectedObjectStore:v,onChange:f,errors:b,touched:r})))),cn(m,"error")&&Ft.createElement("div",{className:"row"},Ft.createElement("div",{className:"col-md-7 col-md-offset-3"},Ft.createElement("div",{className:"well-compact alert alert-danger"},Ft.createElement("b",null,"There was a problem starting your analysis:"),Ft.createElement("span",null,JSON.stringify(m.error.data)))))),Ft.createElement(xn.Footer,{className:"horizontal right"},Ft.createElement("button",{className:"btn btn-default",onClick:e,type:"button"},"Cancel"),Ft.createElement(fl,{isValid:p,isSubmitting:d,errors:b})))}})}}ml.defaultProps={closeModal:Yt,dismissModal:Yt,initialValues:{configId:null,startTime:"",endTime:"",step:"",baselineScope:"",canaryScope:"",baselineLocation:"",canaryLocation:"",extendedScopeParams:{},resourceType:"",marginalThreshold:"",passThreshold:"",metricsAccountName:"",storageAccountName:""}};const fl=({errors:e,isValid:t,isSubmitting:n})=>{const r=Ft.createElement(Wt,{isDisabled:!t,submitting:n,isFormSubmit:!0,label:"Start analysis"}),a=Object.values(e).map(((e,t)=>Ft.createElement("li",{key:t},e)));if(t||!a.length)return r;return Ft.createElement("div",{className:"sp-margin-s-left"},Ft.createElement(Ht,{Component:()=>Ft.createElement("div",null,"The following errors must be corrected before submitting:",Ft.createElement("ul",null,a))},r))},hl=(e,t,n)=>e?[...new Set(t.concat(n))]:t.length>0?t:n,bl=({hasLocationChoices:e,showAll:t,recommendedLocations:n,locations:r,value:a,onChange:i,onShowAllChange:o,errors:l,touched:s,field:c})=>{if(!e)return Ft.createElement(yl,{name:c,errors:l,touched:s});const u=hl(t,n,r).sort().map((e=>({label:e,value:e})));return Ft.createElement(Ft.Fragment,null,Ft.createElement(tn,{clearable:!1,value:a,options:u,onChange:e=>i(e&&e.value||"")}),Ft.createElement(vl,{field:c,errors:l,touched:s}),n.length>0&&r.length>0&&Ft.createElement("div",{className:"pull-right"},Ft.createElement("button",{type:"button",className:"link",onClick:()=>{o(!t),hl(!t,n,r).includes(a)||i("")}},t?"Only show recommended locations":"Show all locations")))},gl=({metricsStores:e,selectedMetricsStore:t,objectStores:n,selectedObjectStore:r,onChange:a,errors:i,touched:o})=>Ft.createElement(Ft.Fragment,null,Ft.createElement("h5",null,"Advanced Settings"),Ft.createElement("div",{className:"horizontal-rule"}),Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"Metrics Account ",Ft.createElement(qt,{id:"pipeline.config.metricsAccount"})),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(tn,{clearable:!1,value:cn(t,"name"),options:e.map((({name:e})=>({label:e,value:e}))),onChange:e=>a("metricsAccountName",e&&e.value||"")}),Ft.createElement(vl,{field:"metricsAccountName",errors:i,touched:o}))),Ft.createElement("div",{className:"form-group"},Ft.createElement("div",{className:"col-md-3 sm-label-right"},"Storage Account ",Ft.createElement(qt,{id:"pipeline.config.storageAccount"})),Ft.createElement("div",{className:"col-md-7"},Ft.createElement(tn,{clearable:!1,value:cn(r,"name"),options:n.map((({name:e})=>({label:e,value:e}))),onChange:e=>a("storageAccountName",e&&e.value||"")}),Ft.createElement(vl,{field:"storageAccountName",errors:i,touched:o})))),vl=({field:e,errors:t,touched:n})=>n[e]&&t[e]?Ft.createElement("div",{className:"error-message"},t[e]):null,yl=e=>{const{errors:t,name:n,touched:r}=e;return Ft.createElement(Ft.Fragment,null,Ft.createElement(Cn,Object.assign({},e,{className:"form-control input-sm",required:r[n],error:t[n]})),Ft.createElement(vl,{field:n,errors:t,touched:r}))};var El=ce(((e,t)=>Object.assign({configId:It(e,t.executionId)},t)))((({configId:e,configName:t})=>{const n=ln("^.^.canaryConfig.configDetail",{id:e});return Ft.createElement("a",Object.assign({},n),t)}));const wl=({parentPipelineExecutionId:e,application:t})=>{const n=ln("home.applications.application.pipelines.executionDetails.execution",{application:t,executionId:e});return Ft.createElement("a",Object.assign({},n),"Pipeline")};var xl=ce(((e,t)=>Object.assign({configId:It(e,t.executionId)},t)))((({configId:e,executionId:t,children:n})=>{const r=ln("^.reportDetail",{configId:e,runId:t});return Ft.createElement("a",Object.assign({},r),n)}));Ee(".execution-list-container {\n overflow-y: auto;\n}\n.execution-list-table {\n margin-bottom: 0;\n}\n");const Nl=(e,t)=>Object.keys(e).reduce(((n,r)=>{const{controlScope:a,experimentScope:i}=e[r],o=((e,t)=>t.some((({query:t,scopeName:n})=>n===e&&"atlas"===t.type)))(r,t);return o&&"global"===cn(a,"extendedScopeParams.dataset")?n.add("Global"):n.add(a.location),o&&"global"===cn(i,"extendedScopeParams.dataset")?n.add("Global"):n.add(i.location),n}),new Set),Sl=[{label:"Summary",getContent:e=>Ft.createElement("div",null,Ft.createElement(xl,{configName:e.config.name,executionId:e.pipelineId,application:e.application},Ft.createElement(ko,{score:e.result.judgeResult.score,showClassification:!1,inverse:!0})," ",Ft.createElement(Mi,{dateIso:e.startTimeIso})),e.startTimeIso&&Ft.createElement("div",{className:"color-text-caption body-small"},rn(new Date(e.startTimeIso).getTime())))},{label:"Locations",getContent:({canaryExecutionRequest:{scopes:e},config:{metrics:t}})=>{const n=[...Nl(e,t)];return Ft.createElement("div",{className:"vertical"},n.map((e=>Ft.createElement("span",{key:e},e))))}},{label:"Config",getContent:e=>Ft.createElement(El,{configName:e.config.name,executionId:e.pipelineId,application:e.application})},{label:"Scopes",getContent:({canaryExecutionRequest:{scopes:e}})=>{const t=Object.keys(e).reduce(((t,n)=>t.add(e[n].controlScope.scope)),new Set),n=Object.keys(e).reduce(((t,n)=>t.add(e[n].experimentScope.scope)),new Set),r={maxWidth:"350px",wordBreak:"break-all"};return wn(t,n)?Ft.createElement("div",{className:"vertical",style:r},[...n].map((e=>Ft.createElement("span",{key:e},e)))):Ft.createElement("div",{className:"vertical",style:r},Ft.createElement("span",{className:"heading-6 uppercase color-text-caption"},"Baseline"),[...t].map((e=>Ft.createElement("span",{key:e},e))),Ft.createElement("span",{className:"heading-6 uppercase color-text-caption",style:{marginTop:"5px"}},"Canary"),[...n].map((e=>Ft.createElement("span",{key:e},e))))}},{getContent:({parentPipelineExecutionId:e,application:t})=>e&&e!==Mt&&Ft.createElement(wl,{parentPipelineExecutionId:e,application:t})}],Cl=(e,t)=>Q.manualAnalysisEnabled?Sl.concat([{label:"Actions",getContent:n=>Ft.createElement(Kt,{value:"Re-run analysis"},Ft.createElement("button",{className:"link",onClick:()=>Ol(n,e,t)},Ft.createElement("i",{className:"fas fa-redo-alt"})))}]):Sl,Ol=(e,t,n)=>{var r;const{controlScope:a,experimentScope:i}=Object.values(e.canaryExecutionRequest.scopes)[0],o=`${null!==(r=a.step)&&void 0!==r?r:60}`;ml.show({title:"Start Manual Analysis",application:t,accounts:n,initialValues:{configId:e.canaryConfigId,startTime:a.start,endTime:a.end,step:o,baselineScope:a.scope,canaryScope:i.scope,baselineLocation:a.location,canaryLocation:i.location,extendedScopeParams:a.extendedScopeParams,resourceType:a.resourceType,marginalThreshold:`${e.canaryExecutionRequest.thresholds.marginal}`,passThreshold:`${e.canaryExecutionRequest.thresholds.pass}`,metricsAccountName:e.metricsAccountName,storageAccountName:e.storageAccountName}})},_l=({executions:e,application:t,accounts:n})=>t.getDataSource("canaryExecutions").loaded?e&&e.length?Ft.createElement(Qe,{rows:e,className:"flex-1 execution-list-table",columns:Cl(t,n),rowKey:e=>e.pipelineId}):Ft.createElement(oo,null,Ft.createElement("h3",{className:"heading-3"},"No canary execution history for this application.")):Ft.createElement(oo,null,Ft.createElement("div",{className:"horizontal center middle spinner-container"},Ft.createElement($t,null))),kl=e=>{Vt.$state.go(".",{count:Number(e.target.value)})};var Tl=ce((e=>({executions:Object.values(e.data.executions.data).filter((e=>e.result)),application:e.data.application,accounts:e.data.kayentaAccounts.data,executionsCount:e.app.executionsCount})))((({executions:e,application:t,accounts:n,executionsCount:r})=>{var a;Ft.useEffect((()=>{const e=t.getDataSource("canaryExecutions");return e.active||e.activate(),e.refresh(),()=>e.deactivate()}),[t,r]);const i=null!==(a=Q.executionsCountOptions)&&void 0!==a?a:[20,50,100,200];return i.includes(r)||(i.push(r),i.sort(((e,t)=>e-t))),Ft.createElement("div",{className:"vertical execution-list-container"},Ft.createElement("div",{className:"horizontal space-between form-inline"},Ft.createElement("div",{className:"form-group"},i.length>1&&Ft.createElement(Ft.Fragment,null,Ft.createElement("span",{className:"sp-margin-s-right"},"Showing"),Ft.createElement("select",{className:"form-control input-sm",onChange:kl},i.map((e=>Ft.createElement("option",{selected:r===e,value:e},e)))),Ft.createElement("span",{className:"sp-margin-s-left"},"most recent reports"))),Q.manualAnalysisEnabled&&Ft.createElement("button",{style:{alignSelf:"flex-end",flexShrink:0},className:"primary",onClick:()=>((e,t)=>{ml.show({title:"Start Manual Analysis",application:e,accounts:t})})(t,n)},Ft.createElement("i",{className:"fa fa-play"})," Start Manual Analysis")),Ft.createElement(_l,{executions:e,application:t,accounts:n}))}));var jl=ce((e=>({loadState:e.data.executions.load})))((({loadState:e})=>{const t=(new Ii).onFulfilled(Ft.createElement(Tl,null)).onFailed(Ft.createElement(oo,null,Ft.createElement("h3",{className:"heading-3"},"Could not load canary execution history."))).build();return Ft.createElement(t,{state:e})})),Al=()=>Ft.createElement("div",{className:"vertical flex-1"},Ft.createElement(an,Object.assign({},{wrap:!1},{name:"detail"})));function Il(e,t){const{stateRegistry:n}=t;var r;return n.get().filter((e=>e.name.match(/home.(project|applications).application.canary/))).sort(((e,t)=>t.name.length-e.name.length)).forEach((e=>n.deregister(e))),function(e,t){var n,r,a;const i={name:"canaryConfig",url:"/config",views:{canary:{component:bo,$type:"react"}},children:[{name:"configDefault",url:"",views:{detail:{component:wo,$type:"react"}}},{name:"configDetail",url:"/:id?copy&new",views:{detail:{component:co,$type:"react"},footer:{component:Eo,$type:"react"}},params:{copy:{type:"boolean",value:!1,squash:!0},new:{type:"boolean",value:!1,squash:!0}},resolve:[{token:"configNameStream",deps:[sn],resolveFn:e=>e.globals.params$}]}],redirectTo:e=>e.to().name+".configDefault"},o={name:"reportDetail",url:"/:configId/:runId",views:{detail:{component:pl,$type:"react"}},resolve:[{token:"resultIdStream",deps:[sn],resolveFn:e=>e.globals.params$}]},l={name:"reportDefault",url:"",views:{detail:{component:jl,$type:"react"}}},s={name:"report",url:"/report?count",views:{canary:{component:Al,$type:"react"}},params:{count:{type:"int",value:null!==(a=null!==(n=Q.defaultExecutionCount)&&void 0!==n?n:null===(r=Q.executionsCountOptions)||void 0===r?void 0:r[0])&&void 0!==a?a:20,squash:!0}},children:[o,l],redirectTo:e=>e.to().name+".reportDefault"},c={abstract:!0,name:"canary",url:"/canary",views:{insight:{component:Ai,$type:"react"}},data:{pageTitleSection:{title:"Canary"}},children:[i,s]};t.addChildState(c)}(0,e),(r=t).transitionService.onBefore({from:"**.configDetail.**",to:e=>!e.name.includes("configDetail")},(()=>{ji.dispatch(Pt())})),Dt.$rootScope.$on("$stateChangeStart",(e=>{const t=ji.getState();t.selectedConfig&&!t.selectedConfig.isInSyncWithServer&&(window.confirm("You have unsaved changes.\nAre you sure you want to navigate away from this page?")||e.preventDefault())})),r.transitionService.onEnter({to:"**.configDetail.**"},(()=>{window.onbeforeunload=()=>{const e=ji.getState();return e.selectedConfig&&!e.selectedConfig.isInSyncWithServer||null}})),r.transitionService.onExit({from:"**.configDetail.**"},(()=>{window.onbeforeunload=void 0})),r.transitionService.onSuccess({to:"**.report.**"},(e=>{e.params("from").count!==e.params("to").count&&ji.dispatch(Rt({count:e.params("to").count}))})),ne.afterConfigsLoaded=e=>{e===ji.getState().data.application&&ji.dispatch(re({configSummaries:e.getDataSource("canaryConfigs").data}))},ne.afterJudgesLoaded=e=>{e===ji.getState().data.application&&ji.dispatch(ae({judges:e.getDataSource("canaryJudges").data}))},ne.loadCanaryExecutions=e=>{const t=ie(e.name);return t.catch((e=>{ji.dispatch(oe({error:e}))})),t},ne.afterCanaryExecutionsLoaded=e=>{e===ji.getState().data.application&&ji.dispatch(le({executions:e.getDataSource("canaryExecutions").data}))},{}}export{Il as lazyInitializeKayenta};
|
|
2
|
+
//# sourceMappingURL=lazy-1f6a42b8.js.map
|