@spinnaker/kayenta 2025.4.1 → 2026.0.0
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-c465ad9f.js +2 -0
- package/build/dist/index-c465ad9f.js.map +1 -0
- package/build/dist/index.js +1 -1
- package/build/dist/{lazy-b3700c07.js → lazy-011b9f6a.js} +2 -2
- package/build/dist/{lazy-b3700c07.js.map → lazy-011b9f6a.js.map} +1 -1
- package/build/dist/semioticGraph-8420345d.js +2 -0
- package/build/dist/{semioticGraph-552b48d5.js.map → semioticGraph-8420345d.js.map} +1 -1
- package/package.json +4 -4
- package/build/dist/index-8a3ef7a0.js +0 -2
- package/build/dist/index-8a3ef7a0.js.map +0 -1
- package/build/dist/semioticGraph-552b48d5.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e,{module as t}from"angular";import{SETTINGS as n,REST as r,ReactInjector as a,ApplicationDataSourceRegistry as o,HelpContentsRegistry as i,withErrorBoundary as s,HelpField as c,noop as l,AccountService as u,AppListExtractor as p,NameUtils as d,ProviderSelectionService as f,CloudProviderRegistry as h,OrchestratedItemTransformer as g,HoverablePopover as m,timestamp as y,CopyToClipboard as v,Registry as b,ValidationMessage as _,JsonEditor as w,DiffView as C,JsonUtils as O}from"@spinnaker/core";import{omit as S,isString as j,get as x,has as k,isEmpty as E,uniq as T,map as P,difference as N,isInteger as R,first as M,unset as A,set as L,isFinite as I,cloneDeep as D,round as q,last as $,identity as F,chain as B,without as U,flatMap as W,pick as z,fromPairs as G,isEqual as H}from"lodash";import*as K from"react";import V,{Children as J,Component as Q,createElement as Y}from"react";import*as X from"react-dom";import Z,{findDOMNode as ee}from"react-dom";import te from"prop-types";import ne from"react-select";import{Modal as re}from"react-bootstrap";const ae=n.canary||{featureDisabled:!0};function oe(e){return r("/v2/canaryConfig").path(e).get().then((t=>Object.assign(Object.assign({},t),{id:e})))}function ie(...e){return r("/v2/canaryConfig").query({application:e}).get()}function se(e){return r("/v2/canaryConfig").path(e.id).put(e)}function ce(e){return r("/v2/canaryConfig").post(e)}function le(e){return r("/v2/canaryConfig").path(e).delete()}function ue(){return r("/v2/canaries/judges").get().then((e=>e.filter((e=>e.visible))))}function pe(){return r("/v2/canaries/credentials").useCache().get()}function de(e){const{selectedConfig:t}=e;return t.config?Object.assign(Object.assign({},t.config),{judge:t.judge.judgeConfig,metrics:t.metricList.map((e=>S(e,"id"))),classifier:Object.assign(Object.assign({},t.config.classifier),{groupWeights:t.group.groupWeights})}):null}function fe(e){let t="new-config",n=1;for(;(e.data.configSummaries||[]).some((e=>e.name===t));)t=`new-config-${n}`,n++;return{name:t,applications:[e.data.application.name],description:"",isNew:!0,metrics:[],configVersion:"1",templates:{},classifier:{groupWeights:{}},judge:{name:ae.defaultJudge||"NetflixACAJudge-v1.0",judgeConfigurations:{}}}}function he(e){const t=Object.assign(Object.assign({},de(e)),{applications:[e.data.application.name]});if(!t)return null;let n=`${t.name}-copy`,r=1;for(;(e.data.configSummaries||[]).some((e=>e.name===n));)n=`${t.name}-copy-${r}`,r++;return S(Object.assign(Object.assign({},t),{name:n,isNew:!0}),"id")}const ge=(e,t)=>r("/v2/canaries/canary").path(e,t).query({storageAccountName:ae.storageAccountName}).useCache().get().then((n=>{var r;const{config:a}=n;return a.id=e,n.id=t,null===(r=n.result)||void 0===r||r.judgeResult.results.sort(((e,t)=>e.name.localeCompare(t.name))),n})),me=(e,t,n={})=>r("/v2/canaries/canary").path(e).query(n).post(t),ye=(e,t)=>r("/v2/canaries/metricSetPairList").path(e).query({storageAccountName:ae.storageAccountName}).useCache().get().then((e=>e.find((e=>e.id===t)))),ve=e=>{const t=a.$stateParams.count||20;return r("/v2/canaries").path(e,"executions").query({limit:t}).get()},be=(e,t)=>{const n=(e||"").toLowerCase(),r=(t||"").toLowerCase();return"unhealthy"===n?"unhealthy":"success"===r?"healthy":"failure"===r?"failing":"unknown"},_e={loadCanaryExecutions:e=>ve(e.name),afterConfigsLoaded:e=>{},afterJudgesLoaded:e=>{},afterCanaryExecutionsLoaded:e=>{}};const we={"pipeline.config.canary.analysisType":"\n <p>\n <strong>Real Time</strong> analysis will be performed\n over a time interval beginning at the moment of execution.\n <ul>\n <li>\n <strong>Automatic:</strong> Spinnaker will provision and clean up the baseline and canary server groups. Not all cloud providers support this mode.\n </li>\n <li>\n <strong>Manual:</strong> You are responsible for provisioning and cleaning up the baseline and canary server groups.\n </li>\n </ul>\n </p>\n <p>\n <strong>Retrospective</strong> analysis will be performed over an explicitly-specified time\n interval (likely in the past). You are responsible for provisioning and cleaning up\n the baseline and canary server groups.\n </p>\n ","pipeline.config.canary.delayBeforeAnalysis":"<p>The number of minutes until the first canary analysis measurement interval begins.</p>","pipeline.config.canary.baselineAnalysisOffset":"<p>The offset in minutes of baseline data collection from the beginning of canary analysis. Useful for comparing metrics pre-canary for relative comparison. This field accepts SpEL</p>","pipeline.config.canary.canaryInterval":"\n <p>The frequency at which a canary score is generated. The recommended interval is at least 30 minutes.</p>\n <p>If an interval is not specified, or the specified interval is larger than the overall time range, there will be one canary run over the full time range.</p>","pipeline.config.canary.successfulScore":"<p>The minimum score the canary must achieve to be considered successful.</p>","pipeline.config.canary.unhealthyScore":"<p>The lowest score the canary can attain before it is aborted and disabled as a failure.</p>","pipeline.config.canary.baselineGroup":"<p>The server group to treat as the <em>control</em> in the canary analysis.</p>","pipeline.config.canary.baselineLocation":"<p>The location (could be a region, a namespace, or something else) of the server group to treat as the <em>control</em> in the canary analysis.</p>","pipeline.config.canary.canaryGroup":"<p>The server group to treat as the <em>experiment</em> in the canary analysis.</p>","pipeline.config.canary.canaryLocation":"<p>The location (could be a region, a namespace, or something else) of the server group to treat as the <em>experiment</em> in the canary analysis.</p>","pipeline.config.canary.startTimeIso":'<p>The overall start time of the data points to be retrieved, specified as a UTC instant using <a target="_" href="https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html#ISO_INSTANT">ISO-8601 instant format.</a> For example, `2018-07-12T20:28:29Z`.</p>',"pipeline.config.canary.endTimeIso":'<p>The overall end time of the data points to be retrieved, specified as a UTC instant using <a target="_" href="https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html#ISO_INSTANT">ISO-8601 instant format.</a> For example, `2018-07-12T22:28:29Z`.</p>',"pipeline.config.canary.extendedScopeParams":"\n <p>Metric source specific parameters which may be used to further alter the canary scope.</p>\n <p>Also used to provide variable bindings for use in the expansion of custom filter templates within the canary config.</p>","pipeline.config.canary.lookback":"<p>With an analysis type of <strong>Growing</strong>, the entire duration of the canary will be considered during the analysis.</p><p>When choosing <strong>Sliding</strong>, the canary will use the most recent number of specified minutes for its analysis report (<b>useful for long running canaries that span multiple days</b>).</p>","pipeline.config.canary.delayBeforeCleanup":"<p>The total time after canary analysis ends before canary cluster cleanup begins. Allows for manual inspection of instances.</p>","pipeline.config.canary.marginalScore":"\n <p>A canary stage can include multiple canary runs.</p>\n <p>If a given canary run score is less than or equal to the marginal threshold, the canary stage will fail immediately.</p>\n <p>If the canary run score is greater than the marginal threshold, the canary stage will not fail and will execute the remaining downstream canary runs.</p>","pipeline.config.canary.passingScore":"<p>When all canary runs in a stage have executed, a canary stage is considered a success if the final (that is, the latest) canary run score is greater than or equal to the pass threshold. Otherwise, it is a failure.</p>","pipeline.config.canary.lifetime":"\n <p>The total time for which data will be collected and analyzed during this stage.</p>\n ","pipeline.config.canary.legacySiteLocalRecipients":"<p>Email addresses to be notified when a canary report completes, separated by commas.</p>","pipeline.config.metricsAccount":"<p>The account to be used to access the metric store defined in this stage's canary config.</p>","pipeline.config.storageAccount":"<p>The account to be used to access a storage service, which will be used to store artifacts generated by this stage.</p>","canary.config.metricGroupWeights":"\n <p>A canary score is the weighted sum of metric group scores.</p>\n <p>Group weights must sum to 100.</p>\n ","canary.config.nanStrategy":"\n <p>When there is no value for a metric at a given point in time, it can either be ignored or assumed to be zero. The right choice depends on what is being measured. For example, when measuring successful attempts (like health checks) replacing missing values with zero may be appropriate.</p>\n <p>The default strategy for a given metric will be used if no strategy is selected.</p>\n ","canary.config.outlierStrategy":"\n <p>When outliers are present in metric data, you can choose to either remove them or include them in the evaluation. The appropriate strategy depends on the metrics being assessed. For example, when measuring CPU or memory utilization, it might be appropriate to remove outliers that occur during startup times.</p> \n <p>If no strategy is chosen, the default strategy for the metric will be implemented.</p>\n ","canary.config.filterTemplate":"\n <p>Templates allow you to compose and parameterize advanced queries against your telemetry provider.</p>\n <p>Parameterized queries are hydrated by values provided in the canary stage. The <strong>project</strong>, <strong>resourceType</strong>, </string><strong>scope</strong>, and <strong>location</strong> variable bindings are implicitly available.</p>\n <p>For example, you can interpolate <strong>project</strong> using the following syntax: <strong>${project}</strong>.</p>\n ","canary.config.signalFx.queryPairs":"\n <p><strong>Query pairs are optional</strong></p>\n <p>Can be dimensions, properties, or tags (Use tag as key for tags).</p>\n <p>\n Example: Given a metric with name <pre>'request.count'</pre> that gets reported with dimensions uri, and stats_code. </br>\n If I added the following query pairs</br>\n <pre>{\n \"uri\": \"v1/some-endpoint\",\n \"status_code\": \"5*\"\n}</pre>\n I could make a metric that tracks the number of server errors for endpoint <pre>/v1/some-endpoint</pre>\n </p>\n <p>These k,v pairs are used to construct filters for the compiled SignalFlow program. EX:<pre>data('request.count', filters=filter('uri', 'v1/some-endpoint') and filter('status_code', '5*') and filter('version', '1.0.0') and filter('environment', 'production')).sum(by=['version', 'environment']).publish()</pre>\n Note that the version and environment would come from the canary scope and the sum method comes from the aggregation method.\n </p>\n ","canary.config.signalFx.aggregationMethod":"\n <p>This must be a method defined in the <a target=\"_blank\" href=\"https://developers.signalfx.com/reference#signalflow-stream-methods-1\">SignalFlow Stream Methods</a> that supports aggregation</p>\n <p>These are methods such as min, max, sum, mean and are documented with supporting the <strong>'by'</strong> keyword, ex: <pre>sum(by=['version', 'environment'])</pre></p>\n <p>Simply put the name of the method that should be used in this field such as sum, Kayenta will populate the by clauses using the canary scope filter keys</p>\n <p>This method is used to construct the compiled SignalFlow program. EX:<pre>data('request.count', filters=filter('uri', 'v1/some-endpoint') and filter('status_code', '5*') and filter('version', '1.0.0') and filter('environment', 'production')).sum(by=['version', 'environment']).publish()</pre>\n Note that the version and environment k,v pairs are sourced from the canary scope. The other k,v pairs come from the metric specific k,v pair list.\n </p>\n ","canary.config.prometheus.queryType":'\n <p>Select <strong>default</strong> to use options from the UI to configure your query.</p>\n <p>Select <strong>PromQL</strong> to compose a custom PromQL query (see <a target="blank" href="https://prometheus.io/docs/prometheus/latest/querying/basics/">documentation</a>).</p>\n ',"canary.config.effectSize.cles":'\n <p>\n The Common Language Effect Size (CLES) reports the probability that a value from one group will be greater than a\n value from the other group.\n </p>\n <p>A value of 0.50 indicates that the two groups are stochastically equal.</p>\n <p>A value of 1 indicates that the first group shows complete stochastic domination over the other group, and a\n value of 0 indicates the complete stochastic domination by the second group.\n </p>\n <p>\n <a href="https://en.wikipedia.org/wiki/Mann%E2%80%93Whitney_U_test#Common_language_effect_size" target="_blank">Read more about CLES</a>.\n </p>\n ',"stackdriver.resourceType":"For Stackdriver, a set of time series is identified by a <strong>resource type</strong> and a metric type that has data from that resource type.","stackdriver.metricType":"For Stackdriver, a set of time series is identified by a resource type and a <strong>metric type</strong> that has data from that resource type.","stackdriver.groupBy":"Group by resource or metric labels to reduce the number of time series.","stackdriver.crossSeriesReducer":"Use an algorithm to group multiple time series together.","stackdriver.perSeriesAligner":"Use an algorithm to align individual time series."};Object.keys(we).forEach((e=>i.register(e,we[e])));var Ce="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Oe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Se(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}function je(e){var t={exports:{}};return e(t,t.exports),t.exports}var xe=function(e){for(var t=-1,n=e?e.length:0,r={};++t<n;){var a=e[t];r[a[0]]=a[1]}return r},ke="object"==typeof Ce&&Ce&&Ce.Object===Object&&Ce,Ee="object"==typeof self&&self&&self.Object===Object&&self,Te=ke||Ee||Function("return this")(),Pe=Te.Symbol,Ne=Object.prototype,Re=Ne.hasOwnProperty,Me=Ne.toString,Ae=Pe?Pe.toStringTag:void 0;var Le=function(e){var t=Re.call(e,Ae),n=e[Ae];try{e[Ae]=void 0;var r=!0}catch(e){}var a=Me.call(e);return r&&(t?e[Ae]=n:delete e[Ae]),a},Ie=Object.prototype.toString;var De=function(e){return Ie.call(e)},qe=Pe?Pe.toStringTag:void 0;var $e=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":qe&&qe in Object(e)?Le(e):De(e)};var Fe=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var Be=function(e){if(!Fe(e))return!1;var t=$e(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Ue=Te["__core-js_shared__"],We=function(){var e=/[^.]+$/.exec(Ue&&Ue.keys&&Ue.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var ze=function(e){return!!We&&We in e},Ge=Function.prototype.toString;var He=function(e){if(null!=e){try{return Ge.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Ke=/^\[object .+?Constructor\]$/,Ve=Function.prototype,Je=Object.prototype,Qe=Ve.toString,Ye=Je.hasOwnProperty,Xe=RegExp("^"+Qe.call(Ye).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Ze=function(e){return!(!Fe(e)||ze(e))&&(Be(e)?Xe:Ke).test(He(e))};var et=function(e,t){return null==e?void 0:e[t]};var tt=function(e,t){var n=et(e,t);return Ze(n)?n:void 0},nt=function(){try{var e=tt(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),rt=nt;var at=function(e,t,n){"__proto__"==t&&rt?rt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var ot=function(e,t){return e===t||e!=e&&t!=t},it=Object.prototype.hasOwnProperty;var st=function(e,t,n){var r=e[t];it.call(e,t)&&ot(r,n)&&(void 0!==n||t in e)||at(e,t,n)};var ct=function(e,t,n,r){var a=!n;n||(n={});for(var o=-1,i=t.length;++o<i;){var s=t[o],c=r?r(n[s],e[s],s,n,e):void 0;void 0===c&&(c=e[s]),a?at(n,s,c):st(n,s,c)}return n};var lt=function(e){return e};var ut=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},pt=Math.max;var dt=function(e,t,n){return t=pt(void 0===t?e.length-1:t,0),function(){for(var r=arguments,a=-1,o=pt(r.length-t,0),i=Array(o);++a<o;)i[a]=r[t+a];a=-1;for(var s=Array(t+1);++a<t;)s[a]=r[a];return s[t]=n(i),ut(e,this,s)}};var ft=function(e){return function(){return e}},ht=rt?function(e,t){return rt(e,"toString",{configurable:!0,enumerable:!1,value:ft(t),writable:!0})}:lt,gt=ht,mt=Date.now;var yt=function(e){var t=0,n=0;return function(){var r=mt(),a=16-(r-n);if(n=r,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}},vt=yt(gt);var bt=function(e,t){return vt(dt(e,t,lt),e+"")};var _t=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var wt=function(e){return null!=e&&_t(e.length)&&!Be(e)},Ct=/^(?:0|[1-9]\d*)$/;var Ot=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Ct.test(e))&&e>-1&&e%1==0&&e<t};var St=function(e,t,n){if(!Fe(n))return!1;var r=typeof t;return!!("number"==r?wt(n)&&Ot(t,n.length):"string"==r&&t in n)&&ot(n[t],e)};var jt=function(e){return bt((function(t,n){var r=-1,a=n.length,o=a>1?n[a-1]:void 0,i=a>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(a--,o):void 0,i&&St(n[0],n[1],i)&&(o=a<3?void 0:o,a=1),t=Object(t);++r<a;){var s=n[r];s&&e(t,s,r,o)}return t}))},xt=Object.prototype;var kt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||xt)};var Et=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};var Tt=function(e){return null!=e&&"object"==typeof e};var Pt=function(e){return Tt(e)&&"[object Arguments]"==$e(e)},Nt=Object.prototype,Rt=Nt.hasOwnProperty,Mt=Nt.propertyIsEnumerable,At=Pt(function(){return arguments}())?Pt:function(e){return Tt(e)&&Rt.call(e,"callee")&&!Mt.call(e,"callee")},Lt=Array.isArray;var It=function(){return!1},Dt=je((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,a=r&&r.exports===n?Te.Buffer:void 0,o=(a?a.isBuffer:void 0)||It;e.exports=o})),qt={};qt["[object Float32Array]"]=qt["[object Float64Array]"]=qt["[object Int8Array]"]=qt["[object Int16Array]"]=qt["[object Int32Array]"]=qt["[object Uint8Array]"]=qt["[object Uint8ClampedArray]"]=qt["[object Uint16Array]"]=qt["[object Uint32Array]"]=!0,qt["[object Arguments]"]=qt["[object Array]"]=qt["[object ArrayBuffer]"]=qt["[object Boolean]"]=qt["[object DataView]"]=qt["[object Date]"]=qt["[object Error]"]=qt["[object Function]"]=qt["[object Map]"]=qt["[object Number]"]=qt["[object Object]"]=qt["[object RegExp]"]=qt["[object Set]"]=qt["[object String]"]=qt["[object WeakMap]"]=!1;var $t=function(e){return Tt(e)&&_t(e.length)&&!!qt[$e(e)]};var Ft=function(e){return function(t){return e(t)}},Bt=je((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,a=r&&r.exports===n&&ke.process,o=function(){try{var e=r&&r.require&&r.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=o})),Ut=Bt&&Bt.isTypedArray,Wt=Ut?Ft(Ut):$t,zt=Object.prototype.hasOwnProperty;var Gt=function(e,t){var n=Lt(e),r=!n&&At(e),a=!n&&!r&&Dt(e),o=!n&&!r&&!a&&Wt(e),i=n||r||a||o,s=i?Et(e.length,String):[],c=s.length;for(var l in e)!t&&!zt.call(e,l)||i&&("length"==l||a&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Ot(l,c))||s.push(l);return s};var Ht=function(e,t){return function(n){return e(t(n))}},Kt=Ht(Object.keys,Object),Vt=Object.prototype.hasOwnProperty;var Jt=function(e){if(!kt(e))return Kt(e);var t=[];for(var n in Object(e))Vt.call(e,n)&&"constructor"!=n&&t.push(n);return t};var Qt=function(e){return wt(e)?Gt(e):Jt(e)},Yt=Object.prototype.hasOwnProperty,Xt=jt((function(e,t){if(kt(t)||wt(t))ct(t,Qt(t),e);else for(var n in t)Yt.call(t,n)&&st(e,n,t[n])})),Zt=Xt;var en=function(e){return function(t,n,r){for(var a=-1,o=Object(t),i=r(t),s=i.length;s--;){var c=i[e?s:++a];if(!1===n(o[c],c,o))break}return t}},tn=en();var nn=function(e,t){return e&&tn(e,t,Qt)};var rn=function(){this.__data__=[],this.size=0};var an=function(e,t){for(var n=e.length;n--;)if(ot(e[n][0],t))return n;return-1},on=Array.prototype.splice;var sn=function(e){var t=this.__data__,n=an(t,e);return!(n<0)&&(n==t.length-1?t.pop():on.call(t,n,1),--this.size,!0)};var cn=function(e){var t=this.__data__,n=an(t,e);return n<0?void 0:t[n][1]};var ln=function(e){return an(this.__data__,e)>-1};var un=function(e,t){var n=this.__data__,r=an(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function pn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}pn.prototype.clear=rn,pn.prototype.delete=sn,pn.prototype.get=cn,pn.prototype.has=ln,pn.prototype.set=un;var dn=pn;var fn=function(){this.__data__=new dn,this.size=0};var hn=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var gn=function(e){return this.__data__.get(e)};var mn=function(e){return this.__data__.has(e)},yn=tt(Te,"Map"),vn=tt(Object,"create");var bn=function(){this.__data__=vn?vn(null):{},this.size=0};var _n=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},wn=Object.prototype.hasOwnProperty;var Cn=function(e){var t=this.__data__;if(vn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return wn.call(t,e)?t[e]:void 0},On=Object.prototype.hasOwnProperty;var Sn=function(e){var t=this.__data__;return vn?void 0!==t[e]:On.call(t,e)};var jn=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=vn&&void 0===t?"__lodash_hash_undefined__":t,this};function xn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}xn.prototype.clear=bn,xn.prototype.delete=_n,xn.prototype.get=Cn,xn.prototype.has=Sn,xn.prototype.set=jn;var kn=xn;var En=function(){this.size=0,this.__data__={hash:new kn,map:new(yn||dn),string:new kn}};var Tn=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Pn=function(e,t){var n=e.__data__;return Tn(t)?n["string"==typeof t?"string":"hash"]:n.map};var Nn=function(e){var t=Pn(this,e).delete(e);return this.size-=t?1:0,t};var Rn=function(e){return Pn(this,e).get(e)};var Mn=function(e){return Pn(this,e).has(e)};var An=function(e,t){var n=Pn(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Ln(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ln.prototype.clear=En,Ln.prototype.delete=Nn,Ln.prototype.get=Rn,Ln.prototype.has=Mn,Ln.prototype.set=An;var In=Ln;var Dn=function(e,t){var n=this.__data__;if(n instanceof dn){var r=n.__data__;if(!yn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new In(r)}return n.set(e,t),this.size=n.size,this};function qn(e){var t=this.__data__=new dn(e);this.size=t.size}qn.prototype.clear=fn,qn.prototype.delete=hn,qn.prototype.get=gn,qn.prototype.has=mn,qn.prototype.set=Dn;var $n=qn;var Fn=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};var Bn=function(e){return this.__data__.has(e)};function Un(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new In;++t<n;)this.add(e[t])}Un.prototype.add=Un.prototype.push=Fn,Un.prototype.has=Bn;var Wn=Un;var zn=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};var Gn=function(e,t){return e.has(t)};var Hn=function(e,t,n,r,a,o){var i=1&n,s=e.length,c=t.length;if(s!=c&&!(i&&c>s))return!1;var l=o.get(e),u=o.get(t);if(l&&u)return l==t&&u==e;var p=-1,d=!0,f=2&n?new Wn:void 0;for(o.set(e,t),o.set(t,e);++p<s;){var h=e[p],g=t[p];if(r)var m=i?r(g,h,p,t,e,o):r(h,g,p,e,t,o);if(void 0!==m){if(m)continue;d=!1;break}if(f){if(!zn(t,(function(e,t){if(!Gn(f,t)&&(h===e||a(h,e,n,r,o)))return f.push(t)}))){d=!1;break}}else if(h!==g&&!a(h,g,n,r,o)){d=!1;break}}return o.delete(e),o.delete(t),d},Kn=Te.Uint8Array;var Vn=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n};var Jn=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},Qn=Pe?Pe.prototype:void 0,Yn=Qn?Qn.valueOf:void 0;var Xn=function(e,t,n,r,a,o,i){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new Kn(e),new Kn(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ot(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=Vn;case"[object Set]":var c=1&r;if(s||(s=Jn),e.size!=t.size&&!c)return!1;var l=i.get(e);if(l)return l==t;r|=2,i.set(e,t);var u=Hn(s(e),s(t),r,a,o,i);return i.delete(e),u;case"[object Symbol]":if(Yn)return Yn.call(e)==Yn.call(t)}return!1};var Zn=function(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e};var er=function(e,t,n){var r=t(e);return Lt(e)?r:Zn(r,n(e))};var tr=function(e,t){for(var n=-1,r=null==e?0:e.length,a=0,o=[];++n<r;){var i=e[n];t(i,n,e)&&(o[a++]=i)}return o};var nr=function(){return[]},rr=Object.prototype.propertyIsEnumerable,ar=Object.getOwnPropertySymbols,or=ar?function(e){return null==e?[]:(e=Object(e),tr(ar(e),(function(t){return rr.call(e,t)})))}:nr,ir=or;var sr=function(e){return er(e,Qt,ir)},cr=Object.prototype.hasOwnProperty;var lr=function(e,t,n,r,a,o){var i=1&n,s=sr(e),c=s.length;if(c!=sr(t).length&&!i)return!1;for(var l=c;l--;){var u=s[l];if(!(i?u in t:cr.call(t,u)))return!1}var p=o.get(e),d=o.get(t);if(p&&d)return p==t&&d==e;var f=!0;o.set(e,t),o.set(t,e);for(var h=i;++l<c;){var g=e[u=s[l]],m=t[u];if(r)var y=i?r(m,g,u,t,e,o):r(g,m,u,e,t,o);if(!(void 0===y?g===m||a(g,m,n,r,o):y)){f=!1;break}h||(h="constructor"==u)}if(f&&!h){var v=e.constructor,b=t.constructor;v==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof b&&b instanceof b||(f=!1)}return o.delete(e),o.delete(t),f},ur=tt(Te,"DataView"),pr=tt(Te,"Promise"),dr=tt(Te,"Set"),fr=tt(Te,"WeakMap"),hr=He(ur),gr=He(yn),mr=He(pr),yr=He(dr),vr=He(fr),br=$e;(ur&&"[object DataView]"!=br(new ur(new ArrayBuffer(1)))||yn&&"[object Map]"!=br(new yn)||pr&&"[object Promise]"!=br(pr.resolve())||dr&&"[object Set]"!=br(new dr)||fr&&"[object WeakMap]"!=br(new fr))&&(br=function(e){var t=$e(e),n="[object Object]"==t?e.constructor:void 0,r=n?He(n):"";if(r)switch(r){case hr:return"[object DataView]";case gr:return"[object Map]";case mr:return"[object Promise]";case yr:return"[object Set]";case vr:return"[object WeakMap]"}return t});var _r=br,wr=Object.prototype.hasOwnProperty;var Cr=function(e,t,n,r,a,o){var i=Lt(e),s=Lt(t),c=i?"[object Array]":_r(e),l=s?"[object Array]":_r(t),u="[object Object]"==(c="[object Arguments]"==c?"[object Object]":c),p="[object Object]"==(l="[object Arguments]"==l?"[object Object]":l),d=c==l;if(d&&Dt(e)){if(!Dt(t))return!1;i=!0,u=!1}if(d&&!u)return o||(o=new $n),i||Wt(e)?Hn(e,t,n,r,a,o):Xn(e,t,c,n,r,a,o);if(!(1&n)){var f=u&&wr.call(e,"__wrapped__"),h=p&&wr.call(t,"__wrapped__");if(f||h){var g=f?e.value():e,m=h?t.value():t;return o||(o=new $n),a(g,m,n,r,o)}}return!!d&&(o||(o=new $n),lr(e,t,n,r,a,o))};var Or=function e(t,n,r,a,o){return t===n||(null==t||null==n||!Tt(t)&&!Tt(n)?t!=t&&n!=n:Cr(t,n,r,a,e,o))};var Sr=function(e,t,n,r){var a=n.length,o=a,i=!r;if(null==e)return!o;for(e=Object(e);a--;){var s=n[a];if(i&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++a<o;){var c=(s=n[a])[0],l=e[c],u=s[1];if(i&&s[2]){if(void 0===l&&!(c in e))return!1}else{var p=new $n;if(r)var d=r(l,u,c,e,t,p);if(!(void 0===d?Or(u,l,3,r,p):d))return!1}}return!0};var jr=function(e){return e==e&&!Fe(e)};var xr=function(e){for(var t=Qt(e),n=t.length;n--;){var r=t[n],a=e[r];t[n]=[r,a,jr(a)]}return t};var kr=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}};var Er=function(e){var t=xr(e);return 1==t.length&&t[0][2]?kr(t[0][0],t[0][1]):function(n){return n===e||Sr(n,e,t)}};var Tr=function(e){return"symbol"==typeof e||Tt(e)&&"[object Symbol]"==$e(e)},Pr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Nr=/^\w*$/;var Rr=function(e,t){if(Lt(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Tr(e))||(Nr.test(e)||!Pr.test(e)||null!=t&&e in Object(t))};function Mr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var i=e.apply(this,r);return n.cache=o.set(a,i)||o,i};return n.cache=new(Mr.Cache||In),n}Mr.Cache=In;var Ar=Mr;var Lr=function(e){var t=Ar(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t},Ir=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dr=/\\(\\)?/g,qr=Lr((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ir,(function(e,n,r,a){t.push(r?a.replace(Dr,"$1"):n||e)})),t})),$r=qr;var Fr=function(e,t){for(var n=-1,r=null==e?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a},Br=Pe?Pe.prototype:void 0,Ur=Br?Br.toString:void 0;var Wr=function e(t){if("string"==typeof t)return t;if(Lt(t))return Fr(t,e)+"";if(Tr(t))return Ur?Ur.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n};var zr=function(e){return null==e?"":Wr(e)};var Gr=function(e,t){return Lt(e)?e:Rr(e,t)?[e]:$r(zr(e))};var Hr=function(e){if("string"==typeof e||Tr(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};var Kr=function(e,t){for(var n=0,r=(t=Gr(t,e)).length;null!=e&&n<r;)e=e[Hr(t[n++])];return n&&n==r?e:void 0};var Vr=function(e,t,n){var r=null==e?void 0:Kr(e,t);return void 0===r?n:r};var Jr=function(e,t){return null!=e&&t in Object(e)};var Qr=function(e,t,n){for(var r=-1,a=(t=Gr(t,e)).length,o=!1;++r<a;){var i=Hr(t[r]);if(!(o=null!=e&&n(e,i)))break;e=e[i]}return o||++r!=a?o:!!(a=null==e?0:e.length)&&_t(a)&&Ot(i,a)&&(Lt(e)||At(e))};var Yr=function(e,t){return null!=e&&Qr(e,t,Jr)};var Xr=function(e,t){return Rr(e)&&jr(t)?kr(Hr(e),t):function(n){var r=Vr(n,e);return void 0===r&&r===t?Yr(n,e):Or(t,r,3)}};var Zr=function(e){return function(t){return null==t?void 0:t[e]}};var ea=function(e){return function(t){return Kr(t,e)}};var ta=function(e){return Rr(e)?Zr(Hr(e)):ea(e)};var na=function(e){return"function"==typeof e?e:null==e?lt:"object"==typeof e?Lt(e)?Xr(e[0],e[1]):Er(e):ta(e)};var ra=function(e,t){var n={};return t=na(t),nn(e,(function(e,r,a){at(n,r,t(e,r,a))})),n};var aa=function(e,t){return function(n,r){if(null==n)return n;if(!wt(n))return e(n,r);for(var a=n.length,o=t?a:-1,i=Object(n);(t?o--:++o<a)&&!1!==r(i[o],o,i););return n}}(nn);var oa=function(e,t){var n;return aa(e,(function(e,r,a){return!(n=t(e,r,a))})),!!n};var ia,sa=function(e,t,n){var r=Lt(e)?zn:oa;return n&&St(e,t,n)&&(t=void 0),r(e,na(t))},ca=function(){function e(){this.__isFirstRender=!0,this.state={},this.props={}}return e.prototype.$onChanges=function(e){var t=this.props,n=ra(e,"currentValue"),r=Zt({},this.props,n);if(this.__isFirstRender)Zt(this,{props:r}),this.componentWillMount(),this.render(),this.__isFirstRender=!1;else{if(!this.didPropsChange(n,t))return;this.componentWillReceiveProps(r);var a=this.shouldComponentUpdate(r,this.state);if(Zt(this,{props:r}),!a)return;this.componentWillUpdate(this.props,this.state),this.render(),this.componentDidUpdate(this.props,this.state)}},e.prototype.$postLink=function(){this.componentDidMount()},e.prototype.$onDestroy=function(){this.componentWillUnmount()},e.prototype.didPropsChange=function(e,t){return sa(e,(function(e,n){return e!==t[n]}))},e.prototype.componentWillMount=function(){},e.prototype.componentDidMount=function(){},e.prototype.componentWillReceiveProps=function(e){},e.prototype.shouldComponentUpdate=function(e,t){return!0},e.prototype.componentWillUpdate=function(e,t){},e.prototype.componentDidUpdate=function(e,t){},e.prototype.componentWillUnmount=function(){},e.prototype.render=function(){},e}(),la=Object.defineProperty({default:ca},"__esModule",{value:!0}),ua=Ce&&Ce.__extends||(ia=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}ia(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),pa=Ce&&Ce.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e};var da=function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=[]);var r=t||e.propTypes&&Object.keys(e.propTypes)||[];return{bindings:xe(r.map((function(e){return[e,"<"]}))),controller:["$element"].concat(n,[function(t){function r(e){for(var r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];var o=t.call(this)||this;return o.$element=e,o.injectedProps={},n.forEach((function(e,t){o.injectedProps[e]=r[t]})),o}return ua(r,t),r.prototype.render=function(){Z.render(V.createElement(e,pa({},this.injectedProps,this.props)),this.$element[0])},r.prototype.componentWillUnmount=function(){Z.unmountComponentAtNode(this.$element[0])},r}(la.default)])}},fa=je((function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var a=arguments[r];if(a){var o=typeof a;if("string"===o||"number"===o)e.push(a);else if(Array.isArray(a))e.push(n.apply(null,a));else if("object"===o)for(var i in a)t.call(a,i)&&a[i]&&e.push(i)}}return e.join(" ")}e.exports?e.exports=n:window.classNames=n}()}));function ha(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}ha(".score.score-label {\n font-size: 110%;\n padding: 3px 6px;\n display: inline-block;\n height: 20px;\n line-height: 14px;\n color: white;\n}\n.score.score-label.inverse {\n padding: 0;\n}\n.score.score-label.label-failing {\n background-color: var(--color-alert-light);\n}\n.score.score-label.label-failing.inverse {\n color: var(--color-alert-light);\n}\n.score.score-label.label-healthy {\n background-color: var(--color-success);\n}\n.score.score-label.label-healthy.inverse {\n color: var(--color-success);\n}\n.score.score-label.label-unhealthy {\n background-color: var(--color-danger);\n}\n.score.score-label.label-unhealthy.inverse {\n color: var(--color-danger);\n}\n.score.score-label.label-unknown {\n background-color: var(--color-text-caption);\n}\n.score.score-label.label-unknown.inverse {\n color: var(--color-text-caption);\n}\n.score.score-label.inverse {\n background-color: transparent;\n font-size: 100%;\n padding: 0;\n}\n.score.score-label .score-classification {\n font-size: 45%;\n display: block;\n margin-top: 15px;\n font-weight: 400;\n text-transform: uppercase;\n}\n.score-large.score {\n height: 48px;\n}\n.score-large .score.score-label {\n height: auto;\n line-height: 48px;\n padding: 0 10px;\n font-size: 28px;\n font-weight: bold;\n margin: 0;\n border-radius: 0;\n display: inline-block;\n}\n.score.score-report {\n align-items: center;\n padding: 12px 12px 6px;\n font-size: 28px;\n font-weight: bold;\n margin-bottom: 10px;\n height: 100%;\n}\n.table-row .score.score-report {\n display: inline-block;\n}\n");class ga extends K.Component{constructor(e){super(e),this.state=this.getLabelState(e)}getLabelState(e){return{score:0===e.score||e.score&&e.score>0?e.score:"N/A",healthLabel:be(e.health,e.result)}}componentWillReceiveProps(e){this.setState(this.getLabelState(e))}render(){const e=[this.props.inverse?"inverse":"","score","score-label","label-default",`label-${this.state.healthLabel}`].join(" ");return K.createElement("span",{className:fa(e,this.props.className)},this.state.score,this.props.classification&&K.createElement("span",{className:"score-classification"},this.props.classification.toString()))}}ga.defaultProps={health:""};t("spinnaker.kayenta.score.component",[]).component("kayentaCanaryScore",da(s(ga,"kayentaCanaryScore"),["score","health","result","inverse"]));function ma(e){const[t,n]=K.useState(!!e.successfulScore),[r,a]=K.useState(!!e.unhealthyScore),{successfulScore:o,unhealthyScore:i}=e,s=e=>j(e)&&e.includes("${"),l=s(i)||s(o);let u,p;l||(u=Number(o),p=Number(i));const d={successful:"",unhealthy:""};t&&(u<=0&&(d.successful="Must be positive"),u>=100&&(d.successful="Must be less than 100")),r&&(p<=0&&(d.unhealthy="Must be positive"),p>=100&&(d.unhealthy="Must be less than 100")),t&&r&&u<=p&&(d.successful=`Must be greater than ${e.unhealthyLabel}`);const f=!(u&&p);return K.createElement("div",null,l&&K.createElement("div",{className:"form-group"},K.createElement("div",{className:"col-md-2 col-md-offset-1 sm-label-right"},"Canary Scores"),K.createElement("div",{className:"col-md-9 form-control-static"},"Expressions are currently being used for canary scores.")),!l&&K.createElement("div",{className:"canary-score"},K.createElement("div",{className:"form-group"},K.createElement("div",{className:"col-md-2 col-md-offset-1 sm-label-right"},e.unhealthyLabel||"Unhealthy Score ",K.createElement(c,{id:e.unhealthyHelpFieldId||"pipeline.config.canary.unhealthyScore"})),K.createElement("div",{className:"col-md-2"},K.createElement("input",{type:"number",required:!0,disabled:e.disabled,onBlur:()=>a(!0),value:Number.isNaN(p)?"":p,onChange:t=>{e.onChange({successfulScore:o,unhealthyScore:t.target.value})},className:fa("form-control","input-sm",{"ng-invalid":!!d.unhealthy,"ng-invalid-validate-min":!!d.unhealthy})}),d.unhealthy&&K.createElement("div",{className:"error-message"},d.unhealthy)),K.createElement("div",{className:"col-md-2 col-md-offset-1 sm-label-right"},e.successfulLabel||"Successful Score ",K.createElement(c,{id:e.successfulHelpFieldId||"pipeline.config.canary.successfulScore"})),K.createElement("div",{className:"col-md-2"},K.createElement("input",{type:"number",required:!0,disabled:e.disabled,onBlur:()=>n(!0),value:Number.isNaN(u)?"":u,onChange:t=>{e.onChange({successfulScore:t.target.value,unhealthyScore:i})},className:fa("form-control","input-sm",{"ng-invalid":!!d.successful,"ng-invalid-validate-max":!!d.successful})}),d.successful&&K.createElement("div",{className:"error-message"},d.successful))),K.createElement("div",{className:"row"},K.createElement("div",{className:"col-md-offset-1 col-md-10"},K.createElement("div",{className:"progress"},K.createElement("div",{className:"progress-bar progress-bar-danger",style:{width:`${f?0:p}%`}}),K.createElement("div",{className:"progress-bar progress-bar-warning",style:{width:(f?0:100-(p+(100-u)))+"%"}}),K.createElement("div",{className:"progress-bar progress-bar-success",style:{width:(f?0:100-u)+"%"}}),K.createElement("div",{className:"progress-bar progress-bar-warning",style:{width:(f?100:0)+"%"}}))))))}ha("div.canary-score div.progress {\n border-radius: 0;\n box-shadow: none;\n -webkit-box-shadow: none;\n height: 10px;\n margin: 20px 0 10px;\n}\ndiv.canary-score div.progress-bar {\n box-shadow: none;\n -webkit-box-shadow: none;\n}\ndiv.canary-score div.progress-bar-danger {\n background-color: var(--color-danger);\n}\ndiv.canary-score div.progress-bar.progress-bar-warning {\n background-color: var(--color-alto);\n}\ndiv.canary-score div.progress-bar.progress-bar-success {\n background-color: var(--color-success-light);\n}\n");var ya;t("spinnaker.kayenta.canaryScores.component",[]).component("kayentaCanaryScores",da(s(ma,"kayentaCanaryScores"),["onChange","successfulHelpFieldId","successfulLabel","successfulScore","unhealthyHelpFieldId","unhealthyLabel","unhealthyScore"])),function(e){e.MetricsStore="METRICS_STORE",e.ObjectStore="OBJECT_STORE",e.ConfigurationStore="CONFIGURATION_STORE"}(ya||(ya={}));const va="no-parent-pipeline-execution";var ba,_a,wa;!function(e){e.RealTimeAutomatic="realTimeAutomatic",e.RealTime="realTime",e.Retrospective="retrospective"}(ba||(ba={})),function(e){e.Pass="Pass",e.High="High",e.Low="Low",e.Nodata="Nodata",e.NodataFailMetric="NodataFailMetric",e.Error="Error"}(_a||(_a={})),function(e){e.Pass="Pass",e.Marginal="Marginal",e.Fail="Fail",e.Nodata="Nodata",e.Error="Error"}(wa||(wa={}));const Ca=()=>K.createElement("div",{className:"alert alert-warning"},"The analysis type you've selected isn't supported by any of this application's cloud providers. Please select a different type."),Oa=({selectedType:e,analysisTypes:t,onChange:n=l,label:r,type:a})=>t.includes(a)?K.createElement("div",{className:"radio"},K.createElement("label",null,K.createElement("input",{type:"radio",name:"analysisType",checked:e===a,onChange:()=>n(a)}),r)):null;t("spinnaker.kayenta.analysisType.component",[]).component("kayentaAnalysisType",da(s((e=>{const{analysisTypes:t=[],selectedType:n}=e;return K.createElement(K.Fragment,null,!t.includes(n)&&K.createElement(Ca,null),K.createElement(Oa,Object.assign({},e,{label:"Real Time (Automatic)",type:ba.RealTimeAutomatic})),K.createElement(Oa,Object.assign({},e,{label:"Real Time (Manual)",type:ba.RealTime})),K.createElement(Oa,Object.assign({},e,{label:"Retrospective",type:ba.Retrospective})))}),"kayentaAnalysisType"),["analysisTypes","selectedType","onChange"]));var Sa=je((function(t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.$httpProvider=void 0,n.$logProvider=void 0,n.$anchorScroll=void 0,n.$cacheFactory=void 0,n.$compile=void 0,n.$controller=void 0,n.$document=void 0,n.$exceptionHandler=void 0,n.$filter=void 0,n.$http=void 0,n.$httpBackend=void 0,n.$httpParamSerializer=void 0,n.$httpParamSerializerJQLike=void 0,n.$injector=void 0,n.$interpolate=void 0,n.$interval=void 0,n.$locale=void 0,n.$location=void 0,n.$log=void 0,n.$parse=void 0,n.$provide=void 0,n.$q=void 0,n.$rootElement=void 0,n.$rootScope=void 0,n.$sce=void 0,n.$sceDelegate=void 0,n.$templateCache=void 0,n.$templateRequest=void 0,n.$timeout=void 0,n.$window=void 0,n.$xhrFactory=void 0;var r=null;try{r=e.module("bcherny/ngimport")}catch(t){r=e.module("bcherny/ngimport",[])}r.config(["$provide","$httpProvider","$logProvider",function(e,t,r){n.$provide=e,n.$httpProvider=t,n.$logProvider=r}]),r.run(["$injector",function(e){n.$anchorScroll=e.get("$anchorScroll"),n.$cacheFactory=e.get("$cacheFactory"),n.$compile=e.get("$compile"),n.$controller=e.get("$controller"),n.$document=e.get("$document"),n.$exceptionHandler=e.get("$exceptionHandler"),n.$filter=e.get("$filter"),n.$http=e.get("$http"),n.$httpBackend=e.get("$httpBackend"),n.$httpParamSerializer=e.get("$httpParamSerializer"),n.$httpParamSerializerJQLike=e.get("$httpParamSerializerJQLike"),n.$injector=e,n.$interpolate=e.get("$interpolate"),n.$interval=e.get("$interval"),n.$locale=e.get("$locale"),n.$location=e.get("$location"),n.$log=e.get("$log"),n.$parse=e.get("$parse"),n.$q=e.get("$q"),n.$rootElement=e.get("$rootElement"),n.$rootScope=e.get("$rootScope"),n.$sce=e.get("$sce"),n.$sceDelegate=e.get("$sceDelegate"),n.$templateCache=e.get("$templateCache"),n.$templateRequest=e.get("$templateRequest"),n.$timeout=e.get("$timeout"),n.$window=e.get("$window"),n.$xhrFactory=e.get("$xhrFactory")}])}));t("spinnaker.kayenta.forAnalysisType.component",[]).component("forAnalysisType",{bindings:{types:"@",stage:"<"},controller:class{constructor(){this.showForAnalysisType=()=>(this.stage||Sa.$log.warn("No stage bound to <for-analysis-type> component"),this.types||Sa.$log.warn("No types bound to <for-analysis-type> component"),(this.types||"").split(",").map((e=>{const t=e.trim();return[ba.Retrospective,ba.RealTime,ba.RealTimeAutomatic].includes(t)||Sa.$log.warn(`${t} is not a Kayenta analysis type.`),t})).includes(this.stage.analysisType))}},transclude:!0,template:'<ng-transclude ng-if="$ctrl.showForAnalysisType()"></ng-transclude>'});const ja=e=>j(e)&&e.includes("${"),xa=/^(.+)@(.+).([A-Za-z]{2,6})/,ka=/^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(.[0-9]+)?(Z)?$/,Ea=e=>ja(e)||j(e)&&e.match(ka),Ta=(e=[],t,n)=>(r,a)=>!e.includes(a.analysisType)||k(a,t)&&""!==x(a,t)?null:`<strong>${n||t}</strong> is a required field for Kayenta Canary stages.`,Pa={label:ae.stageName||"Canary Analysis",description:ae.stageDescription||"Runs a canary task",key:"kayentaCanary",templateUrl:"./kayentaStage.html",controller:"KayentaCanaryStageCtrl",controllerAs:"kayentaCanaryStageCtrl",executionDetailsUrl:"./kayentaStageExecutionDetails.html",executionLabelComponent:({stage:e})=>{const{overallScore:t,overallResult:n}=x(e,"masterStage.context",{}),r=K.createElement(ga,{inverse:!0,score:t,result:"success"===n?n:null,health:"success"===n?null:"unhealthy"});return K.createElement("span",{className:"stage-label"},K.createElement("span",null,e.name)," (",r,")")},validators:[{type:"requiredField",fieldName:"canaryConfig.canaryConfigId",fieldLabel:"Config Name"},{type:"requiredField",fieldName:"canaryConfig.metricsAccountName",fieldLabel:"Metrics Account"},{type:"requiredField",fieldName:"canaryConfig.storageAccountName",fieldLabel:"Storage Account"},{type:"custom",validate:Ta([ba.RealTimeAutomatic],"deployments.serverGroupPairs[0].control","Baseline & Canary Server Groups")},{type:"custom",validate:Ta([ba.RealTimeAutomatic],"deployments.baseline.cluster","Baseline Cluster")},{type:"custom",validate:Ta([ba.RealTimeAutomatic],"deployments.baseline.account","Baseline Account")},{type:"custom",validate:Ta([ba.RealTime,ba.Retrospective],"canaryConfig.scopes[0].controlScope","Baseline Scope")},{type:"custom",validate:Ta([ba.RealTime,ba.Retrospective],"canaryConfig.scopes[0].experimentScope","Canary Scope")},{type:"custom",validate:Ta([ba.RealTime,ba.RealTimeAutomatic],"canaryConfig.lifetimeDuration","Lifetime")},{type:"custom",validate:Ta([ba.Retrospective],"canaryConfig.scopes[0].startTimeIso","Start Time")},{type:"custom",validate:Ta([ba.Retrospective],"canaryConfig.scopes[0].endTimeIso","End Time")},{type:"custom",validate:(e,t)=>k(t,"canaryConfig.canaryConfigId")&&t.analysisType!==ba.RealTimeAutomatic?oe(x(t,"canaryConfig.canaryConfigId")).then((e=>"atlas"!==x(e,"metrics[0].query.type")||x(t,"canaryConfig.scopes[0].extendedScopeParams.type")?null:"Scope Type is required")):null},{type:"custom",validate:(e,t)=>oe(x(t,"canaryConfig.canaryConfigId")).then((e=>{let n=T(P(e.metrics,(e=>e.scopeName||"default")));n=E(n)?["default"]:n;const r=P(x(t,"canaryConfig.scopes"),"scopeName"),a=N(n,r);return a.length>1?`Scopes <strong>${a.join()}</strong> are defined but not configured.`:1===a.length?`Scope <strong>${a[0]}</strong> is defined but not configured.`:null}))},{type:"custom",validate:(e,t)=>oe(x(t,"canaryConfig.canaryConfigId")).then((e=>{let n=T(P(e.metrics,(e=>e.scopeName||"default")));n=E(n)?["default"]:n;const r=P(x(t,"canaryConfig.scopes"),"scopeName"),a=N(r,n);return a.length>1?`Scopes <strong>${a.join()}</strong> are configured but are not defined in the canary configuration.`:1===a.length?`Scope <strong>${a[0]}</strong> is configured but is not defined in the canary configuration.`:null}))},{type:"custom",validate:(e,{canaryConfig:t})=>{if(!ae.legacySiteLocalFieldsEnabled)return null;const n=x(t,"siteLocal.notificationEmail");if(!n)return null;const r=(Array.isArray(n)?n:[n]).find((e=>!(e=>ja(e)||e.match(xa))(e)));return r?`Invalid <strong>Notification Email</strong> (${r})`:null}},{type:"custom",validate:(e,t)=>{const n=x(t,"canaryConfig.scopes[0].startTimeIso");return t.analysisType!==ba.Retrospective||E(n)||Ea(n)?null:"<strong>Start Time</strong> must be formatted as a UTC instant using ISO-8601 instant format (e.g., 2018-07-12T20:28:29Z)."}},{type:"custom",validate:(e,t)=>{const n=x(t,"canaryConfig.scopes[0].endTimeIso");return t.analysisType!==ba.Retrospective||E(n)||Ea(n)?null:"<strong>End Time</strong> must be formatted as a UTC instant using ISO-8601 instant format (e.g., 2018-07-12T20:28:29Z)."}}]};window.angular.module("ng").run(["$templateCache",function(e){e.put("./kayentaStage.html",'<loading-spinner size="\'medium\'" ng-if="kayentaCanaryStageCtrl.state.backingDataLoading"> </loading-spinner>\n\n<div ng-if="!kayentaCanaryStageCtrl.state.backingDataLoading" class="form-horizontal canary-config-view">\n <div class="alert alert-warning" ng-if="kayentaCanaryStageCtrl.state.lifetimeHoursUpdatedToDuration">\n <p>\n <strong>Kayenta now supports analysis lifetimes shorter than 1 hour.</strong>\n </p>\n <p>\n This canary stage has been updated to reflect the new lifetime support. Click "Save Changes" to save the updated\n lifetime on the server.\n </p>\n </div>\n\n <kayenta-stage-config-section title="Analysis Config">\n <stage-config-field label="Analysis Type" help-key="pipeline.config.canary.analysisType">\n <kayenta-analysis-type\n analysis-types="kayentaCanaryStageCtrl.state.analysisTypes"\n selected-type="kayentaCanaryStageCtrl.stage.analysisType"\n on-change="kayentaCanaryStageCtrl.handleAnalysisTypeChange"\n ></kayenta-analysis-type>\n </stage-config-field>\n\n <stage-config-field label="Config Name">\n <ui-select\n required\n ng-model="kayentaCanaryStageCtrl.stage.canaryConfig.canaryConfigId"\n on-select="kayentaCanaryStageCtrl.onCanaryConfigSelect()"\n class="visible-sm-inline-block visible-md-inline-block visible-lg-inline-block"\n style="width: 300px"\n >\n <ui-select-match>{{$select.selected.name}}</ui-select-match>\n <ui-select-choices\n repeat="summary.id as summary in kayentaCanaryStageCtrl.canaryConfigSummaries | filter: $select.search"\n >\n {{summary.name}}\n </ui-select-choices>\n </ui-select>\n </stage-config-field>\n\n <for-analysis-type stage="kayentaCanaryStageCtrl.stage" types="realTime, realTimeAutomatic">\n <stage-config-field\n label="Lifetime"\n field-columns="8"\n help-key="pipeline.config.canary.lifetime"\n ng-class="kayentaCanaryStageCtrl.getLifetimeClassnames()"\n style="padding-left: 0; padding-right: 0"\n >\n <input\n type="number"\n min="0"\n ng-class="kayentaCanaryStageCtrl.getLifetimeInputClassnames()"\n ng-model="kayentaCanaryStageCtrl.state.lifetime.hours"\n class="form-control input-sm"\n style="display: inline-block; width: 11%"\n ng-change="kayentaCanaryStageCtrl.onLifetimeChange()"\n />\n <span class="form-control-static"> hours </span>\n <input\n type="number"\n min="0"\n max="59"\n ng-class="kayentaCanaryStageCtrl.getLifetimeInputClassnames()"\n ng-model="kayentaCanaryStageCtrl.state.lifetime.minutes"\n class="form-control input-sm"\n style="display: inline-block; width: 11%; margin-left: 12px"\n ng-change="kayentaCanaryStageCtrl.onLifetimeChange()"\n />\n <span class="form-control-static"> minutes </span>\n </stage-config-field>\n </for-analysis-type>\n\n <for-analysis-type stage="kayentaCanaryStageCtrl.stage" types="retrospective">\n <stage-config-field label="Start Time" help-key="pipeline.config.canary.startTimeIso">\n <input\n required\n class="form-control input-sm"\n ng-model="kayentaCanaryStageCtrl.stage.canaryConfig.scopes[0].startTimeIso"\n type="text"\n />\n </stage-config-field>\n\n <stage-config-field label="End Time" help-key="pipeline.config.canary.endTimeIso">\n <input\n required\n class="form-control input-sm"\n ng-model="kayentaCanaryStageCtrl.stage.canaryConfig.scopes[0].endTimeIso"\n type="text"\n />\n </stage-config-field>\n </for-analysis-type>\n\n <for-analysis-type stage="kayentaCanaryStageCtrl.stage" types="realTime, realTimeAutomatic">\n <stage-config-field label="Delay" help-key="pipeline.config.canary.delayBeforeAnalysis" field-columns="5">\n <input\n type="text"\n ng-model="kayentaCanaryStageCtrl.stage.canaryConfig.beginCanaryAnalysisAfterMins"\n class="form-control input-sm"\n style="display: inline-block; width: 19%"\n />\n <span class="form-control-static"> minutes before starting analysis </span>\n </stage-config-field>\n </for-analysis-type>\n\n <stage-config-field label="Interval" help-key="pipeline.config.canary.canaryInterval" field-columns="3">\n <input\n type="text"\n ng-model="kayentaCanaryStageCtrl.stage.canaryConfig.canaryAnalysisIntervalMins"\n class="form-control input-sm"\n style="width: 33%; display: inline-block"\n />\n <span class="form-control-static"> minutes</span>\n </stage-config-field>\n\n \x3c!--TODO(dpeach): add help text here--\x3e\n <stage-config-field label="Step" field-columns="3">\n <input\n class="form-control input-sm"\n ng-model="kayentaCanaryStageCtrl.stage.canaryConfig.scopes[0].step"\n type="number"\n min="0"\n style="width: 33%; display: inline-block"\n />\n <span class="form-control-static"> seconds</span>\n </stage-config-field>\n\n <stage-config-field\n label="Baseline Offset"\n help-key="pipeline.config.canary.baselineAnalysisOffset"\n field-columns="3"\n >\n <input\n class="form-control input-sm"\n ng-model="kayentaCanaryStageCtrl.stage.canaryConfig.baselineAnalysisOffsetInMins"\n type="text"\n min="0"\n style="width: 33%; display: inline-block"\n />\n <span class="form-control-static"> minutes</span>\n </stage-config-field>\n\n <stage-config-field label="Lookback Type" help-key="pipeline.config.canary.lookback" field-columns="3">\n <select\n class="form-control input-sm"\n ng-model="kayentaCanaryStageCtrl.state.useLookback"\n ng-options="(useLookback ? \'Sliding\' : \'Growing\') for useLookback in [false, true]"\n ng-change="kayentaCanaryStageCtrl.onUseLookbackChange()"\n ></select>\n </stage-config-field>\n\n <stage-config-field ng-if="kayentaCanaryStageCtrl.state.useLookback">\n <div class="form-group">\n <div class="col-md-9">\n <p\n class="form-control-static"\n ng-if="kayentaCanaryStageCtrl.isExpression(kayentaCanaryStageCtrl.stage.canaryConfig.lookbackMins)"\n >\n Using a sliding lookback duration defined by an expression viewable in the pipeline JSON editor.\n </p>\n <span ng-if="!kayentaCanaryStageCtrl.isExpression(kayentaCanaryStageCtrl.stage.canaryConfig.lookbackMins)">\n with a look-back duration of\n <input\n type="number"\n min="1"\n max="{{kayentaCanaryStageCtrl.state.lifetime.hours * 60}}"\n required\n ng-model="kayentaCanaryStageCtrl.stage.canaryConfig.lookbackMins"\n class="form-control input-sm"\n style="display: inline-block; margin: 0 5px; width: 15%"\n />\n minutes\n </span>\n </div>\n </div>\n <div\n class="error-message col-md-12"\n ng-if="kayentaCanaryStageCtrl.stage.canaryConfig.lookbackMins > 0 && kayentaCanaryStageCtrl.stage.canaryConfig.lookbackMins < 30"\n >\n <b>NOTE:</b> To provide enough data points for the canary analysis it is recommended to set the look-back time\n to at least 30 minutes.\n </div>\n </stage-config-field>\n </kayenta-stage-config-section>\n\n <for-analysis-type stage="kayentaCanaryStageCtrl.stage" types="realTimeAutomatic">\n <stage-config-field\n label="Delay Before Cleanup"\n field-columns="8"\n help-key="pipeline.config.canary.delayBeforeCleanup"\n style="padding-left: 0; padding-right: 0"\n >\n <input\n type="number"\n min="0"\n ng-model="kayentaCanaryStageCtrl.state.delayBeforeCleanup.hours"\n class="form-control input-sm"\n style="display: inline-block; width: 11%"\n ng-change="kayentaCanaryStageCtrl.onDelayBeforeCleanupChange()"\n />\n <span class="form-control-static"> hours </span>\n <input\n type="number"\n min="0"\n max="59"\n ng-model="kayentaCanaryStageCtrl.state.delayBeforeCleanup.minutes"\n class="form-control input-sm"\n style="display: inline-block; width: 11%; margin-left: 12px"\n ng-change="kayentaCanaryStageCtrl.onDelayBeforeCleanupChange()"\n />\n <span class="form-control-static"> minutes </span>\n </stage-config-field>\n </for-analysis-type>\n\n <for-analysis-type stage="kayentaCanaryStageCtrl.stage" types="realTimeAutomatic">\n <kayenta-stage-config-section title="Baseline Version">\n <stage-config-field\n label="Provider"\n ng-if="kayentaCanaryStageCtrl.providers.length > 1\n && kayentaCanaryStageCtrl.stage.isNew"\n >\n <provider-selector\n providers="kayentaCanaryStageCtrl.providers"\n component="kayentaCanaryStageCtrl.stage.deployments.baseline"\n on-change="kayentaCanaryStageCtrl.handleProviderChange()"\n field="cloudProvider"\n read-only="!kayentaCanaryStageCtrl.stage.isNew"\n ></provider-selector>\n </stage-config-field>\n\n <stage-config-field label="Account">\n <account-select-field\n component="kayentaCanaryStageCtrl.stage.deployments.baseline"\n field="account"\n accounts="kayentaCanaryStageCtrl.accounts"\n on-change="kayentaCanaryStageCtrl.setClusterList()"\n provider="kayentaCanaryStageCtrl.stage.deployments.baseline.cloudProvider"\n required\n >\n </account-select-field>\n </stage-config-field>\n\n <stage-config-field label="Cluster">\n <cluster-selector\n ng-if="application.serverGroups.loaded"\n clusters="kayentaCanaryStageCtrl.clusterList"\n required="true"\n model="kayentaCanaryStageCtrl.stage.deployments.baseline.cluster"\n >\n </cluster-selector>\n </stage-config-field>\n </kayenta-stage-config-section>\n </for-analysis-type>\n\n <kayenta-stage-config-section title="Baseline + Canary Pair">\n <section-header ng-if="kayentaCanaryStageCtrl.stage.analysisType === \'realTime\'">\n <span\n uib-tooltip="Click to populate with expressions for resolving control\n and experiment scopes from an upstream clone stage."\n ng-click="kayentaCanaryStageCtrl.populateScopeWithExpressions()"\n class="fa fa-magic clickable"\n ></span>\n </section-header>\n\n <for-analysis-type stage="kayentaCanaryStageCtrl.stage" types="realTime, retrospective">\n <stage-config-field label="Baseline" help-key="pipeline.config.canary.baselineGroup">\n <input\n ng-if="kayentaCanaryStageCtrl.state.atlasScopeType !== \'query\'"\n class="form-control input-sm"\n ng-model="kayentaCanaryStageCtrl.stage.canaryConfig.scopes[0].controlScope"\n required\n type="text"\n />\n\n <textarea\n ng-if="kayentaCanaryStageCtrl.state.atlasScopeType === \'query\'"\n class="form-control input-sm"\n ng-model="kayentaCanaryStageCtrl.stage.canaryConfig.scopes[0].controlScope"\n required\n >\n </textarea>\n </stage-config-field>\n\n <stage-config-field label="Baseline Location" help-key="pipeline.config.canary.baselineLocation">\n <select\n required\n class="form-control input-sm"\n ng-if="kayentaCanaryStageCtrl.getLocationChoices().hasChoices"\n ng-model="kayentaCanaryStageCtrl.stage.canaryConfig.scopes[0].controlLocation"\n ng-options="location for location in kayentaCanaryStageCtrl.getLocationChoices().combinedLocations.control"\n ></select>\n <input\n class="form-control input-sm"\n ng-if="!kayentaCanaryStageCtrl.getLocationChoices().hasChoices"\n ng-model="kayentaCanaryStageCtrl.stage.canaryConfig.scopes[0].controlLocation"\n required\n type="text"\n />\n <div class="pull-right" ng-if="kayentaCanaryStageCtrl.getLocationChoices().hasChoices">\n <button\n ng-click="kayentaCanaryStageCtrl.toggleAllLocations(\'control\')"\n ng-if="!kayentaCanaryStageCtrl.state.showAllLocations.control && kayentaCanaryStageCtrl.getLocationChoices().locations.length > 0"\n class="link"\n >\n Show all locations\n </button>\n <button\n ng-click="kayentaCanaryStageCtrl.toggleAllLocations(\'control\')"\n ng-if="kayentaCanaryStageCtrl.state.showAllLocations.control && kayentaCanaryStageCtrl.getLocationChoices().recommendedLocations.length > 0"\n class="link"\n >\n Only show recommended locations\n </button>\n </div>\n </stage-config-field>\n\n <stage-config-field label="Canary" help-key="pipeline.config.canary.canaryGroup">\n <input\n ng-if="kayentaCanaryStageCtrl.state.atlasScopeType !== \'query\'"\n class="form-control input-sm"\n ng-model="kayentaCanaryStageCtrl.stage.canaryConfig.scopes[0].experimentScope"\n required\n type="text"\n />\n\n <textarea\n ng-if="kayentaCanaryStageCtrl.state.atlasScopeType === \'query\'"\n class="form-control input-sm"\n ng-model="kayentaCanaryStageCtrl.stage.canaryConfig.scopes[0].experimentScope"\n required\n >\n </textarea>\n </stage-config-field>\n\n <stage-config-field label="Canary Location" help-key="pipeline.config.canary.canaryLocation">\n <select\n required\n class="form-control input-sm"\n ng-if="kayentaCanaryStageCtrl.getLocationChoices().hasChoices"\n ng-model="kayentaCanaryStageCtrl.stage.canaryConfig.scopes[0].experimentLocation"\n ng-options="location for location in kayentaCanaryStageCtrl.getLocationChoices().combinedLocations.experiment"\n ></select>\n <input\n class="form-control input-sm"\n ng-if="!kayentaCanaryStageCtrl.getLocationChoices().hasChoices"\n ng-model="kayentaCanaryStageCtrl.stage.canaryConfig.scopes[0].experimentLocation"\n required\n type="text"\n />\n <div class="pull-right" ng-if="kayentaCanaryStageCtrl.getLocationChoices().hasChoices">\n <button\n ng-click="kayentaCanaryStageCtrl.toggleAllLocations(\'experiment\')"\n ng-if="!kayentaCanaryStageCtrl.state.showAllLocations.experiment && kayentaCanaryStageCtrl.getLocationChoices().locations.length > 0"\n class="link"\n >\n Show all locations\n </button>\n <button\n ng-click="kayentaCanaryStageCtrl.toggleAllLocations(\'experiment\')"\n ng-if="kayentaCanaryStageCtrl.state.showAllLocations.experiment && kayentaCanaryStageCtrl.getLocationChoices().recommendedLocations.length > 0"\n class="link"\n >\n Only show recommended locations\n </button>\n </div>\n </stage-config-field>\n </for-analysis-type>\n\n <for-analysis-type stage="kayentaCanaryStageCtrl.stage" types="realTimeAutomatic">\n <div class="row">\n <div style="margin: 10px 10px 0 50px">\n <div class="well well-sm">\n <table class="table">\n <thead>\n <tr>\n <th>Location</th>\n <th>Baseline</th>\n <th>Canary</th>\n <th>Actions</th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="clusterPair in kayentaCanaryStageCtrl.stage.deployments.serverGroupPairs">\n <td>\n <account-tag account="clusterPair.control.account"></account-tag>\n {{kayentaCanaryStageCtrl.getRegion(clusterPair.control)}}\n </td>\n <td>\n {{kayentaCanaryStageCtrl.getServerGroupName(clusterPair.control)}}\n <br />\n <a href ng-click="kayentaCanaryStageCtrl.editServerGroup(clusterPair.control, $index, \'control\')"\n >Edit</a\n >\n </td>\n <td>\n {{kayentaCanaryStageCtrl.getServerGroupName(clusterPair.experiment)}}\n <br />\n <a\n href\n ng-click="kayentaCanaryStageCtrl.editServerGroup(clusterPair.experiment, $index, \'experiment\')"\n >Edit</a\n >\n </td>\n <td>\n <a href ng-click="kayentaCanaryStageCtrl.deletePair($index);">\n <span class="glyphicon glyphicon-trash" uib-tooltip="Delete Pair"></span>\n </a>\n </td>\n </tr>\n </tbody>\n <tfoot>\n <tr ng-if="!kayentaCanaryStageCtrl.stage.deployments.serverGroupPairs.length">\n <td colspan="4">\n <button class="btn btn-block btn-sm add-new" ng-click="kayentaCanaryStageCtrl.addPair()">\n <span class="glyphicon glyphicon-plus-sign"></span> Add Baseline + Canary Pair\n </button>\n </td>\n </tr>\n </tfoot>\n </table>\n </div>\n </div>\n </div>\n </for-analysis-type>\n </kayenta-stage-config-section>\n\n <kayenta-stage-config-section title="Metric Scope">\n <for-analysis-type stage="kayentaCanaryStageCtrl.stage" types="realTimeAutomatic">\n <stage-config-field label="Dataset" ng-if="kayentaCanaryStageCtrl.metricStore === \'atlas\'">\n <input\n type="checkbox"\n ng-model="kayentaCanaryStageCtrl.state.useAtlasGlobalDataset"\n ng-click="kayentaCanaryStageCtrl.handleAtlasDatasetChange($event)"\n />\n Use Global Atlas Dataset\n </stage-config-field>\n </for-analysis-type>\n\n <for-analysis-type stage="kayentaCanaryStageCtrl.stage" types="realTime, retrospective">\n <stage-config-field label="Scope Type" ng-if="kayentaCanaryStageCtrl.metricStore === \'atlas\'">\n <select\n required\n class="form-control input-sm"\n ng-model="kayentaCanaryStageCtrl.state.atlasScopeType"\n ng-options="(type === \'cluster\' ? \'Cluster\' : \'Query\') for type in [\'cluster\', \'query\']"\n ng-change="kayentaCanaryStageCtrl.onAtlasScopeTypeChange()"\n ></select>\n </stage-config-field>\n </for-analysis-type>\n\n <stage-config-field label="Extended Params" help-key="pipeline.config.canary.extendedScopeParams">\n <map-editor\n hidden-keys="[\'resourceType\', \'dataset\', \'type\', \'environment\']"\n on-change="kayentaCanaryStageCtrl.handleExtendedScopeParamsChange()"\n model="kayentaCanaryStageCtrl.stage.canaryConfig.scopes[0].extendedScopeParams"\n >\n </map-editor>\n </stage-config-field>\n </kayenta-stage-config-section>\n\n <kayenta-stage-config-section title="Scoring Thresholds">\n <kayenta-canary-scores\n on-change="kayentaCanaryStageCtrl.handleScoreThresholdChange"\n successful-help-field-id="\'pipeline.config.canary.passingScore\'"\n successful-label="\'Pass\'"\n successful-score="kayentaCanaryStageCtrl.stage.canaryConfig.scoreThresholds.pass"\n unhealthy-help-field-id="\'pipeline.config.canary.marginalScore\'"\n unhealthy-label="\'Marginal\'"\n unhealthy-score="kayentaCanaryStageCtrl.stage.canaryConfig.scoreThresholds.marginal"\n ></kayenta-canary-scores>\n </kayenta-stage-config-section>\n\n <kayenta-stage-config-section title="Advanced Settings" ng-if="kayentaCanaryStageCtrl.state.showAdvancedSettings">\n <stage-config-field\n label="Notification Emails"\n help-key="pipeline.config.canary.legacySiteLocalRecipients"\n ng-if="kayentaCanaryStageCtrl.state.showLegacySiteLocalRecipients"\n >\n <textarea\n class="form-control input-sm"\n ng-model="kayentaCanaryStageCtrl.state.legacySiteLocalRecipients"\n ng-change="kayentaCanaryStageCtrl.handleLegacySiteLocalRecipientsChange()"\n placeholder="Email addresses separated by commas"\n >\n </textarea>\n </stage-config-field>\n\n <stage-config-field\n label="Metrics Account"\n help-key="pipeline.config.metricsAccount"\n ng-if="kayentaCanaryStageCtrl.kayentaAccounts.get(\'METRICS_STORE\').length > 1"\n >\n <select\n class="form-control input-sm"\n ng-model="kayentaCanaryStageCtrl.stage.canaryConfig.metricsAccountName"\n ng-options="account.name as account.name for account in kayentaCanaryStageCtrl.kayentaAccounts.get(\'METRICS_STORE\')"\n ></select>\n </stage-config-field>\n <stage-config-field\n label="Storage Account"\n help-key="pipeline.config.storageAccount"\n ng-if="kayentaCanaryStageCtrl.kayentaAccounts.get(\'OBJECT_STORE\').length > 1"\n >\n <select\n class="form-control input-sm"\n ng-model="kayentaCanaryStageCtrl.stage.canaryConfig.storageAccountName"\n ng-options="account.name as account.name for account in kayentaCanaryStageCtrl.kayentaAccounts.get(\'OBJECT_STORE\')"\n ></select>\n </stage-config-field>\n\n <stage-config-field label="Scope Name" ng-if="kayentaCanaryStageCtrl.scopeNames.length > 1">\n <ui-select\n required\n ng-model="kayentaCanaryStageCtrl.stage.canaryConfig.scopes[0].scopeName"\n class="visible-sm-inline-block visible-md-inline-block visible-lg-inline-block"\n style="width: 300px"\n >\n <ui-select-match>{{$select.selected}}</ui-select-match>\n <ui-select-choices repeat="scopeName in kayentaCanaryStageCtrl.scopeNames | filter: $select.search">\n {{scopeName}}\n </ui-select-choices>\n </ui-select>\n </stage-config-field>\n\n <div class="alert alert-warning" ng-if="kayentaCanaryStageCtrl.stage.canaryConfig.scopes.length > 1">\n <strong>Warning!</strong> This stage specifies more than one scope. Please edit the stage JSON to configure scopes\n beyond the first one.\n </div>\n </kayenta-stage-config-section>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("./kayentaStageExecutionDetails.html",'<div class="canary-details" ng-controller="kayentaStageExecutionDetailsCtrl as kayentaStageDetailsCtrl">\n <execution-details-section-nav sections="configSections"></execution-details-section-nav>\n <div class="step-section-details" ng-if="detailsSection === \'canarySummary\'">\n <div class="row">\n <div class="col-md-2 canary-summary">\n <div class="score score-large">\n <kayenta-canary-score\n score="stage.context.overallScore"\n health="stage.context.overallHealth"\n result="stage.context.overallResult"\n ></kayenta-canary-score>\n </div>\n </div>\n </div>\n\n <div class="row">\n <div class="col-md-12 horizontal">\n <canary-run-summaries\n class="horizontal flex-1"\n canary-runs="kayentaStageDetailsCtrl.canaryRuns"\n first-scope-name="kayentaStageDetailsCtrl.firstScopeName"\n ></canary-run-summaries>\n </div>\n </div>\n\n <stage-failure-message\n stage="stage"\n is-failed="stage.exceptions.length > 0"\n messages="stage.exceptions"\n ></stage-failure-message>\n </div>\n\n <div class="step-section-details" ng-if="detailsSection === \'canaryConfig\'">\n <div class="row">\n <div class="col-md-12 canary-config-section">\n <h5>Scope</h5>\n <div class="horizontal-rule"></div>\n <div class="row">\n <div class="col-md-4 sm-label-right compact">Baseline</div>\n <div class="col-md-8" style="word-wrap: break-word">{{ kayentaStageDetailsCtrl.resolvedControl }}</div>\n </div>\n <div class="row">\n <div class="col-md-4 sm-label-right compact">Canary</div>\n <div class="col-md-8" style="word-wrap: break-word">{{ kayentaStageDetailsCtrl.resolvedExperiment }}</div>\n </div>\n <div class="row" ng-if="stage.context.canaryConfig.scopes[0].step">\n <div class="col-md-4 sm-label-right compact">Step</div>\n <div class="col-md-8" style="word-wrap: break-word">{{stage.context.canaryConfig.scopes[0].step}}</div>\n </div>\n <div class="row" ng-if="stage.context.canaryConfig.scopes[0].startTimeIso">\n <div class="col-md-4 sm-label-right compact">Start Time</div>\n <div class="col-md-8" style="word-wrap: break-word">\n {{ stage.context.canaryConfig.scopes[0].startTimeIso | dateToMillis | timestamp}}\n </div>\n </div>\n <div class="row" ng-if="stage.context.canaryConfig.scopes[0].endTimeIso">\n <div class="col-md-4 sm-label-right compact">End Time</div>\n <div class="col-md-8" style="word-wrap: break-word">\n {{stage.context.canaryConfig.scopes[0].endTimeIso | dateToMillis | timestamp}}\n </div>\n </div>\n </div>\n <div class="col-md-12 canary-config-section">\n <h5>Analysis Config</h5>\n <div class="horizontal-rule"></div>\n <div class="row">\n <div class="col-md-4 sm-label-right compact">Config Name</div>\n <div class="col-md-8" style="word-wrap: break-word">\n <a\n href\n ui-sref="home.applications.application.canary.canaryConfig.configDetail({id: stage.context.canaryConfig.canaryConfigId})"\n >\n {{kayentaStageDetailsCtrl.canaryConfigName}}\n </a>\n </div>\n </div>\n <div class="row">\n <div class="col-md-4 sm-label-right compact">Analysis Type</div>\n <div class="col-md-8" style="word-wrap: break-word">{{stage.context.analysisType | robotToHuman}}</div>\n </div>\n <div class="row" ng-if="stage.context.canaryConfig.lifetimeHours">\n <div class="col-md-4 sm-label-right compact">Duration</div>\n <div class="col-md-6">{{stage.context.canaryConfig.lifetimeHours}} hours</div>\n </div>\n <div class="row">\n <div class="col-md-4 sm-label-right compact">Pass</div>\n <div class="col-md-6">{{stage.context.canaryConfig.scoreThresholds.pass}}</div>\n </div>\n <div class="row">\n <div class="col-md-4 sm-label-right compact">Marginal</div>\n <div class="col-md-6">{{stage.context.canaryConfig.scoreThresholds.marginal}}</div>\n </div>\n <div class="row" ng-if="stage.context.canaryConfig.beginCanaryAnalysisAfterMins">\n <div class="col-md-4 sm-label-right compact">Warmup Period</div>\n <div class="col-md-6">{{stage.context.canaryConfig.beginCanaryAnalysisAfterMins}} minutes</div>\n </div>\n <div class="row" ng-if="stage.context.canaryConfig.canaryAnalysisIntervalMins">\n <div class="col-md-4 sm-label-right compact">Interval</div>\n <div class="col-md-6">{{stage.context.canaryConfig.canaryAnalysisIntervalMins}} minutes</div>\n </div>\n <div class="row" ng-if="stage.context.canaryConfig.baselineAnalysisOffsetInMins">\n <div class="col-md-4 sm-label-right compact">Baseline Offset</div>\n <div class="col-md-6">{{stage.context.canaryConfig.baselineAnalysisOffsetInMins}} minutes</div>\n </div>\n </div>\n </div>\n </div>\n\n <div class="step-section-details" ng-if="detailsSection === \'taskStatus\'">\n <div class="row">\n <execution-step-details item="stage"></execution-step-details>\n </div>\n </div>\n</div>\n')}]);const Na={hours:0,minutes:0};function Ra(e){const t=Object.assign({},Na);if(!j(e))return t;const n=e.match(/PT(\d+)H(?:(\d+)M)?/i);if(E(n))return t;let r=parseInt(n[1],10);(!R(r)||r<0)&&(r=0);let a=parseInt(n[2],10);return(!R(a)||a<0)&&(a=0),{hours:r,minutes:a}}function Ma(e){if(!e)return"PT0H0M";let{hours:t,minutes:n}=e;return(!R(t)||t<0)&&(t=0),(!R(n)||n<0)&&(n=0),`PT${t}H${n}M`}ha(".canary-config-view .alert {\n margin-bottom: 0;\n}\n");const Aa=["gce","aws","titus"];class La{constructor(e,t,n,r,a,o){this.$scope=e,this.$uibModal=t,this.$log=n,this.serverGroupCommandBuilder=r,this.serverGroupTransformer=a,this.stage=o,this.state={useLookback:!1,backingDataLoading:!1,lifetimeHoursUpdatedToDuration:!1,lifetime:{hours:0,minutes:0},showAdvancedSettings:!1,useAtlasGlobalDataset:!1,atlasScopeType:"cluster",legacySiteLocalRecipients:"",showLegacySiteLocalRecipients:ae.legacySiteLocalFieldsEnabled,showAllLocations:{control:!1,experiment:!1},delayBeforeCleanup:{hours:0,minutes:0},analysisTypes:[ba.RealTimeAutomatic,ba.RealTime,ba.Retrospective]},this.canaryConfigSummaries=[],this.scopeNames=[],this.kayentaAccounts=new Map,this.initialize=async()=>{await this.loadBackingData();const e=M(this.kayentaAccounts.get(ya.ObjectStore)),t=M(this.kayentaAccounts.get(ya.MetricsStore));if(this.stage.canaryConfig=Object.assign(Object.assign({storageAccountName:e&&e.name||ae.storageAccountName,metricsAccountName:t&&t.name||ae.metricsAccountName},this.stage.canaryConfig),{scoreThresholds:Object.assign({marginal:null,pass:null},x(this.stage,"canaryConfig.scoreThresholds"))}),this.stage.analysisType=this.stage.analysisType||this.state.analysisTypes[0],this.stage.canaryConfig.scopes&&this.stage.canaryConfig.scopes.length||(this.stage.canaryConfig.scopes=[{scopeName:"default"}]),!this.stage.isNew){const e=x(this.stage,"canaryConfig.lifetimeDuration");this.state.lifetime=Ra(e);const t=x(this.stage,"deployments.delayBeforeCleanup");this.state.delayBeforeCleanup=Ra(t)}this.stage.canaryConfig.lookbackMins&&(this.state.useLookback=!0),this.populateScopeNameChoices(),this.setMetricStore(),this.setLocations(),this.setShowAdvancedSettings(),this.setClusterList(),this.deleteConfigAccountsIfMissing(),this.updateLifetimeFromHoursToDuration(),this.deleteCanaryConfigIdIfMissing(),ae.legacySiteLocalFieldsEnabled&&this.setLegacySiteLocalRecipients(),this.stage.isNew&&this.stage.analysisType===ba.RealTimeAutomatic&&await this.initializeRealTimeAutomaticAnalysisType()},this.loadBackingData=async()=>{this.state.backingDataLoading=!0;try{await this.$scope.application.ready(),[this.selectedCanaryConfigDetails,this.kayentaAccounts,this.providers,this.accounts,this.canaryConfigSummaries]=await Promise.all([this.loadCanaryConfigDetails(),this.loadKayentaAccounts(),this.loadProviders(),this.loadAccounts(),Promise.resolve(this.$scope.application.getDataSource("canaryConfigs").data)])}catch(e){this.$log.warn("Error loading backing data for Kayenta stage: ",e)}finally{this.state.backingDataLoading=!1,this.$scope.$applyAsync()}},this.onUseLookbackChange=()=>{this.state.useLookback||delete this.stage.canaryConfig.lookbackMins},this.onCanaryConfigSelect=async()=>{this.selectedCanaryConfigDetails=await this.loadCanaryConfigDetails(),this.populateScopeNameChoices(),this.setMetricStore()},this.isExpression=e=>j(e)&&e.includes("${"),this.handleScoreThresholdChange=e=>{this.$scope.$applyAsync((()=>{this.stage.canaryConfig.scoreThresholds.pass=e.successfulScore,this.stage.canaryConfig.scoreThresholds.marginal=e.unhealthyScore}))},this.handleAnalysisTypeChange=async e=>{switch(this.stage.analysisType=e,this.stage.analysisType){case ba.RealTime:delete this.stage.canaryConfig.scopes[0].startTimeIso,delete this.stage.canaryConfig.scopes[0].endTimeIso,delete this.stage.deployments,"atlas"===this.metricStore&&(this.stage.canaryConfig.scopes.forEach((e=>{A(e,"extendedScopeParams.dataset"),A(e,"extendedScopeParams.environment")})),this.setAtlasScopeParams());break;case ba.RealTimeAutomatic:delete this.stage.canaryConfig.scopes[0].startTimeIso,delete this.stage.canaryConfig.scopes[0].endTimeIso,delete this.stage.canaryConfig.scopes[0].controlLocation,delete this.stage.canaryConfig.scopes[0].experimentLocation,this.initializeRealTimeAutomaticAnalysisType();break;case ba.Retrospective:delete this.stage.canaryConfig.beginCanaryAnalysisAfterMins,delete this.stage.canaryConfig.lifetimeDuration,delete this.stage.deployments,"atlas"===this.metricStore&&(this.stage.canaryConfig.scopes.forEach((e=>{A(e,"extendedScopeParams.dataset"),A(e,"extendedScopeParams.environment")})),this.setAtlasScopeParams())}this.$scope.$applyAsync()},this.initializeRealTimeAutomaticAnalysisType=async()=>{this.stage.deployments=Object.assign(Object.assign({},this.stage.deployments),{baseline:Object.assign(Object.assign({},x(this.stage,"deployments.baseline")),{cloudProvider:this.providers[0],application:this.$scope.application.name,cluster:null,account:null}),serverGroupPairs:[]}),this.accounts=await this.loadAccounts(),this.setClusterList(),this.setMetricStore()},this.loadCanaryConfigDetails=async()=>{if(!k(this.stage,"canaryConfig.canaryConfigId"))return null;const e=this.stage.canaryConfig.canaryConfigId;try{return oe(e)}catch(t){return this.$log.warn(`Could not load canary config with id ${e}: `,t),null}},this.setMetricStore=()=>{this.metricStore=x(this.selectedCanaryConfigDetails,"metrics[0].query.type"),"atlas"===this.metricStore?(this.setAtlasScopeParams(),this.$scope.$applyAsync()):this.stage.canaryConfig.scopes.forEach((e=>{A(e,"extendedScopeParams.type")}))},this.setAtlasScopeParams=()=>{const e=this.stage.analysisType===ba.RealTimeAutomatic,t=x(this.stage.canaryConfig.scopes[0],"extendedScopeParams.type");e||(this.state.atlasScopeType="asg"!==t?t:"cluster"),this.stage.canaryConfig.scopes.forEach((t=>{L(t,"extendedScopeParams.type",e?"asg":this.state.atlasScopeType)})),e&&(this.state.useAtlasGlobalDataset="global"===x(this.stage.canaryConfig.scopes[0],"extendedScopeParams.dataset"),this.stage.canaryConfig.scopes.forEach((e=>{L(e,"extendedScopeParams.dataset",this.state.useAtlasGlobalDataset?"global":"regional")})))},this.setLocations=()=>{const{recommendedLocations:e,locations:t,hasChoices:n}=this.getLocationChoices();n&&(this.state.showAllLocations.control=this.state.showAllLocations.experiment=0===e.length&&t.length>0,this.stage.canaryConfig.scopes.forEach((n=>{e.includes(n.controlLocation)||t.includes(n.controlLocation)?e.includes(n.controlLocation)||(this.state.showAllLocations.control=!0):delete n.controlLocation,e.includes(n.experimentLocation)||t.includes(n.experimentLocation)?e.includes(n.experimentLocation)||(this.state.showAllLocations.experiment=!0):delete n.experimentLocation})))},this.setShowAdvancedSettings=()=>{this.state.showAdvancedSettings=this.kayentaAccounts.get(ya.MetricsStore).length>1||this.kayentaAccounts.get(ya.ObjectStore).length>1||this.scopeNames.length>1||ae.legacySiteLocalFieldsEnabled},this.getLocationChoices=()=>{const e=this.kayentaAccounts.get(ya.MetricsStore),t=e&&e.find((({name:e})=>e===this.stage.canaryConfig.metricsAccountName));if(!t)return{combinedLocations:{control:[],experiment:[]},recommendedLocations:[],locations:[],hasChoices:!1};const n=t.locations.length>0||t.recommendedLocations.length>0,r=t.recommendedLocations.concat(t.locations);return{combinedLocations:{control:T(this.state.showAllLocations.control?r:t.recommendedLocations.length>0?t.recommendedLocations:t.locations),experiment:T(this.state.showAllLocations.experiment?r:t.recommendedLocations.length>0?t.recommendedLocations:t.locations)},recommendedLocations:t.recommendedLocations,locations:t.locations,hasChoices:n}},this.toggleAllLocations=e=>{this.state.showAllLocations[e]=!this.state.showAllLocations[e];const t=this.getLocationChoices();this.stage.canaryConfig.scopes.forEach((e=>{t.combinedLocations.control.includes(e.controlLocation)||delete e.controlLocation,t.combinedLocations.experiment.includes(e.experimentLocation)||delete e.experimentLocation}))},this.populateScopeNameChoices=()=>{if(!this.selectedCanaryConfigDetails)return;const e=T(P(this.selectedCanaryConfigDetails.metrics,(e=>e.scopeName||"default")));this.scopeNames=E(e)?["default"]:e,this.setShowAdvancedSettings(),E(this.stage.canaryConfig.scopes)||e.includes(this.stage.canaryConfig.scopes[0].scopeName)?E(this.stage.canaryConfig.scopes)&&(this.stage.canaryConfig.scopes=[{scopeName:e[0]}]):delete this.stage.canaryConfig.scopes[0].scopeName},this.loadKayentaAccounts=async()=>{const e=new Map;return(await pe()).forEach((t=>{t.supportedTypes.forEach((n=>{e.has(n)?e.set(n,e.get(n).concat([t])):e.set(n,[t])}))})),e},this.deleteConfigAccountsIfMissing=()=>{(this.kayentaAccounts.get(ya.ObjectStore)||[]).every((e=>e.name!==this.stage.canaryConfig.storageAccountName))&&delete this.stage.canaryConfig.storageAccountName,(this.kayentaAccounts.get(ya.MetricsStore)||[]).every((e=>e.name!==this.stage.canaryConfig.metricsAccountName))&&delete this.stage.canaryConfig.metricsAccountName},this.deleteCanaryConfigIdIfMissing=()=>{this.canaryConfigSummaries.every((e=>e.id!==this.stage.canaryConfig.canaryConfigId))&&delete this.stage.canaryConfig.canaryConfigId},this.populateScopeWithExpressions=()=>{this.stage.canaryConfig.scopes[0].controlScope="${ #stage('Clone Server Group')['context']['source']['serverGroupName'] }",this.stage.canaryConfig.scopes[0].controlLocation="${ deployedServerGroups[0].region }",this.stage.canaryConfig.scopes[0].experimentScope="${ deployedServerGroups[0].serverGroup }",this.stage.canaryConfig.scopes[0].experimentLocation="${ deployedServerGroups[0].region }"},this.onLifetimeChange=()=>{this.stage.canaryConfig.lifetimeDuration=Ma(this.state.lifetime)},this.updateLifetimeFromHoursToDuration=()=>{if(k(this.stage,["canaryConfig","lifetimeHours"])){const e=parseInt(this.stage.canaryConfig.lifetimeHours,10);if(I(e)){const t=parseFloat(this.stage.canaryConfig.lifetimeHours)-e,n=Math.floor(60*t);this.stage.canaryConfig.lifetimeDuration=`PT${e}H`,I(n)&&(this.stage.canaryConfig.lifetimeDuration+=`${n}M`),this.state.lifetimeHoursUpdatedToDuration=!0}delete this.stage.canaryConfig.lifetimeHours}},this.getLifetimeClassnames=()=>this.state.lifetimeHoursUpdatedToDuration?"alert alert-warning":"",this.getLifetimeInputClassnames=()=>{const{hours:e,minutes:t}=this.state.lifetime;return 0===e&&0===t?"ng-invalid ng-invalid-required":""},this.loadProviders=async()=>(this.providers=(await u.listProviders(this.$scope.application)).filter((e=>Aa.includes(e))),this.providers.length||(this.state.analysisTypes=[ba.RealTime,ba.Retrospective]),this.providers),this.handleProviderChange=async()=>{L(this.stage,"deployments.baseline.account",null),L(this.stage,"deployments.baseline.cluster",null),this.accounts=await this.loadAccounts(),this.setClusterList()},this.loadAccounts=()=>k(this.stage,"deployments.baseline.cloudProvider")?Promise.resolve(u.listAccounts(this.stage.deployments.baseline.cloudProvider)):null,this.setClusterList=()=>{this.clusterList=p.getClusters([this.$scope.application],(e=>!k(this.stage,"deployments.baseline.account")||e.account===this.stage.deployments.baseline.account)),this.setAtlasEnvironment()},this.setAtlasEnvironment=()=>{"atlas"===this.metricStore&&this.stage.analysisType===ba.RealTimeAutomatic&&this.stage.canaryConfig.scopes.forEach((e=>{if(this.stage.deployments.baseline.account){const t=this.accounts.find((({name:e})=>this.stage.deployments.baseline.account===e));t&&L(e,"extendedScopeParams.environment",t.environment)}else A(e,"extendedScopeParams.environment")}))},this.setLegacySiteLocalRecipients=()=>{const e=x(this.stage.canaryConfig,"siteLocal.notificationEmail");Array.isArray(e)?this.state.legacySiteLocalRecipients=e.join(","):this.state.legacySiteLocalRecipients=j(e)?e:""},this.handleLegacySiteLocalRecipientsChange=()=>{this.state.legacySiteLocalRecipients.includes("${")?L(this.stage.canaryConfig,"siteLocal.notificationEmail",this.state.legacySiteLocalRecipients):this.state.legacySiteLocalRecipients.length?L(this.stage.canaryConfig,"siteLocal.notificationEmail",this.state.legacySiteLocalRecipients.split(",").map((e=>e.trim()))):delete this.stage.canaryConfig.siteLocal},this.getRegion=e=>{if(e.region)return e.region;const t=e.availabilityZones;return t&&Object.keys(t).length?Object.keys(t)[0]:"n/a"},this.getServerGroupName=e=>d.getClusterName(e.application,e.stack,e.freeFormDetails),this.addPair=async()=>{this.stage.deployments.serverGroupPairs=this.stage.deployments.serverGroupPairs||[];const e=await(k(this.stage,"deployments.baseline.cloudProvider")?Promise.resolve(this.stage.deployments.baseline.cloudProvider):Promise.resolve(f.selectProvider(this.$scope.application,"serverGroup")));this.stage.deployments.baseline.cloudProvider=e;const t=h.getValue(e,"serverGroup"),n=await this.serverGroupCommandBuilder.buildNewServerGroupCommandForPipeline(e,null,null);n.viewState=Object.assign(Object.assign({},n.viewState),{requiresTemplateSelection:!0,disableStrategySelection:!0,hideClusterNamePreview:!0,readOnlyFields:{credentials:!0,region:!0,subnet:!0,useSourceCapacity:!0},overrides:{capacity:{min:1,max:1,desired:1},useSourceCapacity:!1},imageSourceText:"\n <p>This dialogue will configure two server groups.</p>\n <p>\n The <b>Baseline</b> server group's image will be resolved\n from the <b>Newest</b> server group\n in the <b>Baseline Version</b> cluster defined in this stage.\n </p>\n <p>\n The <b>Canary</b> server group's image will be resolved from\n an upstream <b>Bake</b> or <b>Find Image</b> stage.\n </p>"}),delete n.strategy;try{const e="Add Baseline + Canary Pair",r=this.$scope.application;let a;a=t.CloneServerGroupModal?await t.CloneServerGroupModal.show({title:e,application:r,command:n}):await this.$uibModal.open({templateUrl:t.cloneServerGroupTemplateUrl,controller:`${t.cloneServerGroupController} as ctrl`,size:"lg",resolve:{title:()=>e,application:()=>r,serverGroupCommand:()=>n}}).result;const o=this.serverGroupTransformer.convertServerGroupCommandToDeployConfiguration(a),i=D(o),s=(e,t)=>{delete e.backingData,e.freeFormDetails&&e.freeFormDetails.split("-").pop()===t||(e.freeFormDetails=`${e.freeFormDetails?`${e.freeFormDetails}-`:""}${t}`)};s(o,"baseline"),s(i,"canary"),this.stage.deployments.serverGroupPairs=[{control:o,experiment:i}],this.$scope.$applyAsync()}catch(e){this.$log.warn("Error creating server group pair for Kayenta stage: ",e)}},this.editServerGroup=async(e,t,n)=>{e.provider=e.provider||e.cloudProvider;const r=h.getValue(e.cloudProvider,"serverGroup");try{const a=`Configure ${n[0].toUpperCase()+n.substring(1)} Server Group`,o=this.$scope.application,i=await this.serverGroupCommandBuilder.buildServerGroupCommandFromPipeline(o,e,null,null);let s;i.viewState=Object.assign(Object.assign({},i.viewState),{disableStrategySelection:!0,hideClusterNamePreview:!0,readOnlyFields:{credentials:!0,region:!0,subnet:!0,useSourceCapacity:!0},imageSourceText:this.resolveImageSourceText(n)}),delete i.strategy,s=r.CloneServerGroupModal?await r.CloneServerGroupModal.show({title:a,application:o,command:i}):await this.$uibModal.open({templateUrl:r.cloneServerGroupTemplateUrl,controller:`${r.cloneServerGroupController} as ctrl`,size:"lg",resolve:{title:()=>a,application:()=>o,serverGroupCommand:()=>i}}).result,this.stage.deployments.serverGroupPairs[t][n]=this.serverGroupTransformer.convertServerGroupCommandToDeployConfiguration(s)}catch(e){this.$log.warn("Error editing server group pair for Kayenta stage: ",e)}},this.deletePair=e=>{(this.stage.deployments.serverGroupPairs||[]).splice(e,1)},this.handleAtlasDatasetChange=e=>{const{checked:t}=e.target;this.$scope.$applyAsync((()=>{this.stage.canaryConfig.scopes.forEach((e=>{L(e,"extendedScopeParams.dataset",t?"global":"regional"),L(e,"extendedScopeParams.type",this.stage.analysisType===ba.RealTimeAutomatic?"asg":this.state.atlasScopeType)}))}))},this.onAtlasScopeTypeChange=()=>{this.$scope.$applyAsync((()=>{this.stage.canaryConfig.scopes.forEach((e=>{L(e,"extendedScopeParams.type",this.state.atlasScopeType)}))}))},this.handleExtendedScopeParamsChange=()=>{"atlas"===this.metricStore&&(this.stage.canaryConfig.scopes.forEach((e=>{L(e,"extendedScopeParams.type",this.stage.analysisType===ba.RealTimeAutomatic?"asg":this.state.atlasScopeType)})),this.stage.analysisType===ba.RealTimeAutomatic&&(this.stage.canaryConfig.scopes.forEach((e=>{L(e,"extendedScopeParams.dataset",this.state.useAtlasGlobalDataset?"global":"regional")})),this.setAtlasEnvironment()),this.$scope.$applyAsync())},this.onDelayBeforeCleanupChange=()=>{this.stage.deployments.delayBeforeCleanup=Ma(this.state.delayBeforeCleanup)},this.initialize()}resolveImageSourceText(e){return"experiment"===e?"This server group's image will be resolved from an upstream\n <b>Bake</b> or <b>Find Image</b> stage.":"This server group's image will be resolved from the <b>Newest</b>\n server group in the <b>Baseline Version</b> cluster defined in this stage."}}La.$inject=["$scope","$uibModal","$log","serverGroupCommandBuilder","serverGroupTransformer","stage"];const Ia="runCanary",Da="wait",qa=["kayentaCanary","createServerGroup"];class $a{transform(e,t){const n=t.stages.filter((({type:e})=>"kayentaCanary"===e));if(!n.length)return;let r=[];t.stages.forEach((e=>{if("kayentaCanary"===e.type){g.defineProperties(e);const n=e.context.intervalStageId,a=n?t.stages.filter((({parentStageId:e,type:t})=>e&&e===n&&[Da,Ia].includes(t))):[];r=r.concat(a);const o=a.filter((e=>e.type===Ia));a.forEach((e=>g.defineProperties(e))),this.calculateRunCanaryResults(o),this.calculateKayentaCanaryResults(e,a),e.exceptions=[],this.addExceptions([e,...a],e.exceptions),e.tasks=[...a,...e.tasks]}else if("createServerGroup"===e.type&&this.isDescendantOf(e,n,t)){g.defineProperties(e);const r=this.isDescendantOf(e,n,t),a=e.context["deploy.server.groups"]&&Object.keys(e.context["deploy.server.groups"]);e.name=`Deploy ${e.context.freeFormDetails}${a?" in "+a.join(", "):""}`,e.parentStageId=r}}));const a=n.map((({id:e})=>e));t.stages.filter((({parentStageId:e,type:t})=>a.includes(e)&&"deployCanaryServerGroups"===t)).forEach((e=>{const t=n.find((({id:t})=>e.parentStageId===t));if(t&&(e.outputs.deployedServerGroups||[]).length){const[{controlScope:n,experimentScope:r}]=e.outputs.deployedServerGroups;t.outputs=Object.assign(Object.assign({},t.outputs),{controlScope:n,experimentScope:r})}})),t.stages=t.stages.filter((e=>!r.includes(e)&&(!this.isDescendantOf(e,n,t)||qa.includes(e.type)||"SUCCEEDED"!==e.status)))}isDescendantOf(e,t,n){const r=t.map((({id:e})=>e));let a=e;for(;a&&a.parentStageId;){const e=n.stages.find((({id:e})=>a.parentStageId===e));if(e&&r.includes(e.id))return e.id;a=e}return null}calculateRunCanaryResults(e){e.forEach((e=>{"number"==typeof e.getValueFor("canaryScore")&&("SUCCEEDED"===e.status?e.context.canaryScore>=e.context.scoreThresholds.pass&&(e.result="success"):e.health="unhealthy",e.context.canaryScore=q(e.context.canaryScore,2))}))}calculateKayentaCanaryResults(e,t){if(!e.isRunning&&(e.getValueFor("canaryScores")?e.context.overallScore=$(e.getValueFor("canaryScores")):e.context.overallScore=this.getLastCanaryRunScore(t),e.context.overallScore=q(e.context.overallScore,2),e.context.canaryScoreMessage||(e.context.canaryScoreMessage=this.getLastCanaryScoreMessage(t)),!e.isCanceled)){const t=x(e,"context.overallScore",null),n=x(e,"context.canaryConfig.scoreThresholds.marginal",null);"SUCCEEDED"===e.status||t&&t>n?e.context.overallResult="success":e.context.overallHealth="unhealthy"}}getLastCanaryRunScore(e=[]){const t=e.filter((e=>"number"==typeof e.getValueFor("canaryScore"))).map((e=>e.getValueFor("canaryScore")));return $(t)}getLastCanaryScoreMessage(e=[]){const t=e.filter((e=>e.getValueFor("canaryScoreMessage"))).map((e=>e.getValueFor("canaryScoreMessage")));return $(t)}addExceptions(e,t){e.forEach((e=>{this.getException(e)&&t.push(this.getException(e));const n=x(e,"context.overallScore",null),r=x(e,"context.canaryConfig.scoreThresholds.marginal",null),a=x(e,"context.canaryScoreMessage",null);n&&a&&n<=r&&t.push(a)}))}getException(e){return e&&e.isFailed?e.context&&e.context.exception&&e.context.exception.details&&e.context.exception.details.responseBody?e.context.exception.details.responseBody:e.failureMessage:null}}const Fa={transclude:{sectionHeader:"?sectionHeader"},bindings:{title:"@"},template:'\n <section>\n <ul class="list-inline">\n <li><h5>{{ $ctrl.title }}</h5></li>\n <li><span ng-transclude="sectionHeader"></span></li>\n </ul>\n <div class="horizontal-rule"></div>\n <ng-transclude></ng-transclude>\n </section>\n '};t("spinnaker.kayenta.stageConfigSection",[]).component("kayentaStageConfigSection",Fa);ha(".kayenta {\n width: 100%;\n}\n.kayenta button[disabled] {\n cursor: not-allowed;\n opacity: 0.4;\n}\n.kayenta.kayenta-root {\n overflow: hidden;\n}\n.kayenta .spinner {\n position: inherit;\n}\n.kayenta .list-detail > .col-md-2,\n.kayenta .list-detail .col-md-10 {\n padding-left: 0;\n padding-right: 0;\n}\n.kayenta .config-list ul {\n max-height: calc(70vh - 44px);\n overflow: auto;\n}\n@media screen and (max-height: 1000px) {\n .kayenta .config-list ul {\n max-height: 55vh;\n }\n}\n@media screen and (max-height: 700px) {\n .kayenta .config-list ul {\n max-height: 45vh;\n }\n}\n.kayenta .config-detail {\n padding: 0 1rem 1rem;\n margin-bottom: 40px;\n overflow-y: auto;\n}\n.kayenta .config-detail .config-detail-header {\n padding: 5px 15px 7px 0;\n}\n.kayenta .config-detail .config-detail-header .heading-1 {\n margin: 3px 0 0 0;\n}\n.kayenta .config-detail .config-detail-edit-warning {\n padding: 12px;\n margin-bottom: 12px;\n}\n.kayenta .config-detail .config-detail-edit-warning i.fa {\n color: var(--color-notice);\n font-size: 32px;\n}\n.kayenta .config-detail .contents .native-table-header {\n padding-top: 10px;\n}\n.kayenta .group-tabs .fas.fa-pencil-alt {\n padding-left: 1rem;\n font-size: smaller;\n}\n.kayenta .group-tabs .fas.fa-pencil-alt.disabled {\n color: var(--color-accessory);\n}\n.kayenta .group-tabs .tabs-basic input {\n text-transform: none;\n font-weight: normal;\n}\n.kayenta .table-header.sticky-header {\n background-color: var(--color-alabaster);\n}\n.kayenta .table-header h6 {\n font-weight: 600;\n}\n.kayenta .table-row > div,\n.kayenta .table-row > td {\n padding: 0.8rem 0;\n}\n.kayenta .table-row i.fa,\n.kayenta .table-row i.far {\n padding: 0 0.5rem;\n cursor: pointer;\n}\n.kayenta .table-row i.fa.fa-edit,\n.kayenta .table-row i.far.fa-edit,\n.kayenta .table-row i.fa.fa-folder,\n.kayenta .table-row i.far.fa-folder {\n font-weight: 100;\n}\n.kayenta .table-row i.fa.fa-folder,\n.kayenta .table-row i.far.fa-folder {\n margin-top: 0.2rem;\n}\n.kayenta .table-row i.fa.fa-trash,\n.kayenta .table-row i.far.fa-trash {\n font-size: small;\n margin-top: 0.1rem;\n}\n.kayenta .table-row g {\n margin-top: -0.25rem;\n margin-right: 0.1rem;\n}\n.kayenta .table-header,\n.kayenta .table-row {\n border-bottom: 1px solid var(--color-divider);\n}\n.kayenta .table-header h6,\n.kayenta .table-row h6 {\n margin-bottom: 5px;\n}\n.kayenta .table-header.background-white,\n.kayenta .table-row.background-white {\n background-color: var(--color-white);\n}\n.kayenta .table-header.selected,\n.kayenta .table-row.selected {\n background-color: var(--color-accent-g2);\n}\n.kayenta .native-table-header {\n position: sticky;\n top: 0;\n background-color: var(--color-alabaster);\n box-shadow: 0 1px 0 var(--color-divider);\n}\n.kayenta .metric-list {\n top: -10px;\n}\n.kayenta .header-transparent .native-table-header {\n background-color: transparent;\n}\n.kayenta .header-white .native-table-header {\n background-color: white;\n}\n.kayenta .flex-1 {\n min-height: 0;\n}\n");function Ba({children:e,className:t}){return K.createElement("div",{className:fa("styleguide","kayenta",t)},e)}const Ua=({rows:e=[],columns:t,className:n})=>K.createElement("thead",{className:n},K.createElement("tr",null,t.map((({label:t,labelClassName:n,hide:r},a)=>K.createElement("th",{key:t||a,className:"native-table-header"},(!r||!e.every(r))&&K.createElement("h6",{className:fa("heading-6","uppercase","color-text-primary",n)},t))))));function Wa({rows:e,columns:t,rowKey:n,tableBodyClassName:r,rowClassName:a,onRowClick:o,customRow:i,className:s,headerClassName:c}){const l=({row:e})=>K.createElement("tr",{onClick:o?()=>o(e):null,className:fa({"table-row":!a},a&&a(e))},t.map((({label:t,hide:n,getContent:r},a)=>K.createElement("td",{key:t||a},(!n||!n(e))&&r(e)))));return K.createElement("table",{className:s},K.createElement(Ua,{rows:e,columns:t,className:fa("table-header",c)}),K.createElement("tbody",{className:r},e.map((e=>i&&i(e)?K.createElement("td",{key:n(e)},i(e)):K.createElement(l,{key:n(e),row:e})))))}function za({canaryRun:e,firstScopeName:t}){const n="Copy timestamp to clipboard as UTC instant in ISO-8601 format";return K.createElement("section",{className:"small"},K.createElement("ul",{className:"list-unstyled"},K.createElement("li",null,K.createElement("b",null,"Start:")," ",y(Date.parse(e.context.scopes[t].experimentScope.start)),K.createElement(v,{displayText:!1,text:e.context.scopes[t].experimentScope.start,toolTip:n})),K.createElement("li",null,K.createElement("b",null,"End:")," ",y(Date.parse(e.context.scopes[t].experimentScope.end)),K.createElement(v,{displayText:!1,text:e.context.scopes[t].experimentScope.end,toolTip:n}))))}function Ga({canaryRun:e}){if(!k(e,"context.canaryConfigId")||!k(e,"context.canaryPipelineExecutionId")||"RUNNING"===e.status)return null;return K.createElement("i",{className:"fa fa-chart-bar clickable",onClick:()=>a.$state.go("home.applications.application.canary.report.reportDetail",{configId:e.context.canaryConfigId,runId:e.context.canaryPipelineExecutionId})})}function Ha({messages:e}){return K.createElement("div",null,e.map(((e,t)=>K.createElement("p",{key:`${t}-${e}`},e))))}ha(".canary-run-summaries .native-table-header {\n background-color: transparent;\n}\n");t("spinnaker.kayenta.canaryRunSummaries.component",[]).component("canaryRunSummaries",da(s((function({canaryRuns:e,firstScopeName:t}){const n=[{label:"Canary Result",getContent:e=>K.createElement(K.Fragment,null,K.createElement(ga,{score:e.context.canaryScore,health:e.health,result:e.result,inverse:!1,className:"label"}),x(e,["context","warnings"],[]).length>0&&K.createElement(m,{template:K.createElement(Ha,{messages:e.context.warnings})},K.createElement("i",{className:"fa fa-exclamation-triangle",style:{paddingLeft:"8px"}})))},{label:"Duration",getContent:e=>K.createElement("span",null,e.context.durationString||" - ")},{label:"Last Updated",getContent:e=>K.createElement("span",null,y(e.context.lastUpdated))},{getContent:e=>{const n=K.createElement(za,{canaryRun:e,firstScopeName:t});return K.createElement("section",{className:"horizontal text-center"},K.createElement("div",{className:"flex-1"},K.createElement(Ga,{canaryRun:e})),K.createElement("div",{className:"flex-1"},K.createElement(m,{template:n},K.createElement("i",{className:"far fa-clock"}))))}}];return K.createElement(Ba,{className:"horizontal flex-1"},K.createElement(Wa,{rows:e,className:"header-transparent flex-1",columns:n,rowKey:e=>e.id}))}),"canaryRunSummaries"),["canaryRuns","firstScopeName"]));ha(".canary-config-section .col-md-6,\n.canary-config-section .col-md-8 {\n margin-top: 5px;\n}\n");class Ka{constructor(e,t,n){this.$scope=e,this.$stateParams=t,this.executionDetailsSectionService=n,this.$scope.configSections=["canarySummary","canaryConfig","taskStatus"],this.$scope.$on("$stateChangeSuccess",(()=>this.initialize()))}$onInit(){this.initialize()}initialize(){this.executionDetailsSectionService.synchronizeSection(this.$scope.configSections,(()=>this.initialized()))}initialized(){this.$scope.detailsSection=this.$stateParams.details,this.$scope.application.ready().then((()=>{if("kayentaCanary"!==this.$scope.stage.type)return;const e=this.$scope.application.getDataSource("canaryConfigs").data.find((e=>e.id===this.$scope.stage.context.canaryConfig.canaryConfigId));e&&(this.canaryConfigName=e.name)})),this.setCanaryRuns(),this.resolveFirstScopeName(),this.resolveControlAndExperimentNames(),this.$scope.$watchCollection("stage.tasks",(()=>this.setCanaryRuns()))}setCanaryRuns(){this.canaryRuns=this.$scope.stage.tasks.filter((e=>e.type===Ia))}resolveFirstScopeName(){this.firstScopeName=this.$scope.stage.context.canaryConfig.scopes[0].scopeName}resolveControlAndExperimentNames(){this.$scope.stage.context.analysisType===ba.RealTimeAutomatic?(this.resolvedControl=this.$scope.stage.outputs.controlScope,this.resolvedExperiment=this.$scope.stage.outputs.experimentScope):(this.resolvedControl=this.canaryRuns.length?this.canaryRuns[0].context.scopes[this.firstScopeName].controlScope.scope:this.$scope.stage.context.canaryConfig.scopes[0].controlScope,this.resolvedExperiment=this.canaryRuns.length?this.canaryRuns[0].context.scopes[this.firstScopeName].experimentScope.scope:this.$scope.stage.context.canaryConfig.scopes[0].experimentScope)}}Ka.$inject=["$scope","$stateParams","executionDetailsSectionService"];t("spinnaker.kayenta.kayentaStageExecutionDetails.controller",["spinnaker.kayenta.canaryRunSummaries.component"]).controller("kayentaStageExecutionDetailsCtrl",Ka).filter("dateToMillis",(()=>Date.parse));const Va="spinnaker.kayenta";ae.featureDisabled?t("spinnaker.kayenta",[]):t("spinnaker.kayenta",["ui.router","spinnaker.kayenta.canaryScores.component","spinnaker.kayenta.score.component","spinnaker.kayenta.forAnalysisType.component","spinnaker.kayenta.analysisType.component","spinnaker.kayenta.stageConfigSection","spinnaker.kayenta.kayentaStageExecutionDetails.controller"]).controller("KayentaCanaryStageCtrl",La).run(["$uiRouter","applicationState",function(e,t){!function(){const e=(e,t)=>Promise.resolve(t);o.registerDataSource({optIn:!ae.optInAll,optional:!0,loader:e=>ae.showAllConfigs?ie():ie(e.name),onLoad:e,afterLoad:e=>_e.afterConfigsLoaded(e),description:"Canary analysis configuration and reporting",key:"canaryConfigs",label:"Canary",defaultData:[]}),o.registerDataSource({key:"canaryJudges",label:"Canary Configs",sref:".canary.canaryConfig",activeState:"**.canaryConfig.**",category:"delivery",requiresDataSource:"canaryConfigs",loader:ue,onLoad:e,afterLoad:e=>_e.afterJudgesLoaded(e),lazy:!0,autoActivate:!0,defaultData:[],iconName:"spMenuCanaryConfig"}),o.registerDataSource({key:"canaryExecutions",label:"Canary Reports",sref:".canary.report",activeState:"**.report.**",category:"delivery",requiresDataSource:"canaryConfigs",loader:e=>_e.loadCanaryExecutions(e),onLoad:e,afterLoad:e=>_e.afterCanaryExecutionsLoaded(e),lazy:!0,defaultData:[],iconName:"spMenuCanaryReport"})}(),function(e,t){const n=[{name:"canary",url:"/canary",lazyLoad:()=>import(/* webpackChunkName: "Lazy-Kayenta-Tabs" */"./lazy-011b9f6a.js").then((n=>n.lazyInitializeKayenta(e,t)))},{name:"canary.canaryConfig",url:"/config"},{name:"canary.canaryConfig.configDetail",url:"/:id?copy&new"},{name:"canary.canaryConfig.configDefault",url:""},{name:"canary.report",url:"/report?count"},{name:"canary.report.reportDetail",url:"/:configId/:runId"},{name:"canary.report.reportDefault",url:""}];["home.project","home.applications"].forEach((e=>{n.map((t=>Object.assign(Object.assign({},t),{name:`${e}.application.${t.name}`}))).forEach((e=>t.stateRegistry.register(e)))}))}(t,e),!1!==ae.stagesEnabled&&(b.pipeline.registerStage(Pa),b.pipeline.registerTransformer(new $a))}]);const Ja="load_config_request",Qa="load_config_success",Ya="load_config_failure",Xa="delete_config_request",Za="delete_config_success",eo="delete_config_failure",to="save_config_request",no="save_config_success",ro="save_config_failure",ao="delete_config_modal_open",oo="delete_config_modal_close",io="dismiss_save_config_error",so="set_executions_count",co="initialize",lo="add_metric",uo="rename_metric",po="edit_metric_begin",fo="edit_metric_modal_confirm",ho="edit_metric_modal_cancel",go="update_metric_direction",mo="update_metric_nan_strategy",yo="update_metric_outlier_strategy",vo="update_metric_criticality",bo="update_metric_data_required",_o="update_effect_size",wo="update_metric_group",Co="update_metric_scope_name",Oo="remove_metric",So="select_config",jo="clear_selected_config",xo="update_config_summaries",ko="add_group",Eo="select_group",To="update_config_name",Po="update_config_description",No="config_json_modal_open",Ro="config_json_modal_close",Mo="set_config_json",Ao="update_prometheus_metric_type",Lo="update_prometheus_metric_query_field",Io="update_prometheus_label_bindings",Do="update_prometheus_group_by_fields",qo="update_stackdriver_metric_type",$o="update_stackdriver_metric_query_field",Fo="update_stackdriver_group_by_fields",Bo="update_judges",Uo="select_judge_name",Wo="update_group_weight",zo="set_config_json_modal_tab_state",Go="update_atlas_query",Ho="update_datadog_metric_type",Ko="update_datadog_metric_name",Vo="update_newrelic_select",Jo="copy_selected_config",Qo="create_new_config",Yo="edit_group_name_begin",Xo="edit_group_name_confirm",Zo="edit_group_name_update",ei="change_metric_group",ti="change_metric_group_select",ni="change_metric_group_confirm",ri="load_run_request",ai="load_run_success",oi="load_run_failure",ii="toggle_metric_classification_filter",si="select_result_metric_group",ci="select_result_metric",li="load_metric_set_pair_request",ui="load_metric_set_pair_success",pi="load_metric_set_pair_failure",di="add_template",fi="edit_template_begin",hi="edit_template_cancel",gi="edit_template_confirm",mi="edit_template_name",yi="edit_template_value",vi="delete_template",bi="select_template",_i="edit_inline_template",wi="load_metrics_service_metadata_request",Ci="load_metrics_service_metadata_success",Oi="load_metrics_service_metadata_failure",Si="update_prometheus_metric_descriptor_filter",ji="update_graphite_metric_descriptor_filter",xi="update_stackdriver_metric_descriptor_filter",ki="update_datadog_metric_descriptor_filter",Ei="load_executions_request",Ti="load_executions_success",Pi="load_executions_failure",Ni="select_graph_type",Ri="load_kayenta_accounts_request",Mi="load_kayenta_accounts_success",Ai="load_kayenta_accounts_failure",Li="select_metric_store",Ii="update_signalfx_metric_name",Di="update_signalfx_aggregation_method",qi="update_signalfx_query_pairs",$i="update_graphite_metric_name";function Fi(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}function Bi(e,t,n,r){var a,o=arguments.length,i=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(o<3?a(i):o>3?a(t,n,i):a(t,n))||i);return o>3&&i&&Object.defineProperty(t,n,i),i}var Ui="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},Wi=function(e){if("function"!=typeof e)return function(t){zi.call(this,t,e)};zi.call(this,e)};function zi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("function"!=typeof e)throw new TypeError("The autoBindMethods decorator must be passed a function as the first argument. It received an argument of type "+(void 0===e?"undefined":Ui(e))+".");var n=e.prototype,r=t.methodsToIgnore,a=void 0===r?[]:r,o=t.dontOptimize,i=void 0!==o&&o,s="function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n)):Object.getOwnPropertyNames(n);a.length>0&&(s=s.filter((function(e){return-1===a.indexOf(e)}))),s.forEach((function(e){var t=Object.getOwnPropertyDescriptor(n,e),r=t.value,a=t.configurable;"function"==typeof r&&a&&Object.defineProperty(n,e,{get:function(){if(this.hasOwnProperty(e))return r;var n=r.bind(this);if(!i){var a=t.writable,o=t.enumerable;Object.defineProperty(this,e,{value:n,configurable:!0,writable:a,enumerable:o})}return n}})}))}var Gi=te.shape({trySubscribe:te.func.isRequired,tryUnsubscribe:te.func.isRequired,notifyNestedSubs:te.func.isRequired,isSubscribed:te.func.isRequired}),Hi=te.shape({subscribe:te.func.isRequired,dispatch:te.func.isRequired,getState:te.func.isRequired});function Ki(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vi(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}function Ji(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)}var Qi=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"store",n=arguments[1],r=n||t+"Subscription",a=function(e){function n(r,a){Ki(this,n);var o=Vi(this,e.call(this,r,a));return o[t]=r.store,o}return Ji(n,e),n.prototype.getChildContext=function(){var e;return(e={})[t]=this[t],e[r]=null,e},n.prototype.render=function(){return J.only(this.props.children)},n}(Q);return a.propTypes={store:Hi.isRequired,children:te.element.isRequired},a.childContextTypes=((e={})[t]=Hi.isRequired,e[r]=Gi,e),a}(),Yi=je((function(e,t){e.exports=function(){var e={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},t={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},n=Object.defineProperty,r=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,o=Object.getOwnPropertyDescriptor,i=Object.getPrototypeOf,s=i&&i(Object);return function c(l,u,p){if("string"!=typeof u){if(s){var d=i(u);d&&d!==s&&c(l,d,p)}var f=r(u);a&&(f=f.concat(a(u)));for(var h=0;h<f.length;++h){var g=f[h];if(!(e[g]||t[g]||p&&p[g])){var m=o(u,g);try{n(l,g,m)}catch(e){}}}return l}return l}}()})),Xi=function(e,t,n,r,a,o,i,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,a,o,i,s],u=0;(c=new Error(t.replace(/%s/g,(function(){return l[u++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}};var Zi={notify:function(){}};var es=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.store=t,this.parentSub=n,this.onStateChange=r,this.unsubscribe=null,this.listeners=Zi}return e.prototype.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},e.prototype.notifyNestedSubs=function(){this.listeners.notify()},e.prototype.isSubscribed=function(){return Boolean(this.unsubscribe)},e.prototype.trySubscribe=function(){var e,t;this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.onStateChange):this.store.subscribe(this.onStateChange),this.listeners=(e=[],t=[],{clear:function(){t=null,e=null},notify:function(){for(var n=e=t,r=0;r<n.length;r++)n[r]()},get:function(){return t},subscribe:function(n){var r=!0;return t===e&&(t=e.slice()),t.push(n),function(){r&&null!==e&&(r=!1,t===e&&(t=e.slice()),t.splice(t.indexOf(n),1))}}}))},e.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=Zi)},e}(),ts=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};function ns(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rs(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}function as(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)}function os(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var is=0,ss={};function cs(){}function ls(e,t){var n={run:function(r){try{var a=e(t.getState(),r);(a!==n.props||n.error)&&(n.shouldComponentUpdate=!0,n.props=a,n.error=null)}catch(e){n.shouldComponentUpdate=!0,n.error=e}}};return n}function us(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.getDisplayName,o=void 0===a?function(e){return"ConnectAdvanced("+e+")"}:a,i=r.methodName,s=void 0===i?"connectAdvanced":i,c=r.renderCountProp,l=void 0===c?void 0:c,u=r.shouldHandleStateChanges,p=void 0===u||u,d=r.storeKey,f=void 0===d?"store":d,h=r.withRef,g=void 0!==h&&h,m=os(r,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef"]),y=f+"Subscription",v=is++,b=((t={})[f]=Hi,t[y]=Gi,t),_=((n={})[y]=Gi,n);return function(t){Xi("function"==typeof t,"You must pass a component to the function returned by "+s+". Instead received "+JSON.stringify(t));var n=t.displayName||t.name||"Component",r=o(n),a=ts({},m,{getDisplayName:o,methodName:s,renderCountProp:l,shouldHandleStateChanges:p,storeKey:f,withRef:g,displayName:r,wrappedComponentName:n,WrappedComponent:t}),i=function(n){function o(e,t){ns(this,o);var a=rs(this,n.call(this,e,t));return a.version=v,a.state={},a.renderCount=0,a.store=e[f]||t[f],a.propsMode=Boolean(e[f]),a.setWrappedInstance=a.setWrappedInstance.bind(a),Xi(a.store,'Could not find "'+f+'" in either the context or props of "'+r+'". Either wrap the root component in a <Provider>, or explicitly pass "'+f+'" as a prop to "'+r+'".'),a.initSelector(),a.initSubscription(),a}return as(o,n),o.prototype.getChildContext=function(){var e,t=this.propsMode?null:this.subscription;return(e={})[y]=t||this.context[y],e},o.prototype.componentDidMount=function(){p&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},o.prototype.componentWillReceiveProps=function(e){this.selector.run(e)},o.prototype.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},o.prototype.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.notifyNestedSubs=cs,this.store=null,this.selector.run=cs,this.selector.shouldComponentUpdate=!1},o.prototype.getWrappedInstance=function(){return Xi(g,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+s+"() call."),this.wrappedInstance},o.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},o.prototype.initSelector=function(){var t=e(this.store.dispatch,a);this.selector=ls(t,this.store),this.selector.run(this.props)},o.prototype.initSubscription=function(){if(p){var e=(this.propsMode?this.props:this.context)[y];this.subscription=new es(this.store,e,this.onStateChange.bind(this)),this.notifyNestedSubs=this.subscription.notifyNestedSubs.bind(this.subscription)}},o.prototype.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=this.notifyNestedSubsOnComponentDidUpdate,this.setState(ss)):this.notifyNestedSubs()},o.prototype.notifyNestedSubsOnComponentDidUpdate=function(){this.componentDidUpdate=void 0,this.notifyNestedSubs()},o.prototype.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},o.prototype.addExtraProps=function(e){if(!(g||l||this.propsMode&&this.subscription))return e;var t=ts({},e);return g&&(t.ref=this.setWrappedInstance),l&&(t[l]=this.renderCount++),this.propsMode&&this.subscription&&(t[y]=this.subscription),t},o.prototype.render=function(){var e=this.selector;if(e.shouldComponentUpdate=!1,e.error)throw e.error;return Y(t,this.addExtraProps(e.props))},o}(Q);return i.WrappedComponent=t,i.displayName=r,i.childContextTypes=_,i.contextTypes=b,i.propTypes=b,Yi(i,t)}}var ps=Object.prototype.hasOwnProperty;function ds(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function fs(e,t){if(ds(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var a=0;a<n.length;a++)if(!ps.call(t,n[a])||!ds(e[n[a]],t[n[a]]))return!1;return!0}var hs="object"==typeof global&&global&&global.Object===Object&&global,gs="object"==typeof self&&self&&self.Object===Object&&self,ms=hs||gs||Function("return this")(),ys=ms.Symbol,vs=Object.prototype,bs=vs.hasOwnProperty,_s=vs.toString,ws=ys?ys.toStringTag:void 0;var Cs=Object.prototype.toString;var Os=ys?ys.toStringTag:void 0;function Ss(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Os&&Os in Object(e)?function(e){var t=bs.call(e,ws),n=e[ws];try{e[ws]=void 0;var r=!0}catch(e){}var a=_s.call(e);return r&&(t?e[ws]=n:delete e[ws]),a}(e):function(e){return Cs.call(e)}(e)}function js(e,t){return function(n){return e(t(n))}}var xs=js(Object.getPrototypeOf,Object);function ks(e){return null!=e&&"object"==typeof e}var Es=Function.prototype,Ts=Object.prototype,Ps=Es.toString,Ns=Ts.hasOwnProperty,Rs=Ps.call(Object);function Ms(e){if(!ks(e)||"[object Object]"!=Ss(e))return!1;var t=xs(e);if(null===t)return!0;var n=Ns.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ps.call(n)==Rs}var As=je((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n=e.Symbol;"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable";return t}})),Ls=je((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n,r,a=(n=As)&&n.__esModule?n:{default:n};r="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==Ce?Ce:e;var o=(0,a.default)(r);t.default=o})),Is=Ls,Ds="@@redux/INIT";function qs(e,t,n){var r;if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(qs)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var a=e,o=t,i=[],s=i,c=!1;function l(){s===i&&(s=i.slice())}function u(){return o}function p(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return l(),s.push(e),function(){if(t){t=!1,l();var n=s.indexOf(e);s.splice(n,1)}}}function d(e){if(!Ms(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(c)throw new Error("Reducers may not dispatch actions.");try{c=!0,o=a(o,e)}finally{c=!1}for(var t=i=s,n=0;n<t.length;n++){(0,t[n])()}return e}return d({type:Ds}),(r={dispatch:d,subscribe:p,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");a=e,d({type:Ds})}})[Is]=function(){var e,t=p;return(e={subscribe:function(e){if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[Is]=function(){return this},e},r}function $s(e,t){var n=t&&t.type;return"Given action "+(n&&'"'+n.toString()+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function Fs(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var a=t[r];"function"==typeof e[a]&&(n[a]=e[a])}var o=Object.keys(n),i=void 0;try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:Ds}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===n(void 0,{type:"@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".")}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+Ds+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')}))}(n)}catch(e){i=e}return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(i)throw i;for(var r=!1,a={},s=0;s<o.length;s++){var c=o[s],l=n[c],u=e[c],p=l(u,t);if(void 0===p){var d=$s(c,t);throw new Error(d)}a[c]=p,r=r||p!==u}return r?a:e}}function Bs(e,t){return function(){return t(e.apply(void 0,arguments))}}function Us(e){return function(t,n){var r=e(t,n);function a(){return r}return a.dependsOnOwnProps=!1,a}}function Ws(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function zs(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=Ws(e);var a=r(t,n);return"function"==typeof a&&(r.mapToProps=a,r.dependsOnOwnProps=Ws(a),a=r(t,n)),a},r}}var Gs=[function(e){return"function"==typeof e?zs(e):void 0},function(e){return e?void 0:Us((function(e){return{dispatch:e}}))},function(e){return e&&"object"==typeof e?Us((function(t){return function(e,t){if("function"==typeof e)return Bs(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var n=Object.keys(e),r={},a=0;a<n.length;a++){var o=n[a],i=e[o];"function"==typeof i&&(r[o]=Bs(i,t))}return r}(e,t)})):void 0}];var Hs=[function(e){return"function"==typeof e?zs(e):void 0},function(e){return e?void 0:Us((function(){return{}}))}],Ks=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};function Vs(e,t,n){return Ks({},n,e,t)}var Js=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r=n.pure,a=n.areMergedPropsEqual,o=!1,i=void 0;return function(t,n,s){var c=e(t,n,s);return o?r&&a(c,i)||(i=c):(o=!0,i=c),i}}}(e):void 0},function(e){return e?void 0:function(){return Vs}}];function Qs(e,t,n,r){return function(a,o){return n(e(a,o),t(r,o),o)}}function Ys(e,t,n,r,a){var o=a.areStatesEqual,i=a.areOwnPropsEqual,s=a.areStatePropsEqual,c=!1,l=void 0,u=void 0,p=void 0,d=void 0,f=void 0;function h(a,c){var h,g,m=!i(c,u),y=!o(a,l);return l=a,u=c,m&&y?(p=e(l,u),t.dependsOnOwnProps&&(d=t(r,u)),f=n(p,d,u)):m?(e.dependsOnOwnProps&&(p=e(l,u)),t.dependsOnOwnProps&&(d=t(r,u)),f=n(p,d,u)):y?(h=e(l,u),g=!s(h,p),p=h,g&&(f=n(p,d,u)),f):f}return function(a,o){return c?h(a,o):(p=e(l=a,u=o),d=t(r,u),f=n(p,d,u),c=!0,f)}}function Xs(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,a=t.initMergeProps,o=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),i=n(e,o),s=r(e,o),c=a(e,o);return(o.pure?Ys:Qs)(i,s,c,e,o)}var Zs=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};function ec(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function tc(e,t,n){for(var r=t.length-1;r>=0;r--){var a=t[r](e);if(a)return a}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function nc(e,t){return e===t}var rc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.connectHOC,n=void 0===t?us:t,r=e.mapStateToPropsFactories,a=void 0===r?Hs:r,o=e.mapDispatchToPropsFactories,i=void 0===o?Gs:o,s=e.mergePropsFactories,c=void 0===s?Js:s,l=e.selectorFactory,u=void 0===l?Xs:l;return function(e,t,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=o.pure,l=void 0===s||s,p=o.areStatesEqual,d=void 0===p?nc:p,f=o.areOwnPropsEqual,h=void 0===f?fs:f,g=o.areStatePropsEqual,m=void 0===g?fs:g,y=o.areMergedPropsEqual,v=void 0===y?fs:y,b=ec(o,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),_=tc(e,a,"mapStateToProps"),w=tc(t,i,"mapDispatchToProps"),C=tc(r,c,"mergeProps");return n(u,Zs({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:_,initMapDispatchToProps:w,initMergeProps:C,pure:l,areStatesEqual:d,areOwnPropsEqual:h,areStatePropsEqual:m,areMergedPropsEqual:v},b))}}();if(ae.atlasWebComponentsUrl){const e=window;if(e.React=K,e.ReactDOM=X,ae.atlasWebComponentsPolyfillUrl){const e=document.createElement("script");e.src=ae.atlasWebComponentsPolyfillUrl,document.head.appendChild(e)}const t=document.createElement("script");t.src=ae.atlasWebComponentsUrl,document.head.appendChild(t)}const ac=e=>x(e,"query.q","");let oc=class extends K.Component{constructor(e){super(e),this.state={webComponent:null}}bindComponent(e){this.setState({webComponent:e}),e&&(e.addEventListener("change.queryString",(e=>{this.props.updateQuery(e.detail)})),e.setAttribute("key","react"))}render(){const e=this.props.editingMetric,t=ac(e);return K.createElement("atlas-query-selector",{class:"spinnaker-theme",backends:"https://atlas-global.prod.netflix.net",hide:"add_scope,comparison,timeOffset,lineStyle,des,trend,lineWidth,axis,color,alpha,multi",query:t,ref:this.bindComponent})}};oc=Bi([Wi],oc);var ic=rc((function(e){return{editingMetric:e.selectedConfig.editingMetric}}),(function(e){return{updateQuery:t=>{e({type:"update_atlas_query",query:t})}}}))(oc);const sc=()=>new class{constructor(){this.delegates=[]}register(e){this.delegates.push(e)}getDelegate(e){return this.delegates.find((t=>t.name===e))}};var cc=sc();function lc(e){return e}function uc(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}cc.register({name:"atlas",metricConfigurer:ic,queryFinder:ac});function pc(e){if(!uc(e))return!1;var t=Ss(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function dc(e){return null===e}function fc(e){var t=arguments.length<=1||void 0===arguments[1]?lc:arguments[1],n=arguments[2];Xi(pc(t)||dc(t),"Expected payloadCreator to be a function, undefined or null");var r=dc(t)||t===lc?lc:function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return e instanceof Error?e:t.apply(void 0,[e].concat(r))},a=pc(n),o=e.toString(),i=function(){var t=r.apply(void 0,arguments),o={type:e};return t instanceof Error&&(o.error=!0),void 0!==t&&(o.payload=t),a&&(o.meta=n.apply(void 0,arguments)),o};return i.toString=function(){return o},i}function hc(e){return null==e}function gc(e){return void 0===e}function mc(e){return e!=e}function yc(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function vc(e){return null!=e&&yc(e.length)&&!pc(e)}var bc=Array.isArray;function _c(e){return"string"==typeof e||!bc(e)&&ks(e)&&"[object String]"==Ss(e)}var wc=/\s/;var Cc=/^\s+/;function Oc(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&wc.test(e.charAt(t)););return t}(e)+1).replace(Cc,""):e}function Sc(e){return"symbol"==typeof e||ks(e)&&"[object Symbol]"==Ss(e)}var jc=/^[-+]0x[0-9a-f]+$/i,xc=/^0b[01]+$/i,kc=/^0o[0-7]+$/i,Ec=parseInt;function Tc(e){return e?Infinity===(e=function(e){if("number"==typeof e)return e;if(Sc(e))return NaN;if(uc(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=uc(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Oc(e);var n=xc.test(e);return n||kc.test(e)?Ec(e.slice(2),n?2:8):jc.test(e)?NaN:+e}(e))||-Infinity===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function Pc(e,t){for(var n=-1,r=null==e?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a}function Nc(e){return ks(e)&&"[object Arguments]"==Ss(e)}var Rc=Object.prototype,Mc=Rc.hasOwnProperty,Ac=Rc.propertyIsEnumerable,Lc=Nc(function(){return arguments}())?Nc:function(e){return ks(e)&&Mc.call(e,"callee")&&!Ac.call(e,"callee")};var Ic="object"==typeof exports&&exports&&!exports.nodeType&&exports,Dc=Ic&&"object"==typeof module&&module&&!module.nodeType&&module,qc=Dc&&Dc.exports===Ic?ms.Buffer:void 0,$c=(qc?qc.isBuffer:void 0)||function(){return!1},Fc=/^(?:0|[1-9]\d*)$/;function Bc(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Fc.test(e))&&e>-1&&e%1==0&&e<t}var Uc={};Uc["[object Float32Array]"]=Uc["[object Float64Array]"]=Uc["[object Int8Array]"]=Uc["[object Int16Array]"]=Uc["[object Int32Array]"]=Uc["[object Uint8Array]"]=Uc["[object Uint8ClampedArray]"]=Uc["[object Uint16Array]"]=Uc["[object Uint32Array]"]=!0,Uc["[object Arguments]"]=Uc["[object Array]"]=Uc["[object ArrayBuffer]"]=Uc["[object Boolean]"]=Uc["[object DataView]"]=Uc["[object Date]"]=Uc["[object Error]"]=Uc["[object Function]"]=Uc["[object Map]"]=Uc["[object Number]"]=Uc["[object Object]"]=Uc["[object RegExp]"]=Uc["[object Set]"]=Uc["[object String]"]=Uc["[object WeakMap]"]=!1;var Wc,zc="object"==typeof exports&&exports&&!exports.nodeType&&exports,Gc=zc&&"object"==typeof module&&module&&!module.nodeType&&module,Hc=Gc&&Gc.exports===zc&&hs.process,Kc=function(){try{var e=Gc&&Gc.require&&Gc.require("util").types;return e||Hc&&Hc.binding&&Hc.binding("util")}catch(e){}}(),Vc=Kc&&Kc.isTypedArray,Jc=Vc?(Wc=Vc,function(e){return Wc(e)}):function(e){return ks(e)&&yc(e.length)&&!!Uc[Ss(e)]},Qc=Object.prototype.hasOwnProperty;function Yc(e,t){var n=bc(e),r=!n&&Lc(e),a=!n&&!r&&$c(e),o=!n&&!r&&!a&&Jc(e),i=n||r||a||o,s=i?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=s.length;for(var l in e)!t&&!Qc.call(e,l)||i&&("length"==l||a&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Bc(l,c))||s.push(l);return s}var Xc=Object.prototype;function Zc(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Xc)}var el=js(Object.keys,Object),tl=Object.prototype.hasOwnProperty;function nl(e){if(!Zc(e))return el(e);var t=[];for(var n in Object(e))tl.call(e,n)&&"constructor"!=n&&t.push(n);return t}function rl(e){return null==e?[]:function(e,t){return Pc(t,(function(t){return e[t]}))}(e,function(e){return vc(e)?Yc(e):nl(e)}(e))}var al=Math.max;function ol(e,t,n,r){e=vc(e)?e:rl(e),n=n&&!r?function(e){var t=Tc(e),n=t%1;return t==t?n?t-n:t:0}(n):0;var a=e.length;return n<0&&(n=al(a+n,0)),_c(e)?n<=a&&e.indexOf(t,n)>-1:!!a&&function(e,t,n){return t==t?function(e,t,n){for(var r=n-1,a=e.length;++r<a;)if(e[r]===t)return r;return-1}(e,t,n):function(e,t,n,r){for(var a=e.length,o=n+(r?1:-1);r?o--:++o<a;)if(t(e[o],o,e))return o;return-1}(e,mc,n)}(e,t,n)>-1}var il=ms["__core-js_shared__"],sl=function(){var e=/[^.]+$/.exec(il&&il.keys&&il.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var cl=Function.prototype.toString;function ll(e){if(null!=e){try{return cl.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var ul=/^\[object .+?Constructor\]$/,pl=Function.prototype,dl=Object.prototype,fl=pl.toString,hl=dl.hasOwnProperty,gl=RegExp("^"+fl.call(hl).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ml(e){return!(!uc(e)||function(e){return!!sl&&sl in e}(e))&&(pc(e)?gl:ul).test(ll(e))}function yl(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ml(n)?n:void 0}var vl=yl(ms,"DataView"),bl=yl(ms,"Map"),_l=yl(ms,"Promise"),wl=yl(ms,"Set"),Cl=yl(ms,"WeakMap"),Ol=ll(vl),Sl=ll(bl),jl=ll(_l),xl=ll(wl),kl=ll(Cl),El=Ss;(vl&&"[object DataView]"!=El(new vl(new ArrayBuffer(1)))||bl&&"[object Map]"!=El(new bl)||_l&&"[object Promise]"!=El(_l.resolve())||wl&&"[object Set]"!=El(new wl)||Cl&&"[object WeakMap]"!=El(new Cl))&&(El=function(e){var t=Ss(e),n="[object Object]"==t?e.constructor:void 0,r=n?ll(n):"";if(r)switch(r){case Ol:return"[object DataView]";case Sl:return"[object Map]";case jl:return"[object Promise]";case xl:return"[object Set]";case kl:return"[object WeakMap]"}return t});var Tl=El,Pl=Object.prototype.hasOwnProperty;var Nl=ys?ys.prototype:void 0,Rl=Nl?Nl.toString:void 0;function Ml(e){if("string"==typeof e)return e;if(bc(e))return Pc(e,Ml)+"";if(Sc(e))return Rl?Rl.call(e):"";var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}function Al(e){return null==e?"":Ml(e)}function Ll(e){return _c(e)||pc(e)||Sc(e)}function Il(e){return!function(e){if(null==e)return!0;if(vc(e)&&(bc(e)||"string"==typeof e||"function"==typeof e.splice||$c(e)||Jc(e)||Lc(e)))return!e.length;var t=Tl(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(Zc(e))return!nl(e).length;for(var n in e)if(Pl.call(e,n))return!1;return!0}(e)&&e.every(Ll)}function Dl(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];Xi(Il(t),"Expected action types to be strings, symbols, or action creators");var r=t.map(Al).join("||");return{toString:function(){return r}}}var ql=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var i,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(a)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function $l(e){var t=arguments.length<=1||void 0===arguments[1]?lc:arguments[1],n=arguments[2],r=e.toString().split("||");Xi(!gc(n),"defaultState for reducer handling "+r.join(", ")+" should be defined"),Xi(pc(t)||Ms(t),"Expected reducer to be a function or object with next and throw reducers");var a=pc(t)?[t,t]:[t.next,t.throw].map((function(e){return hc(e)?lc:e})),o=ql(a,2),i=o[0],s=o[1];return function(){var e=arguments.length<=0||void 0===arguments[0]?n:arguments[0],t=arguments[1],a=t.type;return a&&ol(r,a.toString())?(!0===t.error?s:i)(e,t):e}}var Fl=Oe(je((function(e,t){t.__esModule=!0,t.default=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,n){return t.reduce((function(e,t){return t(e,n)}),e)}},e.exports=t.default})));function Bl(e){if("undefined"!=typeof Reflect&&"function"==typeof Reflect.ownKeys)return Reflect.ownKeys(e);var t=Object.getOwnPropertyNames(e);return"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e))),t}var Ul,Wl=(Ul=function(e){return Ms(e)&&!function(e){var t=Bl(e),n=t.every((function(e){return"next"===e||"throw"===e}));return t.length&&t.length<=2&&n}(e)},function e(t){var n=arguments.length<=1||void 0===arguments[1]?"/":arguments[1],r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],a=arguments.length<=3||void 0===arguments[3]?"":arguments[3];function o(e){return a?""+a+n+e:e}return Bl(t).forEach((function(a){var i=o(a),s=t[a];Ul(s)?e(t[a],n,r,i):r[i]=t[a]})),r});function zl(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)}function Gl(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],r=n.namespace;Xi(Ms(e),"Expected handlers to be an plain object.");var a=Wl(e,r),o=Bl(a).map((function(e){return $l(e,a[e],t)})),i=Fl.apply(void 0,zl(o));return function(){var e=arguments.length<=0||void 0===arguments[0]?t:arguments[0],n=arguments[1];return i(e,n)}}const Hl=fc("toggle_metric_classification_filter"),Kl=fc("set_executions_count"),Vl=fc("delete_config_modal_open"),Jl=fc("delete_config_modal_close"),Ql=fc("delete_config_request"),Yl=fc("config_json_modal_close"),Xl=fc("config_json_modal_open"),Zl=fc("edit_metric_modal_cancel"),eu=fc("edit_metric_modal_confirm"),tu=fc("update_metric_direction"),nu=fc("update_metric_nan_strategy"),ru=fc("update_metric_outlier_strategy"),au=fc("update_metric_criticality"),ou=fc("update_metric_data_required"),iu=fc("update_effect_size"),su=fc("update_metric_group"),cu=fc("add_group"),lu=fc("save_config_request"),uu=fc("dismiss_save_config_error"),pu=fc("set_config_json_modal_tab_state"),du=fc("set_config_json"),fu=fc("delete_config_success"),hu=fc("load_config_request"),gu=fc("save_config_success"),mu=fc(So),yu=fc("clear_selected_config"),vu=fc("rename_metric"),bu=fc("select_group"),_u=fc("update_group_weight"),wu=fc("select_judge_name"),Cu=fc("edit_metric_begin"),Ou=fc(Oo),Su=fc(lo),ju=fc("update_config_name"),xu=fc("update_config_description"),ku=fc("save_config_failure"),Eu=fc("delete_config_failure"),Tu=fc("update_config_summaries"),Pu=fc("update_judges"),Nu=fc("load_config_success"),Ru=fc("load_config_failure"),Mu=fc("copy_selected_config"),Au=fc("create_new_config"),Lu=fc("edit_group_name_begin"),Iu=fc("edit_group_name_update"),Du=fc("edit_group_name_confirm"),qu=fc("change_metric_group_select"),$u=fc(ni),Fu=fc("load_run_request"),Bu=fc(ai),Uu=fc("load_run_failure"),Wu=fc(si),zu=fc(ci),Gu=fc("load_metric_set_pair_request"),Hu=fc("load_metric_set_pair_success"),Ku=fc("load_metric_set_pair_failure"),Vu=fc("add_template"),Ju=fc("edit_template_begin"),Qu=fc("edit_template_confirm"),Yu=fc("edit_template_cancel"),Xu=fc("edit_template_name"),Zu=fc("edit_template_value"),ep=fc("edit_inline_template"),tp=fc("update_prometheus_label_bindings"),np=fc("update_prometheus_group_by_fields"),rp=fc("update_prometheus_metric_query_field"),ap=fc("update_stackdriver_group_by_fields"),op=fc("delete_template"),ip=fc("select_template"),sp=fc("change_metric_group"),cp=fc("load_metrics_service_metadata_request"),lp=fc("load_metrics_service_metadata_success"),up=fc("load_metrics_service_metadata_failure"),pp=fc("update_prometheus_metric_descriptor_filter"),dp=fc("update_graphite_metric_descriptor_filter"),fp=fc("update_stackdriver_metric_descriptor_filter"),hp=fc("update_datadog_metric_descriptor_filter"),gp=fc("update_stackdriver_metric_query_field"),mp=fc("update_datadog_metric_name"),yp=fc("update_newrelic_select");fc("load_executions_request");const vp=fc("load_executions_failure"),bp=fc("load_executions_success"),_p=fc("select_graph_type");fc("load_kayenta_accounts_request");const wp=fc("load_kayenta_accounts_success"),Cp=fc("load_kayenta_accounts_failure"),Op=fc("select_metric_store"),Sp=fc("update_signalfx_metric_name"),jp=fc("update_signalfx_aggregation_method"),xp=fc("update_signalfx_query_pairs"),kp=fc("update_graphite_metric_name");function Ep({label:e,helpId:t,children:n,checkbox:r,error:a,warning:o,inputOnly:i}){const s={};return i||(s.marginTop="5px"),r&&(s.marginBottom="0"),K.createElement("div",{className:"form-group row"},K.createElement("label",{className:"col-sm-2 control-label sm-label-right"},e," ",t&&K.createElement(c,{id:t})),K.createElement("div",{className:fa("col-sm-10",{checkbox:r}),style:s},n,a&&K.createElement(_,{type:"error",message:a}),o&&K.createElement(_,{type:"warning",message:o})))}var Tp=function(){return Te.Date.now()},Pp=/\s/;var Np=function(e){for(var t=e.length;t--&&Pp.test(e.charAt(t)););return t},Rp=/^\s+/;var Mp=function(e){return e?e.slice(0,Np(e)+1).replace(Rp,""):e},Ap=/^[-+]0x[0-9a-f]+$/i,Lp=/^0b[01]+$/i,Ip=/^0o[0-7]+$/i,Dp=parseInt;var qp=function(e){if("number"==typeof e)return e;if(Tr(e))return NaN;if(Fe(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Fe(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Mp(e);var n=Lp.test(e);return n||Ip.test(e)?Dp(e.slice(2),n?2:8):Ap.test(e)?NaN:+e},$p=Math.max,Fp=Math.min;var Bp=function(e,t,n){var r,a,o,i,s,c,l=0,u=!1,p=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var n=r,o=a;return r=a=void 0,l=t,i=e.apply(o,n)}function h(e){return l=e,s=setTimeout(m,t),u?f(e):i}function g(e){var n=e-c;return void 0===c||n>=t||n<0||p&&e-l>=o}function m(){var e=Tp();if(g(e))return y(e);s=setTimeout(m,function(e){var n=t-(e-c);return p?Fp(n,o-(e-l)):n}(e))}function y(e){return s=void 0,d&&r?f(e):(r=a=void 0,i)}function v(){var e=Tp(),n=g(e);if(r=arguments,a=this,c=e,n){if(void 0===s)return h(c);if(p)return clearTimeout(s),s=setTimeout(m,t),f(c)}return void 0===s&&(s=setTimeout(m,t)),i}return t=qp(t)||0,Fe(n)&&(u=!!n.leading,o=(p="maxWait"in n)?$p(qp(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d),v.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=c=a=s=void 0},v.flush=function(){return void 0===s?i:y(Tp())},v},Up=ff;var Wp=function(e,t){var n=t.allowNew,r=t.labelKey,a=t.text;return!(!n||!a.trim())&&("function"==typeof n?n(e,t):!e.some((function(e){return(0,Up.getOptionLabel)(e,r)===a})))},zp=Object.defineProperty({default:Wp},"__esModule",{value:!0});var Gp=function(e,t){return Or(e,t)};for(var Hp=function(e){return"string"==typeof e||!Lt(e)&&Tt(e)&&"[object String]"==$e(e)},Kp=function(e){return e.replace(/[\u0300-\u036F]/g,"").replace(/[^\u0000-\u007E]/g,(function(e){return Jp[e]||e}))},Vp=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹÐ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"OE",letters:"Œ"},{base:"oe",letters:"œ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Jp={},Qp=0;Qp<Vp.length;Qp++)for(var Yp=Vp[Qp].letters,Xp=0;Xp<Yp.length;Xp++)Jp[Yp[Xp]]=Vp[Qp].base;var Zp,ed=Object.defineProperty({default:Kp},"__esModule",{value:!0}),td=function(e,t){if(!e&&-1!==t.indexOf("deprecated")){if(ad[t])return;ad[t]=!0}t="[react-bootstrap-typeahead] "+t;for(var n=arguments.length,r=Array(n>2?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];rd.default.apply(void 0,[e,t].concat(r))},nd=function(){ad={}},rd=(Zp=function(){})&&Zp.__esModule?Zp:{default:Zp};var ad={};var od=Object.defineProperty({default:td,_resetWarned:nd},"__esModule",{value:!0}),id=function(e,t){var n=t.filterBy,r=t.labelKey,a=t.multiple,o=t.selected,i=t.text;if(a&&o.some((function(t){return(0,sd.default)(t,e)})))return!1;var s=n.slice();if((0,cd.default)(r)&&hd(i,r(e),t))return!0;(0,ld.default)(r)&&-1===s.indexOf(r)&&s.unshift(r);if((0,ld.default)(e))return(0,dd.default)(s.length<=1,"You cannot filter by properties when `option` is a string."),hd(i,e,t);return(0,ud.default)(s,(function(n){var r=e[n];return(0,ld.default)(r)||((0,dd.default)(!1,"Fields passed to `filterBy` should have string values. Value will be converted to a string; results may be unexpected."),r+=""),hd(i,r,t)}))},sd=fd(Gp),cd=fd(Be),ld=fd(Hp),ud=fd(sa),pd=fd(ed),dd=fd(od);function fd(e){return e&&e.__esModule?e:{default:e}}function hd(e,t,n){return n.caseSensitive||(e=e.toLowerCase(),t=t.toLowerCase()),n.ignoreDiacritics&&(e=(0,pd.default)(e),t=(0,pd.default)(t)),-1!==t.indexOf(e)}var gd=Object.defineProperty({default:id},"__esModule",{value:!0});var md=function(e){var t=e.a11yNumResults,n=e.a11yNumSelected,r=e.emptyLabel,a=e.isMenuShown,o=e.results,i=e.selected;return a?0===o.length?r:t(o):n(i)},yd=Object.defineProperty({default:md},"__esModule",{value:!0}),vd=function(e){return e.displayName||e.name||"Component"};var bd=Object.defineProperty({default:vd},"__esModule",{value:!0}),_d=/[|\\{}()[\]^$+*?.]/g,wd=function(e,t){var n=(t=new RegExp((0,Cd.default)((0,Od.default)(t)),"i")).exec((0,Od.default)(e));if(!n)return null;var r=n.index,a=n[0].length;if(jd.test(e)){for(var o=0;o<=r;o++)jd.test(e[o])&&r++;for(var i=r;i<=r+a;i++)jd.test(e[i])&&a++}return{end:r+a,start:r}},Cd=Sd((function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(_d,"\\$&")})),Od=Sd(ed);function Sd(e){return e&&e.__esModule?e:{default:e}}var jd=/[\u0300-\u036F]/;var xd=Object.defineProperty({default:wd},"__esModule",{value:!0}),kd=Ht(Object.getPrototypeOf,Object),Ed=Function.prototype,Td=Object.prototype,Pd=Ed.toString,Nd=Td.hasOwnProperty,Rd=Pd.call(Object);var Md=function(e){if(!Tt(e)||"[object Object]"!=$e(e))return!1;var t=kd(e);if(null===t)return!0;var n=Nd.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Pd.call(n)==Rd},Ad=je((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_LABELKEY="label"})),Ld=function(e){return"string"==typeof e?e:Ad.DEFAULT_LABELKEY};var Id=Object.defineProperty({default:Ld},"__esModule",{value:!0}),Dd=Fd(Xi),qd=Fd(Md),$d=Fd(Id);function Fd(e){return e&&e.__esModule?e:{default:e}}var Bd=function(e,t){if(e.paginationOption||e.customOption)return e[(0,$d.default)(t)];var n=void 0;return"string"==typeof e&&(n=e),"function"==typeof t?n=t(e):"string"==typeof t&&(0,qd.default)(e)&&(n=e[t]),"string"!=typeof n&&(0,Dd.default)(!1),n},Ud=Object.defineProperty({default:Bd},"__esModule",{value:!0}),Wd=Gd(xd),zd=Gd(Ud);function Gd(e){return e&&e.__esModule?e:{default:e}}var Hd=function(e){var t=e.activeItem,n=e.initialItem,r=e.isMenuShown,a=e.labelKey,o=e.multiple,i=e.selected,s=e.text;if(!s||!r||!n||n.customOption||t||i.length&&!o)return"";var c=(0,zd.default)(n,a),l=(0,Wd.default)(c.toLowerCase(),s.toLowerCase());return l&&0===l.start?s+c.slice(l.end,c.length):""},Kd=Object.defineProperty({default:Hd},"__esModule",{value:!0});var Vd=function(e){return e&&e.length?e[0]:void 0},Jd=Yd(Vd),Qd=Yd(Ud);function Yd(e){return e&&e.__esModule?e:{default:e}}var Xd=function(e){var t=e.activeItem,n=e.labelKey,r=e.multiple,a=e.selected,o=e.text;if(t)return t.paginationOption?o:(0,Qd.default)(t,n);var i=!r&&!!a.length&&(0,Jd.default)(a);return i?(0,Qd.default)(i,n):o},Zd=Object.defineProperty({default:Xd},"__esModule",{value:!0}),ef=function(e){return"rbt-menu-item-"+e};var tf=Object.defineProperty({default:ef},"__esModule",{value:!0});var nf=function(e,t){return!t||t>=e.length?e:e.slice(0,t)},rf=Object.defineProperty({default:nf},"__esModule",{value:!0}),af=function(e,t){var n=t.emptyLabel,r=t.minLength,a=t.showMenu,o=t.text;if(!a)return!1;if(o.length<r)return!1;return!(!e.length&&!n)};var of=Object.defineProperty({default:af},"__esModule",{value:!0}),sf=function(e,t,n){return n=n||e+"s",1===t?"1 "+e:t+" "+n};var cf=Object.defineProperty({default:sf},"__esModule",{value:!0}),lf=function(e){e.preventDefault()};var uf=Object.defineProperty({default:lf},"__esModule",{value:!0});var pf=function(e){if(Element.prototype.scrollIntoViewIfNeeded)e.scrollIntoViewIfNeeded();else{var t=e.getBoundingClientRect(),n=e.parentNode,r=n.getBoundingClientRect(),a=window.getComputedStyle(n,null),o=parseInt(a.getPropertyValue("border-top-width"));(t.top<r.top||t.bottom>r.bottom)&&(n.scrollTop=e.offsetTop-n.offsetTop-n.clientHeight/2-o+e.clientHeight/2)}},df=Object.defineProperty({default:pf},"__esModule",{value:!0}),ff=je((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.warn=t.stripDiacritics=t.scrollIntoViewIfNeeded=t.preventInputBlur=t.pluralize=t.isShown=t.getTruncatedOptions=t.getStringLabelKey=t.getOptionLabel=t.getMenuItemId=t.getMatchBounds=t.getInputText=t.getHintText=t.getDisplayName=t.getAccessibilityStatus=t.defaultFilterBy=t.addCustomOption=void 0;var n=b(zp),r=b(gd),a=b(yd),o=b(bd),i=b(Kd),s=b(Zd),c=b(xd),l=b(tf),u=b(Ud),p=b(Id),d=b(rf),f=b(of),h=b(cf),g=b(uf),m=b(df),y=b(ed),v=b(od);function b(e){return e&&e.__esModule?e:{default:e}}t.addCustomOption=n.default,t.defaultFilterBy=r.default,t.getAccessibilityStatus=a.default,t.getDisplayName=o.default,t.getHintText=i.default,t.getInputText=s.default,t.getMatchBounds=c.default,t.getMenuItemId=l.default,t.getOptionLabel=u.default,t.getStringLabelKey=p.default,t.getTruncatedOptions=d.default,t.isShown=f.default,t.pluralize=h.default,t.preventInputBlur=g.default,t.scrollIntoViewIfNeeded=m.default,t.stripDiacritics=y.default,t.warn=v.default})),hf=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},gf=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}}(),mf=bf(Bp),yf=bf(te),vf=bf(V);function bf(e){return e&&e.__esModule?e:{default:e}}function _f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wf(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}var Cf=function(e){var t=function(t){function n(){var e,t,r;_f(this,n);for(var a=arguments.length,o=Array(a),i=0;i<a;i++)o[i]=arguments[i];return t=r=wf(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(o))),r.state={query:""},r._getEmptyLabel=function(){var e=r.props,t=e.emptyLabel,n=e.isLoading,a=e.promptText,o=e.searchText,i=e.useCache,s=r.state.query;return s.length?n||i&&!r._cache[s]?o:t:a},r._handleInputChange=function(e,t){r.props.onInputChange&&r.props.onInputChange(e,t),r._handleSearchDebounced(e)},r._handleSearch=function(e){var t=r.props,n=t.minLength,a=t.onSearch,o=t.useCache;r.setState({query:e}),!e||n&&e.length<n||o&&r._cache[e]||a(e)},wf(r,t)}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)}(n,vf.default.Component),gf(n,[{key:"componentWillMount",value:function(){this._cache={},this._handleSearchDebounced=(0,mf.default)(this._handleSearch,this.props.delay)}},{key:"componentWillReceiveProps",value:function(e){var t=e.options,n=e.useCache;this.props.isLoading&&n&&(this._cache[this.state.query]=t)}},{key:"componentWillUnmount",value:function(){this._cache={},this._handleSearchDebounced.cancel()}},{key:"render",value:function(){var t=this,n=this.props,r=n.options,a=n.useCache,o=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(n,["options","useCache"]),i=this._cache[this.state.query],s=this._getEmptyLabel(),c=o.allowNew&&s===o.emptyLabel;return"function"==typeof o.allowNew&&(c=o.allowNew),vf.default.createElement(e,hf({},o,{allowNew:c,emptyLabel:s,onInputChange:this._handleInputChange,options:a&&i?i:r,ref:function(e){return t._instance=e}}))}},{key:"getInstance",value:function(){return this._instance.getInstance()}}]),n}();return t.displayName="AsyncContainer("+(0,Up.getDisplayName)(e)+")",t.propTypes={delay:yf.default.number,isLoading:yf.default.bool.isRequired,onSearch:yf.default.func.isRequired,options:yf.default.array,promptText:yf.default.node,searchText:yf.default.node,useCache:yf.default.bool},t.defaultProps={delay:200,minLength:2,options:[],promptText:"Type to search...",searchText:"Searching...",useCache:!0},t},Of=Object.defineProperty({default:Cf},"__esModule",{value:!0}),Sf=je((function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var a=arguments[r];if(a){var o=typeof a;if("string"===o||"number"===o)e.push(a);else if(Array.isArray(a)&&a.length){var i=n.apply(null,a);i&&e.push(i)}else if("object"===o)for(var s in a)t.call(a,s)&&a[s]&&e.push(s)}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n}()}));var jf=function(e,t,n,r){if(!Fe(e))return e;for(var a=-1,o=(t=Gr(t,e)).length,i=o-1,s=e;null!=s&&++a<o;){var c=Hr(t[a]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(a!=i){var u=s[c];void 0===(l=r?r(u,c,s):void 0)&&(l=Fe(u)?u:Ot(t[a+1])?[]:{})}st(s,c,l),s=s[c]}return e};var xf=function(e,t,n){for(var r=-1,a=t.length,o={};++r<a;){var i=t[r],s=Kr(e,i);n(s,i)&&jf(o,Gr(i,e),s)}return o};var kf=function(e,t){return xf(e,t,(function(t,n){return Yr(e,n)}))},Ef=Pe?Pe.isConcatSpreadable:void 0;var Tf=function(e){return Lt(e)||At(e)||!!(Ef&&e&&e[Ef])};var Pf=function e(t,n,r,a,o){var i=-1,s=t.length;for(r||(r=Tf),o||(o=[]);++i<s;){var c=t[i];n>0&&r(c)?n>1?e(c,n-1,r,a,o):Zn(o,c):a||(o[o.length]=c)}return o};var Nf=function(e){return(null==e?0:e.length)?Pf(e,1):[]};var Rf=function(e){return vt(dt(e,void 0,Nf),e+"")},Mf=Rf((function(e,t){return null==e?{}:kf(e,t)})),Af=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},Lf=qf(Sf),If=qf(V),Df=qf(te);function qf(e){return e&&e.__esModule?e:{default:e}}var $f=function(e){var t=e.bsSize,n=e.className,r=e.label,a=e.onClick,o=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["bsSize","className","label","onClick"]);return If.default.createElement("button",Af({},o,{"aria-label":r,className:(0,Lf.default)("close","rbt-close",{"rbt-close-lg":"large"===t||"lg"===t},n),onClick:function(e){e.stopPropagation(),a(e)},type:"button"}),If.default.createElement("span",{"aria-hidden":"true"},"×"),If.default.createElement("span",{className:"sr-only"},r))};$f.propTypes={bsSize:Df.default.oneOf(["large","lg","small","sm"]),label:Df.default.string,onClick:Df.default.func.isRequired},$f.defaultProps={label:"Clear"};var Ff=$f,Bf=Object.defineProperty({default:Ff},"__esModule",{value:!0}),Uf=Gf(Sf),Wf=Gf(V),zf=Gf(te);function Gf(e){return e&&e.__esModule?e:{default:e}}var Hf=function(e){var t=e.bsSize;return Wf.default.createElement("div",{className:(0,Uf.default)("rbt-loader",{"rbt-loader-lg":"large"===t||"lg"===t,"rbt-loader-sm":"small"===t||"sm"===t})})};Hf.propTypes={bsSize:zf.default.oneOf(["large","lg","small","sm"])};var Kf=Hf,Vf=Object.defineProperty({default:Kf},"__esModule",{value:!0}),Jf=je((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(t,n,r,a,o,i){var s=a||"<<anonymous>>",c=i||r;if(null==n[r])return t?new Error("Required "+o+" `"+c+"` was not specified in `"+s+"`."):null;for(var l=arguments.length,u=Array(l>6?l-6:0),p=6;p<l;p++)u[p-6]=arguments[p];return e.apply(void 0,[n,r,s,o,c].concat(u))}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n},e.exports=t.default})),Qf=je((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n="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},r=o(V),a=o(Jf);function o(e){return e&&e.__esModule?e:{default:e}}t.default=(0,a.default)((function(e,t,a,o,i){var s=e[t],c=void 0===s?"undefined":n(s);return r.default.isValidElement(s)?new Error("Invalid "+o+" `"+i+"` of type ReactElement supplied to `"+a+"`, expected a ReactComponent or a DOMElement. You can usually obtain a ReactComponent or DOMElement from a ReactElement by attaching a ref to it."):"object"===c&&"function"==typeof s.render||1===s.nodeType?null:new Error("Invalid "+o+" `"+i+"` of value `"+s+"` supplied to `"+a+"`, expected a ReactComponent or a DOMElement.")})),e.exports=t.default})),Yf=je((function(e,t){t.__esModule=!0,t.default=function(e,t){return e="function"==typeof e?e():e,n.default.findDOMNode(e)||t};var n=function(e){return e&&e.__esModule?e:{default:e}}(Z);e.exports=t.default})),Xf=je((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e&&e.ownerDocument||document},e.exports=t.default})),Zf=je((function(e,t){t.__esModule=!0,t.default=function(e){return(0,r.default)(n.default.findDOMNode(e))};var n=a(Z),r=a(Xf);function a(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default})),eh=je((function(e,t){t.__esModule=!0;var n=c(te),r=c(Qf),a=c(V),o=c(Z),i=c(Yf),s=c(Zf);function c(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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}var p=function(e){function t(){var n,r;l(this,t);for(var c=arguments.length,p=Array(c),d=0;d<c;d++)p[d]=arguments[d];return n=r=u(this,e.call.apply(e,[this].concat(p))),r._mountOverlayTarget=function(){r._overlayTarget||(r._overlayTarget=document.createElement("div"),r._portalContainerNode=(0,i.default)(r.props.container,(0,s.default)(r).body),r._portalContainerNode.appendChild(r._overlayTarget))},r._unmountOverlayTarget=function(){r._overlayTarget&&(r._portalContainerNode.removeChild(r._overlayTarget),r._overlayTarget=null),r._portalContainerNode=null},r._renderOverlay=function(){var e=r.props.children?a.default.Children.only(r.props.children):null;if(null!==e){r._mountOverlayTarget();var t=!r._overlayInstance;r._overlayInstance=o.default.unstable_renderSubtreeIntoContainer(r,e,r._overlayTarget,(function(){t&&r.props.onRendered&&r.props.onRendered()}))}else r._unrenderOverlay(),r._unmountOverlayTarget()},r._unrenderOverlay=function(){r._overlayTarget&&(o.default.unmountComponentAtNode(r._overlayTarget),r._overlayInstance=null)},r.getMountNode=function(){return r._overlayTarget},u(r,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,e),t.prototype.componentDidMount=function(){this._isMounted=!0,this._renderOverlay()},t.prototype.componentDidUpdate=function(){this._renderOverlay()},t.prototype.componentWillReceiveProps=function(e){this._overlayTarget&&e.container!==this.props.container&&(this._portalContainerNode.removeChild(this._overlayTarget),this._portalContainerNode=(0,i.default)(e.container,(0,s.default)(this).body),this._portalContainerNode.appendChild(this._overlayTarget))},t.prototype.componentWillUnmount=function(){this._isMounted=!1,this._unrenderOverlay(),this._unmountOverlayTarget()},t.prototype.render=function(){return null},t}(a.default.Component);p.displayName="Portal",p.propTypes={container:n.default.oneOfType([r.default,n.default.func]),onRendered:n.default.func},t.default=p,e.exports=t.default})),th=je((function(e,t){t.__esModule=!0;var n=l(te),r=l(Qf),a=l(V),o=l(Z),i=l(Yf),s=l(Zf),c=l(eh);function l(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(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}var d=function(e){function t(){var n,r;u(this,t);for(var a=arguments.length,o=Array(a),c=0;c<a;c++)o[c]=arguments[c];return n=r=p(this,e.call.apply(e,[this].concat(o))),r.setContainer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.props;r._portalContainerNode=(0,i.default)(e.container,(0,s.default)(r).body)},r.getMountNode=function(){return r._portalContainerNode},p(r,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,e),t.prototype.componentDidMount=function(){this.setContainer(),this.forceUpdate(this.props.onRendered)},t.prototype.componentWillReceiveProps=function(e){e.container!==this.props.container&&this.setContainer(e)},t.prototype.componentWillUnmount=function(){this._portalContainerNode=null},t.prototype.render=function(){return this.props.children&&this._portalContainerNode?o.default.createPortal(this.props.children,this._portalContainerNode):null},t}(a.default.Component);d.displayName="Portal",d.propTypes={container:n.default.oneOfType([r.default,n.default.func]),onRendered:n.default.func},t.default=o.default.createPortal?d:c.default,e.exports=t.default})),nh=je((function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)})),rh=je((function(e){var t=e.exports={version:"2.4.0"};"number"==typeof __e&&(__e=t)})),ah=function(e,t,n){if(function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!")}(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,a){return e.call(t,n,r,a)}}return function(){return e.apply(t,arguments)}},oh=function(e){return"object"==typeof e?null!==e:"function"==typeof e},ih=function(e){if(!oh(e))throw TypeError(e+" is not an object!");return e},sh=function(e){try{return!!e()}catch(e){return!0}},ch=!sh((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),lh=nh.document,uh=oh(lh)&&oh(lh.createElement),ph=function(e){return uh?lh.createElement(e):{}},dh=!ch&&!sh((function(){return 7!=Object.defineProperty(ph("div"),"a",{get:function(){return 7}}).a})),fh=function(e,t){if(!oh(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!oh(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!oh(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!oh(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},hh=Object.defineProperty,gh={f:ch?Object.defineProperty:function(e,t,n){if(ih(e),t=fh(t,!0),ih(n),dh)try{return hh(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},mh=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},yh=ch?function(e,t,n){return gh.f(e,t,mh(1,n))}:function(e,t,n){return e[t]=n,e},vh=function(e,t,n){var r,a,o,i=e&vh.F,s=e&vh.G,c=e&vh.S,l=e&vh.P,u=e&vh.B,p=e&vh.W,d=s?rh:rh[t]||(rh[t]={}),f=d.prototype,h=s?nh:c?nh[t]:(nh[t]||{}).prototype;for(r in s&&(n=t),n)(a=!i&&h&&void 0!==h[r])&&r in d||(o=a?h[r]:n[r],d[r]=s&&"function"!=typeof h[r]?n[r]:u&&a?ah(o,nh):p&&h[r]==o?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(o):l&&"function"==typeof o?ah(Function.call,o):o,l&&((d.virtual||(d.virtual={}))[r]=o,e&vh.R&&f&&!f[r]&&yh(f,r,o)))};vh.F=1,vh.G=2,vh.S=4,vh.P=8,vh.B=16,vh.W=32,vh.U=64,vh.R=128;var bh,_h=vh,wh={}.hasOwnProperty,Ch=function(e,t){return wh.call(e,t)},Oh={}.toString,Sh=function(e){return Oh.call(e).slice(8,-1)},jh=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==Sh(e)?e.split(""):Object(e)},xh=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},kh=function(e){return jh(xh(e))},Eh=Math.ceil,Th=Math.floor,Ph=function(e){return isNaN(e=+e)?0:(e>0?Th:Eh)(e)},Nh=Math.min,Rh=Math.max,Mh=Math.min,Ah=nh["__core-js_shared__"]||(nh["__core-js_shared__"]={}),Lh=function(e){return Ah[e]||(Ah[e]={})},Ih=0,Dh=Math.random(),qh=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++Ih+Dh).toString(36))},$h=Lh("keys"),Fh=function(e){return $h[e]||($h[e]=qh(e))},Bh=(bh=!1,function(e,t,n){var r,a,o=kh(e),i=(a=o.length)>0?Nh(Ph(a),9007199254740991):0,s=function(e,t){return(e=Ph(e))<0?Rh(e+t,0):Mh(e,t)}(n,i);if(bh&&t!=t){for(;i>s;)if((r=o[s++])!=r)return!0}else for(;i>s;s++)if((bh||s in o)&&o[s]===t)return bh||s||0;return!bh&&-1}),Uh=Fh("IE_PROTO"),Wh=function(e,t){var n,r=kh(e),a=0,o=[];for(n in r)n!=Uh&&Ch(r,n)&&o.push(n);for(;t.length>a;)Ch(r,n=t[a++])&&(~Bh(o,n)||o.push(n));return o},zh="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),Gh=Object.keys||function(e){return Wh(e,zh)},Hh={f:Object.getOwnPropertySymbols},Kh={f:{}.propertyIsEnumerable},Vh=function(e){return Object(xh(e))},Jh=Object.assign,Qh=!Jh||sh((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=Jh({},e)[n]||Object.keys(Jh({},t)).join("")!=r}))?function(e,t){for(var n=Vh(e),r=arguments.length,a=1,o=Hh.f,i=Kh.f;r>a;)for(var s,c=jh(arguments[a++]),l=o?Gh(c).concat(o(c)):Gh(c),u=l.length,p=0;u>p;)i.call(c,s=l[p++])&&(n[s]=c[s]);return n}:Jh;_h(_h.S+_h.F,"Object",{assign:Qh});var Yh=function(e){return e&&e.__esModule?e:{default:e}}({default:rh.Object.assign,__esModule:!0});var Xh=Yh.default||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},Zh=Object.defineProperty({default:Xh},"__esModule",{value:!0}),eg=Object.defineProperty({default:function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},"__esModule",{value:!0}),tg=yh,ng={},rg=ch?Object.defineProperties:function(e,t){ih(e);for(var n,r=Gh(t),a=r.length,o=0;a>o;)gh.f(e,n=r[o++],t[n]);return e},ag=nh.document&&document.documentElement,og=Fh("IE_PROTO"),ig=function(){},sg=function(){var e,t=ph("iframe"),n=zh.length;for(t.style.display="none",ag.appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),sg=e.F;n--;)delete sg.prototype[zh[n]];return sg()},cg=Object.create||function(e,t){var n;return null!==e?(ig.prototype=ih(e),n=new ig,ig.prototype=null,n[og]=e):n=sg(),void 0===t?n:rg(n,t)},lg=je((function(e){var t=Lh("wks"),n=nh.Symbol,r="function"==typeof n,a=e.exports=function(e){return t[e]||(t[e]=r&&n[e]||(r?n:qh)("Symbol."+e))};a.store=t})),ug=gh.f,pg=lg("toStringTag"),dg=function(e,t,n){e&&!Ch(e=n?e:e.prototype,pg)&&ug(e,pg,{configurable:!0,value:t})},fg={};yh(fg,lg("iterator"),(function(){return this}));var hg,gg=function(e,t,n){e.prototype=cg(fg,{next:mh(1,n)}),dg(e,t+" Iterator")},mg=Fh("IE_PROTO"),yg=Object.prototype,vg=Object.getPrototypeOf||function(e){return e=Vh(e),Ch(e,mg)?e[mg]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?yg:null},bg=lg("iterator"),_g=!([].keys&&"next"in[].keys()),wg=function(){return this},Cg=function(e,t,n,r,a,o,i){gg(n,t,r);var s,c,l,u=function(e){if(!_g&&e in h)return h[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},p=t+" Iterator",d="values"==a,f=!1,h=e.prototype,g=h[bg]||h["@@iterator"]||a&&h[a],m=g||u(a),y=a?d?u("entries"):m:void 0,v="Array"==t&&h.entries||g;if(v&&(l=vg(v.call(new e)))!==Object.prototype&&dg(l,p,!0),d&&g&&"values"!==g.name&&(f=!0,m=function(){return g.call(this)}),i&&(_g||f||!h[bg])&&yh(h,bg,m),ng[t]=m,ng[p]=wg,a)if(s={values:d?m:u("values"),keys:o?m:u("keys"),entries:y},i)for(c in s)c in h||tg(h,c,s[c]);else _h(_h.P+_h.F*(_g||f),t,s);return s},Og=(hg=!0,function(e,t){var n,r,a=String(xh(e)),o=Ph(t),i=a.length;return o<0||o>=i?hg?"":void 0:(n=a.charCodeAt(o))<55296||n>56319||o+1===i||(r=a.charCodeAt(o+1))<56320||r>57343?hg?a.charAt(o):n:hg?a.slice(o,o+2):r-56320+(n-55296<<10)+65536});Cg(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=Og(t,n),this._i+=e.length,{value:e,done:!1})}));var Sg=function(e,t){return{value:t,done:!!e}};Cg(Array,"Array",(function(e,t){this._t=kh(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,Sg(1)):Sg(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values"),ng.Arguments=ng.Array;for(var jg=lg("toStringTag"),xg=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],kg=0;kg<5;kg++){var Eg=xg[kg],Tg=nh[Eg],Pg=Tg&&Tg.prototype;Pg&&!Pg[jg]&&yh(Pg,jg,Eg),ng[Eg]=ng.Array}var Ng={f:lg},Rg={default:Ng.f("iterator"),__esModule:!0},Mg=je((function(e){var t=qh("meta"),n=gh.f,r=0,a=Object.isExtensible||function(){return!0},o=!sh((function(){return a(Object.preventExtensions({}))})),i=function(e){n(e,t,{value:{i:"O"+ ++r,w:{}}})},s=e.exports={KEY:t,NEED:!1,fastKey:function(e,n){if(!oh(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!Ch(e,t)){if(!a(e))return"F";if(!n)return"E";i(e)}return e[t].i},getWeak:function(e,n){if(!Ch(e,t)){if(!a(e))return!0;if(!n)return!1;i(e)}return e[t].w},onFreeze:function(e){return o&&s.NEED&&a(e)&&!Ch(e,t)&&i(e),e}}})),Ag=gh.f,Lg=function(e){var t=rh.Symbol||(rh.Symbol={});"_"==e.charAt(0)||e in t||Ag(t,e,{value:Ng.f(e)})},Ig=Array.isArray||function(e){return"Array"==Sh(e)},Dg=zh.concat("length","prototype"),qg={f:Object.getOwnPropertyNames||function(e){return Wh(e,Dg)}},$g=qg.f,Fg={}.toString,Bg="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Ug={f:function(e){return Bg&&"[object Window]"==Fg.call(e)?function(e){try{return $g(e)}catch(e){return Bg.slice()}}(e):$g(kh(e))}},Wg=Object.getOwnPropertyDescriptor,zg={f:ch?Wg:function(e,t){if(e=kh(e),t=fh(t,!0),dh)try{return Wg(e,t)}catch(e){}if(Ch(e,t))return mh(!Kh.f.call(e,t),e[t])}},Gg=Mg.KEY,Hg=zg.f,Kg=gh.f,Vg=Ug.f,Jg=nh.Symbol,Qg=nh.JSON,Yg=Qg&&Qg.stringify,Xg=lg("_hidden"),Zg=lg("toPrimitive"),em={}.propertyIsEnumerable,tm=Lh("symbol-registry"),nm=Lh("symbols"),rm=Lh("op-symbols"),am=Object.prototype,om="function"==typeof Jg,im=nh.QObject,sm=!im||!im.prototype||!im.prototype.findChild,cm=ch&&sh((function(){return 7!=cg(Kg({},"a",{get:function(){return Kg(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=Hg(am,t);r&&delete am[t],Kg(e,t,n),r&&e!==am&&Kg(am,t,r)}:Kg,lm=function(e){var t=nm[e]=cg(Jg.prototype);return t._k=e,t},um=om&&"symbol"==typeof Jg.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof Jg},pm=function(e,t,n){return e===am&&pm(rm,t,n),ih(e),t=fh(t,!0),ih(n),Ch(nm,t)?(n.enumerable?(Ch(e,Xg)&&e[Xg][t]&&(e[Xg][t]=!1),n=cg(n,{enumerable:mh(0,!1)})):(Ch(e,Xg)||Kg(e,Xg,mh(1,{})),e[Xg][t]=!0),cm(e,t,n)):Kg(e,t,n)},dm=function(e,t){ih(e);for(var n,r=function(e){var t=Gh(e),n=Hh.f;if(n)for(var r,a=n(e),o=Kh.f,i=0;a.length>i;)o.call(e,r=a[i++])&&t.push(r);return t}(t=kh(t)),a=0,o=r.length;o>a;)pm(e,n=r[a++],t[n]);return e},fm=function(e){var t=em.call(this,e=fh(e,!0));return!(this===am&&Ch(nm,e)&&!Ch(rm,e))&&(!(t||!Ch(this,e)||!Ch(nm,e)||Ch(this,Xg)&&this[Xg][e])||t)},hm=function(e,t){if(e=kh(e),t=fh(t,!0),e!==am||!Ch(nm,t)||Ch(rm,t)){var n=Hg(e,t);return!n||!Ch(nm,t)||Ch(e,Xg)&&e[Xg][t]||(n.enumerable=!0),n}},gm=function(e){for(var t,n=Vg(kh(e)),r=[],a=0;n.length>a;)Ch(nm,t=n[a++])||t==Xg||t==Gg||r.push(t);return r},mm=function(e){for(var t,n=e===am,r=Vg(n?rm:kh(e)),a=[],o=0;r.length>o;)!Ch(nm,t=r[o++])||n&&!Ch(am,t)||a.push(nm[t]);return a};om||(tg((Jg=function(){if(this instanceof Jg)throw TypeError("Symbol is not a constructor!");var e=qh(arguments.length>0?arguments[0]:void 0),t=function(n){this===am&&t.call(rm,n),Ch(this,Xg)&&Ch(this[Xg],e)&&(this[Xg][e]=!1),cm(this,e,mh(1,n))};return ch&&sm&&cm(am,e,{configurable:!0,set:t}),lm(e)}).prototype,"toString",(function(){return this._k})),zg.f=hm,gh.f=pm,qg.f=Ug.f=gm,Kh.f=fm,Hh.f=mm,Ng.f=function(e){return lm(lg(e))}),_h(_h.G+_h.W+_h.F*!om,{Symbol:Jg});for(var ym="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),vm=0;ym.length>vm;)lg(ym[vm++]);for(ym=Gh(lg.store),vm=0;ym.length>vm;)Lg(ym[vm++]);_h(_h.S+_h.F*!om,"Symbol",{for:function(e){return Ch(tm,e+="")?tm[e]:tm[e]=Jg(e)},keyFor:function(e){if(um(e))return function(e,t){for(var n,r=kh(e),a=Gh(r),o=a.length,i=0;o>i;)if(r[n=a[i++]]===t)return n}(tm,e);throw TypeError(e+" is not a symbol!")},useSetter:function(){sm=!0},useSimple:function(){sm=!1}}),_h(_h.S+_h.F*!om,"Object",{create:function(e,t){return void 0===t?cg(e):dm(cg(e),t)},defineProperty:pm,defineProperties:dm,getOwnPropertyDescriptor:hm,getOwnPropertyNames:gm,getOwnPropertySymbols:mm}),Qg&&_h(_h.S+_h.F*(!om||sh((function(){var e=Jg();return"[null]"!=Yg([e])||"{}"!=Yg({a:e})||"{}"!=Yg(Object(e))}))),"JSON",{stringify:function(e){if(void 0!==e&&!um(e)){for(var t,n,r=[e],a=1;arguments.length>a;)r.push(arguments[a++]);return"function"==typeof(t=r[1])&&(n=t),!n&&Ig(t)||(t=function(e,t){if(n&&(t=n.call(this,e,t)),!um(t))return t}),r[1]=t,Yg.apply(Qg,r)}}}),Jg.prototype[Zg]||yh(Jg.prototype,Zg,Jg.prototype.valueOf),dg(Jg,"Symbol"),dg(Math,"Math",!0),dg(nh.JSON,"JSON",!0),Lg("asyncIterator"),Lg("observable");var bm={default:rh.Symbol,__esModule:!0},_m=Om(Rg),wm=Om(bm),Cm="function"==typeof wm.default&&"symbol"==typeof _m.default?function(e){return typeof e}:function(e){return e&&"function"==typeof wm.default&&e.constructor===wm.default&&e!==wm.default.prototype?"symbol":typeof e};function Om(e){return e&&e.__esModule?e:{default:e}}var Sm="function"==typeof wm.default&&"symbol"===Cm(_m.default)?function(e){return void 0===e?"undefined":Cm(e)}:function(e){return e&&"function"==typeof wm.default&&e.constructor===wm.default&&e!==wm.default.prototype?"symbol":void 0===e?"undefined":Cm(e)},jm=Object.defineProperty({default:Sm},"__esModule",{value:!0}),xm=function(e){return e&&e.__esModule?e:{default:e}}(jm);var km=Object.defineProperty({default:function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,xm.default)(t))&&"function"!=typeof t?e:t}},"__esModule",{value:!0}),Em=function(e,t){if(ih(e),!oh(t)&&null!==t)throw TypeError(t+": can't set as prototype!")},Tm={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{(n=ah(Function.call,zg.f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,r){return Em(e,r),t?e.__proto__=r:n(e,r),e}}({},!1):void 0),check:Em};_h(_h.S,"Object",{setPrototypeOf:Tm.set});var Pm={default:rh.Object.setPrototypeOf,__esModule:!0};_h(_h.S,"Object",{create:cg});var Nm=rh.Object,Rm={default:function(e,t){return Nm.create(e,t)},__esModule:!0},Mm=Im(Pm),Am=Im(Rm),Lm=Im(jm);function Im(e){return e&&e.__esModule?e:{default:e}}for(var Dm=Object.defineProperty({default:function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,Lm.default)(t)));e.prototype=(0,Am.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Mm.default?(0,Mm.default)(e,t):e.__proto__=t)}},"__esModule",{value:!0}),qm="undefined"!=typeof window&&"undefined"!=typeof document,$m=["Edge","Trident","Firefox"],Fm=0,Bm=0;Bm<$m.length;Bm+=1)if(qm&&navigator.userAgent.indexOf($m[Bm])>=0){Fm=1;break}var Um=qm&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),Fm))}};function Wm(e){return e&&"[object Function]"==={}.toString.call(e)}function zm(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function Gm(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function Hm(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=zm(e),n=t.overflow,r=t.overflowX,a=t.overflowY;return/(auto|scroll|overlay)/.test(n+a+r)?e:Hm(Gm(e))}var Km=qm&&!(!window.MSInputMethodContext||!document.documentMode),Vm=qm&&/MSIE 10/.test(navigator.userAgent);function Jm(e){return 11===e?Km:10===e?Vm:Km||Vm}function Qm(e){if(!e)return document.documentElement;for(var t=Jm(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===zm(n,"position")?Qm(n):n:e?e.ownerDocument.documentElement:document.documentElement}function Ym(e){return null!==e.parentNode?Ym(e.parentNode):e}function Xm(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,a=n?t:e,o=document.createRange();o.setStart(r,0),o.setEnd(a,0);var i,s,c=o.commonAncestorContainer;if(e!==c&&t!==c||r.contains(a))return"BODY"===(s=(i=c).nodeName)||"HTML"!==s&&Qm(i.firstElementChild)!==i?Qm(c):c;var l=Ym(e);return l.host?Xm(l.host,t):Xm(e,Ym(t).host)}function Zm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var a=e.ownerDocument.documentElement,o=e.ownerDocument.scrollingElement||a;return o[n]}return e[n]}function ey(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=Zm(t,"top"),a=Zm(t,"left"),o=n?-1:1;return e.top+=r*o,e.bottom+=r*o,e.left+=a*o,e.right+=a*o,e}function ty(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"],10)+parseFloat(e["border"+r+"Width"],10)}function ny(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],Jm(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function ry(e){var t=e.body,n=e.documentElement,r=Jm(10)&&getComputedStyle(n);return{height:ny("Height",t,n,r),width:ny("Width",t,n,r)}}var ay=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},oy=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}}(),iy=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},sy=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};function cy(e){return sy({},e,{right:e.left+e.width,bottom:e.top+e.height})}function ly(e){var t={};try{if(Jm(10)){t=e.getBoundingClientRect();var n=Zm(e,"top"),r=Zm(e,"left");t.top+=n,t.left+=r,t.bottom+=n,t.right+=r}else t=e.getBoundingClientRect()}catch(e){}var a={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},o="HTML"===e.nodeName?ry(e.ownerDocument):{},i=o.width||e.clientWidth||a.right-a.left,s=o.height||e.clientHeight||a.bottom-a.top,c=e.offsetWidth-i,l=e.offsetHeight-s;if(c||l){var u=zm(e);c-=ty(u,"x"),l-=ty(u,"y"),a.width-=c,a.height-=l}return cy(a)}function uy(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=Jm(10),a="HTML"===t.nodeName,o=ly(e),i=ly(t),s=Hm(e),c=zm(t),l=parseFloat(c.borderTopWidth,10),u=parseFloat(c.borderLeftWidth,10);n&&a&&(i.top=Math.max(i.top,0),i.left=Math.max(i.left,0));var p=cy({top:o.top-i.top-l,left:o.left-i.left-u,width:o.width,height:o.height});if(p.marginTop=0,p.marginLeft=0,!r&&a){var d=parseFloat(c.marginTop,10),f=parseFloat(c.marginLeft,10);p.top-=l-d,p.bottom-=l-d,p.left-=u-f,p.right-=u-f,p.marginTop=d,p.marginLeft=f}return(r&&!n?t.contains(s):t===s&&"BODY"!==s.nodeName)&&(p=ey(p,t)),p}function py(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=uy(e,n),a=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),i=t?0:Zm(n),s=t?0:Zm(n,"left"),c={top:i-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:a,height:o};return cy(c)}function dy(e){var t=e.nodeName;return"BODY"!==t&&"HTML"!==t&&("fixed"===zm(e,"position")||dy(Gm(e)))}function fy(e){if(!e||!e.parentElement||Jm())return document.documentElement;for(var t=e.parentElement;t&&"none"===zm(t,"transform");)t=t.parentElement;return t||document.documentElement}function hy(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},i=a?fy(e):Xm(e,t);if("viewport"===r)o=py(i,a);else{var s=void 0;"scrollParent"===r?"BODY"===(s=Hm(Gm(t))).nodeName&&(s=e.ownerDocument.documentElement):s="window"===r?e.ownerDocument.documentElement:r;var c=uy(s,i,a);if("HTML"!==s.nodeName||dy(i))o=c;else{var l=ry(e.ownerDocument),u=l.height,p=l.width;o.top+=c.top-c.marginTop,o.bottom=u+c.top,o.left+=c.left-c.marginLeft,o.right=p+c.left}}var d="number"==typeof(n=n||0);return o.left+=d?n:n.left||0,o.top+=d?n:n.top||0,o.right-=d?n:n.right||0,o.bottom-=d?n:n.bottom||0,o}function gy(e){return e.width*e.height}function my(e,t,n,r,a){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var i=hy(n,r,o,a),s={top:{width:i.width,height:t.top-i.top},right:{width:i.right-t.right,height:i.height},bottom:{width:i.width,height:i.bottom-t.bottom},left:{width:t.left-i.left,height:i.height}},c=Object.keys(s).map((function(e){return sy({key:e},s[e],{area:gy(s[e])})})).sort((function(e,t){return t.area-e.area})),l=c.filter((function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight})),u=l.length>0?l[0].key:c[0].key,p=e.split("-")[1];return u+(p?"-"+p:"")}function yy(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=r?fy(t):Xm(t,n);return uy(n,a,r)}function vy(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function by(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function _y(e,t,n){n=n.split("-")[0];var r=vy(e),a={width:r.width,height:r.height},o=-1!==["right","left"].indexOf(n),i=o?"top":"left",s=o?"left":"top",c=o?"height":"width",l=o?"width":"height";return a[i]=t[i]+t[c]/2-r[c]/2,a[s]=n===s?t[s]-r[l]:t[by(s)],a}function wy(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function Cy(e,t,n){var r=void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex((function(e){return e[t]===n}));var r=wy(e,(function(e){return e[t]===n}));return e.indexOf(r)}(e,"name",n));return r.forEach((function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&Wm(n)&&(t.offsets.popper=cy(t.offsets.popper),t.offsets.reference=cy(t.offsets.reference),t=n(t,e))})),t}function Oy(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=yy(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=my(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=_y(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=Cy(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function Sy(e,t){return e.some((function(e){var n=e.name;return e.enabled&&n===t}))}function jy(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r<t.length;r++){var a=t[r],o=a?""+a+n:e;if(void 0!==document.body.style[o])return o}return null}function xy(){return this.state.isDestroyed=!0,Sy(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[jy("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function ky(e){var t=e.ownerDocument;return t?t.defaultView:window}function Ey(e,t,n,r){var a="BODY"===e.nodeName,o=a?e.ownerDocument.defaultView:e;o.addEventListener(t,n,{passive:!0}),a||Ey(Hm(o.parentNode),t,n,r),r.push(o)}function Ty(e,t,n,r){n.updateBound=r,ky(e).addEventListener("resize",n.updateBound,{passive:!0});var a=Hm(e);return Ey(a,"scroll",n.updateBound,n.scrollParents),n.scrollElement=a,n.eventsEnabled=!0,n}function Py(){this.state.eventsEnabled||(this.state=Ty(this.reference,this.options,this.state,this.scheduleUpdate))}function Ny(){var e,t;this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=(e=this.reference,t=this.state,ky(e).removeEventListener("resize",t.updateBound),t.scrollParents.forEach((function(e){e.removeEventListener("scroll",t.updateBound)})),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t))}function Ry(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function My(e,t){Object.keys(t).forEach((function(n){var r="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&Ry(t[n])&&(r="px"),e.style[n]=t[n]+r}))}var Ay=qm&&/Firefox/i.test(navigator.userAgent);function Ly(e,t,n){var r=wy(e,(function(e){return e.name===t})),a=!!r&&e.some((function(e){return e.name===n&&e.enabled&&e.order<r.order}));if(!a){var o="`"+t+"`",i="`"+n+"`";console.warn(i+" modifier is required by "+o+" modifier in order to work, be sure to include it before "+o+"!")}return a}var Iy=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],Dy=Iy.slice(3);function qy(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Dy.indexOf(e),r=Dy.slice(n+1).concat(Dy.slice(0,n));return t?r.reverse():r}var $y="flip",Fy="clockwise",By="counterclockwise";function Uy(e,t,n,r){var a=[0,0],o=-1!==["right","left"].indexOf(r),i=e.split(/(\+|\-)/).map((function(e){return e.trim()})),s=i.indexOf(wy(i,(function(e){return-1!==e.search(/,|\s/)})));i[s]&&-1===i[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var c=/\s*,\s*|\s+/,l=-1!==s?[i.slice(0,s).concat([i[s].split(c)[0]]),[i[s].split(c)[1]].concat(i.slice(s+1))]:[i];return l=l.map((function(e,r){var a=(1===r?!o:o)?"height":"width",i=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,i=!0,e):i?(e[e.length-1]+=t,i=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,n,r){var a=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+a[1],i=a[2];if(!o)return e;if(0===i.indexOf("%")){return cy("%p"===i?n:r)[t]/100*o}if("vh"===i||"vw"===i)return("vh"===i?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o;return o}(e,a,t,n)}))})),l.forEach((function(e,t){e.forEach((function(n,r){Ry(n)&&(a[t]+=n*("-"===e[r-1]?-1:1))}))})),a}var Wy={shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var a=e.offsets,o=a.reference,i=a.popper,s=-1!==["bottom","top"].indexOf(n),c=s?"left":"top",l=s?"width":"height",u={start:iy({},c,o[c]),end:iy({},c,o[c]+o[l]-i[l])};e.offsets.popper=sy({},i,u[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,a=e.offsets,o=a.popper,i=a.reference,s=r.split("-")[0],c=void 0;return c=Ry(+n)?[+n,0]:Uy(n,o,i,s),"left"===s?(o.top+=c[0],o.left-=c[1]):"right"===s?(o.top+=c[0],o.left+=c[1]):"top"===s?(o.left+=c[0],o.top-=c[1]):"bottom"===s&&(o.left+=c[0],o.top+=c[1]),e.popper=o,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||Qm(e.instance.popper);e.instance.reference===n&&(n=Qm(n));var r=jy("transform"),a=e.instance.popper.style,o=a.top,i=a.left,s=a[r];a.top="",a.left="",a[r]="";var c=hy(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);a.top=o,a.left=i,a[r]=s,t.boundaries=c;var l=t.priority,u=e.offsets.popper,p={primary:function(e){var n=u[e];return u[e]<c[e]&&!t.escapeWithReference&&(n=Math.max(u[e],c[e])),iy({},e,n)},secondary:function(e){var n="right"===e?"left":"top",r=u[n];return u[e]>c[e]&&!t.escapeWithReference&&(r=Math.min(u[n],c[e]-("right"===e?u.width:u.height))),iy({},n,r)}};return l.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";u=sy({},u,p[t](e))})),e.offsets.popper=u,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,a=e.placement.split("-")[0],o=Math.floor,i=-1!==["top","bottom"].indexOf(a),s=i?"right":"bottom",c=i?"left":"top",l=i?"width":"height";return n[s]<o(r[c])&&(e.offsets.popper[c]=o(r[c])-n[l]),n[c]>o(r[s])&&(e.offsets.popper[c]=o(r[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!Ly(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"==typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var a=e.placement.split("-")[0],o=e.offsets,i=o.popper,s=o.reference,c=-1!==["left","right"].indexOf(a),l=c?"height":"width",u=c?"Top":"Left",p=u.toLowerCase(),d=c?"left":"top",f=c?"bottom":"right",h=vy(r)[l];s[f]-h<i[p]&&(e.offsets.popper[p]-=i[p]-(s[f]-h)),s[p]+h>i[f]&&(e.offsets.popper[p]+=s[p]+h-i[f]),e.offsets.popper=cy(e.offsets.popper);var g=s[p]+s[l]/2-h/2,m=zm(e.instance.popper),y=parseFloat(m["margin"+u],10),v=parseFloat(m["border"+u+"Width"],10),b=g-e.offsets.popper[p]-y-v;return b=Math.max(Math.min(i[l]-h,b),0),e.arrowElement=r,e.offsets.arrow=(iy(n={},p,Math.round(b)),iy(n,d,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(Sy(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=hy(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],a=by(r),o=e.placement.split("-")[1]||"",i=[];switch(t.behavior){case $y:i=[r,a];break;case Fy:i=qy(r);break;case By:i=qy(r,!0);break;default:i=t.behavior}return i.forEach((function(s,c){if(r!==s||i.length===c+1)return e;r=e.placement.split("-")[0],a=by(r);var l=e.offsets.popper,u=e.offsets.reference,p=Math.floor,d="left"===r&&p(l.right)>p(u.left)||"right"===r&&p(l.left)<p(u.right)||"top"===r&&p(l.bottom)>p(u.top)||"bottom"===r&&p(l.top)<p(u.bottom),f=p(l.left)<p(n.left),h=p(l.right)>p(n.right),g=p(l.top)<p(n.top),m=p(l.bottom)>p(n.bottom),y="left"===r&&f||"right"===r&&h||"top"===r&&g||"bottom"===r&&m,v=-1!==["top","bottom"].indexOf(r),b=!!t.flipVariations&&(v&&"start"===o&&f||v&&"end"===o&&h||!v&&"start"===o&&g||!v&&"end"===o&&m);(d||y||b)&&(e.flipped=!0,(d||y)&&(r=i[c+1]),b&&(o=function(e){return"end"===e?"start":"start"===e?"end":e}(o)),e.placement=r+(o?"-"+o:""),e.offsets.popper=sy({},e.offsets.popper,_y(e.instance.popper,e.offsets.reference,e.placement)),e=Cy(e.instance.modifiers,e,"flip"))})),e},behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,a=r.popper,o=r.reference,i=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return a[i?"left":"top"]=o[n]-(s?a[i?"width":"height"]:0),e.placement=by(t),e.offsets.popper=cy(a),e}},hide:{order:800,enabled:!0,fn:function(e){if(!Ly(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=wy(e.instance.modifiers,(function(e){return"preventOverflow"===e.name})).boundaries;if(t.bottom<n.top||t.left>n.right||t.top>n.bottom||t.right<n.left){if(!0===e.hide)return e;e.hide=!0,e.attributes["x-out-of-boundaries"]=""}else{if(!1===e.hide)return e;e.hide=!1,e.attributes["x-out-of-boundaries"]=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var n=t.x,r=t.y,a=e.offsets.popper,o=wy(e.instance.modifiers,(function(e){return"applyStyle"===e.name})).gpuAcceleration;void 0!==o&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var i=void 0!==o?o:t.gpuAcceleration,s=Qm(e.instance.popper),c=ly(s),l={position:a.position},u=function(e,t){var n=e.offsets,r=n.popper,a=n.reference,o=-1!==["left","right"].indexOf(e.placement),i=-1!==e.placement.indexOf("-"),s=a.width%2==r.width%2,c=a.width%2==1&&r.width%2==1,l=function(e){return e},u=t?o||i||s?Math.round:Math.floor:l,p=t?Math.round:l;return{left:u(c&&!i&&t?r.left-1:r.left),top:p(r.top),bottom:p(r.bottom),right:u(r.right)}}(e,window.devicePixelRatio<2||!Ay),p="bottom"===n?"top":"bottom",d="right"===r?"left":"right",f=jy("transform"),h=void 0,g=void 0;if(g="bottom"===p?"HTML"===s.nodeName?-s.clientHeight+u.bottom:-c.height+u.bottom:u.top,h="right"===d?"HTML"===s.nodeName?-s.clientWidth+u.right:-c.width+u.right:u.left,i&&f)l[f]="translate3d("+h+"px, "+g+"px, 0)",l[p]=0,l[d]=0,l.willChange="transform";else{var m="bottom"===p?-1:1,y="right"===d?-1:1;l[p]=g*m,l[d]=h*y,l.willChange=p+", "+d}var v={"x-placement":e.placement};return e.attributes=sy({},v,e.attributes),e.styles=sy({},l,e.styles),e.arrowStyles=sy({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(e){var t,n;return My(e.instance.popper,e.styles),t=e.instance.popper,n=e.attributes,Object.keys(n).forEach((function(e){!1!==n[e]?t.setAttribute(e,n[e]):t.removeAttribute(e)})),e.arrowElement&&Object.keys(e.arrowStyles).length&&My(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,n,r,a){var o=yy(a,t,e,n.positionFixed),i=my(n.placement,o,t,e,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return t.setAttribute("x-placement",i),My(t,{position:n.positionFixed?"fixed":"absolute"}),n},gpuAcceleration:void 0}},zy={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:Wy},Gy=function(){function e(t,n){var r=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};ay(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=Um(this.update.bind(this)),this.options=sy({},e.Defaults,a),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(sy({},e.Defaults.modifiers,a.modifiers)).forEach((function(t){r.options.modifiers[t]=sy({},e.Defaults.modifiers[t]||{},a.modifiers?a.modifiers[t]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return sy({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&Wm(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return oy(e,[{key:"update",value:function(){return Oy.call(this)}},{key:"destroy",value:function(){return xy.call(this)}},{key:"enableEventListeners",value:function(){return Py.call(this)}},{key:"disableEventListeners",value:function(){return Ny.call(this)}}]),e}();Gy.Utils=("undefined"!=typeof window?window:global).PopperUtils,Gy.placements=Iy,Gy.Defaults=zy;var Hy=Object.freeze({__proto__:null,default:Gy}),Ky="__global_unique_id__",Vy=function(){return Ce[Ky]=(Ce[Ky]||0)+1};function Jy(e){return function(){return e}}var Qy=function(){};Qy.thatReturns=Jy,Qy.thatReturnsFalse=Jy(!1),Qy.thatReturnsTrue=Jy(!0),Qy.thatReturnsNull=Jy(null),Qy.thatReturnsThis=function(){return this},Qy.thatReturnsArgument=function(e){return e};var Yy=Qy,Xy=je((function(e,t){t.__esModule=!0,a(V);var n=a(te),r=a(Vy);function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function s(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)}a(Yy);var c=1073741823;function l(e){var t=[];return{on:function(e){t.push(e)},off:function(e){t=t.filter((function(t){return t!==e}))},get:function(){return e},set:function(n,r){e=n,t.forEach((function(t){return t(e,r)}))}}}t.default=function(e,t){var a,u,p="__create-react-context-"+(0,r.default)()+"__",d=function(e){function n(){var t,r;o(this,n);for(var a=arguments.length,s=Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=r=i(this,e.call.apply(e,[this].concat(s))),r.emitter=l(r.props.value),i(r,t)}return s(n,e),n.prototype.getChildContext=function(){var e;return(e={})[p]=this.emitter,e},n.prototype.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n=this.props.value,r=e.value,a=void 0;((o=n)===(i=r)?0!==o||1/o==1/i:o!=o&&i!=i)?a=0:(a="function"==typeof t?t(n,r):c,0!==(a|=0)&&this.emitter.set(e.value,a))}var o,i},n.prototype.render=function(){return this.props.children},n}(V.Component);d.childContextTypes=((a={})[p]=n.default.object.isRequired,a);var f=function(t){function n(){var e,r;o(this,n);for(var a=arguments.length,s=Array(a),c=0;c<a;c++)s[c]=arguments[c];return e=r=i(this,t.call.apply(t,[this].concat(s))),r.state={value:r.getValue()},r.onUpdate=function(e,t){0!=((0|r.observedBits)&t)&&r.setState({value:r.getValue()})},i(r,e)}return s(n,t),n.prototype.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?c:t},n.prototype.componentDidMount=function(){this.context[p]&&this.context[p].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?c:e},n.prototype.componentWillUnmount=function(){this.context[p]&&this.context[p].off(this.onUpdate)},n.prototype.getValue=function(){return this.context[p]?this.context[p].get():e},n.prototype.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(V.Component);return f.contextTypes=((u={})[p]=n.default.object,u),{Provider:d,Consumer:f}},e.exports=t.default})),Zy=je((function(e,t){t.__esModule=!0;var n=a(V),r=a(Xy);function a(e){return e&&e.__esModule?e:{default:e}}t.default=n.default.createContext||r.default,e.exports=t.default})),ev=je((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.ManagerContext=void 0;var n=c(Zh),r=c(eg),a=c(km),o=c(Dm),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(V),s=c(Zy);function c(e){return e&&e.__esModule?e:{default:e}}var l=t.ManagerContext=(0,s.default)({getReferenceRef:void 0,referenceNode:void 0}),u=function(e){function t(){(0,r.default)(this,t);var o=(0,a.default)(this,e.call(this));return o.getReferenceRef=function(e){return o.setState((function(t){var r=t.context;return{context:(0,n.default)({},r,{referenceNode:e})}}))},o.state={context:{getReferenceRef:o.getReferenceRef,referenceNode:void 0}},o}return(0,o.default)(t,e),t.prototype.render=function(){return i.createElement(l.Provider,{value:this.state.context},this.props.children)},t}(i.Component);t.default=u})),tv=je((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.unwrapArray=function(e){return Array.isArray(e)?e[0]:e},t.safeInvoke=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if("function"==typeof e)return e.apply(void 0,n)}})),nv=Se(Hy),rv=je((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.placements=t.InnerPopper=void 0;var n=c(Zh),r=c(eg),a=c(km),o=c(Dm);t.default=function(e){return i.createElement(ev.ManagerContext.Consumer,null,(function(t){var r=t.referenceNode;return i.createElement(p,(0,n.default)({referenceElement:r},e))}))};var i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(V),s=c(nv);function c(e){return e&&e.__esModule?e:{default:e}}var l={position:"absolute",top:0,left:0,opacity:0,pointerEvents:"none"},u={},p=t.InnerPopper=function(e){function t(){var o,i,c;(0,r.default)(this,t);for(var p=arguments.length,d=Array(p),f=0;f<p;f++)d[f]=arguments[f];return o=i=(0,a.default)(this,e.call.apply(e,[this].concat(d))),i.state={data:void 0,placement:void 0},i.popperNode=null,i.arrowNode=null,i.setPopperNode=function(e){i.popperNode!==e&&((0,tv.safeInvoke)(i.props.innerRef,e),i.popperNode=e,i.updatePopperInstance())},i.setArrowNode=function(e){i.arrowNode!==e&&(i.arrowNode=e,i.popperInstance||i.updatePopperInstance())},i.updateStateModifier={enabled:!0,order:900,fn:function(e){var t=e.placement;return i.setState({data:e,placement:t},t!==i.state.placement?i.scheduleUpdate:void 0),e}},i.getOptions=function(){return{placement:i.props.placement,eventsEnabled:i.props.eventsEnabled,positionFixed:i.props.positionFixed,modifiers:(0,n.default)({},i.props.modifiers,{arrow:(0,n.default)({},i.props.modifiers&&i.props.modifiers.arrow,{enabled:!!i.arrowNode,element:i.arrowNode}),applyStyle:{enabled:!1},updateStateModifier:i.updateStateModifier})}},i.getPopperStyle=function(){return i.popperNode&&i.state.data?(0,n.default)({position:i.state.data.offsets.popper.position},i.state.data.styles):l},i.getPopperPlacement=function(){return i.state.data?i.state.placement:void 0},i.getArrowStyle=function(){return i.arrowNode&&i.state.data?i.state.data.arrowStyles:u},i.getOutOfBoundariesState=function(){return i.state.data?i.state.data.hide:void 0},i.destroyPopperInstance=function(){i.popperInstance&&(i.popperInstance.destroy(),i.popperInstance=null)},i.updatePopperInstance=function(){i.destroyPopperInstance();var e=i.popperNode,t=i.props.referenceElement;t&&e&&(i.popperInstance=new s.default(t,e,i.getOptions()))},i.scheduleUpdate=function(){i.popperInstance&&i.popperInstance.scheduleUpdate()},c=o,(0,a.default)(i,c)}return(0,o.default)(t,e),t.prototype.componentDidUpdate=function(e,t){this.props.placement!==e.placement||this.props.referenceElement!==e.referenceElement||this.props.positionFixed!==e.positionFixed?this.updatePopperInstance():this.props.eventsEnabled!==e.eventsEnabled&&this.popperInstance&&(this.props.eventsEnabled?this.popperInstance.enableEventListeners():this.popperInstance.disableEventListeners()),t.placement!==this.state.placement&&this.scheduleUpdate()},t.prototype.componentWillUnmount=function(){this.destroyPopperInstance()},t.prototype.render=function(){return(0,tv.unwrapArray)(this.props.children)({ref:this.setPopperNode,style:this.getPopperStyle(),placement:this.getPopperPlacement(),outOfBoundaries:this.getOutOfBoundariesState(),scheduleUpdate:this.scheduleUpdate,arrowProps:{ref:this.setArrowNode,style:this.getArrowStyle()}})},t}(i.Component);p.defaultProps={placement:"bottom",eventsEnabled:!0,referenceElement:void 0,positionFixed:!1};var d=s.default.placements;t.placements=d})),av=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},ov=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}}(),iv=dv(Sf),sv=dv(V),cv=dv(te),lv=dv(Qf),uv=dv(th),pv=dv(rv);function dv(e){return e&&e.__esModule?e:{default:e}}function fv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hv(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)}function gv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mv(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}function yv(e){var t=e.align;return{computeStyles:{enabled:!0,fn:function(e){return"right"!==t&&"left"!==t&&(e.styles.width=e.offsets.reference.width),e}},flip:{enabled:e.flip},preventOverflow:{escapeWithReference:!0}}}function vv(e){return e===document.body}var bv=function(e){function t(){var e,n,r;gv(this,t);for(var a=arguments.length,o=Array(a),i=0;i<a;i++)o[i]=arguments[i];return n=r=mv(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r._update=function(){var e,t=r.props,n=t.className,a=t.container;t.show&&vv(a)&&(a.classList.add("rbt-body-container"),n&&(e=a.classList).add.apply(e,hv(n.split(" "))))},mv(r,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,sv.default.Component),ov(t,[{key:"componentDidMount",value:function(){this._update()}},{key:"componentWillReceiveProps",value:function(e){var t=e.onMenuHide,n=e.onMenuShow,r=e.show;this.props.show&&!r&&t(),!this.props.show&&r&&n();var a,o=this.props,i=o.className,s=o.container;vv(s)&&!vv(e.container)&&(s.classList.remove("rbt-body-container"),i&&(a=s.classList).remove.apply(a,hv(i.split(" "))));this._update()}},{key:"render",value:function(){var e=this.props,t=e.align,n=e.children,r=e.container,a=e.dropup,o=e.referenceElement;if(!(e.show&&V.Children.count(n)&&o))return null;var i=V.Children.only(n),s="right"===t?"end":"start",c=a?"top":"bottom";return sv.default.createElement(uv.default,{container:r},sv.default.createElement(pv.default,{modifiers:yv(this.props),placement:c+"-"+s,referenceElement:o},(function(e){var t=e.ref,n=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["ref"]);return(0,V.cloneElement)(i,av({},i.props,n,{className:(0,iv.default)(i.props.className,fv({},"ignore-react-onclickoutside",vv(r))),innerRef:t}))})))}}]),t}();bv.propTypes={children:cv.default.element,container:lv.default.isRequired,onMenuHide:cv.default.func.isRequired,onMenuShow:cv.default.func.isRequired,referenceElement:lv.default,show:cv.default.bool},bv.defaultProps={show:!1};var _v=bv,wv=Object.defineProperty({default:_v},"__esModule",{value:!0}),Cv=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},Ov=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}}(),Sv=xv(te),jv=xv(V);function xv(e){return e&&e.__esModule?e:{default:e}}function kv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ev(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}var Tv={height:0,left:0,overflow:"scroll",position:"absolute",top:0,visibility:"hidden",whiteSpace:"pre"},Pv=["inputClassName","inputRef","inputStyle"],Nv=function(e,t){t.style.fontSize=e.fontSize,t.style.fontFamily=e.fontFamily,t.style.fontWeight=e.fontWeight,t.style.fontStyle=e.fontStyle,t.style.letterSpacing=e.letterSpacing,t.style.textTransform=e.textTransform},Rv=function(e){function t(){var e,n,r;kv(this,t);for(var a=arguments.length,o=Array(a),i=0;i<a;i++)o[i]=arguments[i];return n=r=Ev(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r.state={inputWidth:1},r._copyInputStyles=function(){var e=r._input&&window.getComputedStyle&&window.getComputedStyle(r._input);e&&(Nv(e,r._sizer),r._placeHolderSizer&&Nv(e,r._placeHolderSizer))},r._updateInputWidth=function(){if(r._sizer&&void 0!==r._sizer.scrollWidth){r._copyInputStyles();var e=r._placeHolderSizer&&r._placeHolderSizer.scrollWidth||1,t=Math.max(r._sizer.scrollWidth,e)+2;t!==r.state.inputWidth&&r.setState({inputWidth:t})}},Ev(r,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,jv.default.Component),Ov(t,[{key:"componentDidMount",value:function(){this._updateInputWidth()}},{key:"componentDidUpdate",value:function(e,t){this._updateInputWidth()}},{key:"render",value:function(){var e=this,t=this.props,n=t.className,r=t.defaultValue,a=t.placeholder,o=t.value,i=Cv({},this.props.style);i.display||(i.display="inline-block");var s=function(e){return Pv.forEach((function(t){return delete e[t]})),e}(Cv({},this.props,{className:this.props.inputClassName,style:Cv({},this.props.inputStyle,{boxSizing:"content-box",width:this.state.inputWidth+"px"})}));return jv.default.createElement("div",{className:n,style:i},jv.default.createElement("input",Cv({},s,{ref:function(t){e._input=t,"function"==typeof e.props.inputRef&&e.props.inputRef(t)}})),jv.default.createElement("div",{ref:function(t){return e._sizer=t},style:Tv},r||o||""),a?jv.default.createElement("div",{ref:function(t){return e._placeHolderSizer=t},style:Tv},a):null)}}]),t}();Rv.propTypes={inputClassName:Sv.default.string,inputRef:Sv.default.func,inputStyle:Sv.default.object};var Mv=Rv,Av=Object.defineProperty({default:Mv},"__esModule",{value:!0});function Lv(e,t,n){return e===t||(e.correspondingElement?e.correspondingElement.classList.contains(n):e.classList.contains(n))}var Iv,Dv,qv=(void 0===Iv&&(Iv=0),function(){return++Iv}),$v={},Fv={},Bv=["touchstart","touchmove"];function Uv(e,t){var n=null;return-1!==Bv.indexOf(t)&&Dv&&(n={passive:!e.props.preventDefault}),n}var Wv=Object.freeze({__proto__:null,IGNORE_CLASS_NAME:"ignore-react-onclickoutside",default:function(e,t){var n,r;return r=n=function(n){var r,a;function o(e){var t;return(t=n.call(this,e)||this).__outsideClickHandler=function(e){if("function"!=typeof t.__clickOutsideHandlerProp){var n=t.getInstance();if("function"!=typeof n.props.handleClickOutside){if("function"!=typeof n.handleClickOutside)throw new Error("WrappedComponent lacks a handleClickOutside(event) function for processing outside click events.");n.handleClickOutside(e)}else n.props.handleClickOutside(e)}else t.__clickOutsideHandlerProp(e)},t.enableOnClickOutside=function(){if("undefined"!=typeof document&&!Fv[t._uid]){void 0===Dv&&(Dv=function(){if("undefined"!=typeof window&&"function"==typeof window.addEventListener){var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}}),n=function(){};return window.addEventListener("testPassiveEventSupport",n,t),window.removeEventListener("testPassiveEventSupport",n,t),e}}()),Fv[t._uid]=!0;var e=t.props.eventTypes;e.forEach||(e=[e]),$v[t._uid]=function(e){var n;t.props.disableOnClickOutside||null!==t.componentNode&&(t.props.preventDefault&&e.preventDefault(),t.props.stopPropagation&&e.stopPropagation(),t.props.excludeScrollbar&&(n=e,document.documentElement.clientWidth<=n.clientX||document.documentElement.clientHeight<=n.clientY)||function(e,t,n){if(e===t)return!0;for(;e.parentNode;){if(Lv(e,t,n))return!0;e=e.parentNode}return e}(e.target,t.componentNode,t.props.outsideClickIgnoreClass)===document&&t.__outsideClickHandler(e))},e.forEach((function(e){document.addEventListener(e,$v[t._uid],Uv(t,e))}))}},t.disableOnClickOutside=function(){delete Fv[t._uid];var e=$v[t._uid];if(e&&"undefined"!=typeof document){var n=t.props.eventTypes;n.forEach||(n=[n]),n.forEach((function(n){return document.removeEventListener(n,e,Uv(t,n))})),delete $v[t._uid]}},t.getRef=function(e){return t.instanceRef=e},t._uid=qv(),t}a=n,(r=o).prototype=Object.create(a.prototype),r.prototype.constructor=r,r.__proto__=a;var i=o.prototype;return i.getInstance=function(){if(!e.prototype.isReactComponent)return this;var t=this.instanceRef;return t.getInstance?t.getInstance():t},i.componentDidMount=function(){if("undefined"!=typeof document&&document.createElement){var e=this.getInstance();if(t&&"function"==typeof t.handleClickOutside&&(this.__clickOutsideHandlerProp=t.handleClickOutside(e),"function"!=typeof this.__clickOutsideHandlerProp))throw new Error("WrappedComponent lacks a function for processing outside click events specified by the handleClickOutside config option.");this.componentNode=ee(this.getInstance()),this.enableOnClickOutside()}},i.componentDidUpdate=function(){this.componentNode=ee(this.getInstance())},i.componentWillUnmount=function(){this.disableOnClickOutside()},i.render=function(){var t=this.props;t.excludeScrollbar;var n=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(t,["excludeScrollbar"]);return e.prototype.isReactComponent?n.ref=this.getRef:n.wrappedRef=this.getRef,n.disableOnClickOutside=this.disableOnClickOutside,n.enableOnClickOutside=this.enableOnClickOutside,Y(e,n)},o}(Q),n.displayName="OnClickOutside("+(e.displayName||e.name||"Component")+")",n.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:t&&t.excludeScrollbar||!1,outsideClickIgnoreClass:"ignore-react-onclickoutside",preventDefault:!1,stopPropagation:!1},n.getClass=function(){return e.getClass?e.getClass():e},r}}),zv=8,Gv=9,Hv=13,Kv=27,Vv=38,Jv=39,Qv=40,Yv=Se(Wv),Xv=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},Zv=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}}(),eb=nb(V),tb=nb(Yv);function nb(e){return e&&e.__esModule?e:{default:e}}function rb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ab(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}var ob=function(e){var t=function(t){function n(){var e,t,r;rb(this,n);for(var a=arguments.length,o=Array(a),i=0;i<a;i++)o[i]=arguments[i];return t=r=ab(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(o))),r.state={active:!1},r._handleBlur=function(e){r.setState({active:!1})},r._handleKeyDown=function(e){if(e.keyCode===zv)r.state.active&&(e.preventDefault(),r.props.onRemove())},r.handleClickOutside=function(e){r._handleBlur()},r._handleActive=function(e){e.stopPropagation(),r.setState({active:!0})},ab(r,t)}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)}(n,eb.default.Component),Zv(n,[{key:"render",value:function(){var t=this.props;t.disableOnClickOutside,t.enableOnClickOutside,t.eventTypes,t.outsideClickIgnoreClass,t.preventDefault,t.stopPropagation;var n=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["disableOnClickOutside","enableOnClickOutside","eventTypes","outsideClickIgnoreClass","preventDefault","stopPropagation"]);return eb.default.createElement(e,Xv({},n,this.state,{onBlur:this._handleBlur,onClick:this._handleActive,onFocus:this._handleActive,onKeyDown:this._handleKeyDown}))}}]),n}();return t.displayName="TokenContainer("+(0,Up.getDisplayName)(e)+")",(0,tb.default)(t)},ib=Object.defineProperty({default:ob},"__esModule",{value:!0}),sb=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},cb=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}}(),lb=hb(Sf),ub=hb(V),pb=hb(te),db=hb(Bf),fb=hb(ib);function hb(e){return e&&e.__esModule?e:{default:e}}function gb(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function mb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yb(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}var vb=function(e){function t(){var e,n,r;mb(this,t);for(var a=arguments.length,o=Array(a),i=0;i<a;i++)o[i]=arguments[i];return n=r=yb(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r._renderRemoveableToken=function(){var e=r.props,t=e.active,n=e.children,a=e.className,o=e.onRemove,i=gb(e,["active","children","className","onRemove"]);return ub.default.createElement("div",sb({},i,{className:(0,lb.default)("rbt-token","rbt-token-removeable",{"rbt-token-active":t},a)}),n,ub.default.createElement(db.default,{className:"rbt-token-remove-button",label:"Remove",onClick:o,onKeyDown:r._handleRemoveButtonKeydown,tabIndex:-1}))},r._renderToken=function(){var e=r.props,t=e.children,n=e.className,a=e.disabled,o=e.href,i=(0,lb.default)("rbt-token",{"rbt-token-disabled":a},n);return o?ub.default.createElement("a",{className:i,href:o},t):ub.default.createElement("div",{className:i},t)},r._handleRemoveButtonKeydown=function(e){if(e.keyCode===Hv)r.props.onRemove()},yb(r,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,ub.default.Component),cb(t,[{key:"render",value:function(){return this.props.onRemove&&!this.props.disabled?this._renderRemoveableToken():this._renderToken()}}]),t}();vb.propTypes={active:pb.default.bool,onRemove:pb.default.func,tabIndex:pb.default.number},vb.defaultProps={active:!1,tabIndex:0};var bb=(0,fb.default)(vb),_b=Object.defineProperty({default:bb},"__esModule",{value:!0}),wb=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},Cb=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}}(),Ob=jb(te),Sb=jb(V);function jb(e){return e&&e.__esModule?e:{default:e}}function xb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kb(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}function Eb(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return n&&(n=n.replace(n[0],n[0].toUpperCase())),["Top","Right","Bottom","Left"].map((function(r){return e[t+r+n]})).join(" ")}function Tb(e,t){var n=window.getComputedStyle(e);t.style.borderStyle=Eb(n,"border","style"),t.style.borderWidth=Eb(n,"border","width"),t.style.fontSize=n.fontSize,t.style.lineHeight=n.lineHeight,t.style.margin=Eb(n,"margin"),t.style.padding=Eb(n,"padding")}var Pb=function(e){var t=function(t){function n(){var e,t,r;xb(this,n);for(var a=arguments.length,o=Array(a),i=0;i<a;i++)o[i]=arguments[i];return t=r=kb(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(o))),r._handleKeyDown=function(e){var t=r.context,n=t.hintText,a=t.initialItem,o=t.onAdd,i=t.selectHintOnEnter,s=r.props,c=s.onKeyDown,l=s.value;n&&(e.keyCode===Hv&&i||e.keyCode===Jv&&e.target.selectionStart===l.length||e.keyCode===Gv)&&(e.preventDefault(),o(a)),c(e)},kb(r,t)}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)}(n,Sb.default.Component),Cb(n,[{key:"componentDidMount",value:function(){Tb(this._input,this._hint)}},{key:"componentDidUpdate",value:function(){Tb(this._input,this._hint)}},{key:"render",value:function(){var t=this;return Sb.default.createElement("div",{className:"rbt-input-hint-container",style:{position:"relative"}},Sb.default.createElement(e,wb({},this.props,{inputRef:function(e){t._input=e,t.props.inputRef(e)},onKeyDown:this._handleKeyDown})),Sb.default.createElement("input",{"aria-hidden":!0,className:"rbt-input-hint",readOnly:!0,ref:function(e){return t._hint=e},style:{backgroundColor:"transparent",borderColor:"transparent",boxShadow:"none",color:"rgba(0, 0, 0, 0.35)",left:0,pointerEvents:"none",position:"absolute",top:0},tabIndex:-1,value:this.context.hintText}))}}]),n}();return t.displayName="HintContainer("+(0,Up.getDisplayName)(e)+")",t.contextTypes={hintText:Ob.default.string.isRequired,initialItem:Ob.default.oneOfType([Ob.default.object.isRequired,Ob.default.string.isRequired]),onAdd:Ob.default.func.isRequired,selectHintOnEnter:Ob.default.bool.isRequired},t},Nb=Object.defineProperty({default:Pb},"__esModule",{value:!0}),Rb=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},Mb=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}}(),Ab=Db(Sf),Lb=Db(te),Ib=Db(V);function Db(e){return e&&e.__esModule?e:{default:e}}function qb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fb(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}var Bb=function(e){var t=function(t){function n(){var e,t,r;$b(this,n);for(var a=arguments.length,o=Array(a),i=0;i<a;i++)o[i]=arguments[i];return t=r=Fb(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(o))),r.state={isFocused:!1},r._handleBlur=function(e){e.persist(),r.setState({isFocused:!1},(function(){return r.props.onBlur(e)}))},r._handleFocus=function(e){e.persist(),r.setState({isFocused:!0},(function(){return r.props.onFocus(e)}))},Fb(r,t)}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)}(n,Ib.default.Component),Mb(n,[{key:"getChildContext",value:function(){var e=this.props,t=e.initialItem,n=e.onAdd,r=e.selectHintOnEnter;return{hintText:(0,Up.getHintText)(this.props),initialItem:t,onAdd:n,selectHintOnEnter:r}}},{key:"render",value:function(){var t,n=this.props,r=n.activeIndex,a=n.bsSize,o=n.disabled,i=n.inputRef,s=n.isInvalid,c=n.isMenuShown,l=n.isValid,u=n.labelKey,p=n.menuId,d=n.multiple,f=n.onChange,h=n.onKeyDown,g=n.onRemove,m=n.placeholder,y=n.renderToken,v=n.selected,b=Rb({},this.props.inputProps,{"aria-activedescendant":r>=0?(0,Up.getMenuItemId)(r):"","aria-autocomplete":d?"list":"both","aria-expanded":c,"aria-haspopup":"listbox","aria-owns":p,autoComplete:this.props.inputProps.autoComplete||"nope",disabled:o,inputRef:i,onBlur:this._handleBlur,onChange:f,onClick:this._handleFocus,onFocus:this._handleFocus,onKeyDown:h,placeholder:v.length?null:m,role:"combobox",value:(0,Up.getInputText)(this.props)}),_=b.className||"";return d&&(b=Rb({},b,{inputClassName:_,labelKey:u,onRemove:g,renderToken:y,role:"",selected:v})),Ib.default.createElement(e,Rb({},b,{className:(0,Ab.default)("rbt-input",(t={},qb(t,_,!d),qb(t,"focus",this.state.isFocused),qb(t,"input-lg form-control-lg","large"===a||"lg"===a),qb(t,"input-sm form-control-sm","small"===a||"sm"===a),qb(t,"is-invalid",s),qb(t,"is-valid",l),t))}))}}]),n}();return t.displayName="InputContainer("+(0,Up.getDisplayName)(e)+")",t.childContextTypes={hintText:Lb.default.string.isRequired,initialItem:Lb.default.oneOfType([Lb.default.object.isRequired,Lb.default.string.isRequired]),onAdd:Lb.default.func.isRequired,selectHintOnEnter:Lb.default.bool.isRequired},t},Ub=Object.defineProperty({default:Bb},"__esModule",{value:!0}),Wb=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},zb=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}}(),Gb=Xb(Sf),Hb=Xb(te),Kb=Xb(V),Vb=Xb(Av),Jb=Xb(_b),Qb=Xb(Nb),Yb=Xb(Ub);function Xb(e){return e&&e.__esModule?e:{default:e}}function Zb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function e_(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}var t_=(0,Qb.default)(Vb.default),n_=function(e){function t(){var e,n,r;Zb(this,t);for(var a=arguments.length,o=Array(a),i=0;i<a;i++)o[i]=arguments[i];return n=r=e_(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r._renderToken=function(e,t){var n=r.props,a=n.onRemove,o=n.renderToken,i=Wb({},r.props,{onRemove:function(){return a(e)}});return o(e,i,t)},r._handleContainerClickOrFocus=function(e){if(r.props.disabled)e.target.blur();else{var t=r._input;e.target!==t&&(t.selectionStart=t.value.length),t.focus()}},r._handleKeyDown=function(e){var t=r.props,n=t.onKeyDown,a=t.selected,o=t.value;if(e.keyCode===zv)if(e.target===r._input&&a.length&&!o){var i=r._wrapper.children,s=i[i.length-2];s&&s.focus()}n(e)},e_(r,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,Kb.default.Component),zb(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.className,r=t.inputClassName;t.labelKey,t.onRemove,t.renderToken;var a=t.selected,o=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["className","inputClassName","labelKey","onRemove","renderToken","selected"]);return Kb.default.createElement("div",{className:(0,Gb.default)("form-control","rbt-input-multi",n),disabled:o.disabled,onClick:this._handleContainerClickOrFocus,onFocus:this._handleContainerClickOrFocus,tabIndex:-1},Kb.default.createElement("div",{className:"rbt-input-wrapper",ref:function(t){return e._wrapper=t}},a.map(this._renderToken),Kb.default.createElement(t_,Wb({},o,{inputClassName:(0,Gb.default)("rbt-input-main",r),inputRef:function(t){e._input=t,e.props.inputRef(t)},inputStyle:{backgroundColor:"transparent",border:0,boxShadow:"none",cursor:"inherit",outline:"none",padding:0},onKeyDown:this._handleKeyDown,style:{position:"relative",zIndex:1}}))))}}]),t}();n_.propTypes={renderToken:Hb.default.func},n_.defaultProps={renderToken:function(e,t,n){return Kb.default.createElement(Jb.default,{disabled:t.disabled,key:n,onRemove:t.onRemove,tabIndex:t.tabIndex},(0,Up.getOptionLabel)(e,t.labelKey))}};var r_=(0,Yb.default)(n_),a_=Object.defineProperty({default:r_},"__esModule",{value:!0}),o_=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},i_=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}}(),s_=p_(Sf),c_=p_(V),l_=p_(Nb),u_=p_(Ub);function p_(e){return e&&e.__esModule?e:{default:e}}function d_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f_(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}var h_=function(e){function t(){return d_(this,t),f_(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}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,c_.default.Component),i_(t,[{key:"render",value:function(){var e=this.props,t=e.className,n=e.inputRef,r=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["className","inputRef"]);return c_.default.createElement("input",o_({},r,{className:(0,s_.default)("rbt-input-main","form-control",t),ref:n,type:"text"}))}}]),t}(),g_=(0,u_.default)((0,l_.default)(h_)),m_=Object.defineProperty({default:g_},"__esModule",{value:!0}),y_=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}}(),v_=__(te),b_=__(V);function __(e){return e&&e.__esModule?e:{default:e}}function w_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C_(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}var O_=function(e){function t(){var e,n,r;w_(this,t);for(var a=arguments.length,o=Array(a),i=0;i<a;i++)o[i]=arguments[i];return n=r=C_(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r._count=0,C_(r,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,b_.default.PureComponent),y_(t,[{key:"render",value:function(){var e=this.props.search?this._renderHighlightedChildren():this.props.children;return b_.default.createElement("span",null,e)}},{key:"_renderHighlightedChildren",value:function(){for(var e=[],t=this.props.children;t;){var n=(0,Up.getMatchBounds)(t,this.props.search);if(!n)return this._count++,e.push(b_.default.createElement("span",{key:this._count},t)),e;var r=t.slice(0,n.start);r&&(this._count++,e.push(b_.default.createElement("span",{key:this._count},r)));var a=t.slice(n.start,n.end);a&&(this._count++,e.push(b_.default.createElement("mark",{className:"rbt-highlight-text",key:this._count},a))),t=t.slice(n.end)}return e}}]),t}();O_.propTypes={children:v_.default.string.isRequired,search:v_.default.string.isRequired};var S_=O_,j_=Object.defineProperty({default:S_},"__esModule",{value:!0}),x_=je((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(t,n,r,a,o){var i=r||"<<anonymous>>",s=o||n;if(null==t[n])return new Error("The "+a+" `"+s+"` is required to make `"+i+"` accessible for users of assistive technologies such as screen readers.");for(var c=arguments.length,l=Array(c>5?c-5:0),u=5;u<c;u++)l[u-5]=arguments[u];return e.apply(void 0,[t,n,r,a,o].concat(l))}},e.exports=t.default}));var k_=function(){},E_=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},T_=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}}(),P_=R_(V),N_=R_(te);function R_(e){return e&&e.__esModule?e:{default:e}}function M_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function A_(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}var L_=function(e){var t=function(t){function n(){var e,t,r;M_(this,n);for(var a=arguments.length,o=Array(a),i=0;i<a;i++)o[i]=arguments[i];return t=r=A_(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(o))),r._handleClick=function(e){var t=r.props,n=t.option,a=t.onClick;r.context.onMenuItemClick(n,e),a&&a(e)},r._updateInitialItem=function(e){var t=e.option;0===e.position&&r.context.onInitialItemChange(t)},A_(r,t)}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)}(n,P_.default.Component),T_(n,[{key:"componentWillMount",value:function(){this._updateInitialItem(this.props)}},{key:"componentWillReceiveProps",value:function(e,t){var n=this.context.activeIndex===this.props.position,r=e.option,a=e.position,o=t.activeIndex,i=t.onActiveItemChange;null!=a&&(o===a&&((0,Up.scrollIntoViewIfNeeded)((0,Z.findDOMNode)(this)),!n&&i(r)),this._updateInitialItem(e))}},{key:"render",value:function(){var t=this.context,n=t.activeIndex,r=t.isOnlyResult,a=this.props,o=a.label;a.option;var i=a.position,s=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(a,["label","option","position"]),c=r||n===i;return P_.default.createElement(e,E_({},s,{active:c,"aria-label":o,"aria-selected":c,id:(0,Up.getMenuItemId)(i),onClick:this._handleClick,onMouseDown:Up.preventInputBlur,role:"option"}))}}]),n}();return t.displayName="MenuItemContainer("+(0,Up.getDisplayName)(e)+")",t.propTypes={option:N_.default.oneOfType([N_.default.object,N_.default.string]).isRequired,position:N_.default.number},t.contextTypes={activeIndex:N_.default.number.isRequired,isOnlyResult:N_.default.bool.isRequired,onActiveItemChange:N_.default.func.isRequired,onInitialItemChange:N_.default.func.isRequired,onMenuItemClick:N_.default.func.isRequired},t},I_=Object.defineProperty({default:L_},"__esModule",{value:!0}),D_=je((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.BaseMenuItem=void 0;var n=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},r=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}}(),a=c(Sf),o=c(k_),i=c(V),s=c(I_);function c(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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}var p=function(e){function t(){var e,n,r;l(this,t);for(var a=arguments.length,o=Array(a),i=0;i<a;i++)o[i]=arguments[i];return n=r=u(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r._handleClick=function(e){var t=r.props,n=t.disabled,a=t.onClick;e.preventDefault(),!n&&a(e)},u(r,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,e),r(t,[{key:"render",value:function(){var e=this.props,t=e.active,r=e.children,o=e.className,s=e.disabled;e.onClick;var c=e.onMouseDown,l=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["active","children","className","disabled","onClick","onMouseDown"]),u={active:t,disabled:s};return i.default.createElement("li",n({},l,{className:(0,a.default)(u,o)}),i.default.createElement("a",{className:(0,a.default)("dropdown-item",u),href:"#",onClick:this._handleClick,onMouseDown:c},r))}}]),t}(i.default.Component);p.defaultProps={onClick:o.default},t.BaseMenuItem=p,t.default=(0,s.default)(p)})),q_=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},$_=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}}(),F_=z_(Sf),B_=z_(te),U_=z_(x_),W_=z_(V);function z_(e){return e&&e.__esModule?e:{default:e}}function G_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function H_(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}var K_=function(e){function t(){return G_(this,t),H_(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}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,W_.default.Component),$_(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.emptyLabel,a=e.id,o=e.innerRef,i=e.maxHeight,s=e.style,c=0===V.Children.count(t)?W_.default.createElement(D_.BaseMenuItem,{disabled:!0},r):t;return W_.default.createElement("ul",{className:(0,F_.default)("rbt-menu","dropdown-menu","show",n),id:a,ref:o,role:"listbox",style:q_({},s,{display:"block",maxHeight:i,overflow:"auto"})},c)}}]),t}();K_.propTypes={id:(0,U_.default)(B_.default.oneOfType([B_.default.number,B_.default.string])),maxHeight:B_.default.string},K_.defaultProps={maxHeight:"300px"},K_.Divider=function(e){return W_.default.createElement("li",{className:"divider dropdown-divider",role:"separator"})},K_.Header=function(e){return W_.default.createElement("li",q_({},e,{className:"dropdown-header"}))};var V_=K_,J_=Object.defineProperty({default:V_},"__esModule",{value:!0}),Q_=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},Y_=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}}(),X_=rw(V),Z_=rw(te),ew=rw(j_),tw=rw(J_),nw=rw(D_);function rw(e){return e&&e.__esModule?e:{default:e}}function aw(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ow(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}var iw=function(e){function t(){var e,n,r;aw(this,t);for(var a=arguments.length,o=Array(a),i=0;i<a;i++)o[i]=arguments[i];return n=r=ow(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r._renderMenuItem=function(e,t){var n=r.props,a=n.labelKey,o=n.newSelectionPrefix,i=n.renderMenuItemChildren,s=n.text,c=(0,Up.getOptionLabel)(e,a),l={disabled:e.disabled,key:t,label:c,option:e,position:t};return e.customOption?X_.default.createElement(nw.default,Q_({},l,{className:"rbt-menu-custom-option",label:o+c}),o,X_.default.createElement(ew.default,{search:s},c)):e.paginationOption?[X_.default.createElement(tw.default.Divider,{key:"pagination-item-divider"}),X_.default.createElement(nw.default,Q_({},l,{className:"rbt-menu-pagination-option",key:"pagination-item"}),c)]:X_.default.createElement(nw.default,l,i(e,r.props,t))},ow(r,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,X_.default.Component),Y_(t,[{key:"render",value:function(){var e=this.props;e.labelKey,e.newSelectionPrefix;var t=e.options;e.renderMenuItemChildren,e.text;var n=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["labelKey","newSelectionPrefix","options","renderMenuItemChildren","text"]);return X_.default.createElement(tw.default,n,t.map(this._renderMenuItem))}}]),t}();iw.propTypes={newSelectionPrefix:Z_.default.string,renderMenuItemChildren:Z_.default.func},iw.defaultProps={newSelectionPrefix:"New selection: ",renderMenuItemChildren:function(e,t,n){return X_.default.createElement(ew.default,{search:t.text},(0,Up.getOptionLabel)(e,t.labelKey))}};var sw=iw,cw=Object.defineProperty({default:sw},"__esModule",{value:!0}),lw=Object.create,uw=function(){function e(){}return function(t){if(!Fe(t))return{};if(lw)return lw(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),pw=uw;var dw=function(){};function fw(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}fw.prototype=pw(dw.prototype),fw.prototype.constructor=fw;var hw=fw,gw=fr&&new fr,mw=gw?function(e){return gw.get(e)}:k_,yw=mw,vw={},bw=Object.prototype.hasOwnProperty;var _w=function(e){for(var t=e.name+"",n=vw[t],r=bw.call(vw,t)?n.length:0;r--;){var a=n[r],o=a.func;if(null==o||o==e)return a.name}return t};function ww(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}ww.prototype=pw(dw.prototype),ww.prototype.constructor=ww;var Cw=ww;var Ow=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};var Sw=function(e){if(e instanceof Cw)return e.clone();var t=new hw(e.__wrapped__,e.__chain__);return t.__actions__=Ow(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t},jw=Object.prototype.hasOwnProperty;function xw(e){if(Tt(e)&&!Lt(e)&&!(e instanceof Cw)){if(e instanceof hw)return e;if(jw.call(e,"__wrapped__"))return Sw(e)}return new hw(e)}xw.prototype=dw.prototype,xw.prototype.constructor=xw;var kw=xw;var Ew=function(e){var t=_w(e),n=kw[t];if("function"!=typeof n||!(t in Cw.prototype))return!1;if(e===n)return!0;var r=yw(n);return!!r&&e===r[0]};var Tw=function(e){return Rf((function(t){var n=t.length,r=n,a=hw.prototype.thru;for(e&&t.reverse();r--;){var o=t[r];if("function"!=typeof o)throw new TypeError("Expected a function");if(a&&!i&&"wrapper"==_w(o))var i=new hw([],!0)}for(r=i?r:n;++r<n;){o=t[r];var s=_w(o),c="wrapper"==s?yw(o):void 0;i=c&&Ew(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?i[_w(c[0])].apply(i,c[3]):1==o.length&&Ew(o)?i[s]():i.thru(o)}return function(){var e=arguments,r=e[0];if(i&&1==e.length&&Lt(r))return i.plant(r).value();for(var a=0,o=n?t[a].apply(this,e):r;++a<n;)o=t[a].call(this,o);return o}}))},Pw=Tw(!0),Nw=0;var Rw=function(e){var t=++Nw;return zr(e)+t},Mw=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},Aw=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}}(),Lw=qw(Vd),Iw=qw(te),Dw=qw(V);function qw(e){return e&&e.__esModule?e:{default:e}}function $w(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fw(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}var Bw=function(e){var t=function(t){function n(){var e,t,r;$w(this,n);for(var a=arguments.length,o=Array(a),i=0;i<a;i++)o[i]=arguments[i];return t=r=Fw(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(o))),r.state={isOnlyResult:!1},r._handleKeyDown=function(e){var t=r.props,n=t.initialItem,a=t.onKeyDown,o=t.onAdd;if(e.keyCode===Hv)r.state.isOnlyResult&&o(n);a(e)},Fw(r,t)}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)}(n,Dw.default.Component),Aw(n,[{key:"componentWillReceiveProps",value:function(e){var t=e.allowNew,n=e.highlightOnlyResult,r=e.results;n&&!t&&r.length!==this.props.results.length&&this.setState({isOnlyResult:1===r.length&&!(0,Lw.default)(r).disabled})}},{key:"getChildContext",value:function(){return{isOnlyResult:this.state.isOnlyResult}}},{key:"render",value:function(){return Dw.default.createElement(e,Mw({},this.props,{onKeyDown:this._handleKeyDown}))}}]),n}();return t.childContextTypes={isOnlyResult:Iw.default.bool.isRequired},t},Uw=Object.defineProperty({default:Bw},"__esModule",{value:!0}),Ww=function(e,t,n){var r=e.caseSensitive,a=e.filterBy;(0,zw.default)(!r||"function"!=typeof a,"Your `filterBy` function will override the `caseSensitive` prop.")},zw=function(e){return e&&e.__esModule?e:{default:e}}(od);var Gw=Object.defineProperty({default:Ww},"__esModule",{value:!0}),Hw=function(e,t){return function(n,r,a){Kw.default.checkPropTypes(function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}({},r,e),n,"prop",a),"function"==typeof t&&t(n,r,a)}},Kw=function(e){return e&&e.__esModule?e:{default:e}}(te);var Vw=Object.defineProperty({default:Hw},"__esModule",{value:!0}),Jw=function(e,t,n){var r=e.defaultInputValue,a=e.defaultSelected,o=e.multiple,i=e.selected,s=a.length?"defaultSelected":"selected";(0,Qw.default)(!(!o&&r&&(a.length||i&&i.length)),"`defaultInputValue` will be overridden by the value from `"+s+"`.")},Qw=function(e){return e&&e.__esModule?e:{default:e}}(od);var Yw=Object.defineProperty({default:Jw},"__esModule",{value:!0}),Xw=function(e,t,n){var r=e.allowNew,a=e.highlightOnlyResult;(0,Zw.default)(!(a&&r),"`highlightOnlyResult` will not work with `allowNew`.")},Zw=function(e){return e&&e.__esModule?e:{default:e}}(od);var eC=Object.defineProperty({default:Xw},"__esModule",{value:!0}),tC=function(e,t,n){var r=e.filterBy,a=e.ignoreDiacritics;(0,nC.default)(a||"function"!=typeof r,"Your `filterBy` function will override the `ignoreDiacritics` prop.")},nC=function(e){return e&&e.__esModule?e:{default:e}}(od);var rC=Object.defineProperty({default:tC},"__esModule",{value:!0}),aC=function(e,t,n){var r=e.inputProps;if(!r||!(0,oC.default)(r))return;cC.forEach((function(e){var t=e.alt,n=e.prop,a=t?" Use the top-level `"+t+"` prop instead.":null;(0,iC.default)(!r.hasOwnProperty(n),"The `"+n+"` property of `inputProps` will be ignored."+a)}))},oC=sC(Md),iC=sC(od);function sC(e){return e&&e.__esModule?e:{default:e}}var cC=[{alt:"onBlur",prop:"onBlur"},{alt:"onInputChange",prop:"onChange"},{alt:"onFocus",prop:"onFocus"},{alt:"onKeyDown",prop:"onKeyDown"}];var lC=Object.defineProperty({default:aC},"__esModule",{value:!0}),uC=function(e,t,n){var r=e.allowNew,a=e.labelKey;(0,pC.default)(!("function"==typeof a&&r),"`labelKey` must be a string when `allowNew={true}`.")},pC=function(e){return e&&e.__esModule?e:{default:e}}(od);var dC=Object.defineProperty({default:uC},"__esModule",{value:!0}),fC=function(e){return e&&e.__esModule?e:{default:e}}(te);var hC=fC.default.oneOfType([fC.default.arrayOf(fC.default.object.isRequired),fC.default.arrayOf(fC.default.string.isRequired)]),gC=Object.defineProperty({default:hC},"__esModule",{value:!0}),mC=je((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.optionType=t.labelKeyType=t.inputPropsType=t.ignoreDiacriticsType=t.highlightOnlyResultType=t.defaultInputValueType=t.checkPropType=t.caseSensitiveType=void 0;var n=u(Gw),r=u(Vw),a=u(Yw),o=u(eC),i=u(rC),s=u(lC),c=u(dC),l=u(gC);function u(e){return e&&e.__esModule?e:{default:e}}t.caseSensitiveType=n.default,t.checkPropType=r.default,t.defaultInputValueType=a.default,t.highlightOnlyResultType=o.default,t.ignoreDiacriticsType=i.default,t.inputPropsType=s.default,t.labelKeyType=c.default,t.optionType=l.default})),yC=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},vC=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}}(),bC=EC(Pw),_C=EC(Vd),wC=EC(Gp),CC=EC(k_),OC=EC(Rw),SC=EC(te),jC=EC(Yv),xC=EC(V),kC=EC(Uw);function EC(e){return e&&e.__esModule?e:{default:e}}function TC(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PC(e){var t=e.defaultInputValue,n=e.defaultSelected,r=e.maxResults,a=e.multiple,o=e.selected?e.selected.slice():n.slice(),i=t;return!a&&o.length&&(i=(0,Up.getOptionLabel)((0,_C.default)(o),e.labelKey),o.length>1&&(o=o.slice(0,1))),{activeIndex:-1,activeItem:null,initialItem:null,selected:o,showMenu:!1,shownResults:r,text:i}}var NC=function(e){e=(0,bC.default)(kC.default)(e);var t=function(t){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=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,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.blur=function(){t.getInput().blur(),t._hideMenu()},t.clear=function(){t.setState(yC({},PC(t.props),{selected:[],text:""}))},t.focus=function(){t.getInput().focus()},t.getInput=function(){return t._input},t._handleActiveIndexChange=function(e){var n={activeIndex:e};-1===e&&(n.activeItem=null),t.setState(n)},t._handleActiveItemChange=function(e){t.setState({activeItem:e})},t._handleClear=function(){t.clear(),t._updateSelected([])},t._handleFocus=function(e){t.setState({showMenu:!0},(function(){return t.props.onFocus(e)}))},t._handleInitialItemChange=function(e){var n=t.props.labelKey,r=t.state.initialItem;(0,wC.default)(e,r)||r&&e&&e.customOption&&e[n]===r[n]||t.setState({initialItem:e})},t._handleInputChange=function(e){e.persist();var n=e.target.value,r=PC(t.props),a=r.activeIndex,o=r.activeItem,i=r.shownResults,s=t.props,c=s.multiple,l=s.onInputChange;t.setState({activeIndex:a,activeItem:o,showMenu:!0,shownResults:i,text:n},(function(){return l(n,e)})),t.state.selected.length&&!c&&t._updateSelected([])},t._handleKeyDown=function(e,n,r){var a=t.state.activeItem;switch(e.keyCode){case Vv:case Qv:if(!r){t._showMenu();break}var o=t.state.activeIndex;for(e.preventDefault(),o+=e.keyCode===Vv?-1:1;n[o]&&n[o].disabled;)o+=e.keyCode===Vv?-1:1;o===n.length?o=-1:-2===o&&(o=n.length-1),t._handleActiveIndexChange(o);break;case Kv:r&&t._hideMenu();break;case Hv:if(!r)break;e.preventDefault(),a&&t._handleMenuItemSelect(a,e);break;case Jv:case Gv:if(!r)break;if(a&&!a.paginationOption){e.keyCode===Gv&&e.preventDefault(),t._handleSelectionAdd(a);break}e.keyCode===Gv&&t._hideMenu()}t.props.onKeyDown(e)},t._handleMenuItemSelect=function(e,n){e.paginationOption?t._handlePaginate(n):t._handleSelectionAdd(e)},t._handlePaginate=function(e){e.persist();var n=t.props,r=n.maxResults,a=n.onPaginate,o=t.state.shownResults+r;t.setState({shownResults:o},(function(){return a(e,o)}))},t._handleSelectionAdd=function(e){var n=t.props,r=n.multiple,a=n.labelKey,o=void 0,i=void 0;r?(o=t.state.selected.concat(e),i=""):(o=[e],i=(0,Up.getOptionLabel)(e,a)),t._hideMenu(),t.setState({initialItem:e,text:i}),t._updateSelected(o)},t._handleSelectionRemove=function(e){var n=t.state.selected.filter((function(t){return!(0,wC.default)(t,e)}));t.focus(),t._hideMenu(),t._updateSelected(n)},t.handleClickOutside=function(e){t.state.showMenu&&t._hideMenu()},t._hideMenu=function(){var e=PC(t.props),n=e.activeIndex,r=e.activeItem,a=e.showMenu,o=e.shownResults;t.setState({activeIndex:n,activeItem:r,showMenu:a,shownResults:o})},t._showMenu=function(){t.setState({showMenu:!0})},t._updateSelected=function(e){t.setState({selected:e},(function(){return t.props.onChange(e)}))},t.state=PC(e),t}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)}(n,xC.default.Component),vC(n,[{key:"getChildContext",value:function(){return{activeIndex:this.state.activeIndex,onActiveItemChange:this._handleActiveItemChange,onInitialItemChange:this._handleInitialItemChange,onMenuItemClick:this._handleMenuItemSelect}}},{key:"componentWillMount",value:function(){this._menuId=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")+Math.random().toString(36).substr(2,12)}("rbt-menu-")}},{key:"componentDidMount",value:function(){this.props.autoFocus&&this.focus()}},{key:"componentWillReceiveProps",value:function(e){var t=e.labelKey,n=e.multiple,r=e.selected;if(r&&!(0,wC.default)(r,this.state.selected)){if(this.setState({selected:r}),n)return;this.setState({text:r.length?(0,Up.getOptionLabel)((0,_C.default)(r),t):""})}var a=r||this.state.selected;if(!n&&a.length>1)return a=a.slice(0,1),void this.setState({selected:a,text:(0,Up.getOptionLabel)((0,_C.default)(a),t)});n!==this.props.multiple&&this.setState({text:""})}},{key:"render",value:function(){var t=this,n=yC({},this.props,this.state),r=n.filterBy,a=n.labelKey,o=n.minLength,i=n.options,s=n.paginate,c=n.paginationText,l=n.shownResults,u=n.text,p=[];if(u.length>=o){var d=Array.isArray(r)?Up.defaultFilterBy:r;p=i.filter((function(e){return d(e,n)}))}var f,h=s&&p.length>l;(p=(0,Up.getTruncatedOptions)(p,l),(0,Up.addCustomOption)(p,n)&&p.push(TC({customOption:!0,id:(0,OC.default)("new-id-")},(0,Up.getStringLabelKey)(a),u)),h)&&p.push((TC(f={},(0,Up.getStringLabelKey)(a),c),TC(f,"paginationOption",!0),f));var g=(0,Up.isShown)(p,n);return xC.default.createElement(e,yC({},n,{inputRef:function(e){return t._input=e},isMenuShown:g,menuId:this.props.menuId||this._menuId,onAdd:this._handleSelectionAdd,onChange:this._handleInputChange,onClear:this._handleClear,onFocus:this._handleFocus,onInitialItemChange:this._handleInitialItemChange,onKeyDown:function(e){return t._handleKeyDown(e,p,g)},onRemove:this._handleSelectionRemove,results:p}))}}]),n}();return t.displayName="TypeaheadContainer("+(0,Up.getDisplayName)(e)+")",t.propTypes={a11yNumResults:SC.default.func,a11yNumSelected:SC.default.func,align:SC.default.oneOf(["justify","left","right"]),allowNew:SC.default.oneOfType([SC.default.bool,SC.default.func]),autoFocus:SC.default.bool,bodyContainer:SC.default.bool,caseSensitive:(0,mC.checkPropType)(SC.default.bool,mC.caseSensitiveType),clearButton:SC.default.bool,defaultInputValue:(0,mC.checkPropType)(SC.default.string,mC.defaultInputValueType),defaultSelected:mC.optionType,disabled:SC.default.bool,dropup:SC.default.bool,emptyLabel:SC.default.node,filterBy:SC.default.oneOfType([SC.default.arrayOf(SC.default.string.isRequired),SC.default.func]),flip:SC.default.bool,highlightOnlyResult:(0,mC.checkPropType)(SC.default.bool,mC.highlightOnlyResultType),ignoreDiacritics:(0,mC.checkPropType)(SC.default.bool,mC.ignoreDiacriticsType),inputProps:(0,mC.checkPropType)(SC.default.object,mC.inputPropsType),isInvalid:SC.default.bool,isLoading:SC.default.bool,isValid:SC.default.bool,labelKey:(0,mC.checkPropType)(SC.default.oneOfType([SC.default.string,SC.default.func]),mC.labelKeyType),maxResults:SC.default.number,menuId:SC.default.oneOfType([SC.default.number,SC.default.string]),minLength:SC.default.number,multiple:SC.default.bool,onBlur:SC.default.func,onChange:SC.default.func,onFocus:SC.default.func,onInputChange:SC.default.func,onKeyDown:SC.default.func,onMenuHide:SC.default.func,onMenuShow:SC.default.func,onPaginate:SC.default.func,options:mC.optionType.isRequired,paginate:SC.default.bool,paginationText:SC.default.string,placeholder:SC.default.string,renderMenu:SC.default.func,selected:mC.optionType,selectHintOnEnter:SC.default.bool},t.defaultProps={a11yNumResults:function(e){return(0,Up.pluralize)("result",e.length)+". Use up and down arrow keys to navigate."},a11yNumSelected:function(e){return(0,Up.pluralize)("selection",e.length)},align:"justify",allowNew:!1,autoFocus:!1,bodyContainer:!1,caseSensitive:!1,clearButton:!1,defaultInputValue:"",defaultSelected:[],disabled:!1,dropup:!1,emptyLabel:"No matches found.",filterBy:[],flip:!1,highlightOnlyResult:!1,ignoreDiacritics:!0,inputProps:{},isInvalid:!1,isLoading:!1,isValid:!1,labelKey:Ad.DEFAULT_LABELKEY,maxResults:100,minLength:0,multiple:!1,onBlur:CC.default,onChange:CC.default,onFocus:CC.default,onInputChange:CC.default,onKeyDown:CC.default,onMenuHide:CC.default,onMenuShow:CC.default,onPaginate:CC.default,paginate:!0,paginationText:"Display additional results...",placeholder:"",selectHintOnEnter:!1},t.childContextTypes={activeIndex:SC.default.number.isRequired,onActiveItemChange:SC.default.func.isRequired,onInitialItemChange:SC.default.func.isRequired,onMenuItemClick:SC.default.func.isRequired},(0,jC.default)(t)},RC=Object.defineProperty({default:NC},"__esModule",{value:!0}),MC=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},AC=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}}(),LC=HC(Sf),IC=HC(Mf),DC=HC(te),qC=HC(V),$C=HC(Bf),FC=HC(Vf),BC=HC(wv),UC=HC(a_),WC=HC(m_),zC=HC(cw),GC=HC(RC);function HC(e){return e&&e.__esModule?e:{default:e}}function KC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VC(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}var JC=function(e){function t(){var e,n,r;KC(this,t);for(var a=arguments.length,o=Array(a),i=0;i<a;i++)o[i]=arguments[i];return n=r=VC(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r._renderInput=function(e){var t=e.multiple?UC.default:WC.default;return qC.default.createElement(t,e)},r._renderAux=function(){var e=r.props,t=e.bsSize,n=e.clearButton,a=e.disabled,o=e.isLoading,i=e.onClear,s=e.selected,c=void 0;return o?c=qC.default.createElement(FC.default,{bsSize:t}):n&&!a&&s.length&&(c=qC.default.createElement($C.default,{bsSize:t,onClick:i,onFocus:function(e){e.stopPropagation()},onMouseDown:Up.preventInputBlur})),c?qC.default.createElement("div",{className:(0,LC.default)("rbt-aux",{"rbt-aux-lg":"large"===t||"lg"===t})},c):null},VC(r,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,qC.default.Component),AC(t,[{key:"componentWillReceiveProps",value:function(e){var t=e.allowNew,n=e.onInitialItemChange,r=e.results;t||r.length||n(null)}},{key:"render",value:function(){var e=this,t=this.props,n=t.bodyContainer,r=t.children,a=t.className,o=t.isMenuShown,i=t.menuId,s=t.renderMenu,c=t.results,l=(0,IC.default)(this.props,["activeIndex","activeItem","bsSize","disabled","initialItem","inputProps","inputRef","isInvalid","isMenuShown","isValid","labelKey","menuId","multiple","onAdd","onBlur","onChange","onFocus","onKeyDown","onRemove","placeholder","renderToken","selected","selectHintOnEnter","text"]),u=(0,IC.default)(this.props,["align","className","dropup","flip","onMenuHide","onMenuShow"]),p=(0,IC.default)(this.props,["emptyLabel","labelKey","maxHeight","newSelectionPrefix","renderMenuItemChildren","text"]),d=this._renderAux();return qC.default.createElement("div",{className:(0,LC.default)("rbt","clearfix","open",{"has-aux":!!d},a),style:{position:"relative"},tabIndex:-1},this._renderInput(MC({},l,{ref:function(t){return e._inputContainer=(0,Z.findDOMNode)(t)}})),"function"==typeof r?r(this.props):r,d,qC.default.createElement(BC.default,MC({},u,{container:n?document.body:this,referenceElement:this._inputContainer,show:o}),s(c,MC({},p,{id:i}))),qC.default.createElement("div",{"aria-atomic":!0,"aria-live":"polite",className:"sr-only rbt-sr-status",role:"status"},(0,Up.getAccessibilityStatus)(this.props)))}}]),t}();JC.propTypes={renderMenu:DC.default.func},JC.defaultProps={renderMenu:function(e,t){return qC.default.createElement(zC.default,MC({},t,{options:e}))}};var QC=(0,GC.default)(JC),YC=Object.defineProperty({default:QC},"__esModule",{value:!0}),XC=eO(Of),ZC=eO(YC);function eO(e){return e&&e.__esModule?e:{default:e}}var tO=(0,XC.default)(ZC.default),nO=Object.defineProperty({default:tO},"__esModule",{value:!0}),rO=je((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.tokenContainer=t.menuItemContainer=t.asyncContainer=t.TypeaheadMenu=t.Typeahead=t.Token=t.MenuItem=t.Menu=t.Highlighter=t.AsyncTypeahead=void 0;var n=d(nO),r=d(j_),a=d(J_),o=d(D_),i=d(_b),s=d(YC),c=d(cw),l=d(Of),u=d(I_),p=d(ib);function d(e){return e&&e.__esModule?e:{default:e}}t.AsyncTypeahead=n.default,t.Highlighter=r.default,t.Menu=a.default,t.MenuItem=o.default,t.Token=i.default,t.Typeahead=s.default,t.TypeaheadMenu=c.default,t.asyncContainer=l.default,t.menuItemContainer=u.default,t.tokenContainer=p.default}));const aO="app.disableConfigEdit",oO=(e,t)=>({disabledBecauseOfState:(t.disabledStateKeys||[]).some((t=>x(e,t,!1)))});function iO(e){return rc(oO)((t=>{const{disabled:n,disabledBecauseOfState:r}=t,a=S(t,["disabled","disabledBecauseOfState","disabledStateKeys","dispatch"]);return K.createElement(e,Object.assign({},a,{disabled:n||r}))}))}const sO=iO((e=>{const{children:t}=e,n=Fi(e,["children"]);return K.createElement("button",Object.assign({},n),t)})),cO=iO((e=>{const{className:t}=e,n=Fi(e,["className"]);return K.createElement("input",Object.assign({},n,{className:fa(t,{"form-control":!["radio","checkbox"].includes(n.type),"input-sm":!["radio","checkbox"].includes(n.type)})}))})),lO=iO((e=>{const{children:t}=e,n=Fi(e,["children"]);return K.createElement(ne,Object.assign({},n),t)})),uO=iO((e=>{const{children:t}=e,n=Fi(e,["children"]);return K.createElement(rO.Typeahead,Object.assign({},n),t)})),pO=iO((e=>{const{children:t}=e,n=Fi(e,["children"]);return K.createElement("select",Object.assign({},n),t)})),dO=iO((e=>{const{className:t}=e,n=Fi(e,["className"]);return K.createElement("textarea",Object.assign({className:fa("form-control","input-sm",t)},n))}));function fO({value:e,label:t,name:n,current:r,action:a}){return K.createElement("div",{className:"radio-inline"},K.createElement("label",{style:{fontWeight:"normal",marginRight:"1em"}},K.createElement(cO,{type:"radio",name:n,value:e,onChange:a,checked:e===r,disabledStateKeys:[aO]})," ",t))}var hO;!function(e){e.Requesting="requesting",e.Fulfilled="fulfilled",e.Failed="failed"}(hO||(hO={}));var gO=rc(((e,t)=>{const n=e.data.metricsServiceMetadata.data.map((e=>({label:e.name,value:e.name})));return Object.assign({options:n,loading:e.data.metricsServiceMetadata.load===hO.Requesting},t)}),(e=>({load:t=>{e(hp({filter:t}))}})))((({loading:e,load:t,options:n,value:r,onChange:a})=>(r&&n.every((e=>e.value!==r))&&(n=n.concat({label:r,value:r})),K.createElement(lO,{isLoading:e,options:n,onChange:a,value:r,placeholder:"Enter at least three characters to search.",onInputChange:e=>(t(e),e),disabledStateKeys:[aO]}))));const mO=e=>x(e,"query.metricName",":"),yO=e=>mO(e).split(":",2)[1],vO=e=>mO(e).split(":",2)[0];var bO=rc((function(e){return{editingMetric:e.selectedConfig.editingMetric}}),(function(e){return{changeMetricName:(t,n)=>{e(mp({metricName:t+":"+n}))}}}))((function({changeMetricName:e,editingMetric:t}){return K.createElement(K.Fragment,null,K.createElement(Ep,{label:"Datadog Metric",inputOnly:!0},K.createElement(gO,{value:yO(t),onChange:n=>e(vO(t),x(n,"value"))})),K.createElement(Ep,{label:"Metric Aggregation"},K.createElement(fO,{value:"avg",label:"Average",name:"aggregator",current:vO(t),action:()=>e("avg",yO(t))}),K.createElement(fO,{value:"sum",label:"Sum",name:"aggregator",current:vO(t),action:()=>e("sum",yO(t))}),K.createElement(fO,{value:"max",label:"Max",name:"aggregator",current:vO(t),action:()=>e("max",yO(t))}),K.createElement(fO,{value:"min",label:"Min",name:"aggregator",current:vO(t),action:()=>e("min",yO(t))})))}));cc.register({name:"datadog",metricConfigurer:bO,queryFinder:mO,useTemplates:!0});ha("li[id^='rbt-menu-item'] {\n pointer-events: none;\n}\n");var _O=rc(((e,t)=>{const n=e.data.metricsServiceMetadata.data.map((e=>e.name));return Object.assign({options:n,loading:e.data.metricsServiceMetadata.load===hO.Requesting},t)}),(e=>({load:t=>{e(dp({filter:t}))}})))((({loading:e,load:t,options:n,value:r,onChange:a})=>(n=n.concat(r),K.createElement(uO,{options:n,isLoading:e,onChange:e=>{a(e),t(e[0])},defaultInputValue:r,renderMenuItemChildren:e=>K.createElement("a",{style:{pointerEvents:"all",textDecoration:"none",color:"#000000"}},e),placeholder:"Enter at least three characters to search.",onInputChange:e=>(a([e]),t(e),e),disabledStateKeys:[aO]}))));const wO=e=>x(e,"query.metricName","");var CO=rc((function(e){return{editingMetric:e.selectedConfig.editingMetric}}),(function(e){return{changeMetricName:t=>{e(kp({metricName:t}))}}}))((function({changeMetricName:e,editingMetric:t}){return K.createElement(Ep,{label:"Graphite Metric",inputOnly:!0},K.createElement(_O,{value:wO(t),onChange:t=>{e(t[0])}}))}));cc.register({name:"graphite",metricConfigurer:CO,queryFinder:wO});const OO=e=>x(e,"query.select","");var SO=rc((function(e){return{editingMetric:e.selectedConfig.editingMetric}}),(function(e){return{changeSelect:t=>{e(yp({select:t.target.value}))}}}))((function({changeSelect:e,editingMetric:t}){return K.createElement(K.Fragment,null,K.createElement(Ep,{label:"NRQL Select",inputOnly:!0},K.createElement(cO,{type:"text",value:OO(t),onChange:e,disabledStateKeys:[aO]}),K.createElement("span",{className:"body-small color-text-caption",style:{marginTop:"5px"}},"Enter the NRQL query only up to, but not including, the WHERE clause")))}));cc.register({name:"newrelic",metricConfigurer:SO,queryFinder:OO});var jO,xO=({onClick:e,className:t,label:n})=>K.createElement(sO,{onClick:e,disabledStateKeys:[aO],className:fa("add-new","btn","btn-block","btn-sm",t)},K.createElement("span",{className:"glyphicon glyphicon-plus-sign"})," ",n||"Add new"),kO=({onClick:e})=>K.createElement("a",{className:"clickable",onClick:e},K.createElement("span",{className:"glyphicon glyphicon-trash"}));ha(".kayenta-list a.clickable {\n margin: 5px 0 0 10px;\n}\n.kayenta-list input.input-sm {\n width: 93%;\n}\n"),function(e){e[e.Add=0]="Add",e[e.Edit=1]="Edit",e[e.Delete=2]="Delete"}(jO||(jO={}));const EO=(e="")=>(t,n)=>{const{index:r,value:a}=n.payload;switch(n.payload.type){case jO.Add:return t.concat(e);case jO.Delete:return[...t.slice(0,r),...t.slice(r+1)];case jO.Edit:return[...t.slice(0,r),a,...t.slice(r+1)]}},TO=({list:e,valueKey:t,actionCreator:n})=>{const r=e=>t=>n({type:jO.Edit,index:e,value:t.target.value}),a=e=>()=>n({type:jO.Delete,index:e});return K.createElement("section",null,e.map(((e,n)=>K.createElement("div",{key:t?t(e):n,className:"horizontal form-group kayenta-list"},K.createElement(cO,{value:e,onChange:r(n),disabledStateKeys:[aO]}),K.createElement(kO,{onClick:a(n)})))),K.createElement(xO,{onClick:()=>n({type:jO.Add})}))};function PO(e,t){const{editingTemplate:n,configTemplates:r}=t;if(""===n.editedName)return e.errors.templateName={message:"Name is required"},e;const a=n&&n.editedName!==n.name,o=Object.keys(r||{}),i=a&&o.some((e=>n.editedName===e));return i&&(e.errors.templateName={message:`Filter template named '${n.editedName}' already exists`}),e}function NO(e,t){const{editingTemplate:n}=t;return""===n.editedValue&&(e.errors.templateValue={message:"Value is required"}),e}function RO(e,t){const{metricList:n,editingMetric:r}=t,a=x(r,"query.customFilterTemplate"),o=null!=r&&null!=a&&n.filter((e=>e.name!==r.name&&a===x(e,"query.customFilterTemplate")));return E(o)||(e.warnings.template={message:`Warning: editing or deleting this template will affect the following metrics: ${o.map((e=>e.name)).join(", ")}`}),e}var MO;!function(e){e.PROMQL="PROMQL",e.DEFAULT="DEFAULT"}(MO||(MO={}));function AO(e){return null!=e&&e.startsWith("PromQL:")}const LO={[MO.PROMQL]:{fromValue:function(e){return AO(e)?e.substring("PromQL:".length):e},toValue:function(e){return`PromQL:${e}`}}};var IO=je((function(e,t){function n(e,t){return e===t}function r(e,t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,a=0;a<r;a++)if(!e(t[a],n[a]))return!1;return!0}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n,a=null,o=null;return function(){return r(t,a,arguments)||(o=e.apply(null,arguments)),a=arguments,o}}function o(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var n=t.map((function(e){return typeof e})).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+n+"]")}return t}function i(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];var s=0,c=r.pop(),l=o(r),u=e.apply(void 0,[function(){return s++,c.apply(null,arguments)}].concat(n)),p=a((function(){for(var e=[],t=l.length,n=0;n<t;n++)e.push(l[n].apply(null,arguments));return u.apply(null,e)}));return p.resultFunc=c,p.recomputations=function(){return s},p.resetRecomputations=function(){return s=0},p}}t.__esModule=!0,t.defaultMemoize=a,t.createSelectorCreator=i,t.createStructuredSelector=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;if("object"!=typeof e)throw new Error("createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);var n=Object.keys(e);return t(n.map((function(t){return e[t]})),(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce((function(e,t,r){return e[n[r]]=t,e}),{})}))};var s=t.createSelector=i(a)}));function DO(e,t,n){const r=Object.assign({},e),a=x(t,"name","");if(!a)return r.name={message:"Name is required"},r;return n.every((e=>e.name!==a||e.id===t.id))||(r.name={message:`Metric '${a}' already exists`}),r}const qO=e=>e.selectedRun.run,$O=IO.createSelector(qO,(e=>{var t;return null===(t=e.result)||void 0===t?void 0:t.judgeResult})),FO=IO.createSelector(qO,(e=>e.config.id)),BO=IO.createSelector(qO,(e=>{var t,n;return null!==(n=null===(t=e.result)||void 0===t?void 0:t.judgeResult.results)&&void 0!==n?n:[]})),UO=IO.createSelector(qO,(e=>e.canaryExecutionRequest)),WO=IO.createSelector(qO,(e=>e.config)),zO=IO.createSelector(WO,(e=>e.classifier.groupWeights)),GO=e=>e.selectedRun.selectedMetric,HO=IO.createSelector(GO,BO,((e,t)=>t.find((t=>t.id===e)))),KO=IO.createSelector(HO,WO,((e,t)=>t.metrics.find((t=>t.name===e.name)))),VO=e=>e.selectedConfig.config,JO=IO.createSelector(VO,(e=>e?e.templates:null)),QO=e=>e.selectedConfig.editingTemplate,YO=(e,t)=>x(e,["data","executions","data"],[]).find((e=>e.pipelineId===t)).canaryConfigId,XO=e=>e.selectedConfig.editingMetric,ZO=e=>e.selectedConfig.metricList,eS=IO.createSelector(XO,ZO,(function(e,t){return[DO].reduce(((n,r)=>r(n,e,t)),{name:null})})),tS=Object.assign({},LO),nS=IO.createSelector((e=>e.selectedConfig.editingMetric),(e=>e&&"prometheus"===e.query.serviceType?(e=>e.query.queryType?e.query.queryType:AO(e.query.customInlineTemplate)?MO.PROMQL:MO.DEFAULT)(e):null)),rS=IO.createSelector(nS,(e=>x(tS,[e,"fromValue"],F))),aS=IO.createSelector(nS,(e=>x(tS,[e,"toValue"],F))),oS=e=>x(e,"selectedConfig.editingMetric.query.customFilterTemplate"),iS=IO.createSelector((e=>x(e,"selectedConfig.editingMetric.query.customInlineTemplate")),rS,((e,t)=>t(e))),sS=IO.createSelector(QO,JO,ZO,XO,((e,t,n,r)=>{return a={editingTemplate:e,configTemplates:t,metricList:n,editingMetric:r},[PO,NO,RO].reduce(((e,t)=>t(e,a)),{errors:{},warnings:{}});var a})),cS=IO.createSelector(sS,(e=>E(Object.keys(e.errors)))),lS=IO.createSelector(iS,(e=>!E(e))),uS=[MO.PROMQL],pS=IO.createSelector(nS,(e=>uS.includes(e))),dS=IO.createSelector(pS,cS,lS,((e,t,n)=>e?n:t));ha(".prometheus-metric-type-selector-account-hint {\n display: flex;\n align-items: center;\n height: 30px;\n}\n");class fS extends K.Component{constructor(e){super(e),this.showAccountDropdown=()=>{this.setState({showAccountDropdown:!0})},this.selectAccount=e=>{this.setState({selectedAccount:e.value,showAccountDropdown:!1})},this.state={showAccountDropdown:!1,selectedAccount:x(e,["accountOptions",0,"value"])}}render(){const{accountOptions:e,load:t,loading:n,metricOptions:r,onChange:a,value:o}=this.props,i=o&&r.every((e=>e.value!==o))?r.concat({label:o,value:o}):r;return K.createElement(K.Fragment,null,K.createElement(lO,{isLoading:n,options:i,onChange:a,value:o,placeholder:"Enter at least three characters to search.",onInputChange:e=>(t(e,this.state.selectedAccount),e),disabledStateKeys:[aO]}),e.length>1&&K.createElement("div",{className:"prometheus-metric-type-selector-account-hint"},K.createElement("span",null,"Metric search is currently populating from ",this.state.selectedAccount,"."),K.createElement("span",{className:"btn btn-link",onClick:this.showAccountDropdown},!this.state.showAccountDropdown&&"Switch Account")),this.state.showAccountDropdown&&K.createElement(lO,{clearable:!1,options:e,onChange:this.selectAccount,value:this.state.selectedAccount,disabledStateKeys:[aO]}))}}const hS=IO.createSelector((e=>e.data.kayentaAccounts.data),(e=>B(e).filter((e=>e.supportedTypes.includes(ya.MetricsStore)&&"prometheus"===e.type)).sortBy((e=>e.name)).map((e=>({label:e.name,value:e.name}))).value())),gS=IO.createSelector((e=>e.data.metricsServiceMetadata.data),(e=>e.map((e=>({label:e.name,value:e.name})))));var mS=rc(((e,t)=>Object.assign({accountOptions:hS(e),metricOptions:gS(e),loading:e.data.metricsServiceMetadata.load===hO.Requesting},t)),(e=>({load:(t,n)=>{e(pp({filter:t,metricsAccountName:n}))}})))(fS);const yS=["gce_instance","aws_ec2_instance"],vS=e=>e.map((e=>({value:e,label:e})));const bS=IO.createSelector(XO,(function(e){return[_S].reduce(((t,n)=>n(t,e)),{metricName:null})}));function _S(e,t){const n=Object.assign({},e);return x(t,"query.metricName","")||(n.metricName={message:"The Prometheus metric is required."}),n}var wS=rc((function(e){return{editingMetric:e.selectedConfig.editingMetric,queryType:nS(e),validationErrors:bS(e)}}),(function(e){return{updateLabelBindings:t=>e(tp(t)),updateGroupBy:t=>e(np(t)),updatePrometheusMetricQueryField:(t,n)=>e(rp({field:t,value:n&&n.value})),updateFilterQueryType:t=>{e(rp({field:"queryType",value:t})),e(Yu()),e(ip({name:null})),e(ep({value:""}))}}}))((function({editingMetric:e,queryType:t,updateLabelBindings:n,updateGroupBy:r,updateFilterQueryType:a,updatePrometheusMetricQueryField:o,validationErrors:i}){return K.createElement(K.Fragment,null,K.createElement(Ep,{label:"Query Type",helpId:"canary.config.prometheus.queryType"},K.createElement(fO,{value:MO.DEFAULT,label:"Default",name:"queryType",current:t,action:()=>a(MO.DEFAULT)}),K.createElement(fO,{value:MO.PROMQL,label:"PromQL",name:"queryType",current:t,action:()=>a(MO.PROMQL)})),t===MO.DEFAULT&&K.createElement(K.Fragment,null,K.createElement(Ep,{label:"Resource Type",inputOnly:!0},K.createElement(lO,{value:x(e,"query.resourceType"),options:vS(yS),onChange:e=>o("resourceType",e),disabledStateKeys:[aO]})),K.createElement(Ep,{label:"Metric Name",inputOnly:!0,error:x(i,"metricName.message",null)},K.createElement(mS,{value:x(e,"query.metricName",""),onChange:e=>o("metricName",e)})),K.createElement(Ep,{label:"Label Bindings"},K.createElement(TO,{list:e.query.labelBindings||[],actionCreator:n})),K.createElement(Ep,{label:"Group By"},K.createElement(TO,{list:e.query.groupByFields||[],actionCreator:r}))))}));cc.register({name:"prometheus",metricConfigurer:wS,queryFinder:e=>x(e,"query.metricName",""),useTemplates:!0});var CS;ha(".kv-pair-item {\n display: flex;\n align-items: center;\n}\n.kv-pair-item .kv-pair-item-section {\n display: flex;\n margin-right: 5px;\n margin-bottom: 7px;\n}\n.kv-pair-item .kv-pair-item-section .kv-pair-item-section-label-wrapper {\n display: flex;\n flex-flow: column;\n justify-content: center;\n}\n.kv-pair-item .kv-pair-item-section .kv-pair-item-section-input {\n margin-left: 5px;\n}\n"),function(e){e[e.ADD=0]="ADD",e[e.DELETE=1]="DELETE",e[e.KEY_EDIT=2]="KEY_EDIT",e[e.VALUE_EDIT=3]="VALUE_EDIT"}(CS||(CS={}));function OS({list:e,className:t,actionCreator:n}){const r=e=>t=>n({type:CS.KEY_EDIT,index:e,value:t.target.value}),a=e=>t=>n({type:CS.VALUE_EDIT,index:e,value:t.target.value}),o=e=>()=>n({type:CS.DELETE,index:e});return K.createElement("section",{className:fa("kv-pair-list",t)},e.map(((e,t)=>{const{key:n,value:i}=e;return K.createElement("div",{key:t,className:"kv-pair-item"},K.createElement("div",{className:"kv-pair-item-section"},K.createElement("div",{className:"kv-pair-item-section-label-wrapper"},K.createElement("div",{className:"kv-pair-item-section-label"},"Key")),K.createElement("div",{className:"kv-pair-item-section-input"},K.createElement(cO,{value:n,onChange:r(t),disabledStateKeys:[aO]}))),K.createElement("div",{className:"kv-pair-item-section"},K.createElement("div",{className:"kv-pair-item-section-label-wrapper"},K.createElement("div",{className:"kv-pair-item-section-label"},"Value")),K.createElement("div",{className:"kv-pair-item-section-input"},K.createElement(cO,{value:i,onChange:a(t),disabledStateKeys:[aO]}))),K.createElement("div",{className:"kv-pair-item-section"},K.createElement(kO,{onClick:o(t)})))})),K.createElement(xO,{onClick:()=>n({type:CS.ADD})}))}ha(".signalfx-query-pairs {\n padding: 10px 10px 0;\n border-radius: 4px;\n border: 1px solid #ccc;\n}\n.signalfx-query-pairs .add-new {\n margin-bottom: 10px;\n margin-top: 5px;\n}\n");const SS=e=>x(e,"query.metricName",""),jS=SS,xS=e=>x(e,"query.queryPairs",[]),kS=e=>x(e,"query.aggregationMethod","");let ES=class extends K.Component{onMetricNameChange(e){this.props.updateMetricName(e.target.value)}onAggregationMethodChange(e){this.props.updateAggregationMethod(e.target.value)}render(){const{editingMetric:e,updateQueryPairs:t,validationErrors:n}=this.props;return K.createElement("section",null,K.createElement(Ep,{label:"SignalFx Metric",error:x(n,"signalFxMetric.message",null),inputOnly:!0},K.createElement(cO,{type:"text",value:jS(e),onChange:this.onMetricNameChange,disabledStateKeys:[aO]})),K.createElement(Ep,{label:"Aggregation Method",inputOnly:!0,helpId:"canary.config.signalFx.aggregationMethod",error:x(n,"aggregationMethod.message",null)},K.createElement(cO,{type:"text",value:kS(e),onChange:this.onAggregationMethodChange,disabledStateKeys:[aO]})),K.createElement(Ep,{label:"Query Pairs",helpId:"canary.config.signalFx.queryPairs",error:x(n,"queryPairs.message",null)},K.createElement(OS,{className:"signalfx-query-pairs",list:xS(e),actionCreator:t})))}};function TS(e){return e&&e.query?[PS,NS,RS]:[]}function PS(e,t){const n=Object.assign({},e);return jS(t)||(n.signalFxMetric={message:"The SignalFx metric is required."}),n}function NS(e,t){const n=Object.assign({},e);return kS(t)||(n.aggregationMethod={message:"The SignalFx SignalFlow stream aggregation method is required."}),n}function RS(e,t){const n=Object.assign({},e);return xS(t).forEach((e=>{e.key&&e.value||(n.queryPairs={message:"All query pairs must contain a non-blank key and value."})})),n}ES=Bi([Wi],ES);const MS=IO.createSelector(XO,(function(e){return[...TS(e)].reduce(((t,n)=>n(t,e)),{})}));var AS=rc((function(e){return{editingMetric:e.selectedConfig.editingMetric,validationErrors:MS(e)}}),(function(e){return{updateMetricName:t=>{e(Sp({metricName:t}))},updateAggregationMethod:t=>{e(jp({aggregationMethod:t}))},updateQueryPairs:t=>e(xp(t))}}))(ES);cc.register({name:"signalfx",metricConfigurer:AS,queryFinder:SS});const LS=({descriptor:e,field:t,label:n})=>e&&e[t]?K.createElement("div",null,K.createElement("strong",null,n,": "),e[t]):null;class IS extends K.Component{componentDidMount(){this.props.load(this.props.value)}render(){const{loading:e,load:t,descriptors:n,value:r,onChange:a}=this.props;let o=n.map((e=>({label:e.type,value:e.type})));return r&&o.every((e=>e.value!==r))&&(o=o.concat({label:r,value:r})),K.createElement(lO,{isLoading:e,options:o,onChange:a,value:r,optionRenderer:e=>{const t=n.find((t=>t.type===e.value));return t?K.createElement(K.Fragment,null,K.createElement(LS,{descriptor:t,field:"type",label:"Metric"}),K.createElement(LS,{descriptor:t,field:"description",label:"Description"}),K.createElement(LS,{descriptor:t,field:"unit",label:"Unit"}),K.createElement(LS,{descriptor:t,field:"metricKind",label:"Kind"}),K.createElement(LS,{descriptor:t,field:"valueType",label:"Value type"})):K.createElement("span",null,e.label)},placeholder:"Enter at least three characters to search.",onInputChange:e=>(t(e),e),disabledStateKeys:[aO]})}}var DS=rc(((e,t)=>{const n=e.data.metricsServiceMetadata.data;return Object.assign({descriptors:n,loading:e.data.metricsServiceMetadata.load===hO.Requesting},t)}),(e=>({load:t=>{e(fp({filter:t}))}})))(IS);const qS=["gce_instance","aws_ec2_instance","gae_app","k8s_container","k8s_pod","k8s_node","gke_container","https_lb_rule","global"],$S=["REDUCE_NONE","REDUCE_MEAN","REDUCE_MIN","REDUCE_MAX","REDUCE_SUM","REDUCE_COUNT_TRUE","REDUCE_COUNT_FALSE","REDUCE_FRACTION_TRUE","REDUCE_PERCENTILE_99","REDUCE_PERCENTILE_95","REDUCE_PERCENTILE_50","REDUCE_PERCENTILE_05"],FS=["ALIGN_NONE","ALIGN_DELTA","ALIGN_RATE","ALIGN_INTERPOLATE","ALIGN_NEXT_OLDER","ALIGN_MIN","ALIGN_MAX","ALIGN_MEAN","ALIGN_COUNT","ALIGN_SUM","ALIGN_STDDEV","ALIGN_COUNT_TRUE","ALIGN_COUNT_FALSE","ALIGN_FRACTION_TRUE","ALIGN_PERCENTILE_99","ALIGN_PERCENTILE_95","ALIGN_PERCENTILE_50","ALIGN_PERCENTILE_05","ALIGN_PERCENT_CHANGE"],BS=e=>e.map((e=>({value:e,label:e})));var US,WS=rc((function(e){return{editingMetric:e.selectedConfig.editingMetric}}),(function(e){return{updateStackdriverQueryField:(t,n)=>e(gp({field:t,value:n&&n.value})),updateGroupBy:t=>e(ap(t))}}))((function({editingMetric:e,updateGroupBy:t,updateStackdriverQueryField:n}){return K.createElement(K.Fragment,null,K.createElement(Ep,{label:"Resource Type",helpId:"stackdriver.resourceType",inputOnly:!0},K.createElement(lO,{value:x(e,"query.resourceType"),options:BS(qS),onChange:e=>n("resourceType",e),disabledStateKeys:[aO]})),K.createElement(Ep,{label:"Metric Type",helpId:"stackdriver.metricType",inputOnly:!0},K.createElement(DS,{value:x(e,"query.metricType",""),onChange:e=>n("metricType",e)})),K.createElement(Ep,{label:"Group By",helpId:"stackdriver.groupBy"},K.createElement(TO,{list:e.query.groupByFields||[],actionCreator:t})),K.createElement(Ep,{label:"Aligner",helpId:"stackdriver.perSeriesAligner",inputOnly:!0},K.createElement(lO,{value:x(e,"query.perSeriesAligner"),options:BS(FS),onChange:e=>n("perSeriesAligner",e),disabledStateKeys:[aO]})),K.createElement(Ep,{label:"Reducer",helpId:"stackdriver.crossSeriesReducer",inputOnly:!0},K.createElement(lO,{value:x(e,"query.crossSeriesReducer"),options:BS($S),onChange:e=>n("crossSeriesReducer",e),disabledStateKeys:[aO]})))}));cc.register({name:"stackdriver",metricConfigurer:WS,queryFinder:e=>x(e,"query.metricType",""),useTemplates:!0}),function(e){e[e.Multiple=0]="Multiple",e[e.Single=1]="Single",e[e.None=2]="None"}(US||(US={}));var zS=rc((function(e){return{judgeOptions:(e.data.judges||[]).map((e=>({value:e.name,label:e.name}))),selectedJudge:e.selectedConfig.judge.judgeConfig.name,renderState:e.selectedConfig.judge.renderState}}),(function(e){return{handleJudgeSelect:t=>{e(wu({judge:{name:t.value}}))}}}))((function({judgeOptions:e,selectedJudge:t,handleJudgeSelect:n,renderState:r}){switch(r){case US.Multiple:return K.createElement(Ep,null,K.createElement(lO,{value:t,options:e,clearable:!1,onChange:n,disabled:ae.disableConfigEdit,disabledStateKeys:[aO]}));case US.Single:return K.createElement(Ep,null,K.createElement(cO,{type:"text",value:t,disabled:!0,disabledStateKeys:[aO]}));case US.None:return null}}));ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],(function(e,t,n){var r=e("../lib/dom"),a=e("../lib/lang"),o=e("../lib/event"),i=e("../keyboard/hash_handler").HashHandler,s=e("../lib/keys");r.importCssString('.ace_search {background-color: #ddd;color: #666;border: 1px solid #cbcbcb;border-top: 0 none;overflow: hidden;margin: 0;padding: 4px 6px 0 4px;position: absolute;top: 0;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {margin: 0 20px 4px 0;overflow: hidden;line-height: 1.9;}.ace_replace_form {margin-right: 0;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {border-radius: 3px 0 0 3px;background-color: white;color: black;border: 1px solid #cbcbcb;border-right: 0 none;box-sizing: border-box!important;outline: 0;padding: 0;font-size: inherit;margin: 0;line-height: inherit;padding: 0 6px;min-width: 17em;vertical-align: top;}.ace_searchbtn {border: 1px solid #cbcbcb;line-height: inherit;display: inline-block;padding: 0 6px;background: #fff;border-right: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;margin: 0;position: relative;box-sizing: content-box!important;color: #666;}.ace_searchbtn:last-child {border-radius: 0 3px 3px 0;border-right: 1px solid #cbcbcb;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn:hover {background-color: #eef1f6;}.ace_searchbtn.prev, .ace_searchbtn.next {padding: 0px 0.7em}.ace_searchbtn.prev:after, .ace_searchbtn.next:after {content: "";border: solid 2px #888;width: 0.5em;height: 0.5em;border-width: 2px 0 0 2px;display:inline-block;transform: rotate(-45deg);}.ace_searchbtn.next:after {border-width: 0 2px 2px 0 ;}.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;font: 16px/16px Arial;padding: 0;height: 14px;width: 14px;top: 9px;right: 7px;position: absolute;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;overflow: hidden;opacity: 0.7;border: 1px solid rgba(100,100,100,0.23);padding: 1px;box-sizing: border-box!important;color: black;}.ace_button:hover {background-color: #eee;opacity:1;}.ace_button:active {background-color: #ddd;}.ace_button.checked {border-color: #3399ff;opacity:1;}.ace_search_options{margin-bottom: 3px;text-align: right;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;clear: both;}.ace_search_counter {float: left;font-family: arial;padding: 0 8px;}',"ace_searchbox");var c='<div class="ace_search right"> <span action="hide" class="ace_searchbtn_close"></span> <div class="ace_search_form"> <input class="ace_search_field" placeholder="Search for" spellcheck="false"></input> <span action="findPrev" class="ace_searchbtn prev"></span> <span action="findNext" class="ace_searchbtn next"></span> <span action="findAll" class="ace_searchbtn" title="Alt-Enter">All</span> </div> <div class="ace_replace_form"> <input class="ace_search_field" placeholder="Replace with" spellcheck="false"></input> <span action="replaceAndFindNext" class="ace_searchbtn">Replace</span> <span action="replaceAll" class="ace_searchbtn">All</span> </div> <div class="ace_search_options"> <span action="toggleReplace" class="ace_button" title="Toggel Replace mode" style="float:left;margin-top:-2px;padding:0 5px;">+</span> <span class="ace_search_counter"></span> <span action="toggleRegexpMode" class="ace_button" title="RegExp Search">.*</span> <span action="toggleCaseSensitive" class="ace_button" title="CaseSensitive Search">Aa</span> <span action="toggleWholeWords" class="ace_button" title="Whole Word Search">\\b</span> <span action="searchInSelection" class="ace_button" title="Search In Selection">S</span> </div></div>'.replace(/> +/g,">"),l=function(e,t,n){var a=r.createElement("div");a.innerHTML=c,this.element=a.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(e)};(function(){this.setEditor=function(e){e.searchBox=this,e.renderer.scroller.appendChild(this.element),this.editor=e},this.setSession=function(e){this.searchRange=null,this.$syncOptions(!0)},this.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOption=e.querySelector("[action=searchInSelection]"),this.replaceOption=e.querySelector("[action=toggleReplace]"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field"),this.searchCounter=e.querySelector(".ace_search_counter")},this.$init=function(){var e=this.element;this.$initElements(e);var t=this;o.addListener(e,"mousedown",(function(e){setTimeout((function(){t.activeInput.focus()}),0),o.stopPropagation(e)})),o.addListener(e,"click",(function(e){var n=(e.target||e.srcElement).getAttribute("action");n&&t[n]?t[n]():t.$searchBarKb.commands[n]&&t.$searchBarKb.commands[n].exec(t),o.stopPropagation(e)})),o.addCommandKeyListener(e,(function(e,n,r){var a=s.keyCodeToString(r),i=t.$searchBarKb.findKeyCommand(n,a);i&&i.exec&&(i.exec(t),o.stopEvent(e))})),this.$onChange=a.delayedCall((function(){t.find(!1,!1)})),o.addListener(this.searchInput,"input",(function(){t.$onChange.schedule(20)})),o.addListener(this.searchInput,"focus",(function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()})),o.addListener(this.replaceInput,"focus",(function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()}))},this.$closeSearchBarKb=new i([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),this.$searchBarKb=new i,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e.replaceOption.checked=!1,e.$syncOptions(),e.searchInput.focus()},"Ctrl-H|Command-Option-F":function(e){e.replaceOption.checked=!0,e.$syncOptions(),e.replaceInput.focus()},"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout((function(){e.hide()}))},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},"Alt-Return":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}},{name:"toggleReplace",exec:function(e){e.replaceOption.checked=!e.replaceOption.checked,e.$syncOptions()}},{name:"searchInSelection",exec:function(e){e.searchOption.checked=!e.searchRange,e.setSearchRange(e.searchOption.checked&&e.editor.getSelectionRange()),e.$syncOptions()}}]),this.setSearchRange=function(e){this.searchRange=e,e?this.searchRangeMarker=this.editor.session.addMarker(e,"ace_active-line"):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},this.$syncOptions=function(e){r.setCssClass(this.replaceOption,"checked",this.searchRange),r.setCssClass(this.searchOption,"checked",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?"-":"+",r.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),r.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),r.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked),this.replaceBox.style.display=this.replaceOption.checked?"":"none",this.find(!1,!1,e)},this.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(e,t,n){var a=!this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:n,range:this.searchRange})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",a),this.editor._emit("findSearchBox",{match:!a}),this.highlight(),this.updateCounter()},this.updateCounter=function(){var e=this.editor,t=e.$search.$options.re,n=0,r=0;if(t){var a=this.searchRange?e.session.getTextRange(this.searchRange):e.getValue(),o=e.session.doc.positionToIndex(e.selection.anchor);this.searchRange&&(o-=e.session.doc.positionToIndex(this.searchRange.start));for(var i,s=t.lastIndex=0;(i=t.exec(a))&&(n++,(s=i.index)<=o&&r++,!(n>999))&&(i[0]||(t.lastIndex=s+=1,!(s>=a.length))););}this.searchCounter.textContent=r+" of "+(n>999?"999+":n)},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var e=!this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",e),this.editor._emit("findSearchBox",{match:!e}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off("changeSession",this.setSession),this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.active=!0,this.editor.on("changeSession",this.setSession),this.element.style.display="",this.replaceOption.checked=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},this.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput}}).call(l.prototype),t.SearchBox=l,t.Search=function(e,t){(e.searchBox||new l(e)).show(e.session.getTextRange(),t)}})),ace.acequire(["ace/ext/searchbox"],(function(){}));var GS={id:"ace/mode/json_worker",src:'"no use strict";!function(window){function resolveModuleId(id,paths){for(var testPath=id,tail="";testPath;){var alias=paths[testPath];if("string"==typeof alias)return alias+tail;if(alias)return alias.location.replace(/\\/*$/,"/")+(tail||alias.main||alias.name);if(alias===!1)return"";var i=testPath.lastIndexOf("/");if(-1===i)break;tail=testPath.substr(i)+tail,testPath=testPath.slice(0,i)}return id}if(!(void 0!==window.window&&window.document||window.acequire&&window.define)){window.console||(window.console=function(){var msgs=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:msgs})},window.console.error=window.console.warn=window.console.log=window.console.trace=window.console),window.window=window,window.ace=window,window.onerror=function(message,file,line,col,err){postMessage({type:"error",data:{message:message,data:err.data,file:file,line:line,col:col,stack:err.stack}})},window.normalizeModule=function(parentId,moduleName){if(-1!==moduleName.indexOf("!")){var chunks=moduleName.split("!");return window.normalizeModule(parentId,chunks[0])+"!"+window.normalizeModule(parentId,chunks[1])}if("."==moduleName.charAt(0)){var base=parentId.split("/").slice(0,-1).join("/");for(moduleName=(base?base+"/":"")+moduleName;-1!==moduleName.indexOf(".")&&previous!=moduleName;){var previous=moduleName;moduleName=moduleName.replace(/^\\.\\//,"").replace(/\\/\\.\\//,"/").replace(/[^\\/]+\\/\\.\\.\\//,"")}}return moduleName},window.acequire=function acequire(parentId,id){if(id||(id=parentId,parentId=null),!id.charAt)throw Error("worker.js acequire() accepts only (parentId, id) as arguments");id=window.normalizeModule(parentId,id);var module=window.acequire.modules[id];if(module)return module.initialized||(module.initialized=!0,module.exports=module.factory().exports),module.exports;if(!window.acequire.tlns)return console.log("unable to load "+id);var path=resolveModuleId(id,window.acequire.tlns);return".js"!=path.slice(-3)&&(path+=".js"),window.acequire.id=id,window.acequire.modules[id]={},importScripts(path),window.acequire(parentId,id)},window.acequire.modules={},window.acequire.tlns={},window.define=function(id,deps,factory){if(2==arguments.length?(factory=deps,"string"!=typeof id&&(deps=id,id=window.acequire.id)):1==arguments.length&&(factory=id,deps=[],id=window.acequire.id),"function"!=typeof factory)return window.acequire.modules[id]={exports:factory,initialized:!0},void 0;deps.length||(deps=["require","exports","module"]);var req=function(childId){return window.acequire(id,childId)};window.acequire.modules[id]={exports:{},factory:function(){var module=this,returnExports=factory.apply(this,deps.map(function(dep){switch(dep){case"require":return req;case"exports":return module.exports;case"module":return module;default:return req(dep)}}));return returnExports&&(module.exports=returnExports),module}}},window.define.amd={},acequire.tlns={},window.initBaseUrls=function(topLevelNamespaces){for(var i in topLevelNamespaces)acequire.tlns[i]=topLevelNamespaces[i]},window.initSender=function(){var EventEmitter=window.acequire("ace/lib/event_emitter").EventEmitter,oop=window.acequire("ace/lib/oop"),Sender=function(){};return function(){oop.implement(this,EventEmitter),this.callback=function(data,callbackId){postMessage({type:"call",id:callbackId,data:data})},this.emit=function(name,data){postMessage({type:"event",name:name,data:data})}}.call(Sender.prototype),new Sender};var main=window.main=null,sender=window.sender=null;window.onmessage=function(e){var msg=e.data;if(msg.event&&sender)sender._signal(msg.event,msg.data);else if(msg.command)if(main[msg.command])main[msg.command].apply(main,msg.args);else{if(!window[msg.command])throw Error("Unknown command:"+msg.command);window[msg.command].apply(window,msg.args)}else if(msg.init){window.initBaseUrls(msg.tlns),acequire("ace/lib/es5-shim"),sender=window.sender=window.initSender();var clazz=acequire(msg.module)[msg.classname];main=window.main=new clazz(sender)}}}}(this),ace.define("ace/lib/oop",["require","exports","module"],function(acequire,exports){"use strict";exports.inherits=function(ctor,superCtor){ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}})},exports.mixin=function(obj,mixin){for(var key in mixin)obj[key]=mixin[key];return obj},exports.implement=function(proto,mixin){exports.mixin(proto,mixin)}}),ace.define("ace/range",["require","exports","module"],function(acequire,exports){"use strict";var comparePoints=function(p1,p2){return p1.row-p2.row||p1.column-p2.column},Range=function(startRow,startColumn,endRow,endColumn){this.start={row:startRow,column:startColumn},this.end={row:endRow,column:endColumn}};(function(){this.isEqual=function(range){return this.start.row===range.start.row&&this.end.row===range.end.row&&this.start.column===range.start.column&&this.end.column===range.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(row,column){return 0==this.compare(row,column)},this.compareRange=function(range){var cmp,end=range.end,start=range.start;return cmp=this.compare(end.row,end.column),1==cmp?(cmp=this.compare(start.row,start.column),1==cmp?2:0==cmp?1:0):-1==cmp?-2:(cmp=this.compare(start.row,start.column),-1==cmp?-1:1==cmp?42:0)},this.comparePoint=function(p){return this.compare(p.row,p.column)},this.containsRange=function(range){return 0==this.comparePoint(range.start)&&0==this.comparePoint(range.end)},this.intersects=function(range){var cmp=this.compareRange(range);return-1==cmp||0==cmp||1==cmp},this.isEnd=function(row,column){return this.end.row==row&&this.end.column==column},this.isStart=function(row,column){return this.start.row==row&&this.start.column==column},this.setStart=function(row,column){"object"==typeof row?(this.start.column=row.column,this.start.row=row.row):(this.start.row=row,this.start.column=column)},this.setEnd=function(row,column){"object"==typeof row?(this.end.column=row.column,this.end.row=row.row):(this.end.row=row,this.end.column=column)},this.inside=function(row,column){return 0==this.compare(row,column)?this.isEnd(row,column)||this.isStart(row,column)?!1:!0:!1},this.insideStart=function(row,column){return 0==this.compare(row,column)?this.isEnd(row,column)?!1:!0:!1},this.insideEnd=function(row,column){return 0==this.compare(row,column)?this.isStart(row,column)?!1:!0:!1},this.compare=function(row,column){return this.isMultiLine()||row!==this.start.row?this.start.row>row?-1:row>this.end.row?1:this.start.row===row?column>=this.start.column?0:-1:this.end.row===row?this.end.column>=column?0:1:0:this.start.column>column?-1:column>this.end.column?1:0},this.compareStart=function(row,column){return this.start.row==row&&this.start.column==column?-1:this.compare(row,column)},this.compareEnd=function(row,column){return this.end.row==row&&this.end.column==column?1:this.compare(row,column)},this.compareInside=function(row,column){return this.end.row==row&&this.end.column==column?1:this.start.row==row&&this.start.column==column?-1:this.compare(row,column)},this.clipRows=function(firstRow,lastRow){if(this.end.row>lastRow)var end={row:lastRow+1,column:0};else if(firstRow>this.end.row)var end={row:firstRow,column:0};if(this.start.row>lastRow)var start={row:lastRow+1,column:0};else if(firstRow>this.start.row)var start={row:firstRow,column:0};return Range.fromPoints(start||this.start,end||this.end)},this.extend=function(row,column){var cmp=this.compare(row,column);if(0==cmp)return this;if(-1==cmp)var start={row:row,column:column};else var end={row:row,column:column};return Range.fromPoints(start||this.start,end||this.end)},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return Range.fromPoints(this.start,this.end)},this.collapseRows=function(){return 0==this.end.column?new Range(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new Range(this.start.row,0,this.end.row,0)},this.toScreenRange=function(session){var screenPosStart=session.documentToScreenPosition(this.start),screenPosEnd=session.documentToScreenPosition(this.end);return new Range(screenPosStart.row,screenPosStart.column,screenPosEnd.row,screenPosEnd.column)},this.moveBy=function(row,column){this.start.row+=row,this.start.column+=column,this.end.row+=row,this.end.column+=column}}).call(Range.prototype),Range.fromPoints=function(start,end){return new Range(start.row,start.column,end.row,end.column)},Range.comparePoints=comparePoints,Range.comparePoints=function(p1,p2){return p1.row-p2.row||p1.column-p2.column},exports.Range=Range}),ace.define("ace/apply_delta",["require","exports","module"],function(acequire,exports){"use strict";exports.applyDelta=function(docLines,delta){var row=delta.start.row,startColumn=delta.start.column,line=docLines[row]||"";switch(delta.action){case"insert":var lines=delta.lines;if(1===lines.length)docLines[row]=line.substring(0,startColumn)+delta.lines[0]+line.substring(startColumn);else{var args=[row,1].concat(delta.lines);docLines.splice.apply(docLines,args),docLines[row]=line.substring(0,startColumn)+docLines[row],docLines[row+delta.lines.length-1]+=line.substring(startColumn)}break;case"remove":var endColumn=delta.end.column,endRow=delta.end.row;row===endRow?docLines[row]=line.substring(0,startColumn)+line.substring(endColumn):docLines.splice(row,endRow-row+1,line.substring(0,startColumn)+docLines[endRow].substring(endColumn))}}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(acequire,exports){"use strict";var EventEmitter={},stopPropagation=function(){this.propagationStopped=!0},preventDefault=function(){this.defaultPrevented=!0};EventEmitter._emit=EventEmitter._dispatchEvent=function(eventName,e){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var listeners=this._eventRegistry[eventName]||[],defaultHandler=this._defaultHandlers[eventName];if(listeners.length||defaultHandler){"object"==typeof e&&e||(e={}),e.type||(e.type=eventName),e.stopPropagation||(e.stopPropagation=stopPropagation),e.preventDefault||(e.preventDefault=preventDefault),listeners=listeners.slice();for(var i=0;listeners.length>i&&(listeners[i](e,this),!e.propagationStopped);i++);return defaultHandler&&!e.defaultPrevented?defaultHandler(e,this):void 0}},EventEmitter._signal=function(eventName,e){var listeners=(this._eventRegistry||{})[eventName];if(listeners){listeners=listeners.slice();for(var i=0;listeners.length>i;i++)listeners[i](e,this)}},EventEmitter.once=function(eventName,callback){var _self=this;callback&&this.addEventListener(eventName,function newCallback(){_self.removeEventListener(eventName,newCallback),callback.apply(null,arguments)})},EventEmitter.setDefaultHandler=function(eventName,callback){var handlers=this._defaultHandlers;if(handlers||(handlers=this._defaultHandlers={_disabled_:{}}),handlers[eventName]){var old=handlers[eventName],disabled=handlers._disabled_[eventName];disabled||(handlers._disabled_[eventName]=disabled=[]),disabled.push(old);var i=disabled.indexOf(callback);-1!=i&&disabled.splice(i,1)}handlers[eventName]=callback},EventEmitter.removeDefaultHandler=function(eventName,callback){var handlers=this._defaultHandlers;if(handlers){var disabled=handlers._disabled_[eventName];if(handlers[eventName]==callback)handlers[eventName],disabled&&this.setDefaultHandler(eventName,disabled.pop());else if(disabled){var i=disabled.indexOf(callback);-1!=i&&disabled.splice(i,1)}}},EventEmitter.on=EventEmitter.addEventListener=function(eventName,callback,capturing){this._eventRegistry=this._eventRegistry||{};var listeners=this._eventRegistry[eventName];return listeners||(listeners=this._eventRegistry[eventName]=[]),-1==listeners.indexOf(callback)&&listeners[capturing?"unshift":"push"](callback),callback},EventEmitter.off=EventEmitter.removeListener=EventEmitter.removeEventListener=function(eventName,callback){this._eventRegistry=this._eventRegistry||{};var listeners=this._eventRegistry[eventName];if(listeners){var index=listeners.indexOf(callback);-1!==index&&listeners.splice(index,1)}},EventEmitter.removeAllListeners=function(eventName){this._eventRegistry&&(this._eventRegistry[eventName]=[])},exports.EventEmitter=EventEmitter}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(acequire,exports){"use strict";var oop=acequire("./lib/oop"),EventEmitter=acequire("./lib/event_emitter").EventEmitter,Anchor=exports.Anchor=function(doc,row,column){this.$onChange=this.onChange.bind(this),this.attach(doc),column===void 0?this.setPosition(row.row,row.column):this.setPosition(row,column)};(function(){function $pointsInOrder(point1,point2,equalPointsInOrder){var bColIsAfter=equalPointsInOrder?point1.column<=point2.column:point1.column<point2.column;return point1.row<point2.row||point1.row==point2.row&&bColIsAfter}function $getTransformedPoint(delta,point,moveIfEqual){var deltaIsInsert="insert"==delta.action,deltaRowShift=(deltaIsInsert?1:-1)*(delta.end.row-delta.start.row),deltaColShift=(deltaIsInsert?1:-1)*(delta.end.column-delta.start.column),deltaStart=delta.start,deltaEnd=deltaIsInsert?deltaStart:delta.end;return $pointsInOrder(point,deltaStart,moveIfEqual)?{row:point.row,column:point.column}:$pointsInOrder(deltaEnd,point,!moveIfEqual)?{row:point.row+deltaRowShift,column:point.column+(point.row==deltaEnd.row?deltaColShift:0)}:{row:deltaStart.row,column:deltaStart.column}}oop.implement(this,EventEmitter),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.$insertRight=!1,this.onChange=function(delta){if(!(delta.start.row==delta.end.row&&delta.start.row!=this.row||delta.start.row>this.row)){var point=$getTransformedPoint(delta,{row:this.row,column:this.column},this.$insertRight);this.setPosition(point.row,point.column,!0)}},this.setPosition=function(row,column,noClip){var pos;if(pos=noClip?{row:row,column:column}:this.$clipPositionToDocument(row,column),this.row!=pos.row||this.column!=pos.column){var old={row:this.row,column:this.column};this.row=pos.row,this.column=pos.column,this._signal("change",{old:old,value:pos})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(doc){this.document=doc||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(row,column){var pos={};return row>=this.document.getLength()?(pos.row=Math.max(0,this.document.getLength()-1),pos.column=this.document.getLine(pos.row).length):0>row?(pos.row=0,pos.column=0):(pos.row=row,pos.column=Math.min(this.document.getLine(pos.row).length,Math.max(0,column))),0>column&&(pos.column=0),pos}}).call(Anchor.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(acequire,exports){"use strict";var oop=acequire("./lib/oop"),applyDelta=acequire("./apply_delta").applyDelta,EventEmitter=acequire("./lib/event_emitter").EventEmitter,Range=acequire("./range").Range,Anchor=acequire("./anchor").Anchor,Document=function(textOrLines){this.$lines=[""],0===textOrLines.length?this.$lines=[""]:Array.isArray(textOrLines)?this.insertMergedLines({row:0,column:0},textOrLines):this.insert({row:0,column:0},textOrLines)};(function(){oop.implement(this,EventEmitter),this.setValue=function(text){var len=this.getLength()-1;this.remove(new Range(0,0,len,this.getLine(len).length)),this.insert({row:0,column:0},text)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(row,column){return new Anchor(this,row,column)},this.$split=0==="aaa".split(/a/).length?function(text){return text.replace(/\\r\\n|\\r/g,"\\n").split("\\n")}:function(text){return text.split(/\\r\\n|\\r|\\n/)},this.$detectNewLine=function(text){var match=text.match(/^.*?(\\r\\n|\\r|\\n)/m);this.$autoNewLine=match?match[1]:"\\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\\r\\n";case"unix":return"\\n";default:return this.$autoNewLine||"\\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(newLineMode){this.$newLineMode!==newLineMode&&(this.$newLineMode=newLineMode,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(text){return"\\r\\n"==text||"\\r"==text||"\\n"==text},this.getLine=function(row){return this.$lines[row]||""},this.getLines=function(firstRow,lastRow){return this.$lines.slice(firstRow,lastRow+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(range){return this.getLinesForRange(range).join(this.getNewLineCharacter())},this.getLinesForRange=function(range){var lines;if(range.start.row===range.end.row)lines=[this.getLine(range.start.row).substring(range.start.column,range.end.column)];else{lines=this.getLines(range.start.row,range.end.row),lines[0]=(lines[0]||"").substring(range.start.column);var l=lines.length-1;range.end.row-range.start.row==l&&(lines[l]=lines[l].substring(0,range.end.column))}return lines},this.insertLines=function(row,lines){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(row,lines)},this.removeLines=function(firstRow,lastRow){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(firstRow,lastRow)},this.insertNewLine=function(position){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, [\'\', \'\']) instead."),this.insertMergedLines(position,["",""])},this.insert=function(position,text){return 1>=this.getLength()&&this.$detectNewLine(text),this.insertMergedLines(position,this.$split(text))},this.insertInLine=function(position,text){var start=this.clippedPos(position.row,position.column),end=this.pos(position.row,position.column+text.length);return this.applyDelta({start:start,end:end,action:"insert",lines:[text]},!0),this.clonePos(end)},this.clippedPos=function(row,column){var length=this.getLength();void 0===row?row=length:0>row?row=0:row>=length&&(row=length-1,column=void 0);var line=this.getLine(row);return void 0==column&&(column=line.length),column=Math.min(Math.max(column,0),line.length),{row:row,column:column}},this.clonePos=function(pos){return{row:pos.row,column:pos.column}},this.pos=function(row,column){return{row:row,column:column}},this.$clipPosition=function(position){var length=this.getLength();return position.row>=length?(position.row=Math.max(0,length-1),position.column=this.getLine(length-1).length):(position.row=Math.max(0,position.row),position.column=Math.min(Math.max(position.column,0),this.getLine(position.row).length)),position},this.insertFullLines=function(row,lines){row=Math.min(Math.max(row,0),this.getLength());var column=0;this.getLength()>row?(lines=lines.concat([""]),column=0):(lines=[""].concat(lines),row--,column=this.$lines[row].length),this.insertMergedLines({row:row,column:column},lines)},this.insertMergedLines=function(position,lines){var start=this.clippedPos(position.row,position.column),end={row:start.row+lines.length-1,column:(1==lines.length?start.column:0)+lines[lines.length-1].length};return this.applyDelta({start:start,end:end,action:"insert",lines:lines}),this.clonePos(end)},this.remove=function(range){var start=this.clippedPos(range.start.row,range.start.column),end=this.clippedPos(range.end.row,range.end.column);return this.applyDelta({start:start,end:end,action:"remove",lines:this.getLinesForRange({start:start,end:end})}),this.clonePos(start)},this.removeInLine=function(row,startColumn,endColumn){var start=this.clippedPos(row,startColumn),end=this.clippedPos(row,endColumn);return this.applyDelta({start:start,end:end,action:"remove",lines:this.getLinesForRange({start:start,end:end})},!0),this.clonePos(start)},this.removeFullLines=function(firstRow,lastRow){firstRow=Math.min(Math.max(0,firstRow),this.getLength()-1),lastRow=Math.min(Math.max(0,lastRow),this.getLength()-1);var deleteFirstNewLine=lastRow==this.getLength()-1&&firstRow>0,deleteLastNewLine=this.getLength()-1>lastRow,startRow=deleteFirstNewLine?firstRow-1:firstRow,startCol=deleteFirstNewLine?this.getLine(startRow).length:0,endRow=deleteLastNewLine?lastRow+1:lastRow,endCol=deleteLastNewLine?0:this.getLine(endRow).length,range=new Range(startRow,startCol,endRow,endCol),deletedLines=this.$lines.slice(firstRow,lastRow+1);return this.applyDelta({start:range.start,end:range.end,action:"remove",lines:this.getLinesForRange(range)}),deletedLines},this.removeNewLine=function(row){this.getLength()-1>row&&row>=0&&this.applyDelta({start:this.pos(row,this.getLine(row).length),end:this.pos(row+1,0),action:"remove",lines:["",""]})},this.replace=function(range,text){if(range instanceof Range||(range=Range.fromPoints(range.start,range.end)),0===text.length&&range.isEmpty())return range.start;if(text==this.getTextRange(range))return range.end;this.remove(range);var end;return end=text?this.insert(range.start,text):range.start},this.applyDeltas=function(deltas){for(var i=0;deltas.length>i;i++)this.applyDelta(deltas[i])},this.revertDeltas=function(deltas){for(var i=deltas.length-1;i>=0;i--)this.revertDelta(deltas[i])},this.applyDelta=function(delta,doNotValidate){var isInsert="insert"==delta.action;(isInsert?1>=delta.lines.length&&!delta.lines[0]:!Range.comparePoints(delta.start,delta.end))||(isInsert&&delta.lines.length>2e4&&this.$splitAndapplyLargeDelta(delta,2e4),applyDelta(this.$lines,delta,doNotValidate),this._signal("change",delta))},this.$splitAndapplyLargeDelta=function(delta,MAX){for(var lines=delta.lines,l=lines.length,row=delta.start.row,column=delta.start.column,from=0,to=0;;){from=to,to+=MAX-1;var chunk=lines.slice(from,to);if(to>l){delta.lines=chunk,delta.start.row=row+from,delta.start.column=column;break}chunk.push(""),this.applyDelta({start:this.pos(row+from,column),end:this.pos(row+to,column=0),action:delta.action,lines:chunk},!0)}},this.revertDelta=function(delta){this.applyDelta({start:this.clonePos(delta.start),end:this.clonePos(delta.end),action:"insert"==delta.action?"remove":"insert",lines:delta.lines.slice()})},this.indexToPosition=function(index,startRow){for(var lines=this.$lines||this.getAllLines(),newlineLength=this.getNewLineCharacter().length,i=startRow||0,l=lines.length;l>i;i++)if(index-=lines[i].length+newlineLength,0>index)return{row:i,column:index+lines[i].length+newlineLength};return{row:l-1,column:lines[l-1].length}},this.positionToIndex=function(pos,startRow){for(var lines=this.$lines||this.getAllLines(),newlineLength=this.getNewLineCharacter().length,index=0,row=Math.min(pos.row,lines.length),i=startRow||0;row>i;++i)index+=lines[i].length+newlineLength;return index+pos.column}}).call(Document.prototype),exports.Document=Document}),ace.define("ace/lib/lang",["require","exports","module"],function(acequire,exports){"use strict";exports.last=function(a){return a[a.length-1]},exports.stringReverse=function(string){return string.split("").reverse().join("")},exports.stringRepeat=function(string,count){for(var result="";count>0;)1&count&&(result+=string),(count>>=1)&&(string+=string);return result};var trimBeginRegexp=/^\\s\\s*/,trimEndRegexp=/\\s\\s*$/;exports.stringTrimLeft=function(string){return string.replace(trimBeginRegexp,"")},exports.stringTrimRight=function(string){return string.replace(trimEndRegexp,"")},exports.copyObject=function(obj){var copy={};for(var key in obj)copy[key]=obj[key];return copy},exports.copyArray=function(array){for(var copy=[],i=0,l=array.length;l>i;i++)copy[i]=array[i]&&"object"==typeof array[i]?this.copyObject(array[i]):array[i];return copy},exports.deepCopy=function deepCopy(obj){if("object"!=typeof obj||!obj)return obj;var copy;if(Array.isArray(obj)){copy=[];for(var key=0;obj.length>key;key++)copy[key]=deepCopy(obj[key]);return copy}if("[object Object]"!==Object.prototype.toString.call(obj))return obj;copy={};for(var key in obj)copy[key]=deepCopy(obj[key]);return copy},exports.arrayToMap=function(arr){for(var map={},i=0;arr.length>i;i++)map[arr[i]]=1;return map},exports.createMap=function(props){var map=Object.create(null);for(var i in props)map[i]=props[i];return map},exports.arrayRemove=function(array,value){for(var i=0;array.length>=i;i++)value===array[i]&&array.splice(i,1)},exports.escapeRegExp=function(str){return str.replace(/([.*+?^${}()|[\\]\\/\\\\])/g,"\\\\$1")},exports.escapeHTML=function(str){return str.replace(/&/g,"&").replace(/"/g,""").replace(/\'/g,"'").replace(/</g,"<")},exports.getMatchOffsets=function(string,regExp){var matches=[];return string.replace(regExp,function(str){matches.push({offset:arguments[arguments.length-2],length:str.length})}),matches},exports.deferredCall=function(fcn){var timer=null,callback=function(){timer=null,fcn()},deferred=function(timeout){return deferred.cancel(),timer=setTimeout(callback,timeout||0),deferred};return deferred.schedule=deferred,deferred.call=function(){return this.cancel(),fcn(),deferred},deferred.cancel=function(){return clearTimeout(timer),timer=null,deferred},deferred.isPending=function(){return timer},deferred},exports.delayedCall=function(fcn,defaultTimeout){var timer=null,callback=function(){timer=null,fcn()},_self=function(timeout){null==timer&&(timer=setTimeout(callback,timeout||defaultTimeout))};return _self.delay=function(timeout){timer&&clearTimeout(timer),timer=setTimeout(callback,timeout||defaultTimeout)},_self.schedule=_self,_self.call=function(){this.cancel(),fcn()},_self.cancel=function(){timer&&clearTimeout(timer),timer=null},_self.isPending=function(){return timer},_self}}),ace.define("ace/worker/mirror",["require","exports","module","ace/range","ace/document","ace/lib/lang"],function(acequire,exports){"use strict";acequire("../range").Range;var Document=acequire("../document").Document,lang=acequire("../lib/lang"),Mirror=exports.Mirror=function(sender){this.sender=sender;var doc=this.doc=new Document(""),deferredUpdate=this.deferredUpdate=lang.delayedCall(this.onUpdate.bind(this)),_self=this;sender.on("change",function(e){var data=e.data;if(data[0].start)doc.applyDeltas(data);else for(var i=0;data.length>i;i+=2){if(Array.isArray(data[i+1]))var d={action:"insert",start:data[i],lines:data[i+1]};else var d={action:"remove",start:data[i],end:data[i+1]};doc.applyDelta(d,!0)}return _self.$timeout?deferredUpdate.schedule(_self.$timeout):(_self.onUpdate(),void 0)})};(function(){this.$timeout=500,this.setTimeout=function(timeout){this.$timeout=timeout},this.setValue=function(value){this.doc.setValue(value),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(callbackId){this.sender.callback(this.doc.getValue(),callbackId)},this.onUpdate=function(){},this.isPending=function(){return this.deferredUpdate.isPending()}}).call(Mirror.prototype)}),ace.define("ace/mode/json/json_parse",["require","exports","module"],function(){"use strict";var at,ch,text,value,escapee={\'"\':\'"\',"\\\\":"\\\\","/":"/",b:"\\b",f:"\\f",n:"\\n",r:"\\r",t:"\t"},error=function(m){throw{name:"SyntaxError",message:m,at:at,text:text}},next=function(c){return c&&c!==ch&&error("Expected \'"+c+"\' instead of \'"+ch+"\'"),ch=text.charAt(at),at+=1,ch},number=function(){var number,string="";for("-"===ch&&(string="-",next("-"));ch>="0"&&"9">=ch;)string+=ch,next();if("."===ch)for(string+=".";next()&&ch>="0"&&"9">=ch;)string+=ch;if("e"===ch||"E"===ch)for(string+=ch,next(),("-"===ch||"+"===ch)&&(string+=ch,next());ch>="0"&&"9">=ch;)string+=ch,next();return number=+string,isNaN(number)?(error("Bad number"),void 0):number},string=function(){var hex,i,uffff,string="";if(\'"\'===ch)for(;next();){if(\'"\'===ch)return next(),string;if("\\\\"===ch)if(next(),"u"===ch){for(uffff=0,i=0;4>i&&(hex=parseInt(next(),16),isFinite(hex));i+=1)uffff=16*uffff+hex;string+=String.fromCharCode(uffff)}else{if("string"!=typeof escapee[ch])break;string+=escapee[ch]}else string+=ch}error("Bad string")},white=function(){for(;ch&&" ">=ch;)next()},word=function(){switch(ch){case"t":return next("t"),next("r"),next("u"),next("e"),!0;case"f":return next("f"),next("a"),next("l"),next("s"),next("e"),!1;case"n":return next("n"),next("u"),next("l"),next("l"),null}error("Unexpected \'"+ch+"\'")},array=function(){var array=[];if("["===ch){if(next("["),white(),"]"===ch)return next("]"),array;for(;ch;){if(array.push(value()),white(),"]"===ch)return next("]"),array;next(","),white()}}error("Bad array")},object=function(){var key,object={};if("{"===ch){if(next("{"),white(),"}"===ch)return next("}"),object;for(;ch;){if(key=string(),white(),next(":"),Object.hasOwnProperty.call(object,key)&&error(\'Duplicate key "\'+key+\'"\'),object[key]=value(),white(),"}"===ch)return next("}"),object;next(","),white()}}error("Bad object")};return value=function(){switch(white(),ch){case"{":return object();case"[":return array();case\'"\':return string();case"-":return number();default:return ch>="0"&&"9">=ch?number():word()}},function(source,reviver){var result;return text=source,at=0,ch=" ",result=value(),white(),ch&&error("Syntax error"),"function"==typeof reviver?function walk(holder,key){var k,v,value=holder[key];if(value&&"object"==typeof value)for(k in value)Object.hasOwnProperty.call(value,k)&&(v=walk(value,k),void 0!==v?value[k]=v:delete value[k]);return reviver.call(holder,key,value)}({"":result},""):result}}),ace.define("ace/mode/json_worker",["require","exports","module","ace/lib/oop","ace/worker/mirror","ace/mode/json/json_parse"],function(acequire,exports){"use strict";var oop=acequire("../lib/oop"),Mirror=acequire("../worker/mirror").Mirror,parse=acequire("./json/json_parse"),JsonWorker=exports.JsonWorker=function(sender){Mirror.call(this,sender),this.setTimeout(200)};oop.inherits(JsonWorker,Mirror),function(){this.onUpdate=function(){var value=this.doc.getValue(),errors=[];try{value&&parse(value)}catch(e){var pos=this.doc.indexToPosition(e.at-1);errors.push({row:pos.row,column:pos.column,text:e.message,type:"error"})}this.sender.emit("annotate",errors)}}.call(JsonWorker.prototype)}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(){function Empty(){}function doesDefinePropertyWork(object){try{return Object.defineProperty(object,"sentinel",{}),"sentinel"in object}catch(exception){}}function toInteger(n){return n=+n,n!==n?n=0:0!==n&&n!==1/0&&n!==-(1/0)&&(n=(n>0||-1)*Math.floor(Math.abs(n))),n}Function.prototype.bind||(Function.prototype.bind=function(that){var target=this;if("function"!=typeof target)throw new TypeError("Function.prototype.bind called on incompatible "+target);var args=slice.call(arguments,1),bound=function(){if(this instanceof bound){var result=target.apply(this,args.concat(slice.call(arguments)));return Object(result)===result?result:this}return target.apply(that,args.concat(slice.call(arguments)))};return target.prototype&&(Empty.prototype=target.prototype,bound.prototype=new Empty,Empty.prototype=null),bound});var defineGetter,defineSetter,lookupGetter,lookupSetter,supportsAccessors,call=Function.prototype.call,prototypeOfArray=Array.prototype,prototypeOfObject=Object.prototype,slice=prototypeOfArray.slice,_toString=call.bind(prototypeOfObject.toString),owns=call.bind(prototypeOfObject.hasOwnProperty);if((supportsAccessors=owns(prototypeOfObject,"__defineGetter__"))&&(defineGetter=call.bind(prototypeOfObject.__defineGetter__),defineSetter=call.bind(prototypeOfObject.__defineSetter__),lookupGetter=call.bind(prototypeOfObject.__lookupGetter__),lookupSetter=call.bind(prototypeOfObject.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function makeArray(l){var a=Array(l+2);return a[0]=a[1]=0,a}var lengthBefore,array=[];return array.splice.apply(array,makeArray(20)),array.splice.apply(array,makeArray(26)),lengthBefore=array.length,array.splice(5,0,"XXX"),lengthBefore+1==array.length,lengthBefore+1==array.length?!0:void 0\n}()){var array_splice=Array.prototype.splice;Array.prototype.splice=function(start,deleteCount){return arguments.length?array_splice.apply(this,[void 0===start?0:start,void 0===deleteCount?this.length-start:deleteCount].concat(slice.call(arguments,2))):[]}}else Array.prototype.splice=function(pos,removeCount){var length=this.length;pos>0?pos>length&&(pos=length):void 0==pos?pos=0:0>pos&&(pos=Math.max(length+pos,0)),length>pos+removeCount||(removeCount=length-pos);var removed=this.slice(pos,pos+removeCount),insert=slice.call(arguments,2),add=insert.length;if(pos===length)add&&this.push.apply(this,insert);else{var remove=Math.min(removeCount,length-pos),tailOldPos=pos+remove,tailNewPos=tailOldPos+add-remove,tailCount=length-tailOldPos,lengthAfterRemove=length-remove;if(tailOldPos>tailNewPos)for(var i=0;tailCount>i;++i)this[tailNewPos+i]=this[tailOldPos+i];else if(tailNewPos>tailOldPos)for(i=tailCount;i--;)this[tailNewPos+i]=this[tailOldPos+i];if(add&&pos===lengthAfterRemove)this.length=lengthAfterRemove,this.push.apply(this,insert);else for(this.length=lengthAfterRemove+add,i=0;add>i;++i)this[pos+i]=insert[i]}return removed};Array.isArray||(Array.isArray=function(obj){return"[object Array]"==_toString(obj)});var boxedString=Object("a"),splitString="a"!=boxedString[0]||!(0 in boxedString);if(Array.prototype.forEach||(Array.prototype.forEach=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,thisp=arguments[1],i=-1,length=self.length>>>0;if("[object Function]"!=_toString(fun))throw new TypeError;for(;length>++i;)i in self&&fun.call(thisp,self[i],i,object)}),Array.prototype.map||(Array.prototype.map=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0,result=Array(length),thisp=arguments[1];if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");for(var i=0;length>i;i++)i in self&&(result[i]=fun.call(thisp,self[i],i,object));return result}),Array.prototype.filter||(Array.prototype.filter=function(fun){var value,object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0,result=[],thisp=arguments[1];if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");for(var i=0;length>i;i++)i in self&&(value=self[i],fun.call(thisp,value,i,object)&&result.push(value));return result}),Array.prototype.every||(Array.prototype.every=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0,thisp=arguments[1];if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");for(var i=0;length>i;i++)if(i in self&&!fun.call(thisp,self[i],i,object))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0,thisp=arguments[1];if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");for(var i=0;length>i;i++)if(i in self&&fun.call(thisp,self[i],i,object))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0;if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");if(!length&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var result,i=0;if(arguments.length>=2)result=arguments[1];else for(;;){if(i in self){result=self[i++];break}if(++i>=length)throw new TypeError("reduce of empty array with no initial value")}for(;length>i;i++)i in self&&(result=fun.call(void 0,result,self[i],i,object));return result}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0;if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");if(!length&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var result,i=length-1;if(arguments.length>=2)result=arguments[1];else for(;;){if(i in self){result=self[i--];break}if(0>--i)throw new TypeError("reduceRight of empty array with no initial value")}do i in this&&(result=fun.call(void 0,result,self[i],i,object));while(i--);return result}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(sought){var self=splitString&&"[object String]"==_toString(this)?this.split(""):toObject(this),length=self.length>>>0;if(!length)return-1;var i=0;for(arguments.length>1&&(i=toInteger(arguments[1])),i=i>=0?i:Math.max(0,length+i);length>i;i++)if(i in self&&self[i]===sought)return i;return-1}),Array.prototype.lastIndexOf&&-1==[0,1].lastIndexOf(0,-3)||(Array.prototype.lastIndexOf=function(sought){var self=splitString&&"[object String]"==_toString(this)?this.split(""):toObject(this),length=self.length>>>0;if(!length)return-1;var i=length-1;for(arguments.length>1&&(i=Math.min(i,toInteger(arguments[1]))),i=i>=0?i:length-Math.abs(i);i>=0;i--)if(i in self&&sought===self[i])return i;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(object){return object.__proto__||(object.constructor?object.constructor.prototype:prototypeOfObject)}),!Object.getOwnPropertyDescriptor){var ERR_NON_OBJECT="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(object,property){if("object"!=typeof object&&"function"!=typeof object||null===object)throw new TypeError(ERR_NON_OBJECT+object);if(owns(object,property)){var descriptor,getter,setter;if(descriptor={enumerable:!0,configurable:!0},supportsAccessors){var prototype=object.__proto__;object.__proto__=prototypeOfObject;var getter=lookupGetter(object,property),setter=lookupSetter(object,property);if(object.__proto__=prototype,getter||setter)return getter&&(descriptor.get=getter),setter&&(descriptor.set=setter),descriptor}return descriptor.value=object[property],descriptor}}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(object){return Object.keys(object)}),!Object.create){var createEmpty;createEmpty=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var empty={};for(var i in empty)empty[i]=null;return empty.constructor=empty.hasOwnProperty=empty.propertyIsEnumerable=empty.isPrototypeOf=empty.toLocaleString=empty.toString=empty.valueOf=empty.__proto__=null,empty},Object.create=function(prototype,properties){var object;if(null===prototype)object=createEmpty();else{if("object"!=typeof prototype)throw new TypeError("typeof prototype["+typeof prototype+"] != \'object\'");var Type=function(){};Type.prototype=prototype,object=new Type,object.__proto__=prototype}return void 0!==properties&&Object.defineProperties(object,properties),object}}if(Object.defineProperty){var definePropertyWorksOnObject=doesDefinePropertyWork({}),definePropertyWorksOnDom="undefined"==typeof document||doesDefinePropertyWork(document.createElement("div"));if(!definePropertyWorksOnObject||!definePropertyWorksOnDom)var definePropertyFallback=Object.defineProperty}if(!Object.defineProperty||definePropertyFallback){var ERR_NON_OBJECT_DESCRIPTOR="Property description must be an object: ",ERR_NON_OBJECT_TARGET="Object.defineProperty called on non-object: ",ERR_ACCESSORS_NOT_SUPPORTED="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(object,property,descriptor){if("object"!=typeof object&&"function"!=typeof object||null===object)throw new TypeError(ERR_NON_OBJECT_TARGET+object);if("object"!=typeof descriptor&&"function"!=typeof descriptor||null===descriptor)throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR+descriptor);if(definePropertyFallback)try{return definePropertyFallback.call(Object,object,property,descriptor)}catch(exception){}if(owns(descriptor,"value"))if(supportsAccessors&&(lookupGetter(object,property)||lookupSetter(object,property))){var prototype=object.__proto__;object.__proto__=prototypeOfObject,delete object[property],object[property]=descriptor.value,object.__proto__=prototype}else object[property]=descriptor.value;else{if(!supportsAccessors)throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);owns(descriptor,"get")&&defineGetter(object,property,descriptor.get),owns(descriptor,"set")&&defineSetter(object,property,descriptor.set)}return object}}Object.defineProperties||(Object.defineProperties=function(object,properties){for(var property in properties)owns(properties,property)&&Object.defineProperty(object,property,properties[property]);return object}),Object.seal||(Object.seal=function(object){return object}),Object.freeze||(Object.freeze=function(object){return object});try{Object.freeze(function(){})}catch(exception){Object.freeze=function(freezeObject){return function(object){return"function"==typeof object?object:freezeObject(object)}}(Object.freeze)}if(Object.preventExtensions||(Object.preventExtensions=function(object){return object}),Object.isSealed||(Object.isSealed=function(){return!1}),Object.isFrozen||(Object.isFrozen=function(){return!1}),Object.isExtensible||(Object.isExtensible=function(object){if(Object(object)===object)throw new TypeError;for(var name="";owns(object,name);)name+="?";object[name]=!0;var returnValue=owns(object,name);return delete object[name],returnValue}),!Object.keys){var hasDontEnumBug=!0,dontEnums=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],dontEnumsLength=dontEnums.length;for(var key in{toString:null})hasDontEnumBug=!1;Object.keys=function(object){if("object"!=typeof object&&"function"!=typeof object||null===object)throw new TypeError("Object.keys called on a non-object");var keys=[];for(var name in object)owns(object,name)&&keys.push(name);if(hasDontEnumBug)for(var i=0,ii=dontEnumsLength;ii>i;i++){var dontEnum=dontEnums[i];owns(object,dontEnum)&&keys.push(dontEnum)}return keys}}Date.now||(Date.now=function(){return(new Date).getTime()});var ws="\t\\n\v\\f\\r \\u2028\\u2029\ufeff";if(!String.prototype.trim||ws.trim()){ws="["+ws+"]";var trimBeginRegexp=RegExp("^"+ws+ws+"*"),trimEndRegexp=RegExp(ws+ws+"*$");String.prototype.trim=function(){return(this+"").replace(trimBeginRegexp,"").replace(trimEndRegexp,"")}}var toObject=function(o){if(null==o)throw new TypeError("can\'t convert "+o+" to object");return Object(o)}});'};function HS({children:e,className:t,style:n}){return K.createElement("ul",{className:fa("tabs-basic","list-unstyled",t),style:n},e)}function KS({selected:e=!1,children:t,className:n}){return K.createElement("li",{className:fa(e?"selected":"",n)},t)}ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],(function(e,t,n){var r=e("../lib/oop"),a=e("./text_highlight_rules").TextHighlightRules,o=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}};r.inherits(o,a),t.JsonHighlightRules=o})),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],(function(e,t,n){var r=e("../range").Range,a=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\s*\})/);if(!n)return 0;var a=n[1].length,o=e.findMatchingBracket({row:t,column:a});if(!o||o.row==t)return 0;var i=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,a-1),i)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(a.prototype),t.MatchingBraceOutdent=a})),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],(function(e,t,n){var r=e("../../lib/oop"),a=e("../../range").Range,o=e("./fold_mode").FoldMode,i=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(i,o),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var a=this._getFoldWidgetBase(e,t,n);return!a&&this.startRegionRe.test(r)?"start":a},this.getFoldWidgetRange=function(e,t,n,r){var a,o=e.getLine(n);if(this.startRegionRe.test(o))return this.getCommentRegionBlock(e,o,n);if(a=o.match(this.foldingStartMarker)){var i=a.index;if(a[1])return this.openingBracketBlock(e,a[1],n,i);var s=e.getCommentFoldRange(n,i+a[0].length,1);return s&&!s.isMultiLine()&&(r?s=this.getSectionRange(e,n):"all"!=t&&(s=null)),s}if("markbegin"!==t&&(a=o.match(this.foldingStopMarker))){i=a.index+a[0].length;return a[1]?this.closingBracketBlock(e,a[1],n,i):e.getCommentFoldRange(n,i,-1)}},this.getSectionRange=function(e,t){for(var n=e.getLine(t),r=n.search(/\S/),o=t,i=n.length,s=t+=1,c=e.getLength();++t<c;){var l=(n=e.getLine(t)).search(/\S/);if(-1!==l){if(r>l)break;var u=this.getFoldWidgetRange(e,"all",t);if(u){if(u.start.row<=o)break;if(u.isMultiLine())t=u.end.row;else if(r==l)break}s=t}}return new a(o,i,s,e.getLine(s).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\s*$/),o=e.getLength(),i=n,s=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,c=1;++n<o;){t=e.getLine(n);var l=s.exec(t);if(l&&(l[1]?c--:c++,!c))break}if(n>i)return new a(i,r,n,t.length)}}.call(i.prototype)})),ace.define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/worker/worker_client"],(function(e,t,n){var r=e("../lib/oop"),a=e("./text").Mode,o=e("./json_highlight_rules").JsonHighlightRules,i=e("./matching_brace_outdent").MatchingBraceOutdent,s=e("./behaviour/cstyle").CstyleBehaviour,c=e("./folding/cstyle").FoldMode,l=e("../worker/worker_client").WorkerClient,u=function(){this.HighlightRules=o,this.$outdent=new i,this.$behaviour=new s,this.foldingRules=new c};r.inherits(u,a),function(){this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t);"start"==e&&(t.match(/^.*[\{\(\[]\s*$/)&&(r+=n));return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new l(["ace"],GS,"JsonWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",(function(t){e.setAnnotations(t.data)})),t.on("terminate",(function(){e.clearAnnotations()})),t},this.$id="ace/mode/json"}.call(u.prototype),t.Mode=u}));var VS;ha(".ace-editor div,\n.ace-editor span {\n font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;\n}\n.ace-editor > div.ace_gutter {\n z-index: 0;\n}\n.kayenta-config-json textarea {\n height: 65vh;\n overflow: scroll;\n padding: 2px 6px;\n line-height: 1.4rem;\n font-family: monospace;\n font-size: 1rem;\n}\n.kayenta-config-json pre.diff {\n height: 65vh;\n box-shadow: none;\n width: 100%;\n padding: 0;\n}\n.kayenta-config-json pre.diff .match,\n.kayenta-config-json pre.diff .add,\n.kayenta-config-json pre.diff .remove {\n font-family: monospace;\n font-size: 1rem;\n}\n.kayenta-config-json .modal-show-history .show-history .summary-nav {\n right: 7px;\n}\n"),function(e){e[e.Edit=0]="Edit",e[e.Diff=1]="Diff"}(VS||(VS={}));var JS,QS,YS,XS=rc((function(e){const t=x(e,"selectedConfig.config.id"),n=O.makeSortedStringFromObject(S(e.data.configs.find((e=>e.id===t))||{},"id")),r=e.selectedConfig.json.configJson||O.makeSortedStringFromObject(S(de(e)||{},"id")),a=e.app.disableConfigEdit||ae.disableConfigEdit;return{configJson:r,id:t,disabled:a,show:e.app.configJsonModalOpen,deserializationError:e.selectedConfig.json.error,tabState:e.app.configJsonModalTabState,diff:e.selectedConfig.json.error?null:O.diff(n,r,!0)}}),(function(e){return{closeModal:()=>e(Yl()),setTabState:t=>()=>e(pu({state:t})),setConfigJson:t=>e(du({json:t})),updateConfig:t=>{e(mu({config:Object.assign({id:t.target.dataset.id},JSON.parse(t.target.dataset.serialized))}))}}}))((function({show:e,disabled:t,configJson:n,id:r,deserializationError:a,closeModal:o,setConfigJson:i,updateConfig:s,setTabState:c,tabState:l,diff:u}){return K.createElement(re,{show:e,onHide:()=>null,bsSize:"large"},K.createElement(Ba,null,K.createElement(re.Header,null,K.createElement(re.Title,null,"JSON")),K.createElement(re.Body,null,K.createElement("section",null,K.createElement(HS,null,K.createElement(KS,{selected:l===VS.Edit},K.createElement("a",{onClick:c(VS.Edit)},"Edit")),K.createElement(KS,{selected:l===VS.Diff},K.createElement("a",{onClick:c(VS.Diff)},"Diff")))),K.createElement("section",{className:"kayenta-config-json"},l===VS.Edit&&K.createElement(w,{value:n,debounceChangePeriod:500,onChange:i,readOnly:t}),l===VS.Diff&&!a&&K.createElement("div",{className:"modal-show-history"},K.createElement("div",{className:"show-history"},K.createElement(C,{diff:u}))),!!a&&K.createElement("div",{className:"horizontal row center"},K.createElement("span",{className:"error-message"},"Error: ",a)))),K.createElement(re.Footer,null,K.createElement("ul",{className:"list-inline pull-right"},K.createElement("li",null,K.createElement("button",{className:"passive",onClick:o},"Close")),K.createElement("li",null,K.createElement("button",{className:"primary","data-id":r,"data-serialized":n,onClick:s,disabled:!!a||t},"Update"))))))}));const ZS=Fs({executionsCount:Gl({set_executions_count:(e,t)=>t.payload.count},null!==(YS=null!==(JS=ae.defaultExecutionCount)&&void 0!==JS?JS:null===(QS=ae.executionsCountOptions)||void 0===QS?void 0:QS[0])&&void 0!==YS?YS:20),deleteConfigModalOpen:Gl({delete_config_modal_open:()=>!0,[Dl("delete_config_modal_close","delete_config_success")]:()=>!1},!1),configJsonModalOpen:Gl({config_json_modal_open:()=>!0,[Dl("config_json_modal_close",So)]:()=>!1},!1),configJsonModalTabState:Gl({set_config_json_modal_tab_state:(e,t)=>t.payload.state,config_json_modal_open:()=>VS.Edit},VS.Edit),disableConfigEdit:Gl({},!1)}),ej=Gl({initialize:(e,t)=>t.state.data.application},null),tj=Gl({initialize:(e,t)=>t.state.data.configSummaries,update_config_summaries:(e,t)=>t.payload.configSummaries},[]),nj=Gl({load_config_success:(e,t)=>e.some((e=>e.id===t.payload.config.id))?U(e,e.find((e=>e.id===t.payload.config.id))).concat([t.payload.config]):e.concat([t.payload.config])},[]),rj=Gl({initialize:(e,t)=>t.state.data.judges,update_judges:(e,t)=>t.payload.judges},null),aj=Fs({data:Gl({load_executions_success:(e,t)=>t.payload.executions},[]),load:Gl({load_executions_request:()=>hO.Requesting,load_executions_success:()=>hO.Fulfilled,load_executions_failure:()=>hO.Failed},hO.Fulfilled)}),oj=Fs({load:Gl({load_metrics_service_metadata_request:()=>hO.Requesting,load_metrics_service_metadata_success:()=>hO.Fulfilled,load_metrics_service_metadata_failure:()=>hO.Failed},hO.Fulfilled),data:Gl({load_metrics_service_metadata_success:(e,t)=>t.payload.data,update_prometheus_metric_type:(e,t)=>t.payload.metricName?e:[],update_stackdriver_metric_type:(e,t)=>t.payload.metricType?e:[],update_datadog_metric_type:(e,t)=>t.payload.metricType?e:[],update_newrelic_select:(e,t)=>t.payload.select?e:[],update_graphite_metric_name:(e,t)=>t.payload.metricName?e:[],edit_metric_begin:()=>[]},[])}),ij=Fs({load:Gl({load_kayenta_accounts_request:()=>hO.Requesting,load_kayenta_accounts_success:()=>hO.Fulfilled,load_kayenta_accounts_failure:()=>hO.Failed},hO.Requesting),data:Gl({load_kayenta_accounts_success:(e,t)=>t.payload.accounts},[])}),sj=Fs({application:ej,configSummaries:tj,judges:rj,configs:nj,executions:aj,metricsServiceMetadata:oj,kayentaAccounts:ij});var cj=rc((function(e,t){return Object.assign({edit:e.selectedConfig.group.edit},t)}),(function(e){return{handleUpdate:t=>{e(Iu({edit:t.target.value}))},handleSubmit:t=>{e(Du(Object.assign({},t.currentTarget.dataset))),t.stopPropagation(),t.preventDefault()}}}))((function({editing:e,edit:t,group:n,onClick:r,handleUpdate:a,handleSubmit:o,defaultGroup:i}){return e?K.createElement("form",{onSubmit:o,onBlur:o,"data-group":n,"data-edit":t},K.createElement(cO,{autoFocus:!0,value:t,onChange:a,disabled:ae.disableConfigEdit,disabledStateKeys:[aO]})):K.createElement("a",{"data-group":n,onClick:r},n||i)}));var lj=rc((function(e){return{groupList:e.selectedConfig.group.list,selectedGroup:e.selectedConfig.group.selected,editing:!!e.selectedConfig.group.edit||""===e.selectedConfig.group.edit,disableConfigEdit:e.app.disableConfigEdit||ae.disableConfigEdit}}),(function(e){return{selectGroup:t=>{e(bu({name:t.target.dataset.group})),t.preventDefault(),t.stopPropagation()},addGroup:t=>{e(cu()),t.preventDefault(),t.stopPropagation()},editGroupBegin:t=>{e(Lu({group:t.target.dataset.group}))}}}))((function({groupList:e,selectedGroup:t,selectGroup:n,addGroup:r,editing:a,editGroupBegin:o,disableConfigEdit:i}){const s=({group:e,editable:r=!1})=>{const s=t===e;return K.createElement(KS,{selected:s},K.createElement(cj,{group:e,editing:s&&a,onClick:n,defaultGroup:"all"}),s&&r&&!a&&K.createElement("i",{"data-group":e,onClick:i||ae.disableConfigEdit?l:o,className:fa("fas","fa-pencil-alt",{disabled:i||ae.disableConfigEdit})}))};return K.createElement("section",{className:"group-tabs"},K.createElement(HS,{style:{marginBottom:"0"}},K.createElement(s,{group:""}),e.map((e=>K.createElement(s,{key:e,group:e,editable:!0}))),K.createElement(sO,{className:"passive float-right",onClick:r,disabled:ae.disableConfigEdit,disabledStateKeys:[aO]},"Add Group")))}));const uj=Fs({name:Gl({edit_template_begin:(e,t)=>t.payload.name,edit_template_cancel:()=>null,add_template:()=>""},null),editedName:Gl({[Dl("edit_template_begin","edit_template_name")]:(e,t)=>t.payload.name,edit_template_cancel:()=>null,add_template:()=>""},null),editedValue:Gl({[Dl("edit_template_value","edit_template_begin")]:(e,t)=>t.payload.value,edit_template_cancel:()=>null,add_template:()=>""},null),isNew:Gl({add_template:()=>!0,edit_template_cancel:()=>!1},!1)});const pj=Gl({[So]:(e,t)=>function(e=[]){const t=e.reduce(((e,t)=>e.concat(t.groups.filter((t=>!e.includes(t))))),[]).sort();return t.length||t.push("Group 1"),t}(t.payload.config.metrics),[lo]:(e,t)=>{const n=t.payload.metric.groups;return e.concat(n.filter((t=>!e.includes(t))))},add_group:e=>{let t=1,n=null;do{n="Group "+t,t++}while(e.includes(n));return e.concat([n])}},[]),dj=Fs({list:pj,selected:Gl({select_group:(e,t)=>t.payload.name,[So]:()=>""},""),groupWeights:Gl({[So]:(e,t)=>x(t,"payload.config.classifier.groupWeights",{}),update_group_weight:(e,t)=>Object.assign(Object.assign({},e),{[t.payload.group]:t.payload.weight})},{}),edit:Gl({edit_group_name_begin:(e,t)=>t.payload.group,edit_group_name_update:(e,t)=>t.payload.edit,[Dl("select_group","edit_group_name_confirm")]:()=>null},null)}),fj=EO(),hj=EO(),gj=Gl({update_prometheus_metric_type:(e,t)=>Object.assign(Object.assign({},e),{query:Object.assign(Object.assign({},e.query),{metricName:t.payload.metricName,type:"prometheus"})}),update_prometheus_metric_query_field:(e,t)=>t.payload.value?Object.assign(Object.assign({},e),{query:Object.assign(Object.assign({},e.query),{[t.payload.field]:t.payload.value})}):Object.assign(Object.assign({},e),{query:S(e.query,t.payload.field)}),update_prometheus_label_bindings:(e,t)=>Object.assign(Object.assign({},e),{query:Object.assign(Object.assign({},e.query),{labelBindings:fj(e.query.labelBindings||[],t)})}),update_prometheus_group_by_fields:(e,t)=>Object.assign(Object.assign({},e),{query:Object.assign(Object.assign({},e.query),{groupByFields:hj(e.query.groupByFields||[],t)})})},null),mj=((e={key:"",value:""})=>(t,n)=>{const{index:r,value:a,type:o}=n.payload;switch(o){case CS.ADD:return t.concat(e);case CS.DELETE:return[...t.slice(0,r),...t.slice(r+1)];case CS.KEY_EDIT:return[...t.slice(0,r),Object.assign(Object.assign({},t[r]),{key:a}),...t.slice(r+1)];case CS.VALUE_EDIT:return[...t.slice(0,r),Object.assign(Object.assign({},t[r]),{value:a}),...t.slice(r+1)]}})(),yj=Gl({update_signalfx_query_pairs:(e,t)=>Object.assign(Object.assign({},e),{query:Object.assign(Object.assign({},e.query),{queryPairs:mj(e.query.queryPairs||[],t)})}),update_signalfx_metric_name:(e,t)=>Object.assign(Object.assign({},e),{query:Object.assign(Object.assign({},e.query),{metricName:t.payload.metricName})}),update_signalfx_aggregation_method:(e,t)=>Object.assign(Object.assign({},e),{query:Object.assign(Object.assign({},e.query),{aggregationMethod:t.payload.aggregationMethod})})},null),vj=EO(),bj=Gl({update_stackdriver_group_by_fields:(e,t)=>Object.assign(Object.assign({},e),{query:Object.assign(Object.assign({},e.query),{groupByFields:vj(e.query.groupByFields||[],t)})}),update_stackdriver_metric_query_field:(e,t)=>t.payload.value?Object.assign(Object.assign({},e),{query:Object.assign(Object.assign({},e.query),{[t.payload.field]:t.payload.value,type:"stackdriver"})}):Object.assign(Object.assign({},e),{query:S(e.query,t.payload.field)})},null),_j=Gl({[So]:(e,t)=>t.payload.config,update_config_name:(e,t)=>Object.assign(Object.assign({},e),{name:t.payload.name}),update_config_description:(e,t)=>Object.assign(Object.assign({},e),{description:t.payload.description}),[Dl("delete_config_success","clear_selected_config")]:()=>null,delete_template:(e,t)=>t.payload.name?Object.assign(Object.assign({},e),{templates:S(e.templates,t.payload.name)}):e},null),wj=Fs({state:Gl({load_config_request:()=>hO.Requesting,load_config_failure:()=>hO.Failed,[So]:()=>hO.Fulfilled},hO.Requesting)});function Cj(e=[]){return e.map(((e,t)=>Object.assign(Object.assign({},e),{id:"#"+t})))}const Oj=Gl({[So]:(e,t)=>Cj(t.payload.config.metrics),[lo]:(e,t)=>Cj(e.concat([t.payload.metric])),[Oo]:(e,t)=>Cj(e.filter((e=>e.id!==t.payload.id))),delete_template:(e,t)=>e.map((e=>function(e,t){if(x(e,"query.customFilterTemplate")===t)return Object.assign(Object.assign({},e),{query:Object.assign(Object.assign({},e.query),{customFilterTemplate:null})});return e}(e,t.payload.name)))},[]);const Sj=Gl({rename_metric:(e,t)=>Object.assign(Object.assign({},e),{name:t.payload.name}),update_metric_direction:(e,t)=>L(D(e),["analysisConfigurations","canary","direction"],t.payload.direction),update_metric_nan_strategy:(e,{payload:t})=>{const n=D(e);return"default"===t.strategy?A(n,["analysisConfigurations","canary","nanStrategy"]):L(n,["analysisConfigurations","canary","nanStrategy"],t.strategy),n},update_metric_outlier_strategy:(e,{payload:t})=>{const n=D(e);return"default"===t.strategy?A(n,["analysisConfigurations","canary","outliers","strategy"]):L(n,["analysisConfigurations","canary","outliers","strategy"],t.strategy),n},update_metric_criticality:(e,{payload:t})=>{const n=D(e);return t.critical?L(n,["analysisConfigurations","canary","critical"],t.critical):A(n,["analysisConfigurations","canary","critical"]),n},update_metric_data_required:(e,{payload:t})=>{const n=D(e);return t.mustHaveData?L(n,["analysisConfigurations","canary","mustHaveData"],t.mustHaveData):A(n,["analysisConfigurations","canary","mustHaveData"]),n},update_effect_size:(e,{payload:t})=>{const n=D(e);return Object.keys(t.value).length?L(n,["analysisConfigurations","canary","effectSize"],t.value):A(n,["analysisConfigurations","canary","effectSize"]),n},update_metric_group:(e,t)=>Object.assign(Object.assign({},e),{groups:[t.payload.group]}),update_atlas_query:(e,t)=>Object.assign(Object.assign({},e),{query:Object.assign(Object.assign({},e.query),{q:t.query})}),update_datadog_metric_name:(e,t)=>Object.assign(Object.assign({},e),{query:Object.assign(Object.assign({},e.query),{metricName:t.payload.metricName})}),update_newrelic_select:(e,t)=>Object.assign(Object.assign({},e),{query:Object.assign(Object.assign({},e.query),{select:t.payload.select})}),select_template:(e,t)=>Object.assign(Object.assign({},e),{query:Object.assign(Object.assign({},e.query),{customFilterTemplate:t.payload.name})}),update_metric_scope_name:(e,t)=>Object.assign(Object.assign({},e),{scopeName:t.payload.scopeName}),update_graphite_metric_name:(e,t)=>Object.assign(Object.assign({},e),{query:Object.assign(Object.assign({},e.query),{metricName:t.payload.metricName})}),edit_inline_template:(e,t)=>Object.assign(Object.assign({},e),{query:Object.assign(Object.assign({},e.query),{customInlineTemplate:t.payload.value})})},null),jj=Fs({state:Gl({save_config_request:()=>hO.Requesting,[Dl("save_config_success","dismiss_save_config_error")]:()=>hO.Fulfilled,save_config_failure:()=>hO.Failed},hO.Fulfilled),error:Gl({save_config_failure:(e,t)=>x(t,"payload.error.data.message",null)},null)}),xj=Fs({state:Gl({delete_config_request:()=>hO.Requesting,delete_config_success:()=>hO.Fulfilled,delete_config_failure:()=>hO.Failed},hO.Fulfilled),error:Gl({delete_config_failure:(e,t)=>x(t,"payload.error.data.message",null)},null)}),kj=Fs({configJson:Gl({set_config_json:(e,t)=>t.payload.json,[Dl("config_json_modal_close",So)]:()=>null},null),error:Gl({[Dl("config_json_modal_close",So,"set_config_json")]:()=>null,set_config_json:(e,t)=>{try{return JSON.parse(t.payload.json).metrics.forEach(((e,t)=>{if(!e.groups||!e.groups.length)throw new Error(`metric #${t+1}: 'groups' is a required field`)})),null}catch(e){return e.message}}},null)}),Ej=Fs({judgeConfig:Gl({select_judge_name:(e,t)=>Object.assign(Object.assign({},e),{name:t.payload.judge.name})},null),renderState:Gl({},US.None)}),Tj=Fs({toGroup:Gl({change_metric_group_select:(e,t)=>t.payload.group,change_metric_group:()=>null},null),metric:Gl({change_metric_group:(e,t)=>t.payload.id,[ni]:()=>null},null)}),Pj=Gl({},null);function Nj(e=null,t){switch(t.type){case lo:return Object.assign(Object.assign({},e),{editingMetric:e.metricList[e.metricList.length-1]});case"edit_metric_begin":return Object.assign(Object.assign({},e),{editingMetric:e.metricList.find((e=>e.id===t.payload.id))});case"edit_metric_modal_confirm":{const t=S(e.editingMetric,"isNew");return Object.assign(Object.assign({},e),{metricList:e.metricList.map((e=>e.id===t.id?t:e)),editingMetric:null})}case"edit_metric_modal_cancel":return Object.assign(Object.assign({},e),{metricList:e.metricList.filter((e=>!e.isNew)),editingMetric:null});default:return e}}function Rj(e=null,t){return t.type===So?k(t,"payload.config.judge")?Object.assign(Object.assign({},e),{judge:Object.assign(Object.assign({},e.judge),{judgeConfig:Object.assign({},t.payload.config.judge)})}):Object.assign(Object.assign({},e),{judge:Object.assign(Object.assign({},e.judge),{judgeConfig:{name:ae.defaultJudge||"NetflixACAJudge-v1.0",judgeConfigurations:{}}})}):e}function Mj(e=null,t){if("edit_group_name_confirm"!==t.type)return e;const{payload:n}=t,r=W(e.metricList,(e=>e.groups));if(!n.edit||"all"===n.edit||r.includes(n.edit))return e;return Object.assign(Object.assign({},e),{metricList:e.metricList.map((e=>Object.assign(Object.assign({},e),{groups:(e.groups||[]).includes(n.group)?[n.edit].concat((e.groups||[]).filter((e=>e!==n.group))):e.groups}))),group:Object.assign(Object.assign({},e.group),{selected:n.edit,groupWeights:(e=>{const t=e[n.group];return e=S(e,n.group),Object.assign(Object.assign({},e),{[n.edit]:t})})(e.group.groupWeights),list:(a=e.group.list,[n.edit].concat((a||[]).filter((e=>e!==n.group))))})});var a}function Aj(e,t){if(t.type!==ni)return e;const{changeMetricGroup:{toGroup:n}}=e,{payload:{metricId:r}}=t;if(!r)return e;return Object.assign(Object.assign({},e),{metricList:e.metricList.map((e=>Object.assign(Object.assign({},e),{groups:e.id===r?[n]:e.groups})))})}function Lj(e,t){if(![So,ni,lo,Oo].includes(t.type))return e;const n=B(e.metricList).flatMap((e=>e.groups)).uniq().value();let r=z(e.group.groupWeights,n);return r=Object.assign(Object.assign({},G(n.map((e=>[e,0])))),r),Object.assign(Object.assign({},e),{group:Object.assign(Object.assign({},e.group),{groupWeights:r})})}const Ij=(e,t)=>{if("edit_template_confirm"!==t.type)return e;const{name:n,editedName:r,editedValue:a,isNew:o}=e.editingTemplate,i=Object.assign(Object.assign({},n?S(e.config.templates,n):e.config.templates),{[r]:a}),s=e=>x(e,"query.customFilterTemplate")!==n?e:Object.assign(Object.assign({},e),{query:Object.assign(Object.assign({},e.query),{customFilterTemplate:r})});return Object.assign(Object.assign({},e),{editingTemplate:{name:null,editedName:null,editedValue:null,isNew:!1},config:Object.assign(Object.assign({},e.config),{templates:i}),metricList:(e.metricList||[]).map(s),editingMetric:(c=e.editingMetric,o?Object.assign(Object.assign({},c),{query:Object.assign(Object.assign({},c.query),{customFilterTemplate:r})}):s(c))});var c},Dj=Fs({config:_j,load:wj,save:jj,destroy:xj,json:kj,judge:Ej,metricList:Oj,editingMetric:(e,t)=>[Sj,gj,yj,bj].reduce(((e,n)=>n(e,t)),e),group:dj,changeMetricGroup:Tj,isInSyncWithServer:Pj,validationErrors:()=>null,editingTemplate:uj,selectedStore:Gl({},null)});var qj;!function(e){e.TimeSeries="Time Series",e.Histogram="Histogram",e.BoxPlot="Beeswarm Box Plot"}(qj||(qj={}));const $j=sc(),Fj=Gl({toggle_metric_classification_filter:(e,t)=>{const{classification:n}=t.payload;return e.includes(n)?e.filter((e=>e!==n)):e.concat([n])}},[]),Bj=Gl({[ai]:(e,t)=>t.payload.run},null),Uj=Gl({load_run_request:()=>hO.Requesting,[ai]:()=>hO.Fulfilled,load_run_failure:()=>hO.Failed},hO.Requesting),Wj=Gl({[si]:(e,t)=>t.payload.group},null),zj=Gl({[si]:()=>null},null),Gj=Fs({pair:Gl({load_metric_set_pair_request:()=>null,load_metric_set_pair_success:(e,t)=>t.payload.metricSetPair},null),load:Gl({load_metric_set_pair_request:()=>hO.Requesting,load_metric_set_pair_success:()=>hO.Fulfilled,load_metric_set_pair_failure:()=>hO.Failed},hO.Fulfilled)}),Hj=Fs({run:Bj,load:Uj,selectedGroup:Wj,selectedMetric:zj,metricSetPair:Gj,graphType:Gl({select_graph_type:(e,t)=>t.payload.type},qj.TimeSeries),metricFilters:Fj}),Kj=e=>{const t=e.selectedConfig.config;return e.data.configSummaries.every((e=>t.name!==e.name||t.id===e.id))?null:{message:`Canary config '${t.name}' already exists.`}},Vj=/^[a-zA-Z0-9_-]*$/,Jj=e=>Vj.test(e.selectedConfig.config.name)?null:{message:"Canary config names must contain only letters, numbers, dashes (-) and underscores (_)."},Qj=e=>{const t=Object.values(e.selectedConfig.group.groupWeights),n=t.reduce(((e,t)=>e+t),0);return 0===t.length||100===n?null:{message:"Metric group weights must sum to 100."}},Yj=e=>Object.values(e.selectedConfig.group.groupWeights).every((e=>e>=0))?null:{message:"A group weight must be greater than or equal to 0."},Xj=e=>{const t=B(e.data.kayentaAccounts.data).filter((e=>e.supportedTypes.includes(ya.MetricsStore))).map((e=>e.metricsStoreType||e.type)).uniq().valueOf(),n=B(e.selectedConfig.metricList).map((e=>e.query.type)).uniq().valueOf().filter((e=>!t.includes(e)));let r;return 1===n.length?r=`This config contains metrics configured to query a metric\n store (${n[0]})\n that does not have any configured accounts.`:n.length>1&&(r=`This config contains metrics configured to query metric\n stores (${n.join()})\n that do not have any configured accounts.`),n.length?{message:r}:null},Zj=e=>B(e.selectedConfig.metricList).map((e=>e.query.type)).uniq().valueOf().length>1?{message:"All metrics must be from the same metric store."}:null,ex=e=>e.selectedConfig?(e.selectedConfig.validationErrors||(e=Object.assign(Object.assign({},e),{selectedConfig:Object.assign(Object.assign({},e.selectedConfig),{validationErrors:[]})})),[Kj,Jj,Qj,Yj,Xj,Zj].reduce(((e,t)=>(e=>t=>{if(!t.selectedConfig.config)return t;const n=e(t);return n?Object.assign(Object.assign({},t),{selectedConfig:Object.assign(Object.assign({},t.selectedConfig),{validationErrors:t.selectedConfig.validationErrors.concat(n?[n]:[])})}):t})(t)(e)),e)):e,tx=Fs({app:ZS,configValidationErrors:()=>null,data:sj,selectedConfig:(e,t)=>[Dj,Nj,Rj,Mj,Aj,Lj,Ij].reduce(((e,n)=>n(e,t)),e),selectedRun:Hj}),nx=(e,t)=>e.some((e=>e.name===t.name))?1===e.length?US.None:US.Multiple:US.Single,rx=Gl({[Dl(So,"update_judges")]:e=>{const{data:{judges:t=[]},selectedConfig:{judge:{judgeConfig:n}}}=e;return n?Object.assign(Object.assign({},e),{selectedConfig:Object.assign(Object.assign({},e.selectedConfig),{judge:Object.assign(Object.assign({},e.selectedConfig.judge),{renderState:nx(t,n)})})}):e}},null),ax=e=>Object.assign(Object.assign({},e),{selectedConfig:Object.assign(Object.assign({},e.selectedConfig),{isInSyncWithServer:(()=>{const t=de(e);if(t){const n=e.data.configs.find((e=>e.id===t.id));return!(n||!t.isNew||e.selectedConfig.save.state!==hO.Requesting)||H(t,n)}return!0})()})}),ox=(e,t)=>{if(![ci,si,ai].includes(t.type))return e;const n=((e,t)=>{switch(t.type){case ci:return t.payload.metricId;case ai:return BO(e).length?BO(e)[0].id:null;case si:{const n=BO(e);if(!n.length)return null;const r=t.payload.group,a=r?e=>e.groups.includes(r):()=>!0;return n.find(a)?n.find(a).id:null}default:return null}})(e,t);return n?(t.asyncDispatch(Gu({pairId:n})),Object.assign(Object.assign({},e),{selectedRun:Object.assign(Object.assign({},e.selectedRun),{selectedMetric:n,metricSetPair:Object.assign(Object.assign({},e.selectedRun.metricSetPair),{load:hO.Requesting})})})):e},ix=(e,t)=>{switch(t.type){case So:case"load_kayenta_accounts_success":{const t=B(e.data.kayentaAccounts.data).filter((e=>e.supportedTypes.includes(ya.MetricsStore))).map((e=>e.metricsStoreType||e.type)).uniq().valueOf();let n=(e.selectedConfig.metricList||[]).map((e=>e.query.type)).find((e=>!!e));return n=n||(t.length?t.includes(ae.metricStore)?ae.metricStore:t[0]:null),Object.assign(Object.assign({},e),{selectedConfig:Object.assign(Object.assign({},e.selectedConfig),{selectedStore:n})})}case"select_metric_store":{const n=t.payload.store,r=e=>Object.assign(Object.assign({},e),{query:Object.assign(Object.assign({},e.query),{type:n,serviceType:n})});return Object.assign(Object.assign({},e),{selectedConfig:Object.assign(Object.assign({},e.selectedConfig),{metricList:e.selectedConfig.metricList.map(r),selectedStore:n})})}default:return e}},sx=e=>e.selectedConfig.config?Object.assign(Object.assign({},e),{app:Object.assign(Object.assign({},e.app),{disableConfigEdit:!e.selectedConfig.config.applications.includes(e.data.application.name)})}):e,cx=(e,t)=>[tx,rx,ix,ox,sx,ex,ax].reduce(((e,n)=>n(e,t)),e);export{cx as $,Ku as A,cp as B,Jo as C,lp as D,up as E,pe as F,qj as G,wp as H,Cp as I,Qa as J,ya as K,Ja as L,to as M,Xa as N,Za as O,ri as P,li as Q,xi as R,no as S,ji as T,Si as U,ki as V,wi as W,co as X,Ri as Y,qs as Z,ae as _,je as a,zS as a$,Ba as a0,Qi as a1,_e as a2,Tu as a3,Pu as a4,ve as a5,vp as a6,bp as a7,hO as a8,rc as a9,aS as aA,ep as aB,cc as aC,pO as aD,vu as aE,su as aF,Zl as aG,eu as aH,tu as aI,nu as aJ,ru as aK,au as aL,ou as aM,dS as aN,pS as aO,eS as aP,qu as aQ,$u as aR,Wa as aS,Su as aT,Cu as aU,Ou as aV,sp as aW,Op as aX,ju as aY,xu as aZ,_u as a_,XS as aa,Xl as ab,Ql as ac,sO as ad,aO as ae,Vl as af,Ep as ag,fO as ah,iu as ai,cO as aj,ha as ak,lO as al,dO as am,QO as an,oS as ao,JO as ap,sS as aq,ip as ar,op as as,Ju as at,Yu as au,Qu as av,Xu as aw,Zu as ax,Vu as ay,iS as az,Ce as b,Io as b$,US as b0,lj as b1,Mu as b2,Au as b3,hu as b4,lu as b5,uu as b6,WO as b7,ga as b8,wa as b9,so as bA,lo as bB,uo as bC,po as bD,fo as bE,ho as bF,go as bG,mo as bH,yo as bI,vo as bJ,bo as bK,_o as bL,wo as bM,Co as bN,Oo as bO,So as bP,jo as bQ,xo as bR,ko as bS,Eo as bT,To as bU,Po as bV,No as bW,Ro as bX,Mo as bY,Ao as bZ,Lo as b_,$O as ba,BO as bb,_p as bc,KO as bd,_a as be,Hl as bf,GO as bg,zu as bh,zO as bi,UO as bj,Wu as bk,Fu as bl,me as bm,ma as bn,YO as bo,va as bp,yu as bq,Sa as br,Kl as bs,Va as bt,Ya as bu,eo as bv,ro as bw,ao as bx,oo as by,io as bz,fa as c,Do as c0,qo as c1,$o as c2,Fo as c3,Bo as c4,Uo as c5,Wo as c6,zo as c7,Go as c8,Ho as c9,Ei as cA,Ti as cB,Pi as cC,Ni as cD,Mi as cE,Ai as cF,Li as cG,Ii as cH,Di as cI,qi as cJ,$i as cK,ba as cL,FO as cM,HO as cN,VO as cO,XO as cP,ZO as cQ,uO as cR,Ko as ca,Vo as cb,Yo as cc,Xo as cd,Zo as ce,ei as cf,ti as cg,ni as ch,ai as ci,oi as cj,ii as ck,si as cl,ci as cm,ui as cn,pi as co,di as cp,fi as cq,hi as cr,gi as cs,mi as ct,yi as cu,vi as cv,bi as cw,_i as cx,Ci as cy,Oi as cz,he as d,Qo as e,fe as f,oe as g,Ru as h,de as i,ce as j,gu as k,Nu as l,$j as m,ku as n,le as o,fu as p,Eu as q,Jl as r,mu as s,ge as t,se as u,Bu as v,Uu as w,qO as x,ye as y,Hu as z};
|
|
2
|
+
//# sourceMappingURL=index-c465ad9f.js.map
|