diff --git a/flink-runtime-web/web-dashboard/app/partials/jobs/job.plan.node-list.metrics.jade b/flink-runtime-web/web-dashboard/app/partials/jobs/job.plan.node-list.metrics.jade index fd7382f50b5e02c68ad64e054c15c672ef3dbd8b..f3ec8dc0217331c14aa55f2a08f40d9be4828740 100644 --- a/flink-runtime-web/web-dashboard/app/partials/jobs/job.plan.node-list.metrics.jade +++ b/flink-runtime-web/web-dashboard/app/partials/jobs/job.plan.node-list.metrics.jade @@ -41,7 +41,7 @@ nav.navbar.navbar-default.navbar-secondary-additional.navbar-secondary-additiona ul.metric-row(ng-if="nodeid && metrics.length > 0" dnd-list="metrics" dnd-drop="dropped(event, index, item, external, type, external)") li.metric-col(ng-repeat="metric in metrics track by metric.id" dnd-draggable="metric" dnd-dragstart="dragStart()" dnd-dragend="dragEnd()" dnd-canceled="dragEnd()" ng-class="{big: metric.size != 'small'}") - metrics-graph(metric="metric" window="window" get-values="getValues(metric.id)" remove-metric="removeMetric(metric)" set-metric-size="setMetricSize") + metrics-graph(metric="metric" window="window" get-values="getValues(metric.id)" remove-metric="removeMetric(metric)" set-metric-size="setMetricSize" set-metric-view="setMetricView") .clearfix diff --git a/flink-runtime-web/web-dashboard/app/scripts/common/filters.coffee b/flink-runtime-web/web-dashboard/app/scripts/common/filters.coffee index a3ce508cc5c52b8570bcabf70b690ef06da490cf..e2b83391e897515c387a2c9b5336883a9d7219a1 100644 --- a/flink-runtime-web/web-dashboard/app/scripts/common/filters.coffee +++ b/flink-runtime-web/web-dashboard/app/scripts/common/filters.coffee @@ -98,3 +98,37 @@ angular.module('flinkApp') .filter "increment", -> (number) -> parseInt(number) + 1 + +.filter "humanizeChartNumeric", ['humanizeBytesFilter', 'humanizeDurationFilter', (humanizeBytesFilter, humanizeDurationFilter)-> + (value, metric)-> + return_val = '' + if value != null + if /bytes/i.test(metric.id) && /persecond/i.test(metric.id) + return_val = humanizeBytesFilter(value) + ' / s' + else if /bytes/i.test(metric.id) + return_val = humanizeBytesFilter(value) + else if /persecond/i.test(metric.id) + return_val = value + ' / s' + else if /time/i.test(metric.id) || /latency/i.test(metric.id) + return_val = humanizeDurationFilter(value, true) + else + return_val = value + return return_val +] + +.filter "humanizeChartNumericTitle", ['humanizeDurationFilter', (humanizeDurationFilter)-> + (value, metric)-> + return_val = '' + if value != null + if /bytes/i.test(metric.id) && /persecond/i.test(metric.id) + return_val = value + ' Bytes / s' + else if /bytes/i.test(metric.id) + return_val = value + ' Bytes' + else if /persecond/i.test(metric.id) + return_val = value + ' / s' + else if /time/i.test(metric.id) || /latency/i.test(metric.id) + return_val = humanizeDurationFilter(value, false) + else + return_val = value + return return_val +] diff --git a/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/jobs.ctrl.coffee b/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/jobs.ctrl.coffee index f25c94d1173fc36a360ba84578fd3d1733a03a49..d4315ea2499b4b5c26de4dda50eddd127d2232e0 100644 --- a/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/jobs.ctrl.coffee +++ b/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/jobs.ctrl.coffee @@ -385,6 +385,10 @@ angular.module('flinkApp') MetricsService.setMetricSize($scope.jobid, $scope.nodeid, metric, size) loadMetrics() + $scope.setMetricView = (metric, view) -> + MetricsService.setMetricView($scope.jobid, $scope.nodeid, metric, view) + loadMetrics() + $scope.getValues = (metric) -> MetricsService.getValues($scope.jobid, $scope.nodeid, metric) diff --git a/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/metrics.dir.coffee b/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/metrics.dir.coffee index adfc09f17944ec31346e3d3d583c8ee07cd1f582..a3787488f5e7ec6c49847e7673ab650aaafcf094 100644 --- a/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/metrics.dir.coffee +++ b/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/metrics.dir.coffee @@ -33,8 +33,16 @@ angular.module('flinkApp')
- + +
+
{{value | humanizeChartNumeric:metric}}
+
+
+
+ + +
' replace: true scope: @@ -42,6 +50,7 @@ angular.module('flinkApp') window: "=" removeMetric: "&" setMetricSize: "=" + setMetricView: "=" getValues: "&" link: (scope, element, attrs) -> @@ -106,10 +115,13 @@ angular.module('flinkApp') scope.setSize = (size) -> scope.setMetricSize(scope.metric, size) - scope.showChart() + scope.setView = (view) -> + scope.setMetricView(scope.metric, view) + scope.showChart() if view == 'chart' + + scope.showChart() if scope.metric.view == 'chart' scope.$on 'metrics:data:update', (event, timestamp, data) -> -# scope.value = parseInt(data[scope.metric.id]) scope.value = parseFloat(data[scope.metric.id]) scope.data[0].values.push { @@ -120,8 +132,8 @@ angular.module('flinkApp') if scope.data[0].values.length > scope.window scope.data[0].values.shift() - scope.showChart() - scope.chart.clearHighlights() + scope.showChart() if scope.metric.view == 'chart' + scope.chart.clearHighlights() if scope.metric.view == 'chart' scope.chart.tooltip.hidden(true) element.find(".metric-title").qtip({ @@ -135,4 +147,4 @@ angular.module('flinkApp') style: { classes: 'qtip-light qtip-timeline-bar' } - }); + }); \ No newline at end of file diff --git a/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/metrics.svc.coffee b/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/metrics.svc.coffee index 9b9fab77827dcd9c978e3c3e8f3df853d3f27219..fbe3d6d8e5cdf217ba551e94455ad378f0a61d43 100644 --- a/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/metrics.svc.coffee +++ b/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/metrics.svc.coffee @@ -110,7 +110,7 @@ angular.module('flinkApp') @addMetric = (jobid, nodeid, metricid) -> @setupLSFor(jobid, nodeid) - @metrics[jobid][nodeid].push({id: metricid, size: 'small'}) + @metrics[jobid][nodeid].push({id: metricid, size: 'small', view: 'chart'}) @saveSetup() @@ -128,7 +128,16 @@ angular.module('flinkApp') i = @metrics[jobid][nodeid].indexOf(metric.id) i = _.findIndex(@metrics[jobid][nodeid], { id: metric.id }) if i == -1 - @metrics[jobid][nodeid][i] = { id: metric.id, size: size } if i != -1 + @metrics[jobid][nodeid][i] = { id: metric.id, size: size, view: metric.view } if i != -1 + + @saveSetup() + + @setMetricView = (jobid, nodeid, metric, view) => + if @metrics[jobid][nodeid]? + i = @metrics[jobid][nodeid].indexOf(metric.id) + i = _.findIndex(@metrics[jobid][nodeid], { id: metric.id }) if i == -1 + + @metrics[jobid][nodeid][i] = { id: metric.id, size: metric.size, view: view } if i != -1 @saveSetup() @@ -148,7 +157,7 @@ angular.module('flinkApp') @getMetricsSetup = (jobid, nodeid) => { names: _.map(@metrics[jobid][nodeid], (value) => - if _.isString(value) then { id: value, size: "small" } else value + if _.isString(value) then { id: value, size: "small", view: "chart" } else value ) } diff --git a/flink-runtime-web/web-dashboard/app/styles/metric.styl b/flink-runtime-web/web-dashboard/app/styles/metric.styl index 972352f1c6f6c2c06cf856a018d0f636b44e9e8e..94c494838a9bfd340ce50cbad7213b56e5a467ba 100644 --- a/flink-runtime-web/web-dashboard/app/styles/metric.styl +++ b/flink-runtime-web/web-dashboard/app/styles/metric.styl @@ -67,6 +67,11 @@ $metric-row-height = 180px + 85px background-color: transparent height: $metric-row-height position: relative + .metric-numeric + text-align: center; + margin-top: 75px; + font-size: 40px; + font-weight: bold; .panel-heading padding: 0px 10px diff --git a/flink-runtime-web/web-dashboard/web/css/index.css b/flink-runtime-web/web-dashboard/web/css/index.css index 7f2099879be120b46e9281a220aada78f40c7e7d..db615b1fb008135313b493547347ed36ce1ae957 100644 --- a/flink-runtime-web/web-dashboard/web/css/index.css +++ b/flink-runtime-web/web-dashboard/web/css/index.css @@ -1 +1 @@ -#main,#sidebar,body,html{height:100%}#content,#sidebar{-webkit-transition:.4s;-moz-transition:.4s;-o-transition:.4s;-ms-transition:.4s}.gutter{background-color:transparent;background-repeat:no-repeat;background-position:50%}.gutter-vertical{cursor:row-resize;background-image:url(../images/grips/horizontal.png)}#sidebar{overflow:hidden;position:fixed;left:-250px;top:0;bottom:0;width:250px;background:#151515;transition:.4s;-webkit-box-shadow:inset -10px 0 10px rgba(0,0,0,.2);box-shadow:inset -10px 0 10px rgba(0,0,0,.2)}#sidebar.sidebar-visible{left:0}#sidebar .logo{width:auto;height:22px}#sidebar .logo img{display:inline-block}#sidebar .navbar-static-top{overflow:hidden;height:51px}#sidebar .navbar-static-top .navbar-header{width:100%}#sidebar .navbar-brand.navbar-brand-text{font-size:14px;font-weight:700;color:#fff;padding-left:0}#sidebar .nav>li>a{color:#aaa;margin-bottom:1px}#sidebar .nav>li>a:focus,#sidebar .nav>li>a:hover{background-color:rgba(40,40,40,.5)}#sidebar .nav>li>a.active{background-color:rgba(100,100,100,.5)}#content{background-color:#fff;margin-left:0;padding-top:70px;height:100%;transition:.4s}.table .table,.table.table-inner{background-color:transparent}#content .navbar-main,#content .navbar-main-additional{-webkit-transition:.4s;-moz-transition:.4s;-o-transition:.4s;-ms-transition:.4s;transition:.4s}#content .navbar-main-additional{margin-top:51px;border-bottom:none;padding:0 20px}#content .navbar-main-additional .nav-tabs{margin:0 -20px;padding:0 20px}#content .navbar-secondary-additional{border:none;padding:0 20px;margin-bottom:0}#content .navbar-secondary-additional .nav-tabs{margin:0 -20px}#content.sidebar-visible{margin-left:250px}#content.sidebar-visible .navbar-main,#content.sidebar-visible .navbar-main-additional{left:250px}#content #fold-button{display:inline-block;margin-left:20px}#content #content-inner{padding:0 20px 20px}#content #content-inner.has-navbar-main-additional{padding-top:42px}.table#add-file-table span.btn,.table#job-submit-table td>span.btn{padding:2px 4px;font-size:14px}.page-header{margin:0 0 20px}.nav>li>a,.nav>li>a:focus,.nav>li>a:hover{color:#aaa;background-color:transparent;border-bottom:2px solid transparent}.nav>li.active>a,.nav>li.active>a:focus,.nav>li.active>a:hover{color:#000;border-bottom:2px solid #000}.nav.nav-tabs{margin-bottom:20px}.table th{font-weight:400;color:#999}.table td.td-long{width:20%;white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}.table.table-clickable tr{cursor:pointer}.table.table-properties{table-layout:fixed;white-space:nowrap}.table.table-properties td{width:50%;white-space:nowrap;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis}.table.table-body-hover>tbody{border-top:none;border-left:2px solid transparent}.table.table-body-hover>tbody.active{border-left:2px solid #000}.table.table-body-hover>tbody.active td.tab-column li.active,.table.table-body-hover>tbody.active td:not(.tab-column),.table.table-body-hover>tbody:hover td.tab-column li.active,.table.table-body-hover>tbody:hover td:not(.tab-column){background-color:#f0f0f0}.table.table-activable td.tab-column,.table.table-activable th.tab-column{border-top:none;width:47px}.table.table-activable td.tab-column{border-right:1px solid #ddd}.table.table-activable td{position:relative}.table.table-no-border td,.table.table-no-border th{border-top:none!important}.table#job-submit-table{table-layout:fixed;white-space:nowrap}.table#job-submit-table td.td-large{width:40%}.table#job-submit-table td{width:15%}.table#job-submit-table td>input{height:28px;font-size:14px}.table#add-file-table{table-layout:fixed}.table#add-file-table span.btn{position:relative;overflow:hidden;border-radius:2px;margin-top:-3px}.table#add-file-table td#add-file-button{width:100px}.table#add-file-table td#add-file-button input[type=file]{position:absolute;top:0;right:0;min-width:100%;min-height:100%;opacity:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);outline:0;cursor:inherit;display:block}.timeline-canvas .timeline-insidelabel,.timeline-canvas .timeline-series,svg.graph .node{cursor:pointer}.table#add-file-table td#add-file-name{width:250px;-o-text-overflow:ellipsis;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.table#add-file-table td#add-file-status{width:100%}.table#add-file-table td#add-file-status span.btn-progress-bar{padding:0!important;width:100%;background-color:#f5f5f5;text-align:left}.table#add-file-table td#add-file-status span.btn-progress{padding:2px;font-size:10px}.table span.error-area{color:red}.table span.row-button{padding:1px 2px;margin:0;border:none!important}.table .small-label{text-transform:uppercase;font-size:13px;color:#999}span.icon-wrapper{width:1.2em;display:inline-block}.panel.panel-dashboard .huge{font-size:28px}.panel.panel-lg{font-size:16px}.panel.panel-lg .badge{font-size:14px}.navbar-secondary{overflow:auto}.navbar-main .navbar-title,.navbar-main .navbar-title-job,.navbar-main .panel-title,.navbar-main-additional .navbar-title,.navbar-main-additional .navbar-title-job,.navbar-main-additional .panel-title,.navbar-secondary .navbar-title,.navbar-secondary .navbar-title-job,.navbar-secondary .panel-title,.navbar-secondary-additional .navbar-title,.navbar-secondary-additional .navbar-title-job,.navbar-secondary-additional .panel-title,.panel.panel-multi .navbar-title,.panel.panel-multi .navbar-title-job,.panel.panel-multi .panel-title{float:left;font-size:18px;padding:12px 20px 13px 10px;color:#333;display:inline-block}.navbar-main .navbar-info,.navbar-main .panel-info,.navbar-main-additional .navbar-info,.navbar-main-additional .panel-info,.navbar-secondary .navbar-info,.navbar-secondary .panel-info,.navbar-secondary-additional .navbar-info,.navbar-secondary-additional .panel-info,.panel.panel-multi .navbar-info,.panel.panel-multi .panel-info{float:left;font-size:14px;padding:15px;color:#999;display:inline-block;border-right:1px solid #e7e7e7;overflow:hidden}.navbar-main .navbar-info .overflow,.navbar-main .panel-info .overflow,.navbar-main-additional .navbar-info .overflow,.navbar-main-additional .panel-info .overflow,.navbar-secondary .navbar-info .overflow,.navbar-secondary .panel-info .overflow,.navbar-secondary-additional .navbar-info .overflow,.navbar-secondary-additional .panel-info .overflow,.panel.panel-multi .navbar-info .overflow,.panel.panel-multi .panel-info .overflow{position:absolute;display:block;-o-text-overflow:ellipsis;text-overflow:ellipsis;overflow:hidden;height:22px;line-height:22px;vertical-align:middle}.navbar-main .navbar-info.first,.navbar-main .panel-info.first,.navbar-main-additional .navbar-info.first,.navbar-main-additional .panel-info.first,.navbar-secondary .navbar-info.first,.navbar-secondary .panel-info.first,.navbar-secondary-additional .navbar-info.first,.navbar-secondary-additional .panel-info.first,.panel.panel-multi .navbar-info.first,.panel.panel-multi .panel-info.first{border-left:1px solid #e7e7e7}.navbar-main .navbar-info.last,.navbar-main .panel-info.last,.navbar-main-additional .navbar-info.last,.navbar-main-additional .panel-info.last,.navbar-secondary .navbar-info.last,.navbar-secondary .panel-info.last,.navbar-secondary-additional .navbar-info.last,.navbar-secondary-additional .panel-info.last,.panel.panel-multi .navbar-info.last,.panel.panel-multi .panel-info.last{border-right:none}.panel.panel-multi .panel-heading{padding:0}.panel.panel-multi .panel-heading .panel-info.thin{padding:8px 10px}.panel.panel-multi .panel-body{padding:10px;background-color:#fdfdfd;color:#999;font-size:13px}.panel.panel-multi .panel-body.clean{color:inherit;font-size:inherit}.navbar-main-additional,.navbar-secondary-additional{min-height:40px;background-color:#fdfdfd}.navbar-main-additional .navbar-info,.navbar-secondary-additional .navbar-info{font-size:13px;padding:10px 15px}.nav-top-affix.affix{width:100%;top:50px;margin-left:-20px;padding-left:20px;margin-right:-20px;padding-right:20px;background-color:#fff;z-index:1}.badge-default[href]:focus,.badge-default[href]:hover{background-color:grey}.badge-primary{background-color:#428bca}.badge-primary[href]:focus,.badge-primary[href]:hover{background-color:#3071a9}.badge-success{background-color:#5cb85c}.badge-success[href]:focus,.badge-success[href]:hover{background-color:#449d44}.badge-info{background-color:#5bc0de}.badge-info[href]:focus,.badge-info[href]:hover{background-color:#31b0d5}.badge-warning{background-color:#f0ad4e}.badge-warning[href]:focus,.badge-warning[href]:hover{background-color:#ec971f}.badge-danger{background-color:#d9534f}.badge-danger[href]:focus,.badge-danger[href]:hover{background-color:#c9302c}.indicator{display:inline-block;margin-right:15px}.indicator.indicator-primary{color:#428bca}.indicator.indicator-success{color:#5cb85c}.indicator.indicator-info{color:#5bc0de}.indicator.indicator-warning{color:#f0ad4e}.indicator.indicator-danger{color:#d9534f}pre.exception{border:none;background-color:transparent;padding:0;margin:0}pre{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}.nav-tabs.tabs-vertical{position:absolute;left:0;top:0;border-bottom:none;z-index:100}.nav-tabs.tabs-vertical li{float:none;margin-bottom:0;margin-right:-1px}.nav-tabs.tabs-vertical li>a{margin-right:0;border-radius:0;border-bottom:none;border-left:2px solid transparent}.nav-tabs.tabs-vertical li.active>a,.nav-tabs.tabs-vertical li>a:focus,.nav-tabs.tabs-vertical li>a:hover{border-bottom:none;border-left:2px solid #000}.navbar-main .navbar-title,.navbar-main-additional .navbar-title,.navbar-secondary .navbar-title,.navbar-secondary-additional .navbar-title{padding:12px 20px 13px}.navbar-main .navbar-title-job{padding:8px 20px}.navbar-main .navbar-title-job .indicator-primary{padding:8px 0 0}.navbar-main .navbar-title-job .no-padding{padding:0}.navbar-main .navbar-title-job .no-margin{margin:0}.navbar-main .navbar-title-job .job-name{font-size:14px}.navbar-main .navbar-title-job .job-id{color:#999;font-size:11px}.checkpoint-overview a,svg.graph .node h4{color:#000}livechart{width:30%;height:30%;text-align:center}.canvas-wrapper{border:1px solid #ddd;position:relative;margin-bottom:20px;height:100%}.canvas-wrapper .main-canvas{height:100%;overflow:hidden}.canvas-wrapper .main-canvas .zoom-buttons{position:absolute;top:10px;right:10px}.label-group .label{display:inline-block;padding-left:.4em;padding-right:.4em;margin:0;border-right:1px solid #fff;border-radius:0}.label-group .label.label-black{background-color:#000}.navbar-info-button{padding:3px 4px;font-size:12px;font-family:inherit;margin-top:-2px}svg.graph .edge-label,svg.graph text{font-size:14px}.checkpoints-view{padding-top:1em}.subtask-details .blank{height:2em}.checkpoint-overview td span{padding-left:2em}svg.graph{overflow:hidden;height:100%;width:100%!important}svg.graph g.type-TK>rect{fill:#00ffd0}svg.graph text{font-weight:300}svg.graph .node>rect{stroke:#999;stroke-width:5px;fill:#fff;margin:0;padding:0}svg.graph .node[active]>rect{fill:#eee}svg.graph .node.node-mirror>rect{stroke:#a8a8a8}svg.graph .node.node-iteration>rect{stroke:#cd3333}svg.graph .node.node-source>rect{stroke:#4ce199}svg.graph .node.node-sink>rect{stroke:#e6ec8b}svg.graph .node.node-normal>rect{stroke:#3fb6d8}svg.graph .node h5{color:#999}svg.graph .edgeLabel rect{fill:#fff}svg.graph .edgePath path{stroke:#333;stroke-width:2px;fill:#333}svg.graph .label{color:#777;margin:0}svg.graph .node-label{display:block;margin:0;text-decoration:none}.timeline{overflow:hidden}.timeline-canvas{overflow:hidden;padding:10px}.timeline-canvas .bar-container{overflow:hidden}.timeline-canvas.secondary .timeline-insidelabel,.timeline-canvas.secondary .timeline-series{cursor:auto}#content .navbar-secondary-additional.navbar-secondary-additional-2 .add-metrics a,.show-pointer{cursor:pointer}.qtip-timeline-bar{font-size:14px;line-height:1.4}#content .navbar-secondary-additional.navbar-secondary-additional-2{margin:-10px -10px 10px;padding:0;border-bottom:1px solid #e4e4e4}#content .navbar-secondary-additional.navbar-secondary-additional-2 .navbar-info{padding-top:12px;padding-bottom:12px}#content .navbar-secondary-additional.navbar-secondary-additional-2 .add-metrics{margin-right:15px;float:right}#content .navbar-secondary-additional.navbar-secondary-additional-2 .add-metrics .btn{margin-top:5px;margin-bottom:5px}#content .navbar-secondary-additional.navbar-secondary-additional-2 .metric-menu{max-height:300px;max-width:900px;overflow-y:scroll;text-align:right}.metric-row{margin:0;min-height:275px;padding:0;list-style-type:none}.metric-row .metric-col{background-color:transparent;width:33.33%;float:left}.metric-row .metric-col.big{width:100%}.metric-row .metric-col .panel{margin-left:5px;margin-right:5px;min-height:265px;margin-bottom:10px}.metric-row .metric-col .panel .panel-body{background-color:transparent;height:265px;position:relative}.metric-row .metric-col .panel .panel-heading{padding:0 10px;background-color:transparent;height:41px;line-height:41px;position:relative;overflow:hidden;cursor:pointer}.metric-row .metric-col .panel .panel-heading .metric-title{padding:10px 0}.metric-row .metric-col .panel .panel-heading .buttons{position:absolute;top:0;right:0;padding:0 10px;background-color:#fff}.metric-row .metric-col.dndDraggingSource{display:none}.metric-row .dndPlaceholder{position:relative;background-color:#f0f0f0;min-height:305px;display:block;width:33.33%;float:left;margin-bottom:10px;border-radius:5px}.p-info{padding-left:5px;padding-right:5px}@media (min-width:1024px) and (max-width:1279px){#content #fold-button,#sidebar .navbar-static-top .navbar-brand-text{display:none}#sidebar{left:0;width:160px}#content{margin-left:160px}#content .navbar-main,#content .navbar-main-additional{left:160px}.table td.td-long{width:20%}}@media (min-width:1280px){#sidebar{left:0}#content{margin-left:250px}#content #fold-button{display:none}#content .navbar-main,#content .navbar-main-additional{left:250px}.table td.td-long{width:30%}}.legend-box{font-size:10px;width:2em}#total-mem{background-color:#7cb5ec}#heap-mem{background-color:#434348}#non-heap-mem{background-color:#90ed7d}#fetch-plan,#job-submit{width:100px}#content-inner,#details,#node-details{height:100%}#job-panel{overflow-y:auto} \ No newline at end of file +#main,#sidebar,body,html{height:100%}#content,#sidebar{-webkit-transition:.4s;-moz-transition:.4s;-o-transition:.4s;-ms-transition:.4s}.gutter{background-color:transparent;background-repeat:no-repeat;background-position:50%}.gutter-vertical{cursor:row-resize;background-image:url(../images/grips/horizontal.png)}#sidebar{overflow:hidden;position:fixed;left:-250px;top:0;bottom:0;width:250px;background:#151515;transition:.4s;-webkit-box-shadow:inset -10px 0 10px rgba(0,0,0,.2);box-shadow:inset -10px 0 10px rgba(0,0,0,.2)}#sidebar.sidebar-visible{left:0}#sidebar .logo{width:auto;height:22px}#sidebar .logo img{display:inline-block}#sidebar .navbar-static-top{overflow:hidden;height:51px}#sidebar .navbar-static-top .navbar-header{width:100%}#sidebar .navbar-brand.navbar-brand-text{font-size:14px;font-weight:700;color:#fff;padding-left:0}#sidebar .nav>li>a{color:#aaa;margin-bottom:1px}#sidebar .nav>li>a:focus,#sidebar .nav>li>a:hover{background-color:rgba(40,40,40,.5)}#sidebar .nav>li>a.active{background-color:rgba(100,100,100,.5)}#content{background-color:#fff;margin-left:0;padding-top:70px;height:100%;transition:.4s}.table .table,.table.table-inner{background-color:transparent}#content .navbar-main,#content .navbar-main-additional{-webkit-transition:.4s;-moz-transition:.4s;-o-transition:.4s;-ms-transition:.4s;transition:.4s}#content .navbar-main-additional{margin-top:51px;border-bottom:none;padding:0 20px}#content .navbar-main-additional .nav-tabs{margin:0 -20px;padding:0 20px}#content .navbar-secondary-additional{border:none;padding:0 20px;margin-bottom:0}#content .navbar-secondary-additional .nav-tabs{margin:0 -20px}#content.sidebar-visible{margin-left:250px}#content.sidebar-visible .navbar-main,#content.sidebar-visible .navbar-main-additional{left:250px}#content #fold-button{display:inline-block;margin-left:20px}#content #content-inner{padding:0 20px 20px}#content #content-inner.has-navbar-main-additional{padding-top:42px}.table#add-file-table span.btn,.table#job-submit-table td>span.btn{padding:2px 4px;font-size:14px}.page-header{margin:0 0 20px}.nav>li>a,.nav>li>a:focus,.nav>li>a:hover{color:#aaa;background-color:transparent;border-bottom:2px solid transparent}.nav>li.active>a,.nav>li.active>a:focus,.nav>li.active>a:hover{color:#000;border-bottom:2px solid #000}.nav.nav-tabs{margin-bottom:20px}.table th{font-weight:400;color:#999}.table td.td-long{width:20%;white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}.table.table-clickable tr{cursor:pointer}.table.table-properties{table-layout:fixed;white-space:nowrap}.table.table-properties td{width:50%;white-space:nowrap;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis}.table.table-body-hover>tbody{border-top:none;border-left:2px solid transparent}.table.table-body-hover>tbody.active{border-left:2px solid #000}.table.table-body-hover>tbody.active td.tab-column li.active,.table.table-body-hover>tbody.active td:not(.tab-column),.table.table-body-hover>tbody:hover td.tab-column li.active,.table.table-body-hover>tbody:hover td:not(.tab-column){background-color:#f0f0f0}.table.table-activable td.tab-column,.table.table-activable th.tab-column{border-top:none;width:47px}.table.table-activable td.tab-column{border-right:1px solid #ddd}.table.table-activable td{position:relative}.table.table-no-border td,.table.table-no-border th{border-top:none!important}.table#job-submit-table{table-layout:fixed;white-space:nowrap}.table#job-submit-table td.td-large{width:40%}.table#job-submit-table td{width:15%}.table#job-submit-table td>input{height:28px;font-size:14px}.table#add-file-table{table-layout:fixed}.table#add-file-table span.btn{position:relative;overflow:hidden;border-radius:2px;margin-top:-3px}.table#add-file-table td#add-file-button{width:100px}.table#add-file-table td#add-file-button input[type=file]{position:absolute;top:0;right:0;min-width:100%;min-height:100%;opacity:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);outline:0;cursor:inherit;display:block}.timeline-canvas .timeline-insidelabel,.timeline-canvas .timeline-series,svg.graph .node{cursor:pointer}.table#add-file-table td#add-file-name{width:250px;-o-text-overflow:ellipsis;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.table#add-file-table td#add-file-status{width:100%}.table#add-file-table td#add-file-status span.btn-progress-bar{padding:0!important;width:100%;background-color:#f5f5f5;text-align:left}.table#add-file-table td#add-file-status span.btn-progress{padding:2px;font-size:10px}.table span.error-area{color:red}.table span.row-button{padding:1px 2px;margin:0;border:none!important}.table .small-label{text-transform:uppercase;font-size:13px;color:#999}span.icon-wrapper{width:1.2em;display:inline-block}.panel.panel-dashboard .huge{font-size:28px}.panel.panel-lg{font-size:16px}.panel.panel-lg .badge{font-size:14px}.navbar-secondary{overflow:auto}.navbar-main .navbar-title,.navbar-main .navbar-title-job,.navbar-main .panel-title,.navbar-main-additional .navbar-title,.navbar-main-additional .navbar-title-job,.navbar-main-additional .panel-title,.navbar-secondary .navbar-title,.navbar-secondary .navbar-title-job,.navbar-secondary .panel-title,.navbar-secondary-additional .navbar-title,.navbar-secondary-additional .navbar-title-job,.navbar-secondary-additional .panel-title,.panel.panel-multi .navbar-title,.panel.panel-multi .navbar-title-job,.panel.panel-multi .panel-title{float:left;font-size:18px;padding:12px 20px 13px 10px;color:#333;display:inline-block}.navbar-main .navbar-info,.navbar-main .panel-info,.navbar-main-additional .navbar-info,.navbar-main-additional .panel-info,.navbar-secondary .navbar-info,.navbar-secondary .panel-info,.navbar-secondary-additional .navbar-info,.navbar-secondary-additional .panel-info,.panel.panel-multi .navbar-info,.panel.panel-multi .panel-info{float:left;font-size:14px;padding:15px;color:#999;display:inline-block;border-right:1px solid #e7e7e7;overflow:hidden}.navbar-main .navbar-info .overflow,.navbar-main .panel-info .overflow,.navbar-main-additional .navbar-info .overflow,.navbar-main-additional .panel-info .overflow,.navbar-secondary .navbar-info .overflow,.navbar-secondary .panel-info .overflow,.navbar-secondary-additional .navbar-info .overflow,.navbar-secondary-additional .panel-info .overflow,.panel.panel-multi .navbar-info .overflow,.panel.panel-multi .panel-info .overflow{position:absolute;display:block;-o-text-overflow:ellipsis;text-overflow:ellipsis;overflow:hidden;height:22px;line-height:22px;vertical-align:middle}.navbar-main .navbar-info.first,.navbar-main .panel-info.first,.navbar-main-additional .navbar-info.first,.navbar-main-additional .panel-info.first,.navbar-secondary .navbar-info.first,.navbar-secondary .panel-info.first,.navbar-secondary-additional .navbar-info.first,.navbar-secondary-additional .panel-info.first,.panel.panel-multi .navbar-info.first,.panel.panel-multi .panel-info.first{border-left:1px solid #e7e7e7}.navbar-main .navbar-info.last,.navbar-main .panel-info.last,.navbar-main-additional .navbar-info.last,.navbar-main-additional .panel-info.last,.navbar-secondary .navbar-info.last,.navbar-secondary .panel-info.last,.navbar-secondary-additional .navbar-info.last,.navbar-secondary-additional .panel-info.last,.panel.panel-multi .navbar-info.last,.panel.panel-multi .panel-info.last{border-right:none}.panel.panel-multi .panel-heading{padding:0}.panel.panel-multi .panel-heading .panel-info.thin{padding:8px 10px}.panel.panel-multi .panel-body{padding:10px;background-color:#fdfdfd;color:#999;font-size:13px}.panel.panel-multi .panel-body.clean{color:inherit;font-size:inherit}.navbar-main-additional,.navbar-secondary-additional{min-height:40px;background-color:#fdfdfd}.navbar-main-additional .navbar-info,.navbar-secondary-additional .navbar-info{font-size:13px;padding:10px 15px}.nav-top-affix.affix{width:100%;top:50px;margin-left:-20px;padding-left:20px;margin-right:-20px;padding-right:20px;background-color:#fff;z-index:1}.badge-default[href]:focus,.badge-default[href]:hover{background-color:grey}.badge-primary{background-color:#428bca}.badge-primary[href]:focus,.badge-primary[href]:hover{background-color:#3071a9}.badge-success{background-color:#5cb85c}.badge-success[href]:focus,.badge-success[href]:hover{background-color:#449d44}.badge-info{background-color:#5bc0de}.badge-info[href]:focus,.badge-info[href]:hover{background-color:#31b0d5}.badge-warning{background-color:#f0ad4e}.badge-warning[href]:focus,.badge-warning[href]:hover{background-color:#ec971f}.badge-danger{background-color:#d9534f}.badge-danger[href]:focus,.badge-danger[href]:hover{background-color:#c9302c}.indicator{display:inline-block;margin-right:15px}.indicator.indicator-primary{color:#428bca}.indicator.indicator-success{color:#5cb85c}.indicator.indicator-info{color:#5bc0de}.indicator.indicator-warning{color:#f0ad4e}.indicator.indicator-danger{color:#d9534f}pre.exception{border:none;background-color:transparent;padding:0;margin:0}pre{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}.nav-tabs.tabs-vertical{position:absolute;left:0;top:0;border-bottom:none;z-index:100}.nav-tabs.tabs-vertical li{float:none;margin-bottom:0;margin-right:-1px}.nav-tabs.tabs-vertical li>a{margin-right:0;border-radius:0;border-bottom:none;border-left:2px solid transparent}.nav-tabs.tabs-vertical li.active>a,.nav-tabs.tabs-vertical li>a:focus,.nav-tabs.tabs-vertical li>a:hover{border-bottom:none;border-left:2px solid #000}.navbar-main .navbar-title,.navbar-main-additional .navbar-title,.navbar-secondary .navbar-title,.navbar-secondary-additional .navbar-title{padding:12px 20px 13px}.navbar-main .navbar-title-job{padding:8px 20px}.navbar-main .navbar-title-job .indicator-primary{padding:8px 0 0}.navbar-main .navbar-title-job .no-padding{padding:0}.navbar-main .navbar-title-job .no-margin{margin:0}.navbar-main .navbar-title-job .job-name{font-size:14px}.navbar-main .navbar-title-job .job-id{color:#999;font-size:11px}.checkpoint-overview a,svg.graph .node h4{color:#000}livechart{width:30%;height:30%;text-align:center}.canvas-wrapper{border:1px solid #ddd;position:relative;margin-bottom:20px;height:100%}.canvas-wrapper .main-canvas{height:100%;overflow:hidden}.canvas-wrapper .main-canvas .zoom-buttons{position:absolute;top:10px;right:10px}.label-group .label{display:inline-block;padding-left:.4em;padding-right:.4em;margin:0;border-right:1px solid #fff;border-radius:0}.label-group .label.label-black{background-color:#000}.navbar-info-button{padding:3px 4px;font-size:12px;font-family:inherit;margin-top:-2px}svg.graph .edge-label,svg.graph text{font-size:14px}.checkpoints-view{padding-top:1em}.subtask-details .blank{height:2em}.checkpoint-overview td span{padding-left:2em}svg.graph{overflow:hidden;height:100%;width:100%!important}svg.graph g.type-TK>rect{fill:#00ffd0}svg.graph text{font-weight:300}svg.graph .node>rect{stroke:#999;stroke-width:5px;fill:#fff;margin:0;padding:0}svg.graph .node[active]>rect{fill:#eee}svg.graph .node.node-mirror>rect{stroke:#a8a8a8}svg.graph .node.node-iteration>rect{stroke:#cd3333}svg.graph .node.node-source>rect{stroke:#4ce199}svg.graph .node.node-sink>rect{stroke:#e6ec8b}svg.graph .node.node-normal>rect{stroke:#3fb6d8}svg.graph .node h5{color:#999}svg.graph .edgeLabel rect{fill:#fff}svg.graph .edgePath path{stroke:#333;stroke-width:2px;fill:#333}svg.graph .label{color:#777;margin:0}svg.graph .node-label{display:block;margin:0;text-decoration:none}.timeline{overflow:hidden}.timeline-canvas{overflow:hidden;padding:10px}.timeline-canvas .bar-container{overflow:hidden}.timeline-canvas.secondary .timeline-insidelabel,.timeline-canvas.secondary .timeline-series{cursor:auto}#content .navbar-secondary-additional.navbar-secondary-additional-2 .add-metrics a,.show-pointer{cursor:pointer}.qtip-timeline-bar{font-size:14px;line-height:1.4}#content .navbar-secondary-additional.navbar-secondary-additional-2{margin:-10px -10px 10px;padding:0;border-bottom:1px solid #e4e4e4}#content .navbar-secondary-additional.navbar-secondary-additional-2 .navbar-info{padding-top:12px;padding-bottom:12px}#content .navbar-secondary-additional.navbar-secondary-additional-2 .add-metrics{margin-right:15px;float:right}#content .navbar-secondary-additional.navbar-secondary-additional-2 .add-metrics .btn{margin-top:5px;margin-bottom:5px}#content .navbar-secondary-additional.navbar-secondary-additional-2 .metric-menu{max-height:300px;max-width:900px;overflow-y:scroll;text-align:right}.metric-row{margin:0;min-height:275px;padding:0;list-style-type:none}.metric-row .metric-col{background-color:transparent;width:33.33%;float:left}.metric-row .metric-col.big{width:100%}.metric-row .metric-col .panel{margin-left:5px;margin-right:5px;min-height:265px;margin-bottom:10px}.metric-row .metric-col .panel .panel-body{background-color:transparent;height:265px;position:relative}.metric-row .metric-col .panel .panel-body .metric-numeric{text-align:center;margin-top:75px;font-size:40px;font-weight:700}.metric-row .metric-col .panel .panel-heading{padding:0 10px;background-color:transparent;height:41px;line-height:41px;position:relative;overflow:hidden;cursor:pointer}.metric-row .metric-col .panel .panel-heading .metric-title{padding:10px 0}.metric-row .metric-col .panel .panel-heading .buttons{position:absolute;top:0;right:0;padding:0 10px;background-color:#fff}.metric-row .metric-col.dndDraggingSource{display:none}.metric-row .dndPlaceholder{position:relative;background-color:#f0f0f0;min-height:305px;display:block;width:33.33%;float:left;margin-bottom:10px;border-radius:5px}.p-info{padding-left:5px;padding-right:5px}@media (min-width:1024px) and (max-width:1279px){#content #fold-button,#sidebar .navbar-static-top .navbar-brand-text{display:none}#sidebar{left:0;width:160px}#content{margin-left:160px}#content .navbar-main,#content .navbar-main-additional{left:160px}.table td.td-long{width:20%}}@media (min-width:1280px){#sidebar{left:0}#content{margin-left:250px}#content #fold-button{display:none}#content .navbar-main,#content .navbar-main-additional{left:250px}.table td.td-long{width:30%}}.legend-box{font-size:10px;width:2em}#total-mem{background-color:#7cb5ec}#heap-mem{background-color:#434348}#non-heap-mem{background-color:#90ed7d}#fetch-plan,#job-submit{width:100px}#content-inner,#details,#node-details{height:100%}#job-panel{overflow-y:auto} \ No newline at end of file diff --git a/flink-runtime-web/web-dashboard/web/js/hs/index.js b/flink-runtime-web/web-dashboard/web/js/hs/index.js index 148d9dd01f798d990e9413448e1f2222dcfa41a5..766120610c899f1fd761e627330412fe5a2963d7 100644 --- a/flink-runtime-web/web-dashboard/web/js/hs/index.js +++ b/flink-runtime-web/web-dashboard/web/js/hs/index.js @@ -1,2 +1,2 @@ -angular.module("flinkApp",["ui.router","angularMoment","dndLists"]).run(["$rootScope",function(e){return e.sidebarVisible=!1,e.showSidebar=function(){return e.sidebarVisible=!e.sidebarVisible,e.sidebarClass="force-show"}}]).value("flinkConfig",{jobServer:"","refresh-interval":1e4}).value("watermarksConfig",{noWatermark:-0x8000000000000000}).run(["JobsService","MainService","flinkConfig","$interval",function(e,t,r,n){return t.loadConfig().then(function(t){return angular.extend(r,t),e.listJobs(),n(function(){return e.listJobs()},r["refresh-interval"])})}]).config(["$uiViewScrollProvider",function(e){return e.useAnchorScroll()}]).run(["$rootScope","$state",function(e,t){return e.$on("$stateChangeStart",function(e,r,n,o){if(r.redirectTo)return e.preventDefault(),t.go(r.redirectTo,n)})}]).config(["$stateProvider","$urlRouterProvider",function(e,t){return e.state("completed-jobs",{url:"/completed-jobs",views:{main:{templateUrl:"partials/jobs/completed-jobs.html",controller:"CompletedJobsController"}}}).state("single-job",{url:"/jobs/{jobid}","abstract":!0,views:{main:{templateUrl:"partials/jobs/job.html",controller:"SingleJobController"}}}).state("single-job.plan",{url:"",redirectTo:"single-job.plan.subtasks",views:{details:{templateUrl:"partials/jobs/job.plan.html",controller:"JobPlanController"}}}).state("single-job.plan.subtasks",{url:"",views:{"node-details":{templateUrl:"partials/jobs/job.plan.node-list.subtasks.html",controller:"JobPlanSubtasksController"}}}).state("single-job.plan.metrics",{url:"/metrics",views:{"node-details":{templateUrl:"partials/jobs/job.plan.node-list.metrics.html",controller:"JobPlanMetricsController"}}}).state("single-job.plan.watermarks",{url:"/watermarks",views:{"node-details":{templateUrl:"partials/jobs/job.plan.node-list.watermarks.html"}}}).state("single-job.plan.taskmanagers",{url:"/taskmanagers",views:{"node-details":{templateUrl:"partials/jobs/job.plan.node-list.taskmanagers.html",controller:"JobPlanTaskManagersController"}}}).state("single-job.plan.accumulators",{url:"/accumulators",views:{"node-details":{templateUrl:"partials/jobs/job.plan.node-list.accumulators.html",controller:"JobPlanAccumulatorsController"}}}).state("single-job.plan.checkpoints",{url:"/checkpoints",redirectTo:"single-job.plan.checkpoints.overview",views:{"node-details":{templateUrl:"partials/jobs/job.plan.node-list.checkpoints.html",controller:"JobPlanCheckpointsController"}}}).state("single-job.plan.checkpoints.overview",{url:"/overview",views:{"checkpoints-view":{templateUrl:"partials/jobs/job.plan.node.checkpoints.overview.html",controller:"JobPlanCheckpointsController"}}}).state("single-job.plan.checkpoints.summary",{url:"/summary",views:{"checkpoints-view":{templateUrl:"partials/jobs/job.plan.node.checkpoints.summary.html",controller:"JobPlanCheckpointsController"}}}).state("single-job.plan.checkpoints.history",{url:"/history",views:{"checkpoints-view":{templateUrl:"partials/jobs/job.plan.node.checkpoints.history.html",controller:"JobPlanCheckpointsController"}}}).state("single-job.plan.checkpoints.config",{url:"/config",views:{"checkpoints-view":{templateUrl:"partials/jobs/job.plan.node.checkpoints.config.html",controller:"JobPlanCheckpointsController"}}}).state("single-job.plan.checkpoints.details",{url:"/details/{checkpointId}",views:{"checkpoints-view":{templateUrl:"partials/jobs/job.plan.node.checkpoints.details.html",controller:"JobPlanCheckpointDetailsController"}}}).state("single-job.plan.backpressure",{url:"/backpressure",views:{"node-details":{templateUrl:"partials/jobs/job.plan.node-list.backpressure.html",controller:"JobPlanBackPressureController"}}}).state("single-job.timeline",{url:"/timeline",views:{details:{templateUrl:"partials/jobs/job.timeline.html"}}}).state("single-job.timeline.vertex",{url:"/{vertexId}",views:{vertex:{templateUrl:"partials/jobs/job.timeline.vertex.html",controller:"JobTimelineVertexController"}}}).state("single-job.exceptions",{url:"/exceptions",views:{details:{templateUrl:"partials/jobs/job.exceptions.html",controller:"JobExceptionsController"}}}).state("single-job.config",{url:"/config",views:{details:{templateUrl:"partials/jobs/job.config.html"}}}),t.otherwise("/completed-jobs")}]),angular.module("flinkApp").directive("bsLabel",["JobsService",function(e){return{transclude:!0,replace:!0,scope:{getLabelClass:"&",status:"@"},template:"",link:function(t,r,n){return t.getLabelClass=function(){return"label label-"+e.translateLabelState(n.status)}}}}]).directive("bpLabel",["JobsService",function(e){return{transclude:!0,replace:!0,scope:{getBackPressureLabelClass:"&",status:"@"},template:"",link:function(t,r,n){return t.getBackPressureLabelClass=function(){return"label label-"+e.translateBackPressureLabelState(n.status)}}}}]).directive("indicatorPrimary",["JobsService",function(e){return{replace:!0,scope:{getLabelClass:"&",status:"@"},template:"",link:function(t,r,n){return t.getLabelClass=function(){return"fa fa-circle indicator indicator-"+e.translateLabelState(n.status)}}}}]).directive("tableProperty",function(){return{replace:!0,scope:{value:"="},template:"{{value || 'None'}}"}}),angular.module("flinkApp").filter("amDurationFormatExtended",["angularMomentConfig",function(e){var t;return t=function(e,t,r){return"undefined"==typeof e||null===e?"":moment.duration(e,t).format(r,{trim:!1})},t.$stateful=e.statefulFilters,t}]).filter("humanizeDuration",function(){return function(e,t){var r,n,o,i,s,a;return"undefined"==typeof e||null===e?"":(i=e%1e3,a=Math.floor(e/1e3),s=a%60,a=Math.floor(a/60),o=a%60,a=Math.floor(a/60),n=a%24,a=Math.floor(a/24),r=a,0===r?0===n?0===o?0===s?i+"ms":s+"s ":o+"m "+s+"s":t?n+"h "+o+"m":n+"h "+o+"m "+s+"s":t?r+"d "+n+"h":r+"d "+n+"h "+o+"m "+s+"s")}}).filter("limit",function(){return function(e){return e.length>73&&(e=e.substring(0,35)+"..."+e.substring(e.length-35,e.length)),e}}).filter("humanizeText",function(){return function(e){return e?e.replace(/>/g,">").replace(//g,""):""}}).filter("humanizeBytes",function(){return function(e){var t,r;return r=["B","KB","MB","GB","TB","PB","EB"],t=function(e,n){var o;return o=Math.pow(1024,n),e=r;n=0<=r?++e:--e)o.push(n+".currentLowWatermark");return o}(),o.getMetrics(i,t.id,s).then(function(e){var t,n,o,i,s,a,l;o=NaN,l={},i=e.values;for(t in i)a=i[t],s=t.replace(".currentLowWatermark",""),l[s]=a,(isNaN(o)||au.noWatermark?o:NaN,r.resolve({lowWatermark:n,watermarks:l})}),r.promise}}(this),r=l.defer(),s={},n=t.length,angular.forEach(t,function(e){return function(e,t){var o;return o=e.id,i(e).then(function(e){if(s[o]=e,t>=n-1)return r.resolve(s)})}}(this)),r.promise},e.hasWatermark=function(t){return e.watermarks[t]&&!isNaN(e.watermarks[t].lowWatermark)},e.$watch("plan",function(t){if(t)return c(t.nodes).then(function(t){return e.watermarks=t})}),e.$on("reload",function(){if(e.plan)return c(e.plan.nodes).then(function(t){return e.watermarks=t})})}]).controller("JobPlanController",["$scope","$state","$stateParams","$window","JobsService",function(e,t,r,n,o){return e.nodeid=null,e.nodeUnfolded=!1,e.stateList=o.stateList(),e.changeNode=function(t){return t!==e.nodeid?(e.nodeid=t,e.vertex=null,e.subtasks=null,e.accumulators=null,e.operatorCheckpointStats=null,e.$broadcast("reload"),e.$broadcast("node:change",e.nodeid)):(e.nodeid=null,e.nodeUnfolded=!1,e.vertex=null,e.subtasks=null,e.accumulators=null,e.operatorCheckpointStats=null)},e.deactivateNode=function(){return e.nodeid=null,e.nodeUnfolded=!1,e.vertex=null,e.subtasks=null,e.accumulators=null,e.operatorCheckpointStats=null},e.toggleFold=function(){return e.nodeUnfolded=!e.nodeUnfolded}}]).controller("JobPlanSubtasksController",["$scope","JobsService",function(e,t){var r;return r=function(){return t.getSubtasks(e.nodeid).then(function(t){return e.subtasks=t})},!e.nodeid||e.vertex&&e.vertex.st||r(),e.$on("reload",function(t){if(e.nodeid)return r()})}]).controller("JobPlanTaskManagersController",["$scope","JobsService",function(e,t){var r;return r=function(){return t.getTaskManagers(e.nodeid).then(function(t){return e.taskmanagers=t})},!e.nodeid||e.vertex&&e.vertex.st||r(),e.$on("reload",function(t){if(e.nodeid)return r()})}]).controller("JobPlanAccumulatorsController",["$scope","JobsService",function(e,t){var r;return r=function(){return t.getAccumulators(e.nodeid).then(function(t){return e.accumulators=t.main,e.subtaskAccumulators=t.subtasks})},!e.nodeid||e.vertex&&e.vertex.accumulators||r(),e.$on("reload",function(t){if(e.nodeid)return r()})}]).controller("JobPlanCheckpointsController",["$scope","$state","$stateParams","JobsService",function(e,t,r,n){var o;return e.checkpointDetails={},e.checkpointDetails.id=-1,n.getCheckpointConfig().then(function(t){return e.checkpointConfig=t}),o=function(){return n.getCheckpointStats().then(function(t){if(null!==t)return e.checkpointStats=t})},o(),e.$on("reload",function(e){return o()})}]).controller("JobPlanCheckpointDetailsController",["$scope","$state","$stateParams","JobsService",function(e,t,r,n){var o,i;return e.subtaskDetails={},e.checkpointDetails.id=r.checkpointId,o=function(t){return n.getCheckpointDetails(t).then(function(t){return null!==t?e.checkpoint=t:e.unknown_checkpoint=!0})},i=function(t,r){return n.getCheckpointSubtaskDetails(t,r).then(function(t){if(null!==t)return e.subtaskDetails[r]=t})},o(r.checkpointId),e.nodeid&&i(r.checkpointId,e.nodeid),e.$on("reload",function(t){if(o(r.checkpointId),e.nodeid)return i(r.checkpointId,e.nodeid)}),e.$on("$destroy",function(){return e.checkpointDetails.id=-1})}]).controller("JobPlanBackPressureController",["$scope","JobsService",function(e,t){var r;return r=function(){if(e.now=Date.now(),e.nodeid)return t.getOperatorBackPressure(e.nodeid).then(function(t){return e.backPressureOperatorStats[e.nodeid]=t})},r(),e.$on("reload",function(e){return r()})}]).controller("JobTimelineVertexController",["$scope","$state","$stateParams","JobsService",function(e,t,r,n){var o;return o=function(){return n.getVertex(r.vertexId).then(function(t){return e.vertex=t})},o(),e.$on("reload",function(e){return o()})}]).controller("JobExceptionsController",["$scope","$state","$stateParams","JobsService",function(e,t,r,n){return n.loadExceptions().then(function(t){return e.exceptions=t})}]).controller("JobPropertiesController",["$scope","JobsService",function(e,t){return e.changeNode=function(r){return r!==e.nodeid?(e.nodeid=r,t.getNode(r).then(function(t){return e.node=t})):(e.nodeid=null,e.node=null)}}]).controller("JobPlanMetricsController",["$scope","JobsService","MetricsService",function(e,t,r){var n;if(e.dragging=!1,e.window=r.getWindow(),e.availableMetrics=null,e.$on("$destroy",function(){return r.unRegisterObserver()}),n=function(){return t.getVertex(e.nodeid).then(function(t){return e.vertex=t}),r.getAvailableMetrics(e.jobid,e.nodeid).then(function(t){return e.availableMetrics=t,e.metrics=r.getMetricsSetup(e.jobid,e.nodeid).names,r.registerObserver(e.jobid,e.nodeid,function(t){return e.$broadcast("metrics:data:update",t.timestamp,t.values)})})},e.dropped=function(t,o,i,s,a){return r.orderMetrics(e.jobid,e.nodeid,i,o),e.$broadcast("metrics:refresh",i),n(),!1},e.dragStart=function(){return e.dragging=!0},e.dragEnd=function(){return e.dragging=!1},e.addMetric=function(t){return r.addMetric(e.jobid,e.nodeid,t.id),n()},e.removeMetric=function(t){return r.removeMetric(e.jobid,e.nodeid,t),n()},e.setMetricSize=function(t,o){return r.setMetricSize(e.jobid,e.nodeid,t,o),n()},e.getValues=function(t){return r.getValues(e.jobid,e.nodeid,t)},e.$on("node:change",function(t,r){if(!e.dragging)return n()}),e.nodeid)return n()}]),angular.module("flinkApp").directive("vertex",["$state",function(e){return{template:"",scope:{data:"="},link:function(e,t,r){var n,o,i;i=t.children()[0],o=t.width(),angular.element(i).attr("width",o),(n=function(e){var t,r,n;return d3.select(i).selectAll("*").remove(),n=[],angular.forEach(e.subtasks,function(e,t){var r;return r=[{label:"Scheduled",color:"#666",borderColor:"#555",starting_time:e.timestamps.SCHEDULED,ending_time:e.timestamps.DEPLOYING,type:"regular"},{label:"Deploying",color:"#aaa",borderColor:"#555",starting_time:e.timestamps.DEPLOYING,ending_time:e.timestamps.RUNNING,type:"regular"}],e.timestamps.FINISHED>0&&r.push({label:"Running",color:"#ddd",borderColor:"#555",starting_time:e.timestamps.RUNNING,ending_time:e.timestamps.FINISHED,type:"regular"}),n.push({label:"("+e.subtask+") "+e.host,times:r})}),t=d3.timeline().stack().tickFormat({format:d3.time.format("%L"),tickSize:1}).prefix("single").labelFormat(function(e){return e}).margin({left:100,right:0,top:0,bottom:0}).itemHeight(30).relativeTime(),r=d3.select(i).datum(n).call(t)})(e.data)}}}]).directive("timeline",["$state",function(e){return{template:"",scope:{vertices:"=",jobid:"="},link:function(t,r,n){var o,i,s,a;s=r.children()[0],i=r.width(),angular.element(s).attr("width",i),a=function(e){return e.replace(">",">")},o=function(r){var n,o,i;return d3.select(s).selectAll("*").remove(),i=[],angular.forEach(r,function(e){if(e["start-time"]>-1)return"scheduled"===e.type?i.push({times:[{label:a(e.name),color:"#cccccc",borderColor:"#555555",starting_time:e["start-time"],ending_time:e["end-time"],type:e.type}]}):i.push({times:[{label:a(e.name),color:"#d9f1f7",borderColor:"#62cdea",starting_time:e["start-time"],ending_time:e["end-time"],link:e.id,type:e.type}]})}),n=d3.timeline().stack().click(function(r,n,o){if(r.link)return e.go("single-job.timeline.vertex",{jobid:t.jobid,vertexId:r.link})}).tickFormat({format:d3.time.format("%L"),tickSize:1}).prefix("main").margin({left:0,right:0,top:0,bottom:0}).itemHeight(30).showBorderLine().showHourTimeline(),o=d3.select(s).datum(i).call(n)},t.$watch(n.vertices,function(e){if(e)return o(e)})}}}]).directive("split",function(){return{compile:function(e,t){return Split(e.children(),{sizes:[50,50],direction:"vertical"})}}}).directive("jobPlan",["$timeout",function(e){return{template:"
",scope:{plan:"=",watermarks:"=",setNode:"&"},link:function(e,t,r){var n,o,i,s,a,l,u,c,d,f,p,g,m,h,b,v,k,j,S,w,C,$,J,M,y;p=null,C=d3.behavior.zoom(),y=[],h=r.jobid,S=t.children()[0],j=t.children().children()[0],w=t.children()[1],l=d3.select(S),u=d3.select(j),c=d3.select(w),n=t.width(),angular.element(t.children()[0]).width(n),v=0,b=0,e.zoomIn=function(){var e,t,r;if(C.scale()<2.99)return e=C.translate(),t=e[0]*(C.scale()+.1/C.scale()),r=e[1]*(C.scale()+.1/C.scale()),C.scale(C.scale()+.1),C.translate([t,r]),u.attr("transform","translate("+t+","+r+") scale("+C.scale()+")"),v=C.scale(),b=C.translate()},e.zoomOut=function(){var e,t,r;if(C.scale()>.31)return C.scale(C.scale()-.1),e=C.translate(),t=e[0]*(C.scale()-.1/C.scale()),r=e[1]*(C.scale()-.1/C.scale()),C.translate([t,r]),u.attr("transform","translate("+t+","+r+") scale("+C.scale()+")"),v=C.scale(),b=C.translate()},i=function(e){var t;return t="",null==e.ship_strategy&&null==e.local_strategy||(t+="
",null!=e.ship_strategy&&(t+=e.ship_strategy),void 0!==e.temp_mode&&(t+=" ("+e.temp_mode+")"),void 0!==e.local_strategy&&(t+=",
"+e.local_strategy),t+="
"),t},m=function(e){return"partialSolution"===e||"nextPartialSolution"===e||"workset"===e||"nextWorkset"===e||"solutionSet"===e||"solutionDelta"===e},g=function(e,t){return"mirror"===t?"node-mirror":m(t)?"node-iteration":"node-normal"},s=function(e,t,r,n){var o,i;return o="
",o+="mirror"===t?"

Mirror of "+e.operator+"

":"

"+e.operator+"

",""===e.description?o+="":(i=e.description,i=M(i),o+="

"+i+"

"),null!=e.step_function?o+=f(e.id,r,n):(m(t)&&(o+="
"+t+" Node
"),""!==e.parallelism&&(o+="
Parallelism: "+e.parallelism+"
"),void 0!==e.lowWatermark&&(o+="
Low Watermark: "+e.lowWatermark+"
"),void 0!==e.operator&&e.operator_strategy&&(o+="
Operation: "+M(e.operator_strategy)+"
")),o+="
"},f=function(e,t,r){var n,o;return o="svg-"+e,n=""},M=function(e){var t;for("<"===e.charAt(0)&&(e=e.replace("<","<"),e=e.replace(">",">")),t="";e.length>30;)t=t+e.substring(0,30)+"
",e=e.substring(30,e.length);return t+=e},a=function(e,t,r,n,o,i){return null==n&&(n=!1),r.id===t.partial_solution?e.setNode(r.id,{label:s(r,"partialSolution",o,i),labelType:"html","class":g(r,"partialSolution")}):r.id===t.next_partial_solution?e.setNode(r.id,{label:s(r,"nextPartialSolution",o,i),labelType:"html","class":g(r,"nextPartialSolution")}):r.id===t.workset?e.setNode(r.id,{label:s(r,"workset",o,i),labelType:"html","class":g(r,"workset")}):r.id===t.next_workset?e.setNode(r.id,{label:s(r,"nextWorkset",o,i),labelType:"html","class":g(r,"nextWorkset")}):r.id===t.solution_set?e.setNode(r.id,{label:s(r,"solutionSet",o,i),labelType:"html","class":g(r,"solutionSet")}):r.id===t.solution_delta?e.setNode(r.id,{label:s(r,"solutionDelta",o,i),labelType:"html","class":g(r,"solutionDelta")}):e.setNode(r.id,{label:s(r,"",o,i),labelType:"html","class":g(r,"")})},o=function(e,t,r,n,o){return e.setEdge(o.id,r.id,{label:i(o),labelType:"html",arrowhead:"normal"})},k=function(e,t){var r,n,i,s,l,u,d,f,p,g,m,h,b,v;for(n=[],null!=t.nodes?v=t.nodes:(v=t.step_function,i=!0),s=0,u=v.length;s-1))return e["end-time"]=e["start-time"]+e.duration})},this.processVertices=function(e){return angular.forEach(e.vertices,function(e,t){return e.type="regular"}),e.vertices.unshift({name:"Scheduled","start-time":e.timestamps.CREATED,"end-time":e.timestamps.CREATED+1,type:"scheduled"})},this.listJobs=function(){var r;return r=o.defer(),e.get(t.jobServer+"joboverview").success(function(e){return function(t,n,o,i){return angular.forEach(t,function(t,r){switch(r){case"running":return c.running=e.setEndTimes(t);case"finished":return c.finished=e.setEndTimes(t);case"cancelled":return c.cancelled=e.setEndTimes(t);case"failed":return c.failed=e.setEndTimes(t)}}),r.resolve(c),d()}}(this)),r.promise},this.getJobs=function(e){return c[e]},this.getAllJobs=function(){return c},this.loadJob=function(r){return s=null,l.job=o.defer(),e.get(t.jobServer+"jobs/"+r).success(function(n){return function(o,i,a,u){return n.setEndTimes(o.vertices),n.processVertices(o),e.get(t.jobServer+"jobs/"+r+"/config").success(function(e){return o=angular.extend(o,e),s=o,l.job.resolve(s)})}}(this)),l.job.promise},this.getNode=function(e){var t,r;return r=function(e,t){var n,o,i,s;for(n=0,o=t.length;n
{{metric.id}}
',replace:!0,scope:{metric:"=",window:"=",removeMetric:"&",setMetricSize:"=",getValues:"&"},link:function(e,t,r){return e.btnClasses=["btn","btn-default","btn-xs"],e.value=null,e.data=[{values:e.getValues()}],e.options={x:function(e,t){return e.x},y:function(e,t){return e.y},xTickFormat:function(e){return d3.time.format("%H:%M:%S")(new Date(e))},yTickFormat:function(e){var t,r,n,o;for(r=!1,n=0,o=1,t=Math.abs(e);!r&&n<50;)Math.pow(10,n)<=t&&t6?e/Math.pow(10,n)+"E"+n:""+e}},e.showChart=function(){return d3.select(t.find("svg")[0]).datum(e.data).transition().duration(250).call(e.chart)},e.chart=nv.models.lineChart().options(e.options).showLegend(!1).margin({top:15,left:60,bottom:30,right:30}),e.chart.yAxis.showMaxMin(!1),e.chart.tooltip.hideDelay(0), -e.chart.tooltip.contentGenerator(function(e){return"

"+d3.time.format("%H:%M:%S")(new Date(e.point.x))+" | "+e.point.y+"

"}),nv.utils.windowResize(e.chart.update),e.setSize=function(t){return e.setMetricSize(e.metric,t)},e.showChart(),e.$on("metrics:data:update",function(t,r,n){return e.value=parseFloat(n[e.metric.id]),e.data[0].values.push({x:r,y:e.value}),e.data[0].values.length>e.window&&e.data[0].values.shift(),e.showChart(),e.chart.clearHighlights(),e.chart.tooltip.hidden(!0)}),t.find(".metric-title").qtip({content:{text:e.metric.id},position:{my:"bottom left",at:"top left"},style:{classes:"qtip-light qtip-timeline-bar"}})}}}),angular.module("flinkApp").service("MetricsService",["$http","$q","flinkConfig","$interval",function(e,t,r,n){return this.metrics={},this.values={},this.watched={},this.observer={jobid:null,nodeid:null,callback:null},this.refresh=n(function(e){return function(){return angular.forEach(e.metrics,function(t,r){return angular.forEach(t,function(t,n){var o;if(o=[],angular.forEach(t,function(e,t){return o.push(e.id)}),o.length>0)return e.getMetrics(r,n,o).then(function(t){if(r===e.observer.jobid&&n===e.observer.nodeid&&e.observer.callback)return e.observer.callback(t)})})})}}(this),r["refresh-interval"]),this.registerObserver=function(e,t,r){return this.observer.jobid=e,this.observer.nodeid=t,this.observer.callback=r},this.unRegisterObserver=function(){return this.observer={jobid:null,nodeid:null,callback:null}},this.setupMetrics=function(e,t){return this.setupLS(),this.watched[e]=[],angular.forEach(t,function(t){return function(r,n){if(r.id)return t.watched[e].push(r.id)}}(this))},this.getWindow=function(){return 100},this.setupLS=function(){return null==sessionStorage.flinkMetrics&&this.saveSetup(),this.metrics=JSON.parse(sessionStorage.flinkMetrics)},this.saveSetup=function(){return sessionStorage.flinkMetrics=JSON.stringify(this.metrics)},this.saveValue=function(e,t,r){if(null==this.values[e]&&(this.values[e]={}),null==this.values[e][t]&&(this.values[e][t]=[]),this.values[e][t].push(r),this.values[e][t].length>this.getWindow())return this.values[e][t].shift()},this.getValues=function(e,t,r){var n;return null==this.values[e]?[]:null==this.values[e][t]?[]:(n=[],angular.forEach(this.values[e][t],function(e){return function(e,t){if(null!=e.values[r])return n.push({x:e.timestamp,y:e.values[r]})}}(this)),n)},this.setupLSFor=function(e,t){if(null==this.metrics[e]&&(this.metrics[e]={}),null==this.metrics[e][t])return this.metrics[e][t]=[]},this.addMetric=function(e,t,r){return this.setupLSFor(e,t),this.metrics[e][t].push({id:r,size:"small"}),this.saveSetup()},this.removeMetric=function(e){return function(t,r,n){var o;if(null!=e.metrics[t][r])return o=e.metrics[t][r].indexOf(n),o===-1&&(o=_.findIndex(e.metrics[t][r],{id:n})),o!==-1&&e.metrics[t][r].splice(o,1),e.saveSetup()}}(this),this.setMetricSize=function(e){return function(t,r,n,o){var i;if(null!=e.metrics[t][r])return i=e.metrics[t][r].indexOf(n.id),i===-1&&(i=_.findIndex(e.metrics[t][r],{id:n.id})),i!==-1&&(e.metrics[t][r][i]={id:n.id,size:o}),e.saveSetup()}}(this),this.orderMetrics=function(e,t,r,n){return this.setupLSFor(e,t),angular.forEach(this.metrics[e][t],function(o){return function(i,s){if(i.id===r.id&&(o.metrics[e][t].splice(s,1),s",link:function(t,r,n){return t.getLabelClass=function(){return"label label-"+e.translateLabelState(n.status)}}}}]).directive("bpLabel",["JobsService",function(e){return{transclude:!0,replace:!0,scope:{getBackPressureLabelClass:"&",status:"@"},template:"",link:function(t,r,n){return t.getBackPressureLabelClass=function(){return"label label-"+e.translateBackPressureLabelState(n.status)}}}}]).directive("indicatorPrimary",["JobsService",function(e){return{replace:!0,scope:{getLabelClass:"&",status:"@"},template:"",link:function(t,r,n){return t.getLabelClass=function(){return"fa fa-circle indicator indicator-"+e.translateLabelState(n.status)}}}}]).directive("tableProperty",function(){return{replace:!0,scope:{value:"="},template:"{{value || 'None'}}"}}),angular.module("flinkApp").filter("amDurationFormatExtended",["angularMomentConfig",function(e){var t;return t=function(e,t,r){return"undefined"==typeof e||null===e?"":moment.duration(e,t).format(r,{trim:!1})},t.$stateful=e.statefulFilters,t}]).filter("humanizeDuration",function(){return function(e,t){var r,n,i,o,s,a;return"undefined"==typeof e||null===e?"":(o=e%1e3,a=Math.floor(e/1e3),s=a%60,a=Math.floor(a/60),i=a%60,a=Math.floor(a/60),n=a%24,a=Math.floor(a/24),r=a,0===r?0===n?0===i?0===s?o+"ms":s+"s ":i+"m "+s+"s":t?n+"h "+i+"m":n+"h "+i+"m "+s+"s":t?r+"d "+n+"h":r+"d "+n+"h "+i+"m "+s+"s")}}).filter("limit",function(){return function(e){return e.length>73&&(e=e.substring(0,35)+"..."+e.substring(e.length-35,e.length)),e}}).filter("humanizeText",function(){return function(e){return e?e.replace(/>/g,">").replace(//g,""):""}}).filter("humanizeBytes",function(){return function(e){var t,r;return r=["B","KB","MB","GB","TB","PB","EB"],t=function(e,n){var i;return i=Math.pow(1024,n),e=r;n=0<=r?++e:--e)i.push(n+".currentLowWatermark");return i}(),i.getMetrics(o,t.id,s).then(function(e){var t,n,i,o,s,a,l;i=NaN,l={},o=e.values;for(t in o)a=o[t],s=t.replace(".currentLowWatermark",""),l[s]=a,(isNaN(i)||au.noWatermark?i:NaN,r.resolve({lowWatermark:n,watermarks:l})}),r.promise}}(this),r=l.defer(),s={},n=t.length,angular.forEach(t,function(e){return function(e,t){var i;return i=e.id,o(e).then(function(e){if(s[i]=e,t>=n-1)return r.resolve(s)})}}(this)),r.promise},e.hasWatermark=function(t){return e.watermarks[t]&&!isNaN(e.watermarks[t].lowWatermark)},e.$watch("plan",function(t){if(t)return c(t.nodes).then(function(t){return e.watermarks=t})}),e.$on("reload",function(){if(e.plan)return c(e.plan.nodes).then(function(t){return e.watermarks=t})})}]).controller("JobPlanController",["$scope","$state","$stateParams","$window","JobsService",function(e,t,r,n,i){return e.nodeid=null,e.nodeUnfolded=!1,e.stateList=i.stateList(),e.changeNode=function(t){return t!==e.nodeid?(e.nodeid=t,e.vertex=null,e.subtasks=null,e.accumulators=null,e.operatorCheckpointStats=null,e.$broadcast("reload"),e.$broadcast("node:change",e.nodeid)):(e.nodeid=null,e.nodeUnfolded=!1,e.vertex=null,e.subtasks=null,e.accumulators=null,e.operatorCheckpointStats=null)},e.deactivateNode=function(){return e.nodeid=null,e.nodeUnfolded=!1,e.vertex=null,e.subtasks=null,e.accumulators=null,e.operatorCheckpointStats=null},e.toggleFold=function(){return e.nodeUnfolded=!e.nodeUnfolded}}]).controller("JobPlanSubtasksController",["$scope","JobsService",function(e,t){var r;return r=function(){return t.getSubtasks(e.nodeid).then(function(t){return e.subtasks=t})},!e.nodeid||e.vertex&&e.vertex.st||r(),e.$on("reload",function(t){if(e.nodeid)return r()})}]).controller("JobPlanTaskManagersController",["$scope","JobsService",function(e,t){var r;return r=function(){return t.getTaskManagers(e.nodeid).then(function(t){return e.taskmanagers=t})},!e.nodeid||e.vertex&&e.vertex.st||r(),e.$on("reload",function(t){if(e.nodeid)return r()})}]).controller("JobPlanAccumulatorsController",["$scope","JobsService",function(e,t){var r;return r=function(){return t.getAccumulators(e.nodeid).then(function(t){return e.accumulators=t.main,e.subtaskAccumulators=t.subtasks})},!e.nodeid||e.vertex&&e.vertex.accumulators||r(),e.$on("reload",function(t){if(e.nodeid)return r()})}]).controller("JobPlanCheckpointsController",["$scope","$state","$stateParams","JobsService",function(e,t,r,n){var i;return e.checkpointDetails={},e.checkpointDetails.id=-1,n.getCheckpointConfig().then(function(t){return e.checkpointConfig=t}),i=function(){return n.getCheckpointStats().then(function(t){if(null!==t)return e.checkpointStats=t})},i(),e.$on("reload",function(e){return i()})}]).controller("JobPlanCheckpointDetailsController",["$scope","$state","$stateParams","JobsService",function(e,t,r,n){var i,o;return e.subtaskDetails={},e.checkpointDetails.id=r.checkpointId,i=function(t){return n.getCheckpointDetails(t).then(function(t){return null!==t?e.checkpoint=t:e.unknown_checkpoint=!0})},o=function(t,r){return n.getCheckpointSubtaskDetails(t,r).then(function(t){if(null!==t)return e.subtaskDetails[r]=t})},i(r.checkpointId),e.nodeid&&o(r.checkpointId,e.nodeid),e.$on("reload",function(t){if(i(r.checkpointId),e.nodeid)return o(r.checkpointId,e.nodeid)}),e.$on("$destroy",function(){return e.checkpointDetails.id=-1})}]).controller("JobPlanBackPressureController",["$scope","JobsService",function(e,t){var r;return r=function(){if(e.now=Date.now(),e.nodeid)return t.getOperatorBackPressure(e.nodeid).then(function(t){return e.backPressureOperatorStats[e.nodeid]=t})},r(),e.$on("reload",function(e){return r()})}]).controller("JobTimelineVertexController",["$scope","$state","$stateParams","JobsService",function(e,t,r,n){var i;return i=function(){return n.getVertex(r.vertexId).then(function(t){return e.vertex=t})},i(),e.$on("reload",function(e){return i()})}]).controller("JobExceptionsController",["$scope","$state","$stateParams","JobsService",function(e,t,r,n){return n.loadExceptions().then(function(t){return e.exceptions=t})}]).controller("JobPropertiesController",["$scope","JobsService",function(e,t){return e.changeNode=function(r){return r!==e.nodeid?(e.nodeid=r,t.getNode(r).then(function(t){return e.node=t})):(e.nodeid=null,e.node=null)}}]).controller("JobPlanMetricsController",["$scope","JobsService","MetricsService",function(e,t,r){var n;if(e.dragging=!1,e.window=r.getWindow(),e.availableMetrics=null,e.$on("$destroy",function(){return r.unRegisterObserver()}),n=function(){return t.getVertex(e.nodeid).then(function(t){return e.vertex=t}),r.getAvailableMetrics(e.jobid,e.nodeid).then(function(t){return e.availableMetrics=t,e.metrics=r.getMetricsSetup(e.jobid,e.nodeid).names,r.registerObserver(e.jobid,e.nodeid,function(t){return e.$broadcast("metrics:data:update",t.timestamp,t.values)})})},e.dropped=function(t,i,o,s,a){return r.orderMetrics(e.jobid,e.nodeid,o,i),e.$broadcast("metrics:refresh",o),n(),!1},e.dragStart=function(){return e.dragging=!0},e.dragEnd=function(){return e.dragging=!1},e.addMetric=function(t){return r.addMetric(e.jobid,e.nodeid,t.id),n()},e.removeMetric=function(t){return r.removeMetric(e.jobid,e.nodeid,t),n()},e.setMetricSize=function(t,i){return r.setMetricSize(e.jobid,e.nodeid,t,i),n()},e.setMetricView=function(t,i){return r.setMetricView(e.jobid,e.nodeid,t,i),n()},e.getValues=function(t){return r.getValues(e.jobid,e.nodeid,t)},e.$on("node:change",function(t,r){if(!e.dragging)return n()}),e.nodeid)return n()}]),angular.module("flinkApp").directive("vertex",["$state",function(e){return{template:"",scope:{data:"="},link:function(e,t,r){var n,i,o;o=t.children()[0],i=t.width(),angular.element(o).attr("width",i),(n=function(e){var t,r,n;return d3.select(o).selectAll("*").remove(),n=[],angular.forEach(e.subtasks,function(e,t){var r;return r=[{label:"Scheduled",color:"#666",borderColor:"#555",starting_time:e.timestamps.SCHEDULED,ending_time:e.timestamps.DEPLOYING,type:"regular"},{label:"Deploying",color:"#aaa",borderColor:"#555",starting_time:e.timestamps.DEPLOYING,ending_time:e.timestamps.RUNNING,type:"regular"}],e.timestamps.FINISHED>0&&r.push({label:"Running",color:"#ddd",borderColor:"#555",starting_time:e.timestamps.RUNNING,ending_time:e.timestamps.FINISHED,type:"regular"}),n.push({label:"("+e.subtask+") "+e.host,times:r})}),t=d3.timeline().stack().tickFormat({format:d3.time.format("%L"),tickSize:1}).prefix("single").labelFormat(function(e){return e}).margin({left:100,right:0,top:0,bottom:0}).itemHeight(30).relativeTime(),r=d3.select(o).datum(n).call(t)})(e.data)}}}]).directive("timeline",["$state",function(e){return{template:"",scope:{vertices:"=",jobid:"="},link:function(t,r,n){var i,o,s,a;s=r.children()[0],o=r.width(),angular.element(s).attr("width",o),a=function(e){return e.replace(">",">")},i=function(r){var n,i,o;return d3.select(s).selectAll("*").remove(),o=[],angular.forEach(r,function(e){if(e["start-time"]>-1)return"scheduled"===e.type?o.push({times:[{label:a(e.name),color:"#cccccc",borderColor:"#555555",starting_time:e["start-time"],ending_time:e["end-time"],type:e.type}]}):o.push({times:[{label:a(e.name),color:"#d9f1f7",borderColor:"#62cdea",starting_time:e["start-time"],ending_time:e["end-time"],link:e.id,type:e.type}]})}),n=d3.timeline().stack().click(function(r,n,i){if(r.link)return e.go("single-job.timeline.vertex",{jobid:t.jobid,vertexId:r.link})}).tickFormat({format:d3.time.format("%L"),tickSize:1}).prefix("main").margin({left:0,right:0,top:0,bottom:0}).itemHeight(30).showBorderLine().showHourTimeline(),i=d3.select(s).datum(o).call(n)},t.$watch(n.vertices,function(e){if(e)return i(e)})}}}]).directive("split",function(){return{compile:function(e,t){return Split(e.children(),{sizes:[50,50],direction:"vertical"})}}}).directive("jobPlan",["$timeout",function(e){return{template:"
",scope:{plan:"=",watermarks:"=",setNode:"&"},link:function(e,t,r){var n,i,o,s,a,l,u,c,d,f,p,m,h,g,b,v,k,j,S,w,C,$,y,J,M;p=null,C=d3.behavior.zoom(),M=[],g=r.jobid,S=t.children()[0],j=t.children().children()[0],w=t.children()[1],l=d3.select(S),u=d3.select(j),c=d3.select(w),n=t.width(),angular.element(t.children()[0]).width(n),v=0,b=0,e.zoomIn=function(){var e,t,r;if(C.scale()<2.99)return e=C.translate(),t=e[0]*(C.scale()+.1/C.scale()),r=e[1]*(C.scale()+.1/C.scale()),C.scale(C.scale()+.1),C.translate([t,r]),u.attr("transform","translate("+t+","+r+") scale("+C.scale()+")"),v=C.scale(),b=C.translate()},e.zoomOut=function(){var e,t,r;if(C.scale()>.31)return C.scale(C.scale()-.1),e=C.translate(),t=e[0]*(C.scale()-.1/C.scale()),r=e[1]*(C.scale()-.1/C.scale()),C.translate([t,r]),u.attr("transform","translate("+t+","+r+") scale("+C.scale()+")"),v=C.scale(),b=C.translate()},o=function(e){var t;return t="",null==e.ship_strategy&&null==e.local_strategy||(t+="
",null!=e.ship_strategy&&(t+=e.ship_strategy),void 0!==e.temp_mode&&(t+=" ("+e.temp_mode+")"),void 0!==e.local_strategy&&(t+=",
"+e.local_strategy),t+="
"),t},h=function(e){return"partialSolution"===e||"nextPartialSolution"===e||"workset"===e||"nextWorkset"===e||"solutionSet"===e||"solutionDelta"===e},m=function(e,t){return"mirror"===t?"node-mirror":h(t)?"node-iteration":"node-normal"},s=function(e,t,r,n){var i,o;return i="
",i+="mirror"===t?"

Mirror of "+e.operator+"

":"

"+e.operator+"

",""===e.description?i+="":(o=e.description,o=J(o),i+="

"+o+"

"),null!=e.step_function?i+=f(e.id,r,n):(h(t)&&(i+="
"+t+" Node
"),""!==e.parallelism&&(i+="
Parallelism: "+e.parallelism+"
"),void 0!==e.lowWatermark&&(i+="
Low Watermark: "+e.lowWatermark+"
"),void 0!==e.operator&&e.operator_strategy&&(i+="
Operation: "+J(e.operator_strategy)+"
")),i+="
"},f=function(e,t,r){var n,i;return i="svg-"+e,n=""},J=function(e){var t;for("<"===e.charAt(0)&&(e=e.replace("<","<"),e=e.replace(">",">")),t="";e.length>30;)t=t+e.substring(0,30)+"
",e=e.substring(30,e.length);return t+=e},a=function(e,t,r,n,i,o){return null==n&&(n=!1),r.id===t.partial_solution?e.setNode(r.id,{label:s(r,"partialSolution",i,o),labelType:"html","class":m(r,"partialSolution")}):r.id===t.next_partial_solution?e.setNode(r.id,{label:s(r,"nextPartialSolution",i,o),labelType:"html","class":m(r,"nextPartialSolution")}):r.id===t.workset?e.setNode(r.id,{label:s(r,"workset",i,o),labelType:"html","class":m(r,"workset")}):r.id===t.next_workset?e.setNode(r.id,{label:s(r,"nextWorkset",i,o),labelType:"html","class":m(r,"nextWorkset")}):r.id===t.solution_set?e.setNode(r.id,{label:s(r,"solutionSet",i,o),labelType:"html","class":m(r,"solutionSet")}):r.id===t.solution_delta?e.setNode(r.id,{label:s(r,"solutionDelta",i,o),labelType:"html","class":m(r,"solutionDelta")}):e.setNode(r.id,{label:s(r,"",i,o),labelType:"html","class":m(r,"")})},i=function(e,t,r,n,i){return e.setEdge(i.id,r.id,{label:o(i),labelType:"html",arrowhead:"normal"})},k=function(e,t){var r,n,o,s,l,u,d,f,p,m,h,g,b,v;for(n=[],null!=t.nodes?v=t.nodes:(v=t.step_function,o=!0),s=0,u=v.length;s-1))return e["end-time"]=e["start-time"]+e.duration})},this.processVertices=function(e){return angular.forEach(e.vertices,function(e,t){return e.type="regular"}),e.vertices.unshift({name:"Scheduled","start-time":e.timestamps.CREATED,"end-time":e.timestamps.CREATED+1,type:"scheduled"})},this.listJobs=function(){var r;return r=i.defer(),e.get(t.jobServer+"joboverview").success(function(e){return function(t,n,i,o){return angular.forEach(t,function(t,r){switch(r){case"running":return c.running=e.setEndTimes(t);case"finished":return c.finished=e.setEndTimes(t);case"cancelled":return c.cancelled=e.setEndTimes(t);case"failed":return c.failed=e.setEndTimes(t)}}),r.resolve(c),d()}}(this)),r.promise},this.getJobs=function(e){return c[e]},this.getAllJobs=function(){return c},this.loadJob=function(r){return s=null,l.job=i.defer(),e.get(t.jobServer+"jobs/"+r).success(function(n){return function(i,o,a,u){return n.setEndTimes(i.vertices),n.processVertices(i),e.get(t.jobServer+"jobs/"+r+"/config").success(function(e){return i=angular.extend(i,e),s=i,l.job.resolve(s)})}}(this)),l.job.promise},this.getNode=function(e){var t,r;return r=function(e,t){var n,i,o,s;for(n=0,i=t.length;n
{{metric.id}}
{{value | humanizeChartNumeric:metric}}
',replace:!0,scope:{metric:"=",window:"=",removeMetric:"&",setMetricSize:"=",setMetricView:"=",getValues:"&"},link:function(e,t,r){return e.btnClasses=["btn","btn-default","btn-xs"],e.value=null,e.data=[{values:e.getValues()}],e.options={x:function(e,t){return e.x},y:function(e,t){return e.y},xTickFormat:function(e){return d3.time.format("%H:%M:%S")(new Date(e))},yTickFormat:function(e){var t,r,n,i;for(r=!1,n=0,i=1,t=Math.abs(e);!r&&n<50;)Math.pow(10,n)<=t&&t6?e/Math.pow(10,n)+"E"+n:""+e}},e.showChart=function(){return d3.select(t.find("svg")[0]).datum(e.data).transition().duration(250).call(e.chart)},e.chart=nv.models.lineChart().options(e.options).showLegend(!1).margin({top:15,left:60,bottom:30,right:30}),e.chart.yAxis.showMaxMin(!1),e.chart.tooltip.hideDelay(0),e.chart.tooltip.contentGenerator(function(e){return"

"+d3.time.format("%H:%M:%S")(new Date(e.point.x))+" | "+e.point.y+"

"}),nv.utils.windowResize(e.chart.update),e.setSize=function(t){return e.setMetricSize(e.metric,t)},e.setView=function(t){if(e.setMetricView(e.metric,t),"chart"===t)return e.showChart()},"chart"===e.metric.view&&e.showChart(),e.$on("metrics:data:update",function(t,r,n){return e.value=parseFloat(n[e.metric.id]),e.data[0].values.push({x:r,y:e.value}),e.data[0].values.length>e.window&&e.data[0].values.shift(),"chart"===e.metric.view&&e.showChart(),"chart"===e.metric.view&&e.chart.clearHighlights(),e.chart.tooltip.hidden(!0)}),t.find(".metric-title").qtip({content:{text:e.metric.id},position:{my:"bottom left",at:"top left"},style:{classes:"qtip-light qtip-timeline-bar"}})}}}),angular.module("flinkApp").service("MetricsService",["$http","$q","flinkConfig","$interval",function(e,t,r,n){return this.metrics={},this.values={},this.watched={},this.observer={jobid:null,nodeid:null,callback:null},this.refresh=n(function(e){return function(){return angular.forEach(e.metrics,function(t,r){return angular.forEach(t,function(t,n){var i;if(i=[],angular.forEach(t,function(e,t){return i.push(e.id)}),i.length>0)return e.getMetrics(r,n,i).then(function(t){if(r===e.observer.jobid&&n===e.observer.nodeid&&e.observer.callback)return e.observer.callback(t)})})})}}(this),r["refresh-interval"]),this.registerObserver=function(e,t,r){return this.observer.jobid=e,this.observer.nodeid=t,this.observer.callback=r},this.unRegisterObserver=function(){return this.observer={jobid:null,nodeid:null,callback:null}},this.setupMetrics=function(e,t){return this.setupLS(),this.watched[e]=[],angular.forEach(t,function(t){return function(r,n){if(r.id)return t.watched[e].push(r.id)}}(this))},this.getWindow=function(){return 100},this.setupLS=function(){return null==sessionStorage.flinkMetrics&&this.saveSetup(),this.metrics=JSON.parse(sessionStorage.flinkMetrics)},this.saveSetup=function(){return sessionStorage.flinkMetrics=JSON.stringify(this.metrics)},this.saveValue=function(e,t,r){if(null==this.values[e]&&(this.values[e]={}),null==this.values[e][t]&&(this.values[e][t]=[]),this.values[e][t].push(r),this.values[e][t].length>this.getWindow())return this.values[e][t].shift()},this.getValues=function(e,t,r){var n;return null==this.values[e]?[]:null==this.values[e][t]?[]:(n=[],angular.forEach(this.values[e][t],function(e){return function(e,t){if(null!=e.values[r])return n.push({x:e.timestamp,y:e.values[r]})}}(this)),n)},this.setupLSFor=function(e,t){if(null==this.metrics[e]&&(this.metrics[e]={}),null==this.metrics[e][t])return this.metrics[e][t]=[]},this.addMetric=function(e,t,r){return this.setupLSFor(e,t),this.metrics[e][t].push({id:r,size:"small",view:"chart"}),this.saveSetup()},this.removeMetric=function(e){return function(t,r,n){var i;if(null!=e.metrics[t][r])return i=e.metrics[t][r].indexOf(n),i===-1&&(i=_.findIndex(e.metrics[t][r],{id:n})),i!==-1&&e.metrics[t][r].splice(i,1),e.saveSetup()}}(this),this.setMetricSize=function(e){return function(t,r,n,i){var o;if(null!=e.metrics[t][r])return o=e.metrics[t][r].indexOf(n.id),o===-1&&(o=_.findIndex(e.metrics[t][r],{id:n.id})),o!==-1&&(e.metrics[t][r][o]={id:n.id,size:i,view:n.view}),e.saveSetup()}}(this),this.setMetricView=function(e){return function(t,r,n,i){var o;if(null!=e.metrics[t][r])return o=e.metrics[t][r].indexOf(n.id),o===-1&&(o=_.findIndex(e.metrics[t][r],{id:n.id})),o!==-1&&(e.metrics[t][r][o]={id:n.id,size:n.size,view:i}),e.saveSetup()}}(this),this.orderMetrics=function(e,t,r,n){return this.setupLSFor(e,t),angular.forEach(this.metrics[e][t],function(i){return function(o,s){if(o.id===r.id&&(i.metrics[e][t].splice(s,1),s",link:function(t,r,n){return t.getLabelClass=function(){return"label label-"+e.translateLabelState(n.status)}}}}]).directive("bpLabel",["JobsService",function(e){return{transclude:!0,replace:!0,scope:{getBackPressureLabelClass:"&",status:"@"},template:"",link:function(t,r,n){return t.getBackPressureLabelClass=function(){return"label label-"+e.translateBackPressureLabelState(n.status)}}}}]).directive("indicatorPrimary",["JobsService",function(e){return{replace:!0,scope:{getLabelClass:"&",status:"@"},template:"",link:function(t,r,n){return t.getLabelClass=function(){return"fa fa-circle indicator indicator-"+e.translateLabelState(n.status)}}}}]).directive("tableProperty",function(){return{replace:!0,scope:{value:"="},template:"{{value || 'None'}}"}}),angular.module("flinkApp").filter("amDurationFormatExtended",["angularMomentConfig",function(e){var t;return t=function(e,t,r){return"undefined"==typeof e||null===e?"":moment.duration(e,t).format(r,{trim:!1})},t.$stateful=e.statefulFilters,t}]).filter("humanizeDuration",function(){return function(e,t){var r,n,o,a,i,s;return"undefined"==typeof e||null===e?"":(a=e%1e3,s=Math.floor(e/1e3),i=s%60,s=Math.floor(s/60),o=s%60,s=Math.floor(s/60),n=s%24,s=Math.floor(s/24),r=s,0===r?0===n?0===o?0===i?a+"ms":i+"s ":o+"m "+i+"s":t?n+"h "+o+"m":n+"h "+o+"m "+i+"s":t?r+"d "+n+"h":r+"d "+n+"h "+o+"m "+i+"s")}}).filter("limit",function(){return function(e){return e.length>73&&(e=e.substring(0,35)+"..."+e.substring(e.length-35,e.length)),e}}).filter("humanizeText",function(){return function(e){return e?e.replace(/>/g,">").replace(//g,""):""}}).filter("humanizeBytes",function(){return function(e){var t,r;return r=["B","KB","MB","GB","TB","PB","EB"],t=function(e,n){var o;return o=Math.pow(1024,n),e=r;n=0<=r?++e:--e)o.push(n+".currentLowWatermark");return o}(),o.getMetrics(a,t.id,i).then(function(e){var t,n,o,a,i,s,l;o=NaN,l={},a=e.values;for(t in a)s=a[t],i=t.replace(".currentLowWatermark",""),l[i]=s,(isNaN(o)||su.noWatermark?o:NaN,r.resolve({lowWatermark:n,watermarks:l})}),r.promise}}(this),r=l.defer(),i={},n=t.length,angular.forEach(t,function(e){return function(e,t){var o;return o=e.id,a(e).then(function(e){if(i[o]=e,t>=n-1)return r.resolve(i)})}}(this)),r.promise},e.hasWatermark=function(t){return e.watermarks[t]&&!isNaN(e.watermarks[t].lowWatermark)},e.$watch("plan",function(t){if(t)return c(t.nodes).then(function(t){return e.watermarks=t})}),e.$on("reload",function(){if(e.plan)return c(e.plan.nodes).then(function(t){return e.watermarks=t})})}]).controller("JobPlanController",["$scope","$state","$stateParams","$window","JobsService",function(e,t,r,n,o){return e.nodeid=null,e.nodeUnfolded=!1,e.stateList=o.stateList(),e.changeNode=function(t){return t!==e.nodeid?(e.nodeid=t,e.vertex=null,e.subtasks=null,e.accumulators=null,e.operatorCheckpointStats=null,e.$broadcast("reload"),e.$broadcast("node:change",e.nodeid)):(e.nodeid=null,e.nodeUnfolded=!1,e.vertex=null,e.subtasks=null,e.accumulators=null,e.operatorCheckpointStats=null)},e.deactivateNode=function(){return e.nodeid=null,e.nodeUnfolded=!1,e.vertex=null,e.subtasks=null,e.accumulators=null,e.operatorCheckpointStats=null},e.toggleFold=function(){return e.nodeUnfolded=!e.nodeUnfolded}}]).controller("JobPlanSubtasksController",["$scope","JobsService",function(e,t){var r;return r=function(){return t.getSubtasks(e.nodeid).then(function(t){return e.subtasks=t})},!e.nodeid||e.vertex&&e.vertex.st||r(),e.$on("reload",function(t){if(e.nodeid)return r()})}]).controller("JobPlanTaskManagersController",["$scope","JobsService",function(e,t){var r;return r=function(){return t.getTaskManagers(e.nodeid).then(function(t){return e.taskmanagers=t})},!e.nodeid||e.vertex&&e.vertex.st||r(),e.$on("reload",function(t){if(e.nodeid)return r()})}]).controller("JobPlanAccumulatorsController",["$scope","JobsService",function(e,t){var r;return r=function(){return t.getAccumulators(e.nodeid).then(function(t){return e.accumulators=t.main,e.subtaskAccumulators=t.subtasks})},!e.nodeid||e.vertex&&e.vertex.accumulators||r(),e.$on("reload",function(t){if(e.nodeid)return r()})}]).controller("JobPlanCheckpointsController",["$scope","$state","$stateParams","JobsService",function(e,t,r,n){var o;return e.checkpointDetails={},e.checkpointDetails.id=-1,n.getCheckpointConfig().then(function(t){return e.checkpointConfig=t}),o=function(){return n.getCheckpointStats().then(function(t){if(null!==t)return e.checkpointStats=t})},o(),e.$on("reload",function(e){return o()})}]).controller("JobPlanCheckpointDetailsController",["$scope","$state","$stateParams","JobsService",function(e,t,r,n){var o,a;return e.subtaskDetails={},e.checkpointDetails.id=r.checkpointId,o=function(t){return n.getCheckpointDetails(t).then(function(t){return null!==t?e.checkpoint=t:e.unknown_checkpoint=!0})},a=function(t,r){return n.getCheckpointSubtaskDetails(t,r).then(function(t){if(null!==t)return e.subtaskDetails[r]=t})},o(r.checkpointId),e.nodeid&&a(r.checkpointId,e.nodeid),e.$on("reload",function(t){if(o(r.checkpointId),e.nodeid)return a(r.checkpointId,e.nodeid)}),e.$on("$destroy",function(){return e.checkpointDetails.id=-1})}]).controller("JobPlanBackPressureController",["$scope","JobsService",function(e,t){var r;return r=function(){if(e.now=Date.now(),e.nodeid)return t.getOperatorBackPressure(e.nodeid).then(function(t){return e.backPressureOperatorStats[e.nodeid]=t})},r(),e.$on("reload",function(e){return r()})}]).controller("JobTimelineVertexController",["$scope","$state","$stateParams","JobsService",function(e,t,r,n){var o;return o=function(){return n.getVertex(r.vertexId).then(function(t){return e.vertex=t})},o(),e.$on("reload",function(e){return o()})}]).controller("JobExceptionsController",["$scope","$state","$stateParams","JobsService",function(e,t,r,n){return n.loadExceptions().then(function(t){return e.exceptions=t})}]).controller("JobPropertiesController",["$scope","JobsService",function(e,t){return e.changeNode=function(r){return r!==e.nodeid?(e.nodeid=r,t.getNode(r).then(function(t){return e.node=t})):(e.nodeid=null,e.node=null)}}]).controller("JobPlanMetricsController",["$scope","JobsService","MetricsService",function(e,t,r){var n;if(e.dragging=!1,e.window=r.getWindow(),e.availableMetrics=null,e.$on("$destroy",function(){return r.unRegisterObserver()}),n=function(){return t.getVertex(e.nodeid).then(function(t){return e.vertex=t}),r.getAvailableMetrics(e.jobid,e.nodeid).then(function(t){return e.availableMetrics=t,e.metrics=r.getMetricsSetup(e.jobid,e.nodeid).names,r.registerObserver(e.jobid,e.nodeid,function(t){return e.$broadcast("metrics:data:update",t.timestamp,t.values)})})},e.dropped=function(t,o,a,i,s){return r.orderMetrics(e.jobid,e.nodeid,a,o),e.$broadcast("metrics:refresh",a),n(),!1},e.dragStart=function(){return e.dragging=!0},e.dragEnd=function(){return e.dragging=!1},e.addMetric=function(t){return r.addMetric(e.jobid,e.nodeid,t.id),n()},e.removeMetric=function(t){return r.removeMetric(e.jobid,e.nodeid,t),n()},e.setMetricSize=function(t,o){return r.setMetricSize(e.jobid,e.nodeid,t,o),n()},e.getValues=function(t){return r.getValues(e.jobid,e.nodeid,t)},e.$on("node:change",function(t,r){if(!e.dragging)return n()}),e.nodeid)return n()}]),angular.module("flinkApp").directive("vertex",["$state",function(e){return{template:"",scope:{data:"="},link:function(e,t,r){var n,o,a;a=t.children()[0],o=t.width(),angular.element(a).attr("width",o),(n=function(e){var t,r,n;return d3.select(a).selectAll("*").remove(),n=[],angular.forEach(e.subtasks,function(e,t){var r;return r=[{label:"Scheduled",color:"#666",borderColor:"#555",starting_time:e.timestamps.SCHEDULED,ending_time:e.timestamps.DEPLOYING,type:"regular"},{label:"Deploying",color:"#aaa",borderColor:"#555",starting_time:e.timestamps.DEPLOYING,ending_time:e.timestamps.RUNNING,type:"regular"}],e.timestamps.FINISHED>0&&r.push({label:"Running",color:"#ddd",borderColor:"#555",starting_time:e.timestamps.RUNNING,ending_time:e.timestamps.FINISHED,type:"regular"}),n.push({label:"("+e.subtask+") "+e.host,times:r})}),t=d3.timeline().stack().tickFormat({format:d3.time.format("%L"),tickSize:1}).prefix("single").labelFormat(function(e){return e}).margin({left:100,right:0,top:0,bottom:0}).itemHeight(30).relativeTime(),r=d3.select(a).datum(n).call(t)})(e.data)}}}]).directive("timeline",["$state",function(e){return{template:"",scope:{vertices:"=",jobid:"="},link:function(t,r,n){var o,a,i,s;i=r.children()[0],a=r.width(),angular.element(i).attr("width",a),s=function(e){return e.replace(">",">")},o=function(r){var n,o,a;return d3.select(i).selectAll("*").remove(),a=[],angular.forEach(r,function(e){if(e["start-time"]>-1)return"scheduled"===e.type?a.push({times:[{label:s(e.name),color:"#cccccc",borderColor:"#555555",starting_time:e["start-time"],ending_time:e["end-time"],type:e.type}]}):a.push({times:[{label:s(e.name),color:"#d9f1f7",borderColor:"#62cdea",starting_time:e["start-time"],ending_time:e["end-time"],link:e.id,type:e.type}]})}),n=d3.timeline().stack().click(function(r,n,o){if(r.link)return e.go("single-job.timeline.vertex",{jobid:t.jobid,vertexId:r.link})}).tickFormat({format:d3.time.format("%L"),tickSize:1}).prefix("main").margin({left:0,right:0,top:0,bottom:0}).itemHeight(30).showBorderLine().showHourTimeline(),o=d3.select(i).datum(a).call(n)},t.$watch(n.vertices,function(e){if(e)return o(e)})}}}]).directive("split",function(){return{compile:function(e,t){return Split(e.children(),{sizes:[50,50],direction:"vertical"})}}}).directive("jobPlan",["$timeout",function(e){return{template:"
",scope:{plan:"=",watermarks:"=",setNode:"&"},link:function(e,t,r){var n,o,a,i,s,l,u,c,d,f,p,m,g,b,h,v,k,j,S,w,C,$,J,M,y;p=null,C=d3.behavior.zoom(),y=[],b=r.jobid,S=t.children()[0],j=t.children().children()[0],w=t.children()[1],l=d3.select(S),u=d3.select(j),c=d3.select(w),n=t.width(),angular.element(t.children()[0]).width(n),v=0,h=0,e.zoomIn=function(){var e,t,r;if(C.scale()<2.99)return e=C.translate(),t=e[0]*(C.scale()+.1/C.scale()),r=e[1]*(C.scale()+.1/C.scale()),C.scale(C.scale()+.1),C.translate([t,r]),u.attr("transform","translate("+t+","+r+") scale("+C.scale()+")"),v=C.scale(),h=C.translate()},e.zoomOut=function(){var e,t,r;if(C.scale()>.31)return C.scale(C.scale()-.1),e=C.translate(),t=e[0]*(C.scale()-.1/C.scale()),r=e[1]*(C.scale()-.1/C.scale()),C.translate([t,r]),u.attr("transform","translate("+t+","+r+") scale("+C.scale()+")"),v=C.scale(),h=C.translate()},a=function(e){var t;return t="",null==e.ship_strategy&&null==e.local_strategy||(t+="
",null!=e.ship_strategy&&(t+=e.ship_strategy),void 0!==e.temp_mode&&(t+=" ("+e.temp_mode+")"),void 0!==e.local_strategy&&(t+=",
"+e.local_strategy),t+="
"),t},g=function(e){return"partialSolution"===e||"nextPartialSolution"===e||"workset"===e||"nextWorkset"===e||"solutionSet"===e||"solutionDelta"===e},m=function(e,t){return"mirror"===t?"node-mirror":g(t)?"node-iteration":"node-normal"},i=function(e,t,r,n){var o,a;return o="
",o+="mirror"===t?"

Mirror of "+e.operator+"

":"

"+e.operator+"

",""===e.description?o+="":(a=e.description,a=M(a),o+="

"+a+"

"),null!=e.step_function?o+=f(e.id,r,n):(g(t)&&(o+="
"+t+" Node
"),""!==e.parallelism&&(o+="
Parallelism: "+e.parallelism+"
"),void 0!==e.lowWatermark&&(o+="
Low Watermark: "+e.lowWatermark+"
"),void 0!==e.operator&&e.operator_strategy&&(o+="
Operation: "+M(e.operator_strategy)+"
")),o+="
"},f=function(e,t,r){var n,o;return o="svg-"+e,n=""},M=function(e){var t;for("<"===e.charAt(0)&&(e=e.replace("<","<"),e=e.replace(">",">")),t="";e.length>30;)t=t+e.substring(0,30)+"
",e=e.substring(30,e.length);return t+=e},s=function(e,t,r,n,o,a){return null==n&&(n=!1),r.id===t.partial_solution?e.setNode(r.id,{label:i(r,"partialSolution",o,a),labelType:"html","class":m(r,"partialSolution")}):r.id===t.next_partial_solution?e.setNode(r.id,{label:i(r,"nextPartialSolution",o,a),labelType:"html","class":m(r,"nextPartialSolution")}):r.id===t.workset?e.setNode(r.id,{label:i(r,"workset",o,a),labelType:"html","class":m(r,"workset")}):r.id===t.next_workset?e.setNode(r.id,{label:i(r,"nextWorkset",o,a),labelType:"html","class":m(r,"nextWorkset")}):r.id===t.solution_set?e.setNode(r.id,{label:i(r,"solutionSet",o,a),labelType:"html","class":m(r,"solutionSet")}):r.id===t.solution_delta?e.setNode(r.id,{label:i(r,"solutionDelta",o,a),labelType:"html","class":m(r,"solutionDelta")}):e.setNode(r.id,{label:i(r,"",o,a),labelType:"html","class":m(r,"")})},o=function(e,t,r,n,o){return e.setEdge(o.id,r.id,{label:a(o),labelType:"html",arrowhead:"normal"})},k=function(e,t){var r,n,a,i,l,u,d,f,p,m,g,b,h,v;for(n=[],null!=t.nodes?v=t.nodes:(v=t.step_function,a=!0),i=0,u=v.length;i-1))return e["end-time"]=e["start-time"]+e.duration})},this.processVertices=function(e){return angular.forEach(e.vertices,function(e,t){return e.type="regular"}),e.vertices.unshift({name:"Scheduled","start-time":e.timestamps.CREATED,"end-time":e.timestamps.CREATED+1,type:"scheduled"})},this.listJobs=function(){var r;return r=o.defer(),e.get(t.jobServer+"joboverview").success(function(e){return function(t,n,o,a){return angular.forEach(t,function(t,r){switch(r){case"running":return c.running=e.setEndTimes(t);case"finished":return c.finished=e.setEndTimes(t);case"cancelled":return c.cancelled=e.setEndTimes(t);case"failed":return c.failed=e.setEndTimes(t)}}),r.resolve(c),d()}}(this)),r.promise},this.getJobs=function(e){return c[e]},this.getAllJobs=function(){return c},this.loadJob=function(r){return i=null,l.job=o.defer(),e.get(t.jobServer+"jobs/"+r).success(function(n){return function(o,a,s,u){return n.setEndTimes(o.vertices),n.processVertices(o),e.get(t.jobServer+"jobs/"+r+"/config").success(function(e){return o=angular.extend(o,e),i=o,l.job.resolve(i)})}}(this)),l.job.promise},this.getNode=function(e){var t,r;return r=function(e,t){var n,o,a,i;for(n=0,o=t.length;n
{{metric.id}}
',replace:!0,scope:{metric:"=",window:"=",removeMetric:"&",setMetricSize:"=",getValues:"&"},link:function(e,t,r){return e.btnClasses=["btn","btn-default","btn-xs"],e.value=null,e.data=[{values:e.getValues()}],e.options={x:function(e,t){return e.x},y:function(e,t){return e.y},xTickFormat:function(e){return d3.time.format("%H:%M:%S")(new Date(e))},yTickFormat:function(e){var t,r,n,o;for(r=!1,n=0,o=1,t=Math.abs(e);!r&&n<50;)Math.pow(10,n)<=t&&t6?e/Math.pow(10,n)+"E"+n:""+e}},e.showChart=function(){return d3.select(t.find("svg")[0]).datum(e.data).transition().duration(250).call(e.chart)},e.chart=nv.models.lineChart().options(e.options).showLegend(!1).margin({top:15,left:60,bottom:30,right:30}),e.chart.yAxis.showMaxMin(!1),e.chart.tooltip.hideDelay(0),e.chart.tooltip.contentGenerator(function(e){return"

"+d3.time.format("%H:%M:%S")(new Date(e.point.x))+" | "+e.point.y+"

"}),nv.utils.windowResize(e.chart.update),e.setSize=function(t){return e.setMetricSize(e.metric,t)},e.showChart(),e.$on("metrics:data:update",function(t,r,n){return e.value=parseFloat(n[e.metric.id]),e.data[0].values.push({x:r,y:e.value}),e.data[0].values.length>e.window&&e.data[0].values.shift(),e.showChart(),e.chart.clearHighlights(),e.chart.tooltip.hidden(!0)}),t.find(".metric-title").qtip({content:{text:e.metric.id},position:{my:"bottom left",at:"top left"},style:{classes:"qtip-light qtip-timeline-bar"}})}}}),angular.module("flinkApp").service("MetricsService",["$http","$q","flinkConfig","$interval",function(e,t,r,n){return this.metrics={},this.values={},this.watched={},this.observer={jobid:null,nodeid:null,callback:null},this.refresh=n(function(e){return function(){return angular.forEach(e.metrics,function(t,r){return angular.forEach(t,function(t,n){var o;if(o=[],angular.forEach(t,function(e,t){return o.push(e.id)}),o.length>0)return e.getMetrics(r,n,o).then(function(t){if(r===e.observer.jobid&&n===e.observer.nodeid&&e.observer.callback)return e.observer.callback(t)})})})}}(this),r["refresh-interval"]),this.registerObserver=function(e,t,r){return this.observer.jobid=e,this.observer.nodeid=t,this.observer.callback=r},this.unRegisterObserver=function(){return this.observer={jobid:null,nodeid:null,callback:null}},this.setupMetrics=function(e,t){return this.setupLS(),this.watched[e]=[],angular.forEach(t,function(t){return function(r,n){if(r.id)return t.watched[e].push(r.id)}}(this))},this.getWindow=function(){return 100},this.setupLS=function(){return null==sessionStorage.flinkMetrics&&this.saveSetup(),this.metrics=JSON.parse(sessionStorage.flinkMetrics)},this.saveSetup=function(){return sessionStorage.flinkMetrics=JSON.stringify(this.metrics)},this.saveValue=function(e,t,r){if(null==this.values[e]&&(this.values[e]={}),null==this.values[e][t]&&(this.values[e][t]=[]),this.values[e][t].push(r),this.values[e][t].length>this.getWindow())return this.values[e][t].shift()},this.getValues=function(e,t,r){var n;return null==this.values[e]?[]:null==this.values[e][t]?[]:(n=[],angular.forEach(this.values[e][t],function(e){return function(e,t){if(null!=e.values[r])return n.push({x:e.timestamp,y:e.values[r]})}}(this)),n)},this.setupLSFor=function(e,t){if(null==this.metrics[e]&&(this.metrics[e]={}),null==this.metrics[e][t])return this.metrics[e][t]=[]},this.addMetric=function(e,t,r){return this.setupLSFor(e,t),this.metrics[e][t].push({id:r,size:"small"}),this.saveSetup()},this.removeMetric=function(e){return function(t,r,n){var o;if(null!=e.metrics[t][r])return o=e.metrics[t][r].indexOf(n),o===-1&&(o=_.findIndex(e.metrics[t][r],{id:n})),o!==-1&&e.metrics[t][r].splice(o,1),e.saveSetup()}}(this),this.setMetricSize=function(e){return function(t,r,n,o){var a;if(null!=e.metrics[t][r])return a=e.metrics[t][r].indexOf(n.id),a===-1&&(a=_.findIndex(e.metrics[t][r],{id:n.id})),a!==-1&&(e.metrics[t][r][a]={id:n.id,size:o}),e.saveSetup()}}(this),this.orderMetrics=function(e,t,r,n){return this.setupLSFor(e,t),angular.forEach(this.metrics[e][t],function(o){return function(a,i){if(a.id===r.id&&(o.metrics[e][t].splice(i,1),i",link:function(t,r,n){return t.getLabelClass=function(){return"label label-"+e.translateLabelState(n.status)}}}}]).directive("bpLabel",["JobsService",function(e){return{transclude:!0,replace:!0,scope:{getBackPressureLabelClass:"&",status:"@"},template:"",link:function(t,r,n){return t.getBackPressureLabelClass=function(){return"label label-"+e.translateBackPressureLabelState(n.status)}}}}]).directive("indicatorPrimary",["JobsService",function(e){return{replace:!0,scope:{getLabelClass:"&",status:"@"},template:"",link:function(t,r,n){return t.getLabelClass=function(){return"fa fa-circle indicator indicator-"+e.translateLabelState(n.status)}}}}]).directive("tableProperty",function(){return{replace:!0,scope:{value:"="},template:"{{value || 'None'}}"}}),angular.module("flinkApp").filter("amDurationFormatExtended",["angularMomentConfig",function(e){var t;return t=function(e,t,r){return"undefined"==typeof e||null===e?"":moment.duration(e,t).format(r,{trim:!1})},t.$stateful=e.statefulFilters,t}]).filter("humanizeDuration",function(){return function(e,t){var r,n,i,o,a,s;return"undefined"==typeof e||null===e?"":(o=e%1e3,s=Math.floor(e/1e3),a=s%60,s=Math.floor(s/60),i=s%60,s=Math.floor(s/60),n=s%24,s=Math.floor(s/24),r=s,0===r?0===n?0===i?0===a?o+"ms":a+"s ":i+"m "+a+"s":t?n+"h "+i+"m":n+"h "+i+"m "+a+"s":t?r+"d "+n+"h":r+"d "+n+"h "+i+"m "+a+"s")}}).filter("limit",function(){return function(e){return e.length>73&&(e=e.substring(0,35)+"..."+e.substring(e.length-35,e.length)),e}}).filter("humanizeText",function(){return function(e){return e?e.replace(/>/g,">").replace(//g,""):""}}).filter("humanizeBytes",function(){return function(e){var t,r;return r=["B","KB","MB","GB","TB","PB","EB"],t=function(e,n){var i;return i=Math.pow(1024,n),e=r;n=0<=r?++e:--e)i.push(n+".currentLowWatermark");return i}(),i.getMetrics(o,t.id,a).then(function(e){var t,n,i,o,a,s,l;i=NaN,l={},o=e.values;for(t in o)s=o[t],a=t.replace(".currentLowWatermark",""),l[a]=s,(isNaN(i)||su.noWatermark?i:NaN,r.resolve({lowWatermark:n,watermarks:l})}),r.promise}}(this),r=l.defer(),a={},n=t.length,angular.forEach(t,function(e){return function(e,t){var i;return i=e.id,o(e).then(function(e){if(a[i]=e,t>=n-1)return r.resolve(a)})}}(this)),r.promise},e.hasWatermark=function(t){return e.watermarks[t]&&!isNaN(e.watermarks[t].lowWatermark)},e.$watch("plan",function(t){if(t)return c(t.nodes).then(function(t){return e.watermarks=t})}),e.$on("reload",function(){if(e.plan)return c(e.plan.nodes).then(function(t){return e.watermarks=t})})}]).controller("JobPlanController",["$scope","$state","$stateParams","$window","JobsService",function(e,t,r,n,i){return e.nodeid=null,e.nodeUnfolded=!1,e.stateList=i.stateList(),e.changeNode=function(t){return t!==e.nodeid?(e.nodeid=t,e.vertex=null,e.subtasks=null,e.accumulators=null,e.operatorCheckpointStats=null,e.$broadcast("reload"),e.$broadcast("node:change",e.nodeid)):(e.nodeid=null,e.nodeUnfolded=!1,e.vertex=null,e.subtasks=null,e.accumulators=null,e.operatorCheckpointStats=null)},e.deactivateNode=function(){return e.nodeid=null,e.nodeUnfolded=!1,e.vertex=null,e.subtasks=null,e.accumulators=null,e.operatorCheckpointStats=null},e.toggleFold=function(){return e.nodeUnfolded=!e.nodeUnfolded}}]).controller("JobPlanSubtasksController",["$scope","JobsService",function(e,t){var r;return r=function(){return t.getSubtasks(e.nodeid).then(function(t){return e.subtasks=t})},!e.nodeid||e.vertex&&e.vertex.st||r(),e.$on("reload",function(t){if(e.nodeid)return r()})}]).controller("JobPlanTaskManagersController",["$scope","JobsService",function(e,t){var r;return r=function(){return t.getTaskManagers(e.nodeid).then(function(t){return e.taskmanagers=t})},!e.nodeid||e.vertex&&e.vertex.st||r(),e.$on("reload",function(t){if(e.nodeid)return r()})}]).controller("JobPlanAccumulatorsController",["$scope","JobsService",function(e,t){var r;return r=function(){return t.getAccumulators(e.nodeid).then(function(t){return e.accumulators=t.main,e.subtaskAccumulators=t.subtasks})},!e.nodeid||e.vertex&&e.vertex.accumulators||r(),e.$on("reload",function(t){if(e.nodeid)return r()})}]).controller("JobPlanCheckpointsController",["$scope","$state","$stateParams","JobsService",function(e,t,r,n){var i;return e.checkpointDetails={},e.checkpointDetails.id=-1,n.getCheckpointConfig().then(function(t){return e.checkpointConfig=t}),i=function(){return n.getCheckpointStats().then(function(t){if(null!==t)return e.checkpointStats=t})},i(),e.$on("reload",function(e){return i()})}]).controller("JobPlanCheckpointDetailsController",["$scope","$state","$stateParams","JobsService",function(e,t,r,n){var i,o;return e.subtaskDetails={},e.checkpointDetails.id=r.checkpointId,i=function(t){return n.getCheckpointDetails(t).then(function(t){return null!==t?e.checkpoint=t:e.unknown_checkpoint=!0})},o=function(t,r){return n.getCheckpointSubtaskDetails(t,r).then(function(t){if(null!==t)return e.subtaskDetails[r]=t})},i(r.checkpointId),e.nodeid&&o(r.checkpointId,e.nodeid),e.$on("reload",function(t){if(i(r.checkpointId),e.nodeid)return o(r.checkpointId,e.nodeid)}),e.$on("$destroy",function(){return e.checkpointDetails.id=-1})}]).controller("JobPlanBackPressureController",["$scope","JobsService",function(e,t){var r;return r=function(){if(e.now=Date.now(),e.nodeid)return t.getOperatorBackPressure(e.nodeid).then(function(t){return e.backPressureOperatorStats[e.nodeid]=t})},r(),e.$on("reload",function(e){return r()})}]).controller("JobTimelineVertexController",["$scope","$state","$stateParams","JobsService",function(e,t,r,n){var i;return i=function(){return n.getVertex(r.vertexId).then(function(t){return e.vertex=t})},i(),e.$on("reload",function(e){return i()})}]).controller("JobExceptionsController",["$scope","$state","$stateParams","JobsService",function(e,t,r,n){return n.loadExceptions().then(function(t){return e.exceptions=t})}]).controller("JobPropertiesController",["$scope","JobsService",function(e,t){return e.changeNode=function(r){return r!==e.nodeid?(e.nodeid=r,t.getNode(r).then(function(t){return e.node=t})):(e.nodeid=null,e.node=null)}}]).controller("JobPlanMetricsController",["$scope","JobsService","MetricsService",function(e,t,r){var n;if(e.dragging=!1,e.window=r.getWindow(),e.availableMetrics=null,e.$on("$destroy",function(){return r.unRegisterObserver()}),n=function(){return t.getVertex(e.nodeid).then(function(t){return e.vertex=t}),r.getAvailableMetrics(e.jobid,e.nodeid).then(function(t){return e.availableMetrics=t,e.metrics=r.getMetricsSetup(e.jobid,e.nodeid).names,r.registerObserver(e.jobid,e.nodeid,function(t){return e.$broadcast("metrics:data:update",t.timestamp,t.values)})})},e.dropped=function(t,i,o,a,s){return r.orderMetrics(e.jobid,e.nodeid,o,i),e.$broadcast("metrics:refresh",o),n(),!1},e.dragStart=function(){return e.dragging=!0},e.dragEnd=function(){return e.dragging=!1},e.addMetric=function(t){return r.addMetric(e.jobid,e.nodeid,t.id),n()},e.removeMetric=function(t){return r.removeMetric(e.jobid,e.nodeid,t),n()},e.setMetricSize=function(t,i){return r.setMetricSize(e.jobid,e.nodeid,t,i),n()},e.setMetricView=function(t,i){return r.setMetricView(e.jobid,e.nodeid,t,i),n()},e.getValues=function(t){return r.getValues(e.jobid,e.nodeid,t)},e.$on("node:change",function(t,r){if(!e.dragging)return n()}),e.nodeid)return n()}]),angular.module("flinkApp").directive("vertex",["$state",function(e){return{template:"",scope:{data:"="},link:function(e,t,r){var n,i,o;o=t.children()[0],i=t.width(),angular.element(o).attr("width",i),(n=function(e){var t,r,n;return d3.select(o).selectAll("*").remove(),n=[],angular.forEach(e.subtasks,function(e,t){var r;return r=[{label:"Scheduled",color:"#666",borderColor:"#555",starting_time:e.timestamps.SCHEDULED,ending_time:e.timestamps.DEPLOYING,type:"regular"},{label:"Deploying",color:"#aaa",borderColor:"#555",starting_time:e.timestamps.DEPLOYING,ending_time:e.timestamps.RUNNING,type:"regular"}],e.timestamps.FINISHED>0&&r.push({label:"Running",color:"#ddd",borderColor:"#555",starting_time:e.timestamps.RUNNING,ending_time:e.timestamps.FINISHED,type:"regular"}),n.push({label:"("+e.subtask+") "+e.host,times:r})}),t=d3.timeline().stack().tickFormat({format:d3.time.format("%L"),tickSize:1}).prefix("single").labelFormat(function(e){return e}).margin({left:100,right:0,top:0,bottom:0}).itemHeight(30).relativeTime(),r=d3.select(o).datum(n).call(t)})(e.data)}}}]).directive("timeline",["$state",function(e){return{template:"",scope:{vertices:"=",jobid:"="},link:function(t,r,n){var i,o,a,s;a=r.children()[0],o=r.width(),angular.element(a).attr("width",o),s=function(e){return e.replace(">",">")},i=function(r){var n,i,o;return d3.select(a).selectAll("*").remove(),o=[],angular.forEach(r,function(e){if(e["start-time"]>-1)return"scheduled"===e.type?o.push({times:[{label:s(e.name),color:"#cccccc",borderColor:"#555555",starting_time:e["start-time"],ending_time:e["end-time"],type:e.type}]}):o.push({times:[{label:s(e.name),color:"#d9f1f7",borderColor:"#62cdea",starting_time:e["start-time"],ending_time:e["end-time"],link:e.id,type:e.type}]})}),n=d3.timeline().stack().click(function(r,n,i){if(r.link)return e.go("single-job.timeline.vertex",{jobid:t.jobid,vertexId:r.link})}).tickFormat({format:d3.time.format("%L"),tickSize:1}).prefix("main").margin({left:0,right:0,top:0,bottom:0}).itemHeight(30).showBorderLine().showHourTimeline(),i=d3.select(a).datum(o).call(n)},t.$watch(n.vertices,function(e){if(e)return i(e)})}}}]).directive("split",function(){return{compile:function(e,t){return Split(e.children(),{sizes:[50,50],direction:"vertical"})}}}).directive("jobPlan",["$timeout",function(e){return{template:"
",scope:{plan:"=",watermarks:"=",setNode:"&"},link:function(e,t,r){var n,i,o,a,s,l,u,c,d,f,p,m,g,h,b,v,k,j,S,w,C,$,J,M,y;p=null,C=d3.behavior.zoom(),y=[],h=r.jobid,S=t.children()[0],j=t.children().children()[0],w=t.children()[1],l=d3.select(S),u=d3.select(j),c=d3.select(w),n=t.width(),angular.element(t.children()[0]).width(n),v=0,b=0,e.zoomIn=function(){var e,t,r;if(C.scale()<2.99)return e=C.translate(),t=e[0]*(C.scale()+.1/C.scale()),r=e[1]*(C.scale()+.1/C.scale()),C.scale(C.scale()+.1),C.translate([t,r]),u.attr("transform","translate("+t+","+r+") scale("+C.scale()+")"),v=C.scale(),b=C.translate()},e.zoomOut=function(){var e,t,r;if(C.scale()>.31)return C.scale(C.scale()-.1),e=C.translate(),t=e[0]*(C.scale()-.1/C.scale()),r=e[1]*(C.scale()-.1/C.scale()),C.translate([t,r]),u.attr("transform","translate("+t+","+r+") scale("+C.scale()+")"),v=C.scale(),b=C.translate()},o=function(e){var t;return t="",null==e.ship_strategy&&null==e.local_strategy||(t+="
",null!=e.ship_strategy&&(t+=e.ship_strategy),void 0!==e.temp_mode&&(t+=" ("+e.temp_mode+")"),void 0!==e.local_strategy&&(t+=",
"+e.local_strategy),t+="
"),t},g=function(e){return"partialSolution"===e||"nextPartialSolution"===e||"workset"===e||"nextWorkset"===e||"solutionSet"===e||"solutionDelta"===e},m=function(e,t){return"mirror"===t?"node-mirror":g(t)?"node-iteration":"node-normal"},a=function(e,t,r,n){var i,o;return i="
",i+="mirror"===t?"

Mirror of "+e.operator+"

":"

"+e.operator+"

",""===e.description?i+="":(o=e.description,o=M(o),i+="

"+o+"

"),null!=e.step_function?i+=f(e.id,r,n):(g(t)&&(i+="
"+t+" Node
"),""!==e.parallelism&&(i+="
Parallelism: "+e.parallelism+"
"),void 0!==e.lowWatermark&&(i+="
Low Watermark: "+e.lowWatermark+"
"),void 0!==e.operator&&e.operator_strategy&&(i+="
Operation: "+M(e.operator_strategy)+"
")),i+="
"},f=function(e,t,r){var n,i;return i="svg-"+e,n=""},M=function(e){var t;for("<"===e.charAt(0)&&(e=e.replace("<","<"),e=e.replace(">",">")),t="";e.length>30;)t=t+e.substring(0,30)+"
",e=e.substring(30,e.length);return t+=e},s=function(e,t,r,n,i,o){return null==n&&(n=!1),r.id===t.partial_solution?e.setNode(r.id,{label:a(r,"partialSolution",i,o),labelType:"html","class":m(r,"partialSolution")}):r.id===t.next_partial_solution?e.setNode(r.id,{label:a(r,"nextPartialSolution",i,o),labelType:"html","class":m(r,"nextPartialSolution")}):r.id===t.workset?e.setNode(r.id,{label:a(r,"workset",i,o),labelType:"html","class":m(r,"workset")}):r.id===t.next_workset?e.setNode(r.id,{label:a(r,"nextWorkset",i,o),labelType:"html","class":m(r,"nextWorkset")}):r.id===t.solution_set?e.setNode(r.id,{label:a(r,"solutionSet",i,o),labelType:"html","class":m(r,"solutionSet")}):r.id===t.solution_delta?e.setNode(r.id,{label:a(r,"solutionDelta",i,o),labelType:"html","class":m(r,"solutionDelta")}):e.setNode(r.id,{label:a(r,"",i,o),labelType:"html","class":m(r,"")})},i=function(e,t,r,n,i){return e.setEdge(i.id,r.id,{label:o(i),labelType:"html",arrowhead:"normal"})},k=function(e,t){var r,n,o,a,l,u,d,f,p,m,g,h,b,v;for(n=[],null!=t.nodes?v=t.nodes:(v=t.step_function,o=!0),a=0,u=v.length;a-1))return e["end-time"]=e["start-time"]+e.duration})},this.processVertices=function(e){return angular.forEach(e.vertices,function(e,t){return e.type="regular"}),e.vertices.unshift({name:"Scheduled","start-time":e.timestamps.CREATED,"end-time":e.timestamps.CREATED+1,type:"scheduled"})},this.listJobs=function(){var r;return r=i.defer(),e.get(t.jobServer+"joboverview").success(function(e){return function(t,n,i,o){return angular.forEach(t,function(t,r){switch(r){case"running":return c.running=e.setEndTimes(t);case"finished":return c.finished=e.setEndTimes(t);case"cancelled":return c.cancelled=e.setEndTimes(t);case"failed":return c.failed=e.setEndTimes(t)}}),r.resolve(c),d()}}(this)),r.promise},this.getJobs=function(e){return c[e]},this.getAllJobs=function(){return c},this.loadJob=function(r){return a=null,l.job=i.defer(),e.get(t.jobServer+"jobs/"+r).success(function(n){return function(i,o,s,u){return n.setEndTimes(i.vertices),n.processVertices(i),e.get(t.jobServer+"jobs/"+r+"/config").success(function(e){return i=angular.extend(i,e),a=i,l.job.resolve(a)})}}(this)),l.job.promise},this.getNode=function(e){var t,r;return r=function(e,t){var n,i,o,a;for(n=0,i=t.length;n
{{metric.id}}
{{value | humanizeChartNumeric:metric}}
',replace:!0,scope:{metric:"=",window:"=",removeMetric:"&",setMetricSize:"=",setMetricView:"=",getValues:"&"},link:function(e,t,r){return e.btnClasses=["btn","btn-default","btn-xs"],e.value=null,e.data=[{values:e.getValues()}],e.options={x:function(e,t){return e.x},y:function(e,t){return e.y},xTickFormat:function(e){return d3.time.format("%H:%M:%S")(new Date(e))},yTickFormat:function(e){var t,r,n,i;for(r=!1,n=0,i=1,t=Math.abs(e);!r&&n<50;)Math.pow(10,n)<=t&&t6?e/Math.pow(10,n)+"E"+n:""+e}},e.showChart=function(){return d3.select(t.find("svg")[0]).datum(e.data).transition().duration(250).call(e.chart)},e.chart=nv.models.lineChart().options(e.options).showLegend(!1).margin({top:15,left:60,bottom:30,right:30}),e.chart.yAxis.showMaxMin(!1),e.chart.tooltip.hideDelay(0),e.chart.tooltip.contentGenerator(function(e){return"

"+d3.time.format("%H:%M:%S")(new Date(e.point.x))+" | "+e.point.y+"

"}),nv.utils.windowResize(e.chart.update),e.setSize=function(t){return e.setMetricSize(e.metric,t)},e.setView=function(t){if(e.setMetricView(e.metric,t),"chart"===t)return e.showChart()},"chart"===e.metric.view&&e.showChart(),e.$on("metrics:data:update",function(t,r,n){return e.value=parseFloat(n[e.metric.id]),e.data[0].values.push({x:r,y:e.value}),e.data[0].values.length>e.window&&e.data[0].values.shift(),"chart"===e.metric.view&&e.showChart(),"chart"===e.metric.view&&e.chart.clearHighlights(),e.chart.tooltip.hidden(!0)}),t.find(".metric-title").qtip({content:{text:e.metric.id},position:{my:"bottom left",at:"top left"},style:{classes:"qtip-light qtip-timeline-bar"}})}}}),angular.module("flinkApp").service("MetricsService",["$http","$q","flinkConfig","$interval",function(e,t,r,n){return this.metrics={},this.values={},this.watched={},this.observer={jobid:null,nodeid:null,callback:null},this.refresh=n(function(e){return function(){return angular.forEach(e.metrics,function(t,r){return angular.forEach(t,function(t,n){var i;if(i=[],angular.forEach(t,function(e,t){return i.push(e.id)}),i.length>0)return e.getMetrics(r,n,i).then(function(t){if(r===e.observer.jobid&&n===e.observer.nodeid&&e.observer.callback)return e.observer.callback(t)})})})}}(this),r["refresh-interval"]),this.registerObserver=function(e,t,r){return this.observer.jobid=e,this.observer.nodeid=t,this.observer.callback=r},this.unRegisterObserver=function(){return this.observer={jobid:null,nodeid:null,callback:null}},this.setupMetrics=function(e,t){return this.setupLS(),this.watched[e]=[],angular.forEach(t,function(t){return function(r,n){if(r.id)return t.watched[e].push(r.id)}}(this))},this.getWindow=function(){return 100},this.setupLS=function(){return null==sessionStorage.flinkMetrics&&this.saveSetup(),this.metrics=JSON.parse(sessionStorage.flinkMetrics)},this.saveSetup=function(){return sessionStorage.flinkMetrics=JSON.stringify(this.metrics)},this.saveValue=function(e,t,r){if(null==this.values[e]&&(this.values[e]={}),null==this.values[e][t]&&(this.values[e][t]=[]),this.values[e][t].push(r),this.values[e][t].length>this.getWindow())return this.values[e][t].shift()},this.getValues=function(e,t,r){var n;return null==this.values[e]?[]:null==this.values[e][t]?[]:(n=[],angular.forEach(this.values[e][t],function(e){return function(e,t){if(null!=e.values[r])return n.push({x:e.timestamp,y:e.values[r]})}}(this)),n)},this.setupLSFor=function(e,t){if(null==this.metrics[e]&&(this.metrics[e]={}),null==this.metrics[e][t])return this.metrics[e][t]=[]},this.addMetric=function(e,t,r){return this.setupLSFor(e,t),this.metrics[e][t].push({id:r,size:"small",view:"chart"}),this.saveSetup()},this.removeMetric=function(e){return function(t,r,n){var i;if(null!=e.metrics[t][r])return i=e.metrics[t][r].indexOf(n),i===-1&&(i=_.findIndex(e.metrics[t][r],{id:n})),i!==-1&&e.metrics[t][r].splice(i,1),e.saveSetup()}}(this),this.setMetricSize=function(e){return function(t,r,n,i){var o;if(null!=e.metrics[t][r])return o=e.metrics[t][r].indexOf(n.id),o===-1&&(o=_.findIndex(e.metrics[t][r],{id:n.id})),o!==-1&&(e.metrics[t][r][o]={id:n.id,size:i,view:n.view}),e.saveSetup()}}(this),this.setMetricView=function(e){return function(t,r,n,i){var o;if(null!=e.metrics[t][r])return o=e.metrics[t][r].indexOf(n.id),o===-1&&(o=_.findIndex(e.metrics[t][r],{id:n.id})),o!==-1&&(e.metrics[t][r][o]={id:n.id,size:n.size,view:i}),e.saveSetup()}}(this),this.orderMetrics=function(e,t,r,n){return this.setupLSFor(e,t),angular.forEach(this.metrics[e][t],function(i){return function(o,a){if(o.id===r.id&&(i.metrics[e][t].splice(a,1),a$.top&&($.top=b.height(),Z=t.utils.availableHeight(M,G,$)-O),ot.select(".nv-legendWrap").attr("transform","translate("+lt+","+-$.top+")")}else ot.select(".nv-legendWrap").selectAll("*").remove();rt.attr("transform","translate("+$.left+","+$.top+")"),ot.select(".nv-context").style("display",T?"initial":"none"),d.width(X).height(Q).color(w.map(function(t,e){return t.color||E(t,e)}).filter(function(t,e){return!w[e].disabled&&w[e].bar})),c.width(X).height(Q).color(w.map(function(t,e){return t.color||E(t,e)}).filter(function(t,e){return!w[e].disabled&&!w[e].bar}));var ct=ot.select(".nv-context .nv-barsWrap").datum(J.length?J:[{values:[]}]),ft=ot.select(".nv-context .nv-linesWrap").datum(Y(tt)?[{values:[]}]:tt.filter(function(t){return!t.disabled}));ot.select(".nv-context").attr("transform","translate(0,"+(Z+$.bottom+k.top)+")"),ct.transition().call(d),ft.transition().call(c),D&&(p._ticks(t.utils.calcTicksX(X/100,w)).tickSize(-Q,0),ot.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+s.range()[0]+")"),ot.select(".nv-context .nv-x.nv-axis").transition().call(p)),N&&(m.scale(s)._ticks(Q/36).tickSize(-X,0),y.scale(u)._ticks(Q/36).tickSize(J.length?0:-X,0),ot.select(".nv-context .nv-y3.nv-axis").style("opacity",J.length?1:0).attr("transform","translate(0,"+i.range()[0]+")"),ot.select(".nv-context .nv-y2.nv-axis").style("opacity",tt.length?1:0).attr("transform","translate("+i.range()[1]+",0)"),ot.select(".nv-context .nv-y1.nv-axis").transition().call(m),ot.select(".nv-context .nv-y2.nv-axis").transition().call(y)),x.x(i).on("brush",V),j&&x.extent(j);var dt=ot.select(".nv-brushBackground").selectAll("g").data([j||x.extent()]),ht=dt.enter().append("g");ht.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",Q),ht.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",Q);var pt=ot.select(".nv-x.nv-brush").call(x);pt.selectAll("rect").attr("height",Q),pt.selectAll(".resize").append("path").attr("d",I),b.dispatch.on("stateChange",function(t){for(var n in t)F[n]=t[n];L.stateChange(F),e.update()}),L.on("changeState",function(t){"undefined"!=typeof t.disabled&&(w.forEach(function(e,n){e.disabled=t.disabled[n]}),F.disabled=t.disabled),e.update()}),V()}),e}var n,r,i,o,a,s,u,l=t.models.line(),c=t.models.line(),f=t.models.historicalBar(),d=t.models.historicalBar(),h=t.models.axis(),p=t.models.axis(),g=t.models.axis(),v=t.models.axis(),m=t.models.axis(),y=t.models.axis(),b=t.models.legend(),x=d3.svg.brush(),w=t.models.tooltip(),$={top:30,right:30,bottom:30,left:60},k={top:0,right:30,bottom:20,left:60},_=null,M=null,C=function(t){return t.x},S=function(t){return t.y},E=t.utils.defaultColor(),A=!0,T=!0,N=!1,D=!0,O=50,j=null,I=null,L=d3.dispatch("brush","stateChange","changeState"),P=0,F=t.utils.state(),q=null,z=" (left axis)",W=" (right axis)",R=!1;l.clipEdge(!0),c.interactive(!1),c.pointActive(function(t){return!1}),h.orient("bottom").tickPadding(5),g.orient("left"),v.orient("right"),p.orient("bottom").tickPadding(5),m.orient("left"),y.orient("right"),w.headerEnabled(!0).headerFormatter(function(t,e){return h.tickFormat()(t,e)});var B=function(){return R?{main:v,focus:y}:{main:g,focus:m}},V=function(){return R?{main:g,focus:m}:{main:v,focus:y}},H=function(t){return function(){return{active:t.map(function(t){return!t.disabled})}}},U=function(t){return function(e){void 0!==e.active&&t.forEach(function(t,n){t.disabled=!e.active[n]})}},Y=function(t){return t.every(function(t){return t.disabled})};return l.dispatch.on("elementMouseover.tooltip",function(t){w.duration(100).valueFormatter(function(t,e){return V().main.tickFormat()(t,e)}).data(t).hidden(!1)}),l.dispatch.on("elementMouseout.tooltip",function(t){w.hidden(!0)}),f.dispatch.on("elementMouseover.tooltip",function(t){t.value=e.x()(t.data),t.series={value:e.y()(t.data),color:t.color},w.duration(0).valueFormatter(function(t,e){return B().main.tickFormat()(t,e)}).data(t).hidden(!1)}),f.dispatch.on("elementMouseout.tooltip",function(t){w.hidden(!0)}),f.dispatch.on("elementMousemove.tooltip",function(t){w()}),e.dispatch=L,e.legend=b,e.lines=l,e.lines2=c,e.bars=f,e.bars2=d,e.xAxis=h,e.x2Axis=p,e.y1Axis=g,e.y2Axis=v,e.y3Axis=m,e.y4Axis=y,e.tooltip=w,e.options=t.utils.optionsFunc.bind(e),e._options=Object.create({},{width:{get:function(){return _},set:function(t){_=t}},height:{get:function(){return M},set:function(t){M=t}},showLegend:{get:function(){return A},set:function(t){A=t}},brushExtent:{get:function(){return j},set:function(t){j=t}},noData:{get:function(){return I},set:function(t){I=t}},focusEnable:{get:function(){return T},set:function(t){T=t}},focusHeight:{get:function(){return O},set:function(t){O=t}},focusShowAxisX:{get:function(){return D},set:function(t){D=t}},focusShowAxisY:{get:function(){return N},set:function(t){N=t}},legendLeftAxisHint:{get:function(){return z},set:function(t){z=t}},legendRightAxisHint:{get:function(){return W},set:function(t){W=t}},margin:{get:function(){return $},set:function(t){$.top=void 0!==t.top?t.top:$.top,$.right=void 0!==t.right?t.right:$.right,$.bottom=void 0!==t.bottom?t.bottom:$.bottom,$.left=void 0!==t.left?t.left:$.left}},focusMargin:{get:function(){return k},set:function(t){k.top=void 0!==t.top?t.top:k.top,k.right=void 0!==t.right?t.right:k.right,k.bottom=void 0!==t.bottom?t.bottom:k.bottom,k.left=void 0!==t.left?t.left:k.left}},duration:{get:function(){return P},set:function(t){P=t}},color:{get:function(){return E},set:function(e){E=t.utils.getColor(e),b.color(E)}},x:{get:function(){return C},set:function(t){C=t,l.x(t),c.x(t),f.x(t),d.x(t)}},y:{get:function(){return S},set:function(t){S=t,l.y(t),c.y(t),f.y(t),d.y(t)}},switchYAxisOrder:{get:function(){return R},set:function(t){if(R!==t){var e=g;g=v,v=e;var n=m;m=y,y=n}R=t,g.orient("left"),v.orient("right"),m.orient("left"),y.orient("right")}}}),t.utils.inheritOptions(e,l),t.utils.initOptions(e),e},t.models.multiBar=function(){"use strict";function e(N){return A.reset(),N.each(function(e){var N=c-l.left-l.right,D=f-l.top-l.bottom;g=d3.select(this),t.utils.initSVG(g);var O=0;if(k&&e.length&&(k=[{values:e[0].values.map(function(t){return{x:t.x,y:0,series:t.series,size:.01}})}]),x){var j=d3.layout.stack().offset(w).values(function(t){return t.values}).y(m)(!e.length&&k?k:e);j.forEach(function(t,n){t.nonStackable?(e[n].nonStackableSeries=O++,j[n]=e[n]):n>0&&j[n-1].nonStackable&&j[n].values.map(function(t,e){t.y0-=j[n-1].values[e].y,t.y1=t.y0+t.y})}),e=j}e.forEach(function(t,e){t.values.forEach(function(n){n.series=e,n.key=t.key})}),x&&e.length>0&&e[0].values.map(function(t,n){var r=0,i=0;e.map(function(t,o){if(!e[o].nonStackable){var a=t.values[n];a.size=Math.abs(a.y),a.y<0?(a.y1=i,i-=a.size):(a.y1=a.size+r,r+=a.size)}})});var I=r&&i?[]:e.map(function(t,e){return t.values.map(function(t,n){return{x:v(t,n),y:m(t,n),y0:t.y0,y1:t.y1,idx:e}})});d.domain(r||d3.merge(I).map(function(t){return t.x})).rangeBands(o||[0,N],C),h.domain(i||d3.extent(d3.merge(I).map(function(t){var n=t.y;return x&&!e[t.idx].nonStackable&&(n=t.y>0?t.y1:t.y1+t.y),n}).concat(y))).range(a||[D,0]),d.domain()[0]===d.domain()[1]&&(d.domain()[0]?d.domain([d.domain()[0]-.01*d.domain()[0],d.domain()[1]+.01*d.domain()[1]]):d.domain([-1,1])),h.domain()[0]===h.domain()[1]&&(h.domain()[0]?h.domain([h.domain()[0]+.01*h.domain()[0],h.domain()[1]-.01*h.domain()[1]]):h.domain([-1,1])),s=s||d,u=u||h;var L=g.selectAll("g.nv-wrap.nv-multibar").data([e]),P=L.enter().append("g").attr("class","nvd3 nv-wrap nv-multibar"),F=P.append("defs"),q=P.append("g"),z=L.select("g");q.append("g").attr("class","nv-groups"),L.attr("transform","translate("+l.left+","+l.top+")"),F.append("clipPath").attr("id","nv-edge-clip-"+p).append("rect"),L.select("#nv-edge-clip-"+p+" rect").attr("width",N).attr("height",D),z.attr("clip-path",b?"url(#nv-edge-clip-"+p+")":"");var W=L.select(".nv-groups").selectAll(".nv-group").data(function(t){return t},function(t,e){return e});W.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);var R=A.transition(W.exit().selectAll("rect.nv-bar"),"multibarExit",Math.min(100,M)).attr("y",function(t,n,r){var i=u(0)||0;return x&&e[t.series]&&!e[t.series].nonStackable&&(i=u(t.y0)),i}).attr("height",0).remove();R.delay&&R.delay(function(t,e){var n=e*(M/(T+1))-e;return n}),W.attr("class",function(t,e){return"nv-group nv-series-"+e}).classed("hover",function(t){return t.hover}).style("fill",function(t,e){return $(t,e)}).style("stroke",function(t,e){return $(t,e)}),W.style("stroke-opacity",1).style("fill-opacity",S);var B=W.selectAll("rect.nv-bar").data(function(t){return k&&!e.length?k.values:t.values});B.exit().remove();B.enter().append("rect").attr("class",function(t,e){return m(t,e)<0?"nv-bar negative":"nv-bar positive"}).attr("x",function(t,n,r){return x&&!e[r].nonStackable?0:r*d.rangeBand()/e.length}).attr("y",function(t,n,r){return u(x&&!e[r].nonStackable?t.y0:0)||0}).attr("height",0).attr("width",function(t,n,r){return d.rangeBand()/(x&&!e[r].nonStackable?1:e.length)}).attr("transform",function(t,e){return"translate("+d(v(t,e))+",0)"});B.style("fill",function(t,e,n){return $(t,n,e)}).style("stroke",function(t,e,n){return $(t,n,e)}).on("mouseover",function(t,e){d3.select(this).classed("hover",!0),E.elementMouseover({data:t,index:e,color:d3.select(this).style("fill")})}).on("mouseout",function(t,e){d3.select(this).classed("hover",!1),E.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")})}).on("mousemove",function(t,e){E.elementMousemove({data:t,index:e,color:d3.select(this).style("fill")})}).on("click",function(t,e){var n=this;E.elementClick({data:t,index:e,color:d3.select(this).style("fill"),event:d3.event,element:n}),d3.event.stopPropagation()}).on("dblclick",function(t,e){E.elementDblClick({data:t,index:e,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}),B.attr("class",function(t,e){return m(t,e)<0?"nv-bar negative":"nv-bar positive"}).attr("transform",function(t,e){return"translate("+d(v(t,e))+",0)"}),_&&(n||(n=e.map(function(){return!0})),B.style("fill",function(t,e,r){return d3.rgb(_(t,e)).darker(n.map(function(t,e){return e}).filter(function(t,e){return!n[e]})[r]).toString()}).style("stroke",function(t,e,r){return d3.rgb(_(t,e)).darker(n.map(function(t,e){return e}).filter(function(t,e){return!n[e]})[r]).toString()}));var V=B.watchTransition(A,"multibar",Math.min(250,M)).delay(function(t,n){return n*M/e[0].values.length});x?V.attr("y",function(t,n,r){var i=0;return i=e[r].nonStackable?m(t,n)<0?h(0):h(0)-h(m(t,n))<-1?h(0)-1:h(m(t,n))||0:h(t.y1)}).attr("height",function(t,n,r){return e[r].nonStackable?Math.max(Math.abs(h(m(t,n))-h(0)),0)||0:Math.max(Math.abs(h(t.y+t.y0)-h(t.y0)),0)}).attr("x",function(t,n,r){var i=0;return e[r].nonStackable&&(i=t.series*d.rangeBand()/e.length,e.length!==O&&(i=e[r].nonStackableSeries*d.rangeBand()/(2*O))),i}).attr("width",function(t,n,r){if(e[r].nonStackable){var i=d.rangeBand()/O;return e.length!==O&&(i=d.rangeBand()/(2*O)),i}return d.rangeBand()}):V.attr("x",function(t,n){return t.series*d.rangeBand()/e.length}).attr("width",d.rangeBand()/e.length).attr("y",function(t,e){return m(t,e)<0?h(0):h(0)-h(m(t,e))<1?h(0)-1:h(m(t,e))||0}).attr("height",function(t,e){return Math.max(Math.abs(h(m(t,e))-h(0)),1)||0}),s=d.copy(),u=h.copy(),e[0]&&e[0].values&&(T=e[0].values.length)}),A.renderEnd("multibar immediate"),e}var n,r,i,o,a,s,u,l={top:0,right:0,bottom:0,left:0},c=960,f=500,d=d3.scale.ordinal(),h=d3.scale.linear(),p=Math.floor(1e4*Math.random()),g=null,v=function(t){return t.x},m=function(t){return t.y},y=[0],b=!0,x=!1,w="zero",$=t.utils.defaultColor(),k=!1,_=null,M=500,C=.1,S=.75,E=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),A=t.utils.renderWatch(E,M),T=0;return e.dispatch=E,e.options=t.utils.optionsFunc.bind(e),e._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return f},set:function(t){f=t}},x:{get:function(){return v},set:function(t){v=t}},y:{get:function(){return m},set:function(t){m=t}},xScale:{get:function(){return d},set:function(t){d=t}},yScale:{get:function(){return h},set:function(t){h=t}},xDomain:{get:function(){return r},set:function(t){r=t}},yDomain:{get:function(){return i},set:function(t){i=t}},xRange:{get:function(){return o},set:function(t){o=t}},yRange:{get:function(){return a},set:function(t){a=t}},forceY:{get:function(){return y},set:function(t){y=t}},stacked:{get:function(){return x},set:function(t){x=t}},stackOffset:{get:function(){return w},set:function(t){w=t}},clipEdge:{get:function(){return b},set:function(t){b=t}},disabled:{get:function(){return n},set:function(t){n=t}},id:{get:function(){return p},set:function(t){p=t}},hideable:{get:function(){return k},set:function(t){k=t}},groupSpacing:{get:function(){return C},set:function(t){C=t}},fillOpacity:{get:function(){return S},set:function(t){S=t}},margin:{get:function(){return l},set:function(t){l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return M},set:function(t){M=t,A.reset(M)}},color:{get:function(){return $},set:function(e){$=t.utils.getColor(e)}},barColor:{get:function(){return _},set:function(e){_=e?t.utils.getColor(e):null}}}),t.utils.initOptions(e),e},t.models.multiBarChart=function(){"use strict";function e(S){return D.reset(),D.models(i),y&&D.models(o),b&&D.models(a),S.each(function(S){var D=d3.select(this);t.utils.initSVG(D);var L=t.utils.availableWidth(d,D,f),P=t.utils.availableHeight(h,D,f);if(e.update=function(){0===T?D.call(e):D.transition().duration(T).call(e)},e.container=this,M.setter(I(S),e.update).getter(j(S)).update(),M.disabled=S.map(function(t){return!!t.disabled}),!C){var F;C={};for(F in M)M[F]instanceof Array?C[F]=M[F].slice(0):C[F]=M[F]}if(!(S&&S.length&&S.filter(function(t){return t.values.length}).length))return t.utils.noData(e,D),e;D.selectAll(".nv-noData").remove(),n=i.xScale(),r=i.yScale();var q=D.selectAll("g.nv-wrap.nv-multiBarWithLegend").data([S]),z=q.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarWithLegend").append("g"),W=q.select("g");if(z.append("g").attr("class","nv-x nv-axis"),z.append("g").attr("class","nv-y nv-axis"),z.append("g").attr("class","nv-barsWrap"),z.append("g").attr("class","nv-legendWrap"),z.append("g").attr("class","nv-controlsWrap"),z.append("g").attr("class","nv-interactive"),m?(u.width(L-A()),W.select(".nv-legendWrap").datum(S).call(u),u.height()>f.top&&(f.top=u.height(),P=t.utils.availableHeight(h,D,f)),W.select(".nv-legendWrap").attr("transform","translate("+A()+","+-f.top+")")):W.select(".nv-legendWrap").selectAll("*").remove(),g){var R=[{key:v.grouped||"Grouped",disabled:i.stacked()},{key:v.stacked||"Stacked",disabled:!i.stacked()}];l.width(A()).color(["#444","#444","#444"]),W.select(".nv-controlsWrap").datum(R).attr("transform","translate(0,"+-f.top+")").call(l)}else W.select(".nv-controlsWrap").selectAll("*").remove();q.attr("transform","translate("+f.left+","+f.top+")"),x&&W.select(".nv-y.nv-axis").attr("transform","translate("+L+",0)"),i.disabled(S.map(function(t){return t.disabled})).width(L).height(P).color(S.map(function(t,e){return t.color||p(t,e)}).filter(function(t,e){return!S[e].disabled}));var B=W.select(".nv-barsWrap").datum(S.filter(function(t){return!t.disabled}));if(B.call(i),y){o.scale(n)._ticks(t.utils.calcTicksX(L/100,S)).tickSize(-P,0),W.select(".nv-x.nv-axis").attr("transform","translate(0,"+r.range()[0]+")"),W.select(".nv-x.nv-axis").call(o);var V=W.select(".nv-x.nv-axis > g").selectAll("g");if(V.selectAll("line, text").style("opacity",1),$){var H=function(t,e){return"translate("+t+","+e+")"},U=5,Y=17;V.selectAll("text").attr("transform",function(t,e,n){return H(0,n%2==0?U:Y)});var G=d3.selectAll(".nv-x.nv-axis .nv-wrap g g text")[0].length;W.selectAll(".nv-x.nv-axis .nv-axisMaxMin text").attr("transform",function(t,e){return H(0,0===e||G%2!==0?Y:U)})}k&&W.selectAll(".tick text").call(t.utils.wrapTicks,e.xAxis.rangeBand()),w&&V.filter(function(t,e){return e%Math.ceil(S[0].values.length/(L/100))!==0}).selectAll("text, line").style("opacity",0),_&&V.selectAll(".tick text").attr("transform","rotate("+_+" 0,0)").style("text-anchor",_>0?"start":"end"),W.select(".nv-x.nv-axis").selectAll("g.nv-axisMaxMin text").style("opacity",1)}b&&(a.scale(r)._ticks(t.utils.calcTicksY(P/36,S)).tickSize(-L,0),W.select(".nv-y.nv-axis").call(a)),N&&(s.width(L).height(P).margin({left:f.left,top:f.top}).svgContainer(D).xScale(n),q.select(".nv-interactive").call(s)),u.dispatch.on("stateChange",function(t){for(var n in t)M[n]=t[n];E.stateChange(M),e.update()}),l.dispatch.on("legendClick",function(t,n){if(t.disabled){switch(R=R.map(function(t){return t.disabled=!0,t}),t.disabled=!1,t.key){case"Grouped":case v.grouped:i.stacked(!1);break;case"Stacked":case v.stacked:i.stacked(!0)}M.stacked=i.stacked(),E.stateChange(M),e.update()}}),E.on("changeState",function(t){"undefined"!=typeof t.disabled&&(S.forEach(function(e,n){e.disabled=t.disabled[n]}),M.disabled=t.disabled),"undefined"!=typeof t.stacked&&(i.stacked(t.stacked),M.stacked=t.stacked,O=t.stacked),e.update()}),N?(s.dispatch.on("elementMousemove",function(t){if(void 0!=t.pointXValue){var r,i,o,a,u=[];S.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(s,l){i=n.domain().indexOf(t.pointXValue);var c=s.values[i];void 0!==c&&(a=c.x,void 0===r&&(r=c),void 0===o&&(o=t.mouseX),u.push({key:s.key,value:e.y()(c,i),color:p(s,s.seriesIndex),data:s.values[i]}))}),s.tooltip.data({value:a,index:i,series:u})(),s.renderGuideLine(o)}}),s.dispatch.on("elementMouseout",function(t){s.tooltip.hidden(!0)})):(i.dispatch.on("elementMouseover.tooltip",function(t){t.value=e.x()(t.data),t.series={key:t.data.key,value:e.y()(t.data),color:t.color},c.data(t).hidden(!1)}),i.dispatch.on("elementMouseout.tooltip",function(t){c.hidden(!0)}),i.dispatch.on("elementMousemove.tooltip",function(t){c()}))}),D.renderEnd("multibarchart immediate"),e}var n,r,i=t.models.multiBar(),o=t.models.axis(),a=t.models.axis(),s=t.interactiveGuideline(),u=t.models.legend(),l=t.models.legend(),c=t.models.tooltip(),f={top:30,right:20,bottom:50,left:60},d=null,h=null,p=t.utils.defaultColor(),g=!0,v={},m=!0,y=!0,b=!0,x=!1,w=!0,$=!1,k=!1,_=0,M=t.utils.state(),C=null,S=null,E=d3.dispatch("stateChange","changeState","renderEnd"),A=function(){return g?180:0},T=250,N=!1;M.stacked=!1,i.stacked(!1),o.orient("bottom").tickPadding(7).showMaxMin(!1).tickFormat(function(t){return t}),a.orient(x?"right":"left").tickFormat(d3.format(",.1f")),c.duration(0).valueFormatter(function(t,e){return a.tickFormat()(t,e)}).headerFormatter(function(t,e){return o.tickFormat()(t,e)}),l.updateState(!1);var D=t.utils.renderWatch(E),O=!1,j=function(t){return function(){return{active:t.map(function(t){return!t.disabled}),stacked:O}}},I=function(t){return function(e){void 0!==e.stacked&&(O=e.stacked),void 0!==e.active&&t.forEach(function(t,n){t.disabled=!e.active[n]})}};return e.dispatch=E,e.multibar=i,e.legend=u,e.controls=l,e.xAxis=o,e.yAxis=a,e.state=M,e.tooltip=c,e.interactiveLayer=s,e.options=t.utils.optionsFunc.bind(e),e._options=Object.create({},{width:{get:function(){return d},set:function(t){d=t}},height:{get:function(){return h},set:function(t){h=t}},showLegend:{get:function(){return m},set:function(t){m=t}},showControls:{get:function(){return g},set:function(t){g=t}},controlLabels:{get:function(){return v},set:function(t){v=t}},showXAxis:{get:function(){return y},set:function(t){y=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return C},set:function(t){C=t}},noData:{get:function(){return S},set:function(t){S=t}},reduceXTicks:{get:function(){return w},set:function(t){w=t}},rotateLabels:{get:function(){return _},set:function(t){_=t}},staggerLabels:{get:function(){return $},set:function(t){$=t}},wrapLabels:{get:function(){return k},set:function(t){k=!!t}},margin:{get:function(){return f},set:function(t){f.top=void 0!==t.top?t.top:f.top,f.right=void 0!==t.right?t.right:f.right,f.bottom=void 0!==t.bottom?t.bottom:f.bottom,f.left=void 0!==t.left?t.left:f.left}},duration:{get:function(){return T},set:function(t){T=t,i.duration(T),o.duration(T),a.duration(T),D.reset(T)}},color:{get:function(){return p},set:function(e){p=t.utils.getColor(e),u.color(p)}},rightAlignYAxis:{get:function(){return x},set:function(t){x=t,a.orient(x?"right":"left")}},useInteractiveGuideline:{get:function(){return N},set:function(t){N=t}},barColor:{get:function(){return i.barColor},set:function(t){i.barColor(t),u.color(function(t,e){return d3.rgb("#ccc").darker(1.5*e).toString()})}}}),t.utils.inheritOptions(e,i),t.utils.initOptions(e),e},t.models.multiBarHorizontal=function(){"use strict";function e(d){return N.reset(),d.each(function(e){var d=c-l.left-l.right,A=f-l.top-l.bottom;h=d3.select(this),t.utils.initSVG(h),$&&(e=d3.layout.stack().offset("zero").values(function(t){return t.values}).y(m)(e)),e.forEach(function(t,e){t.values.forEach(function(n){n.series=e,n.key=t.key})}),$&&e[0].values.map(function(t,n){var r=0,i=0;e.map(function(t){var e=t.values[n];e.size=Math.abs(e.y),e.y<0?(e.y1=i-e.size,i-=e.size):(e.y1=r,r+=e.size)})});var D=r&&i?[]:e.map(function(t){return t.values.map(function(t,e){return{x:v(t,e),y:m(t,e),y0:t.y0,y1:t.y1}})});p.domain(r||d3.merge(D).map(function(t){return t.x})).rangeBands(o||[0,A],C),g.domain(i||d3.extent(d3.merge(D).map(function(t){return $?t.y>0?t.y1+t.y:t.y1:t.y}).concat(b))),k&&!$?g.range(a||[g.domain()[0]<0?M:0,d-(g.domain()[1]>0?M:0)]):g.range(a||[0,d]),s=s||p,u=u||d3.scale.linear().domain(g.domain()).range([g(0),g(0)]);var O=d3.select(this).selectAll("g.nv-wrap.nv-multibarHorizontal").data([e]),j=O.enter().append("g").attr("class","nvd3 nv-wrap nv-multibarHorizontal"),I=(j.append("defs"),j.append("g"));O.select("g");I.append("g").attr("class","nv-groups"),O.attr("transform","translate("+l.left+","+l.top+")");var L=O.select(".nv-groups").selectAll(".nv-group").data(function(t){return t},function(t,e){return e});L.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),L.exit().watchTransition(N,"multibarhorizontal: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),L.attr("class",function(t,e){return"nv-group nv-series-"+e}).classed("hover",function(t){return t.hover}).style("fill",function(t,e){return x(t,e)}).style("stroke",function(t,e){return x(t,e)}),L.watchTransition(N,"multibarhorizontal: groups").style("stroke-opacity",1).style("fill-opacity",S);var P=L.selectAll("g.nv-bar").data(function(t){return t.values});P.exit().remove();var F=P.enter().append("g").attr("transform",function(t,n,r){return"translate("+u($?t.y0:0)+","+($?0:r*p.rangeBand()/e.length+p(v(t,n)))+")"});F.append("rect").attr("width",0).attr("height",p.rangeBand()/($?1:e.length)),P.on("mouseover",function(t,e){d3.select(this).classed("hover",!0),T.elementMouseover({data:t,index:e,color:d3.select(this).style("fill")})}).on("mouseout",function(t,e){d3.select(this).classed("hover",!1),T.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")})}).on("mouseout",function(t,e){T.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")})}).on("mousemove",function(t,e){T.elementMousemove({data:t,index:e,color:d3.select(this).style("fill")})}).on("click",function(t,e){var n=this;T.elementClick({data:t,index:e,color:d3.select(this).style("fill"),event:d3.event,element:n}),d3.event.stopPropagation()}).on("dblclick",function(t,e){T.elementDblClick({data:t,index:e,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}),y(e[0],0)&&(F.append("polyline"),P.select("polyline").attr("fill","none").attr("points",function(t,n){var r=y(t,n),i=.8*p.rangeBand()/(2*($?1:e.length));r=r.length?r:[-Math.abs(r),Math.abs(r)],r=r.map(function(t){return g(t)-g(0)});var o=[[r[0],-i],[r[0],i],[r[0],0],[r[1],0],[r[1],-i],[r[1],i]];return o.map(function(t){return t.join(",")}).join(" ")}).attr("transform",function(t,n){var r=p.rangeBand()/(2*($?1:e.length));return"translate("+(m(t,n)<0?0:g(m(t,n))-g(0))+", "+r+")"})),F.append("text"),k&&!$?(P.select("text").attr("text-anchor",function(t,e){return m(t,e)<0?"end":"start"}).attr("y",p.rangeBand()/(2*e.length)).attr("dy",".32em").text(function(t,e){var n=E(m(t,e)),r=y(t,e);return void 0===r?n:r.length?n+"+"+E(Math.abs(r[1]))+"-"+E(Math.abs(r[0])):n+"±"+E(Math.abs(r))}),P.watchTransition(N,"multibarhorizontal: bars").select("text").attr("x",function(t,e){return m(t,e)<0?-4:g(m(t,e))-g(0)+4})):P.selectAll("text").text(""),_&&!$?(F.append("text").classed("nv-bar-label",!0),P.select("text.nv-bar-label").attr("text-anchor",function(t,e){return m(t,e)<0?"start":"end"}).attr("y",p.rangeBand()/(2*e.length)).attr("dy",".32em").text(function(t,e){return v(t,e)}),P.watchTransition(N,"multibarhorizontal: bars").select("text.nv-bar-label").attr("x",function(t,e){return m(t,e)<0?g(0)-g(m(t,e))+4:-4})):P.selectAll("text.nv-bar-label").text(""),P.attr("class",function(t,e){return m(t,e)<0?"nv-bar negative":"nv-bar positive"}),w&&(n||(n=e.map(function(){return!0})),P.style("fill",function(t,e,r){return d3.rgb(w(t,e)).darker(n.map(function(t,e){return e}).filter(function(t,e){return!n[e]})[r]).toString()}).style("stroke",function(t,e,r){return d3.rgb(w(t,e)).darker(n.map(function(t,e){return e}).filter(function(t,e){return!n[e]})[r]).toString()})),$?P.watchTransition(N,"multibarhorizontal: bars").attr("transform",function(t,e){return"translate("+g(t.y1)+","+p(v(t,e))+")"}).select("rect").attr("width",function(t,e){return Math.abs(g(m(t,e)+t.y0)-g(t.y0))||0}).attr("height",p.rangeBand()):P.watchTransition(N,"multibarhorizontal: bars").attr("transform",function(t,n){return"translate("+g(m(t,n)<0?m(t,n):0)+","+(t.series*p.rangeBand()/e.length+p(v(t,n)))+")"}).select("rect").attr("height",p.rangeBand()/e.length).attr("width",function(t,e){return Math.max(Math.abs(g(m(t,e))-g(0)),1)||0}),s=p.copy(),u=g.copy()}),N.renderEnd("multibarHorizontal immediate"),e}var n,r,i,o,a,s,u,l={top:0,right:0,bottom:0,left:0},c=960,f=500,d=Math.floor(1e4*Math.random()),h=null,p=d3.scale.ordinal(),g=d3.scale.linear(),v=function(t){return t.x},m=function(t){return t.y},y=function(t){return t.yErr},b=[0],x=t.utils.defaultColor(),w=null,$=!1,k=!1,_=!1,M=60,C=.1,S=.75,E=d3.format(",.2f"),A=250,T=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),N=t.utils.renderWatch(T,A);return e.dispatch=T,e.options=t.utils.optionsFunc.bind(e),e._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return f},set:function(t){f=t}},x:{get:function(){return v},set:function(t){v=t}},y:{get:function(){return m},set:function(t){m=t}},yErr:{get:function(){return y},set:function(t){y=t}},xScale:{get:function(){return p},set:function(t){p=t}},yScale:{get:function(){return g},set:function(t){g=t}},xDomain:{get:function(){return r},set:function(t){r=t}},yDomain:{get:function(){return i},set:function(t){i=t}},xRange:{get:function(){return o},set:function(t){o=t}},yRange:{get:function(){return a},set:function(t){a=t}},forceY:{get:function(){return b},set:function(t){b=t}},stacked:{get:function(){return $},set:function(t){$=t}},showValues:{get:function(){return k},set:function(t){k=t}},disabled:{get:function(){return n},set:function(t){n=t}},id:{get:function(){return d},set:function(t){d=t}},valueFormat:{get:function(){return E},set:function(t){E=t}},valuePadding:{get:function(){return M},set:function(t){M=t}},groupSpacing:{get:function(){return C},set:function(t){C=t}},fillOpacity:{get:function(){return S},set:function(t){S=t}},margin:{get:function(){return l},set:function(t){l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return A},set:function(t){A=t,N.reset(A)}},color:{get:function(){return x},set:function(e){x=t.utils.getColor(e)}},barColor:{get:function(){return w},set:function(e){w=e?t.utils.getColor(e):null}}}),t.utils.initOptions(e),e},t.models.multiBarHorizontalChart=function(){"use strict";function e(l){return E.reset(),E.models(i),m&&E.models(o),y&&E.models(a),l.each(function(l){var $=d3.select(this);t.utils.initSVG($);var E=t.utils.availableWidth(f,$,c),A=t.utils.availableHeight(d,$,c);if(e.update=function(){$.transition().duration(M).call(e)},e.container=this,b=i.stacked(),x.setter(S(l),e.update).getter(C(l)).update(),x.disabled=l.map(function(t){return!!t.disabled}),!w){var T;w={};for(T in x)x[T]instanceof Array?w[T]=x[T].slice(0):w[T]=x[T]}if(!(l&&l.length&&l.filter(function(t){return t.values.length}).length))return t.utils.noData(e,$),e;$.selectAll(".nv-noData").remove(),n=i.xScale(),r=i.yScale().clamp(!0);var N=$.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").data([l]),D=N.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarHorizontalChart").append("g"),O=N.select("g");if(D.append("g").attr("class","nv-x nv-axis"),D.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"), D.append("g").attr("class","nv-barsWrap"),D.append("g").attr("class","nv-legendWrap"),D.append("g").attr("class","nv-controlsWrap"),v?(s.width(E-_()),O.select(".nv-legendWrap").datum(l).call(s),s.height()>c.top&&(c.top=s.height(),A=t.utils.availableHeight(d,$,c)),O.select(".nv-legendWrap").attr("transform","translate("+_()+","+-c.top+")")):O.select(".nv-legendWrap").selectAll("*").remove(),p){var j=[{key:g.grouped||"Grouped",disabled:i.stacked()},{key:g.stacked||"Stacked",disabled:!i.stacked()}];u.width(_()).color(["#444","#444","#444"]),O.select(".nv-controlsWrap").datum(j).attr("transform","translate(0,"+-c.top+")").call(u)}else O.select(".nv-controlsWrap").selectAll("*").remove();N.attr("transform","translate("+c.left+","+c.top+")"),i.disabled(l.map(function(t){return t.disabled})).width(E).height(A).color(l.map(function(t,e){return t.color||h(t,e)}).filter(function(t,e){return!l[e].disabled}));var I=O.select(".nv-barsWrap").datum(l.filter(function(t){return!t.disabled}));if(I.transition().call(i),m){o.scale(n)._ticks(t.utils.calcTicksY(A/24,l)).tickSize(-E,0),O.select(".nv-x.nv-axis").call(o);var L=O.select(".nv-x.nv-axis").selectAll("g");L.selectAll("line, text")}y&&(a.scale(r)._ticks(t.utils.calcTicksX(E/100,l)).tickSize(-A,0),O.select(".nv-y.nv-axis").attr("transform","translate(0,"+A+")"),O.select(".nv-y.nv-axis").call(a)),O.select(".nv-zeroLine line").attr("x1",r(0)).attr("x2",r(0)).attr("y1",0).attr("y2",-A),s.dispatch.on("stateChange",function(t){for(var n in t)x[n]=t[n];k.stateChange(x),e.update()}),u.dispatch.on("legendClick",function(t,n){if(t.disabled){switch(j=j.map(function(t){return t.disabled=!0,t}),t.disabled=!1,t.key){case"Grouped":case g.grouped:i.stacked(!1);break;case"Stacked":case g.stacked:i.stacked(!0)}x.stacked=i.stacked(),k.stateChange(x),b=i.stacked(),e.update()}}),k.on("changeState",function(t){"undefined"!=typeof t.disabled&&(l.forEach(function(e,n){e.disabled=t.disabled[n]}),x.disabled=t.disabled),"undefined"!=typeof t.stacked&&(i.stacked(t.stacked),x.stacked=t.stacked,b=t.stacked),e.update()})}),E.renderEnd("multibar horizontal chart immediate"),e}var n,r,i=t.models.multiBarHorizontal(),o=t.models.axis(),a=t.models.axis(),s=t.models.legend().height(30),u=t.models.legend().height(30),l=t.models.tooltip(),c={top:30,right:20,bottom:50,left:60},f=null,d=null,h=t.utils.defaultColor(),p=!0,g={},v=!0,m=!0,y=!0,b=!1,x=t.utils.state(),w=null,$=null,k=d3.dispatch("stateChange","changeState","renderEnd"),_=function(){return p?180:0},M=250;x.stacked=!1,i.stacked(b),o.orient("left").tickPadding(5).showMaxMin(!1).tickFormat(function(t){return t}),a.orient("bottom").tickFormat(d3.format(",.1f")),l.duration(0).valueFormatter(function(t,e){return a.tickFormat()(t,e)}).headerFormatter(function(t,e){return o.tickFormat()(t,e)}),u.updateState(!1);var C=function(t){return function(){return{active:t.map(function(t){return!t.disabled}),stacked:b}}},S=function(t){return function(e){void 0!==e.stacked&&(b=e.stacked),void 0!==e.active&&t.forEach(function(t,n){t.disabled=!e.active[n]})}},E=t.utils.renderWatch(k,M);return i.dispatch.on("elementMouseover.tooltip",function(t){t.value=e.x()(t.data),t.series={key:t.data.key,value:e.y()(t.data),color:t.color},l.data(t).hidden(!1)}),i.dispatch.on("elementMouseout.tooltip",function(t){l.hidden(!0)}),i.dispatch.on("elementMousemove.tooltip",function(t){l()}),e.dispatch=k,e.multibar=i,e.legend=s,e.controls=u,e.xAxis=o,e.yAxis=a,e.state=x,e.tooltip=l,e.options=t.utils.optionsFunc.bind(e),e._options=Object.create({},{width:{get:function(){return f},set:function(t){f=t}},height:{get:function(){return d},set:function(t){d=t}},showLegend:{get:function(){return v},set:function(t){v=t}},showControls:{get:function(){return p},set:function(t){p=t}},controlLabels:{get:function(){return g},set:function(t){g=t}},showXAxis:{get:function(){return m},set:function(t){m=t}},showYAxis:{get:function(){return y},set:function(t){y=t}},defaultState:{get:function(){return w},set:function(t){w=t}},noData:{get:function(){return $},set:function(t){$=t}},margin:{get:function(){return c},set:function(t){c.top=void 0!==t.top?t.top:c.top,c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},duration:{get:function(){return M},set:function(t){M=t,E.reset(M),i.duration(M),o.duration(M),a.duration(M)}},color:{get:function(){return h},set:function(e){h=t.utils.getColor(e),s.color(h)}},barColor:{get:function(){return i.barColor},set:function(t){i.barColor(t),s.color(function(t,e){return d3.rgb("#ccc").darker(1.5*e).toString()})}}}),t.utils.inheritOptions(e,i),t.utils.initOptions(e),e},t.models.multiChart=function(){"use strict";function e(l){return l.each(function(l){function h(t){var e=2===l[t.seriesIndex].yAxis?T:A;t.value=t.point.x,t.series={value:t.point.y,color:t.point.color,key:t.series.key},D.duration(0).headerFormatter(function(t,e){return E.tickFormat()(t,e)}).valueFormatter(function(t,n){return e.tickFormat()(t,n)}).data(t).hidden(!1)}function O(t){var e=2===l[t.seriesIndex].yAxis?T:A;t.value=t.point.x,t.series={value:t.point.y,color:t.point.color,key:t.series.key},D.duration(100).headerFormatter(function(t,e){return E.tickFormat()(t,e)}).valueFormatter(function(t,n){return e.tickFormat()(t,n)}).data(t).hidden(!1)}function I(t){var e=2===l[t.seriesIndex].yAxis?T:A;t.point.x=C.x()(t.point),t.point.y=C.y()(t.point),D.duration(0).headerFormatter(function(t,e){return E.tickFormat()(t,e)}).valueFormatter(function(t,n){return e.tickFormat()(t,n)}).data(t).hidden(!1)}function L(t){var e=2===l[t.data.series].yAxis?T:A;t.value=_.x()(t.data),t.series={value:_.y()(t.data),color:t.color,key:t.data.key},D.duration(0).headerFormatter(function(t,e){return E.tickFormat()(t,e)}).valueFormatter(function(t,n){return e.tickFormat()(t,n)}).data(t).hidden(!1)}function P(){for(var t=0,e=j.length;ti.top&&(i.top=N.height(),W=t.utils.availableHeight(s,q,i)),tt.select(".legendWrap").attr("transform","translate("+rt+","+-i.top+")")}else tt.select(".legendWrap").selectAll("*").remove();x.width(z).height(W).interpolate(d).color(et.filter(function(t,e){return!l[e].disabled&&1==l[e].yAxis&&"line"==l[e].type})),w.width(z).height(W).interpolate(d).color(et.filter(function(t,e){return!l[e].disabled&&2==l[e].yAxis&&"line"==l[e].type})),$.width(z).height(W).color(et.filter(function(t,e){return!l[e].disabled&&1==l[e].yAxis&&"scatter"==l[e].type})),k.width(z).height(W).color(et.filter(function(t,e){return!l[e].disabled&&2==l[e].yAxis&&"scatter"==l[e].type})),_.width(z).height(W).color(et.filter(function(t,e){return!l[e].disabled&&1==l[e].yAxis&&"bar"==l[e].type})),M.width(z).height(W).color(et.filter(function(t,e){return!l[e].disabled&&2==l[e].yAxis&&"bar"==l[e].type})),C.width(z).height(W).interpolate(d).color(et.filter(function(t,e){return!l[e].disabled&&1==l[e].yAxis&&"area"==l[e].type})),S.width(z).height(W).interpolate(d).color(et.filter(function(t,e){return!l[e].disabled&&2==l[e].yAxis&&"area"==l[e].type})),tt.attr("transform","translate("+i.left+","+i.top+")");var it=tt.select(".lines1Wrap").datum(R.filter(function(t){return!t.disabled})),ot=tt.select(".scatters1Wrap").datum(V.filter(function(t){return!t.disabled})),at=tt.select(".bars1Wrap").datum(U.filter(function(t){return!t.disabled})),st=tt.select(".stack1Wrap").datum(G.filter(function(t){return!t.disabled})),ut=tt.select(".lines2Wrap").datum(B.filter(function(t){return!t.disabled})),lt=tt.select(".scatters2Wrap").datum(H.filter(function(t){return!t.disabled})),ct=tt.select(".bars2Wrap").datum(Y.filter(function(t){return!t.disabled})),ft=tt.select(".stack2Wrap").datum(X.filter(function(t){return!t.disabled})),dt=G.length?G.map(function(t){return t.values}).reduce(function(t,e){return t.map(function(t,n){return{x:t.x,y:t.y+e[n].y}})}).concat([{x:0,y:0}]):[],ht=X.length?X.map(function(t){return t.values}).reduce(function(t,e){return t.map(function(t,n){return{x:t.x,y:t.y+e[n].y}})}).concat([{x:0,y:0}]):[];y.domain(n||d3.extent(d3.merge(Z).concat(dt),function(t){return t.y})).range([0,W]),b.domain(r||d3.extent(d3.merge(Q).concat(ht),function(t){return t.y})).range([0,W]),x.yDomain(y.domain()),$.yDomain(y.domain()),_.yDomain(y.domain()),C.yDomain(y.domain()),w.yDomain(b.domain()),k.yDomain(b.domain()),M.yDomain(b.domain()),S.yDomain(b.domain()),G.length&&d3.transition(st).call(C),X.length&&d3.transition(ft).call(S),U.length&&d3.transition(at).call(_),Y.length&&d3.transition(ct).call(M),R.length&&d3.transition(it).call(x),B.length&&d3.transition(ut).call(w),V.length&&d3.transition(ot).call($),H.length&&d3.transition(lt).call(k),E._ticks(t.utils.calcTicksX(z/100,l)).tickSize(-W,0),tt.select(".nv-x.nv-axis").attr("transform","translate(0,"+W+")"),d3.transition(tt.select(".nv-x.nv-axis")).call(E),A._ticks(t.utils.calcTicksY(W/36,l)).tickSize(-z,0),d3.transition(tt.select(".nv-y1.nv-axis")).call(A),T._ticks(t.utils.calcTicksY(W/36,l)).tickSize(-z,0),d3.transition(tt.select(".nv-y2.nv-axis")).call(T),tt.select(".nv-y1.nv-axis").classed("nv-disabled",!Z.length).attr("transform","translate("+m.range()[0]+",0)"),tt.select(".nv-y2.nv-axis").classed("nv-disabled",!Q.length).attr("transform","translate("+m.range()[1]+",0)"),N.dispatch.on("stateChange",function(t){e.update()}),g&&(p.width(z).height(W).margin({left:i.left,top:i.top}).svgContainer(q).xScale(m),K.select(".nv-interactive").call(p)),g?(p.dispatch.on("elementMousemove",function(n){P();var r,i,a,s=[];l.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(u,l){var c=m.domain(),f=u.values.filter(function(t,n){return e.x()(t,n)>=c[0]&&e.x()(t,n)<=c[1]});i=t.interactiveBisect(f,n.pointXValue,e.x());var d=f[i],h=e.y()(d,i);null!==h&&F(l,i,!0),void 0!==d&&(void 0===r&&(r=d),void 0===a&&(a=m(e.x()(d,i))),s.push({key:u.key,value:h,color:o(u,u.seriesIndex),data:d,yAxis:2==u.yAxis?T:A}))});var u=function(t,e){var n=s[e].yAxis;return null==t?"N/A":n.tickFormat()(t)};p.tooltip.headerFormatter(function(t,e){return E.tickFormat()(t,e)}).valueFormatter(p.tooltip.valueFormatter()||u).data({value:e.x()(r,i),index:i,series:s})(),p.renderGuideLine(a)}),p.dispatch.on("elementMouseout",function(t){P()})):(x.dispatch.on("elementMouseover.tooltip",h),w.dispatch.on("elementMouseover.tooltip",h),x.dispatch.on("elementMouseout.tooltip",function(t){D.hidden(!0)}),w.dispatch.on("elementMouseout.tooltip",function(t){D.hidden(!0)}),$.dispatch.on("elementMouseover.tooltip",O),k.dispatch.on("elementMouseover.tooltip",O),$.dispatch.on("elementMouseout.tooltip",function(t){D.hidden(!0)}),k.dispatch.on("elementMouseout.tooltip",function(t){D.hidden(!0)}),C.dispatch.on("elementMouseover.tooltip",I),S.dispatch.on("elementMouseover.tooltip",I),C.dispatch.on("elementMouseout.tooltip",function(t){D.hidden(!0)}),S.dispatch.on("elementMouseout.tooltip",function(t){D.hidden(!0)}),_.dispatch.on("elementMouseover.tooltip",L),M.dispatch.on("elementMouseover.tooltip",L),_.dispatch.on("elementMouseout.tooltip",function(t){D.hidden(!0)}),M.dispatch.on("elementMouseout.tooltip",function(t){D.hidden(!0)}),_.dispatch.on("elementMousemove.tooltip",function(t){D()}),M.dispatch.on("elementMousemove.tooltip",function(t){D()}))}),e}var n,r,i={top:30,right:20,bottom:50,left:60},o=t.utils.defaultColor(),a=null,s=null,u=!0,l=null,c=function(t){return t.x},f=function(t){return t.y},d="linear",h=!0,p=t.interactiveGuideline(),g=!1,v=" (right axis)",m=d3.scale.linear(),y=d3.scale.linear(),b=d3.scale.linear(),x=t.models.line().yScale(y),w=t.models.line().yScale(b),$=t.models.scatter().yScale(y),k=t.models.scatter().yScale(b),_=t.models.multiBar().stacked(!1).yScale(y),M=t.models.multiBar().stacked(!1).yScale(b),C=t.models.stackedArea().yScale(y),S=t.models.stackedArea().yScale(b),E=t.models.axis().scale(m).orient("bottom").tickPadding(5),A=t.models.axis().scale(y).orient("left"),T=t.models.axis().scale(b).orient("right"),N=t.models.legend().height(30),D=t.models.tooltip(),O=d3.dispatch(),j=[x,w,$,k,_,M,C,S];return e.dispatch=O,e.legend=N,e.lines1=x,e.lines2=w,e.scatters1=$,e.scatters2=k,e.bars1=_,e.bars2=M,e.stack1=C,e.stack2=S,e.xAxis=E,e.yAxis1=A,e.yAxis2=T,e.tooltip=D,e.interactiveLayer=p,e.options=t.utils.optionsFunc.bind(e),e._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},showLegend:{get:function(){return u},set:function(t){u=t}},yDomain1:{get:function(){return n},set:function(t){n=t}},yDomain2:{get:function(){return r},set:function(t){r=t}},noData:{get:function(){return l},set:function(t){l=t}},interpolate:{get:function(){return d},set:function(t){d=t}},legendRightAxisHint:{get:function(){return v},set:function(t){v=t}},margin:{get:function(){return i},set:function(t){i.top=void 0!==t.top?t.top:i.top,i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}},color:{get:function(){return o},set:function(e){o=t.utils.getColor(e)}},x:{get:function(){return c},set:function(t){c=t,x.x(t),w.x(t),$.x(t),k.x(t),_.x(t),M.x(t),C.x(t),S.x(t)}},y:{get:function(){return f},set:function(t){f=t,x.y(t),w.y(t),$.y(t),k.y(t),C.y(t),S.y(t),_.y(t),M.y(t)}},useVoronoi:{get:function(){return h},set:function(t){h=t,x.useVoronoi(t),w.useVoronoi(t),C.useVoronoi(t),S.useVoronoi(t)}},useInteractiveGuideline:{get:function(){return g},set:function(t){g=t,g&&(x.interactive(!1),x.useVoronoi(!1),w.interactive(!1),w.useVoronoi(!1),C.interactive(!1),C.useVoronoi(!1),S.interactive(!1),S.useVoronoi(!1),$.interactive(!1),k.interactive(!1))}}}),t.utils.initOptions(e),e},t.models.ohlcBar=function(){"use strict";function e(_){return _.each(function(e){c=d3.select(this);var _=t.utils.availableWidth(s,c,a),C=t.utils.availableHeight(u,c,a);t.utils.initSVG(c);var S=_/e[0].values.length*.9;f.domain(n||d3.extent(e[0].values.map(h).concat(b))),w?f.range(i||[.5*_/e[0].values.length,_*(e[0].values.length-.5)/e[0].values.length]):f.range(i||[5+S/2,_-S/2-5]),d.domain(r||[d3.min(e[0].values.map(y).concat(x)),d3.max(e[0].values.map(m).concat(x))]).range(o||[C,0]),f.domain()[0]===f.domain()[1]&&(f.domain()[0]?f.domain([f.domain()[0]-.01*f.domain()[0],f.domain()[1]+.01*f.domain()[1]]):f.domain([-1,1])),d.domain()[0]===d.domain()[1]&&(d.domain()[0]?d.domain([d.domain()[0]+.01*d.domain()[0],d.domain()[1]-.01*d.domain()[1]]):d.domain([-1,1]));var E=d3.select(this).selectAll("g.nv-wrap.nv-ohlcBar").data([e[0].values]),A=E.enter().append("g").attr("class","nvd3 nv-wrap nv-ohlcBar"),T=A.append("defs"),N=A.append("g"),D=E.select("g");N.append("g").attr("class","nv-ticks"),E.attr("transform","translate("+a.left+","+a.top+")"),c.on("click",function(t,e){M.chartClick({data:t,index:e,pos:d3.event,id:l})}),T.append("clipPath").attr("id","nv-chart-clip-path-"+l).append("rect"),E.select("#nv-chart-clip-path-"+l+" rect").attr("width",_).attr("height",C),D.attr("clip-path",$?"url(#nv-chart-clip-path-"+l+")":"");var O=E.select(".nv-ticks").selectAll(".nv-tick").data(function(t){return t});O.exit().remove(),O.enter().append("path").attr("class",function(t,e,n){return(g(t,e)>v(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e}).attr("d",function(t,e){return"m0,0l0,"+(d(g(t,e))-d(m(t,e)))+"l"+-S/2+",0l"+S/2+",0l0,"+(d(y(t,e))-d(g(t,e)))+"l0,"+(d(v(t,e))-d(y(t,e)))+"l"+S/2+",0l"+-S/2+",0z"}).attr("transform",function(t,e){return"translate("+f(h(t,e))+","+d(m(t,e))+")"}).attr("fill",function(t,e){return k[0]}).attr("stroke",function(t,e){return k[0]}).attr("x",0).attr("y",function(t,e){return d(Math.max(0,p(t,e)))}).attr("height",function(t,e){return Math.abs(d(p(t,e))-d(0))}),O.attr("class",function(t,e,n){return(g(t,e)>v(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e}),d3.transition(O).attr("transform",function(t,e){return"translate("+f(h(t,e))+","+d(m(t,e))+")"}).attr("d",function(t,n){var r=_/e[0].values.length*.9;return"m0,0l0,"+(d(g(t,n))-d(m(t,n)))+"l"+-r/2+",0l"+r/2+",0l0,"+(d(y(t,n))-d(g(t,n)))+"l0,"+(d(v(t,n))-d(y(t,n)))+"l"+r/2+",0l"+-r/2+",0z"})}),e}var n,r,i,o,a={top:0,right:0,bottom:0,left:0},s=null,u=null,l=Math.floor(1e4*Math.random()),c=null,f=d3.scale.linear(),d=d3.scale.linear(),h=function(t){return t.x},p=function(t){return t.y},g=function(t){return t.open},v=function(t){return t.close},m=function(t){return t.high},y=function(t){return t.low},b=[],x=[],w=!1,$=!0,k=t.utils.defaultColor(),_=!1,M=d3.dispatch("stateChange","changeState","renderEnd","chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove");return e.highlightPoint=function(t,n){e.clearHighlights(),c.select(".nv-ohlcBar .nv-tick-0-"+t).classed("hover",n)},e.clearHighlights=function(){c.select(".nv-ohlcBar .nv-tick.hover").classed("hover",!1)},e.dispatch=M,e.options=t.utils.optionsFunc.bind(e),e._options=Object.create({},{width:{get:function(){return s},set:function(t){s=t}},height:{get:function(){return u},set:function(t){u=t}},xScale:{get:function(){return f},set:function(t){f=t}},yScale:{get:function(){return d},set:function(t){d=t}},xDomain:{get:function(){return n},set:function(t){n=t}},yDomain:{get:function(){return r},set:function(t){r=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return o},set:function(t){o=t}},forceX:{get:function(){return b},set:function(t){b=t}},forceY:{get:function(){return x},set:function(t){x=t}},padData:{get:function(){return w},set:function(t){w=t}},clipEdge:{get:function(){return $},set:function(t){$=t}},id:{get:function(){return l},set:function(t){l=t}},interactive:{get:function(){return _},set:function(t){_=t}},x:{get:function(){return h},set:function(t){h=t}},y:{get:function(){return p},set:function(t){p=t}},open:{get:function(){return g()},set:function(t){g=t}},close:{get:function(){return v()},set:function(t){v=t}},high:{get:function(){return m},set:function(t){m=t}},low:{get:function(){return y},set:function(t){y=t}},margin:{get:function(){return a},set:function(t){a.top=void 0!=t.top?t.top:a.top,a.right=void 0!=t.right?t.right:a.right,a.bottom=void 0!=t.bottom?t.bottom:a.bottom,a.left=void 0!=t.left?t.left:a.left}},color:{get:function(){return k},set:function(e){k=t.utils.getColor(e)}}}),t.utils.initOptions(e),e},t.models.parallelCoordinates=function(){"use strict";function e(S){return C.reset(),S.each(function(e){function C(t){return k(p.map(function(e){if(isNaN(t.values[e.key])||isNaN(parseFloat(t.values[e.key]))||z){var n=f[e.key].domain(),r=f[e.key].range(),i=n[0]-(n[1]-n[0])/9;if(w.indexOf(e.key)<0){var o=d3.scale.linear().domain([i,n[1]]).range([l-12,r[1]]);f[e.key].brush.y(o),w.push(e.key)}if(isNaN(t.values[e.key])||isNaN(parseFloat(t.values[e.key])))return[c(e.key),f[e.key](i)]}return void 0!==U&&(w.length>0||z?(U.style("display","inline"),Y.style("display","inline")):(U.style("display","none"),Y.style("display","none"))),[c(e.key),f[e.key](t.values[e.key])]}))}function S(t){y.forEach(function(e){var n=f[e.dimension].brush.y().domain();e.hasOnlyNaN&&(e.extent[1]=(f[e.dimension].domain()[1]-n[0])*(e.extent[1]-e.extent[0])/(q[e.dimension]-e.extent[0])+n[0]),e.hasNaN&&(e.extent[0]=n[0]),t&&f[e.dimension].brush.extent(e.extent)}),i.select(".nv-brushBackground").each(function(t){d3.select(this).call(f[t.key].brush)}).selectAll("rect").attr("x",-8).attr("width",16),N()}function E(){v===!1&&(v=!0,S(!0))}function A(){K=g.filter(function(t){return!f[t].brush.empty()}),J=K.map(function(t){return f[t].brush.extent()}),y=[],K.forEach(function(t,e){y[e]={dimension:t,extent:J[e],hasNaN:!1,hasOnlyNaN:!1}}),b=[],n.style("display",function(t){var e=K.every(function(e,n){return!(!isNaN(t.values[e])&&!isNaN(parseFloat(t.values[e]))||J[n][0]!=f[e].brush.y().domain()[0])||J[n][0]<=t.values[e]&&t.values[e]<=J[n][1]&&!isNaN(parseFloat(t.values[e]))});return e&&b.push(t),e?null:"none"}),N(),M.brush({filters:y,active:b})}function T(){var t=K.length>0;y.forEach(function(t){t.extent[0]===f[t.dimension].brush.y().domain()[0]&&w.indexOf(t.dimension)>=0&&(t.hasNaN=!0),t.extent[1]f[t.key].domain()[0]&&(W[t.key]=[n[0].extent[1]]),n[0].extent[0]>=f[t.key].domain()[0]&&W[t.key].push(n[0].extent[0])),d3.select(this).call(_.scale(f[t.key]).tickFormat(t.format).tickValues(W[t.key]))})}function D(t){x[t.key]=this.parentNode.__origin__=c(t.key),r.attr("visibility","hidden")}function O(t){x[t.key]=Math.min(u,Math.max(0,this.parentNode.__origin__+=d3.event.x)),n.attr("d",C),p.sort(function(t,e){return I(t.key)-I(e.key)}),p.forEach(function(t,e){return t.currentPosition=e}),c.domain(p.map(function(t){return t.key})),i.attr("transform",function(t){return"translate("+I(t.key)+")"})}function j(t,e){delete this.parentNode.__origin__,delete x[t.key],d3.select(this.parentNode).attr("transform","translate("+c(t.key)+")"),n.attr("d",C),r.attr("d",C).attr("visibility",null),M.dimensionsOrder(p)}function I(t){var e=x[t];return null==e?c(t):e}var L=d3.select(this);if(u=t.utils.availableWidth(a,L,o),l=t.utils.availableHeight(s,L,o),t.utils.initSVG(L),void 0===e[0].values){var P=[];e.forEach(function(t){var e={},n=Object.keys(t);n.forEach(function(n){"name"!==n&&(e[n]=t[n])}),P.push({key:t.name,values:e})}),e=P}var F=e.map(function(t){return t.values});0===b.length&&(b=e),g=h.sort(function(t,e){return t.currentPosition-e.currentPosition}).map(function(t){return t.key}),p=h.filter(function(t){return!t.disabled}),c.rangePoints([0,u],1).domain(p.map(function(t){return t.key}));var q={},z=!1,W=[];g.forEach(function(t){var e=d3.extent(F,function(e){return+e[t]}),n=e[0],r=e[1],i=!1;(isNaN(n)||isNaN(r))&&(i=!0,n=0,r=0),n===r&&(n-=1,r+=1);var o=y.filter(function(e){return e.dimension==t});0!==o.length&&(i?(n=f[t].domain()[0],r=f[t].domain()[1]):!o[0].hasOnlyNaN&&v?(n=n>o[0].extent[0]?o[0].extent[0]:n,r=r0||!t.utils.arrayEquals(b,tt))&&M.activeChanged(b)}),e}var n,r,i,o={top:30,right:0,bottom:10,left:0},a=null,s=null,u=null,l=null,c=d3.scale.ordinal(),f={},d="undefined values",h=[],p=[],g=[],v=!0,m=t.utils.defaultColor(),y=[],b=[],x=[],w=[],$=1,k=d3.svg.line(),_=d3.svg.axis(),M=d3.dispatch("brushstart","brush","brushEnd","dimensionsOrder","stateChange","elementClick","elementMouseover","elementMouseout","elementMousemove","renderEnd","activeChanged"),C=t.utils.renderWatch(M);return e.dispatch=M,e.options=t.utils.optionsFunc.bind(e),e._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},dimensionData:{get:function(){return h},set:function(t){h=t}},displayBrush:{get:function(){return v},set:function(t){v=t}},filters:{get:function(){return y},set:function(t){y=t}},active:{get:function(){return b},set:function(t){b=t}},lineTension:{get:function(){return $},set:function(t){$=t}},undefinedValuesLabel:{get:function(){return d},set:function(t){d=t}},dimensions:{get:function(){return h.map(function(t){return t.key})},set:function(e){t.deprecated("dimensions","use dimensionData instead"),0===h.length?e.forEach(function(t){h.push({key:t})}):e.forEach(function(t,e){h[e].key=t})}},dimensionNames:{get:function(){return h.map(function(t){return t.key})},set:function(e){t.deprecated("dimensionNames","use dimensionData instead"),g=[],0===h.length?e.forEach(function(t){h.push({key:t})}):e.forEach(function(t,e){h[e].key=t})}},dimensionFormats:{get:function(){return h.map(function(t){return t.format})},set:function(e){t.deprecated("dimensionFormats","use dimensionData instead"),0===h.length?e.forEach(function(t){h.push({format:t})}):e.forEach(function(t,e){h[e].format=t})}},margin:{get:function(){return o},set:function(t){o.top=void 0!==t.top?t.top:o.top,o.right=void 0!==t.right?t.right:o.right,o.bottom=void 0!==t.bottom?t.bottom:o.bottom,o.left=void 0!==t.left?t.left:o.left}},color:{get:function(){return m},set:function(e){m=t.utils.getColor(e)}}}),t.utils.initOptions(e),e},t.models.parallelCoordinatesChart=function(){"use strict";function e(i){return m.reset(),m.models(n),i.each(function(i){var l=d3.select(this);t.utils.initSVG(l);var p=t.utils.availableWidth(a,l,o),g=t.utils.availableHeight(s,l,o);if(e.update=function(){l.call(e)},e.container=this,c.setter(b(f),e.update).getter(y(f)).update(),c.disabled=f.map(function(t){return!!t.disabled}),f=f.map(function(t){return t.disabled=!!t.disabled,t}),f.forEach(function(t,e){t.originalPosition=isNaN(t.originalPosition)?e:t.originalPosition,t.currentPosition=isNaN(t.currentPosition)?e:t.currentPosition}),!h){var m;h={};for(m in c)c[m]instanceof Array?h[m]=c[m].slice(0):h[m]=c[m]}if(!i||!i.length)return t.utils.noData(e,l),e;l.selectAll(".nv-noData").remove();var x=l.selectAll("g.nv-wrap.nv-parallelCoordinatesChart").data([i]),w=x.enter().append("g").attr("class","nvd3 nv-wrap nv-parallelCoordinatesChart").append("g"),$=x.select("g");w.append("g").attr("class","nv-parallelCoordinatesWrap"),w.append("g").attr("class","nv-legendWrap"),$.select("rect").attr("width",p).attr("height",g>0?g:0),u?(r.width(p).color(function(t){return"rgb(188,190,192)"}),$.select(".nv-legendWrap").datum(f.sort(function(t,e){return t.originalPosition-e.originalPosition})).call(r),r.height()>o.top&&(o.top=r.height(),g=t.utils.availableHeight(s,l,o)),x.select(".nv-legendWrap").attr("transform","translate( 0 ,"+-o.top+")")):$.select(".nv-legendWrap").selectAll("*").remove(),x.attr("transform","translate("+o.left+","+o.top+")"),n.width(p).height(g).dimensionData(f).displayBrush(d);var k=$.select(".nv-parallelCoordinatesWrap ").datum(i);k.transition().call(n),n.dispatch.on("brushEnd",function(t,e){e?(d=!0,v.brushEnd(t)):d=!1}),r.dispatch.on("stateChange",function(t){for(var n in t)c[n]=t[n];v.stateChange(c),e.update()}),n.dispatch.on("dimensionsOrder",function(t){f.sort(function(t,e){return t.currentPosition-e.currentPosition});var e=!1;f.forEach(function(t,n){t.currentPosition=n,t.currentPosition!==t.originalPosition&&(e=!0)}),v.dimensionsOrder(f,e)}),v.on("changeState",function(t){"undefined"!=typeof t.disabled&&(f.forEach(function(e,n){e.disabled=t.disabled[n]}),c.disabled=t.disabled),e.update()})}),m.renderEnd("parraleleCoordinateChart immediate"),e}var n=t.models.parallelCoordinates(),r=t.models.legend(),i=t.models.tooltip(),o=(t.models.tooltip(),{top:0,right:0,bottom:0,left:0}),a=null,s=null,u=!0,l=t.utils.defaultColor(),c=t.utils.state(),f=[],d=!0,h=null,p=null,g="undefined",v=d3.dispatch("dimensionsOrder","brushEnd","stateChange","changeState","renderEnd"),m=t.utils.renderWatch(v),y=function(t){ return function(){return{active:t.map(function(t){return!t.disabled})}}},b=function(t){return function(e){void 0!==e.active&&t.forEach(function(t,n){t.disabled=!e.active[n]})}};return i.contentGenerator(function(t){var e='";return 0!==t.series.length&&(e+='',t.series.forEach(function(t){e=e+'"}),e+=""),e+="
'+t.key+"
'+t.key+''+t.value+"
"}),n.dispatch.on("elementMouseover.tooltip",function(t){var e={key:t.label,color:t.color,series:[]};t.values&&(Object.keys(t.values).forEach(function(n){var r=t.dimensions.filter(function(t){return t.key===n})[0];if(r){var i;i=isNaN(t.values[n])||isNaN(parseFloat(t.values[n]))?g:r.format(t.values[n]),e.series.push({idx:r.currentPosition,key:n,value:i,color:r.color})}}),e.series.sort(function(t,e){return t.idx-e.idx})),i.data(e).hidden(!1)}),n.dispatch.on("elementMouseout.tooltip",function(t){i.hidden(!0)}),n.dispatch.on("elementMousemove.tooltip",function(){i()}),e.dispatch=v,e.parallelCoordinates=n,e.legend=r,e.tooltip=i,e.options=t.utils.optionsFunc.bind(e),e._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},showLegend:{get:function(){return u},set:function(t){u=t}},defaultState:{get:function(){return h},set:function(t){h=t}},dimensionData:{get:function(){return f},set:function(t){f=t}},displayBrush:{get:function(){return d},set:function(t){d=t}},noData:{get:function(){return p},set:function(t){p=t}},nanValue:{get:function(){return g},set:function(t){g=t}},margin:{get:function(){return o},set:function(t){o.top=void 0!==t.top?t.top:o.top,o.right=void 0!==t.right?t.right:o.right,o.bottom=void 0!==t.bottom?t.bottom:o.bottom,o.left=void 0!==t.left?t.left:o.left}},color:{get:function(){return l},set:function(e){l=t.utils.getColor(e),r.color(l),n.color(l)}}}),t.utils.inheritOptions(e,n),t.utils.initOptions(e),e},t.models.pie=function(){"use strict";function e(N){return T.reset(),N.each(function(e){function N(t,e){t.endAngle=isNaN(t.endAngle)?0:t.endAngle,t.startAngle=isNaN(t.startAngle)?0:t.startAngle,g||(t.innerRadius=0);var n=d3.interpolate(this._current,t);return this._current=n(0),function(t){return E[e](n(t))}}var D=r-n.left-n.right,O=i-n.top-n.bottom,j=Math.min(D,O)/2,I=[],L=[];if(u=d3.select(this),0===C.length)for(var P=j-j/5,F=_*j,q=0;q=p){var o=et(r);K[o]&&(r[1]-=J),K[et(r)]=!0}return"translate("+r+")"}),X.select(".nv-label text").style("text-anchor",function(t,e){return b?(t.startAngle+t.endAngle)/2o.top&&(o.top=r.height(),p=t.utils.availableHeight(s,u,o)),m.select(".nv-legendWrap").attr("transform","translate(0,"+-o.top+")");else if("right"===c){var $=t.models.legend().width();f/2<$&&($=f/2),r.height(p).key(n.x()),r.width($),f-=r.width(),m.select(".nv-legendWrap").datum(i).call(r).attr("transform","translate("+f+",0)")}}else w.select(".nv-legendWrap").selectAll("*").remove();m.attr("transform","translate("+o.left+","+o.top+")"),n.width(f).height(p);var k=w.select(".nv-pieWrap").datum([i]);d3.transition(k).call(n),r.dispatch.on("stateChange",function(t){for(var n in t)d[n]=t[n];v.stateChange(d),e.update()}),v.on("changeState",function(t){"undefined"!=typeof t.disabled&&(i.forEach(function(e,n){e.disabled=t.disabled[n]}),d.disabled=t.disabled),e.update()})}),m.renderEnd("pieChart immediate"),e}var n=t.models.pie(),r=t.models.legend(),i=t.models.tooltip(),o={top:30,right:20,bottom:20,left:20},a=null,s=null,u=!1,l=!0,c="top",f=t.utils.defaultColor(),d=t.utils.state(),h=null,p=null,g=250,v=d3.dispatch("stateChange","changeState","renderEnd");i.duration(0).headerEnabled(!1).valueFormatter(function(t,e){return n.valueFormat()(t,e)});var m=t.utils.renderWatch(v),y=function(t){return function(){return{active:t.map(function(t){return!t.disabled})}}},b=function(t){return function(e){void 0!==e.active&&t.forEach(function(t,n){t.disabled=!e.active[n]})}};return n.dispatch.on("elementMouseover.tooltip",function(t){t.series={key:e.x()(t.data),value:e.y()(t.data),color:t.color,percent:t.percent},u||(delete t.percent,delete t.series.percent),i.data(t).hidden(!1)}),n.dispatch.on("elementMouseout.tooltip",function(t){i.hidden(!0)}),n.dispatch.on("elementMousemove.tooltip",function(t){i()}),e.legend=r,e.dispatch=v,e.pie=n,e.tooltip=i,e.options=t.utils.optionsFunc.bind(e),e._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},noData:{get:function(){return p},set:function(t){p=t}},showTooltipPercent:{get:function(){return u},set:function(t){u=t}},showLegend:{get:function(){return l},set:function(t){l=t}},legendPosition:{get:function(){return c},set:function(t){c=t}},defaultState:{get:function(){return h},set:function(t){h=t}},color:{get:function(){return f},set:function(t){f=t,r.color(f),n.color(f)}},duration:{get:function(){return g},set:function(t){g=t,m.reset(g),n.duration(g)}},margin:{get:function(){return o},set:function(t){o.top=void 0!==t.top?t.top:o.top,o.right=void 0!==t.right?t.right:o.right,o.bottom=void 0!==t.bottom?t.bottom:o.bottom,o.left=void 0!==t.left?t.left:o.left}}}),t.utils.inheritOptions(e,n),t.utils.initOptions(e),e},t.models.scatter=function(){"use strict";function e(t){var e,n;return e=u=u||{},n=t[0].series,e=e[n]=e[n]||{},n=t[1],e=e[n]=e[n]||{}}function n(t){var n,r,i=t[0],o=e(t),a=!1;for(n=1;n0?G:0),rt.attr("clip-path",A?"url(#nv-edge-clip-"+h+")":""),H=!0;var it=J.select(".nv-groups").selectAll(".nv-group").data(function(t){return t},function(t){return t.key});it.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),it.exit().remove(),it.attr("class",function(t,e){return(t.classed||"")+" nv-group nv-series-"+e}).classed("nv-noninteractive",!M).classed("hover",function(t){return t.hover}),it.watchTransition(U,"scatter: groups").style("fill",function(t,e){return d(t,e)}).style("stroke",function(t,e){return d(t,e)}).style("stroke-opacity",1).style("fill-opacity",.5);var ot=it.selectAll("path.nv-point").data(function(t){return t.values.map(function(t,e){return[t,e]}).filter(function(t,e){return C(t[0],e)})});if(ot.enter().append("path").attr("class",function(t){return"nv-point nv-point-"+t[1]}).style("fill",function(t){return t.color}).style("stroke",function(t){return t.color}).attr("transform",function(e){return"translate("+t.utils.NaNtoZero(i(y(e[0],e[1])))+","+t.utils.NaNtoZero(o(b(e[0],e[1])))+")"}).attr("d",t.utils.symbol().type(function(t){return w(t[0])}).size(function(t){return m(x(t[0],t[1]))})),ot.exit().remove(),it.exit().selectAll("path.nv-point").watchTransition(U,"scatter exit").attr("transform",function(e){return"translate("+t.utils.NaNtoZero(g(y(e[0],e[1])))+","+t.utils.NaNtoZero(v(b(e[0],e[1])))+")"}).remove(),ot.filter(function(t){return K||n(t,"x","y")}).watchTransition(U,"scatter points").attr("transform",function(e){return"translate("+t.utils.NaNtoZero(g(y(e[0],e[1])))+","+t.utils.NaNtoZero(v(b(e[0],e[1])))+")"}),ot.filter(function(t){return K||n(t,"shape","size")}).watchTransition(U,"scatter points").attr("d",t.utils.symbol().type(function(t){return w(t[0])}).size(function(t){return m(x(t[0],t[1]))})),V){var at=it.selectAll(".nv-label").data(function(t){return t.values.map(function(t,e){return[t,e]}).filter(function(t,e){return C(t[0],e)})});at.enter().append("text").style("fill",function(t,e){return t.color}).style("stroke-opacity",0).style("fill-opacity",1).attr("transform",function(e){var n=t.utils.NaNtoZero(i(y(e[0],e[1])))+Math.sqrt(m(x(e[0],e[1]))/Math.PI)+2;return"translate("+n+","+t.utils.NaNtoZero(o(b(e[0],e[1])))+")"}).text(function(t,e){return t[0].label}),at.exit().remove(),it.exit().selectAll("path.nv-label").watchTransition(U,"scatter exit").attr("transform",function(e){var n=t.utils.NaNtoZero(g(y(e[0],e[1])))+Math.sqrt(m(x(e[0],e[1]))/Math.PI)+2;return"translate("+n+","+t.utils.NaNtoZero(v(b(e[0],e[1])))+")"}).remove(),at.each(function(t){d3.select(this).classed("nv-label",!0).classed("nv-label-"+t[1],!1).classed("hover",!1)}),at.watchTransition(U,"scatter labels").attr("transform",function(e){var n=t.utils.NaNtoZero(g(y(e[0],e[1])))+Math.sqrt(m(x(e[0],e[1]))/Math.PI)+2;return"translate("+n+","+t.utils.NaNtoZero(v(b(e[0],e[1])))+")"})}B?(clearTimeout(s),s=setTimeout(u,B)):u(),i=g.copy(),o=v.copy(),a=m.copy()}),U.renderEnd("scatter immediate"),r}var i,o,a,s,u,l={top:0,right:0,bottom:0,left:0},c=null,f=null,d=t.utils.defaultColor(),h=Math.floor(1e5*Math.random()),p=null,g=d3.scale.linear(),v=d3.scale.linear(),m=d3.scale.linear(),y=function(t){return t.x},b=function(t){return t.y},x=function(t){return t.size||1},w=function(t){return t.shape||"circle"},$=[],k=[],_=[],M=!0,C=function(t){return!t.notActive},S=!1,E=.1,A=!1,T=!0,N=!1,D=function(){return 25},O=null,j=null,I=null,L=null,P=null,F=null,q=!1,z=d3.dispatch("elementClick","elementDblClick","elementMouseover","elementMouseout","renderEnd"),W=!0,R=250,B=300,V=!1,H=!1,U=t.utils.renderWatch(z,R),Y=[16,256];return r.dispatch=z,r.options=t.utils.optionsFunc.bind(r),r._calls=new function(){this.clearHighlights=function(){return t.dom.write(function(){p.selectAll(".nv-point.hover").classed("hover",!1)}),null},this.highlightPoint=function(e,n,r){t.dom.write(function(){p.select(".nv-groups").selectAll(".nv-series-"+e).selectAll(".nv-point-"+n).classed("hover",r)})}},z.on("elementMouseover.point",function(t){M&&r._calls.highlightPoint(t.seriesIndex,t.pointIndex,!0)}),z.on("elementMouseout.point",function(t){M&&r._calls.highlightPoint(t.seriesIndex,t.pointIndex,!1)}),r._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return f},set:function(t){f=t}},xScale:{get:function(){return g},set:function(t){g=t}},yScale:{get:function(){return v},set:function(t){v=t}},pointScale:{get:function(){return m},set:function(t){m=t}},xDomain:{get:function(){return O},set:function(t){O=t}},yDomain:{get:function(){return j},set:function(t){j=t}},pointDomain:{get:function(){return P},set:function(t){P=t}},xRange:{get:function(){return I},set:function(t){I=t}},yRange:{get:function(){return L},set:function(t){L=t}},pointRange:{get:function(){return F},set:function(t){F=t}},forceX:{get:function(){return $},set:function(t){$=t}},forceY:{get:function(){return k},set:function(t){k=t}},forcePoint:{get:function(){return _},set:function(t){_=t}},interactive:{get:function(){return M},set:function(t){M=t}},pointActive:{get:function(){return C},set:function(t){C=t}},padDataOuter:{get:function(){return E},set:function(t){E=t}},padData:{get:function(){return S},set:function(t){S=t}},clipEdge:{get:function(){return A},set:function(t){A=t}},clipVoronoi:{get:function(){return T},set:function(t){T=t}},clipRadius:{get:function(){return D},set:function(t){D=t}},showVoronoi:{get:function(){return N},set:function(t){N=t}},id:{get:function(){return h},set:function(t){h=t}},interactiveUpdateDelay:{get:function(){return B},set:function(t){B=t}},showLabels:{get:function(){return V},set:function(t){V=t}},x:{get:function(){return y},set:function(t){y=d3.functor(t)}},y:{get:function(){return b},set:function(t){b=d3.functor(t)}},pointSize:{get:function(){return x},set:function(t){x=d3.functor(t)}},pointShape:{get:function(){return w},set:function(t){w=d3.functor(t)}},margin:{get:function(){return l},set:function(t){l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return R},set:function(t){R=t,U.reset(R)}},color:{get:function(){return d},set:function(e){d=t.utils.getColor(e)}},useVoronoi:{get:function(){return W},set:function(t){W=t,W===!1&&(T=!1)}}}),t.utils.initOptions(r),r},t.models.scatterChart=function(){"use strict";function e(M){return T.reset(),T.models(n),b&&T.models(r),x&&T.models(i),v&&T.models(a),m&&T.models(s),M.each(function(M){d=d3.select(this),t.utils.initSVG(d);var O=t.utils.availableWidth(c,d,l),j=t.utils.availableHeight(f,d,l);if(e.update=function(){0===C?d.call(e):d.transition().duration(C).call(e)},e.container=this,$.setter(D(M),e.update).getter(N(M)).update(),$.disabled=M.map(function(t){return!!t.disabled}),!k){var I;k={};for(I in $)$[I]instanceof Array?k[I]=$[I].slice(0):k[I]=$[I]}if(!(M&&M.length&&M.filter(function(t){return t.values.length}).length))return t.utils.noData(e,d),T.renderEnd("scatter immediate"),e;d.selectAll(".nv-noData").remove(),p=n.xScale(),g=n.yScale();var L=d.selectAll("g.nv-wrap.nv-scatterChart").data([M]),P=L.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+n.id()),F=P.append("g"),q=L.select("g");if(F.append("rect").attr("class","nvd3 nv-background").style("pointer-events","none"),F.append("g").attr("class","nv-x nv-axis"),F.append("g").attr("class","nv-y nv-axis"),F.append("g").attr("class","nv-scatterWrap"),F.append("g").attr("class","nv-regressionLinesWrap"),F.append("g").attr("class","nv-distWrap"),F.append("g").attr("class","nv-legendWrap"),w&&q.select(".nv-y.nv-axis").attr("transform","translate("+O+",0)"),y){var z=O;o.width(z),L.select(".nv-legendWrap").datum(M).call(o),o.height()>l.top&&(l.top=o.height(),j=t.utils.availableHeight(f,d,l)),L.select(".nv-legendWrap").attr("transform","translate(0,"+-l.top+")")}else q.select(".nv-legendWrap").selectAll("*").remove();L.attr("transform","translate("+l.left+","+l.top+")"),n.width(O).height(j).color(M.map(function(t,e){return t.color=t.color||h(t,e),t.color}).filter(function(t,e){return!M[e].disabled})).showLabels(S),L.select(".nv-scatterWrap").datum(M.filter(function(t){return!t.disabled})).call(n),L.select(".nv-regressionLinesWrap").attr("clip-path","url(#nv-edge-clip-"+n.id()+")");var W=L.select(".nv-regressionLinesWrap").selectAll(".nv-regLines").data(function(t){return t});W.enter().append("g").attr("class","nv-regLines");var R=W.selectAll(".nv-regLine").data(function(t){return[t]});R.enter().append("line").attr("class","nv-regLine").style("stroke-opacity",0),R.filter(function(t){return t.intercept&&t.slope}).watchTransition(T,"scatterPlusLineChart: regline").attr("x1",p.range()[0]).attr("x2",p.range()[1]).attr("y1",function(t,e){return g(p.domain()[0]*t.slope+t.intercept)}).attr("y2",function(t,e){return g(p.domain()[1]*t.slope+t.intercept)}).style("stroke",function(t,e,n){return h(t,n)}).style("stroke-opacity",function(t,e){return t.disabled||"undefined"==typeof t.slope||"undefined"==typeof t.intercept?0:1}),b&&(r.scale(p)._ticks(t.utils.calcTicksX(O/100,M)).tickSize(-j,0),q.select(".nv-x.nv-axis").attr("transform","translate(0,"+g.range()[0]+")").call(r)),x&&(i.scale(g)._ticks(t.utils.calcTicksY(j/36,M)).tickSize(-O,0),q.select(".nv-y.nv-axis").call(i)),v&&(a.getData(n.x()).scale(p).width(O).color(M.map(function(t,e){return t.color||h(t,e)}).filter(function(t,e){return!M[e].disabled})),F.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),q.select(".nv-distributionX").attr("transform","translate(0,"+g.range()[0]+")").datum(M.filter(function(t){return!t.disabled})).call(a)),m&&(s.getData(n.y()).scale(g).width(j).color(M.map(function(t,e){return t.color||h(t,e)}).filter(function(t,e){return!M[e].disabled})),F.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),q.select(".nv-distributionY").attr("transform","translate("+(w?O:-s.size())+",0)").datum(M.filter(function(t){return!t.disabled})).call(s)),o.dispatch.on("stateChange",function(t){for(var n in t)$[n]=t[n];_.stateChange($),e.update()}),_.on("changeState",function(t){"undefined"!=typeof t.disabled&&(M.forEach(function(e,n){e.disabled=t.disabled[n]}),$.disabled=t.disabled),e.update()}),n.dispatch.on("elementMouseout.tooltip",function(t){u.hidden(!0),d.select(".nv-chart-"+n.id()+" .nv-series-"+t.seriesIndex+" .nv-distx-"+t.pointIndex).attr("y1",0),d.select(".nv-chart-"+n.id()+" .nv-series-"+t.seriesIndex+" .nv-disty-"+t.pointIndex).attr("x2",s.size())}),n.dispatch.on("elementMouseover.tooltip",function(t){d.select(".nv-series-"+t.seriesIndex+" .nv-distx-"+t.pointIndex).attr("y1",t.relativePos[1]-j),d.select(".nv-series-"+t.seriesIndex+" .nv-disty-"+t.pointIndex).attr("x2",t.relativePos[0]+a.size()),u.data(t).hidden(!1)}),E=p.copy(),A=g.copy()}),T.renderEnd("scatter with line immediate"),e}var n=t.models.scatter(),r=t.models.axis(),i=t.models.axis(),o=t.models.legend(),a=t.models.distribution(),s=t.models.distribution(),u=t.models.tooltip(),l={top:30,right:20,bottom:50,left:75},c=null,f=null,d=null,h=t.utils.defaultColor(),p=n.xScale(),g=n.yScale(),v=!1,m=!1,y=!0,b=!0,x=!0,w=!1,$=t.utils.state(),k=null,_=d3.dispatch("stateChange","changeState","renderEnd"),M=null,C=250,S=!1;n.xScale(p).yScale(g),r.orient("bottom").tickPadding(10),i.orient(w?"right":"left").tickPadding(10),a.axis("x"),s.axis("y"),u.headerFormatter(function(t,e){return r.tickFormat()(t,e)}).valueFormatter(function(t,e){return i.tickFormat()(t,e)});var E,A,T=t.utils.renderWatch(_,C),N=function(t){return function(){return{active:t.map(function(t){return!t.disabled})}}},D=function(t){return function(e){void 0!==e.active&&t.forEach(function(t,n){t.disabled=!e.active[n]})}};return e.dispatch=_,e.scatter=n,e.legend=o,e.xAxis=r,e.yAxis=i,e.distX=a,e.distY=s,e.tooltip=u,e.options=t.utils.optionsFunc.bind(e),e._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return f},set:function(t){f=t}},container:{get:function(){return d},set:function(t){d=t}},showDistX:{get:function(){return v},set:function(t){v=t}},showDistY:{get:function(){return m},set:function(t){m=t}},showLegend:{get:function(){return y},set:function(t){y=t}},showXAxis:{get:function(){return b},set:function(t){b=t}},showYAxis:{get:function(){return x},set:function(t){x=t}},defaultState:{get:function(){return k},set:function(t){k=t}},noData:{get:function(){return M},set:function(t){M=t}},duration:{get:function(){return C},set:function(t){C=t}},showLabels:{get:function(){return S},set:function(t){S=t}},margin:{get:function(){return l},set:function(t){l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},rightAlignYAxis:{get:function(){return w},set:function(t){w=t,i.orient(t?"right":"left")}},color:{get:function(){return h},set:function(e){h=t.utils.getColor(e),o.color(h),a.color(h),s.color(h)}}}),t.utils.inheritOptions(e,n),t.utils.initOptions(e),e},t.models.sparkline=function(){"use strict";function e(c){return b.reset(),c.each(function(e){var c=s-a.left-a.right,y=u-a.top-a.bottom;l=d3.select(this),t.utils.initSVG(l),f.domain(n||d3.extent(e,h)).range(i||[0,c]),d.domain(r||d3.extent(e,p)).range(o||[y,0]); -var b=l.selectAll("g.nv-wrap.nv-sparkline").data([e]),x=b.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline");x.append("g"),b.select("g");b.attr("transform","translate("+a.left+","+a.top+")");var w=b.selectAll("path").data(function(t){return[t]});w.enter().append("path"),w.exit().remove(),w.style("stroke",function(t,e){return t.color||g(t,e)}).attr("d",d3.svg.line().x(function(t,e){return f(h(t,e))}).y(function(t,e){return d(p(t,e))}));var $=b.selectAll("circle.nv-point").data(function(t){function e(e){if(e!=-1){var n=t[e];return n.pointIndex=e,n}return null}var n=t.map(function(t,e){return p(t,e)}),r=e(n.lastIndexOf(d.domain()[1])),i=e(n.indexOf(d.domain()[0])),o=e(n.length-1);return[v?i:null,v?r:null,m?o:null].filter(function(t){return null!=t})});$.enter().append("circle"),$.exit().remove(),$.attr("cx",function(t,e){return f(h(t,t.pointIndex))}).attr("cy",function(t,e){return d(p(t,t.pointIndex))}).attr("r",2).attr("class",function(t,e){return h(t,t.pointIndex)==f.domain()[1]?"nv-point nv-currentValue":p(t,t.pointIndex)==d.domain()[0]?"nv-point nv-noWatermark":"nv-point nv-maxValue"})}),b.renderEnd("sparkline immediate"),e}var n,r,i,o,a={top:2,right:0,bottom:2,left:0},s=400,u=32,l=null,c=!0,f=d3.scale.linear(),d=d3.scale.linear(),h=function(t){return t.x},p=function(t){return t.y},g=t.utils.getColor(["#000"]),v=!0,m=!0,y=d3.dispatch("renderEnd"),b=t.utils.renderWatch(y);return e.options=t.utils.optionsFunc.bind(e),e._options=Object.create({},{width:{get:function(){return s},set:function(t){s=t}},height:{get:function(){return u},set:function(t){u=t}},xDomain:{get:function(){return n},set:function(t){n=t}},yDomain:{get:function(){return r},set:function(t){r=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return o},set:function(t){o=t}},xScale:{get:function(){return f},set:function(t){f=t}},yScale:{get:function(){return d},set:function(t){d=t}},animate:{get:function(){return c},set:function(t){c=t}},showMinMaxPoints:{get:function(){return v},set:function(t){v=t}},showCurrentPoint:{get:function(){return m},set:function(t){m=t}},x:{get:function(){return h},set:function(t){h=d3.functor(t)}},y:{get:function(){return p},set:function(t){p=d3.functor(t)}},margin:{get:function(){return a},set:function(t){a.top=void 0!==t.top?t.top:a.top,a.right=void 0!==t.right?t.right:a.right,a.bottom=void 0!==t.bottom?t.bottom:a.bottom,a.left=void 0!==t.left?t.left:a.left}},color:{get:function(){return g},set:function(e){g=t.utils.getColor(e)}}}),e.dispatch=y,t.utils.initOptions(e),e},t.models.sparklinePlus=function(){"use strict";function e(g){return m.reset(),m.models(i),g.each(function(g){function v(){if(!l){var t=M.selectAll(".nv-hoverValue").data(u),e=t.enter().append("g").attr("class","nv-hoverValue").style("stroke-opacity",0).style("fill-opacity",0);t.exit().transition().duration(250).style("stroke-opacity",0).style("fill-opacity",0).remove(),t.attr("transform",function(t){return"translate("+n(i.x()(g[t],t))+",0)"}).transition().duration(250).style("stroke-opacity",1).style("fill-opacity",1),u.length&&(e.append("line").attr("x1",0).attr("y1",-o.top).attr("x2",0).attr("y2",x),e.append("text").attr("class","nv-xValue").attr("x",-6).attr("y",-o.top).attr("text-anchor","end").attr("dy",".9em"),M.select(".nv-hoverValue .nv-xValue").text(c(i.x()(g[u[0]],u[0]))),e.append("text").attr("class","nv-yValue").attr("x",6).attr("y",-o.top).attr("text-anchor","start").attr("dy",".9em"),M.select(".nv-hoverValue .nv-yValue").text(f(i.y()(g[u[0]],u[0]))))}}function m(){function t(t,e){for(var n=Math.abs(i.x()(t[0],0)-e),r=0,o=0;o=t[0]&&i.x()(e,n)<=t[1]}),disableTooltip:e.disableTooltip}}));e.transition().duration(D).call(i),S(),I()}var W=d3.select(this);t.utils.initSVG(W);var R=t.utils.availableWidth(h,W,d),B=t.utils.availableHeight(p,W,d)-(w?f.height():0);if(e.update=function(){W.transition().duration(D).call(e)},e.container=this,M.setter(F(c),e.update).getter(P(c)).update(),M.disabled=c.map(function(t){return!!t.disabled}),!C){var V;C={};for(V in M)M[V]instanceof Array?C[V]=M[V].slice(0):C[V]=M[V]}if(!(c&&c.length&&c.filter(function(t){return t.values.length}).length))return t.utils.noData(e,W),e;W.selectAll(".nv-noData").remove(),n=i.xScale(),r=i.yScale();var H=W.selectAll("g.nv-wrap.nv-stackedAreaChart").data([c]),U=H.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedAreaChart").append("g"),Y=H.select("g");U.append("g").attr("class","nv-legendWrap"),U.append("g").attr("class","nv-controlsWrap");var G=U.append("g").attr("class","nv-focus");G.append("g").attr("class","nv-background").append("rect"),G.append("g").attr("class","nv-x nv-axis"),G.append("g").attr("class","nv-y nv-axis"),G.append("g").attr("class","nv-stackedWrap"),G.append("g").attr("class","nv-interactive");U.append("g").attr("class","nv-focusWrap");if(m){var X=v?R-A:R;s.width(X),Y.select(".nv-legendWrap").datum(c).call(s),s.height()>d.top&&(d.top=s.height(),B=t.utils.availableHeight(p,W,d)-(w?f.height():0)),Y.select(".nv-legendWrap").attr("transform","translate("+(R-X)+","+-d.top+")")}else Y.select(".nv-legendWrap").selectAll("*").remove();if(v){var Z=[{key:N.stacked||"Stacked",metaKey:"Stacked",disabled:"stack"!=i.style(),style:"stack"},{key:N.stream||"Stream",metaKey:"Stream",disabled:"stream"!=i.style(),style:"stream"},{key:N.expanded||"Expanded",metaKey:"Expanded",disabled:"expand"!=i.style(),style:"expand"},{key:N.stack_percent||"Stack %",metaKey:"Stack_Percent",disabled:"stack_percent"!=i.style(),style:"stack_percent"}];A=T.length/3*260,Z=Z.filter(function(t){return T.indexOf(t.metaKey)!==-1}),u.width(A).color(["#444","#444","#444"]),Y.select(".nv-controlsWrap").datum(Z).call(u),Math.max(u.height(),s.height())>d.top&&(d.top=Math.max(u.height(),s.height()),B=t.utils.availableHeight(p,W,d)),Y.select(".nv-controlsWrap").attr("transform","translate(0,"+-d.top+")")}else Y.select(".nv-controlsWrap").selectAll("*").remove();H.attr("transform","translate("+d.left+","+d.top+")"),x&&Y.select(".nv-y.nv-axis").attr("transform","translate("+R+",0)"),$&&(l.width(R).height(B).margin({left:d.left,top:d.top}).svgContainer(W).xScale(n),H.select(".nv-interactive").call(l)),Y.select(".nv-focus .nv-background rect").attr("width",R).attr("height",B),i.width(R).height(B).color(c.map(function(t,e){return t.color||g(t,e)}).filter(function(t,e){return!c[e].disabled}));var Q=Y.select(".nv-focus .nv-stackedWrap").datum(c.filter(function(t){return!t.disabled}));if(y&&o.scale(n)._ticks(t.utils.calcTicksX(R/100,c)).tickSize(-B,0),b){var K;K="wiggle"===i.offset()?0:t.utils.calcTicksY(B/36,c),a.scale(r)._ticks(K).tickSize(-R,0)}if(w){f.width(R),Y.select(".nv-focusWrap").attr("transform","translate(0,"+(B+d.bottom+f.margin().top)+")").datum(c.filter(function(t){return!t.disabled})).call(f);var J=f.brush.empty()?f.xDomain():f.brush.extent();null!==J&&z(J)}else Q.transition().call(i),S(),I();i.dispatch.on("areaClick.toggle",function(t){1===c.filter(function(t){return!t.disabled}).length?c.forEach(function(t){t.disabled=!1}):c.forEach(function(e,n){e.disabled=n!=t.seriesIndex}),M.disabled=c.map(function(t){return!!t.disabled}),E.stateChange(M),e.update()}),s.dispatch.on("stateChange",function(t){for(var n in t)M[n]=t[n];E.stateChange(M),e.update()}),u.dispatch.on("legendClick",function(t,n){t.disabled&&(Z=Z.map(function(t){return t.disabled=!0,t}),t.disabled=!1,i.style(t.style),M.style=i.style(),E.stateChange(M),e.update())}),l.dispatch.on("elementMousemove",function(n){i.clearHighlights();var r,o,a,s=[],u=0,f=!0;if(c.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(l,c){o=t.interactiveBisect(l.values,n.pointXValue,e.x());var d=l.values[o],h=e.y()(d,o);if(null!=h&&i.highlightPoint(c,o,!0),"undefined"!=typeof d){"undefined"==typeof r&&(r=d),"undefined"==typeof a&&(a=e.xScale()(e.x()(d,o)));var p="expand"==i.style()?d.display.y:e.y()(d,o);s.push({key:l.key,value:p,color:g(l,l.seriesIndex),point:d}),k&&"expand"!=i.style()&&null!=p&&(u+=p,f=!1)}}),s.reverse(),s.length>2){var d=e.yScale().invert(n.mouseY),h=null;s.forEach(function(t,e){d=Math.abs(d);var n=Math.abs(t.point.display.y0),r=Math.abs(t.point.display.y);if(d>=n&&d<=r+n)return void(h=e)}),null!=h&&(s[h].highlight=!0)}k&&"expand"!=i.style()&&s.length>=2&&!f&&s.push({key:_,value:u,total:!0});var p=e.x()(r,o),v=l.tooltip.valueFormatter();"expand"===i.style()||"stack_percent"===i.style()?(j||(j=v),v=d3.format(".1%")):j&&(v=j,j=null),l.tooltip.valueFormatter(v).data({value:p,series:s})(),l.renderGuideLine(a)}),l.dispatch.on("elementMouseout",function(t){i.clearHighlights()}),f.dispatch.on("onBrush",function(t){z(t)}),E.on("changeState",function(t){"undefined"!=typeof t.disabled&&c.length===t.disabled.length&&(c.forEach(function(e,n){e.disabled=t.disabled[n]}),M.disabled=t.disabled),"undefined"!=typeof t.style&&(i.style(t.style),L=t.style),e.update()})}),I.renderEnd("stacked Area chart immediate"),e}var n,r,i=t.models.stackedArea(),o=t.models.axis(),a=t.models.axis(),s=t.models.legend(),u=t.models.legend(),l=t.interactiveGuideline(),c=t.models.tooltip(),f=t.models.focus(t.models.stackedArea()),d={top:30,right:25,bottom:50,left:60},h=null,p=null,g=t.utils.defaultColor(),v=!0,m=!0,y=!0,b=!0,x=!1,w=!1,$=!1,k=!0,_="TOTAL",M=t.utils.state(),C=null,S=null,E=d3.dispatch("stateChange","changeState","renderEnd"),A=250,T=["Stacked","Stream","Expanded"],N={},D=250;M.style=i.style(),o.orient("bottom").tickPadding(7),a.orient(x?"right":"left"),c.headerFormatter(function(t,e){return o.tickFormat()(t,e)}).valueFormatter(function(t,e){return a.tickFormat()(t,e)}),l.tooltip.headerFormatter(function(t,e){return o.tickFormat()(t,e)}).valueFormatter(function(t,e){return null==t?"N/A":a.tickFormat()(t,e)});var O=null,j=null;u.updateState(!1);var I=t.utils.renderWatch(E),L=i.style(),P=function(t){return function(){return{active:t.map(function(t){return!t.disabled}),style:i.style()}}},F=function(t){return function(e){void 0!==e.style&&(L=e.style),void 0!==e.active&&t.forEach(function(t,n){t.disabled=!e.active[n]})}},q=d3.format("%");return i.dispatch.on("elementMouseover.tooltip",function(t){t.point.x=i.x()(t.point),t.point.y=i.y()(t.point),c.data(t).hidden(!1)}),i.dispatch.on("elementMouseout.tooltip",function(t){c.hidden(!0)}),e.dispatch=E,e.stacked=i,e.legend=s,e.controls=u,e.xAxis=o,e.x2Axis=f.xAxis,e.yAxis=a,e.y2Axis=f.yAxis,e.interactiveLayer=l,e.tooltip=c,e.focus=f,e.dispatch=E,e.options=t.utils.optionsFunc.bind(e),e._options=Object.create({},{width:{get:function(){return h},set:function(t){h=t}},height:{get:function(){return p},set:function(t){p=t}},showLegend:{get:function(){return m},set:function(t){m=t}},showXAxis:{get:function(){return y},set:function(t){y=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return C},set:function(t){C=t}},noData:{get:function(){return S},set:function(t){S=t}},showControls:{get:function(){return v},set:function(t){v=t}},controlLabels:{get:function(){return N},set:function(t){N=t}},controlOptions:{get:function(){return T},set:function(t){T=t}},showTotalInTooltip:{get:function(){return k},set:function(t){k=t}},totalLabel:{get:function(){return _},set:function(t){_=t}},focusEnable:{get:function(){return w},set:function(t){w=t}},focusHeight:{get:function(){return f.height()},set:function(t){f.height(t)}},brushExtent:{get:function(){return f.brushExtent()},set:function(t){f.brushExtent(t)}},margin:{get:function(){return d},set:function(t){d.top=void 0!==t.top?t.top:d.top,d.right=void 0!==t.right?t.right:d.right,d.bottom=void 0!==t.bottom?t.bottom:d.bottom,d.left=void 0!==t.left?t.left:d.left}},focusMargin:{get:function(){return f.margin},set:function(t){f.margin.top=void 0!==t.top?t.top:f.margin.top,f.margin.right=void 0!==t.right?t.right:f.margin.right,f.margin.bottom=void 0!==t.bottom?t.bottom:f.margin.bottom,f.margin.left=void 0!==t.left?t.left:f.margin.left}},duration:{get:function(){return D},set:function(t){D=t,I.reset(D),i.duration(D),o.duration(D),a.duration(D)}},color:{get:function(){return g},set:function(e){g=t.utils.getColor(e),s.color(g),i.color(g),f.color(g)}},x:{get:function(){return i.x()},set:function(t){i.x(t),f.x(t)}},y:{get:function(){return i.y()},set:function(t){i.y(t),f.y(t)}},rightAlignYAxis:{get:function(){return x},set:function(t){x=t,a.orient(x?"right":"left")}},useInteractiveGuideline:{get:function(){return $},set:function(t){$=!!t,e.interactive(!t),e.useVoronoi(!t),i.scatter.interactive(!t)}}}),t.utils.inheritOptions(e,i),t.utils.initOptions(e),e},t.models.stackedAreaWithFocusChart=function(){return t.models.stackedAreaChart().margin({bottom:30}).focusEnable(!0)},t.models.sunburst=function(){"use strict";function e(t){var e=n(t);return e>90?180:0}function n(t){var e=Math.max(0,Math.min(2*Math.PI,N(t.x))),n=Math.max(0,Math.min(2*Math.PI,N(t.x+t.dx))),r=(e+n)/2*(180/Math.PI)-90;return r}function r(t){var e=Math.max(0,Math.min(2*Math.PI,N(t.x))),n=Math.max(0,Math.min(2*Math.PI,N(t.x+t.dx)));return(n-e)/(2*Math.PI)}function i(t){var e=Math.max(0,Math.min(2*Math.PI,N(t.x))),n=Math.max(0,Math.min(2*Math.PI,N(t.x+t.dx))),r=n-e;return r>M}function o(t,e){var n=d3.interpolate(N.domain(),[f.x,f.x+f.dx]),r=d3.interpolate(D.domain(),[f.y,1]),i=d3.interpolate(D.range(),[f.y?20:0,p]);return 0===e?function(){return I(t)}:function(e){return N.domain(n(e)),D.domain(r(e)).range(i(e)),I(t)}}function a(t){var e=d3.interpolate({x:t.x0,dx:t.dx0,y:t.y0,dy:t.dy0},t);return function(n){var r=e(n);return t.x0=r.x,t.dx0=r.dx,t.y0=r.y,t.dy0=r.dy,I(r)}}function s(t){var e=S(t);j[e]||(j[e]={});var n=j[e];n.dx=t.dx,n.x=t.x,n.dy=t.dy,n.y=t.y}function u(t){t.forEach(function(t){var e=S(t),n=j[e];n?(t.dx0=n.dx,t.x0=n.x,t.dy0=n.dy,t.y0=n.y):(t.dx0=t.dx,t.x0=t.x,t.dy0=t.dy,t.y0=t.y),s(t)})}function l(t){var r=w.selectAll("text"),a=w.selectAll("path");r.transition().attr("opacity",0),f=t,a.transition().duration(A).attrTween("d",o).each("end",function(r){if(r.x>=t.x&&r.x=t.depth){var o=d3.select(this.parentNode),a=o.select("text");a.transition().duration(A).text(function(t){return _(t)}).attr("opacity",function(t){return i(t)?1:0}).attr("transform",function(){var i=this.getBBox().width;if(0===r.depth)return"translate("+i/2*-1+",0)";if(r.depth===t.depth)return"translate("+(D(r.y)+5)+",0)";var o=n(r),a=e(r);return 0===a?"rotate("+o+")translate("+(D(r.y)+5)+",0)":"rotate("+o+")translate("+(D(r.y)+i+5)+",0)rotate("+a+")"})}})}function c(o){return L.reset(),o.each(function(o){w=d3.select(this),d=t.utils.availableWidth(v,w,g),h=t.utils.availableHeight(m,w,g),p=Math.min(d,h)/2,D.range([0,p]);var s=w.select("g.nvd3.nv-wrap.nv-sunburst");s[0][0]?s.attr("transform","translate("+(d/2+g.left+g.right)+","+(h/2+g.top+g.bottom)+")"):s=w.append("g").attr("class","nvd3 nv-wrap nv-sunburst nv-chart-"+x).attr("transform","translate("+(d/2+g.left+g.right)+","+(h/2+g.top+g.bottom)+")"),w.on("click",function(t,e){T.chartClick({data:t,index:e,pos:d3.event,id:x})}),O.value(b[y]||b.count);var c=O.nodes(o[0]).reverse();u(c);var f=s.selectAll(".arc-container").data(c,S),M=f.enter().append("g").attr("class","arc-container");M.append("path").attr("d",I).style("fill",function(t){return t.color?t.color:$(E?(t.children?t:t.parent).name:t.name)}).style("stroke","#FFF").on("click",l).on("mouseover",function(t,e){d3.select(this).classed("hover",!0).style("opacity",.8),T.elementMouseover({data:t,color:d3.select(this).style("fill"),percent:r(t)})}).on("mouseout",function(t,e){d3.select(this).classed("hover",!1).style("opacity",1),T.elementMouseout({data:t})}).on("mousemove",function(t,e){T.elementMousemove({data:t})}),f.each(function(t){d3.select(this).select("path").transition().duration(A).attrTween("d",a)}),k&&(f.selectAll("text").remove(),f.append("text").text(function(t){return _(t)}).transition().duration(A).attr("opacity",function(t){return i(t)?1:0}).attr("transform",function(t){var r=this.getBBox().width;if(0===t.depth)return"rotate(0)translate("+r/2*-1+",0)";var i=n(t),o=e(t);return 0===o?"rotate("+i+")translate("+(D(t.y)+5)+",0)":"rotate("+i+")translate("+(D(t.y)+r+5)+",0)rotate("+o+")"})),l(c[c.length-1]),f.exit().transition().duration(A).attr("opacity",0).each("end",function(t){var e=S(t);j[e]=void 0}).remove()}),L.renderEnd("sunburst immediate"),c}var f,d,h,p,g={top:0,right:0,bottom:0,left:0},v=600,m=600,y="count",b={count:function(t){return 1},value:function(t){return t.value||t.size},size:function(t){return t.value||t.size}},x=Math.floor(1e4*Math.random()),w=null,$=t.utils.defaultColor(),k=!1,_=function(t){return"count"===y?t.name+" #"+t.value:t.name+" "+(t.value||t.size)},M=.02,C=function(t,e){return t.name>e.name},S=function(t,e){return t.name},E=!0,A=500,T=d3.dispatch("chartClick","elementClick","elementDblClick","elementMousemove","elementMouseover","elementMouseout","renderEnd"),N=d3.scale.linear().range([0,2*Math.PI]),D=d3.scale.sqrt(),O=d3.layout.partition().sort(C),j={},I=d3.svg.arc().startAngle(function(t){return Math.max(0,Math.min(2*Math.PI,N(t.x)))}).endAngle(function(t){return Math.max(0,Math.min(2*Math.PI,N(t.x+t.dx)))}).innerRadius(function(t){return Math.max(0,D(t.y))}).outerRadius(function(t){return Math.max(0,D(t.y+t.dy))}),L=t.utils.renderWatch(T);return c.dispatch=T,c.options=t.utils.optionsFunc.bind(c),c._options=Object.create({},{width:{get:function(){return v},set:function(t){v=t}},height:{get:function(){return m},set:function(t){m=t}},mode:{get:function(){return y},set:function(t){y=t}},id:{get:function(){return x},set:function(t){x=t}},duration:{get:function(){return A},set:function(t){A=t}},groupColorByParent:{get:function(){return E},set:function(t){E=!!t}},showLabels:{get:function(){return k},set:function(t){k=!!t}},labelFormat:{get:function(){return _},set:function(t){_=t}},labelThreshold:{get:function(){return M},set:function(t){M=t}},sort:{get:function(){return C},set:function(t){C=t}},key:{get:function(){return S},set:function(t){S=t}},margin:{get:function(){return g},set:function(t){g.top=void 0!=t.top?t.top:g.top,g.right=void 0!=t.right?t.right:g.right,g.bottom=void 0!=t.bottom?t.bottom:g.bottom,g.left=void 0!=t.left?t.left:g.left}},color:{get:function(){return $},set:function(e){$=t.utils.getColor(e)}}}),t.utils.initOptions(c),c},t.models.sunburstChart=function(){"use strict";function e(r){return h.reset(),h.models(n),r.each(function(r){var s=d3.select(this);t.utils.initSVG(s);var u=t.utils.availableWidth(o,s,i),l=t.utils.availableHeight(a,s,i);return e.update=function(){0===f?s.call(e):s.transition().duration(f).call(e)},e.container=s,r&&r.length?(s.selectAll(".nv-noData").remove(),n.width(u).height(l).margin(i),void s.call(n)):(t.utils.noData(e,s),e)}),h.renderEnd("sunburstChart immediate"),e}var n=t.models.sunburst(),r=t.models.tooltip(),i={top:30,right:20,bottom:20,left:20},o=null,a=null,s=t.utils.defaultColor(),u=!1,l=(Math.round(1e5*Math.random()),null),c=null,f=250,d=d3.dispatch("stateChange","changeState","renderEnd"),h=t.utils.renderWatch(d);return r.duration(0).headerEnabled(!1).valueFormatter(function(t){return t}),n.dispatch.on("elementMouseover.tooltip",function(t){t.series={key:t.data.name,value:t.data.value||t.data.size,color:t.color,percent:t.percent},u||(delete t.percent,delete t.series.percent),r.data(t).hidden(!1)}),n.dispatch.on("elementMouseout.tooltip",function(t){r.hidden(!0)}),n.dispatch.on("elementMousemove.tooltip",function(t){r()}),e.dispatch=d,e.sunburst=n,e.tooltip=r,e.options=t.utils.optionsFunc.bind(e),e._options=Object.create({},{noData:{get:function(){return c},set:function(t){c=t}},defaultState:{get:function(){return l},set:function(t){l=t}},showTooltipPercent:{get:function(){return u},set:function(t){u=t}},color:{get:function(){return s},set:function(t){s=t,n.color(s)}},duration:{get:function(){return f},set:function(t){f=t,h.reset(f),n.duration(f)}},margin:{get:function(){return i},set:function(t){i.top=void 0!==t.top?t.top:i.top,i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left,n.margin(i)}}}),t.utils.inheritOptions(e,n),t.utils.initOptions(e),e},t.version="1.8.4"}(),function(){var t=this,e="addEventListener",n="removeEventListener",r="getBoundingClientRect",i=t.attachEvent&&!t[e],o=t.document,a=function(){for(var t,e=["","-webkit-","-moz-","-o-"],n=0;n=this.size-this.bMin-l.snapOffset&&(e=this.size-this.bMin),k.call(this,e),l.onDrag&&l.onDrag())},$=function(){var e=t.getComputedStyle(this.parent),n=this.parent[d]-parseFloat(e[v])-parseFloat(e[m]);this.size=this.a[r]()[c]+this.b[r]()[c]+this.aGutterSize+this.bGutterSize,this.percentage=Math.min(this.size/n*100,100),this.start=this.a[r]()[p]},k=function(t){this.a.style[c]=a+"("+t/this.size*this.percentage+"% - "+this.aGutterSize+"px)",this.b.style[c]=a+"("+(this.percentage-t/this.size*this.percentage)+"% - "+this.bGutterSize+"px)"},_=function(){var t=this,e=t.a,n=t.b;e[r]()[c]=0;e--)$.call(t[e]),M.call(t[e])},S=function(){return!1},E=s(u[0]).parentNode;if(!l.sizes){var A=100/u.length;for(l.sizes=[],f=0;f0&&(D={a:s(u[f-1]),b:O,aMin:l.minSize[f-1],bMin:l.minSize[f],dragging:!1,parent:E,isFirst:j,isLast:I,direction:l.direction},D.aGutterSize=l.gutterSize,D.bGutterSize=l.gutterSize,j&&(D.aGutterSize=l.gutterSize/2),I&&(D.bGutterSize=l.gutterSize/2)),i)N="string"==typeof l.sizes[f]||l.sizes[f]instanceof String?l.sizes[f]:l.sizes[f]+"%";else{if(f>0){var P=o.createElement("div");P.className=g,P.style[c]=l.gutterSize+"px",P[e]("mousedown",b.bind(D)),P[e]("touchstart",b.bind(D)),E.insertBefore(P,O),D.gutter=P}0!==f&&f!=u.length-1||(L=l.gutterSize/2),N="string"==typeof l.sizes[f]||l.sizes[f]instanceof String?l.sizes[f]:a+"("+l.sizes[f]+"% - "+L+"px)"}O.style[c]=N,f>0&&y.push(D)}C(y)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=u),exports.Split=u):t.Split=u}.call(window),function(){"use strict";function t(t,e){return t.module("angularMoment",[]).constant("angularMomentConfig",{preprocess:null,timezone:"",format:null,statefulFilters:!0}).constant("moment",e).constant("amTimeAgoConfig",{withoutSuffix:!1,serverTime:null,titleFormat:null,fullDateThreshold:null,fullDateFormat:null}).directive("amTimeAgo",["$window","moment","amMoment","amTimeAgoConfig","angularMomentConfig",function(e,n,r,i,o){return function(a,s,u){function l(){var t;if(g)t=g;else if(i.serverTime){var e=(new Date).getTime(),r=e-$+i.serverTime;t=n(r)}else t=n();return t}function c(){v&&(e.clearTimeout(v),v=null)}function f(t){var n=l().diff(t,"day"),r=x&&n>=x;if(r?s.text(t.format(w)):s.text(t.from(l(),y)),b&&!s.attr("title")&&s.attr("title",t.local().format(b)),!r){var i=Math.abs(l().diff(t,"minute")),o=3600;i<1?o=1:i<60?o=30:i<180&&(o=300),v=e.setTimeout(function(){f(t)},1e3*o)}}function d(t){M&&s.attr("datetime",t)}function h(){if(c(),p){var t=r.preprocessDate(p,k,m);f(t),d(t.toISOString())}}var p,g,v=null,m=o.format,y=i.withoutSuffix,b=i.titleFormat,x=i.fullDateThreshold,w=i.fullDateFormat,$=(new Date).getTime(),k=o.preprocess,_=u.amTimeAgo,M="TIME"===s[0].nodeName.toUpperCase();a.$watch(_,function(t){return"undefined"==typeof t||null===t||""===t?(c(),void(p&&(s.text(""),d(""),p=null))):(p=t,void h())}),t.isDefined(u.amFrom)&&a.$watch(u.amFrom,function(t){g="undefined"==typeof t||null===t||""===t?null:n(t),h()}),t.isDefined(u.amWithoutSuffix)&&a.$watch(u.amWithoutSuffix,function(t){"boolean"==typeof t?(y=t,h()):y=i.withoutSuffix}),u.$observe("amFormat",function(t){"undefined"!=typeof t&&(m=t,h())}),u.$observe("amPreprocess",function(t){k=t,h()}),u.$observe("amFullDateThreshold",function(t){x=t,h()}),u.$observe("amFullDateFormat",function(t){w=t,h()}),a.$on("$destroy",function(){c()}),a.$on("amMoment:localeChanged",function(){h()})}}]).service("amMoment",["moment","$rootScope","$log","angularMomentConfig",function(e,n,r,i){this.preprocessors={utc:e.utc,unix:e.unix},this.changeLocale=function(r,i){var o=e.locale(r,i);return t.isDefined(r)&&n.$broadcast("amMoment:localeChanged"),o},this.changeTimezone=function(t){i.timezone=t,n.$broadcast("amMoment:timezoneChanged")},this.preprocessDate=function(n,o,a){return t.isUndefined(o)&&(o=i.preprocess),this.preprocessors[o]?this.preprocessors[o](n,a):(o&&r.warn("angular-moment: Ignoring unsupported value for preprocess: "+o),!isNaN(parseFloat(n))&&isFinite(n)?e(parseInt(n,10)):e(n,a))},this.applyTimezone=function(t,e){return(e=e||i.timezone)?(e.match(/^Z|[+-]\d\d:?\d\d$/i)?t=t.utcOffset(e):t.tz?t=t.tz(e):r.warn("angular-moment: named timezone specified but moment.tz() is undefined. Did you forget to include moment-timezone.js?"),t):t}}]).filter("amCalendar",["moment","amMoment","angularMomentConfig",function(t,e,n){function r(n,r,i){if("undefined"==typeof n||null===n)return"";n=e.preprocessDate(n,r);var o=t(n);return o.isValid()?e.applyTimezone(o,i).calendar():""}return r.$stateful=n.statefulFilters,r}]).filter("amDifference",["moment","amMoment","angularMomentConfig",function(t,e,n){function r(n,r,i,o,a,s){if("undefined"==typeof n||null===n)return"";n=e.preprocessDate(n,a);var u=t(n);if(!u.isValid())return"";var l;if("undefined"==typeof r||null===r)l=t();else if(r=e.preprocessDate(r,s),l=t(r),!l.isValid())return"";return e.applyTimezone(u).diff(e.applyTimezone(l),i,o)}return r.$stateful=n.statefulFilters,r}]).filter("amDateFormat",["moment","amMoment","angularMomentConfig",function(t,e,n){function r(r,i,o,a,s){var u=s||n.format;if("undefined"==typeof r||null===r)return"";r=e.preprocessDate(r,o,u);var l=t(r);return l.isValid()?e.applyTimezone(l,a).format(i):""}return r.$stateful=n.statefulFilters,r}]).filter("amDurationFormat",["moment","angularMomentConfig",function(t,e){function n(e,n,r){return"undefined"==typeof e||null===e?"":t.duration(e,n).humanize(r)}return n.$stateful=e.statefulFilters,n}]).filter("amTimeAgo",["moment","amMoment","angularMomentConfig",function(t,e,n){function r(n,r,i,o){var a,s;return"undefined"==typeof n||null===n?"":(n=e.preprocessDate(n,r),a=t(n),a.isValid()?(s=t(o),"undefined"!=typeof o&&s.isValid()?e.applyTimezone(a).from(s,i):e.applyTimezone(a).fromNow(i)):"")}return r.$stateful=n.statefulFilters,r}]).filter("amSubtract",["moment","angularMomentConfig",function(t,e){function n(e,n,r){return"undefined"==typeof e||null===e?"":t(e).subtract(parseInt(n,10),r)}return n.$stateful=e.statefulFilters,n}]).filter("amAdd",["moment","angularMomentConfig",function(t,e){function n(e,n,r){return"undefined"==typeof e||null===e?"":t(e).add(parseInt(n,10),r)}return n.$stateful=e.statefulFilters,n}])}"function"==typeof define&&define.amd?define(["angular","moment"],t):"undefined"!=typeof module&&module&&module.exports?(t(angular,require("moment")),module.exports="angularMoment"):t(angular,("undefined"!=typeof global?global:window).moment)}(),function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a0&&(i=u.removeMin(),o=s[i],o.distance!==Number.POSITIVE_INFINITY);)r(i).forEach(l);return s}var o=t("../lodash"),a=t("../data/priority-queue");e.exports=r;var s=o.constant(1)},{"../data/priority-queue":16,"../lodash":20}],7:[function(t,e,n){function r(t){return i.filter(o(t),function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])})}var i=t("../lodash"),o=t("./tarjan");e.exports=r},{"../lodash":20,"./tarjan":14}],8:[function(t,e,n){function r(t,e,n){return i(t,e||a,n||function(e){return t.outEdges(e)})}function i(t,e,n){var r={},i=t.nodes();return i.forEach(function(t){r[t]={},r[t][t]={distance:0},i.forEach(function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})}),n(t).forEach(function(n){var i=n.v===t?n.w:n.v,o=e(n);r[t][i]={distance:o,predecessor:t}})}),i.forEach(function(t){var e=r[t];i.forEach(function(n){var o=r[n];i.forEach(function(n){var r=o[t],i=e[n],a=o[n],s=r.distance+i.distance;s0;){if(r=l.removeMin(),i.has(u,r))s.setEdge(r,u[r]);else{if(c)throw new Error("Input graph is not connected: "+t);c=!0}t.nodeEdges(r).forEach(n)}return s}var i=t("../lodash"),o=t("../graph"),a=t("../data/priority-queue");e.exports=r},{"../data/priority-queue":16,"../graph":17,"../lodash":20}],14:[function(t,e,n){function r(t){function e(s){var u=o[s]={onStack:!0,lowlink:n,index:n++};if(r.push(s),t.successors(s).forEach(function(t){i.has(o,t)?o[t].onStack&&(u.lowlink=Math.min(u.lowlink,o[t].index)):(e(t),u.lowlink=Math.min(u.lowlink,o[t].lowlink))}),u.lowlink===u.index){var l,c=[];do l=r.pop(),o[l].onStack=!1,c.push(l);while(s!==l);a.push(c)}}var n=0,r=[],o={},a=[];return t.nodes().forEach(function(t){i.has(o,t)||e(t)}),a}var i=t("../lodash");e.exports=r},{"../lodash":20}],15:[function(t,e,n){function r(t){function e(s){if(o.has(r,s))throw new i;o.has(n,s)||(r[s]=!0,n[s]=!0,o.each(t.predecessors(s),e),delete r[s],a.push(s))}var n={},r={},a=[];if(o.each(t.sinks(),e),o.size(n)!==t.nodeCount())throw new i;return a}function i(){}var o=t("../lodash");e.exports=r,r.CycleException=i},{"../lodash":20}],16:[function(t,e,n){function r(){this._arr=[],this._keyIndices={}}var i=t("../lodash");e.exports=r,r.prototype.size=function(){return this._arr.length},r.prototype.keys=function(){return this._arr.map(function(t){return t.key})},r.prototype.has=function(t){return i.has(this._keyIndices,t)},r.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},r.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},r.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!i.has(n,t)){var r=this._arr,o=r.length;return n[t]=o,r.push({key:t,priority:e}),this._decrease(o),!0}return!1},r.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},r.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},r.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n>1,!(n[e].priorityo){var a=i;i=o,o=a}return i+d+o+d+(l.isUndefined(r)?c:r)}function s(t,e,n,r){var i=""+e,o=""+n;if(!t&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}function u(t,e){return a(t,e.v,e.w,e.name)}var l=t("./lodash");e.exports=r;var c="\0",f="\0",d="";r.prototype._nodeCount=0,r.prototype._edgeCount=0,r.prototype.isDirected=function(){return this._isDirected},r.prototype.isMultigraph=function(){return this._isMultigraph},r.prototype.isCompound=function(){return this._isCompound},r.prototype.setGraph=function(t){return this._label=t,this},r.prototype.graph=function(){return this._label},r.prototype.setDefaultNodeLabel=function(t){return l.isFunction(t)||(t=l.constant(t)),this._defaultNodeLabelFn=t,this},r.prototype.nodeCount=function(){return this._nodeCount},r.prototype.nodes=function(){return l.keys(this._nodes)},r.prototype.sources=function(){return l.filter(this.nodes(),function(t){return l.isEmpty(this._in[t])},this)},r.prototype.sinks=function(){return l.filter(this.nodes(),function(t){return l.isEmpty(this._out[t])},this)},r.prototype.setNodes=function(t,e){var n=arguments;return l.each(t,function(t){n.length>1?this.setNode(t,e):this.setNode(t)},this),this},r.prototype.setNode=function(t,e){return l.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=f,this._children[t]={},this._children[f][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},r.prototype.node=function(t){return this._nodes[t]},r.prototype.hasNode=function(t){return l.has(this._nodes,t)},r.prototype.removeNode=function(t){var e=this;if(l.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],l.each(this.children(t),function(t){this.setParent(t)},this),delete this._children[t]),l.each(l.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],l.each(l.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},r.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(l.isUndefined(e))e=f;else{e+="";for(var n=e;!l.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},r.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},r.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==f)return e}},r.prototype.children=function(t){if(l.isUndefined(t)&&(t=f),this._isCompound){var e=this._children[t];if(e)return l.keys(e)}else{if(t===f)return this.nodes();if(this.hasNode(t))return[]}},r.prototype.predecessors=function(t){var e=this._preds[t];if(e)return l.keys(e)},r.prototype.successors=function(t){var e=this._sucs[t];if(e)return l.keys(e)},r.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return l.union(e,this.successors(t))},r.prototype.filterNodes=function(t){function e(t){var o=r.parent(t);return void 0===o||n.hasNode(o)?(i[t]=o,o):o in i?i[o]:e(o)}var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph()),l.each(this._nodes,function(e,r){t(r)&&n.setNode(r,e)},this),l.each(this._edgeObjs,function(t){n.hasNode(t.v)&&n.hasNode(t.w)&&n.setEdge(t,this.edge(t))},this);var r=this,i={};return this._isCompound&&l.each(n.nodes(),function(t){n.setParent(t,e(t))}),n},r.prototype.setDefaultEdgeLabel=function(t){return l.isFunction(t)||(t=l.constant(t)),this._defaultEdgeLabelFn=t,this},r.prototype.edgeCount=function(){return this._edgeCount},r.prototype.edges=function(){return l.values(this._edgeObjs)},r.prototype.setPath=function(t,e){var n=this,r=arguments;return l.reduce(t,function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i}),this},r.prototype.setEdge=function(){var t,e,n,r,o=!1,u=arguments[0];"object"==typeof u&&null!==u&&"v"in u?(t=u.v,e=u.w,n=u.name,2===arguments.length&&(r=arguments[1],o=!0)):(t=u,e=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],o=!0)),t=""+t,e=""+e,l.isUndefined(n)||(n=""+n);var c=a(this._isDirected,t,e,n);if(l.has(this._edgeLabels,c))return o&&(this._edgeLabels[c]=r),this;if(!l.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[c]=o?r:this._defaultEdgeLabelFn(t,e,n);var f=s(this._isDirected,t,e,n);return t=f.v,e=f.w,Object.freeze(f),this._edgeObjs[c]=f,i(this._preds[e],t),i(this._sucs[t],e),this._in[e][c]=f,this._out[t][c]=f,this._edgeCount++,this},r.prototype.edge=function(t,e,n){var r=1===arguments.length?u(this._isDirected,arguments[0]):a(this._isDirected,t,e,n);return this._edgeLabels[r]},r.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?u(this._isDirected,arguments[0]):a(this._isDirected,t,e,n);return l.has(this._edgeLabels,r)},r.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?u(this._isDirected,arguments[0]):a(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],o(this._preds[e],t),o(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},r.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=l.values(n);return e?l.filter(r,function(t){return t.v===e}):r}},r.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=l.values(n);return e?l.filter(r,function(t){return t.w===e}):r}},r.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}},{"./lodash":20}],18:[function(t,e,n){e.exports={Graph:t("./graph"),version:t("./version")}},{"./graph":17,"./version":21}],19:[function(t,e,n){function r(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:i(t),edges:o(t)};return s.isUndefined(t.graph())||(e.value=s.clone(t.graph())),e}function i(t){return s.map(t.nodes(),function(e){var n=t.node(e),r=t.parent(e),i={v:e};return s.isUndefined(n)||(i.value=n),s.isUndefined(r)||(i.parent=r),i})}function o(t){return s.map(t.edges(),function(e){var n=t.edge(e),r={v:e.v,w:e.w};return s.isUndefined(e.name)||(r.name=e.name),s.isUndefined(n)||(r.value=n),r})}function a(t){var e=new u(t.options).setGraph(t.value);return s.each(t.nodes,function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),s.each(t.edges,function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}var s=t("./lodash"),u=t("./graph");e.exports={write:r,read:a}},{"./graph":17,"./lodash":20}],20:[function(t,e,n){var r;if("function"==typeof t)try{r=t("lodash")}catch(i){}r||(r=window._),e.exports=r},{lodash:void 0}],21:[function(t,e,n){e.exports="1.0.7"},{}]},{},[1]),function(t,e){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(n){return e(t,n)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}(window,function(t,e){"use strict";function n(t,e){for(var n in e)t[n]=e[n];return t}function r(t){var e=[];if(Array.isArray(t))e=t;else if("number"==typeof t.length)for(var n=0;n0;--u)if(r=e[u].dequeue()){i=i.concat(o(t,e,n,r,!0));break}}return i}function o(t,e,n,r,i){var o=i?[]:void 0;return u.each(t.inEdges(r.v),function(r){var a=t.edge(r),u=t.node(r.v);i&&o.push({v:r.v,w:r.w}),u.out-=a,s(e,n,u)}),u.each(t.outEdges(r.v),function(r){var i=t.edge(r),o=r.w,a=t.node(o);a["in"]-=i,s(e,n,a)}),t.removeNode(r.v),o}function a(t,e){var n=new l,r=0,i=0;u.each(t.nodes(),function(t){n.setNode(t,{v:t,"in":0,out:0})}),u.each(t.edges(),function(t){var o=n.edge(t.v,t.w)||0,a=e(t),s=o+a;n.setEdge(t.v,t.w,s),i=Math.max(i,n.node(t.v).out+=a),r=Math.max(r,n.node(t.w)["in"]+=a)});var o=u.range(i+r+3).map(function(){return new c}),a=r+1;return u.each(n.nodes(),function(t){s(o,a,n.node(t))}),{graph:n,buckets:o,zeroIdx:a}}function s(t,e,n){n.out?n["in"]?t[n.out-n["in"]+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}var u=t("./lodash"),l=t("./graphlib").Graph,c=t("./data/list");e.exports=r;var f=u.constant(1)},{"./data/list":5,"./graphlib":7,"./lodash":10}],9:[function(t,e,n){"use strict";function r(t,e){var n=e&&e.debugTiming?O.time:O.notime;n("layout",function(){var e=n(" buildLayoutGraph",function(){return a(t)});n(" runLayout",function(){i(e,n)}),n(" updateInputGraph",function(){o(t,e)})})}function i(t,e){e(" makeSpaceForEdgeLabels",function(){s(t)}),e(" removeSelfEdges",function(){v(t)}),e(" acyclic",function(){$.run(t)}),e(" nestingGraph.run",function(){E.run(t)}),e(" rank",function(){_(O.asNonCompoundGraph(t))}),e(" injectEdgeLabelProxies",function(){u(t)}),e(" removeEmptyRanks",function(){S(t)}),e(" nestingGraph.cleanup",function(){E.cleanup(t)}),e(" normalizeRanks",function(){M(t)}),e(" assignRankMinMax",function(){l(t)}),e(" removeEdgeLabelProxies",function(){c(t)}),e(" normalize.run",function(){k.run(t)}),e(" parentDummyChains",function(){C(t)}),e(" addBorderSegments",function(){A(t)}),e(" order",function(){N(t)}),e(" insertSelfEdges",function(){ -m(t)}),e(" adjustCoordinateSystem",function(){T.adjust(t)}),e(" position",function(){D(t)}),e(" positionSelfEdges",function(){y(t)}),e(" removeBorderNodes",function(){g(t)}),e(" normalize.undo",function(){k.undo(t)}),e(" fixupEdgeLabelCoords",function(){h(t)}),e(" undoCoordinateSystem",function(){T.undo(t)}),e(" translateGraph",function(){f(t)}),e(" assignNodeIntersects",function(){d(t)}),e(" reversePoints",function(){p(t)}),e(" acyclic.undo",function(){$.undo(t)})}function o(t,e){w.each(t.nodes(),function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,e.children(n).length&&(r.width=i.width,r.height=i.height))}),w.each(t.edges(),function(n){var r=t.edge(n),i=e.edge(n);r.points=i.points,w.has(i,"x")&&(r.x=i.x,r.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}function a(t){var e=new j({multigraph:!0,compound:!0}),n=x(t.graph());return e.setGraph(w.merge({},L,b(n,I),w.pick(n,P))),w.each(t.nodes(),function(n){var r=x(t.node(n));e.setNode(n,w.defaults(b(r,F),q)),e.setParent(n,t.parent(n))}),w.each(t.edges(),function(n){var r=x(t.edge(n));e.setEdge(n,w.merge({},W,b(r,z),w.pick(r,R)))}),e}function s(t){var e=t.graph();e.ranksep/=2,w.each(t.edges(),function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function u(t){w.each(t.edges(),function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i=t.node(e.w),o={rank:(i.rank-r.rank)/2+r.rank,e:e};O.addDummyNode(t,"edge-proxy",o,"_ep")}})}function l(t){var e=0;w.each(t.nodes(),function(n){var r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=w.max(e,r.maxRank))}),t.graph().maxRank=e}function c(t){w.each(t.nodes(),function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))})}function f(t){function e(t){var e=t.x,a=t.y,s=t.width,u=t.height;n=Math.min(n,e-s/2),r=Math.max(r,e+s/2),i=Math.min(i,a-u/2),o=Math.max(o,a+u/2)}var n=Number.POSITIVE_INFINITY,r=0,i=Number.POSITIVE_INFINITY,o=0,a=t.graph(),s=a.marginx||0,u=a.marginy||0;w.each(t.nodes(),function(n){e(t.node(n))}),w.each(t.edges(),function(n){var r=t.edge(n);w.has(r,"x")&&e(r)}),n-=s,i-=u,w.each(t.nodes(),function(e){var r=t.node(e);r.x-=n,r.y-=i}),w.each(t.edges(),function(e){var r=t.edge(e);w.each(r.points,function(t){t.x-=n,t.y-=i}),w.has(r,"x")&&(r.x-=n),w.has(r,"y")&&(r.y-=i)}),a.width=r-n+s,a.height=o-i+u}function d(t){w.each(t.edges(),function(e){var n,r,i=t.edge(e),o=t.node(e.v),a=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(O.intersectRect(o,n)),i.points.push(O.intersectRect(a,r))})}function h(t){w.each(t.edges(),function(e){var n=t.edge(e);if(w.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})}function p(t){w.each(t.edges(),function(e){var n=t.edge(e);n.reversed&&n.points.reverse()})}function g(t){w.each(t.nodes(),function(e){if(t.children(e).length){var n=t.node(e),r=t.node(n.borderTop),i=t.node(n.borderBottom),o=t.node(w.last(n.borderLeft)),a=t.node(w.last(n.borderRight));n.width=Math.abs(a.x-o.x),n.height=Math.abs(i.y-r.y),n.x=o.x+n.width/2,n.y=r.y+n.height/2}}),w.each(t.nodes(),function(e){"border"===t.node(e).dummy&&t.removeNode(e)})}function v(t){w.each(t.edges(),function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}function m(t){var e=O.buildLayerMatrix(t);w.each(e,function(e){var n=0;w.each(e,function(e,r){var i=t.node(e);i.order=r+n,w.each(i.selfEdges,function(e){O.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++n,e:e.e,label:e.label},"_se")}),delete i.selfEdges})})}function y(t){w.each(t.nodes(),function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,s=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}})}function b(t,e){return w.mapValues(w.pick(t,e),Number)}function x(t){var e={};return w.each(t,function(t,n){e[n.toLowerCase()]=t}),e}var w=t("./lodash"),$=t("./acyclic"),k=t("./normalize"),_=t("./rank"),M=t("./util").normalizeRanks,C=t("./parent-dummy-chains"),S=t("./util").removeEmptyRanks,E=t("./nesting-graph"),A=t("./add-border-segments"),T=t("./coordinate-system"),N=t("./order"),D=t("./position"),O=t("./util"),j=t("./graphlib").Graph;e.exports=r;var I=["nodesep","edgesep","ranksep","marginx","marginy"],L={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},P=["acyclicer","ranker","rankdir","align"],F=["width","height"],q={width:0,height:0},z=["minlen","weight","width","height","labeloffset"],W={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},R=["labelpos"]},{"./acyclic":2,"./add-border-segments":3,"./coordinate-system":4,"./graphlib":7,"./lodash":10,"./nesting-graph":11,"./normalize":12,"./order":17,"./parent-dummy-chains":22,"./position":24,"./rank":26,"./util":29}],10:[function(t,e,n){var r;if("function"==typeof t)try{r=t("lodash")}catch(i){}r||(r=window._),e.exports=r},{lodash:void 0}],11:[function(t,e,n){function r(t){var e=l.addDummyNode(t,"root",{},"_root"),n=o(t),r=u.max(n)-1,s=2*r+1;t.graph().nestingRoot=e,u.each(t.edges(),function(e){t.edge(e).minlen*=s});var c=a(t)+1;u.each(t.children(),function(o){i(t,e,s,c,r,n,o)}),t.graph().nodeRankFactor=s}function i(t,e,n,r,o,a,s){var c=t.children(s);if(!c.length)return void(s!==e&&t.setEdge(e,s,{weight:0,minlen:n}));var f=l.addBorderNode(t,"_bt"),d=l.addBorderNode(t,"_bb"),h=t.node(s);t.setParent(f,s),h.borderTop=f,t.setParent(d,s),h.borderBottom=d,u.each(c,function(u){i(t,e,n,r,o,a,u);var l=t.node(u),c=l.borderTop?l.borderTop:u,h=l.borderBottom?l.borderBottom:u,p=l.borderTop?r:2*r,g=c!==h?1:o-a[s]+1;t.setEdge(f,c,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(h,d,{weight:p,minlen:g,nestingEdge:!0})}),t.parent(s)||t.setEdge(e,f,{weight:0,minlen:o+a[s]})}function o(t){function e(r,i){var o=t.children(r);o&&o.length&&u.each(o,function(t){e(t,i+1)}),n[r]=i}var n={};return u.each(t.children(),function(t){e(t,1)}),n}function a(t){return u.reduce(t.edges(),function(e,n){return e+t.edge(n).weight},0)}function s(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,u.each(t.edges(),function(e){var n=t.edge(e);n.nestingEdge&&t.removeEdge(e)})}var u=t("./lodash"),l=t("./util");e.exports={run:r,cleanup:s}},{"./lodash":10,"./util":29}],12:[function(t,e,n){"use strict";function r(t){t.graph().dummyChains=[],a.each(t.edges(),function(e){i(t,e)})}function i(t,e){var n=e.v,r=t.node(n).rank,i=e.w,o=t.node(i).rank,a=e.name,u=t.edge(e),l=u.labelRank;if(o!==r+1){t.removeEdge(e);var c,f,d;for(d=0,++r;r0;)e%2&&(n+=u[e+1]),e=e-1>>1,u[e]+=t.weight;l+=t.weight*n})),l}var o=t("../lodash");e.exports=r},{"../lodash":10}],17:[function(t,e,n){"use strict";function r(t){var e=p.maxRank(t),n=i(t,s.range(1,e+1),"inEdges"),r=i(t,s.range(e-1,-1,-1),"outEdges"),c=u(t);a(t,c);for(var f,d=Number.POSITIVE_INFINITY,h=0,g=0;g<4;++h,++g){o(h%2?n:r,h%4>=2),c=p.buildLayerMatrix(t);var v=l(t,c);v=t.barycenter)&&o(t,e)}}function n(e){return function(n){n["in"].push(e),0===--n.indegree&&t.push(n)}}for(var r=[];t.length;){var i=t.pop();r.push(i),a.each(i["in"].reverse(),e(i)),a.each(i.out,n(i))}return a.chain(r).filter(function(t){return!t.merged}).map(function(t){return a.pick(t,["vs","i","barycenter","weight"])}).value()}function o(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}var a=t("../lodash");e.exports=r},{"../lodash":10}],20:[function(t,e,n){function r(t,e,n,c){var f=t.children(e),d=t.node(e),h=d?d.borderLeft:void 0,p=d?d.borderRight:void 0,g={};h&&(f=a.filter(f,function(t){return t!==h&&t!==p}));var v=s(t,f);a.each(v,function(e){if(t.children(e.v).length){var i=r(t,e.v,n,c);g[e.v]=i,a.has(i,"barycenter")&&o(e,i)}});var m=u(v,n);i(m,g);var y=l(m,c);if(h&&(y.vs=a.flatten([h,y.vs,p],!0),t.predecessors(h).length)){var b=t.node(t.predecessors(h)[0]),x=t.node(t.predecessors(p)[0]);a.has(y,"barycenter")||(y.barycenter=0,y.weight=0),y.barycenter=(y.barycenter*y.weight+b.order+x.order)/(y.weight+2),y.weight+=2}return y}function i(t,e){a.each(t,function(t){t.vs=a.flatten(t.vs.map(function(t){return e[t]?e[t].vs:t}),!0)})}function o(t,e){a.isUndefined(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}var a=t("../lodash"),s=t("./barycenter"),u=t("./resolve-conflicts"),l=t("./sort");e.exports=r},{"../lodash":10,"./barycenter":14,"./resolve-conflicts":19,"./sort":21}],21:[function(t,e,n){function r(t,e){var n=s.partition(t,function(t){return a.has(t,"barycenter")}),r=n.lhs,u=a.sortBy(n.rhs,function(t){return-t.i}),l=[],c=0,f=0,d=0;r.sort(o(!!e)),d=i(l,u,d),a.each(r,function(t){d+=t.vs.length,l.push(t.vs),c+=t.barycenter*t.weight,f+=t.weight,d=i(l,u,d)});var h={vs:a.flatten(l,!0)};return f&&(h.barycenter=c/f,h.weight=f),h}function i(t,e,n){for(var r;e.length&&(r=a.last(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}function o(t){return function(e,n){return e.barycentern.barycenter?1:t?n.i-e.i:e.i-n.i}}var a=t("../lodash"),s=t("../util");e.exports=r},{"../lodash":10,"../util":29}],22:[function(t,e,n){function r(t){var e=o(t);a.each(t.graph().dummyChains,function(n){for(var r=t.node(n),o=r.edgeObj,a=i(t,e,o.v,o.w),s=a.path,u=a.lca,l=0,c=s[l],f=!0;n!==o.w;){if(r=t.node(n),f){for(;(c=s[l])!==u&&t.node(c).maxRanku||l>e[i].lim));for(o=i,i=r;(i=t.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}function o(t){function e(i){var o=r;a.each(t.children(i),e),n[i]={low:o,lim:r++}}var n={},r=0;return a.each(t.children(),e),n}var a=t("./lodash");e.exports=r},{"./lodash":10}],23:[function(t,e,n){"use strict";function r(t,e){function n(e,n){var i=0,s=0,u=e.length,l=m.last(n);return m.each(n,function(e,c){var f=o(t,e),d=f?t.node(f).order:u;(f||e===l)&&(m.each(n.slice(s,c+1),function(e){m.each(t.predecessors(e),function(n){var o=t.node(n),s=o.order;!(ss)&&a(i,e,u)})})}function r(e,r){var i,o=-1,a=0;return m.each(r,function(s,u){if("border"===t.node(s).dummy){var l=t.predecessors(s);l.length&&(i=t.node(l[0]).order,n(r,a,u,o,i),a=u,o=i)}n(r,a,r.length,i,e.length)}),r}var i={};return m.reduce(e,r),i}function o(t,e){if(t.node(e).dummy)return m.find(t.predecessors(e),function(e){return t.node(e).dummy})}function a(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function s(t,e,n){if(e>n){var r=e;e=n,n=r}return m.has(t[e],n)}function u(t,e,n,r){var i={},o={},a={};return m.each(e,function(t){m.each(t,function(t,e){i[t]=t,o[t]=t,a[t]=e})}),m.each(e,function(t){var e=-1;m.each(t,function(t){var u=r(t);if(u.length){u=m.sortBy(u,function(t){return a[t]});for(var l=(u.length-1)/2,c=Math.floor(l),f=Math.ceil(l);c<=f;++c){var d=u[c];o[t]===t&&ea.lim&&(s=a,u=!0);var l=g.filter(e.edges(),function(e){return u===p(t,t.node(e.v),s)&&u!==p(t,t.node(e.w),s)});return g.min(l,function(t){return m(e,t)})}function f(t,e,n,r){var o=n.v,a=n.w;t.removeEdge(o,a),t.setEdge(r.v,r.w,{}),s(t),i(t,e),d(t,e)}function d(t,e){var n=g.find(t.nodes(),function(t){return!e.node(t).parent}),r=b(t,n);r=r.slice(1),g.each(r,function(n){var r=t.node(n).parent,i=e.edge(n,r),o=!1;i||(i=e.edge(r,n),o=!0),e.node(n).rank=e.node(r).rank+(o?i.minlen:-i.minlen)})}function h(t,e,n){return t.hasEdge(e,n)}function p(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}var g=t("../lodash"),v=t("./feasible-tree"),m=t("./util").slack,y=t("./util").longestPath,b=t("../graphlib").alg.preorder,x=t("../graphlib").alg.postorder,w=t("../util").simplify;e.exports=r,r.initLowLimValues=s,r.initCutValues=i,r.calcCutValue=a,r.leaveEdge=l,r.enterEdge=c,r.exchangeEdges=f},{"../graphlib":7,"../lodash":10,"../util":29,"./feasible-tree":25,"./util":28}],28:[function(t,e,n){"use strict";function r(t){function e(r){var i=t.node(r);if(o.has(n,r))return i.rank;n[r]=!0;var a=o.min(o.map(t.outEdges(r),function(n){return e(n.w)-t.edge(n).minlen}));return a===Number.POSITIVE_INFINITY&&(a=0),i.rank=a}var n={};o.each(t.sources(),e)}function i(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}var o=t("../lodash");e.exports={longestPath:r,slack:i}},{"../lodash":10}],29:[function(t,e,n){"use strict";function r(t,e,n,r){var i;do i=m.uniqueId(r);while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i}function i(t){var e=(new y).setGraph(t.graph());return m.each(t.nodes(),function(n){e.setNode(n,t.node(n))}),m.each(t.edges(),function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),e}function o(t){var e=new y({multigraph:t.isMultigraph()}).setGraph(t.graph());return m.each(t.nodes(),function(n){t.children(n).length||e.setNode(n,t.node(n))}),m.each(t.edges(),function(n){e.setEdge(n,t.edge(n))}),e}function a(t){var e=m.map(t.nodes(),function(e){var n={};return m.each(t.outEdges(e),function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight}),n});return m.zipObject(t.nodes(),e)}function s(t){var e=m.map(t.nodes(),function(e){var n={};return m.each(t.inEdges(e),function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight}),n});return m.zipObject(t.nodes(),e)}function u(t,e){var n=t.x,r=t.y,i=e.x-n,o=e.y-r,a=t.width/2,s=t.height/2;if(!i&&!o)throw new Error("Not possible to find intersection inside of the rectangle");var u,l;return Math.abs(o)*a>Math.abs(i)*s?(o<0&&(s=-s),u=s*i/o,l=s):(i<0&&(a=-a),u=a,l=a*o/i),{x:n+u,y:r+l}}function l(t){var e=m.map(m.range(h(t)+1),function(){return[]});return m.each(t.nodes(),function(n){var r=t.node(n),i=r.rank;m.isUndefined(i)||(e[i][r.order]=n)}),e}function c(t){var e=m.min(m.map(t.nodes(),function(e){return t.node(e).rank}));m.each(t.nodes(),function(n){var r=t.node(n);m.has(r,"rank")&&(r.rank-=e)})}function f(t){var e=m.min(m.map(t.nodes(),function(e){return t.node(e).rank})),n=[];m.each(t.nodes(),function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=t.graph().nodeRankFactor;m.each(n,function(e,n){m.isUndefined(e)&&n%i!==0?--r:r&&m.each(e,function(e){t.node(e).rank+=r})})}function d(t,e,n,i){var o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=i),r(t,"border",o,e)}function h(t){return m.max(m.map(t.nodes(),function(e){var n=t.node(e).rank;if(!m.isUndefined(n))return n}))}function p(t,e){var n={lhs:[],rhs:[]};return m.each(t,function(t){e(t)?n.lhs.push(t):n.rhs.push(t)}),n}function g(t,e){var n=m.now();try{return e()}finally{console.log(t+" time: "+(m.now()-n)+"ms")}}function v(t,e){return e()}var m=t("./lodash"),y=t("./graphlib").Graph;e.exports={addDummyNode:r,simplify:i,asNonCompoundGraph:o,successorWeights:a,predecessorWeights:s,intersectRect:u,buildLayerMatrix:l,normalizeRanks:c,removeEmptyRanks:f,addBorderNode:d,maxRank:h,partition:p,time:g,notime:v}},{"./graphlib":7,"./lodash":10}],30:[function(t,e,n){e.exports="0.7.4"},{}]},{},[1])(1)}),function(t,e,n){!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):jQuery&&!jQuery.fn.qtip&&t(jQuery)}(function(r){"use strict";function i(t,e,n,i){this.id=n,this.target=t,this.tooltip=N,this.elements={target:t},this._id=V+"-"+n,this.timers={img:{}},this.options=e,this.plugins={},this.cache={event:{},target:r(),disabled:T,attr:i,onTooltip:T,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=T}function o(t){return t===N||"object"!==r.type(t)}function a(t){return!(r.isFunction(t)||t&&t.attr||t.length||"object"===r.type(t)&&(t.jquery||t.then))}function s(t){var e,n,i,s;return o(t)?T:(o(t.metadata)&&(t.metadata={type:t.metadata}),"content"in t&&(e=t.content,o(e)||e.jquery||e.done?e=t.content={text:n=a(e)?T:e}:n=e.text,"ajax"in e&&(i=e.ajax,s=i&&i.once!==T,delete e.ajax,e.text=function(t,e){var o=n||r(this).attr(e.options.content.attr)||"Loading...",a=r.ajax(r.extend({},i,{context:e})).then(i.success,N,i.error).then(function(t){return t&&s&&e.set("content.text",t),t},function(t,n,r){e.destroyed||0===t.status||e.set("content.text",n+": "+r)});return s?o:(e.set("content.text",o),a)}),"title"in e&&(r.isPlainObject(e.title)&&(e.button=e.title.button,e.title=e.title.text),a(e.title||T)&&(e.title=T))),"position"in t&&o(t.position)&&(t.position={my:t.position,at:t.position}),"show"in t&&o(t.show)&&(t.show=t.show.jquery?{target:t.show}:t.show===A?{ready:A}:{event:t.show}),"hide"in t&&o(t.hide)&&(t.hide=t.hide.jquery?{target:t.hide}:{event:t.hide}),"style"in t&&o(t.style)&&(t.style={classes:t.style}),r.each(B,function(){this.sanitize&&this.sanitize(t)}),t)}function u(t,e){for(var n,r=0,i=t,o=e.split(".");i=i[o[r++]];)r0?setTimeout(r.proxy(t,this),e):void t.call(this)}function d(t){this.tooltip.hasClass(tt)||(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=f.call(this,function(){this.toggle(A,t)},this.options.show.delay))}function h(t){if(!this.tooltip.hasClass(tt)&&!this.destroyed){var e=r(t.relatedTarget),n=e.closest(G)[0]===this.tooltip[0],i=e[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==e[0]&&"mouse"===this.options.position.target&&n||this.options.hide.fixed&&/mouse(out|leave|move)/.test(t.type)&&(n||i))try{t.preventDefault(),t.stopImmediatePropagation()}catch(o){}else this.timers.hide=f.call(this,function(){this.toggle(T,t)},this.options.hide.delay,this)}}function p(t){!this.tooltip.hasClass(tt)&&this.options.hide.inactive&&(clearTimeout(this.timers.inactive),this.timers.inactive=f.call(this,function(){this.hide(t)},this.options.hide.inactive))}function g(t){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(t)}function v(t,n,i){r(e.body).delegate(t,(n.split?n:n.join("."+V+" "))+"."+V,function(){var t=_.api[r.attr(this,U)];t&&!t.disabled&&i.apply(t,arguments)})}function m(t,n,o){var a,u,l,c,f,d=r(e.body),h=t[0]===e?d:t,p=t.metadata?t.metadata(o.metadata):N,g="html5"===o.metadata.type&&p?p[o.metadata.name]:N,v=t.data(o.metadata.name||"qtipopts");try{v="string"==typeof v?r.parseJSON(v):v}catch(m){}if(c=r.extend(A,{},_.defaults,o,"object"==typeof v?s(v):N,s(g||p)),u=c.position,c.id=n,"boolean"==typeof c.content.text){if(l=t.attr(c.content.attr),c.content.attr===T||!l)return T;c.content.text=l}if(u.container.length||(u.container=d),u.target===T&&(u.target=h),c.show.target===T&&(c.show.target=h),c.show.solo===A&&(c.show.solo=u.container.closest("body")),c.hide.target===T&&(c.hide.target=h),c.position.viewport===A&&(c.position.viewport=u.container),u.container=u.container.eq(0),u.at=new C(u.at,A),u.my=new C(u.my),t.data(V))if(c.overwrite)t.qtip("destroy",!0);else if(c.overwrite===T)return T;return t.attr(H,n),c.suppress&&(f=t.attr("title"))&&t.removeAttr("title").attr(nt,f).attr("title",""),a=new i(t,c,n,(!!l)),t.data(V,a),a}function y(t){return t.charAt(0).toUpperCase()+t.slice(1)}function b(t,e){var r,i,o=e.charAt(0).toUpperCase()+e.slice(1),a=(e+" "+mt.join(o+" ")+o).split(" "),s=0;if(vt[e])return t.css(vt[e]);for(;r=a[s++];)if((i=t.css(r))!==n)return vt[e]=r,i}function x(t,e){return Math.ceil(parseFloat(b(t,e)))}function w(t,e){this._ns="tip",this.options=e,this.offset=e.offset,this.size=[e.width,e.height],this.init(this.qtip=t)}function $(t,e){this.options=e,this._ns="-modal",this.init(this.qtip=t)}function k(t,e){this._ns="ie6",this.init(this.qtip=t)}var _,M,C,S,E,A=!0,T=!1,N=null,D="x",O="y",j="width",I="height",L="top",P="left",F="bottom",q="right",z="center",W="flipinvert",R="shift",B={},V="qtip",H="data-hasqtip",U="data-qtip-id",Y=["ui-widget","ui-tooltip"],G="."+V,X="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),Z=V+"-fixed",Q=V+"-default",K=V+"-focus",J=V+"-hover",tt=V+"-disabled",et="_replacedByqTip",nt="oldtitle",rt={ie:function(){for(var t=4,n=e.createElement("div");(n.innerHTML="")&&n.getElementsByTagName("i")[0];t+=1);return t>4?t:NaN}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||T};M=i.prototype,M._when=function(t){return r.when.apply(r,t)},M.render=function(t){if(this.rendered||this.destroyed)return this;var e,n=this,i=this.options,o=this.cache,a=this.elements,s=i.content.text,u=i.content.title,l=i.content.button,c=i.position,f=("."+this._id+" ",[]);return r.attr(this.target[0],"aria-describedby",this._id),o.posClass=this._createPosClass((this.position={my:c.my,at:c.at}).my),this.tooltip=a.tooltip=e=r("
",{id:this._id,"class":[V,Q,i.style.classes,o.posClass].join(" "),width:i.style.width||"",height:i.style.height||"",tracking:"mouse"===c.target&&c.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":T,"aria-describedby":this._id+"-content","aria-hidden":A}).toggleClass(tt,this.disabled).attr(U,this.id).data(V,this).appendTo(c.container).append(a.content=r("
",{"class":V+"-content",id:this._id+"-content","aria-atomic":A})),this.rendered=-1,this.positioning=A,u&&(this._createTitle(),r.isFunction(u)||f.push(this._updateTitle(u,T))),l&&this._createButton(),r.isFunction(s)||f.push(this._updateContent(s,T)),this.rendered=A,this._setWidget(),r.each(B,function(t){var e;"render"===this.initialize&&(e=this(n))&&(n.plugins[t]=e)}),this._unassignEvents(),this._assignEvents(),this._when(f).then(function(){n._trigger("render"),n.positioning=T,n.hiddenDuringWait||!i.show.ready&&!t||n.toggle(A,o.event,T),n.hiddenDuringWait=T}),_.api[this.id]=this,this},M.destroy=function(t){function e(){if(!this.destroyed){this.destroyed=A;var t,e=this.target,n=e.attr(nt);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),r.each(this.plugins,function(t){ -this.destroy&&this.destroy()});for(t in this.timers)clearTimeout(this.timers[t]);e.removeData(V).removeAttr(U).removeAttr(H).removeAttr("aria-describedby"),this.options.suppress&&n&&e.attr("title",n).removeAttr(nt),this._unassignEvents(),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=N,delete _.api[this.id]}}return this.destroyed?this.target:(t===A&&"hide"!==this.triggering||!this.rendered?e.call(this):(this.tooltip.one("tooltiphidden",r.proxy(e,this)),!this.triggering&&this.hide()),this.target)},S=M.checks={builtin:{"^id$":function(t,e,n,i){var o=n===A?_.nextid:n,a=V+"-"+o;o!==T&&o.length>0&&!r("#"+a).length?(this._id=a,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):t[e]=i},"^prerender":function(t,e,n){n&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(t,e,n){this._updateContent(n)},"^content.attr$":function(t,e,n,r){this.options.content.text===this.target.attr(r)&&this._updateContent(this.target.attr(n))},"^content.title$":function(t,e,n){return n?(n&&!this.elements.title&&this._createTitle(),void this._updateTitle(n)):this._removeTitle()},"^content.button$":function(t,e,n){this._updateButton(n)},"^content.title.(text|button)$":function(t,e,n){this.set("content."+e,n)},"^position.(my|at)$":function(t,e,n){"string"==typeof n&&(this.position[e]=t[e]=new C(n,"at"===e))},"^position.container$":function(t,e,n){this.rendered&&this.tooltip.appendTo(n)},"^show.ready$":function(t,e,n){n&&(!this.rendered&&this.render(A)||this.toggle(A))},"^style.classes$":function(t,e,n,r){this.rendered&&this.tooltip.removeClass(r).addClass(n)},"^style.(width|height)":function(t,e,n){this.rendered&&this.tooltip.css(e,n)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(t,e,n){this.rendered&&this.tooltip.toggleClass(Q,!!n)},"^events.(render|show|move|hide|focus|blur)$":function(t,e,n){this.rendered&&this.tooltip[(r.isFunction(n)?"":"un")+"bind"]("tooltip"+e,n)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var t=this.options.position;this.tooltip.attr("tracking","mouse"===t.target&&t.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},M.get=function(t){if(this.destroyed)return this;var e=u(this.options,t.toLowerCase()),n=e[0][e[1]];return n.precedance?n.string():n};var it=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,ot=/^prerender|show\.ready/i;M.set=function(t,e){if(this.destroyed)return this;var n,i=this.rendered,o=T,a=this.options;this.checks;return"string"==typeof t?(n=t,t={},t[n]=e):t=r.extend({},t),r.each(t,function(e,n){if(i&&ot.test(e))return void delete t[e];var s,l=u(a,e.toLowerCase());s=l[0][l[1]],l[0][l[1]]=n&&n.nodeType?r(n):n,o=it.test(e)||o,t[e]=[l[0],l[1],n,s]}),s(a),this.positioning=A,r.each(t,r.proxy(l,this)),this.positioning=T,this.rendered&&this.tooltip[0].offsetWidth>0&&o&&this.reposition("mouse"===a.position.target?N:this.cache.event),this},M._update=function(t,e,n){var i=this,o=this.cache;return this.rendered&&t?(r.isFunction(t)&&(t=t.call(this.elements.target,o.event,this)||""),r.isFunction(t.then)?(o.waiting=A,t.then(function(t){return o.waiting=T,i._update(t,e)},N,function(t){return i._update(t,e)})):t===T||!t&&""!==t?T:(t.jquery&&t.length>0?e.empty().append(t.css({display:"block",visibility:"visible"})):e.html(t),this._waitForContent(e).then(function(t){i.rendered&&i.tooltip[0].offsetWidth>0&&i.reposition(o.event,!t.length)}))):T},M._waitForContent=function(t){var e=this.cache;return e.waiting=A,(r.fn.imagesLoaded?t.imagesLoaded():r.Deferred().resolve([])).done(function(){e.waiting=T}).promise()},M._updateContent=function(t,e){this._update(t,this.elements.content,e)},M._updateTitle=function(t,e){this._update(t,this.elements.title,e)===T&&this._removeTitle(T)},M._createTitle=function(){var t=this.elements,e=this._id+"-title";t.titlebar&&this._removeTitle(),t.titlebar=r("
",{"class":V+"-titlebar "+(this.options.style.widget?c("header"):"")}).append(t.title=r("
",{id:e,"class":V+"-title","aria-atomic":A})).insertBefore(t.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(t){r(this).toggleClass("ui-state-active ui-state-focus","down"===t.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(t){r(this).toggleClass("ui-state-hover","mouseover"===t.type)}),this.options.content.button&&this._createButton()},M._removeTitle=function(t){var e=this.elements;e.title&&(e.titlebar.remove(),e.titlebar=e.title=e.button=N,t!==T&&this.reposition())},M._createPosClass=function(t){return V+"-pos-"+(t||this.options.position.my).abbrev()},M.reposition=function(n,i){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=A;var o,a,s,u,l=this.cache,c=this.tooltip,f=this.options.position,d=f.target,h=f.my,p=f.at,g=f.viewport,v=f.container,m=f.adjust,y=m.method.split(" "),b=c.outerWidth(T),x=c.outerHeight(T),w=0,$=0,k=c.css("position"),_={left:0,top:0},M=c[0].offsetWidth>0,C=n&&"scroll"===n.type,S=r(t),E=v[0].ownerDocument,N=this.mouse;if(r.isArray(d)&&2===d.length)p={x:P,y:L},_={left:d[0],top:d[1]};else if("mouse"===d)p={x:P,y:L},(!m.mouse||this.options.hide.distance)&&l.origin&&l.origin.pageX?n=l.origin:!n||n&&("resize"===n.type||"scroll"===n.type)?n=l.event:N&&N.pageX&&(n=N),"static"!==k&&(_=v.offset()),E.body.offsetWidth!==(t.innerWidth||E.documentElement.clientWidth)&&(a=r(e.body).offset()),_={left:n.pageX-_.left+(a&&a.left||0),top:n.pageY-_.top+(a&&a.top||0)},m.mouse&&C&&N&&(_.left-=(N.scrollX||0)-S.scrollLeft(),_.top-=(N.scrollY||0)-S.scrollTop());else{if("event"===d?n&&n.target&&"scroll"!==n.type&&"resize"!==n.type?l.target=r(n.target):n.target||(l.target=this.elements.target):"event"!==d&&(l.target=r(d.jquery?d:this.elements.target)),d=l.target,d=r(d).eq(0),0===d.length)return this;d[0]===e||d[0]===t?(w=rt.iOS?t.innerWidth:d.width(),$=rt.iOS?t.innerHeight:d.height(),d[0]===t&&(_={top:(g||d).scrollTop(),left:(g||d).scrollLeft()})):B.imagemap&&d.is("area")?o=B.imagemap(this,d,p,B.viewport?y:T):B.svg&&d&&d[0].ownerSVGElement?o=B.svg(this,d,p,B.viewport?y:T):(w=d.outerWidth(T),$=d.outerHeight(T),_=d.offset()),o&&(w=o.width,$=o.height,a=o.offset,_=o.position),_=this.reposition.offset(d,_,v),(rt.iOS>3.1&&rt.iOS<4.1||rt.iOS>=4.3&&rt.iOS<4.33||!rt.iOS&&"fixed"===k)&&(_.left-=S.scrollLeft(),_.top-=S.scrollTop()),(!o||o&&o.adjustable!==T)&&(_.left+=p.x===q?w:p.x===z?w/2:0,_.top+=p.y===F?$:p.y===z?$/2:0)}return _.left+=m.x+(h.x===q?-b:h.x===z?-b/2:0),_.top+=m.y+(h.y===F?-x:h.y===z?-x/2:0),B.viewport?(s=_.adjusted=B.viewport(this,_,f,w,$,b,x),a&&s.left&&(_.left+=a.left),a&&s.top&&(_.top+=a.top),s.my&&(this.position.my=s.my)):_.adjusted={left:0,top:0},l.posClass!==(u=this._createPosClass(this.position.my))&&c.removeClass(l.posClass).addClass(l.posClass=u),this._trigger("move",[_,g.elem||g],n)?(delete _.adjusted,i===T||!M||isNaN(_.left)||isNaN(_.top)||"mouse"===d||!r.isFunction(f.effect)?c.css(_):r.isFunction(f.effect)&&(f.effect.call(c,this,r.extend({},_)),c.queue(function(t){r(this).css({opacity:"",height:""}),rt.ie&&this.style.removeAttribute("filter"),t()})),this.positioning=T,this):this},M.reposition.offset=function(t,n,i){function o(t,e){n.left+=e*t.scrollLeft(),n.top+=e*t.scrollTop()}if(!i[0])return n;var a,s,u,l,c=r(t[0].ownerDocument),f=!!rt.ie&&"CSS1Compat"!==e.compatMode,d=i[0];do"static"!==(s=r.css(d,"position"))&&("fixed"===s?(u=d.getBoundingClientRect(),o(c,-1)):(u=r(d).position(),u.left+=parseFloat(r.css(d,"borderLeftWidth"))||0,u.top+=parseFloat(r.css(d,"borderTopWidth"))||0),n.left-=u.left+(parseFloat(r.css(d,"marginLeft"))||0),n.top-=u.top+(parseFloat(r.css(d,"marginTop"))||0),a||"hidden"===(l=r.css(d,"overflow"))||"visible"===l||(a=r(d)));while(d=d.offsetParent);return a&&(a[0]!==c[0]||f)&&o(a,1),n};var at=(C=M.reposition.Corner=function(t,e){t=(""+t).replace(/([A-Z])/," $1").replace(/middle/gi,z).toLowerCase(),this.x=(t.match(/left|right/i)||t.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(t.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!e;var n=t.charAt(0);this.precedance="t"===n||"b"===n?O:D}).prototype;at.invert=function(t,e){this[t]=this[t]===P?q:this[t]===q?P:e||this[t]},at.string=function(t){var e=this.x,n=this.y,r=e!==n?"center"===e||"center"!==n&&(this.precedance===O||this.forceY)?[n,e]:[e,n]:[e];return t!==!1?r.join(" "):r},at.abbrev=function(){var t=this.string(!1);return t[0].charAt(0)+(t[1]&&t[1].charAt(0)||"")},at.clone=function(){return new C(this.string(),this.forceY)},M.toggle=function(t,n){var i=this.cache,o=this.options,a=this.tooltip;if(n){if(/over|enter/.test(n.type)&&i.event&&/out|leave/.test(i.event.type)&&o.show.target.add(n.target).length===o.show.target.length&&a.has(n.relatedTarget).length)return this;i.event=r.event.fix(n)}if(this.waiting&&!t&&(this.hiddenDuringWait=A),!this.rendered)return t?this.render(1):this;if(this.destroyed||this.disabled)return this;var s,u,l,c=t?"show":"hide",f=this.options[c],d=(this.options[t?"hide":"show"],this.options.position),h=this.options.content,p=this.tooltip.css("width"),g=this.tooltip.is(":visible"),v=t||1===f.target.length,m=!n||f.target.length<2||i.target[0]===n.target;return(typeof t).search("boolean|number")&&(t=!g),s=!a.is(":animated")&&g===t&&m,u=s?N:!!this._trigger(c,[90]),this.destroyed?this:(u!==T&&t&&this.focus(n),!u||s?this:(r.attr(a[0],"aria-hidden",!t),t?(this.mouse&&(i.origin=r.event.fix(this.mouse)),r.isFunction(h.text)&&this._updateContent(h.text,T),r.isFunction(h.title)&&this._updateTitle(h.title,T),!E&&"mouse"===d.target&&d.adjust.mouse&&(r(e).bind("mousemove."+V,this._storeMouse),E=A),p||a.css("width",a.outerWidth(T)),this.reposition(n,arguments[2]),p||a.css("width",""),f.solo&&("string"==typeof f.solo?r(f.solo):r(G,f.solo)).not(a).not(f.target).qtip("hide",r.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete i.origin,E&&!r(G+'[tracking="true"]:visible',f.solo).not(a).length&&(r(e).unbind("mousemove."+V),E=T),this.blur(n)),l=r.proxy(function(){t?(rt.ie&&a[0].style.removeAttribute("filter"),a.css("overflow",""),"string"==typeof f.autofocus&&r(this.options.show.autofocus,a).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):a.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(t?"visible":"hidden")},this),f.effect===T||v===T?(a[c](),l()):r.isFunction(f.effect)?(a.stop(1,1),f.effect.call(a,this),a.queue("fx",function(t){l(),t()})):a.fadeTo(90,t?1:0,l),t&&f.target.trigger("qtip-"+this.id+"-inactive"),this))},M.show=function(t){return this.toggle(A,t)},M.hide=function(t){return this.toggle(T,t)},M.focus=function(t){if(!this.rendered||this.destroyed)return this;var e=r(G),n=this.tooltip,i=parseInt(n[0].style.zIndex,10),o=_.zindex+e.length;return n.hasClass(K)||this._trigger("focus",[o],t)&&(i!==o&&(e.each(function(){this.style.zIndex>i&&(this.style.zIndex=this.style.zIndex-1)}),e.filter("."+K).qtip("blur",t)),n.addClass(K)[0].style.zIndex=o),this},M.blur=function(t){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(K),this._trigger("blur",[this.tooltip.css("zIndex")],t),this)},M.disable=function(t){return this.destroyed?this:("toggle"===t?t=!(this.rendered?this.tooltip.hasClass(tt):this.disabled):"boolean"!=typeof t&&(t=A),this.rendered&&this.tooltip.toggleClass(tt,t).attr("aria-disabled",t),this.disabled=!!t,this)},M.enable=function(){return this.disable(T)},M._createButton=function(){var t=this,e=this.elements,n=e.tooltip,i=this.options.content.button,o="string"==typeof i,a=o?i:"Close tooltip";e.button&&e.button.remove(),i.jquery?e.button=i:e.button=r("",{"class":"qtip-close "+(this.options.style.widget?"":V+"-icon"),title:a,"aria-label":a}).prepend(r("",{"class":"ui-icon ui-icon-close",html:"×"})),e.button.appendTo(e.titlebar||n).attr("role","button").click(function(e){return n.hasClass(tt)||t.hide(e),T})},M._updateButton=function(t){if(!this.rendered)return T;var e=this.elements.button;t?this._createButton():e.remove()},M._setWidget=function(){var t=this.options.style.widget,e=this.elements,n=e.tooltip,r=n.hasClass(tt);n.removeClass(tt),tt=t?"ui-state-disabled":"qtip-disabled",n.toggleClass(tt,r),n.toggleClass("ui-helper-reset "+c(),t).toggleClass(Q,this.options.style.def&&!t),e.content&&e.content.toggleClass(c("content"),t),e.titlebar&&e.titlebar.toggleClass(c("header"),t),e.button&&e.button.toggleClass(V+"-icon",!t)},M._storeMouse=function(t){return(this.mouse=r.event.fix(t)).type="mousemove",this},M._bind=function(t,e,n,i,o){if(t&&n&&e.length){var a="."+this._id+(i?"-"+i:"");return r(t).bind((e.split?e:e.join(a+" "))+a,r.proxy(n,o||this)),this}},M._unbind=function(t,e){return t&&r(t).unbind("."+this._id+(e?"-"+e:"")),this},M._trigger=function(t,e,n){var i=r.Event("tooltip"+t);return i.originalEvent=n&&r.extend({},n)||this.cache.event||N,this.triggering=t,this.tooltip.trigger(i,[this].concat(e||[])),this.triggering=T,!i.isDefaultPrevented()},M._bindEvents=function(t,e,n,i,o,a){var s=n.filter(i).add(i.filter(n)),u=[];s.length&&(r.each(e,function(e,n){var i=r.inArray(n,t);i>-1&&u.push(t.splice(i,1)[0])}),u.length&&(this._bind(s,u,function(t){var e=!!this.rendered&&this.tooltip[0].offsetWidth>0;(e?a:o).call(this,t)}),n=n.not(s),i=i.not(s))),this._bind(n,t,o),this._bind(i,e,a)},M._assignInitialEvents=function(t){function e(t){return this.disabled||this.destroyed?T:(this.cache.event=t&&r.event.fix(t),this.cache.target=t&&r(t.target),clearTimeout(this.timers.show),void(this.timers.show=f.call(this,function(){this.render("object"==typeof t||n.show.ready)},n.prerender?0:n.show.delay)))}var n=this.options,i=n.show.target,o=n.hide.target,a=n.show.event?r.trim(""+n.show.event).split(" "):[],s=n.hide.event?r.trim(""+n.hide.event).split(" "):[];this._bind(this.elements.target,["remove","removeqtip"],function(t){this.destroy(!0)},"destroy"),/mouse(over|enter)/i.test(n.show.event)&&!/mouse(out|leave)/i.test(n.hide.event)&&s.push("mouseleave"),this._bind(i,"mousemove",function(t){this._storeMouse(t),this.cache.onTarget=A}),this._bindEvents(a,s,i,o,e,function(){return this.timers?void clearTimeout(this.timers.show):T}),(n.show.ready||n.prerender)&&e.call(this,t)},M._assignEvents=function(){var n=this,i=this.options,o=i.position,a=this.tooltip,s=i.show.target,u=i.hide.target,l=o.container,c=o.viewport,f=r(e),v=(r(e.body),r(t)),m=i.show.event?r.trim(""+i.show.event).split(" "):[],y=i.hide.event?r.trim(""+i.hide.event).split(" "):[];r.each(i.events,function(t,e){n._bind(a,"toggle"===t?["tooltipshow","tooltiphide"]:["tooltip"+t],e,null,a)}),/mouse(out|leave)/i.test(i.hide.event)&&"window"===i.hide.leave&&this._bind(f,["mouseout","blur"],function(t){/select|option/.test(t.target.nodeName)||t.relatedTarget||this.hide(t)}),i.hide.fixed?u=u.add(a.addClass(Z)):/mouse(over|enter)/i.test(i.show.event)&&this._bind(u,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+i.hide.event).indexOf("unfocus")>-1&&this._bind(l.closest("html"),["mousedown","touchstart"],function(t){var e=r(t.target),n=this.rendered&&!this.tooltip.hasClass(tt)&&this.tooltip[0].offsetWidth>0,i=e.parents(G).filter(this.tooltip[0]).length>0;e[0]===this.target[0]||e[0]===this.tooltip[0]||i||this.target.has(e[0]).length||!n||this.hide(t)}),"number"==typeof i.hide.inactive&&(this._bind(s,"qtip-"+this.id+"-inactive",p,"inactive"),this._bind(u.add(a),_.inactiveEvents,p)),this._bindEvents(m,y,s,u,d,h),this._bind(s.add(a),"mousemove",function(t){if("number"==typeof i.hide.distance){var e=this.cache.origin||{},n=this.options.hide.distance,r=Math.abs;(r(t.pageX-e.pageX)>=n||r(t.pageY-e.pageY)>=n)&&this.hide(t)}this._storeMouse(t)}),"mouse"===o.target&&o.adjust.mouse&&(i.hide.event&&this._bind(s,["mouseenter","mouseleave"],function(t){return this.cache?void(this.cache.onTarget="mouseenter"===t.type):T}),this._bind(f,"mousemove",function(t){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(tt)&&this.tooltip[0].offsetWidth>0&&this.reposition(t)})),(o.adjust.resize||c.length)&&this._bind(r.event.special.resize?c:v,"resize",g),o.adjust.scroll&&this._bind(v.add(o.container),"scroll",g)},M._unassignEvents=function(){var n=this.options,i=n.show.target,o=n.hide.target,a=r.grep([this.elements.target[0],this.rendered&&this.tooltip[0],n.position.container[0],n.position.viewport[0],n.position.container.closest("html")[0],t,e],function(t){return"object"==typeof t});i&&i.toArray&&(a=a.concat(i.toArray())),o&&o.toArray&&(a=a.concat(o.toArray())),this._unbind(a)._unbind(a,"destroy")._unbind(a,"inactive")},r(function(){v(G,["mouseenter","mouseleave"],function(t){var e="mouseenter"===t.type,n=r(t.currentTarget),i=r(t.relatedTarget||t.target),o=this.options;e?(this.focus(t),n.hasClass(Z)&&!n.hasClass(tt)&&clearTimeout(this.timers.hide)):"mouse"===o.position.target&&o.position.adjust.mouse&&o.hide.event&&o.show.target&&!i.closest(o.show.target[0]).length&&this.hide(t),n.toggleClass(J,e)}),v("["+U+"]",X,p)}),_=r.fn.qtip=function(t,e,i){var o=(""+t).toLowerCase(),a=N,u=r.makeArray(arguments).slice(1),l=u[u.length-1],c=this[0]?r.data(this[0],V):N;return!arguments.length&&c||"api"===o?c:"string"==typeof t?(this.each(function(){var t=r.data(this,V);if(!t)return A;if(l&&l.timeStamp&&(t.cache.event=l),!e||"option"!==o&&"options"!==o)t[o]&&t[o].apply(t,u);else{if(i===n&&!r.isPlainObject(e))return a=t.get(e),T;t.set(e,i)}}),a!==N?a:this):"object"!=typeof t&&arguments.length?void 0:(c=s(r.extend(A,{},t)),this.each(function(t){var e,n;return n=r.isArray(c.id)?c.id[t]:c.id,n=!n||n===T||n.length<1||_.api[n]?_.nextid++:n,e=m(r(this),n,c),e===T?A:(_.api[n]=e,r.each(B,function(){"initialize"===this.initialize&&this(e)}),void e._assignInitialEvents(l))}))},r.qtip=i,_.api={},r.each({attr:function(t,e){if(this.length){var n=this[0],i="title",o=r.data(n,"qtip");if(t===i&&o&&"object"==typeof o&&o.options.suppress)return arguments.length<2?r.attr(n,nt):(o&&o.options.content.attr===i&&o.cache.attr&&o.set("content.text",e),this.attr(nt,e))}return r.fn["attr"+et].apply(this,arguments)},clone:function(t){var e=(r([]),r.fn["clone"+et].apply(this,arguments));return t||e.filter("["+nt+"]").attr("title",function(){return r.attr(this,nt)}).removeAttr(nt),e}},function(t,e){if(!e||r.fn[t+et])return A;var n=r.fn[t+et]=r.fn[t];r.fn[t]=function(){return e.apply(this,arguments)||n.apply(this,arguments)}}),r.ui||(r["cleanData"+et]=r.cleanData,r.cleanData=function(t){for(var e,n=0;(e=r(t[n])).length;n++)if(e.attr(H))try{e.triggerHandler("removeqtip")}catch(i){}r["cleanData"+et].apply(this,arguments)}),_.version="2.2.1",_.nextid=0,_.inactiveEvents=X,_.zindex=15e3,_.defaults={prerender:T,id:T,overwrite:A,suppress:A,content:{text:A,attr:"title",title:T,button:T},position:{my:"top left",at:"bottom right",target:T,container:T,viewport:T,adjust:{x:0,y:0,mouse:A,scroll:A,resize:A,method:"flipinvert flipinvert"},effect:function(t,e,n){r(this).animate(e,{duration:200,queue:T})}},show:{target:T,event:"mouseenter",effect:A,delay:90,solo:T,ready:T,autofocus:T},hide:{target:T,event:"mouseleave",effect:A,delay:0,fixed:T,inactive:T,leave:"window",distance:T},style:{classes:"",widget:T,width:T,height:T,def:A},events:{render:N,move:N,show:N,hide:N,toggle:N,visible:N,hidden:N,focus:N,blur:N}};var st,ut="margin",lt="border",ct="color",ft="background-color",dt="transparent",ht=" !important",pt=!!e.createElement("canvas").getContext,gt=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,vt={},mt=["Webkit","O","Moz","ms"];if(pt)var yt=t.devicePixelRatio||1,bt=function(){var t=e.createElement("canvas").getContext("2d");return t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||1}(),xt=yt/bt;else var wt=function(t,e,n){return"'};r.extend(w.prototype,{init:function(t){var e,n;n=this.element=t.elements.tip=r("
",{"class":V+"-tip"}).prependTo(t.tooltip),pt?(e=r("").appendTo(this.element)[0].getContext("2d"),e.lineJoin="miter",e.miterLimit=1e5,e.save()):(e=wt("shape",'coordorigin="0,0"',"position:absolute;"),this.element.html(e+e),t._bind(r("*",n).add(n),["click","mousedown"],function(t){t.stopPropagation()},this._ns)),t._bind(t.tooltip,"tooltipmove",this.reposition,this._ns,this),this.create()},_swapDimensions:function(){this.size[0]=this.options.height,this.size[1]=this.options.width},_resetDimensions:function(){this.size[0]=this.options.width,this.size[1]=this.options.height},_useTitle:function(t){var e=this.qtip.elements.titlebar;return e&&(t.y===L||t.y===z&&this.element.position().top+this.size[1]/2+this.options.offset-1),left:l[0]-l[2]*Number(o===D),top:l[1]-l[2]*Number(o===O),width:c[0]+f,height:c[1]+f}).each(function(t){var e=r(this);e[e.prop?"prop":"attr"]({coordsize:c[0]+f+" "+(c[1]+f),path:s,fillcolor:i[0],filled:!!t,stroked:!t}).toggle(!(!f&&!t)),!t&&e.html(wt("stroke",'weight="'+2*f+'px" color="'+i[1]+'" miterlimit="1000" joinstyle="miter"'))})),t.opera&&setTimeout(function(){d.tip.css({display:"inline-block",visibility:"visible"})},1),n!==T&&this.calculate(e,c)},calculate:function(t,e){if(!this.enabled)return T;var n,i,o=this,a=this.qtip.elements,s=this.element,u=this.options.offset,l=(a.tooltip.hasClass("ui-widget"),{});return t=t||this.corner,n=t.precedance,e=e||this._calculateSize(t),i=[t.x,t.y],n===D&&i.reverse(),r.each(i,function(r,i){var s,c,f;i===z?(s=n===O?P:L,l[s]="50%",l[ut+"-"+s]=-Math.round(e[n===O?0:1]/2)+u):(s=o._parseWidth(t,i,a.tooltip),c=o._parseWidth(t,i,a.content),f=o._parseRadius(t),l[i]=Math.max(-o.border,r?c:u+(f>s?f:-s)))}),l[t[n]]-=e[n===D?0:1],s.css({margin:"",top:"",bottom:"",left:"",right:""}).css(l),l},reposition:function(t,e,r,i){function o(t,e,n,r,i){t===R&&c.precedance===e&&f[r]&&c[n]!==z?c.precedance=c.precedance===D?O:D:t!==R&&f[r]&&(c[e]=c[e]===z?f[r]>0?r:i:c[e]===r?i:r)}function a(t,e,i){c[t]===z?v[ut+"-"+e]=g[t]=s[ut+"-"+e]-f[e]:(u=s[i]!==n?[f[e],-s[e]]:[-f[e],s[e]],(g[t]=Math.max(u[0],u[1]))>u[0]&&(r[e]-=f[e],g[e]=T),v[s[i]!==n?i:e]=g[t])}if(this.enabled){var s,u,l=e.cache,c=this.corner.clone(),f=r.adjusted,d=e.options.position.adjust.method.split(" "),h=d[0],p=d[1]||d[0],g={left:T,top:T,x:0,y:0},v={};this.corner.fixed!==A&&(o(h,D,O,P,q),o(p,O,D,L,F),c.string()===l.corner.string()&&l.cornerTop===f.top&&l.cornerLeft===f.left||this.update(c,T)),s=this.calculate(c),s.right!==n&&(s.left=-s.right),s.bottom!==n&&(s.top=-s.bottom),s.user=this.offset,(g.left=h===R&&!!f.left)&&a(D,P,q),(g.top=p===R&&!!f.top)&&a(O,L,F),this.element.css(v).toggle(!(g.x&&g.y||c.x===z&&g.y||c.y===z&&g.x)),r.left-=s.left.charAt?s.user:h!==R||g.top||!g.left&&!g.top?s.left+this.border:0,r.top-=s.top.charAt?s.user:p!==R||g.left||!g.left&&!g.top?s.top+this.border:0,l.cornerLeft=f.left,l.cornerTop=f.top,l.corner=c.clone()}},destroy:function(){this.qtip._unbind(this.qtip.tooltip,this._ns),this.qtip.elements.tip&&this.qtip.elements.tip.find("*").remove().end().remove()}}),st=B.tip=function(t){return new w(t,t.options.style.tip)},st.initialize="render",st.sanitize=function(t){if(t.style&&"tip"in t.style){var e=t.style.tip;"object"!=typeof e&&(e=t.style.tip={corner:e}),/string|boolean/i.test(typeof e.corner)||(e.corner=A)}},S.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){this.create(),this.qtip.reposition()},"^style.tip.(height|width)$":function(t){this.size=[t.width,t.height],this.update(),this.qtip.reposition()},"^content.title|style.(classes|widget)$":function(){this.update()}},r.extend(A,_.defaults,{style:{tip:{corner:A,mimic:T,width:6,height:6,border:A,offset:0}}});var $t,kt,_t="qtip-modal",Mt="."+_t;kt=function(){function t(t){if(r.expr[":"].focusable)return r.expr[":"].focusable;var e,n,i,o=!isNaN(r.attr(t,"tabindex")),a=t.nodeName&&t.nodeName.toLowerCase();return"area"===a?(e=t.parentNode,n=e.name,!(!t.href||!n||"map"!==e.nodeName.toLowerCase())&&(i=r("img[usemap=#"+n+"]")[0],!!i&&i.is(":visible"))):/input|select|textarea|button|object/.test(a)?!t.disabled:"a"===a?t.href||o:o}function n(t){c.length<1&&t.length?t.not("body").blur():c.first().focus()}function i(t){if(u.is(":visible")){var e,i=r(t.target),s=o.tooltip,l=i.closest(G);e=l.length<1?T:parseInt(l[0].style.zIndex,10)>parseInt(s[0].style.zIndex,10),e||i.closest(G)[0]===s[0]||n(i),a=t.target===c[c.length-1]}}var o,a,s,u,l=this,c={};r.extend(l,{init:function(){return u=l.elem=r("
",{id:"qtip-overlay",html:"
",mousedown:function(){return T}}).hide(),r(e.body).bind("focusin"+Mt,i),r(e).bind("keydown"+Mt,function(t){o&&o.options.show.modal.escape&&27===t.keyCode&&o.hide(t)}),u.bind("click"+Mt,function(t){o&&o.options.show.modal.blur&&o.hide(t)}),l},update:function(e){o=e,c=e.options.show.modal.stealfocus!==T?e.tooltip.find("*").filter(function(){return t(this)}):[]},toggle:function(t,i,a){var c=(r(e.body),t.tooltip),f=t.options.show.modal,d=f.effect,h=i?"show":"hide",p=u.is(":visible"),g=r(Mt).filter(":visible:not(:animated)").not(c);return l.update(t),i&&f.stealfocus!==T&&n(r(":focus")),u.toggleClass("blurs",f.blur),i&&u.appendTo(e.body),u.is(":animated")&&p===i&&s!==T||!i&&g.length?l:(u.stop(A,T),r.isFunction(d)?d.call(u,i):d===T?u[h]():u.fadeTo(parseInt(a,10)||90,i?1:0,function(){i||u.hide()}),i||u.queue(function(t){u.css({left:"",top:""}),r(Mt).length||u.detach(),t()}),s=i,o.destroyed&&(o=N),l)}}),l.init()},kt=new kt,r.extend($.prototype,{init:function(t){var e=t.tooltip;return this.options.on?(t.elements.overlay=kt.elem,e.addClass(_t).css("z-index",_.modal_zindex+r(Mt).length),t._bind(e,["tooltipshow","tooltiphide"],function(t,n,i){var o=t.originalEvent;if(t.target===e[0])if(o&&"tooltiphide"===t.type&&/mouse(leave|enter)/.test(o.type)&&r(o.relatedTarget).closest(kt.elem[0]).length)try{t.preventDefault()}catch(a){}else(!o||o&&"tooltipsolo"!==o.type)&&this.toggle(t,"tooltipshow"===t.type,i)},this._ns,this),t._bind(e,"tooltipfocus",function(t,n){if(!t.isDefaultPrevented()&&t.target===e[0]){var i=r(Mt),o=_.modal_zindex+i.length,a=parseInt(e[0].style.zIndex,10);kt.elem[0].style.zIndex=o-1,i.each(function(){this.style.zIndex>a&&(this.style.zIndex-=1)}),i.filter("."+K).qtip("blur",t.originalEvent),e.addClass(K)[0].style.zIndex=o,kt.update(n);try{t.preventDefault()}catch(s){}}},this._ns,this),void t._bind(e,"tooltiphide",function(t){t.target===e[0]&&r(Mt).filter(":visible").not(e).last().qtip("focus",t)},this._ns,this)):this},toggle:function(t,e,n){return t&&t.isDefaultPrevented()?this:void kt.toggle(this.qtip,!!e,n)},destroy:function(){this.qtip.tooltip.removeClass(_t),this.qtip._unbind(this.qtip.tooltip,this._ns),kt.toggle(this.qtip,T),delete this.qtip.elements.overlay}}),$t=B.modal=function(t){return new $(t,t.options.show.modal)},$t.sanitize=function(t){t.show&&("object"!=typeof t.show.modal?t.show.modal={on:!!t.show.modal}:"undefined"==typeof t.show.modal.on&&(t.show.modal.on=A))},_.modal_zindex=_.zindex-200,$t.initialize="render",S.modal={"^show.modal.(on|blur)$":function(){this.destroy(),this.init(),this.qtip.elems.overlay.toggle(this.qtip.tooltip[0].offsetWidth>0)}},r.extend(A,_.defaults,{show:{modal:{on:T,effect:A,blur:A,stealfocus:A,escape:A}}}),B.viewport=function(n,r,i,o,a,s,u){function l(t,e,n,i,o,a,s,u,l){var c=r[o],y=x[t],b=w[t],$=n===R,k=y===o?l:y===a?-l:-l/2,_=b===o?u:b===a?-u:-u/2,M=v[o]+m[o]-(h?0:d[o]),C=M-c,S=c+l-(s===j?p:g)-M,E=k-(x.precedance===t||y===x[e]?_:0)-(b===z?u/2:0);return $?(E=(y===o?1:-1)*k,r[o]+=C>0?C:S>0?-S:0,r[o]=Math.max(-d[o]+m[o],c-E,Math.min(Math.max(-d[o]+m[o]+(s===j?p:g),c+E),r[o],"center"===y?c-k:1e9))):(i*=n===W?2:0,C>0&&(y!==o||S>0)?(r[o]-=E+i,f.invert(t,o)):S>0&&(y!==a||C>0)&&(r[o]-=(y===z?-E:E)+i,f.invert(t,a)),r[o]S&&(r[o]=c,f=x.clone())),r[o]-c}var c,f,d,h,p,g,v,m,y=i.target,b=n.elements.tooltip,x=i.my,w=i.at,$=i.adjust,k=$.method.split(" "),_=k[0],M=k[1]||k[0],C=i.viewport,S=i.container,E=(n.cache,{left:0,top:0});return C.jquery&&y[0]!==t&&y[0]!==e.body&&"none"!==$.method?(d=S.offset()||E,h="static"===S.css("position"),c="fixed"===b.css("position"),p=C[0]===t?C.width():C.outerWidth(T),g=C[0]===t?C.height():C.outerHeight(T),v={left:c?0:C.scrollLeft(),top:c?0:C.scrollTop()},m=C.offset()||E,"shift"===_&&"shift"===M||(f=x.clone()),E={left:"none"!==_?l(D,O,_,$.x,P,q,j,o,s):0,top:"none"!==M?l(O,D,M,$.y,L,F,I,a,u):0,my:f}):E},B.polys={polygon:function(t,e){var n,r,i,o={width:0,height:0,position:{top:1e10,right:0,bottom:0,left:1e10},adjustable:T},a=0,s=[],u=1,l=1,c=0,f=0; -for(a=t.length;a--;)n=[parseInt(t[--a],10),parseInt(t[a+1],10)],n[0]>o.position.right&&(o.position.right=n[0]),n[0]o.position.bottom&&(o.position.bottom=n[1]),n[1]0&&i>0&&u>0&&l>0;)for(r=Math.floor(r/2),i=Math.floor(i/2),e.x===P?u=r:e.x===q?u=o.width-r:u+=Math.floor(r/2),e.y===L?l=i:e.y===F?l=o.height-i:l+=Math.floor(i/2),a=s.length;a--&&!(s.length<2);)c=s[a][0]-o.position.left,f=s[a][1]-o.position.top,(e.x===P&&c>=u||e.x===q&&c<=u||e.x===z&&(co.width-u)||e.y===L&&f>=l||e.y===F&&f<=l||e.y===z&&(fo.height-l))&&s.splice(a,1);o.position={left:s[0][0],top:s[0][1]}}return o},rect:function(t,e,n,r){return{width:Math.abs(n-t),height:Math.abs(r-e),position:{left:Math.min(t,n),top:Math.min(e,r)}}},_angles:{tc:1.5,tr:7/4,tl:5/4,bc:.5,br:.25,bl:.75,rc:2,lc:1,c:0},ellipse:function(t,e,n,r,i){var o=B.polys._angles[i.abbrev()],a=0===o?0:n*Math.cos(o*Math.PI),s=r*Math.sin(o*Math.PI);return{width:2*n-Math.abs(a),height:2*r-Math.abs(s),position:{left:t+a,top:e+s},adjustable:T}},circle:function(t,e,n,r){return B.polys.ellipse(t,e,n,n,r)}},B.svg=function(t,n,i){for(var o,a,s,u,l,c,f,d,h,p=(r(e),n[0]),g=r(p.ownerSVGElement),v=p.ownerDocument,m=(parseInt(n.css("stroke-width"),10)||0)/2;!p.getBBox;)p=p.parentNode;if(!p.getBBox||!p.parentNode)return T;switch(p.nodeName){case"ellipse":case"circle":d=B.polys.ellipse(p.cx.baseVal.value,p.cy.baseVal.value,(p.rx||p.r).baseVal.value+m,(p.ry||p.r).baseVal.value+m,i);break;case"line":case"polygon":case"polyline":for(f=p.points||[{x:p.x1.baseVal.value,y:p.y1.baseVal.value},{x:p.x2.baseVal.value,y:p.y2.baseVal.value}],d=[],c=-1,u=f.numberOfItems||f.length;++c';r.extend(k.prototype,{_scroll:function(){var e=this.qtip.elements.overlay;e&&(e[0].style.top=r(t).scrollTop()+"px")},init:function(n){var i=n.tooltip;r("select, object").length<1&&(this.bgiframe=n.elements.bgiframe=r(St).appendTo(i),n._bind(i,"tooltipmove",this.adjustBGIFrame,this._ns,this)),this.redrawContainer=r("
",{id:V+"-rcontainer"}).appendTo(e.body),n.elements.overlay&&n.elements.overlay.addClass("qtipmodal-ie6fix")&&(n._bind(t,["scroll","resize"],this._scroll,this._ns,this),n._bind(i,["tooltipshow"],this._scroll,this._ns,this)),this.redraw()},adjustBGIFrame:function(){var t,e,n=this.qtip.tooltip,r={height:n.outerHeight(T),width:n.outerWidth(T)},i=this.qtip.plugins.tip,o=this.qtip.elements.tip;e=parseInt(n.css("borderLeftWidth"),10)||0,e={left:-e,top:-e},i&&o&&(t="x"===i.corner.precedance?[j,P]:[I,L],e[t[1]]-=o[t[0]]()),this.bgiframe.css(e).css(r)},redraw:function(){if(this.qtip.rendered<1||this.drawing)return this;var t,e,n,r,i=this.qtip.tooltip,o=this.qtip.options.style,a=this.qtip.options.position.container;return this.qtip.drawing=1,o.height&&i.css(I,o.height),o.width?i.css(j,o.width):(i.css(j,"").appendTo(this.redrawContainer),e=i.width(),e%2<1&&(e+=1),n=i.css("maxWidth")||"",r=i.css("minWidth")||"",t=(n+r).indexOf("%")>-1?a.width()/100:0,n=(n.indexOf("%")>-1?t:1)*parseInt(n,10)||e,r=(r.indexOf("%")>-1?t:1)*parseInt(r,10)||0,e=n+r?Math.min(Math.max(e,r),n):e,i.css(j,Math.round(e)).appendTo(a)),this.drawing=0,this},destroy:function(){this.bgiframe&&this.bgiframe.remove(),this.qtip._unbind([t,this.qtip.tooltip],this._ns)}}),Ct=B.ie6=function(t){return 6===rt.ie?new k(t):T},Ct.initialize="render",S.ie6={"^content|style$":function(){this.redraw()}}})}(window,document),function(t,e,n){!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):jQuery&&!jQuery.fn.qtip&&t(jQuery)}(function(r){"use strict";function i(t,e,n,i){this.id=n,this.target=t,this.tooltip=M,this.elements={target:t},this._id=j+"-"+n,this.timers={img:{}},this.options=e,this.plugins={},this.cache={event:{},target:r(),disabled:_,attr:i,onTooltip:_,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=_}function o(t){return t===M||"object"!==r.type(t)}function a(t){return!(r.isFunction(t)||t&&t.attr||t.length||"object"===r.type(t)&&(t.jquery||t.then))}function s(t){var e,n,i,s;return o(t)?_:(o(t.metadata)&&(t.metadata={type:t.metadata}),"content"in t&&(e=t.content,o(e)||e.jquery||e.done?e=t.content={text:n=a(e)?_:e}:n=e.text,"ajax"in e&&(i=e.ajax,s=i&&i.once!==_,delete e.ajax,e.text=function(t,e){var o=n||r(this).attr(e.options.content.attr)||"Loading...",a=r.ajax(r.extend({},i,{context:e})).then(i.success,M,i.error).then(function(t){return t&&s&&e.set("content.text",t),t},function(t,n,r){e.destroyed||0===t.status||e.set("content.text",n+": "+r)});return s?o:(e.set("content.text",o),a)}),"title"in e&&(r.isPlainObject(e.title)&&(e.button=e.title.button,e.title=e.title.text),a(e.title||_)&&(e.title=_))),"position"in t&&o(t.position)&&(t.position={my:t.position,at:t.position}),"show"in t&&o(t.show)&&(t.show=t.show.jquery?{target:t.show}:t.show===k?{ready:k}:{event:t.show}),"hide"in t&&o(t.hide)&&(t.hide=t.hide.jquery?{target:t.hide}:{event:t.hide}),"style"in t&&o(t.style)&&(t.style={classes:t.style}),r.each(O,function(){this.sanitize&&this.sanitize(t)}),t)}function u(t,e){for(var n,r=0,i=t,o=e.split(".");i=i[o[r++]];)r0?setTimeout(r.proxy(t,this),e):void t.call(this)}function d(t){this.tooltip.hasClass(V)||(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=f.call(this,function(){this.toggle(k,t)},this.options.show.delay))}function h(t){if(!this.tooltip.hasClass(V)&&!this.destroyed){var e=r(t.relatedTarget),n=e.closest(F)[0]===this.tooltip[0],i=e[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==e[0]&&"mouse"===this.options.position.target&&n||this.options.hide.fixed&&/mouse(out|leave|move)/.test(t.type)&&(n||i))try{t.preventDefault(),t.stopImmediatePropagation()}catch(o){}else this.timers.hide=f.call(this,function(){this.toggle(_,t)},this.options.hide.delay,this)}}function p(t){!this.tooltip.hasClass(V)&&this.options.hide.inactive&&(clearTimeout(this.timers.inactive),this.timers.inactive=f.call(this,function(){this.hide(t)},this.options.hide.inactive))}function g(t){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(t)}function v(t,n,i){r(e.body).delegate(t,(n.split?n:n.join("."+j+" "))+"."+j,function(){var t=y.api[r.attr(this,L)];t&&!t.disabled&&i.apply(t,arguments)})}function m(t,n,o){var a,u,l,c,f,d=r(e.body),h=t[0]===e?d:t,p=t.metadata?t.metadata(o.metadata):M,g="html5"===o.metadata.type&&p?p[o.metadata.name]:M,v=t.data(o.metadata.name||"qtipopts");try{v="string"==typeof v?r.parseJSON(v):v}catch(m){}if(c=r.extend(k,{},y.defaults,o,"object"==typeof v?s(v):M,s(g||p)),u=c.position,c.id=n,"boolean"==typeof c.content.text){if(l=t.attr(c.content.attr),c.content.attr===_||!l)return _;c.content.text=l}if(u.container.length||(u.container=d),u.target===_&&(u.target=h),c.show.target===_&&(c.show.target=h),c.show.solo===k&&(c.show.solo=u.container.closest("body")),c.hide.target===_&&(c.hide.target=h),c.position.viewport===k&&(c.position.viewport=u.container),u.container=u.container.eq(0),u.at=new x(u.at,k),u.my=new x(u.my),t.data(j))if(c.overwrite)t.qtip("destroy",!0);else if(c.overwrite===_)return _;return t.attr(I,n),c.suppress&&(f=t.attr("title"))&&t.removeAttr("title").attr(U,f).attr("title",""),a=new i(t,c,n,(!!l)),t.data(j,a),a}var y,b,x,w,$,k=!0,_=!1,M=null,C="x",S="y",E="top",A="left",T="bottom",N="right",D="center",O={},j="qtip",I="data-hasqtip",L="data-qtip-id",P=["ui-widget","ui-tooltip"],F="."+j,q="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),z=j+"-fixed",W=j+"-default",R=j+"-focus",B=j+"-hover",V=j+"-disabled",H="_replacedByqTip",U="oldtitle",Y={ie:function(){for(var t=4,n=e.createElement("div");(n.innerHTML="")&&n.getElementsByTagName("i")[0];t+=1);return t>4?t:NaN}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||_};b=i.prototype,b._when=function(t){return r.when.apply(r,t)},b.render=function(t){if(this.rendered||this.destroyed)return this;var e,n=this,i=this.options,o=this.cache,a=this.elements,s=i.content.text,u=i.content.title,l=i.content.button,c=i.position,f=("."+this._id+" ",[]);return r.attr(this.target[0],"aria-describedby",this._id),o.posClass=this._createPosClass((this.position={my:c.my,at:c.at}).my),this.tooltip=a.tooltip=e=r("
",{id:this._id,"class":[j,W,i.style.classes,o.posClass].join(" "),width:i.style.width||"",height:i.style.height||"",tracking:"mouse"===c.target&&c.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":_,"aria-describedby":this._id+"-content","aria-hidden":k}).toggleClass(V,this.disabled).attr(L,this.id).data(j,this).appendTo(c.container).append(a.content=r("
",{"class":j+"-content",id:this._id+"-content","aria-atomic":k})),this.rendered=-1,this.positioning=k,u&&(this._createTitle(),r.isFunction(u)||f.push(this._updateTitle(u,_))),l&&this._createButton(),r.isFunction(s)||f.push(this._updateContent(s,_)),this.rendered=k,this._setWidget(),r.each(O,function(t){var e;"render"===this.initialize&&(e=this(n))&&(n.plugins[t]=e)}),this._unassignEvents(),this._assignEvents(),this._when(f).then(function(){n._trigger("render"),n.positioning=_,n.hiddenDuringWait||!i.show.ready&&!t||n.toggle(k,o.event,_),n.hiddenDuringWait=_}),y.api[this.id]=this,this},b.destroy=function(t){function e(){if(!this.destroyed){this.destroyed=k;var t,e=this.target,n=e.attr(U);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),r.each(this.plugins,function(t){this.destroy&&this.destroy()});for(t in this.timers)clearTimeout(this.timers[t]);e.removeData(j).removeAttr(L).removeAttr(I).removeAttr("aria-describedby"),this.options.suppress&&n&&e.attr("title",n).removeAttr(U),this._unassignEvents(),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=M,delete y.api[this.id]}}return this.destroyed?this.target:(t===k&&"hide"!==this.triggering||!this.rendered?e.call(this):(this.tooltip.one("tooltiphidden",r.proxy(e,this)),!this.triggering&&this.hide()),this.target)},w=b.checks={builtin:{"^id$":function(t,e,n,i){var o=n===k?y.nextid:n,a=j+"-"+o;o!==_&&o.length>0&&!r("#"+a).length?(this._id=a,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):t[e]=i},"^prerender":function(t,e,n){n&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(t,e,n){this._updateContent(n)},"^content.attr$":function(t,e,n,r){this.options.content.text===this.target.attr(r)&&this._updateContent(this.target.attr(n))},"^content.title$":function(t,e,n){return n?(n&&!this.elements.title&&this._createTitle(),void this._updateTitle(n)):this._removeTitle()},"^content.button$":function(t,e,n){this._updateButton(n)},"^content.title.(text|button)$":function(t,e,n){this.set("content."+e,n)},"^position.(my|at)$":function(t,e,n){"string"==typeof n&&(this.position[e]=t[e]=new x(n,"at"===e))},"^position.container$":function(t,e,n){this.rendered&&this.tooltip.appendTo(n)},"^show.ready$":function(t,e,n){n&&(!this.rendered&&this.render(k)||this.toggle(k))},"^style.classes$":function(t,e,n,r){this.rendered&&this.tooltip.removeClass(r).addClass(n)},"^style.(width|height)":function(t,e,n){this.rendered&&this.tooltip.css(e,n)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(t,e,n){this.rendered&&this.tooltip.toggleClass(W,!!n)},"^events.(render|show|move|hide|focus|blur)$":function(t,e,n){this.rendered&&this.tooltip[(r.isFunction(n)?"":"un")+"bind"]("tooltip"+e,n)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var t=this.options.position;this.tooltip.attr("tracking","mouse"===t.target&&t.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},b.get=function(t){if(this.destroyed)return this;var e=u(this.options,t.toLowerCase()),n=e[0][e[1]];return n.precedance?n.string():n};var G=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,X=/^prerender|show\.ready/i;b.set=function(t,e){if(this.destroyed)return this;var n,i=this.rendered,o=_,a=this.options;this.checks;return"string"==typeof t?(n=t,t={},t[n]=e):t=r.extend({},t),r.each(t,function(e,n){if(i&&X.test(e))return void delete t[e];var s,l=u(a,e.toLowerCase());s=l[0][l[1]],l[0][l[1]]=n&&n.nodeType?r(n):n,o=G.test(e)||o,t[e]=[l[0],l[1],n,s]}),s(a),this.positioning=k,r.each(t,r.proxy(l,this)),this.positioning=_,this.rendered&&this.tooltip[0].offsetWidth>0&&o&&this.reposition("mouse"===a.position.target?M:this.cache.event),this},b._update=function(t,e,n){var i=this,o=this.cache;return this.rendered&&t?(r.isFunction(t)&&(t=t.call(this.elements.target,o.event,this)||""),r.isFunction(t.then)?(o.waiting=k,t.then(function(t){return o.waiting=_,i._update(t,e)},M,function(t){return i._update(t,e)})):t===_||!t&&""!==t?_:(t.jquery&&t.length>0?e.empty().append(t.css({display:"block",visibility:"visible"})):e.html(t),this._waitForContent(e).then(function(t){i.rendered&&i.tooltip[0].offsetWidth>0&&i.reposition(o.event,!t.length)}))):_},b._waitForContent=function(t){var e=this.cache;return e.waiting=k,(r.fn.imagesLoaded?t.imagesLoaded():r.Deferred().resolve([])).done(function(){e.waiting=_}).promise()},b._updateContent=function(t,e){this._update(t,this.elements.content,e)},b._updateTitle=function(t,e){this._update(t,this.elements.title,e)===_&&this._removeTitle(_)},b._createTitle=function(){var t=this.elements,e=this._id+"-title";t.titlebar&&this._removeTitle(),t.titlebar=r("
",{"class":j+"-titlebar "+(this.options.style.widget?c("header"):"")}).append(t.title=r("
",{id:e,"class":j+"-title","aria-atomic":k})).insertBefore(t.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(t){r(this).toggleClass("ui-state-active ui-state-focus","down"===t.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(t){r(this).toggleClass("ui-state-hover","mouseover"===t.type)}),this.options.content.button&&this._createButton()},b._removeTitle=function(t){var e=this.elements;e.title&&(e.titlebar.remove(),e.titlebar=e.title=e.button=M,t!==_&&this.reposition())},b._createPosClass=function(t){return j+"-pos-"+(t||this.options.position.my).abbrev()},b.reposition=function(n,i){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=k;var o,a,s,u,l=this.cache,c=this.tooltip,f=this.options.position,d=f.target,h=f.my,p=f.at,g=f.viewport,v=f.container,m=f.adjust,y=m.method.split(" "),b=c.outerWidth(_),x=c.outerHeight(_),w=0,$=0,M=c.css("position"),C={left:0,top:0},S=c[0].offsetWidth>0,j=n&&"scroll"===n.type,I=r(t),L=v[0].ownerDocument,P=this.mouse;if(r.isArray(d)&&2===d.length)p={x:A,y:E},C={left:d[0],top:d[1]};else if("mouse"===d)p={x:A,y:E},(!m.mouse||this.options.hide.distance)&&l.origin&&l.origin.pageX?n=l.origin:!n||n&&("resize"===n.type||"scroll"===n.type)?n=l.event:P&&P.pageX&&(n=P),"static"!==M&&(C=v.offset()),L.body.offsetWidth!==(t.innerWidth||L.documentElement.clientWidth)&&(a=r(e.body).offset()),C={left:n.pageX-C.left+(a&&a.left||0),top:n.pageY-C.top+(a&&a.top||0)},m.mouse&&j&&P&&(C.left-=(P.scrollX||0)-I.scrollLeft(),C.top-=(P.scrollY||0)-I.scrollTop());else{if("event"===d?n&&n.target&&"scroll"!==n.type&&"resize"!==n.type?l.target=r(n.target):n.target||(l.target=this.elements.target):"event"!==d&&(l.target=r(d.jquery?d:this.elements.target)),d=l.target,d=r(d).eq(0),0===d.length)return this;d[0]===e||d[0]===t?(w=Y.iOS?t.innerWidth:d.width(),$=Y.iOS?t.innerHeight:d.height(),d[0]===t&&(C={top:(g||d).scrollTop(),left:(g||d).scrollLeft()})):O.imagemap&&d.is("area")?o=O.imagemap(this,d,p,O.viewport?y:_):O.svg&&d&&d[0].ownerSVGElement?o=O.svg(this,d,p,O.viewport?y:_):(w=d.outerWidth(_),$=d.outerHeight(_),C=d.offset()),o&&(w=o.width,$=o.height,a=o.offset,C=o.position),C=this.reposition.offset(d,C,v),(Y.iOS>3.1&&Y.iOS<4.1||Y.iOS>=4.3&&Y.iOS<4.33||!Y.iOS&&"fixed"===M)&&(C.left-=I.scrollLeft(),C.top-=I.scrollTop()),(!o||o&&o.adjustable!==_)&&(C.left+=p.x===N?w:p.x===D?w/2:0,C.top+=p.y===T?$:p.y===D?$/2:0)}return C.left+=m.x+(h.x===N?-b:h.x===D?-b/2:0),C.top+=m.y+(h.y===T?-x:h.y===D?-x/2:0),O.viewport?(s=C.adjusted=O.viewport(this,C,f,w,$,b,x),a&&s.left&&(C.left+=a.left),a&&s.top&&(C.top+=a.top),s.my&&(this.position.my=s.my)):C.adjusted={left:0,top:0},l.posClass!==(u=this._createPosClass(this.position.my))&&c.removeClass(l.posClass).addClass(l.posClass=u),this._trigger("move",[C,g.elem||g],n)?(delete C.adjusted,i===_||!S||isNaN(C.left)||isNaN(C.top)||"mouse"===d||!r.isFunction(f.effect)?c.css(C):r.isFunction(f.effect)&&(f.effect.call(c,this,r.extend({},C)),c.queue(function(t){r(this).css({opacity:"",height:""}),Y.ie&&this.style.removeAttribute("filter"),t()})),this.positioning=_,this):this},b.reposition.offset=function(t,n,i){function o(t,e){n.left+=e*t.scrollLeft(),n.top+=e*t.scrollTop()}if(!i[0])return n;var a,s,u,l,c=r(t[0].ownerDocument),f=!!Y.ie&&"CSS1Compat"!==e.compatMode,d=i[0];do"static"!==(s=r.css(d,"position"))&&("fixed"===s?(u=d.getBoundingClientRect(),o(c,-1)):(u=r(d).position(),u.left+=parseFloat(r.css(d,"borderLeftWidth"))||0,u.top+=parseFloat(r.css(d,"borderTopWidth"))||0),n.left-=u.left+(parseFloat(r.css(d,"marginLeft"))||0),n.top-=u.top+(parseFloat(r.css(d,"marginTop"))||0),a||"hidden"===(l=r.css(d,"overflow"))||"visible"===l||(a=r(d)));while(d=d.offsetParent);return a&&(a[0]!==c[0]||f)&&o(a,1),n};var Z=(x=b.reposition.Corner=function(t,e){t=(""+t).replace(/([A-Z])/," $1").replace(/middle/gi,D).toLowerCase(),this.x=(t.match(/left|right/i)||t.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(t.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!e;var n=t.charAt(0);this.precedance="t"===n||"b"===n?S:C}).prototype;Z.invert=function(t,e){this[t]=this[t]===A?N:this[t]===N?A:e||this[t]},Z.string=function(t){var e=this.x,n=this.y,r=e!==n?"center"===e||"center"!==n&&(this.precedance===S||this.forceY)?[n,e]:[e,n]:[e];return t!==!1?r.join(" "):r},Z.abbrev=function(){var t=this.string(!1);return t[0].charAt(0)+(t[1]&&t[1].charAt(0)||"")},Z.clone=function(){return new x(this.string(),this.forceY)},b.toggle=function(t,n){var i=this.cache,o=this.options,a=this.tooltip;if(n){if(/over|enter/.test(n.type)&&i.event&&/out|leave/.test(i.event.type)&&o.show.target.add(n.target).length===o.show.target.length&&a.has(n.relatedTarget).length)return this;i.event=r.event.fix(n)}if(this.waiting&&!t&&(this.hiddenDuringWait=k),!this.rendered)return t?this.render(1):this;if(this.destroyed||this.disabled)return this;var s,u,l,c=t?"show":"hide",f=this.options[c],d=(this.options[t?"hide":"show"],this.options.position),h=this.options.content,p=this.tooltip.css("width"),g=this.tooltip.is(":visible"),v=t||1===f.target.length,m=!n||f.target.length<2||i.target[0]===n.target;return(typeof t).search("boolean|number")&&(t=!g),s=!a.is(":animated")&&g===t&&m,u=s?M:!!this._trigger(c,[90]),this.destroyed?this:(u!==_&&t&&this.focus(n),!u||s?this:(r.attr(a[0],"aria-hidden",!t),t?(this.mouse&&(i.origin=r.event.fix(this.mouse)),r.isFunction(h.text)&&this._updateContent(h.text,_),r.isFunction(h.title)&&this._updateTitle(h.title,_),!$&&"mouse"===d.target&&d.adjust.mouse&&(r(e).bind("mousemove."+j,this._storeMouse),$=k),p||a.css("width",a.outerWidth(_)),this.reposition(n,arguments[2]),p||a.css("width",""),f.solo&&("string"==typeof f.solo?r(f.solo):r(F,f.solo)).not(a).not(f.target).qtip("hide",r.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete i.origin,$&&!r(F+'[tracking="true"]:visible',f.solo).not(a).length&&(r(e).unbind("mousemove."+j),$=_),this.blur(n)),l=r.proxy(function(){t?(Y.ie&&a[0].style.removeAttribute("filter"),a.css("overflow",""),"string"==typeof f.autofocus&&r(this.options.show.autofocus,a).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):a.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(t?"visible":"hidden")},this),f.effect===_||v===_?(a[c](),l()):r.isFunction(f.effect)?(a.stop(1,1),f.effect.call(a,this),a.queue("fx",function(t){l(),t()})):a.fadeTo(90,t?1:0,l),t&&f.target.trigger("qtip-"+this.id+"-inactive"),this))},b.show=function(t){return this.toggle(k,t)},b.hide=function(t){return this.toggle(_,t)},b.focus=function(t){if(!this.rendered||this.destroyed)return this;var e=r(F),n=this.tooltip,i=parseInt(n[0].style.zIndex,10),o=y.zindex+e.length;return n.hasClass(R)||this._trigger("focus",[o],t)&&(i!==o&&(e.each(function(){this.style.zIndex>i&&(this.style.zIndex=this.style.zIndex-1)}),e.filter("."+R).qtip("blur",t)),n.addClass(R)[0].style.zIndex=o),this},b.blur=function(t){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(R),this._trigger("blur",[this.tooltip.css("zIndex")],t),this)},b.disable=function(t){return this.destroyed?this:("toggle"===t?t=!(this.rendered?this.tooltip.hasClass(V):this.disabled):"boolean"!=typeof t&&(t=k),this.rendered&&this.tooltip.toggleClass(V,t).attr("aria-disabled",t),this.disabled=!!t,this)},b.enable=function(){return this.disable(_)},b._createButton=function(){var t=this,e=this.elements,n=e.tooltip,i=this.options.content.button,o="string"==typeof i,a=o?i:"Close tooltip";e.button&&e.button.remove(),i.jquery?e.button=i:e.button=r("",{"class":"qtip-close "+(this.options.style.widget?"":j+"-icon"),title:a,"aria-label":a}).prepend(r("",{"class":"ui-icon ui-icon-close",html:"×"})),e.button.appendTo(e.titlebar||n).attr("role","button").click(function(e){return n.hasClass(V)||t.hide(e),_})},b._updateButton=function(t){if(!this.rendered)return _;var e=this.elements.button;t?this._createButton():e.remove()},b._setWidget=function(){var t=this.options.style.widget,e=this.elements,n=e.tooltip,r=n.hasClass(V);n.removeClass(V),V=t?"ui-state-disabled":"qtip-disabled",n.toggleClass(V,r),n.toggleClass("ui-helper-reset "+c(),t).toggleClass(W,this.options.style.def&&!t),e.content&&e.content.toggleClass(c("content"),t),e.titlebar&&e.titlebar.toggleClass(c("header"),t),e.button&&e.button.toggleClass(j+"-icon",!t)},b._storeMouse=function(t){return(this.mouse=r.event.fix(t)).type="mousemove",this},b._bind=function(t,e,n,i,o){if(t&&n&&e.length){var a="."+this._id+(i?"-"+i:"");return r(t).bind((e.split?e:e.join(a+" "))+a,r.proxy(n,o||this)),this}},b._unbind=function(t,e){return t&&r(t).unbind("."+this._id+(e?"-"+e:"")),this},b._trigger=function(t,e,n){var i=r.Event("tooltip"+t);return i.originalEvent=n&&r.extend({},n)||this.cache.event||M,this.triggering=t,this.tooltip.trigger(i,[this].concat(e||[])),this.triggering=_,!i.isDefaultPrevented()},b._bindEvents=function(t,e,n,i,o,a){var s=n.filter(i).add(i.filter(n)),u=[];s.length&&(r.each(e,function(e,n){var i=r.inArray(n,t);i>-1&&u.push(t.splice(i,1)[0])}),u.length&&(this._bind(s,u,function(t){var e=!!this.rendered&&this.tooltip[0].offsetWidth>0;(e?a:o).call(this,t)}),n=n.not(s),i=i.not(s))),this._bind(n,t,o),this._bind(i,e,a)},b._assignInitialEvents=function(t){function e(t){return this.disabled||this.destroyed?_:(this.cache.event=t&&r.event.fix(t),this.cache.target=t&&r(t.target),clearTimeout(this.timers.show),void(this.timers.show=f.call(this,function(){this.render("object"==typeof t||n.show.ready)},n.prerender?0:n.show.delay)))}var n=this.options,i=n.show.target,o=n.hide.target,a=n.show.event?r.trim(""+n.show.event).split(" "):[],s=n.hide.event?r.trim(""+n.hide.event).split(" "):[];this._bind(this.elements.target,["remove","removeqtip"],function(t){this.destroy(!0)},"destroy"),/mouse(over|enter)/i.test(n.show.event)&&!/mouse(out|leave)/i.test(n.hide.event)&&s.push("mouseleave"),this._bind(i,"mousemove",function(t){this._storeMouse(t),this.cache.onTarget=k}),this._bindEvents(a,s,i,o,e,function(){return this.timers?void clearTimeout(this.timers.show):_}),(n.show.ready||n.prerender)&&e.call(this,t)},b._assignEvents=function(){var n=this,i=this.options,o=i.position,a=this.tooltip,s=i.show.target,u=i.hide.target,l=o.container,c=o.viewport,f=r(e),v=(r(e.body),r(t)),m=i.show.event?r.trim(""+i.show.event).split(" "):[],b=i.hide.event?r.trim(""+i.hide.event).split(" "):[];r.each(i.events,function(t,e){n._bind(a,"toggle"===t?["tooltipshow","tooltiphide"]:["tooltip"+t],e,null,a)}),/mouse(out|leave)/i.test(i.hide.event)&&"window"===i.hide.leave&&this._bind(f,["mouseout","blur"],function(t){/select|option/.test(t.target.nodeName)||t.relatedTarget||this.hide(t)}),i.hide.fixed?u=u.add(a.addClass(z)):/mouse(over|enter)/i.test(i.show.event)&&this._bind(u,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+i.hide.event).indexOf("unfocus")>-1&&this._bind(l.closest("html"),["mousedown","touchstart"],function(t){var e=r(t.target),n=this.rendered&&!this.tooltip.hasClass(V)&&this.tooltip[0].offsetWidth>0,i=e.parents(F).filter(this.tooltip[0]).length>0;e[0]===this.target[0]||e[0]===this.tooltip[0]||i||this.target.has(e[0]).length||!n||this.hide(t)}),"number"==typeof i.hide.inactive&&(this._bind(s,"qtip-"+this.id+"-inactive",p,"inactive"),this._bind(u.add(a),y.inactiveEvents,p)),this._bindEvents(m,b,s,u,d,h),this._bind(s.add(a),"mousemove",function(t){if("number"==typeof i.hide.distance){var e=this.cache.origin||{},n=this.options.hide.distance,r=Math.abs;(r(t.pageX-e.pageX)>=n||r(t.pageY-e.pageY)>=n)&&this.hide(t)}this._storeMouse(t)}),"mouse"===o.target&&o.adjust.mouse&&(i.hide.event&&this._bind(s,["mouseenter","mouseleave"],function(t){return this.cache?void(this.cache.onTarget="mouseenter"===t.type):_}),this._bind(f,"mousemove",function(t){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(V)&&this.tooltip[0].offsetWidth>0&&this.reposition(t)})),(o.adjust.resize||c.length)&&this._bind(r.event.special.resize?c:v,"resize",g),o.adjust.scroll&&this._bind(v.add(o.container),"scroll",g)},b._unassignEvents=function(){var n=this.options,i=n.show.target,o=n.hide.target,a=r.grep([this.elements.target[0],this.rendered&&this.tooltip[0],n.position.container[0],n.position.viewport[0],n.position.container.closest("html")[0],t,e],function(t){return"object"==typeof t});i&&i.toArray&&(a=a.concat(i.toArray())),o&&o.toArray&&(a=a.concat(o.toArray())),this._unbind(a)._unbind(a,"destroy")._unbind(a,"inactive")},r(function(){v(F,["mouseenter","mouseleave"],function(t){var e="mouseenter"===t.type,n=r(t.currentTarget),i=r(t.relatedTarget||t.target),o=this.options;e?(this.focus(t),n.hasClass(z)&&!n.hasClass(V)&&clearTimeout(this.timers.hide)):"mouse"===o.position.target&&o.position.adjust.mouse&&o.hide.event&&o.show.target&&!i.closest(o.show.target[0]).length&&this.hide(t),n.toggleClass(B,e)}),v("["+L+"]",q,p)}),y=r.fn.qtip=function(t,e,i){var o=(""+t).toLowerCase(),a=M,u=r.makeArray(arguments).slice(1),l=u[u.length-1],c=this[0]?r.data(this[0],j):M;return!arguments.length&&c||"api"===o?c:"string"==typeof t?(this.each(function(){var t=r.data(this,j);if(!t)return k;if(l&&l.timeStamp&&(t.cache.event=l),!e||"option"!==o&&"options"!==o)t[o]&&t[o].apply(t,u);else{if(i===n&&!r.isPlainObject(e))return a=t.get(e),_;t.set(e,i)}}),a!==M?a:this):"object"!=typeof t&&arguments.length?void 0:(c=s(r.extend(k,{},t)),this.each(function(t){var e,n;return n=r.isArray(c.id)?c.id[t]:c.id,n=!n||n===_||n.length<1||y.api[n]?y.nextid++:n,e=m(r(this),n,c),e===_?k:(y.api[n]=e,r.each(O,function(){"initialize"===this.initialize&&this(e)}),void e._assignInitialEvents(l))}))},r.qtip=i,y.api={},r.each({attr:function(t,e){if(this.length){var n=this[0],i="title",o=r.data(n,"qtip");if(t===i&&o&&"object"==typeof o&&o.options.suppress)return arguments.length<2?r.attr(n,U):(o&&o.options.content.attr===i&&o.cache.attr&&o.set("content.text",e),this.attr(U,e))}return r.fn["attr"+H].apply(this,arguments)},clone:function(t){var e=(r([]),r.fn["clone"+H].apply(this,arguments));return t||e.filter("["+U+"]").attr("title",function(){return r.attr(this,U)}).removeAttr(U),e}},function(t,e){if(!e||r.fn[t+H])return k;var n=r.fn[t+H]=r.fn[t];r.fn[t]=function(){return e.apply(this,arguments)||n.apply(this,arguments)}}),r.ui||(r["cleanData"+H]=r.cleanData,r.cleanData=function(t){for(var e,n=0;(e=r(t[n])).length;n++)if(e.attr(I))try{e.triggerHandler("removeqtip")}catch(i){}r["cleanData"+H].apply(this,arguments)}),y.version="2.2.1",y.nextid=0,y.inactiveEvents=q,y.zindex=15e3,y.defaults={prerender:_,id:_,overwrite:k,suppress:k,content:{text:k,attr:"title",title:_,button:_},position:{my:"top left",at:"bottom right",target:_,container:_,viewport:_,adjust:{x:0,y:0,mouse:k,scroll:k,resize:k,method:"flipinvert flipinvert"},effect:function(t,e,n){r(this).animate(e,{duration:200,queue:_})}},show:{target:_,event:"mouseenter",effect:k,delay:90,solo:_,ready:_,autofocus:_},hide:{target:_,event:"mouseleave",effect:k,delay:0,fixed:_,inactive:_,leave:"window",distance:_},style:{classes:"",widget:_,width:_,height:_,def:k},events:{render:M,move:M,show:M,hide:M,toggle:M,visible:M,hidden:M,focus:M,blur:M}}})}(window,document),function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.dagreD3=t()}}(function(){return function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a=t[0]&&i.x()(e,n)<=t[1]}),disableTooltip:e.disableTooltip}}));e.transition().duration(D).call(i),S(),I()}var W=d3.select(this);t.utils.initSVG(W);var R=t.utils.availableWidth(h,W,d),B=t.utils.availableHeight(p,W,d)-(w?f.height():0);if(e.update=function(){W.transition().duration(D).call(e)},e.container=this,M.setter(F(c),e.update).getter(P(c)).update(),M.disabled=c.map(function(t){return!!t.disabled}),!C){var V;C={};for(V in M)M[V]instanceof Array?C[V]=M[V].slice(0):C[V]=M[V]}if(!(c&&c.length&&c.filter(function(t){return t.values.length}).length))return t.utils.noData(e,W),e;W.selectAll(".nv-noData").remove(),n=i.xScale(),r=i.yScale();var H=W.selectAll("g.nv-wrap.nv-stackedAreaChart").data([c]),U=H.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedAreaChart").append("g"),Y=H.select("g");U.append("g").attr("class","nv-legendWrap"),U.append("g").attr("class","nv-controlsWrap");var G=U.append("g").attr("class","nv-focus");G.append("g").attr("class","nv-background").append("rect"),G.append("g").attr("class","nv-x nv-axis"),G.append("g").attr("class","nv-y nv-axis"),G.append("g").attr("class","nv-stackedWrap"),G.append("g").attr("class","nv-interactive");U.append("g").attr("class","nv-focusWrap");if(m){var X=v?R-A:R;s.width(X),Y.select(".nv-legendWrap").datum(c).call(s),s.height()>d.top&&(d.top=s.height(),B=t.utils.availableHeight(p,W,d)-(w?f.height():0)),Y.select(".nv-legendWrap").attr("transform","translate("+(R-X)+","+-d.top+")")}else Y.select(".nv-legendWrap").selectAll("*").remove();if(v){var Z=[{key:N.stacked||"Stacked",metaKey:"Stacked",disabled:"stack"!=i.style(),style:"stack"},{key:N.stream||"Stream",metaKey:"Stream",disabled:"stream"!=i.style(),style:"stream"},{key:N.expanded||"Expanded",metaKey:"Expanded",disabled:"expand"!=i.style(),style:"expand"},{key:N.stack_percent||"Stack %",metaKey:"Stack_Percent",disabled:"stack_percent"!=i.style(),style:"stack_percent"}];A=T.length/3*260,Z=Z.filter(function(t){return T.indexOf(t.metaKey)!==-1}),u.width(A).color(["#444","#444","#444"]),Y.select(".nv-controlsWrap").datum(Z).call(u),Math.max(u.height(),s.height())>d.top&&(d.top=Math.max(u.height(),s.height()),B=t.utils.availableHeight(p,W,d)),Y.select(".nv-controlsWrap").attr("transform","translate(0,"+-d.top+")")}else Y.select(".nv-controlsWrap").selectAll("*").remove();H.attr("transform","translate("+d.left+","+d.top+")"),x&&Y.select(".nv-y.nv-axis").attr("transform","translate("+R+",0)"),$&&(l.width(R).height(B).margin({left:d.left,top:d.top}).svgContainer(W).xScale(n),H.select(".nv-interactive").call(l)),Y.select(".nv-focus .nv-background rect").attr("width",R).attr("height",B),i.width(R).height(B).color(c.map(function(t,e){return t.color||g(t,e)}).filter(function(t,e){return!c[e].disabled}));var Q=Y.select(".nv-focus .nv-stackedWrap").datum(c.filter(function(t){return!t.disabled}));if(y&&o.scale(n)._ticks(t.utils.calcTicksX(R/100,c)).tickSize(-B,0),b){var K;K="wiggle"===i.offset()?0:t.utils.calcTicksY(B/36,c),a.scale(r)._ticks(K).tickSize(-R,0)}if(w){f.width(R),Y.select(".nv-focusWrap").attr("transform","translate(0,"+(B+d.bottom+f.margin().top)+")").datum(c.filter(function(t){return!t.disabled})).call(f);var J=f.brush.empty()?f.xDomain():f.brush.extent();null!==J&&z(J)}else Q.transition().call(i),S(),I();i.dispatch.on("areaClick.toggle",function(t){1===c.filter(function(t){return!t.disabled}).length?c.forEach(function(t){t.disabled=!1}):c.forEach(function(e,n){e.disabled=n!=t.seriesIndex}),M.disabled=c.map(function(t){return!!t.disabled}),E.stateChange(M),e.update()}),s.dispatch.on("stateChange",function(t){for(var n in t)M[n]=t[n];E.stateChange(M),e.update()}),u.dispatch.on("legendClick",function(t,n){t.disabled&&(Z=Z.map(function(t){return t.disabled=!0,t}),t.disabled=!1,i.style(t.style),M.style=i.style(),E.stateChange(M),e.update())}),l.dispatch.on("elementMousemove",function(n){i.clearHighlights();var r,o,a,s=[],u=0,f=!0;if(c.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(l,c){o=t.interactiveBisect(l.values,n.pointXValue,e.x());var d=l.values[o],h=e.y()(d,o);if(null!=h&&i.highlightPoint(c,o,!0),"undefined"!=typeof d){"undefined"==typeof r&&(r=d),"undefined"==typeof a&&(a=e.xScale()(e.x()(d,o)));var p="expand"==i.style()?d.display.y:e.y()(d,o);s.push({key:l.key,value:p,color:g(l,l.seriesIndex),point:d}),k&&"expand"!=i.style()&&null!=p&&(u+=p,f=!1)}}),s.reverse(),s.length>2){var d=e.yScale().invert(n.mouseY),h=null;s.forEach(function(t,e){d=Math.abs(d);var n=Math.abs(t.point.display.y0),r=Math.abs(t.point.display.y);if(d>=n&&d<=r+n)return void(h=e)}),null!=h&&(s[h].highlight=!0)}k&&"expand"!=i.style()&&s.length>=2&&!f&&s.push({key:_,value:u,total:!0});var p=e.x()(r,o),v=l.tooltip.valueFormatter();"expand"===i.style()||"stack_percent"===i.style()?(j||(j=v),v=d3.format(".1%")):j&&(v=j,j=null),l.tooltip.valueFormatter(v).data({value:p,series:s})(),l.renderGuideLine(a)}),l.dispatch.on("elementMouseout",function(t){i.clearHighlights()}),f.dispatch.on("onBrush",function(t){z(t)}),E.on("changeState",function(t){"undefined"!=typeof t.disabled&&c.length===t.disabled.length&&(c.forEach(function(e,n){e.disabled=t.disabled[n]}),M.disabled=t.disabled),"undefined"!=typeof t.style&&(i.style(t.style),L=t.style),e.update()})}),I.renderEnd("stacked Area chart immediate"),e}var n,r,i=t.models.stackedArea(),o=t.models.axis(),a=t.models.axis(),s=t.models.legend(),u=t.models.legend(),l=t.interactiveGuideline(),c=t.models.tooltip(),f=t.models.focus(t.models.stackedArea()),d={top:30,right:25,bottom:50,left:60},h=null,p=null,g=t.utils.defaultColor(),v=!0,m=!0,y=!0,b=!0,x=!1,w=!1,$=!1,k=!0,_="TOTAL",M=t.utils.state(),C=null,S=null,E=d3.dispatch("stateChange","changeState","renderEnd"),A=250,T=["Stacked","Stream","Expanded"],N={},D=250;M.style=i.style(),o.orient("bottom").tickPadding(7),a.orient(x?"right":"left"),c.headerFormatter(function(t,e){return o.tickFormat()(t,e)}).valueFormatter(function(t,e){return a.tickFormat()(t,e)}),l.tooltip.headerFormatter(function(t,e){return o.tickFormat()(t,e)}).valueFormatter(function(t,e){return null==t?"N/A":a.tickFormat()(t,e)});var O=null,j=null;u.updateState(!1);var I=t.utils.renderWatch(E),L=i.style(),P=function(t){return function(){return{active:t.map(function(t){return!t.disabled}),style:i.style()}}},F=function(t){return function(e){void 0!==e.style&&(L=e.style),void 0!==e.active&&t.forEach(function(t,n){t.disabled=!e.active[n]})}},q=d3.format("%");return i.dispatch.on("elementMouseover.tooltip",function(t){t.point.x=i.x()(t.point),t.point.y=i.y()(t.point),c.data(t).hidden(!1)}),i.dispatch.on("elementMouseout.tooltip",function(t){c.hidden(!0)}),e.dispatch=E,e.stacked=i,e.legend=s,e.controls=u,e.xAxis=o,e.x2Axis=f.xAxis,e.yAxis=a,e.y2Axis=f.yAxis,e.interactiveLayer=l,e.tooltip=c,e.focus=f,e.dispatch=E,e.options=t.utils.optionsFunc.bind(e),e._options=Object.create({},{width:{get:function(){return h},set:function(t){h=t}},height:{get:function(){return p},set:function(t){p=t}},showLegend:{get:function(){return m},set:function(t){m=t}},showXAxis:{get:function(){return y},set:function(t){y=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return C},set:function(t){C=t}},noData:{get:function(){return S},set:function(t){S=t}},showControls:{get:function(){return v},set:function(t){v=t}},controlLabels:{get:function(){return N},set:function(t){N=t}},controlOptions:{get:function(){return T},set:function(t){T=t}},showTotalInTooltip:{get:function(){return k},set:function(t){k=t}},totalLabel:{get:function(){return _},set:function(t){_=t}},focusEnable:{get:function(){return w},set:function(t){w=t}},focusHeight:{get:function(){return f.height()},set:function(t){f.height(t)}},brushExtent:{get:function(){return f.brushExtent()},set:function(t){f.brushExtent(t)}},margin:{get:function(){return d},set:function(t){d.top=void 0!==t.top?t.top:d.top,d.right=void 0!==t.right?t.right:d.right,d.bottom=void 0!==t.bottom?t.bottom:d.bottom,d.left=void 0!==t.left?t.left:d.left}},focusMargin:{get:function(){return f.margin},set:function(t){f.margin.top=void 0!==t.top?t.top:f.margin.top,f.margin.right=void 0!==t.right?t.right:f.margin.right,f.margin.bottom=void 0!==t.bottom?t.bottom:f.margin.bottom,f.margin.left=void 0!==t.left?t.left:f.margin.left}},duration:{get:function(){return D},set:function(t){D=t,I.reset(D),i.duration(D),o.duration(D),a.duration(D)}},color:{get:function(){return g},set:function(e){g=t.utils.getColor(e),s.color(g),i.color(g),f.color(g)}},x:{get:function(){return i.x()},set:function(t){i.x(t),f.x(t)}},y:{get:function(){return i.y()},set:function(t){i.y(t),f.y(t)}},rightAlignYAxis:{get:function(){return x},set:function(t){x=t,a.orient(x?"right":"left")}},useInteractiveGuideline:{get:function(){return $},set:function(t){$=!!t,e.interactive(!t),e.useVoronoi(!t),i.scatter.interactive(!t)}}}),t.utils.inheritOptions(e,i),t.utils.initOptions(e),e},t.models.stackedAreaWithFocusChart=function(){return t.models.stackedAreaChart().margin({bottom:30}).focusEnable(!0)},t.models.sunburst=function(){"use strict";function e(t){var e=n(t);return e>90?180:0}function n(t){var e=Math.max(0,Math.min(2*Math.PI,N(t.x))),n=Math.max(0,Math.min(2*Math.PI,N(t.x+t.dx))),r=(e+n)/2*(180/Math.PI)-90;return r}function r(t){var e=Math.max(0,Math.min(2*Math.PI,N(t.x))),n=Math.max(0,Math.min(2*Math.PI,N(t.x+t.dx)));return(n-e)/(2*Math.PI)}function i(t){var e=Math.max(0,Math.min(2*Math.PI,N(t.x))),n=Math.max(0,Math.min(2*Math.PI,N(t.x+t.dx))),r=n-e;return r>M}function o(t,e){var n=d3.interpolate(N.domain(),[f.x,f.x+f.dx]),r=d3.interpolate(D.domain(),[f.y,1]),i=d3.interpolate(D.range(),[f.y?20:0,p]);return 0===e?function(){return I(t)}:function(e){return N.domain(n(e)),D.domain(r(e)).range(i(e)),I(t)}}function a(t){var e=d3.interpolate({x:t.x0,dx:t.dx0,y:t.y0,dy:t.dy0},t);return function(n){var r=e(n);return t.x0=r.x,t.dx0=r.dx,t.y0=r.y,t.dy0=r.dy,I(r)}}function s(t){var e=S(t);j[e]||(j[e]={});var n=j[e];n.dx=t.dx,n.x=t.x,n.dy=t.dy,n.y=t.y}function u(t){t.forEach(function(t){var e=S(t),n=j[e];n?(t.dx0=n.dx,t.x0=n.x,t.dy0=n.dy,t.y0=n.y):(t.dx0=t.dx,t.x0=t.x,t.dy0=t.dy,t.y0=t.y),s(t)})}function l(t){var r=w.selectAll("text"),a=w.selectAll("path");r.transition().attr("opacity",0),f=t,a.transition().duration(A).attrTween("d",o).each("end",function(r){if(r.x>=t.x&&r.x=t.depth){var o=d3.select(this.parentNode),a=o.select("text");a.transition().duration(A).text(function(t){return _(t)}).attr("opacity",function(t){return i(t)?1:0}).attr("transform",function(){var i=this.getBBox().width;if(0===r.depth)return"translate("+i/2*-1+",0)";if(r.depth===t.depth)return"translate("+(D(r.y)+5)+",0)";var o=n(r),a=e(r);return 0===a?"rotate("+o+")translate("+(D(r.y)+5)+",0)":"rotate("+o+")translate("+(D(r.y)+i+5)+",0)rotate("+a+")"})}})}function c(o){return L.reset(),o.each(function(o){w=d3.select(this),d=t.utils.availableWidth(v,w,g),h=t.utils.availableHeight(m,w,g),p=Math.min(d,h)/2,D.range([0,p]);var s=w.select("g.nvd3.nv-wrap.nv-sunburst");s[0][0]?s.attr("transform","translate("+(d/2+g.left+g.right)+","+(h/2+g.top+g.bottom)+")"):s=w.append("g").attr("class","nvd3 nv-wrap nv-sunburst nv-chart-"+x).attr("transform","translate("+(d/2+g.left+g.right)+","+(h/2+g.top+g.bottom)+")"),w.on("click",function(t,e){T.chartClick({data:t,index:e,pos:d3.event,id:x})}),O.value(b[y]||b.count);var c=O.nodes(o[0]).reverse();u(c);var f=s.selectAll(".arc-container").data(c,S),M=f.enter().append("g").attr("class","arc-container");M.append("path").attr("d",I).style("fill",function(t){return t.color?t.color:$(E?(t.children?t:t.parent).name:t.name)}).style("stroke","#FFF").on("click",l).on("mouseover",function(t,e){d3.select(this).classed("hover",!0).style("opacity",.8),T.elementMouseover({data:t,color:d3.select(this).style("fill"),percent:r(t)})}).on("mouseout",function(t,e){d3.select(this).classed("hover",!1).style("opacity",1),T.elementMouseout({data:t})}).on("mousemove",function(t,e){T.elementMousemove({data:t})}),f.each(function(t){d3.select(this).select("path").transition().duration(A).attrTween("d",a)}),k&&(f.selectAll("text").remove(),f.append("text").text(function(t){return _(t)}).transition().duration(A).attr("opacity",function(t){return i(t)?1:0}).attr("transform",function(t){var r=this.getBBox().width;if(0===t.depth)return"rotate(0)translate("+r/2*-1+",0)";var i=n(t),o=e(t);return 0===o?"rotate("+i+")translate("+(D(t.y)+5)+",0)":"rotate("+i+")translate("+(D(t.y)+r+5)+",0)rotate("+o+")"})),l(c[c.length-1]),f.exit().transition().duration(A).attr("opacity",0).each("end",function(t){var e=S(t);j[e]=void 0}).remove()}),L.renderEnd("sunburst immediate"),c}var f,d,h,p,g={top:0,right:0,bottom:0,left:0},v=600,m=600,y="count",b={count:function(t){return 1},value:function(t){return t.value||t.size},size:function(t){return t.value||t.size}},x=Math.floor(1e4*Math.random()),w=null,$=t.utils.defaultColor(),k=!1,_=function(t){return"count"===y?t.name+" #"+t.value:t.name+" "+(t.value||t.size)},M=.02,C=function(t,e){return t.name>e.name},S=function(t,e){return t.name},E=!0,A=500,T=d3.dispatch("chartClick","elementClick","elementDblClick","elementMousemove","elementMouseover","elementMouseout","renderEnd"),N=d3.scale.linear().range([0,2*Math.PI]),D=d3.scale.sqrt(),O=d3.layout.partition().sort(C),j={},I=d3.svg.arc().startAngle(function(t){return Math.max(0,Math.min(2*Math.PI,N(t.x)))}).endAngle(function(t){return Math.max(0,Math.min(2*Math.PI,N(t.x+t.dx)))}).innerRadius(function(t){return Math.max(0,D(t.y))}).outerRadius(function(t){return Math.max(0,D(t.y+t.dy))}),L=t.utils.renderWatch(T);return c.dispatch=T,c.options=t.utils.optionsFunc.bind(c),c._options=Object.create({},{width:{get:function(){return v},set:function(t){v=t}},height:{get:function(){return m},set:function(t){m=t}},mode:{get:function(){return y},set:function(t){y=t}},id:{get:function(){return x},set:function(t){x=t}},duration:{get:function(){return A},set:function(t){A=t}},groupColorByParent:{get:function(){return E},set:function(t){E=!!t}},showLabels:{get:function(){return k},set:function(t){k=!!t}},labelFormat:{get:function(){return _},set:function(t){_=t}},labelThreshold:{get:function(){return M},set:function(t){M=t}},sort:{get:function(){return C},set:function(t){C=t}},key:{get:function(){return S},set:function(t){S=t}},margin:{get:function(){return g},set:function(t){g.top=void 0!=t.top?t.top:g.top,g.right=void 0!=t.right?t.right:g.right,g.bottom=void 0!=t.bottom?t.bottom:g.bottom,g.left=void 0!=t.left?t.left:g.left}},color:{get:function(){return $},set:function(e){$=t.utils.getColor(e)}}}),t.utils.initOptions(c),c},t.models.sunburstChart=function(){"use strict";function e(r){return h.reset(),h.models(n),r.each(function(r){var s=d3.select(this);t.utils.initSVG(s);var u=t.utils.availableWidth(o,s,i),l=t.utils.availableHeight(a,s,i);return e.update=function(){0===f?s.call(e):s.transition().duration(f).call(e)},e.container=s,r&&r.length?(s.selectAll(".nv-noData").remove(),n.width(u).height(l).margin(i),void s.call(n)):(t.utils.noData(e,s),e)}),h.renderEnd("sunburstChart immediate"),e}var n=t.models.sunburst(),r=t.models.tooltip(),i={top:30,right:20,bottom:20,left:20},o=null,a=null,s=t.utils.defaultColor(),u=!1,l=(Math.round(1e5*Math.random()),null),c=null,f=250,d=d3.dispatch("stateChange","changeState","renderEnd"),h=t.utils.renderWatch(d);return r.duration(0).headerEnabled(!1).valueFormatter(function(t){return t}),n.dispatch.on("elementMouseover.tooltip",function(t){t.series={key:t.data.name,value:t.data.value||t.data.size,color:t.color,percent:t.percent},u||(delete t.percent,delete t.series.percent),r.data(t).hidden(!1)}),n.dispatch.on("elementMouseout.tooltip",function(t){r.hidden(!0)}),n.dispatch.on("elementMousemove.tooltip",function(t){r()}),e.dispatch=d,e.sunburst=n,e.tooltip=r,e.options=t.utils.optionsFunc.bind(e),e._options=Object.create({},{noData:{get:function(){return c},set:function(t){c=t}},defaultState:{get:function(){return l},set:function(t){l=t}},showTooltipPercent:{get:function(){return u},set:function(t){u=t}},color:{get:function(){return s},set:function(t){s=t,n.color(s)}},duration:{get:function(){return f},set:function(t){f=t,h.reset(f),n.duration(f)}},margin:{get:function(){return i},set:function(t){i.top=void 0!==t.top?t.top:i.top,i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left,n.margin(i)}}}),t.utils.inheritOptions(e,n),t.utils.initOptions(e),e},t.version="1.8.4"}(),function(){var t=this,e="addEventListener",n="removeEventListener",r="getBoundingClientRect",i=t.attachEvent&&!t[e],o=t.document,a=function(){for(var t,e=["","-webkit-","-moz-","-o-"],n=0;n=this.size-this.bMin-l.snapOffset&&(e=this.size-this.bMin),k.call(this,e),l.onDrag&&l.onDrag())},$=function(){var e=t.getComputedStyle(this.parent),n=this.parent[d]-parseFloat(e[v])-parseFloat(e[m]);this.size=this.a[r]()[c]+this.b[r]()[c]+this.aGutterSize+this.bGutterSize,this.percentage=Math.min(this.size/n*100,100),this.start=this.a[r]()[p]},k=function(t){this.a.style[c]=a+"("+t/this.size*this.percentage+"% - "+this.aGutterSize+"px)",this.b.style[c]=a+"("+(this.percentage-t/this.size*this.percentage)+"% - "+this.bGutterSize+"px)"},_=function(){var t=this,e=t.a,n=t.b;e[r]()[c]=0;e--)$.call(t[e]),M.call(t[e])},S=function(){return!1},E=s(u[0]).parentNode;if(!l.sizes){var A=100/u.length;for(l.sizes=[],f=0;f0&&(D={a:s(u[f-1]),b:O,aMin:l.minSize[f-1],bMin:l.minSize[f],dragging:!1,parent:E,isFirst:j,isLast:I,direction:l.direction},D.aGutterSize=l.gutterSize,D.bGutterSize=l.gutterSize,j&&(D.aGutterSize=l.gutterSize/2),I&&(D.bGutterSize=l.gutterSize/2)),i)N="string"==typeof l.sizes[f]||l.sizes[f]instanceof String?l.sizes[f]:l.sizes[f]+"%";else{if(f>0){var P=o.createElement("div");P.className=g,P.style[c]=l.gutterSize+"px",P[e]("mousedown",b.bind(D)),P[e]("touchstart",b.bind(D)),E.insertBefore(P,O),D.gutter=P}0!==f&&f!=u.length-1||(L=l.gutterSize/2),N="string"==typeof l.sizes[f]||l.sizes[f]instanceof String?l.sizes[f]:a+"("+l.sizes[f]+"% - "+L+"px)"}O.style[c]=N,f>0&&y.push(D)}C(y)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=u),exports.Split=u):t.Split=u}.call(window),function(){"use strict";function t(t,e){return t.module("angularMoment",[]).constant("angularMomentConfig",{preprocess:null,timezone:"",format:null,statefulFilters:!0}).constant("moment",e).constant("amTimeAgoConfig",{withoutSuffix:!1,serverTime:null,titleFormat:null,fullDateThreshold:null,fullDateFormat:null}).directive("amTimeAgo",["$window","moment","amMoment","amTimeAgoConfig","angularMomentConfig",function(e,n,r,i,o){return function(a,s,u){function l(){var t;if(g)t=g;else if(i.serverTime){var e=(new Date).getTime(),r=e-$+i.serverTime;t=n(r)}else t=n();return t}function c(){v&&(e.clearTimeout(v),v=null)}function f(t){var n=l().diff(t,"day"),r=x&&n>=x;if(r?s.text(t.format(w)):s.text(t.from(l(),y)),b&&!s.attr("title")&&s.attr("title",t.local().format(b)),!r){var i=Math.abs(l().diff(t,"minute")),o=3600;i<1?o=1:i<60?o=30:i<180&&(o=300),v=e.setTimeout(function(){f(t)},1e3*o)}}function d(t){M&&s.attr("datetime",t)}function h(){if(c(),p){var t=r.preprocessDate(p,k,m);f(t),d(t.toISOString())}}var p,g,v=null,m=o.format,y=i.withoutSuffix,b=i.titleFormat,x=i.fullDateThreshold,w=i.fullDateFormat,$=(new Date).getTime(),k=o.preprocess,_=u.amTimeAgo,M="TIME"===s[0].nodeName.toUpperCase();a.$watch(_,function(t){return"undefined"==typeof t||null===t||""===t?(c(),void(p&&(s.text(""),d(""),p=null))):(p=t,void h())}),t.isDefined(u.amFrom)&&a.$watch(u.amFrom,function(t){g="undefined"==typeof t||null===t||""===t?null:n(t),h()}),t.isDefined(u.amWithoutSuffix)&&a.$watch(u.amWithoutSuffix,function(t){"boolean"==typeof t?(y=t,h()):y=i.withoutSuffix}),u.$observe("amFormat",function(t){"undefined"!=typeof t&&(m=t,h())}),u.$observe("amPreprocess",function(t){k=t,h()}),u.$observe("amFullDateThreshold",function(t){x=t,h()}),u.$observe("amFullDateFormat",function(t){w=t,h()}),a.$on("$destroy",function(){c()}),a.$on("amMoment:localeChanged",function(){h()})}}]).service("amMoment",["moment","$rootScope","$log","angularMomentConfig",function(e,n,r,i){this.preprocessors={utc:e.utc,unix:e.unix},this.changeLocale=function(r,i){var o=e.locale(r,i);return t.isDefined(r)&&n.$broadcast("amMoment:localeChanged"),o},this.changeTimezone=function(t){i.timezone=t,n.$broadcast("amMoment:timezoneChanged")},this.preprocessDate=function(n,o,a){return t.isUndefined(o)&&(o=i.preprocess),this.preprocessors[o]?this.preprocessors[o](n,a):(o&&r.warn("angular-moment: Ignoring unsupported value for preprocess: "+o),!isNaN(parseFloat(n))&&isFinite(n)?e(parseInt(n,10)):e(n,a))},this.applyTimezone=function(t,e){return(e=e||i.timezone)?(e.match(/^Z|[+-]\d\d:?\d\d$/i)?t=t.utcOffset(e):t.tz?t=t.tz(e):r.warn("angular-moment: named timezone specified but moment.tz() is undefined. Did you forget to include moment-timezone.js?"),t):t}}]).filter("amCalendar",["moment","amMoment","angularMomentConfig",function(t,e,n){function r(n,r,i){if("undefined"==typeof n||null===n)return"";n=e.preprocessDate(n,r);var o=t(n);return o.isValid()?e.applyTimezone(o,i).calendar():""}return r.$stateful=n.statefulFilters,r}]).filter("amDifference",["moment","amMoment","angularMomentConfig",function(t,e,n){function r(n,r,i,o,a,s){if("undefined"==typeof n||null===n)return"";n=e.preprocessDate(n,a);var u=t(n);if(!u.isValid())return"";var l;if("undefined"==typeof r||null===r)l=t();else if(r=e.preprocessDate(r,s),l=t(r),!l.isValid())return"";return e.applyTimezone(u).diff(e.applyTimezone(l),i,o)}return r.$stateful=n.statefulFilters,r}]).filter("amDateFormat",["moment","amMoment","angularMomentConfig",function(t,e,n){function r(r,i,o,a,s){var u=s||n.format;if("undefined"==typeof r||null===r)return"";r=e.preprocessDate(r,o,u);var l=t(r);return l.isValid()?e.applyTimezone(l,a).format(i):""}return r.$stateful=n.statefulFilters,r}]).filter("amDurationFormat",["moment","angularMomentConfig",function(t,e){function n(e,n,r){return"undefined"==typeof e||null===e?"":t.duration(e,n).humanize(r)}return n.$stateful=e.statefulFilters,n}]).filter("amTimeAgo",["moment","amMoment","angularMomentConfig",function(t,e,n){function r(n,r,i,o){var a,s;return"undefined"==typeof n||null===n?"":(n=e.preprocessDate(n,r),a=t(n),a.isValid()?(s=t(o),"undefined"!=typeof o&&s.isValid()?e.applyTimezone(a).from(s,i):e.applyTimezone(a).fromNow(i)):"")}return r.$stateful=n.statefulFilters,r}]).filter("amSubtract",["moment","angularMomentConfig",function(t,e){function n(e,n,r){return"undefined"==typeof e||null===e?"":t(e).subtract(parseInt(n,10),r)}return n.$stateful=e.statefulFilters,n}]).filter("amAdd",["moment","angularMomentConfig",function(t,e){function n(e,n,r){return"undefined"==typeof e||null===e?"":t(e).add(parseInt(n,10),r)}return n.$stateful=e.statefulFilters,n}])}"function"==typeof define&&define.amd?define(["angular","moment"],t):"undefined"!=typeof module&&module&&module.exports?(t(angular,require("moment")),module.exports="angularMoment"):t(angular,("undefined"!=typeof global?global:window).moment)}(),function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a0&&(i=u.removeMin(),o=s[i],o.distance!==Number.POSITIVE_INFINITY);)r(i).forEach(l);return s}var o=t("../lodash"),a=t("../data/priority-queue");e.exports=r;var s=o.constant(1)},{"../data/priority-queue":16,"../lodash":20}],7:[function(t,e,n){function r(t){return i.filter(o(t),function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])})}var i=t("../lodash"),o=t("./tarjan");e.exports=r},{"../lodash":20,"./tarjan":14}],8:[function(t,e,n){function r(t,e,n){return i(t,e||a,n||function(e){return t.outEdges(e)})}function i(t,e,n){var r={},i=t.nodes();return i.forEach(function(t){r[t]={},r[t][t]={distance:0},i.forEach(function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})}),n(t).forEach(function(n){var i=n.v===t?n.w:n.v,o=e(n);r[t][i]={distance:o,predecessor:t}})}),i.forEach(function(t){var e=r[t];i.forEach(function(n){var o=r[n];i.forEach(function(n){var r=o[t],i=e[n],a=o[n],s=r.distance+i.distance;s0;){if(r=l.removeMin(),i.has(u,r))s.setEdge(r,u[r]);else{if(c)throw new Error("Input graph is not connected: "+t);c=!0}t.nodeEdges(r).forEach(n)}return s}var i=t("../lodash"),o=t("../graph"),a=t("../data/priority-queue");e.exports=r},{"../data/priority-queue":16,"../graph":17,"../lodash":20}],14:[function(t,e,n){function r(t){function e(s){var u=o[s]={onStack:!0,lowlink:n,index:n++};if(r.push(s),t.successors(s).forEach(function(t){i.has(o,t)?o[t].onStack&&(u.lowlink=Math.min(u.lowlink,o[t].index)):(e(t),u.lowlink=Math.min(u.lowlink,o[t].lowlink))}),u.lowlink===u.index){var l,c=[];do l=r.pop(),o[l].onStack=!1,c.push(l);while(s!==l);a.push(c)}}var n=0,r=[],o={},a=[];return t.nodes().forEach(function(t){i.has(o,t)||e(t)}),a}var i=t("../lodash");e.exports=r},{"../lodash":20}],15:[function(t,e,n){function r(t){function e(s){if(o.has(r,s))throw new i;o.has(n,s)||(r[s]=!0,n[s]=!0,o.each(t.predecessors(s),e),delete r[s],a.push(s))}var n={},r={},a=[];if(o.each(t.sinks(),e),o.size(n)!==t.nodeCount())throw new i;return a}function i(){}var o=t("../lodash");e.exports=r,r.CycleException=i},{"../lodash":20}],16:[function(t,e,n){function r(){this._arr=[],this._keyIndices={}}var i=t("../lodash");e.exports=r,r.prototype.size=function(){return this._arr.length},r.prototype.keys=function(){return this._arr.map(function(t){return t.key})},r.prototype.has=function(t){return i.has(this._keyIndices,t)},r.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},r.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},r.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!i.has(n,t)){var r=this._arr,o=r.length;return n[t]=o,r.push({key:t,priority:e}),this._decrease(o),!0}return!1},r.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},r.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},r.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n>1,!(n[e].priorityo){var a=i;i=o,o=a}return i+d+o+d+(l.isUndefined(r)?c:r)}function s(t,e,n,r){var i=""+e,o=""+n;if(!t&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}function u(t,e){return a(t,e.v,e.w,e.name)}var l=t("./lodash");e.exports=r;var c="\0",f="\0",d="";r.prototype._nodeCount=0,r.prototype._edgeCount=0,r.prototype.isDirected=function(){return this._isDirected},r.prototype.isMultigraph=function(){return this._isMultigraph},r.prototype.isCompound=function(){return this._isCompound},r.prototype.setGraph=function(t){return this._label=t,this},r.prototype.graph=function(){return this._label},r.prototype.setDefaultNodeLabel=function(t){return l.isFunction(t)||(t=l.constant(t)),this._defaultNodeLabelFn=t,this},r.prototype.nodeCount=function(){return this._nodeCount},r.prototype.nodes=function(){return l.keys(this._nodes)},r.prototype.sources=function(){return l.filter(this.nodes(),function(t){return l.isEmpty(this._in[t])},this)},r.prototype.sinks=function(){return l.filter(this.nodes(),function(t){return l.isEmpty(this._out[t])},this)},r.prototype.setNodes=function(t,e){var n=arguments;return l.each(t,function(t){n.length>1?this.setNode(t,e):this.setNode(t)},this),this},r.prototype.setNode=function(t,e){return l.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=f,this._children[t]={},this._children[f][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},r.prototype.node=function(t){return this._nodes[t]},r.prototype.hasNode=function(t){return l.has(this._nodes,t)},r.prototype.removeNode=function(t){var e=this;if(l.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],l.each(this.children(t),function(t){this.setParent(t)},this),delete this._children[t]),l.each(l.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],l.each(l.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},r.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(l.isUndefined(e))e=f;else{e+="";for(var n=e;!l.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},r.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},r.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==f)return e}},r.prototype.children=function(t){if(l.isUndefined(t)&&(t=f),this._isCompound){var e=this._children[t];if(e)return l.keys(e)}else{if(t===f)return this.nodes();if(this.hasNode(t))return[]}},r.prototype.predecessors=function(t){var e=this._preds[t];if(e)return l.keys(e)},r.prototype.successors=function(t){var e=this._sucs[t];if(e)return l.keys(e)},r.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return l.union(e,this.successors(t))},r.prototype.filterNodes=function(t){function e(t){var o=r.parent(t);return void 0===o||n.hasNode(o)?(i[t]=o,o):o in i?i[o]:e(o)}var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph()),l.each(this._nodes,function(e,r){t(r)&&n.setNode(r,e)},this),l.each(this._edgeObjs,function(t){n.hasNode(t.v)&&n.hasNode(t.w)&&n.setEdge(t,this.edge(t))},this);var r=this,i={};return this._isCompound&&l.each(n.nodes(),function(t){n.setParent(t,e(t))}),n},r.prototype.setDefaultEdgeLabel=function(t){return l.isFunction(t)||(t=l.constant(t)),this._defaultEdgeLabelFn=t,this},r.prototype.edgeCount=function(){return this._edgeCount},r.prototype.edges=function(){return l.values(this._edgeObjs)},r.prototype.setPath=function(t,e){var n=this,r=arguments;return l.reduce(t,function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i}),this},r.prototype.setEdge=function(){var t,e,n,r,o=!1,u=arguments[0];"object"==typeof u&&null!==u&&"v"in u?(t=u.v,e=u.w,n=u.name,2===arguments.length&&(r=arguments[1],o=!0)):(t=u,e=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],o=!0)),t=""+t,e=""+e,l.isUndefined(n)||(n=""+n);var c=a(this._isDirected,t,e,n);if(l.has(this._edgeLabels,c))return o&&(this._edgeLabels[c]=r),this;if(!l.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[c]=o?r:this._defaultEdgeLabelFn(t,e,n);var f=s(this._isDirected,t,e,n);return t=f.v,e=f.w,Object.freeze(f),this._edgeObjs[c]=f,i(this._preds[e],t),i(this._sucs[t],e),this._in[e][c]=f,this._out[t][c]=f,this._edgeCount++,this},r.prototype.edge=function(t,e,n){var r=1===arguments.length?u(this._isDirected,arguments[0]):a(this._isDirected,t,e,n);return this._edgeLabels[r]},r.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?u(this._isDirected,arguments[0]):a(this._isDirected,t,e,n);return l.has(this._edgeLabels,r)},r.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?u(this._isDirected,arguments[0]):a(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],o(this._preds[e],t),o(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},r.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=l.values(n);return e?l.filter(r,function(t){return t.v===e}):r}},r.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=l.values(n);return e?l.filter(r,function(t){return t.w===e}):r}},r.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}},{"./lodash":20}],18:[function(t,e,n){e.exports={Graph:t("./graph"),version:t("./version")}},{"./graph":17,"./version":21}],19:[function(t,e,n){function r(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:i(t),edges:o(t)};return s.isUndefined(t.graph())||(e.value=s.clone(t.graph())),e}function i(t){return s.map(t.nodes(),function(e){var n=t.node(e),r=t.parent(e),i={v:e};return s.isUndefined(n)||(i.value=n),s.isUndefined(r)||(i.parent=r),i})}function o(t){return s.map(t.edges(),function(e){var n=t.edge(e),r={v:e.v,w:e.w};return s.isUndefined(e.name)||(r.name=e.name),s.isUndefined(n)||(r.value=n),r})}function a(t){var e=new u(t.options).setGraph(t.value);return s.each(t.nodes,function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),s.each(t.edges,function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}var s=t("./lodash"),u=t("./graph");e.exports={write:r,read:a}},{"./graph":17,"./lodash":20}],20:[function(t,e,n){var r;if("function"==typeof t)try{r=t("lodash")}catch(i){}r||(r=window._),e.exports=r},{lodash:void 0}],21:[function(t,e,n){e.exports="1.0.7"},{}]},{},[1]),function(t,e){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(n){return e(t,n)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}("undefined"!=typeof window?window:this,function(t,e){"use strict";function n(t,e){for(var n in e)t[n]=e[n];return t}function r(t){var e=[];if(Array.isArray(t))e=t;else if("number"==typeof t.length)for(var n=0;n0;--u)if(r=e[u].dequeue()){i=i.concat(o(t,e,n,r,!0));break}}return i}function o(t,e,n,r,i){var o=i?[]:void 0;return u.each(t.inEdges(r.v),function(r){var a=t.edge(r),u=t.node(r.v);i&&o.push({v:r.v,w:r.w}),u.out-=a,s(e,n,u)}),u.each(t.outEdges(r.v),function(r){var i=t.edge(r),o=r.w,a=t.node(o);a["in"]-=i,s(e,n,a)}),t.removeNode(r.v),o}function a(t,e){var n=new l,r=0,i=0;u.each(t.nodes(),function(t){n.setNode(t,{v:t,"in":0,out:0})}),u.each(t.edges(),function(t){var o=n.edge(t.v,t.w)||0,a=e(t),s=o+a;n.setEdge(t.v,t.w,s),i=Math.max(i,n.node(t.v).out+=a),r=Math.max(r,n.node(t.w)["in"]+=a)});var o=u.range(i+r+3).map(function(){return new c}),a=r+1;return u.each(n.nodes(),function(t){s(o,a,n.node(t))}),{graph:n,buckets:o,zeroIdx:a}}function s(t,e,n){n.out?n["in"]?t[n.out-n["in"]+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}var u=t("./lodash"),l=t("./graphlib").Graph,c=t("./data/list");e.exports=r;var f=u.constant(1)},{"./data/list":5,"./graphlib":7,"./lodash":10}],9:[function(t,e,n){"use strict";function r(t,e){var n=e&&e.debugTiming?O.time:O.notime;n("layout",function(){var e=n(" buildLayoutGraph",function(){return a(t)});n(" runLayout",function(){i(e,n)}),n(" updateInputGraph",function(){o(t,e)})})}function i(t,e){e(" makeSpaceForEdgeLabels",function(){s(t)}),e(" removeSelfEdges",function(){v(t)}),e(" acyclic",function(){$.run(t)}),e(" nestingGraph.run",function(){E.run(t)}),e(" rank",function(){_(O.asNonCompoundGraph(t))}),e(" injectEdgeLabelProxies",function(){u(t)}),e(" removeEmptyRanks",function(){S(t)}),e(" nestingGraph.cleanup",function(){E.cleanup(t)}),e(" normalizeRanks",function(){M(t)}),e(" assignRankMinMax",function(){l(t)}),e(" removeEdgeLabelProxies",function(){c(t)}),e(" normalize.run",function(){k.run(t)}),e(" parentDummyChains",function(){C(t)}),e(" addBorderSegments",function(){A(t)}),e(" order",function(){N(t)}),e(" insertSelfEdges",function(){m(t)}),e(" adjustCoordinateSystem",function(){ +T.adjust(t)}),e(" position",function(){D(t)}),e(" positionSelfEdges",function(){y(t)}),e(" removeBorderNodes",function(){g(t)}),e(" normalize.undo",function(){k.undo(t)}),e(" fixupEdgeLabelCoords",function(){h(t)}),e(" undoCoordinateSystem",function(){T.undo(t)}),e(" translateGraph",function(){f(t)}),e(" assignNodeIntersects",function(){d(t)}),e(" reversePoints",function(){p(t)}),e(" acyclic.undo",function(){$.undo(t)})}function o(t,e){w.each(t.nodes(),function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,e.children(n).length&&(r.width=i.width,r.height=i.height))}),w.each(t.edges(),function(n){var r=t.edge(n),i=e.edge(n);r.points=i.points,w.has(i,"x")&&(r.x=i.x,r.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}function a(t){var e=new j({multigraph:!0,compound:!0}),n=x(t.graph());return e.setGraph(w.merge({},L,b(n,I),w.pick(n,P))),w.each(t.nodes(),function(n){var r=x(t.node(n));e.setNode(n,w.defaults(b(r,F),q)),e.setParent(n,t.parent(n))}),w.each(t.edges(),function(n){var r=x(t.edge(n));e.setEdge(n,w.merge({},W,b(r,z),w.pick(r,R)))}),e}function s(t){var e=t.graph();e.ranksep/=2,w.each(t.edges(),function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function u(t){w.each(t.edges(),function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i=t.node(e.w),o={rank:(i.rank-r.rank)/2+r.rank,e:e};O.addDummyNode(t,"edge-proxy",o,"_ep")}})}function l(t){var e=0;w.each(t.nodes(),function(n){var r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=w.max(e,r.maxRank))}),t.graph().maxRank=e}function c(t){w.each(t.nodes(),function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))})}function f(t){function e(t){var e=t.x,a=t.y,s=t.width,u=t.height;n=Math.min(n,e-s/2),r=Math.max(r,e+s/2),i=Math.min(i,a-u/2),o=Math.max(o,a+u/2)}var n=Number.POSITIVE_INFINITY,r=0,i=Number.POSITIVE_INFINITY,o=0,a=t.graph(),s=a.marginx||0,u=a.marginy||0;w.each(t.nodes(),function(n){e(t.node(n))}),w.each(t.edges(),function(n){var r=t.edge(n);w.has(r,"x")&&e(r)}),n-=s,i-=u,w.each(t.nodes(),function(e){var r=t.node(e);r.x-=n,r.y-=i}),w.each(t.edges(),function(e){var r=t.edge(e);w.each(r.points,function(t){t.x-=n,t.y-=i}),w.has(r,"x")&&(r.x-=n),w.has(r,"y")&&(r.y-=i)}),a.width=r-n+s,a.height=o-i+u}function d(t){w.each(t.edges(),function(e){var n,r,i=t.edge(e),o=t.node(e.v),a=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(O.intersectRect(o,n)),i.points.push(O.intersectRect(a,r))})}function h(t){w.each(t.edges(),function(e){var n=t.edge(e);if(w.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})}function p(t){w.each(t.edges(),function(e){var n=t.edge(e);n.reversed&&n.points.reverse()})}function g(t){w.each(t.nodes(),function(e){if(t.children(e).length){var n=t.node(e),r=t.node(n.borderTop),i=t.node(n.borderBottom),o=t.node(w.last(n.borderLeft)),a=t.node(w.last(n.borderRight));n.width=Math.abs(a.x-o.x),n.height=Math.abs(i.y-r.y),n.x=o.x+n.width/2,n.y=r.y+n.height/2}}),w.each(t.nodes(),function(e){"border"===t.node(e).dummy&&t.removeNode(e)})}function v(t){w.each(t.edges(),function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}function m(t){var e=O.buildLayerMatrix(t);w.each(e,function(e){var n=0;w.each(e,function(e,r){var i=t.node(e);i.order=r+n,w.each(i.selfEdges,function(e){O.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++n,e:e.e,label:e.label},"_se")}),delete i.selfEdges})})}function y(t){w.each(t.nodes(),function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,s=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}})}function b(t,e){return w.mapValues(w.pick(t,e),Number)}function x(t){var e={};return w.each(t,function(t,n){e[n.toLowerCase()]=t}),e}var w=t("./lodash"),$=t("./acyclic"),k=t("./normalize"),_=t("./rank"),M=t("./util").normalizeRanks,C=t("./parent-dummy-chains"),S=t("./util").removeEmptyRanks,E=t("./nesting-graph"),A=t("./add-border-segments"),T=t("./coordinate-system"),N=t("./order"),D=t("./position"),O=t("./util"),j=t("./graphlib").Graph;e.exports=r;var I=["nodesep","edgesep","ranksep","marginx","marginy"],L={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},P=["acyclicer","ranker","rankdir","align"],F=["width","height"],q={width:0,height:0},z=["minlen","weight","width","height","labeloffset"],W={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},R=["labelpos"]},{"./acyclic":2,"./add-border-segments":3,"./coordinate-system":4,"./graphlib":7,"./lodash":10,"./nesting-graph":11,"./normalize":12,"./order":17,"./parent-dummy-chains":22,"./position":24,"./rank":26,"./util":29}],10:[function(t,e,n){var r;if("function"==typeof t)try{r=t("lodash")}catch(i){}r||(r=window._),e.exports=r},{lodash:void 0}],11:[function(t,e,n){function r(t){var e=l.addDummyNode(t,"root",{},"_root"),n=o(t),r=u.max(n)-1,s=2*r+1;t.graph().nestingRoot=e,u.each(t.edges(),function(e){t.edge(e).minlen*=s});var c=a(t)+1;u.each(t.children(),function(o){i(t,e,s,c,r,n,o)}),t.graph().nodeRankFactor=s}function i(t,e,n,r,o,a,s){var c=t.children(s);if(!c.length)return void(s!==e&&t.setEdge(e,s,{weight:0,minlen:n}));var f=l.addBorderNode(t,"_bt"),d=l.addBorderNode(t,"_bb"),h=t.node(s);t.setParent(f,s),h.borderTop=f,t.setParent(d,s),h.borderBottom=d,u.each(c,function(u){i(t,e,n,r,o,a,u);var l=t.node(u),c=l.borderTop?l.borderTop:u,h=l.borderBottom?l.borderBottom:u,p=l.borderTop?r:2*r,g=c!==h?1:o-a[s]+1;t.setEdge(f,c,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(h,d,{weight:p,minlen:g,nestingEdge:!0})}),t.parent(s)||t.setEdge(e,f,{weight:0,minlen:o+a[s]})}function o(t){function e(r,i){var o=t.children(r);o&&o.length&&u.each(o,function(t){e(t,i+1)}),n[r]=i}var n={};return u.each(t.children(),function(t){e(t,1)}),n}function a(t){return u.reduce(t.edges(),function(e,n){return e+t.edge(n).weight},0)}function s(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,u.each(t.edges(),function(e){var n=t.edge(e);n.nestingEdge&&t.removeEdge(e)})}var u=t("./lodash"),l=t("./util");e.exports={run:r,cleanup:s}},{"./lodash":10,"./util":29}],12:[function(t,e,n){"use strict";function r(t){t.graph().dummyChains=[],a.each(t.edges(),function(e){i(t,e)})}function i(t,e){var n=e.v,r=t.node(n).rank,i=e.w,o=t.node(i).rank,a=e.name,u=t.edge(e),l=u.labelRank;if(o!==r+1){t.removeEdge(e);var c,f,d;for(d=0,++r;r0;)e%2&&(n+=u[e+1]),e=e-1>>1,u[e]+=t.weight;l+=t.weight*n})),l}var o=t("../lodash");e.exports=r},{"../lodash":10}],17:[function(t,e,n){"use strict";function r(t){var e=p.maxRank(t),n=i(t,s.range(1,e+1),"inEdges"),r=i(t,s.range(e-1,-1,-1),"outEdges"),c=u(t);a(t,c);for(var f,d=Number.POSITIVE_INFINITY,h=0,g=0;g<4;++h,++g){o(h%2?n:r,h%4>=2),c=p.buildLayerMatrix(t);var v=l(t,c);v=t.barycenter)&&o(t,e)}}function n(e){return function(n){n["in"].push(e),0===--n.indegree&&t.push(n)}}for(var r=[];t.length;){var i=t.pop();r.push(i),a.each(i["in"].reverse(),e(i)),a.each(i.out,n(i))}return a.chain(r).filter(function(t){return!t.merged}).map(function(t){return a.pick(t,["vs","i","barycenter","weight"])}).value()}function o(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}var a=t("../lodash");e.exports=r},{"../lodash":10}],20:[function(t,e,n){function r(t,e,n,c){var f=t.children(e),d=t.node(e),h=d?d.borderLeft:void 0,p=d?d.borderRight:void 0,g={};h&&(f=a.filter(f,function(t){return t!==h&&t!==p}));var v=s(t,f);a.each(v,function(e){if(t.children(e.v).length){var i=r(t,e.v,n,c);g[e.v]=i,a.has(i,"barycenter")&&o(e,i)}});var m=u(v,n);i(m,g);var y=l(m,c);if(h&&(y.vs=a.flatten([h,y.vs,p],!0),t.predecessors(h).length)){var b=t.node(t.predecessors(h)[0]),x=t.node(t.predecessors(p)[0]);a.has(y,"barycenter")||(y.barycenter=0,y.weight=0),y.barycenter=(y.barycenter*y.weight+b.order+x.order)/(y.weight+2),y.weight+=2}return y}function i(t,e){a.each(t,function(t){t.vs=a.flatten(t.vs.map(function(t){return e[t]?e[t].vs:t}),!0)})}function o(t,e){a.isUndefined(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}var a=t("../lodash"),s=t("./barycenter"),u=t("./resolve-conflicts"),l=t("./sort");e.exports=r},{"../lodash":10,"./barycenter":14,"./resolve-conflicts":19,"./sort":21}],21:[function(t,e,n){function r(t,e){var n=s.partition(t,function(t){return a.has(t,"barycenter")}),r=n.lhs,u=a.sortBy(n.rhs,function(t){return-t.i}),l=[],c=0,f=0,d=0;r.sort(o(!!e)),d=i(l,u,d),a.each(r,function(t){d+=t.vs.length,l.push(t.vs),c+=t.barycenter*t.weight,f+=t.weight,d=i(l,u,d)});var h={vs:a.flatten(l,!0)};return f&&(h.barycenter=c/f,h.weight=f),h}function i(t,e,n){for(var r;e.length&&(r=a.last(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}function o(t){return function(e,n){return e.barycentern.barycenter?1:t?n.i-e.i:e.i-n.i}}var a=t("../lodash"),s=t("../util");e.exports=r},{"../lodash":10,"../util":29}],22:[function(t,e,n){function r(t){var e=o(t);a.each(t.graph().dummyChains,function(n){for(var r=t.node(n),o=r.edgeObj,a=i(t,e,o.v,o.w),s=a.path,u=a.lca,l=0,c=s[l],f=!0;n!==o.w;){if(r=t.node(n),f){for(;(c=s[l])!==u&&t.node(c).maxRanku||l>e[i].lim));for(o=i,i=r;(i=t.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}function o(t){function e(i){var o=r;a.each(t.children(i),e),n[i]={low:o,lim:r++}}var n={},r=0;return a.each(t.children(),e),n}var a=t("./lodash");e.exports=r},{"./lodash":10}],23:[function(t,e,n){"use strict";function r(t,e){function n(e,n){var i=0,s=0,u=e.length,l=m.last(n);return m.each(n,function(e,c){var f=o(t,e),d=f?t.node(f).order:u;(f||e===l)&&(m.each(n.slice(s,c+1),function(e){m.each(t.predecessors(e),function(n){var o=t.node(n),s=o.order;!(ss)&&a(i,e,u)})})}function r(e,r){var i,o=-1,a=0;return m.each(r,function(s,u){if("border"===t.node(s).dummy){var l=t.predecessors(s);l.length&&(i=t.node(l[0]).order,n(r,a,u,o,i),a=u,o=i)}n(r,a,r.length,i,e.length)}),r}var i={};return m.reduce(e,r),i}function o(t,e){if(t.node(e).dummy)return m.find(t.predecessors(e),function(e){return t.node(e).dummy})}function a(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function s(t,e,n){if(e>n){var r=e;e=n,n=r}return m.has(t[e],n)}function u(t,e,n,r){var i={},o={},a={};return m.each(e,function(t){m.each(t,function(t,e){i[t]=t,o[t]=t,a[t]=e})}),m.each(e,function(t){var e=-1;m.each(t,function(t){var u=r(t);if(u.length){u=m.sortBy(u,function(t){return a[t]});for(var l=(u.length-1)/2,c=Math.floor(l),f=Math.ceil(l);c<=f;++c){var d=u[c];o[t]===t&&ea.lim&&(s=a,u=!0);var l=g.filter(e.edges(),function(e){return u===p(t,t.node(e.v),s)&&u!==p(t,t.node(e.w),s)});return g.min(l,function(t){return m(e,t)})}function f(t,e,n,r){var o=n.v,a=n.w;t.removeEdge(o,a),t.setEdge(r.v,r.w,{}),s(t),i(t,e),d(t,e)}function d(t,e){var n=g.find(t.nodes(),function(t){return!e.node(t).parent}),r=b(t,n);r=r.slice(1),g.each(r,function(n){var r=t.node(n).parent,i=e.edge(n,r),o=!1;i||(i=e.edge(r,n),o=!0),e.node(n).rank=e.node(r).rank+(o?i.minlen:-i.minlen)})}function h(t,e,n){return t.hasEdge(e,n)}function p(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}var g=t("../lodash"),v=t("./feasible-tree"),m=t("./util").slack,y=t("./util").longestPath,b=t("../graphlib").alg.preorder,x=t("../graphlib").alg.postorder,w=t("../util").simplify;e.exports=r,r.initLowLimValues=s,r.initCutValues=i,r.calcCutValue=a,r.leaveEdge=l,r.enterEdge=c,r.exchangeEdges=f},{"../graphlib":7,"../lodash":10,"../util":29,"./feasible-tree":25,"./util":28}],28:[function(t,e,n){"use strict";function r(t){function e(r){var i=t.node(r);if(o.has(n,r))return i.rank;n[r]=!0;var a=o.min(o.map(t.outEdges(r),function(n){return e(n.w)-t.edge(n).minlen}));return a===Number.POSITIVE_INFINITY&&(a=0),i.rank=a}var n={};o.each(t.sources(),e)}function i(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}var o=t("../lodash");e.exports={longestPath:r,slack:i}},{"../lodash":10}],29:[function(t,e,n){"use strict";function r(t,e,n,r){var i;do i=m.uniqueId(r);while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i}function i(t){var e=(new y).setGraph(t.graph());return m.each(t.nodes(),function(n){e.setNode(n,t.node(n))}),m.each(t.edges(),function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),e}function o(t){var e=new y({multigraph:t.isMultigraph()}).setGraph(t.graph());return m.each(t.nodes(),function(n){t.children(n).length||e.setNode(n,t.node(n))}),m.each(t.edges(),function(n){e.setEdge(n,t.edge(n))}),e}function a(t){var e=m.map(t.nodes(),function(e){var n={};return m.each(t.outEdges(e),function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight}),n});return m.zipObject(t.nodes(),e)}function s(t){var e=m.map(t.nodes(),function(e){var n={};return m.each(t.inEdges(e),function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight}),n});return m.zipObject(t.nodes(),e)}function u(t,e){var n=t.x,r=t.y,i=e.x-n,o=e.y-r,a=t.width/2,s=t.height/2;if(!i&&!o)throw new Error("Not possible to find intersection inside of the rectangle");var u,l;return Math.abs(o)*a>Math.abs(i)*s?(o<0&&(s=-s),u=s*i/o,l=s):(i<0&&(a=-a),u=a,l=a*o/i),{x:n+u,y:r+l}}function l(t){var e=m.map(m.range(h(t)+1),function(){return[]});return m.each(t.nodes(),function(n){var r=t.node(n),i=r.rank;m.isUndefined(i)||(e[i][r.order]=n)}),e}function c(t){var e=m.min(m.map(t.nodes(),function(e){return t.node(e).rank}));m.each(t.nodes(),function(n){var r=t.node(n);m.has(r,"rank")&&(r.rank-=e)})}function f(t){var e=m.min(m.map(t.nodes(),function(e){return t.node(e).rank})),n=[];m.each(t.nodes(),function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=t.graph().nodeRankFactor;m.each(n,function(e,n){m.isUndefined(e)&&n%i!==0?--r:r&&m.each(e,function(e){t.node(e).rank+=r})})}function d(t,e,n,i){var o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=i),r(t,"border",o,e)}function h(t){return m.max(m.map(t.nodes(),function(e){var n=t.node(e).rank;if(!m.isUndefined(n))return n}))}function p(t,e){var n={lhs:[],rhs:[]};return m.each(t,function(t){e(t)?n.lhs.push(t):n.rhs.push(t)}),n}function g(t,e){var n=m.now();try{return e()}finally{console.log(t+" time: "+(m.now()-n)+"ms")}}function v(t,e){return e()}var m=t("./lodash"),y=t("./graphlib").Graph;e.exports={addDummyNode:r,simplify:i,asNonCompoundGraph:o,successorWeights:a,predecessorWeights:s,intersectRect:u,buildLayerMatrix:l,normalizeRanks:c,removeEmptyRanks:f,addBorderNode:d,maxRank:h,partition:p,time:g,notime:v}},{"./graphlib":7,"./lodash":10}],30:[function(t,e,n){e.exports="0.7.4"},{}]},{},[1])(1)}),function(t,e,n){!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):jQuery&&!jQuery.fn.qtip&&t(jQuery)}(function(r){"use strict";function i(t,e,n,i){this.id=n,this.target=t,this.tooltip=N,this.elements={target:t},this._id=V+"-"+n,this.timers={img:{}},this.options=e,this.plugins={},this.cache={event:{},target:r(),disabled:T,attr:i,onTooltip:T,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=T}function o(t){return t===N||"object"!==r.type(t)}function a(t){return!(r.isFunction(t)||t&&t.attr||t.length||"object"===r.type(t)&&(t.jquery||t.then))}function s(t){var e,n,i,s;return o(t)?T:(o(t.metadata)&&(t.metadata={type:t.metadata}),"content"in t&&(e=t.content,o(e)||e.jquery||e.done?e=t.content={text:n=a(e)?T:e}:n=e.text,"ajax"in e&&(i=e.ajax,s=i&&i.once!==T,delete e.ajax,e.text=function(t,e){var o=n||r(this).attr(e.options.content.attr)||"Loading...",a=r.ajax(r.extend({},i,{context:e})).then(i.success,N,i.error).then(function(t){return t&&s&&e.set("content.text",t),t},function(t,n,r){e.destroyed||0===t.status||e.set("content.text",n+": "+r)});return s?o:(e.set("content.text",o),a)}),"title"in e&&(r.isPlainObject(e.title)&&(e.button=e.title.button,e.title=e.title.text),a(e.title||T)&&(e.title=T))),"position"in t&&o(t.position)&&(t.position={my:t.position,at:t.position}),"show"in t&&o(t.show)&&(t.show=t.show.jquery?{target:t.show}:t.show===A?{ready:A}:{event:t.show}),"hide"in t&&o(t.hide)&&(t.hide=t.hide.jquery?{target:t.hide}:{event:t.hide}),"style"in t&&o(t.style)&&(t.style={classes:t.style}),r.each(B,function(){this.sanitize&&this.sanitize(t)}),t)}function u(t,e){for(var n,r=0,i=t,o=e.split(".");i=i[o[r++]];)r0?setTimeout(r.proxy(t,this),e):void t.call(this)}function d(t){this.tooltip.hasClass(tt)||(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=f.call(this,function(){this.toggle(A,t)},this.options.show.delay))}function h(t){if(!this.tooltip.hasClass(tt)&&!this.destroyed){var e=r(t.relatedTarget),n=e.closest(G)[0]===this.tooltip[0],i=e[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==e[0]&&"mouse"===this.options.position.target&&n||this.options.hide.fixed&&/mouse(out|leave|move)/.test(t.type)&&(n||i))try{t.preventDefault(),t.stopImmediatePropagation()}catch(o){}else this.timers.hide=f.call(this,function(){this.toggle(T,t)},this.options.hide.delay,this)}}function p(t){!this.tooltip.hasClass(tt)&&this.options.hide.inactive&&(clearTimeout(this.timers.inactive),this.timers.inactive=f.call(this,function(){this.hide(t)},this.options.hide.inactive))}function g(t){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(t)}function v(t,n,i){r(e.body).delegate(t,(n.split?n:n.join("."+V+" "))+"."+V,function(){var t=_.api[r.attr(this,U)];t&&!t.disabled&&i.apply(t,arguments)})}function m(t,n,o){var a,u,l,c,f,d=r(e.body),h=t[0]===e?d:t,p=t.metadata?t.metadata(o.metadata):N,g="html5"===o.metadata.type&&p?p[o.metadata.name]:N,v=t.data(o.metadata.name||"qtipopts");try{v="string"==typeof v?r.parseJSON(v):v}catch(m){}if(c=r.extend(A,{},_.defaults,o,"object"==typeof v?s(v):N,s(g||p)),u=c.position,c.id=n,"boolean"==typeof c.content.text){if(l=t.attr(c.content.attr),c.content.attr===T||!l)return T;c.content.text=l}if(u.container.length||(u.container=d),u.target===T&&(u.target=h),c.show.target===T&&(c.show.target=h),c.show.solo===A&&(c.show.solo=u.container.closest("body")),c.hide.target===T&&(c.hide.target=h),c.position.viewport===A&&(c.position.viewport=u.container),u.container=u.container.eq(0),u.at=new C(u.at,A),u.my=new C(u.my),t.data(V))if(c.overwrite)t.qtip("destroy",!0);else if(c.overwrite===T)return T;return t.attr(H,n),c.suppress&&(f=t.attr("title"))&&t.removeAttr("title").attr(nt,f).attr("title",""),a=new i(t,c,n,(!!l)),t.data(V,a),a}function y(t){return t.charAt(0).toUpperCase()+t.slice(1)}function b(t,e){var r,i,o=e.charAt(0).toUpperCase()+e.slice(1),a=(e+" "+mt.join(o+" ")+o).split(" "),s=0;if(vt[e])return t.css(vt[e]);for(;r=a[s++];)if((i=t.css(r))!==n)return vt[e]=r,i}function x(t,e){return Math.ceil(parseFloat(b(t,e)))}function w(t,e){this._ns="tip",this.options=e,this.offset=e.offset,this.size=[e.width,e.height],this.init(this.qtip=t)}function $(t,e){this.options=e,this._ns="-modal",this.init(this.qtip=t)}function k(t,e){this._ns="ie6",this.init(this.qtip=t)}var _,M,C,S,E,A=!0,T=!1,N=null,D="x",O="y",j="width",I="height",L="top",P="left",F="bottom",q="right",z="center",W="flipinvert",R="shift",B={},V="qtip",H="data-hasqtip",U="data-qtip-id",Y=["ui-widget","ui-tooltip"],G="."+V,X="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),Z=V+"-fixed",Q=V+"-default",K=V+"-focus",J=V+"-hover",tt=V+"-disabled",et="_replacedByqTip",nt="oldtitle",rt={ie:function(){for(var t=4,n=e.createElement("div");(n.innerHTML="")&&n.getElementsByTagName("i")[0];t+=1);return t>4?t:NaN}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||T};M=i.prototype,M._when=function(t){return r.when.apply(r,t)},M.render=function(t){if(this.rendered||this.destroyed)return this;var e,n=this,i=this.options,o=this.cache,a=this.elements,s=i.content.text,u=i.content.title,l=i.content.button,c=i.position,f=("."+this._id+" ",[]);return r.attr(this.target[0],"aria-describedby",this._id),o.posClass=this._createPosClass((this.position={my:c.my,at:c.at}).my),this.tooltip=a.tooltip=e=r("
",{id:this._id,"class":[V,Q,i.style.classes,o.posClass].join(" "),width:i.style.width||"",height:i.style.height||"",tracking:"mouse"===c.target&&c.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":T,"aria-describedby":this._id+"-content","aria-hidden":A}).toggleClass(tt,this.disabled).attr(U,this.id).data(V,this).appendTo(c.container).append(a.content=r("
",{"class":V+"-content",id:this._id+"-content","aria-atomic":A})),this.rendered=-1,this.positioning=A,u&&(this._createTitle(),r.isFunction(u)||f.push(this._updateTitle(u,T))),l&&this._createButton(),r.isFunction(s)||f.push(this._updateContent(s,T)),this.rendered=A,this._setWidget(),r.each(B,function(t){var e;"render"===this.initialize&&(e=this(n))&&(n.plugins[t]=e)}),this._unassignEvents(),this._assignEvents(),this._when(f).then(function(){n._trigger("render"),n.positioning=T,n.hiddenDuringWait||!i.show.ready&&!t||n.toggle(A,o.event,T),n.hiddenDuringWait=T}),_.api[this.id]=this,this},M.destroy=function(t){function e(){if(!this.destroyed){this.destroyed=A;var t,e=this.target,n=e.attr(nt);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),r.each(this.plugins,function(t){this.destroy&&this.destroy(); +});for(t in this.timers)clearTimeout(this.timers[t]);e.removeData(V).removeAttr(U).removeAttr(H).removeAttr("aria-describedby"),this.options.suppress&&n&&e.attr("title",n).removeAttr(nt),this._unassignEvents(),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=N,delete _.api[this.id]}}return this.destroyed?this.target:(t===A&&"hide"!==this.triggering||!this.rendered?e.call(this):(this.tooltip.one("tooltiphidden",r.proxy(e,this)),!this.triggering&&this.hide()),this.target)},S=M.checks={builtin:{"^id$":function(t,e,n,i){var o=n===A?_.nextid:n,a=V+"-"+o;o!==T&&o.length>0&&!r("#"+a).length?(this._id=a,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):t[e]=i},"^prerender":function(t,e,n){n&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(t,e,n){this._updateContent(n)},"^content.attr$":function(t,e,n,r){this.options.content.text===this.target.attr(r)&&this._updateContent(this.target.attr(n))},"^content.title$":function(t,e,n){return n?(n&&!this.elements.title&&this._createTitle(),void this._updateTitle(n)):this._removeTitle()},"^content.button$":function(t,e,n){this._updateButton(n)},"^content.title.(text|button)$":function(t,e,n){this.set("content."+e,n)},"^position.(my|at)$":function(t,e,n){"string"==typeof n&&(this.position[e]=t[e]=new C(n,"at"===e))},"^position.container$":function(t,e,n){this.rendered&&this.tooltip.appendTo(n)},"^show.ready$":function(t,e,n){n&&(!this.rendered&&this.render(A)||this.toggle(A))},"^style.classes$":function(t,e,n,r){this.rendered&&this.tooltip.removeClass(r).addClass(n)},"^style.(width|height)":function(t,e,n){this.rendered&&this.tooltip.css(e,n)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(t,e,n){this.rendered&&this.tooltip.toggleClass(Q,!!n)},"^events.(render|show|move|hide|focus|blur)$":function(t,e,n){this.rendered&&this.tooltip[(r.isFunction(n)?"":"un")+"bind"]("tooltip"+e,n)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var t=this.options.position;this.tooltip.attr("tracking","mouse"===t.target&&t.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},M.get=function(t){if(this.destroyed)return this;var e=u(this.options,t.toLowerCase()),n=e[0][e[1]];return n.precedance?n.string():n};var it=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,ot=/^prerender|show\.ready/i;M.set=function(t,e){if(this.destroyed)return this;var n,i=this.rendered,o=T,a=this.options;this.checks;return"string"==typeof t?(n=t,t={},t[n]=e):t=r.extend({},t),r.each(t,function(e,n){if(i&&ot.test(e))return void delete t[e];var s,l=u(a,e.toLowerCase());s=l[0][l[1]],l[0][l[1]]=n&&n.nodeType?r(n):n,o=it.test(e)||o,t[e]=[l[0],l[1],n,s]}),s(a),this.positioning=A,r.each(t,r.proxy(l,this)),this.positioning=T,this.rendered&&this.tooltip[0].offsetWidth>0&&o&&this.reposition("mouse"===a.position.target?N:this.cache.event),this},M._update=function(t,e,n){var i=this,o=this.cache;return this.rendered&&t?(r.isFunction(t)&&(t=t.call(this.elements.target,o.event,this)||""),r.isFunction(t.then)?(o.waiting=A,t.then(function(t){return o.waiting=T,i._update(t,e)},N,function(t){return i._update(t,e)})):t===T||!t&&""!==t?T:(t.jquery&&t.length>0?e.empty().append(t.css({display:"block",visibility:"visible"})):e.html(t),this._waitForContent(e).then(function(t){i.rendered&&i.tooltip[0].offsetWidth>0&&i.reposition(o.event,!t.length)}))):T},M._waitForContent=function(t){var e=this.cache;return e.waiting=A,(r.fn.imagesLoaded?t.imagesLoaded():r.Deferred().resolve([])).done(function(){e.waiting=T}).promise()},M._updateContent=function(t,e){this._update(t,this.elements.content,e)},M._updateTitle=function(t,e){this._update(t,this.elements.title,e)===T&&this._removeTitle(T)},M._createTitle=function(){var t=this.elements,e=this._id+"-title";t.titlebar&&this._removeTitle(),t.titlebar=r("
",{"class":V+"-titlebar "+(this.options.style.widget?c("header"):"")}).append(t.title=r("
",{id:e,"class":V+"-title","aria-atomic":A})).insertBefore(t.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(t){r(this).toggleClass("ui-state-active ui-state-focus","down"===t.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(t){r(this).toggleClass("ui-state-hover","mouseover"===t.type)}),this.options.content.button&&this._createButton()},M._removeTitle=function(t){var e=this.elements;e.title&&(e.titlebar.remove(),e.titlebar=e.title=e.button=N,t!==T&&this.reposition())},M._createPosClass=function(t){return V+"-pos-"+(t||this.options.position.my).abbrev()},M.reposition=function(n,i){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=A;var o,a,s,u,l=this.cache,c=this.tooltip,f=this.options.position,d=f.target,h=f.my,p=f.at,g=f.viewport,v=f.container,m=f.adjust,y=m.method.split(" "),b=c.outerWidth(T),x=c.outerHeight(T),w=0,$=0,k=c.css("position"),_={left:0,top:0},M=c[0].offsetWidth>0,C=n&&"scroll"===n.type,S=r(t),E=v[0].ownerDocument,N=this.mouse;if(r.isArray(d)&&2===d.length)p={x:P,y:L},_={left:d[0],top:d[1]};else if("mouse"===d)p={x:P,y:L},(!m.mouse||this.options.hide.distance)&&l.origin&&l.origin.pageX?n=l.origin:!n||n&&("resize"===n.type||"scroll"===n.type)?n=l.event:N&&N.pageX&&(n=N),"static"!==k&&(_=v.offset()),E.body.offsetWidth!==(t.innerWidth||E.documentElement.clientWidth)&&(a=r(e.body).offset()),_={left:n.pageX-_.left+(a&&a.left||0),top:n.pageY-_.top+(a&&a.top||0)},m.mouse&&C&&N&&(_.left-=(N.scrollX||0)-S.scrollLeft(),_.top-=(N.scrollY||0)-S.scrollTop());else{if("event"===d?n&&n.target&&"scroll"!==n.type&&"resize"!==n.type?l.target=r(n.target):n.target||(l.target=this.elements.target):"event"!==d&&(l.target=r(d.jquery?d:this.elements.target)),d=l.target,d=r(d).eq(0),0===d.length)return this;d[0]===e||d[0]===t?(w=rt.iOS?t.innerWidth:d.width(),$=rt.iOS?t.innerHeight:d.height(),d[0]===t&&(_={top:(g||d).scrollTop(),left:(g||d).scrollLeft()})):B.imagemap&&d.is("area")?o=B.imagemap(this,d,p,B.viewport?y:T):B.svg&&d&&d[0].ownerSVGElement?o=B.svg(this,d,p,B.viewport?y:T):(w=d.outerWidth(T),$=d.outerHeight(T),_=d.offset()),o&&(w=o.width,$=o.height,a=o.offset,_=o.position),_=this.reposition.offset(d,_,v),(rt.iOS>3.1&&rt.iOS<4.1||rt.iOS>=4.3&&rt.iOS<4.33||!rt.iOS&&"fixed"===k)&&(_.left-=S.scrollLeft(),_.top-=S.scrollTop()),(!o||o&&o.adjustable!==T)&&(_.left+=p.x===q?w:p.x===z?w/2:0,_.top+=p.y===F?$:p.y===z?$/2:0)}return _.left+=m.x+(h.x===q?-b:h.x===z?-b/2:0),_.top+=m.y+(h.y===F?-x:h.y===z?-x/2:0),B.viewport?(s=_.adjusted=B.viewport(this,_,f,w,$,b,x),a&&s.left&&(_.left+=a.left),a&&s.top&&(_.top+=a.top),s.my&&(this.position.my=s.my)):_.adjusted={left:0,top:0},l.posClass!==(u=this._createPosClass(this.position.my))&&c.removeClass(l.posClass).addClass(l.posClass=u),this._trigger("move",[_,g.elem||g],n)?(delete _.adjusted,i===T||!M||isNaN(_.left)||isNaN(_.top)||"mouse"===d||!r.isFunction(f.effect)?c.css(_):r.isFunction(f.effect)&&(f.effect.call(c,this,r.extend({},_)),c.queue(function(t){r(this).css({opacity:"",height:""}),rt.ie&&this.style.removeAttribute("filter"),t()})),this.positioning=T,this):this},M.reposition.offset=function(t,n,i){function o(t,e){n.left+=e*t.scrollLeft(),n.top+=e*t.scrollTop()}if(!i[0])return n;var a,s,u,l,c=r(t[0].ownerDocument),f=!!rt.ie&&"CSS1Compat"!==e.compatMode,d=i[0];do"static"!==(s=r.css(d,"position"))&&("fixed"===s?(u=d.getBoundingClientRect(),o(c,-1)):(u=r(d).position(),u.left+=parseFloat(r.css(d,"borderLeftWidth"))||0,u.top+=parseFloat(r.css(d,"borderTopWidth"))||0),n.left-=u.left+(parseFloat(r.css(d,"marginLeft"))||0),n.top-=u.top+(parseFloat(r.css(d,"marginTop"))||0),a||"hidden"===(l=r.css(d,"overflow"))||"visible"===l||(a=r(d)));while(d=d.offsetParent);return a&&(a[0]!==c[0]||f)&&o(a,1),n};var at=(C=M.reposition.Corner=function(t,e){t=(""+t).replace(/([A-Z])/," $1").replace(/middle/gi,z).toLowerCase(),this.x=(t.match(/left|right/i)||t.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(t.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!e;var n=t.charAt(0);this.precedance="t"===n||"b"===n?O:D}).prototype;at.invert=function(t,e){this[t]=this[t]===P?q:this[t]===q?P:e||this[t]},at.string=function(t){var e=this.x,n=this.y,r=e!==n?"center"===e||"center"!==n&&(this.precedance===O||this.forceY)?[n,e]:[e,n]:[e];return t!==!1?r.join(" "):r},at.abbrev=function(){var t=this.string(!1);return t[0].charAt(0)+(t[1]&&t[1].charAt(0)||"")},at.clone=function(){return new C(this.string(),this.forceY)},M.toggle=function(t,n){var i=this.cache,o=this.options,a=this.tooltip;if(n){if(/over|enter/.test(n.type)&&i.event&&/out|leave/.test(i.event.type)&&o.show.target.add(n.target).length===o.show.target.length&&a.has(n.relatedTarget).length)return this;i.event=r.event.fix(n)}if(this.waiting&&!t&&(this.hiddenDuringWait=A),!this.rendered)return t?this.render(1):this;if(this.destroyed||this.disabled)return this;var s,u,l,c=t?"show":"hide",f=this.options[c],d=(this.options[t?"hide":"show"],this.options.position),h=this.options.content,p=this.tooltip.css("width"),g=this.tooltip.is(":visible"),v=t||1===f.target.length,m=!n||f.target.length<2||i.target[0]===n.target;return(typeof t).search("boolean|number")&&(t=!g),s=!a.is(":animated")&&g===t&&m,u=s?N:!!this._trigger(c,[90]),this.destroyed?this:(u!==T&&t&&this.focus(n),!u||s?this:(r.attr(a[0],"aria-hidden",!t),t?(this.mouse&&(i.origin=r.event.fix(this.mouse)),r.isFunction(h.text)&&this._updateContent(h.text,T),r.isFunction(h.title)&&this._updateTitle(h.title,T),!E&&"mouse"===d.target&&d.adjust.mouse&&(r(e).bind("mousemove."+V,this._storeMouse),E=A),p||a.css("width",a.outerWidth(T)),this.reposition(n,arguments[2]),p||a.css("width",""),f.solo&&("string"==typeof f.solo?r(f.solo):r(G,f.solo)).not(a).not(f.target).qtip("hide",r.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete i.origin,E&&!r(G+'[tracking="true"]:visible',f.solo).not(a).length&&(r(e).unbind("mousemove."+V),E=T),this.blur(n)),l=r.proxy(function(){t?(rt.ie&&a[0].style.removeAttribute("filter"),a.css("overflow",""),"string"==typeof f.autofocus&&r(this.options.show.autofocus,a).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):a.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(t?"visible":"hidden")},this),f.effect===T||v===T?(a[c](),l()):r.isFunction(f.effect)?(a.stop(1,1),f.effect.call(a,this),a.queue("fx",function(t){l(),t()})):a.fadeTo(90,t?1:0,l),t&&f.target.trigger("qtip-"+this.id+"-inactive"),this))},M.show=function(t){return this.toggle(A,t)},M.hide=function(t){return this.toggle(T,t)},M.focus=function(t){if(!this.rendered||this.destroyed)return this;var e=r(G),n=this.tooltip,i=parseInt(n[0].style.zIndex,10),o=_.zindex+e.length;return n.hasClass(K)||this._trigger("focus",[o],t)&&(i!==o&&(e.each(function(){this.style.zIndex>i&&(this.style.zIndex=this.style.zIndex-1)}),e.filter("."+K).qtip("blur",t)),n.addClass(K)[0].style.zIndex=o),this},M.blur=function(t){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(K),this._trigger("blur",[this.tooltip.css("zIndex")],t),this)},M.disable=function(t){return this.destroyed?this:("toggle"===t?t=!(this.rendered?this.tooltip.hasClass(tt):this.disabled):"boolean"!=typeof t&&(t=A),this.rendered&&this.tooltip.toggleClass(tt,t).attr("aria-disabled",t),this.disabled=!!t,this)},M.enable=function(){return this.disable(T)},M._createButton=function(){var t=this,e=this.elements,n=e.tooltip,i=this.options.content.button,o="string"==typeof i,a=o?i:"Close tooltip";e.button&&e.button.remove(),i.jquery?e.button=i:e.button=r("",{"class":"qtip-close "+(this.options.style.widget?"":V+"-icon"),title:a,"aria-label":a}).prepend(r("",{"class":"ui-icon ui-icon-close",html:"×"})),e.button.appendTo(e.titlebar||n).attr("role","button").click(function(e){return n.hasClass(tt)||t.hide(e),T})},M._updateButton=function(t){if(!this.rendered)return T;var e=this.elements.button;t?this._createButton():e.remove()},M._setWidget=function(){var t=this.options.style.widget,e=this.elements,n=e.tooltip,r=n.hasClass(tt);n.removeClass(tt),tt=t?"ui-state-disabled":"qtip-disabled",n.toggleClass(tt,r),n.toggleClass("ui-helper-reset "+c(),t).toggleClass(Q,this.options.style.def&&!t),e.content&&e.content.toggleClass(c("content"),t),e.titlebar&&e.titlebar.toggleClass(c("header"),t),e.button&&e.button.toggleClass(V+"-icon",!t)},M._storeMouse=function(t){return(this.mouse=r.event.fix(t)).type="mousemove",this},M._bind=function(t,e,n,i,o){if(t&&n&&e.length){var a="."+this._id+(i?"-"+i:"");return r(t).bind((e.split?e:e.join(a+" "))+a,r.proxy(n,o||this)),this}},M._unbind=function(t,e){return t&&r(t).unbind("."+this._id+(e?"-"+e:"")),this},M._trigger=function(t,e,n){var i=r.Event("tooltip"+t);return i.originalEvent=n&&r.extend({},n)||this.cache.event||N,this.triggering=t,this.tooltip.trigger(i,[this].concat(e||[])),this.triggering=T,!i.isDefaultPrevented()},M._bindEvents=function(t,e,n,i,o,a){var s=n.filter(i).add(i.filter(n)),u=[];s.length&&(r.each(e,function(e,n){var i=r.inArray(n,t);i>-1&&u.push(t.splice(i,1)[0])}),u.length&&(this._bind(s,u,function(t){var e=!!this.rendered&&this.tooltip[0].offsetWidth>0;(e?a:o).call(this,t)}),n=n.not(s),i=i.not(s))),this._bind(n,t,o),this._bind(i,e,a)},M._assignInitialEvents=function(t){function e(t){return this.disabled||this.destroyed?T:(this.cache.event=t&&r.event.fix(t),this.cache.target=t&&r(t.target),clearTimeout(this.timers.show),void(this.timers.show=f.call(this,function(){this.render("object"==typeof t||n.show.ready)},n.prerender?0:n.show.delay)))}var n=this.options,i=n.show.target,o=n.hide.target,a=n.show.event?r.trim(""+n.show.event).split(" "):[],s=n.hide.event?r.trim(""+n.hide.event).split(" "):[];this._bind(this.elements.target,["remove","removeqtip"],function(t){this.destroy(!0)},"destroy"),/mouse(over|enter)/i.test(n.show.event)&&!/mouse(out|leave)/i.test(n.hide.event)&&s.push("mouseleave"),this._bind(i,"mousemove",function(t){this._storeMouse(t),this.cache.onTarget=A}),this._bindEvents(a,s,i,o,e,function(){return this.timers?void clearTimeout(this.timers.show):T}),(n.show.ready||n.prerender)&&e.call(this,t)},M._assignEvents=function(){var n=this,i=this.options,o=i.position,a=this.tooltip,s=i.show.target,u=i.hide.target,l=o.container,c=o.viewport,f=r(e),v=(r(e.body),r(t)),m=i.show.event?r.trim(""+i.show.event).split(" "):[],y=i.hide.event?r.trim(""+i.hide.event).split(" "):[];r.each(i.events,function(t,e){n._bind(a,"toggle"===t?["tooltipshow","tooltiphide"]:["tooltip"+t],e,null,a)}),/mouse(out|leave)/i.test(i.hide.event)&&"window"===i.hide.leave&&this._bind(f,["mouseout","blur"],function(t){/select|option/.test(t.target.nodeName)||t.relatedTarget||this.hide(t)}),i.hide.fixed?u=u.add(a.addClass(Z)):/mouse(over|enter)/i.test(i.show.event)&&this._bind(u,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+i.hide.event).indexOf("unfocus")>-1&&this._bind(l.closest("html"),["mousedown","touchstart"],function(t){var e=r(t.target),n=this.rendered&&!this.tooltip.hasClass(tt)&&this.tooltip[0].offsetWidth>0,i=e.parents(G).filter(this.tooltip[0]).length>0;e[0]===this.target[0]||e[0]===this.tooltip[0]||i||this.target.has(e[0]).length||!n||this.hide(t)}),"number"==typeof i.hide.inactive&&(this._bind(s,"qtip-"+this.id+"-inactive",p,"inactive"),this._bind(u.add(a),_.inactiveEvents,p)),this._bindEvents(m,y,s,u,d,h),this._bind(s.add(a),"mousemove",function(t){if("number"==typeof i.hide.distance){var e=this.cache.origin||{},n=this.options.hide.distance,r=Math.abs;(r(t.pageX-e.pageX)>=n||r(t.pageY-e.pageY)>=n)&&this.hide(t)}this._storeMouse(t)}),"mouse"===o.target&&o.adjust.mouse&&(i.hide.event&&this._bind(s,["mouseenter","mouseleave"],function(t){return this.cache?void(this.cache.onTarget="mouseenter"===t.type):T}),this._bind(f,"mousemove",function(t){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(tt)&&this.tooltip[0].offsetWidth>0&&this.reposition(t)})),(o.adjust.resize||c.length)&&this._bind(r.event.special.resize?c:v,"resize",g),o.adjust.scroll&&this._bind(v.add(o.container),"scroll",g)},M._unassignEvents=function(){var n=this.options,i=n.show.target,o=n.hide.target,a=r.grep([this.elements.target[0],this.rendered&&this.tooltip[0],n.position.container[0],n.position.viewport[0],n.position.container.closest("html")[0],t,e],function(t){return"object"==typeof t});i&&i.toArray&&(a=a.concat(i.toArray())),o&&o.toArray&&(a=a.concat(o.toArray())),this._unbind(a)._unbind(a,"destroy")._unbind(a,"inactive")},r(function(){v(G,["mouseenter","mouseleave"],function(t){var e="mouseenter"===t.type,n=r(t.currentTarget),i=r(t.relatedTarget||t.target),o=this.options;e?(this.focus(t),n.hasClass(Z)&&!n.hasClass(tt)&&clearTimeout(this.timers.hide)):"mouse"===o.position.target&&o.position.adjust.mouse&&o.hide.event&&o.show.target&&!i.closest(o.show.target[0]).length&&this.hide(t),n.toggleClass(J,e)}),v("["+U+"]",X,p)}),_=r.fn.qtip=function(t,e,i){var o=(""+t).toLowerCase(),a=N,u=r.makeArray(arguments).slice(1),l=u[u.length-1],c=this[0]?r.data(this[0],V):N;return!arguments.length&&c||"api"===o?c:"string"==typeof t?(this.each(function(){var t=r.data(this,V);if(!t)return A;if(l&&l.timeStamp&&(t.cache.event=l),!e||"option"!==o&&"options"!==o)t[o]&&t[o].apply(t,u);else{if(i===n&&!r.isPlainObject(e))return a=t.get(e),T;t.set(e,i)}}),a!==N?a:this):"object"!=typeof t&&arguments.length?void 0:(c=s(r.extend(A,{},t)),this.each(function(t){var e,n;return n=r.isArray(c.id)?c.id[t]:c.id,n=!n||n===T||n.length<1||_.api[n]?_.nextid++:n,e=m(r(this),n,c),e===T?A:(_.api[n]=e,r.each(B,function(){"initialize"===this.initialize&&this(e)}),void e._assignInitialEvents(l))}))},r.qtip=i,_.api={},r.each({attr:function(t,e){if(this.length){var n=this[0],i="title",o=r.data(n,"qtip");if(t===i&&o&&"object"==typeof o&&o.options.suppress)return arguments.length<2?r.attr(n,nt):(o&&o.options.content.attr===i&&o.cache.attr&&o.set("content.text",e),this.attr(nt,e))}return r.fn["attr"+et].apply(this,arguments)},clone:function(t){var e=(r([]),r.fn["clone"+et].apply(this,arguments));return t||e.filter("["+nt+"]").attr("title",function(){return r.attr(this,nt)}).removeAttr(nt),e}},function(t,e){if(!e||r.fn[t+et])return A;var n=r.fn[t+et]=r.fn[t];r.fn[t]=function(){return e.apply(this,arguments)||n.apply(this,arguments)}}),r.ui||(r["cleanData"+et]=r.cleanData,r.cleanData=function(t){for(var e,n=0;(e=r(t[n])).length;n++)if(e.attr(H))try{e.triggerHandler("removeqtip")}catch(i){}r["cleanData"+et].apply(this,arguments)}),_.version="2.2.1",_.nextid=0,_.inactiveEvents=X,_.zindex=15e3,_.defaults={prerender:T,id:T,overwrite:A,suppress:A,content:{text:A,attr:"title",title:T,button:T},position:{my:"top left",at:"bottom right",target:T,container:T,viewport:T,adjust:{x:0,y:0,mouse:A,scroll:A,resize:A,method:"flipinvert flipinvert"},effect:function(t,e,n){r(this).animate(e,{duration:200,queue:T})}},show:{target:T,event:"mouseenter",effect:A,delay:90,solo:T,ready:T,autofocus:T},hide:{target:T,event:"mouseleave",effect:A,delay:0,fixed:T,inactive:T,leave:"window",distance:T},style:{classes:"",widget:T,width:T,height:T,def:A},events:{render:N,move:N,show:N,hide:N,toggle:N,visible:N,hidden:N,focus:N,blur:N}};var st,ut="margin",lt="border",ct="color",ft="background-color",dt="transparent",ht=" !important",pt=!!e.createElement("canvas").getContext,gt=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,vt={},mt=["Webkit","O","Moz","ms"];if(pt)var yt=t.devicePixelRatio||1,bt=function(){var t=e.createElement("canvas").getContext("2d");return t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||1}(),xt=yt/bt;else var wt=function(t,e,n){return"'};r.extend(w.prototype,{init:function(t){var e,n;n=this.element=t.elements.tip=r("
",{"class":V+"-tip"}).prependTo(t.tooltip),pt?(e=r("").appendTo(this.element)[0].getContext("2d"),e.lineJoin="miter",e.miterLimit=1e5,e.save()):(e=wt("shape",'coordorigin="0,0"',"position:absolute;"),this.element.html(e+e),t._bind(r("*",n).add(n),["click","mousedown"],function(t){t.stopPropagation()},this._ns)),t._bind(t.tooltip,"tooltipmove",this.reposition,this._ns,this),this.create()},_swapDimensions:function(){this.size[0]=this.options.height,this.size[1]=this.options.width},_resetDimensions:function(){this.size[0]=this.options.width,this.size[1]=this.options.height},_useTitle:function(t){var e=this.qtip.elements.titlebar;return e&&(t.y===L||t.y===z&&this.element.position().top+this.size[1]/2+this.options.offset-1),left:l[0]-l[2]*Number(o===D),top:l[1]-l[2]*Number(o===O),width:c[0]+f,height:c[1]+f}).each(function(t){var e=r(this);e[e.prop?"prop":"attr"]({coordsize:c[0]+f+" "+(c[1]+f),path:s,fillcolor:i[0],filled:!!t,stroked:!t}).toggle(!(!f&&!t)),!t&&e.html(wt("stroke",'weight="'+2*f+'px" color="'+i[1]+'" miterlimit="1000" joinstyle="miter"'))})),t.opera&&setTimeout(function(){d.tip.css({display:"inline-block",visibility:"visible"})},1),n!==T&&this.calculate(e,c)},calculate:function(t,e){if(!this.enabled)return T;var n,i,o=this,a=this.qtip.elements,s=this.element,u=this.options.offset,l=(a.tooltip.hasClass("ui-widget"),{});return t=t||this.corner,n=t.precedance,e=e||this._calculateSize(t),i=[t.x,t.y],n===D&&i.reverse(),r.each(i,function(r,i){var s,c,f;i===z?(s=n===O?P:L,l[s]="50%",l[ut+"-"+s]=-Math.round(e[n===O?0:1]/2)+u):(s=o._parseWidth(t,i,a.tooltip),c=o._parseWidth(t,i,a.content),f=o._parseRadius(t),l[i]=Math.max(-o.border,r?c:u+(f>s?f:-s)))}),l[t[n]]-=e[n===D?0:1],s.css({margin:"",top:"",bottom:"",left:"",right:""}).css(l),l},reposition:function(t,e,r,i){function o(t,e,n,r,i){t===R&&c.precedance===e&&f[r]&&c[n]!==z?c.precedance=c.precedance===D?O:D:t!==R&&f[r]&&(c[e]=c[e]===z?f[r]>0?r:i:c[e]===r?i:r)}function a(t,e,i){c[t]===z?v[ut+"-"+e]=g[t]=s[ut+"-"+e]-f[e]:(u=s[i]!==n?[f[e],-s[e]]:[-f[e],s[e]],(g[t]=Math.max(u[0],u[1]))>u[0]&&(r[e]-=f[e],g[e]=T),v[s[i]!==n?i:e]=g[t])}if(this.enabled){var s,u,l=e.cache,c=this.corner.clone(),f=r.adjusted,d=e.options.position.adjust.method.split(" "),h=d[0],p=d[1]||d[0],g={left:T,top:T,x:0,y:0},v={};this.corner.fixed!==A&&(o(h,D,O,P,q),o(p,O,D,L,F),c.string()===l.corner.string()&&l.cornerTop===f.top&&l.cornerLeft===f.left||this.update(c,T)),s=this.calculate(c),s.right!==n&&(s.left=-s.right),s.bottom!==n&&(s.top=-s.bottom),s.user=this.offset,(g.left=h===R&&!!f.left)&&a(D,P,q),(g.top=p===R&&!!f.top)&&a(O,L,F),this.element.css(v).toggle(!(g.x&&g.y||c.x===z&&g.y||c.y===z&&g.x)),r.left-=s.left.charAt?s.user:h!==R||g.top||!g.left&&!g.top?s.left+this.border:0,r.top-=s.top.charAt?s.user:p!==R||g.left||!g.left&&!g.top?s.top+this.border:0,l.cornerLeft=f.left,l.cornerTop=f.top,l.corner=c.clone()}},destroy:function(){this.qtip._unbind(this.qtip.tooltip,this._ns),this.qtip.elements.tip&&this.qtip.elements.tip.find("*").remove().end().remove()}}),st=B.tip=function(t){return new w(t,t.options.style.tip)},st.initialize="render",st.sanitize=function(t){if(t.style&&"tip"in t.style){var e=t.style.tip;"object"!=typeof e&&(e=t.style.tip={corner:e}),/string|boolean/i.test(typeof e.corner)||(e.corner=A)}},S.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){this.create(),this.qtip.reposition()},"^style.tip.(height|width)$":function(t){this.size=[t.width,t.height],this.update(),this.qtip.reposition()},"^content.title|style.(classes|widget)$":function(){this.update()}},r.extend(A,_.defaults,{style:{tip:{corner:A,mimic:T,width:6,height:6,border:A,offset:0}}});var $t,kt,_t="qtip-modal",Mt="."+_t;kt=function(){function t(t){if(r.expr[":"].focusable)return r.expr[":"].focusable;var e,n,i,o=!isNaN(r.attr(t,"tabindex")),a=t.nodeName&&t.nodeName.toLowerCase();return"area"===a?(e=t.parentNode,n=e.name,!(!t.href||!n||"map"!==e.nodeName.toLowerCase())&&(i=r("img[usemap=#"+n+"]")[0],!!i&&i.is(":visible"))):/input|select|textarea|button|object/.test(a)?!t.disabled:"a"===a?t.href||o:o}function n(t){c.length<1&&t.length?t.not("body").blur():c.first().focus()}function i(t){if(u.is(":visible")){var e,i=r(t.target),s=o.tooltip,l=i.closest(G);e=l.length<1?T:parseInt(l[0].style.zIndex,10)>parseInt(s[0].style.zIndex,10),e||i.closest(G)[0]===s[0]||n(i),a=t.target===c[c.length-1]}}var o,a,s,u,l=this,c={};r.extend(l,{init:function(){return u=l.elem=r("
",{id:"qtip-overlay",html:"
",mousedown:function(){return T}}).hide(),r(e.body).bind("focusin"+Mt,i),r(e).bind("keydown"+Mt,function(t){o&&o.options.show.modal.escape&&27===t.keyCode&&o.hide(t)}),u.bind("click"+Mt,function(t){o&&o.options.show.modal.blur&&o.hide(t)}),l},update:function(e){o=e,c=e.options.show.modal.stealfocus!==T?e.tooltip.find("*").filter(function(){return t(this)}):[]},toggle:function(t,i,a){var c=(r(e.body),t.tooltip),f=t.options.show.modal,d=f.effect,h=i?"show":"hide",p=u.is(":visible"),g=r(Mt).filter(":visible:not(:animated)").not(c);return l.update(t),i&&f.stealfocus!==T&&n(r(":focus")),u.toggleClass("blurs",f.blur),i&&u.appendTo(e.body),u.is(":animated")&&p===i&&s!==T||!i&&g.length?l:(u.stop(A,T),r.isFunction(d)?d.call(u,i):d===T?u[h]():u.fadeTo(parseInt(a,10)||90,i?1:0,function(){i||u.hide()}),i||u.queue(function(t){u.css({left:"",top:""}),r(Mt).length||u.detach(),t()}),s=i,o.destroyed&&(o=N),l)}}),l.init()},kt=new kt,r.extend($.prototype,{init:function(t){var e=t.tooltip;return this.options.on?(t.elements.overlay=kt.elem,e.addClass(_t).css("z-index",_.modal_zindex+r(Mt).length),t._bind(e,["tooltipshow","tooltiphide"],function(t,n,i){var o=t.originalEvent;if(t.target===e[0])if(o&&"tooltiphide"===t.type&&/mouse(leave|enter)/.test(o.type)&&r(o.relatedTarget).closest(kt.elem[0]).length)try{t.preventDefault()}catch(a){}else(!o||o&&"tooltipsolo"!==o.type)&&this.toggle(t,"tooltipshow"===t.type,i)},this._ns,this),t._bind(e,"tooltipfocus",function(t,n){if(!t.isDefaultPrevented()&&t.target===e[0]){var i=r(Mt),o=_.modal_zindex+i.length,a=parseInt(e[0].style.zIndex,10);kt.elem[0].style.zIndex=o-1,i.each(function(){this.style.zIndex>a&&(this.style.zIndex-=1)}),i.filter("."+K).qtip("blur",t.originalEvent),e.addClass(K)[0].style.zIndex=o,kt.update(n);try{t.preventDefault()}catch(s){}}},this._ns,this),void t._bind(e,"tooltiphide",function(t){t.target===e[0]&&r(Mt).filter(":visible").not(e).last().qtip("focus",t)},this._ns,this)):this},toggle:function(t,e,n){return t&&t.isDefaultPrevented()?this:void kt.toggle(this.qtip,!!e,n)},destroy:function(){this.qtip.tooltip.removeClass(_t),this.qtip._unbind(this.qtip.tooltip,this._ns),kt.toggle(this.qtip,T),delete this.qtip.elements.overlay}}),$t=B.modal=function(t){return new $(t,t.options.show.modal)},$t.sanitize=function(t){t.show&&("object"!=typeof t.show.modal?t.show.modal={on:!!t.show.modal}:"undefined"==typeof t.show.modal.on&&(t.show.modal.on=A))},_.modal_zindex=_.zindex-200,$t.initialize="render",S.modal={"^show.modal.(on|blur)$":function(){this.destroy(),this.init(),this.qtip.elems.overlay.toggle(this.qtip.tooltip[0].offsetWidth>0)}},r.extend(A,_.defaults,{show:{modal:{on:T,effect:A,blur:A,stealfocus:A,escape:A}}}),B.viewport=function(n,r,i,o,a,s,u){function l(t,e,n,i,o,a,s,u,l){var c=r[o],y=x[t],b=w[t],$=n===R,k=y===o?l:y===a?-l:-l/2,_=b===o?u:b===a?-u:-u/2,M=v[o]+m[o]-(h?0:d[o]),C=M-c,S=c+l-(s===j?p:g)-M,E=k-(x.precedance===t||y===x[e]?_:0)-(b===z?u/2:0);return $?(E=(y===o?1:-1)*k,r[o]+=C>0?C:S>0?-S:0,r[o]=Math.max(-d[o]+m[o],c-E,Math.min(Math.max(-d[o]+m[o]+(s===j?p:g),c+E),r[o],"center"===y?c-k:1e9))):(i*=n===W?2:0,C>0&&(y!==o||S>0)?(r[o]-=E+i,f.invert(t,o)):S>0&&(y!==a||C>0)&&(r[o]-=(y===z?-E:E)+i,f.invert(t,a)),r[o]S&&(r[o]=c,f=x.clone())),r[o]-c}var c,f,d,h,p,g,v,m,y=i.target,b=n.elements.tooltip,x=i.my,w=i.at,$=i.adjust,k=$.method.split(" "),_=k[0],M=k[1]||k[0],C=i.viewport,S=i.container,E=(n.cache,{left:0,top:0});return C.jquery&&y[0]!==t&&y[0]!==e.body&&"none"!==$.method?(d=S.offset()||E,h="static"===S.css("position"),c="fixed"===b.css("position"),p=C[0]===t?C.width():C.outerWidth(T),g=C[0]===t?C.height():C.outerHeight(T),v={left:c?0:C.scrollLeft(),top:c?0:C.scrollTop()},m=C.offset()||E,"shift"===_&&"shift"===M||(f=x.clone()),E={left:"none"!==_?l(D,O,_,$.x,P,q,j,o,s):0,top:"none"!==M?l(O,D,M,$.y,L,F,I,a,u):0,my:f}):E},B.polys={polygon:function(t,e){var n,r,i,o={width:0,height:0,position:{top:1e10,right:0,bottom:0,left:1e10},adjustable:T},a=0,s=[],u=1,l=1,c=0,f=0;for(a=t.length;a--;)n=[parseInt(t[--a],10),parseInt(t[a+1],10)], +n[0]>o.position.right&&(o.position.right=n[0]),n[0]o.position.bottom&&(o.position.bottom=n[1]),n[1]0&&i>0&&u>0&&l>0;)for(r=Math.floor(r/2),i=Math.floor(i/2),e.x===P?u=r:e.x===q?u=o.width-r:u+=Math.floor(r/2),e.y===L?l=i:e.y===F?l=o.height-i:l+=Math.floor(i/2),a=s.length;a--&&!(s.length<2);)c=s[a][0]-o.position.left,f=s[a][1]-o.position.top,(e.x===P&&c>=u||e.x===q&&c<=u||e.x===z&&(co.width-u)||e.y===L&&f>=l||e.y===F&&f<=l||e.y===z&&(fo.height-l))&&s.splice(a,1);o.position={left:s[0][0],top:s[0][1]}}return o},rect:function(t,e,n,r){return{width:Math.abs(n-t),height:Math.abs(r-e),position:{left:Math.min(t,n),top:Math.min(e,r)}}},_angles:{tc:1.5,tr:7/4,tl:5/4,bc:.5,br:.25,bl:.75,rc:2,lc:1,c:0},ellipse:function(t,e,n,r,i){var o=B.polys._angles[i.abbrev()],a=0===o?0:n*Math.cos(o*Math.PI),s=r*Math.sin(o*Math.PI);return{width:2*n-Math.abs(a),height:2*r-Math.abs(s),position:{left:t+a,top:e+s},adjustable:T}},circle:function(t,e,n,r){return B.polys.ellipse(t,e,n,n,r)}},B.svg=function(t,n,i){for(var o,a,s,u,l,c,f,d,h,p=(r(e),n[0]),g=r(p.ownerSVGElement),v=p.ownerDocument,m=(parseInt(n.css("stroke-width"),10)||0)/2;!p.getBBox;)p=p.parentNode;if(!p.getBBox||!p.parentNode)return T;switch(p.nodeName){case"ellipse":case"circle":d=B.polys.ellipse(p.cx.baseVal.value,p.cy.baseVal.value,(p.rx||p.r).baseVal.value+m,(p.ry||p.r).baseVal.value+m,i);break;case"line":case"polygon":case"polyline":for(f=p.points||[{x:p.x1.baseVal.value,y:p.y1.baseVal.value},{x:p.x2.baseVal.value,y:p.y2.baseVal.value}],d=[],c=-1,u=f.numberOfItems||f.length;++c';r.extend(k.prototype,{_scroll:function(){var e=this.qtip.elements.overlay;e&&(e[0].style.top=r(t).scrollTop()+"px")},init:function(n){var i=n.tooltip;r("select, object").length<1&&(this.bgiframe=n.elements.bgiframe=r(St).appendTo(i),n._bind(i,"tooltipmove",this.adjustBGIFrame,this._ns,this)),this.redrawContainer=r("
",{id:V+"-rcontainer"}).appendTo(e.body),n.elements.overlay&&n.elements.overlay.addClass("qtipmodal-ie6fix")&&(n._bind(t,["scroll","resize"],this._scroll,this._ns,this),n._bind(i,["tooltipshow"],this._scroll,this._ns,this)),this.redraw()},adjustBGIFrame:function(){var t,e,n=this.qtip.tooltip,r={height:n.outerHeight(T),width:n.outerWidth(T)},i=this.qtip.plugins.tip,o=this.qtip.elements.tip;e=parseInt(n.css("borderLeftWidth"),10)||0,e={left:-e,top:-e},i&&o&&(t="x"===i.corner.precedance?[j,P]:[I,L],e[t[1]]-=o[t[0]]()),this.bgiframe.css(e).css(r)},redraw:function(){if(this.qtip.rendered<1||this.drawing)return this;var t,e,n,r,i=this.qtip.tooltip,o=this.qtip.options.style,a=this.qtip.options.position.container;return this.qtip.drawing=1,o.height&&i.css(I,o.height),o.width?i.css(j,o.width):(i.css(j,"").appendTo(this.redrawContainer),e=i.width(),e%2<1&&(e+=1),n=i.css("maxWidth")||"",r=i.css("minWidth")||"",t=(n+r).indexOf("%")>-1?a.width()/100:0,n=(n.indexOf("%")>-1?t:1)*parseInt(n,10)||e,r=(r.indexOf("%")>-1?t:1)*parseInt(r,10)||0,e=n+r?Math.min(Math.max(e,r),n):e,i.css(j,Math.round(e)).appendTo(a)),this.drawing=0,this},destroy:function(){this.bgiframe&&this.bgiframe.remove(),this.qtip._unbind([t,this.qtip.tooltip],this._ns)}}),Ct=B.ie6=function(t){return 6===rt.ie?new k(t):T},Ct.initialize="render",S.ie6={"^content|style$":function(){this.redraw()}}})}(window,document),function(t,e,n){!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):jQuery&&!jQuery.fn.qtip&&t(jQuery)}(function(r){"use strict";function i(t,e,n,i){this.id=n,this.target=t,this.tooltip=M,this.elements={target:t},this._id=j+"-"+n,this.timers={img:{}},this.options=e,this.plugins={},this.cache={event:{},target:r(),disabled:_,attr:i,onTooltip:_,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=_}function o(t){return t===M||"object"!==r.type(t)}function a(t){return!(r.isFunction(t)||t&&t.attr||t.length||"object"===r.type(t)&&(t.jquery||t.then))}function s(t){var e,n,i,s;return o(t)?_:(o(t.metadata)&&(t.metadata={type:t.metadata}),"content"in t&&(e=t.content,o(e)||e.jquery||e.done?e=t.content={text:n=a(e)?_:e}:n=e.text,"ajax"in e&&(i=e.ajax,s=i&&i.once!==_,delete e.ajax,e.text=function(t,e){var o=n||r(this).attr(e.options.content.attr)||"Loading...",a=r.ajax(r.extend({},i,{context:e})).then(i.success,M,i.error).then(function(t){return t&&s&&e.set("content.text",t),t},function(t,n,r){e.destroyed||0===t.status||e.set("content.text",n+": "+r)});return s?o:(e.set("content.text",o),a)}),"title"in e&&(r.isPlainObject(e.title)&&(e.button=e.title.button,e.title=e.title.text),a(e.title||_)&&(e.title=_))),"position"in t&&o(t.position)&&(t.position={my:t.position,at:t.position}),"show"in t&&o(t.show)&&(t.show=t.show.jquery?{target:t.show}:t.show===k?{ready:k}:{event:t.show}),"hide"in t&&o(t.hide)&&(t.hide=t.hide.jquery?{target:t.hide}:{event:t.hide}),"style"in t&&o(t.style)&&(t.style={classes:t.style}),r.each(O,function(){this.sanitize&&this.sanitize(t)}),t)}function u(t,e){for(var n,r=0,i=t,o=e.split(".");i=i[o[r++]];)r0?setTimeout(r.proxy(t,this),e):void t.call(this)}function d(t){this.tooltip.hasClass(V)||(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=f.call(this,function(){this.toggle(k,t)},this.options.show.delay))}function h(t){if(!this.tooltip.hasClass(V)&&!this.destroyed){var e=r(t.relatedTarget),n=e.closest(F)[0]===this.tooltip[0],i=e[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==e[0]&&"mouse"===this.options.position.target&&n||this.options.hide.fixed&&/mouse(out|leave|move)/.test(t.type)&&(n||i))try{t.preventDefault(),t.stopImmediatePropagation()}catch(o){}else this.timers.hide=f.call(this,function(){this.toggle(_,t)},this.options.hide.delay,this)}}function p(t){!this.tooltip.hasClass(V)&&this.options.hide.inactive&&(clearTimeout(this.timers.inactive),this.timers.inactive=f.call(this,function(){this.hide(t)},this.options.hide.inactive))}function g(t){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(t)}function v(t,n,i){r(e.body).delegate(t,(n.split?n:n.join("."+j+" "))+"."+j,function(){var t=y.api[r.attr(this,L)];t&&!t.disabled&&i.apply(t,arguments)})}function m(t,n,o){var a,u,l,c,f,d=r(e.body),h=t[0]===e?d:t,p=t.metadata?t.metadata(o.metadata):M,g="html5"===o.metadata.type&&p?p[o.metadata.name]:M,v=t.data(o.metadata.name||"qtipopts");try{v="string"==typeof v?r.parseJSON(v):v}catch(m){}if(c=r.extend(k,{},y.defaults,o,"object"==typeof v?s(v):M,s(g||p)),u=c.position,c.id=n,"boolean"==typeof c.content.text){if(l=t.attr(c.content.attr),c.content.attr===_||!l)return _;c.content.text=l}if(u.container.length||(u.container=d),u.target===_&&(u.target=h),c.show.target===_&&(c.show.target=h),c.show.solo===k&&(c.show.solo=u.container.closest("body")),c.hide.target===_&&(c.hide.target=h),c.position.viewport===k&&(c.position.viewport=u.container),u.container=u.container.eq(0),u.at=new x(u.at,k),u.my=new x(u.my),t.data(j))if(c.overwrite)t.qtip("destroy",!0);else if(c.overwrite===_)return _;return t.attr(I,n),c.suppress&&(f=t.attr("title"))&&t.removeAttr("title").attr(U,f).attr("title",""),a=new i(t,c,n,(!!l)),t.data(j,a),a}var y,b,x,w,$,k=!0,_=!1,M=null,C="x",S="y",E="top",A="left",T="bottom",N="right",D="center",O={},j="qtip",I="data-hasqtip",L="data-qtip-id",P=["ui-widget","ui-tooltip"],F="."+j,q="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),z=j+"-fixed",W=j+"-default",R=j+"-focus",B=j+"-hover",V=j+"-disabled",H="_replacedByqTip",U="oldtitle",Y={ie:function(){for(var t=4,n=e.createElement("div");(n.innerHTML="")&&n.getElementsByTagName("i")[0];t+=1);return t>4?t:NaN}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||_};b=i.prototype,b._when=function(t){return r.when.apply(r,t)},b.render=function(t){if(this.rendered||this.destroyed)return this;var e,n=this,i=this.options,o=this.cache,a=this.elements,s=i.content.text,u=i.content.title,l=i.content.button,c=i.position,f=("."+this._id+" ",[]);return r.attr(this.target[0],"aria-describedby",this._id),o.posClass=this._createPosClass((this.position={my:c.my,at:c.at}).my),this.tooltip=a.tooltip=e=r("
",{id:this._id,"class":[j,W,i.style.classes,o.posClass].join(" "),width:i.style.width||"",height:i.style.height||"",tracking:"mouse"===c.target&&c.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":_,"aria-describedby":this._id+"-content","aria-hidden":k}).toggleClass(V,this.disabled).attr(L,this.id).data(j,this).appendTo(c.container).append(a.content=r("
",{"class":j+"-content",id:this._id+"-content","aria-atomic":k})),this.rendered=-1,this.positioning=k,u&&(this._createTitle(),r.isFunction(u)||f.push(this._updateTitle(u,_))),l&&this._createButton(),r.isFunction(s)||f.push(this._updateContent(s,_)),this.rendered=k,this._setWidget(),r.each(O,function(t){var e;"render"===this.initialize&&(e=this(n))&&(n.plugins[t]=e)}),this._unassignEvents(),this._assignEvents(),this._when(f).then(function(){n._trigger("render"),n.positioning=_,n.hiddenDuringWait||!i.show.ready&&!t||n.toggle(k,o.event,_),n.hiddenDuringWait=_}),y.api[this.id]=this,this},b.destroy=function(t){function e(){if(!this.destroyed){this.destroyed=k;var t,e=this.target,n=e.attr(U);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),r.each(this.plugins,function(t){this.destroy&&this.destroy()});for(t in this.timers)clearTimeout(this.timers[t]);e.removeData(j).removeAttr(L).removeAttr(I).removeAttr("aria-describedby"),this.options.suppress&&n&&e.attr("title",n).removeAttr(U),this._unassignEvents(),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=M,delete y.api[this.id]}}return this.destroyed?this.target:(t===k&&"hide"!==this.triggering||!this.rendered?e.call(this):(this.tooltip.one("tooltiphidden",r.proxy(e,this)),!this.triggering&&this.hide()),this.target)},w=b.checks={builtin:{"^id$":function(t,e,n,i){var o=n===k?y.nextid:n,a=j+"-"+o;o!==_&&o.length>0&&!r("#"+a).length?(this._id=a,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):t[e]=i},"^prerender":function(t,e,n){n&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(t,e,n){this._updateContent(n)},"^content.attr$":function(t,e,n,r){this.options.content.text===this.target.attr(r)&&this._updateContent(this.target.attr(n))},"^content.title$":function(t,e,n){return n?(n&&!this.elements.title&&this._createTitle(),void this._updateTitle(n)):this._removeTitle()},"^content.button$":function(t,e,n){this._updateButton(n)},"^content.title.(text|button)$":function(t,e,n){this.set("content."+e,n)},"^position.(my|at)$":function(t,e,n){"string"==typeof n&&(this.position[e]=t[e]=new x(n,"at"===e))},"^position.container$":function(t,e,n){this.rendered&&this.tooltip.appendTo(n)},"^show.ready$":function(t,e,n){n&&(!this.rendered&&this.render(k)||this.toggle(k))},"^style.classes$":function(t,e,n,r){this.rendered&&this.tooltip.removeClass(r).addClass(n)},"^style.(width|height)":function(t,e,n){this.rendered&&this.tooltip.css(e,n)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(t,e,n){this.rendered&&this.tooltip.toggleClass(W,!!n)},"^events.(render|show|move|hide|focus|blur)$":function(t,e,n){this.rendered&&this.tooltip[(r.isFunction(n)?"":"un")+"bind"]("tooltip"+e,n)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var t=this.options.position;this.tooltip.attr("tracking","mouse"===t.target&&t.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},b.get=function(t){if(this.destroyed)return this;var e=u(this.options,t.toLowerCase()),n=e[0][e[1]];return n.precedance?n.string():n};var G=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,X=/^prerender|show\.ready/i;b.set=function(t,e){if(this.destroyed)return this;var n,i=this.rendered,o=_,a=this.options;this.checks;return"string"==typeof t?(n=t,t={},t[n]=e):t=r.extend({},t),r.each(t,function(e,n){if(i&&X.test(e))return void delete t[e];var s,l=u(a,e.toLowerCase());s=l[0][l[1]],l[0][l[1]]=n&&n.nodeType?r(n):n,o=G.test(e)||o,t[e]=[l[0],l[1],n,s]}),s(a),this.positioning=k,r.each(t,r.proxy(l,this)),this.positioning=_,this.rendered&&this.tooltip[0].offsetWidth>0&&o&&this.reposition("mouse"===a.position.target?M:this.cache.event),this},b._update=function(t,e,n){var i=this,o=this.cache;return this.rendered&&t?(r.isFunction(t)&&(t=t.call(this.elements.target,o.event,this)||""),r.isFunction(t.then)?(o.waiting=k,t.then(function(t){return o.waiting=_,i._update(t,e)},M,function(t){return i._update(t,e)})):t===_||!t&&""!==t?_:(t.jquery&&t.length>0?e.empty().append(t.css({display:"block",visibility:"visible"})):e.html(t),this._waitForContent(e).then(function(t){i.rendered&&i.tooltip[0].offsetWidth>0&&i.reposition(o.event,!t.length)}))):_},b._waitForContent=function(t){var e=this.cache;return e.waiting=k,(r.fn.imagesLoaded?t.imagesLoaded():r.Deferred().resolve([])).done(function(){e.waiting=_}).promise()},b._updateContent=function(t,e){this._update(t,this.elements.content,e)},b._updateTitle=function(t,e){this._update(t,this.elements.title,e)===_&&this._removeTitle(_)},b._createTitle=function(){var t=this.elements,e=this._id+"-title";t.titlebar&&this._removeTitle(),t.titlebar=r("
",{"class":j+"-titlebar "+(this.options.style.widget?c("header"):"")}).append(t.title=r("
",{id:e,"class":j+"-title","aria-atomic":k})).insertBefore(t.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(t){r(this).toggleClass("ui-state-active ui-state-focus","down"===t.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(t){r(this).toggleClass("ui-state-hover","mouseover"===t.type)}),this.options.content.button&&this._createButton()},b._removeTitle=function(t){var e=this.elements;e.title&&(e.titlebar.remove(),e.titlebar=e.title=e.button=M,t!==_&&this.reposition())},b._createPosClass=function(t){return j+"-pos-"+(t||this.options.position.my).abbrev()},b.reposition=function(n,i){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=k;var o,a,s,u,l=this.cache,c=this.tooltip,f=this.options.position,d=f.target,h=f.my,p=f.at,g=f.viewport,v=f.container,m=f.adjust,y=m.method.split(" "),b=c.outerWidth(_),x=c.outerHeight(_),w=0,$=0,M=c.css("position"),C={left:0,top:0},S=c[0].offsetWidth>0,j=n&&"scroll"===n.type,I=r(t),L=v[0].ownerDocument,P=this.mouse;if(r.isArray(d)&&2===d.length)p={x:A,y:E},C={left:d[0],top:d[1]};else if("mouse"===d)p={x:A,y:E},(!m.mouse||this.options.hide.distance)&&l.origin&&l.origin.pageX?n=l.origin:!n||n&&("resize"===n.type||"scroll"===n.type)?n=l.event:P&&P.pageX&&(n=P),"static"!==M&&(C=v.offset()),L.body.offsetWidth!==(t.innerWidth||L.documentElement.clientWidth)&&(a=r(e.body).offset()),C={left:n.pageX-C.left+(a&&a.left||0),top:n.pageY-C.top+(a&&a.top||0)},m.mouse&&j&&P&&(C.left-=(P.scrollX||0)-I.scrollLeft(),C.top-=(P.scrollY||0)-I.scrollTop());else{if("event"===d?n&&n.target&&"scroll"!==n.type&&"resize"!==n.type?l.target=r(n.target):n.target||(l.target=this.elements.target):"event"!==d&&(l.target=r(d.jquery?d:this.elements.target)),d=l.target,d=r(d).eq(0),0===d.length)return this;d[0]===e||d[0]===t?(w=Y.iOS?t.innerWidth:d.width(),$=Y.iOS?t.innerHeight:d.height(),d[0]===t&&(C={top:(g||d).scrollTop(),left:(g||d).scrollLeft()})):O.imagemap&&d.is("area")?o=O.imagemap(this,d,p,O.viewport?y:_):O.svg&&d&&d[0].ownerSVGElement?o=O.svg(this,d,p,O.viewport?y:_):(w=d.outerWidth(_),$=d.outerHeight(_),C=d.offset()),o&&(w=o.width,$=o.height,a=o.offset,C=o.position),C=this.reposition.offset(d,C,v),(Y.iOS>3.1&&Y.iOS<4.1||Y.iOS>=4.3&&Y.iOS<4.33||!Y.iOS&&"fixed"===M)&&(C.left-=I.scrollLeft(),C.top-=I.scrollTop()),(!o||o&&o.adjustable!==_)&&(C.left+=p.x===N?w:p.x===D?w/2:0,C.top+=p.y===T?$:p.y===D?$/2:0)}return C.left+=m.x+(h.x===N?-b:h.x===D?-b/2:0),C.top+=m.y+(h.y===T?-x:h.y===D?-x/2:0),O.viewport?(s=C.adjusted=O.viewport(this,C,f,w,$,b,x),a&&s.left&&(C.left+=a.left),a&&s.top&&(C.top+=a.top),s.my&&(this.position.my=s.my)):C.adjusted={left:0,top:0},l.posClass!==(u=this._createPosClass(this.position.my))&&c.removeClass(l.posClass).addClass(l.posClass=u),this._trigger("move",[C,g.elem||g],n)?(delete C.adjusted,i===_||!S||isNaN(C.left)||isNaN(C.top)||"mouse"===d||!r.isFunction(f.effect)?c.css(C):r.isFunction(f.effect)&&(f.effect.call(c,this,r.extend({},C)),c.queue(function(t){r(this).css({opacity:"",height:""}),Y.ie&&this.style.removeAttribute("filter"),t()})),this.positioning=_,this):this},b.reposition.offset=function(t,n,i){function o(t,e){n.left+=e*t.scrollLeft(),n.top+=e*t.scrollTop()}if(!i[0])return n;var a,s,u,l,c=r(t[0].ownerDocument),f=!!Y.ie&&"CSS1Compat"!==e.compatMode,d=i[0];do"static"!==(s=r.css(d,"position"))&&("fixed"===s?(u=d.getBoundingClientRect(),o(c,-1)):(u=r(d).position(),u.left+=parseFloat(r.css(d,"borderLeftWidth"))||0,u.top+=parseFloat(r.css(d,"borderTopWidth"))||0),n.left-=u.left+(parseFloat(r.css(d,"marginLeft"))||0),n.top-=u.top+(parseFloat(r.css(d,"marginTop"))||0),a||"hidden"===(l=r.css(d,"overflow"))||"visible"===l||(a=r(d)));while(d=d.offsetParent);return a&&(a[0]!==c[0]||f)&&o(a,1),n};var Z=(x=b.reposition.Corner=function(t,e){t=(""+t).replace(/([A-Z])/," $1").replace(/middle/gi,D).toLowerCase(),this.x=(t.match(/left|right/i)||t.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(t.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!e;var n=t.charAt(0);this.precedance="t"===n||"b"===n?S:C}).prototype;Z.invert=function(t,e){this[t]=this[t]===A?N:this[t]===N?A:e||this[t]},Z.string=function(t){var e=this.x,n=this.y,r=e!==n?"center"===e||"center"!==n&&(this.precedance===S||this.forceY)?[n,e]:[e,n]:[e];return t!==!1?r.join(" "):r},Z.abbrev=function(){var t=this.string(!1);return t[0].charAt(0)+(t[1]&&t[1].charAt(0)||"")},Z.clone=function(){return new x(this.string(),this.forceY)},b.toggle=function(t,n){var i=this.cache,o=this.options,a=this.tooltip;if(n){if(/over|enter/.test(n.type)&&i.event&&/out|leave/.test(i.event.type)&&o.show.target.add(n.target).length===o.show.target.length&&a.has(n.relatedTarget).length)return this;i.event=r.event.fix(n)}if(this.waiting&&!t&&(this.hiddenDuringWait=k),!this.rendered)return t?this.render(1):this;if(this.destroyed||this.disabled)return this;var s,u,l,c=t?"show":"hide",f=this.options[c],d=(this.options[t?"hide":"show"],this.options.position),h=this.options.content,p=this.tooltip.css("width"),g=this.tooltip.is(":visible"),v=t||1===f.target.length,m=!n||f.target.length<2||i.target[0]===n.target;return(typeof t).search("boolean|number")&&(t=!g),s=!a.is(":animated")&&g===t&&m,u=s?M:!!this._trigger(c,[90]),this.destroyed?this:(u!==_&&t&&this.focus(n),!u||s?this:(r.attr(a[0],"aria-hidden",!t),t?(this.mouse&&(i.origin=r.event.fix(this.mouse)),r.isFunction(h.text)&&this._updateContent(h.text,_),r.isFunction(h.title)&&this._updateTitle(h.title,_),!$&&"mouse"===d.target&&d.adjust.mouse&&(r(e).bind("mousemove."+j,this._storeMouse),$=k),p||a.css("width",a.outerWidth(_)),this.reposition(n,arguments[2]),p||a.css("width",""),f.solo&&("string"==typeof f.solo?r(f.solo):r(F,f.solo)).not(a).not(f.target).qtip("hide",r.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete i.origin,$&&!r(F+'[tracking="true"]:visible',f.solo).not(a).length&&(r(e).unbind("mousemove."+j),$=_),this.blur(n)),l=r.proxy(function(){t?(Y.ie&&a[0].style.removeAttribute("filter"),a.css("overflow",""),"string"==typeof f.autofocus&&r(this.options.show.autofocus,a).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):a.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(t?"visible":"hidden")},this),f.effect===_||v===_?(a[c](),l()):r.isFunction(f.effect)?(a.stop(1,1),f.effect.call(a,this),a.queue("fx",function(t){l(),t()})):a.fadeTo(90,t?1:0,l),t&&f.target.trigger("qtip-"+this.id+"-inactive"),this))},b.show=function(t){return this.toggle(k,t)},b.hide=function(t){return this.toggle(_,t)},b.focus=function(t){if(!this.rendered||this.destroyed)return this;var e=r(F),n=this.tooltip,i=parseInt(n[0].style.zIndex,10),o=y.zindex+e.length;return n.hasClass(R)||this._trigger("focus",[o],t)&&(i!==o&&(e.each(function(){this.style.zIndex>i&&(this.style.zIndex=this.style.zIndex-1)}),e.filter("."+R).qtip("blur",t)),n.addClass(R)[0].style.zIndex=o),this},b.blur=function(t){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(R),this._trigger("blur",[this.tooltip.css("zIndex")],t),this)},b.disable=function(t){return this.destroyed?this:("toggle"===t?t=!(this.rendered?this.tooltip.hasClass(V):this.disabled):"boolean"!=typeof t&&(t=k),this.rendered&&this.tooltip.toggleClass(V,t).attr("aria-disabled",t),this.disabled=!!t,this)},b.enable=function(){return this.disable(_)},b._createButton=function(){var t=this,e=this.elements,n=e.tooltip,i=this.options.content.button,o="string"==typeof i,a=o?i:"Close tooltip";e.button&&e.button.remove(),i.jquery?e.button=i:e.button=r("",{"class":"qtip-close "+(this.options.style.widget?"":j+"-icon"),title:a,"aria-label":a}).prepend(r("",{"class":"ui-icon ui-icon-close",html:"×"})),e.button.appendTo(e.titlebar||n).attr("role","button").click(function(e){return n.hasClass(V)||t.hide(e),_})},b._updateButton=function(t){if(!this.rendered)return _;var e=this.elements.button;t?this._createButton():e.remove()},b._setWidget=function(){var t=this.options.style.widget,e=this.elements,n=e.tooltip,r=n.hasClass(V);n.removeClass(V),V=t?"ui-state-disabled":"qtip-disabled",n.toggleClass(V,r),n.toggleClass("ui-helper-reset "+c(),t).toggleClass(W,this.options.style.def&&!t),e.content&&e.content.toggleClass(c("content"),t),e.titlebar&&e.titlebar.toggleClass(c("header"),t),e.button&&e.button.toggleClass(j+"-icon",!t)},b._storeMouse=function(t){return(this.mouse=r.event.fix(t)).type="mousemove",this},b._bind=function(t,e,n,i,o){if(t&&n&&e.length){var a="."+this._id+(i?"-"+i:"");return r(t).bind((e.split?e:e.join(a+" "))+a,r.proxy(n,o||this)),this}},b._unbind=function(t,e){return t&&r(t).unbind("."+this._id+(e?"-"+e:"")),this},b._trigger=function(t,e,n){var i=r.Event("tooltip"+t);return i.originalEvent=n&&r.extend({},n)||this.cache.event||M,this.triggering=t,this.tooltip.trigger(i,[this].concat(e||[])),this.triggering=_,!i.isDefaultPrevented()},b._bindEvents=function(t,e,n,i,o,a){var s=n.filter(i).add(i.filter(n)),u=[];s.length&&(r.each(e,function(e,n){var i=r.inArray(n,t);i>-1&&u.push(t.splice(i,1)[0])}),u.length&&(this._bind(s,u,function(t){var e=!!this.rendered&&this.tooltip[0].offsetWidth>0;(e?a:o).call(this,t)}),n=n.not(s),i=i.not(s))),this._bind(n,t,o),this._bind(i,e,a)},b._assignInitialEvents=function(t){function e(t){return this.disabled||this.destroyed?_:(this.cache.event=t&&r.event.fix(t),this.cache.target=t&&r(t.target),clearTimeout(this.timers.show),void(this.timers.show=f.call(this,function(){this.render("object"==typeof t||n.show.ready)},n.prerender?0:n.show.delay)))}var n=this.options,i=n.show.target,o=n.hide.target,a=n.show.event?r.trim(""+n.show.event).split(" "):[],s=n.hide.event?r.trim(""+n.hide.event).split(" "):[];this._bind(this.elements.target,["remove","removeqtip"],function(t){this.destroy(!0)},"destroy"),/mouse(over|enter)/i.test(n.show.event)&&!/mouse(out|leave)/i.test(n.hide.event)&&s.push("mouseleave"),this._bind(i,"mousemove",function(t){this._storeMouse(t),this.cache.onTarget=k}),this._bindEvents(a,s,i,o,e,function(){return this.timers?void clearTimeout(this.timers.show):_}),(n.show.ready||n.prerender)&&e.call(this,t)},b._assignEvents=function(){var n=this,i=this.options,o=i.position,a=this.tooltip,s=i.show.target,u=i.hide.target,l=o.container,c=o.viewport,f=r(e),v=(r(e.body),r(t)),m=i.show.event?r.trim(""+i.show.event).split(" "):[],b=i.hide.event?r.trim(""+i.hide.event).split(" "):[];r.each(i.events,function(t,e){n._bind(a,"toggle"===t?["tooltipshow","tooltiphide"]:["tooltip"+t],e,null,a)}),/mouse(out|leave)/i.test(i.hide.event)&&"window"===i.hide.leave&&this._bind(f,["mouseout","blur"],function(t){/select|option/.test(t.target.nodeName)||t.relatedTarget||this.hide(t)}),i.hide.fixed?u=u.add(a.addClass(z)):/mouse(over|enter)/i.test(i.show.event)&&this._bind(u,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+i.hide.event).indexOf("unfocus")>-1&&this._bind(l.closest("html"),["mousedown","touchstart"],function(t){var e=r(t.target),n=this.rendered&&!this.tooltip.hasClass(V)&&this.tooltip[0].offsetWidth>0,i=e.parents(F).filter(this.tooltip[0]).length>0;e[0]===this.target[0]||e[0]===this.tooltip[0]||i||this.target.has(e[0]).length||!n||this.hide(t)}),"number"==typeof i.hide.inactive&&(this._bind(s,"qtip-"+this.id+"-inactive",p,"inactive"),this._bind(u.add(a),y.inactiveEvents,p)),this._bindEvents(m,b,s,u,d,h),this._bind(s.add(a),"mousemove",function(t){if("number"==typeof i.hide.distance){var e=this.cache.origin||{},n=this.options.hide.distance,r=Math.abs;(r(t.pageX-e.pageX)>=n||r(t.pageY-e.pageY)>=n)&&this.hide(t)}this._storeMouse(t)}),"mouse"===o.target&&o.adjust.mouse&&(i.hide.event&&this._bind(s,["mouseenter","mouseleave"],function(t){return this.cache?void(this.cache.onTarget="mouseenter"===t.type):_}),this._bind(f,"mousemove",function(t){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(V)&&this.tooltip[0].offsetWidth>0&&this.reposition(t)})),(o.adjust.resize||c.length)&&this._bind(r.event.special.resize?c:v,"resize",g),o.adjust.scroll&&this._bind(v.add(o.container),"scroll",g)},b._unassignEvents=function(){var n=this.options,i=n.show.target,o=n.hide.target,a=r.grep([this.elements.target[0],this.rendered&&this.tooltip[0],n.position.container[0],n.position.viewport[0],n.position.container.closest("html")[0],t,e],function(t){return"object"==typeof t});i&&i.toArray&&(a=a.concat(i.toArray())),o&&o.toArray&&(a=a.concat(o.toArray())),this._unbind(a)._unbind(a,"destroy")._unbind(a,"inactive")},r(function(){v(F,["mouseenter","mouseleave"],function(t){var e="mouseenter"===t.type,n=r(t.currentTarget),i=r(t.relatedTarget||t.target),o=this.options;e?(this.focus(t),n.hasClass(z)&&!n.hasClass(V)&&clearTimeout(this.timers.hide)):"mouse"===o.position.target&&o.position.adjust.mouse&&o.hide.event&&o.show.target&&!i.closest(o.show.target[0]).length&&this.hide(t),n.toggleClass(B,e)}),v("["+L+"]",q,p)}),y=r.fn.qtip=function(t,e,i){var o=(""+t).toLowerCase(),a=M,u=r.makeArray(arguments).slice(1),l=u[u.length-1],c=this[0]?r.data(this[0],j):M;return!arguments.length&&c||"api"===o?c:"string"==typeof t?(this.each(function(){var t=r.data(this,j);if(!t)return k;if(l&&l.timeStamp&&(t.cache.event=l),!e||"option"!==o&&"options"!==o)t[o]&&t[o].apply(t,u);else{if(i===n&&!r.isPlainObject(e))return a=t.get(e),_;t.set(e,i)}}),a!==M?a:this):"object"!=typeof t&&arguments.length?void 0:(c=s(r.extend(k,{},t)),this.each(function(t){var e,n;return n=r.isArray(c.id)?c.id[t]:c.id,n=!n||n===_||n.length<1||y.api[n]?y.nextid++:n,e=m(r(this),n,c),e===_?k:(y.api[n]=e,r.each(O,function(){"initialize"===this.initialize&&this(e)}),void e._assignInitialEvents(l))}))},r.qtip=i,y.api={},r.each({attr:function(t,e){if(this.length){var n=this[0],i="title",o=r.data(n,"qtip");if(t===i&&o&&"object"==typeof o&&o.options.suppress)return arguments.length<2?r.attr(n,U):(o&&o.options.content.attr===i&&o.cache.attr&&o.set("content.text",e),this.attr(U,e))}return r.fn["attr"+H].apply(this,arguments)},clone:function(t){var e=(r([]),r.fn["clone"+H].apply(this,arguments));return t||e.filter("["+U+"]").attr("title",function(){return r.attr(this,U)}).removeAttr(U),e}},function(t,e){if(!e||r.fn[t+H])return k;var n=r.fn[t+H]=r.fn[t];r.fn[t]=function(){return e.apply(this,arguments)||n.apply(this,arguments)}}),r.ui||(r["cleanData"+H]=r.cleanData,r.cleanData=function(t){for(var e,n=0;(e=r(t[n])).length;n++)if(e.attr(I))try{e.triggerHandler("removeqtip")}catch(i){}r["cleanData"+H].apply(this,arguments)}),y.version="2.2.1",y.nextid=0,y.inactiveEvents=q,y.zindex=15e3,y.defaults={prerender:_,id:_,overwrite:k,suppress:k,content:{text:k,attr:"title",title:_,button:_},position:{my:"top left",at:"bottom right",target:_,container:_,viewport:_,adjust:{x:0,y:0,mouse:k,scroll:k,resize:k,method:"flipinvert flipinvert"},effect:function(t,e,n){r(this).animate(e,{duration:200,queue:_})}},show:{target:_,event:"mouseenter",effect:k,delay:90,solo:_,ready:_,autofocus:_},hide:{target:_,event:"mouseleave",effect:k,delay:0,fixed:_,inactive:_,leave:"window",distance:_},style:{classes:"",widget:_,width:_,height:_,def:k},events:{render:M,move:M,show:M,hide:M,toggle:M,visible:M,hidden:M,focus:M,blur:M}}})}(window,document),function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.dagreD3=t()}}(function(){return function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a0}e.exports=r},{}],14:[function(t,e,n){function r(t,e){return t.intersect(e)}e.exports=r},{}],15:[function(t,e,n){function r(t,e,n){var r=t.x,o=t.y,a=[],s=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY;e.forEach(function(t){s=Math.min(s,t.x),u=Math.min(u,t.y)});for(var l=r-t.width/2-s,c=o-t.height/2-u,f=0;f1&&a.sort(function(t,e){var r=t.x-n.x,i=t.y-n.y,o=Math.sqrt(r*r+i*i),a=e.x-n.x,s=e.y-n.y,u=Math.sqrt(a*a+s*s);return oMath.abs(a)*l?(s<0&&(l=-l),n=0===s?0:l*a/s,r=l):(a<0&&(u=-u),n=u,r=0===a?0:u*s/a),{x:i+n,y:o+r}}e.exports=r},{}],17:[function(t,e,n){function r(t,e){var n=t.append("foreignObject").attr("width","100000"),r=n.append("xhtml:div");r.attr("xmlns","http://www.w3.org/1999/xhtml");var o=e.label;switch(typeof o){case"function":r.insert(o);break;case"object":r.insert(function(){return o});break;default:r.html(o)}i.applyStyle(r,e.labelStyle),r.style("display","inline-block"),r.style("white-space","nowrap");var a=r[0][0].getBoundingClientRect();return n.attr("width",a.width).attr("height",a.height),n}var i=t("../util");e.exports=r},{"../util":27}],18:[function(t,e,n){function r(t,e,n){var r=e.label,s=t.append("g");"svg"===e.labelType?a(s,e):"string"!=typeof r||"html"===e.labelType?o(s,e):i(s,e);var u,l=s.node().getBBox();switch(n){case"top":u=-e.height/2;break;case"bottom":u=e.height/2-l.height;break;default:u=-l.height/2}return s.attr("transform","translate("+-l.width/2+","+u+")"),s}var i=t("./add-text-label"),o=t("./add-html-label"),a=t("./add-svg-label");e.exports=r},{"./add-html-label":17,"./add-svg-label":19,"./add-text-label":20}],19:[function(t,e,n){function r(t,e){var n=t;return n.node().appendChild(e.label),i.applyStyle(n,e.labelStyle),n}var i=t("../util");e.exports=r},{"../util":27}],20:[function(t,e,n){function r(t,e){for(var n=t.append("text"),r=i(e.label).split("\n"),a=0;a5?n-5:n}function P(){if(c||z.attr("height"))c?z.attr("height",c):c=z.attr("height");else{if(!_)throw"height of the timeline is not set";c=K.height+K.top-q.top,d3.select(t[0][0]).attr("height",c)}}function F(){if(l||q.width){if(!l||!q.width)try{l=z.attr("width")}catch(t){console.log(t)}}else try{if(l=z.attr("width"),!l)throw"width of the timeline is not set. As of Firefox 27, timeline().with(x) needs to be explicitly set in order to render"}catch(t){console.log(t)}}var q=t[0][0].getBoundingClientRect(),z=d3.select(t[0][0]),W={},R=1,B=0,V=0;F();var H=(t.append("svg:clipPath").attr("id",D+"-gclip").append("svg:rect").attr("clipPathUnits","objectBoundingBox").attr("x",b.left).attr("y",b.top).attr("width",l-b.left-b.right).attr("height",1e3),t.append("g").attr("clip-path","url(#"+D+"-gclip)"));k&&H.each(function(t,e){t.forEach(function(t,e){t.times.forEach(function(t,n){0===e&&0===n?(originTime=t.starting_time,t.starting_time=0,t.ending_time=t.ending_time-originTime):(t.starting_time=t.starting_time-originTime,t.ending_time=t.ending_time-originTime)})})}),(x||0===y||0===m)&&(H.each(function(t,e){t.forEach(function(t,e){x&&Object.keys(W).indexOf(e)==-1&&(W[e]=R,R++),t.times.forEach(function(t,e){0===m&&(t.starting_timeV&&(V=t.ending_time)})})}),0===y&&(y=V),0===m&&(m=B));var U=d3.time.scale().domain([m,y]).range([b.left,l-b.right]),Y=d3.svg.axis().scale(U).orient(u).tickFormat(h.format).ticks(h.numTicks||h.tickTime,h.tickInterval).tickSize(h.tickSize);if(T)var G=d3.svg.axis().scale(U).orient(u).tickFormat(d3.time.format("%X")).ticks(h.numTicks||h.tickTime,h.tickInterval).tickSize(0);if(C){var X=b.top+(_+M)*R;H.append("g").attr("class","axis").attr("transform","translate(0,"+X+")").call(Y),T&&H.append("g").attr("class","axis-hour").attr("transform","translate(0,"+(X+20)+")").call(G)}S&&H.append("g").attr("class","axis axis-tick").attr("transform","translate(0,"+(b.top+(_+M)*R)+")").attr(E.stroke,E.spacing).call(Y.tickFormat("").tickSize(-(b.top+(_+M)*(R-1)+3),0,0)),H.each(function(a,u){a.forEach(function(a,c){function h(t,e){return x?b.top+(_+M)*W[c]:b.top}function m(t,e){return x?b.top+(_+M)*W[c]+.65*_:b.top+.65*_}function y(t,e){return x?b.top+(_+M)*W[c]+_-3:b.top+_-3}var w=a.times,k="undefined"!=typeof a.label,C=function(t){return null==s?t:s(t)};if("undefined"!=typeof a.id&&console.warn("d3Timeline Warning: Ids per dataset is deprecated in favor of a 'class' key. Ids are now per data element."),d){var S=(_+M)*W[c];H.selectAll("svg").data(w).enter().insert("rect").attr("class","row-green-bar").attr("x",0+b.left).attr("width",l-b.right-b.left).attr("y",S).attr("height",_).attr("fill",d)}var E=H.selectAll("svg").data(w).enter().append("g").attr("class",function(t,e){return"bar-container bar-type-"+t.type}).attr("width",I);"scheduled"!=w[0].type&&E.append("svg:clipPath").attr("id",D+"-timeline-textclip-"+u+"-"+c).attr("class","timeline-clip").append("svg:rect").attr("clipPathUnits","objectBoundingBox").attr("x",O).attr("y",h).attr("width",L).attr("height",_);var T=E.append(function(t,e){return document.createElementNS(d3.ns.prefix.svg,"display"in t?t.display:v)}).attr("x",O).attr("y",h).attr("rx",5).attr("ry",5).attr("width",I).attr("cy",function(t,e){return h(t,e)+_/2}).attr("cx",O).attr("r",_/2).attr("height",_).style("stroke",function(t,e){return t.borderColor}).style("stroke-width",1).style("fill",function(t,e){var n;return t.color?t.color:g?(n=t[g],p(n?n:a[g])):p(c)}).on("mousemove",function(t,e){n(t,c,a)}).on("mouseover",function(t,e){r(t,e,a)}).on("mouseout",function(t,e){i(t,e,a)}).on("click",function(t,e){o(t,c,a)}).attr("class",function(t,e){return a["class"]?"timeline-series timelineSeries_"+a["class"]:"timeline-series timelineSeries_"+c}).attr("id",function(t,e){return a.id&&!t.id?"timelineItem_"+a.id:t.id?t.id:"timelineItem_"+c+"_"+e}),P=E.append("text").attr("class","timeline-insidelabel").attr("x",j).attr("y",m).attr("height",_).attr("clip-path","url(#"+D+"-timeline-textclip-"+u+"-"+c+")").text(function(t){return t.label}).on("click",function(t,e){o(t,c,a)});if("scheduled"==w[0].type&&T.attr("width",P.node().getComputedTextLength()+10),H.selectAll("svg .bar-container").each(function(t,e){$(this).qtip({content:{text:t.label},position:{my:"bottom left",at:"top left"},style:{classes:"qtip-light qtip-timeline-bar"}})}),f){var F=_+M/2+b.top+(_+M)*W[c];t.append("svg:line").attr("class","row-seperator").attr("x1",0+b.left).attr("x2",l-b.right).attr("y1",F).attr("y2",F).attr("stroke-width",1).attr("stroke",f)}A&&"scheduled"==w[0].type&&H.selectAll("svg").data(w).enter().append("svg:line").attr("class","line-start").attr("x1",e).attr("y1",y).attr("x2",e).attr("y2",b.top+(_+M)*R).style("stroke",function(t,e){return t.color}).style("stroke-width",N.width),k&&t.append("text").attr("class","timeline-label").attr("transform","translate(0,"+(.75*_+b.top+(_+M)*W[c])+")").text(k?C(a.label):a.id).on("click",function(t,e){o(t,c,a)}),"undefined"!=typeof a.icon&&t.append("image").attr("class","timeline-label").attr("transform","translate(0,"+(b.top+(_+M)*W[c])+")").attr("xlink:href",a.icon).attr("width",b.left).attr("height",_)})});var Z=function(){$(".qtip.qtip-timeline-bar").qtip("hide"),H.selectAll(".bar-type-scheduled .timeline-series").attr("x",O),H.selectAll(".bar-type-regular .timeline-series").attr("x",O).attr("width",I),H.selectAll(".timeline-insidelabel").attr("x",j),H.selectAll(".bar-type-scheduled .timeline-clip").select("rect").attr("x",O),H.selectAll(".bar-type-regular .timeline-clip").select("rect").attr("x",O).attr("width",L),H.selectAll("g.axis").call(Y),T&&H.selectAll("g.axis-hour").call(G),A&&(H.selectAll("line.line-start").attr("x1",e).attr("x2",e),H.selectAll("line.line-end").attr("x1",a).attr("x2",a))},Q=d3.behavior.zoom().x(U).on("zoom",Z);t.call(Q),w&&H.selectAll(".tick text").attr("transform",function(t){return"rotate("+w+")translate("+(this.getBBox().width/2+10)+","+this.getBBox().height/2+")"});var K=H[0][0].getBoundingClientRect();P(),bbox=H[0][0].getBBox(),t.attr("height",bbox.height+40)}var e=["circle","rect"],n=function(){},r=function(){},i=function(){},o=function(){},a=function(){},s=function(){},u="bottom",l=null,c=null,f=null,d=null,h={format:d3.time.format("%I %p"),tickTime:d3.time.hours,tickInterval:1,tickSize:6},p=d3.scale.category20(),g=null,v="rect",m=0,y=0,b={left:30,right:30,top:30,bottom:30},x=!1,w=!1,k=!1,_=20,M=5,C=!0,S=!1,E={stroke:"stroke-dasharray",spacing:"4 10"},A=!1,T=!1,N={marginTop:25,marginBottom:0,width:1,color:p},D="timeline";return t.margin=function(e){return arguments.length?(b=e,t):b},t.orient=function(e){return arguments.length?(u=e,t):u},t.itemHeight=function(e){return arguments.length?(_=e,t):_},t.itemMargin=function(e){return arguments.length?(M=e,t):M},t.height=function(e){return arguments.length?(c=e,t):c},t.width=function(e){return arguments.length?(l=e,t):l},t.display=function(n){return arguments.length&&e.indexOf(n)!=-1?(v=n,t):v},t.labelFormat=function(e){return arguments.length?(s=e,t):null},t.tickFormat=function(e){return arguments.length?(h=e,t):h},t.prefix=function(e){return arguments.length?(D=e,t):D},t.hover=function(e){return arguments.length?(n=e,t):n},t.mouseover=function(e){return arguments.length?(r=e,t):e},t.mouseout=function(e){return arguments.length?(i=e,t):e},t.click=function(e){return arguments.length?(o=e,t):o},t.scroll=function(e){return arguments.length?(a=e,t):a},t.colors=function(e){return arguments.length?(p=e,t):p},t.beginning=function(e){return arguments.length?(m=e,t):m},t.ending=function(e){return arguments.length?(y=e,t):y},t.rotateTicks=function(e){return w=e,t},t.stack=function(){return x=!x,t},t.relativeTime=function(){return k=!k,t},t.showBorderLine=function(){return A=!A,t},t.showHourTimeline=function(){return T=!T,t},t.showBorderFormat=function(e){return arguments.length?(N=e,t):N},t.colorProperty=function(e){return arguments.length?(g=e,t):g},t.rowSeperators=function(e){return arguments.length?(f=e,t):f},t.background=function(e){return arguments.length?(d=e,t):d},t.showTimeAxis=function(){return C=!C,t},t.showTimeAxisTick=function(){return S=!S,t},t.showTimeAxisTickFormat=function(e){return arguments.length?(E=e,t):E},t}}(); \ No newline at end of file diff --git a/flink-runtime-web/web-dashboard/web/partials/jobs/job.plan.node-list.metrics.html b/flink-runtime-web/web-dashboard/web/partials/jobs/job.plan.node-list.metrics.html index 26a1e65de37599fed820c7ce159b9d1b6d0cb630..daaf7c4269120a7adc6fe37825629b7e5e1d444b 100644 --- a/flink-runtime-web/web-dashboard/web/partials/jobs/job.plan.node-list.metrics.html +++ b/flink-runtime-web/web-dashboard/web/partials/jobs/job.plan.node-list.metrics.html @@ -39,7 +39,7 @@ limitations under the License.
  • - +
\ No newline at end of file